66 Sorted_(!StaticProfile),
67 StorageOptimized_(false),
68 NoRedundancies_(!StaticProfile),
69 IndicesAreGlobal_(false),
70 IndicesAreLocal_(false),
71 IndicesAreContiguous_(false),
72 LowerTriangular_(true),
73 UpperTriangular_(true),
75 GlobalConstantsComputed_(false),
76 StaticProfile_(StaticProfile),
77 SortGhostsAssociatedWithEachProcessor_(false),
80 IndexBase_(RowMap.IndexBase64()),
82 NumGlobalBlockRows_(RowMap.NumGlobalElements64()),
83 NumGlobalBlockCols_(NumGlobalBlockRows_),
84 NumGlobalBlockDiagonals_(0),
86 NumMyBlockRows_(RowMap.NumMyElements()),
87 NumMyBlockCols_(NumMyBlockRows_),
88 NumMyBlockDiagonals_(0),
89 MaxRowDim_(RowMap.MaxElementSize()),
90 MaxColDim_(MaxRowDim_),
91 GlobalMaxRowDim_(RowMap.MaxElementSize()),
92 GlobalMaxColDim_(GlobalMaxRowDim_),
94 GlobalMaxNumNonzeros_(0),
95 NumGlobalNonzeros_(0),
96 NumGlobalRows_(RowMap.NumGlobalPoints64()),
97 NumGlobalCols_(NumGlobalRows_),
98 NumGlobalDiagonals_(0),
100 NumMyRows_(RowMap.NumMyPoints()),
101 NumMyCols_(NumMyRows_),
104 GlobalMaxNumIndices_(0),
105 NumTempColIndices_(0),
106 NumAllocatedIndicesPerRow_(0),
107 NumIndicesPerRow_(0),
111 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
116 throw "Epetra_CrsGraphData::Epetra_CrsGraphData: cannot be called without any index type for RowMap";
119 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 141 Sorted_(!StaticProfile),
142 StorageOptimized_(false),
143 NoRedundancies_(!StaticProfile),
144 IndicesAreGlobal_(false),
145 IndicesAreLocal_(false),
146 IndicesAreContiguous_(false),
147 LowerTriangular_(true),
148 UpperTriangular_(true),
150 GlobalConstantsComputed_(false),
151 StaticProfile_(StaticProfile),
152 SortGhostsAssociatedWithEachProcessor_(false),
154 IndexBase_(RowMap.IndexBase64()),
155 NumGlobalEntries_(0),
156 NumGlobalBlockRows_(RowMap.NumGlobalElements64()),
157 NumGlobalBlockCols_(ColMap.NumGlobalElements64()),
158 NumGlobalBlockDiagonals_(0),
160 NumMyBlockRows_(RowMap.NumMyElements()),
161 NumMyBlockCols_(ColMap.NumMyElements()),
162 NumMyBlockDiagonals_(0),
163 MaxRowDim_(RowMap.MaxElementSize()),
164 MaxColDim_(ColMap.MaxElementSize()),
165 GlobalMaxRowDim_(RowMap.MaxElementSize()),
166 GlobalMaxColDim_(ColMap.MaxElementSize()),
168 GlobalMaxNumNonzeros_(0),
169 NumGlobalNonzeros_(0),
170 NumGlobalRows_(RowMap.NumGlobalPoints64()),
171 NumGlobalCols_(ColMap.NumGlobalPoints64()),
172 NumGlobalDiagonals_(0),
174 NumMyRows_(RowMap.NumMyPoints()),
175 NumMyCols_(ColMap.NumMyPoints()),
178 GlobalMaxNumIndices_(0),
179 NumTempColIndices_(0),
180 NumAllocatedIndicesPerRow_(0),
181 NumIndicesPerRow_(0),
185 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
190 throw "Epetra_CrsGraphData::Epetra_CrsGraphData: cannot be called without any index type for RowMap";
193 throw "Epetra_CrsGraphData::Epetra_CrsGraphData: cannot be called with different indices types for RowMap and ColMap";
196 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 213 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 228 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 236 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 281 if(IntPacketSizeTimesNumTrans > Length) {
284 Length = IntPacketSizeTimesNumTrans;
285 int* newPtr =
new int[Length];
286 UserPtr =
reinterpret_cast<char*
> (newPtr);
293 bool four_bit = (level >= 4);
294 bool two_bit = ((level % 4) >= 2);
295 bool one_bit = ((level % 2) == 1);
297 os <<
"\n***** CrsGraphData (output level " << level <<
") *****" << std::endl;
300 os <<
"RowMap_:\n" <<
RowMap_ << std::endl;
301 os <<
"ColMap_:\n" <<
ColMap_ << std::endl;
302 os <<
"DomainMap_:\n" <<
DomainMap_ << std::endl;
303 os <<
"RangeMap_:\n" <<
RangeMap_ << std::endl;
307 os.width(26); os <<
"HaveColMap_: " <<
HaveColMap_;
308 os.width(25); os <<
"Filled_: " <<
Filled_;
309 os.width(25); os <<
"Allocated_: " <<
Allocated_;
310 os.width(25); os <<
"Sorted_: " <<
Sorted_ << std::endl;
319 os.width(25); os <<
"NoDiagonal_: " <<
NoDiagonal_ << std::endl;
321 os.width(25); os <<
"StaticProfile_: " <<
StaticProfile_ << std::endl << std::endl;
331 os.width(10); os <<
"IB_: " <<
IndexBase_ << std::endl;
340 os.width(10); os <<
"CV_: " <<
CV_ << std::endl;
349 os.width(11); os <<
"RC: " <<
ReferenceCount() << std::endl << std::endl;
358 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
361 throw "Epetra_CrsGraphData::Print: GlobalIndicesLongLong but no long long API";
371 os <<
"Indices_[" << i <<
"]: (" <<
data->
Indices_[i] <<
") ";
383 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 396 throw "Epetra_CrsGraphData::Print: GlobalIndicesLongLong but no long long API";
401 os <<
"***** End CrsGraphData *****" << std::endl;
406 template<
typename int_type>
411 if ( (entries_.size()==0) || ( entries_.back() < Col) )
413 entries_.push_back(Col);
418 typename std::vector<int_type>::iterator it = std::lower_bound(entries_.begin(),
428 entries_.insert(it, Col);
433 template<
typename int_type>
436 const int_type *Indices)
442 bool indicesAreSorted =
true;
443 for (
int i=1; i<numCols; ++i)
444 if (Indices[i] <= Indices[i-1]) {
445 indicesAreSorted =
false;
449 if (indicesAreSorted && numCols > 3) {
450 const int_type * curInput = &Indices[0];
451 int_type col = *curInput;
452 const int_type * endInput = &Indices[numCols];
456 if (entries_.size() == 0 || entries_.back() < col)
458 entries_.insert(entries_.end(), &Indices[0], &Indices[numCols]);
464 typename std::vector<int_type>::iterator it =
465 std::lower_bound(entries_.begin(), entries_.end(), col);
468 if (curInput == endInput)
474 if (it == entries_.end())
483 it = std::lower_bound(it, entries_.end(), col);
484 if (it == entries_.end())
489 if (curInput == endInput)
496 const int pos1 = (int) (it - entries_.begin());
497 entries_.insert (it, curInput, endInput);
498 it = entries_.begin() + pos1;
501 typename std::vector<int_type>::iterator it2 = it + (endInput - curInput);
505 while (curInput != endInput && it2 != entries_.end())
507 if (*curInput < *it2)
509 else if (*curInput == *it2)
520 while (curInput != endInput)
523 while (it2 != entries_.end())
527 const int new_size = (int) (it - entries_.begin());
528 entries_.resize (new_size);
534 for (
int i=0; i<numCols; ++i)
535 AddEntry(Indices[i]);
542 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES bool GlobalConstantsComputed_
const Epetra_Export * Exporter_
int MakeImportExport()
called by FillComplete (and TransformToLocal)
Epetra_BlockMap RangeMap_
long long NumGlobalBlockCols_
Epetra_IntSerialDenseVector NumIndicesPerRow_
int GlobalMaxNumNonzeros_
int ReferenceCount() const
Get reference count.
bool IndicesAreContiguous_
bool SameAs(const Epetra_BlockMap &Map) const
Returns true if this and Map are identical maps.
long long NumGlobalEntries_
int ReAllocateAndCast(char *&UserPtr, int &Length, const int IntPacketSizeTimesNumTrans)
called by PackAndPrepare
long long NumGlobalNonzeros_
~Epetra_CrsGraphData()
Epetra_CrsGraphData Destructor.
bool SortGhostsAssociatedWithEachProcessor_
IndexData< long long > * LL_data
Epetra_BlockMap DomainMap_
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements...
Epetra_LongLongSerialDenseVector All_Indices_
Epetra_Import: This class builds an import object for efficient importing of off-processor elements...
void AddEntry(const int_type col_num)
Add the given column number to this line.
Epetra_IntSerialDenseVector NumAllocatedIndicesPerRow_
bool GlobalIndicesInt() const
Returns true if map create with int NumGlobalElements.
void Print(std::ostream &os, int level=3) const
Outputs state of almost all data members. (primarily used for testing purposes).
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
long long * TempColIndices_
Epetra_IntSerialDenseVector All_Indices_
long long NumGlobalBlockRows_
void AddEntries(const int n_cols, const int_type *col_nums)
Add many entries to one row.
Epetra_CrsGraphData(Epetra_DataAccess CV, const Epetra_BlockMap &RowMap, bool StaticProfile)
Epetra_CrsGraphData Default Constructor.
Epetra_IntSerialDenseVector IndexOffset_
bool GlobalIndicesTypeMatch(const Epetra_BlockMap &other) const
long long NumGlobalBlockDiagonals_
const Epetra_Import * Importer_
bool GlobalIndicesLongLong() const
Returns true if map create with long long NumGlobalElements.
long long NumGlobalDiagonals_