18 #define fei_file "fei_ConnectivityBlock.cpp"
24 int numConnectivities)
31 connectivityOffsets_(),
32 numRecordsPerConnectivity_(pattern->getNumIDs()),
33 connectivities_(pattern->getNumIDs()*numConnectivities),
34 numRecordsPerColConnectivity_(0),
45 int numConnectivities)
48 colPattern_(colpattern),
52 connectivityOffsets_(),
53 numRecordsPerConnectivity_(rowpattern->getNumIDs()),
54 connectivities_(rowpattern->getNumIDs()*numConnectivities),
55 numRecordsPerColConnectivity_(colpattern->getNumIDs()),
56 colConnectivities_(colpattern->getNumIDs()*numConnectivities),
65 const int* rowOffsets,
66 bool offsets_are_lengths)
73 connectivityOffsets_(),
74 numRecordsPerConnectivity_(0),
76 numRecordsPerColConnectivity_(0),
85 if (offsets_are_lengths) {
87 for(
int ii=0; ii<numRowIDs; ++ii) {
88 sum += rowOffsets[ii];
92 else clen = rowOffsets[numRowIDs];
97 if (offsets_are_lengths) {
99 for(i=0; i<numRowIDs; ++i) {
102 offset += rowOffsets[i];
107 for(i=0; i<numRowIDs; ++i) {
119 const int* rowOffsets,
120 bool offsets_are_lengths)
127 connectivityOffsets_(),
128 numRecordsPerConnectivity_(0),
130 numRecordsPerColConnectivity_(0),
131 colConnectivities_(),
139 if (offsets_are_lengths) {
141 for(
int ii=0; ii<numRowIDs; ++ii) {
142 sum += rowOffsets[ii];
146 else clen = rowOffsets[numRowIDs];
151 if (offsets_are_lengths) {
153 for(i=0; i<numRowIDs; ++i) {
156 offset += rowOffsets[i];
161 for(i=0; i<numRowIDs+1; ++i) {
177 std::map<int,int>::const_iterator
178 iter = connIDsOffsetMap_.find(ID);
179 if (iter == connIDsOffsetMap_.end()) {
183 int ind = iter->second;
184 const int* ptr = &connectivities_[0];
185 return( ptr + ind*numRecordsPerConnectivity_);
191 std::map<int,int>::const_iterator
192 iter = connIDsOffsetMap_.find(ID);
193 if (iter == connIDsOffsetMap_.end()) {
197 int ind = iter->second;
198 int* ptr = &connectivities_[0];
199 return( ptr + ind*numRecordsPerConnectivity_);
205 std::map<int,int>::const_iterator
206 iter = connIDsOffsetMap_.find(ID);
207 if (iter == connIDsOffsetMap_.end()) {
211 int ind = iter->second;
212 const int* ptr = &colConnectivities_[0];
213 return(ptr+ind*numRecordsPerColConnectivity_);
219 std::map<int,int>::const_iterator
220 iter = connIDsOffsetMap_.find(ID);
221 if (iter == connIDsOffsetMap_.end()) {
225 int ind = iter->second;
226 int* ptr = &colConnectivities_[0];
227 return(ptr+ind*numRecordsPerColConnectivity_);
const int * getRowConnectivity(int ID) const
virtual ~ConnectivityBlock()
std::vector< int > colConnectivities_
std::vector< int > connectivityOffsets_
ConnectivityBlock(int blockID, fei::Pattern *pattern, int numConnectivities)
std::vector< int > connectivities_
const int * getColConnectivity(int ID) const
std::map< int, int > connIDsOffsetMap_