1 #ifndef __COMPACT_3D_LOOKUP_H__
2 #define __COMPACT_3D_LOOKUP_H__
31 #include "CompactLookup.h"
42 T&
at(
const int64_t& index1,
const int64_t& index2,
const int64_t& index3);
44 T&
at(
const int64_t index[3]) {
return at(index[0], index[1], index[2]); }
46 void insert(
const int64_t& index1,
const int64_t& index2,
const int64_t& index3,
const T& value)
47 {
at(index1, index2, index3) = value; }
49 void insert(
const int64_t index[3],
const T& value)
50 {
at(index) = value; }
52 T*
find(
const int64_t& index1,
const int64_t& index2,
const int64_t& index3);
54 T*
find(
const int64_t index[3]) {
return find(index[0], index[1], index[2]); }
56 const T*
find(
const int64_t& index1,
const int64_t& index2,
const int64_t& index3)
const;
58 const T*
find(
const int64_t index[3])
const {
return find(index[0], index[1], index[2]); }
66 return m_lookup[index3][index2][index1];
73 if (iter1 == m_lookup.end())
return NULL;
75 if (iter2 == iter1->end())
return NULL;
77 if (iter3 == iter2->end())
return NULL;
85 if (iter1 == m_lookup.end())
return NULL;
87 if (iter2 == iter1->end())
return NULL;
89 if (iter3 == iter2->end())
return NULL;
Definition: Compact3DLookup.h:38
void clear()
empties the lookup
Definition: Compact3DLookup.h:94
T & at(const int64_t &index1, const int64_t &index2, const int64_t &index3)
creates the element if it didn't exist, and returns a reference to it
Definition: Compact3DLookup.h:64
T & at(const int64_t index[3])
creates the element if it didn't exist, and returns a reference to it
Definition: Compact3DLookup.h:44
const T * find(const int64_t index[3]) const
returns a pointer to the desired element, or NULL if no such element is found
Definition: Compact3DLookup.h:58
void insert(const int64_t &index1, const int64_t &index2, const int64_t &index3, const T &value)
add or overwrite an element in the lookup
Definition: Compact3DLookup.h:46
const T * find(const int64_t &index1, const int64_t &index2, const int64_t &index3) const
returns a pointer to the desired element, or NULL if no such element is found
Definition: Compact3DLookup.h:82
T * find(const int64_t &index1, const int64_t &index2, const int64_t &index3)
returns a pointer to the desired element, or NULL if no such element is found
Definition: Compact3DLookup.h:70
T * find(const int64_t index[3])
returns a pointer to the desired element, or NULL if no such element is found
Definition: Compact3DLookup.h:54
void insert(const int64_t index[3], const T &value)
add or overwrite an element in the lookup
Definition: Compact3DLookup.h:49
Definition: CompactLookup.h:77
Definition: CompactLookup.h:49
Definition: CompactLookup.h:40
iterator find(const int64_t &index)
returns an iterator pointing to the desired element, or one equal to end() if no such element is foun...
Definition: CompactLookup.h:169
namespace for all CiftiLib functionality
Definition: CiftiBrainModelsMap.h:42