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
282 if(IntPacketSizeTimesNumTrans > Length) {
285 Length = IntPacketSizeTimesNumTrans;
286 int* newPtr =
new int[Length];
287 UserPtr =
reinterpret_cast<char*
> (newPtr);
294 bool four_bit = (level >= 4);
295 bool two_bit = ((level % 4) >= 2);
296 bool one_bit = ((level % 2) == 1);
298 os <<
"\n***** CrsGraphData (output level " << level <<
") *****" << std::endl;
301 os <<
"RowMap_:\n" <<
RowMap_ << std::endl;
302 os <<
"ColMap_:\n" <<
ColMap_ << std::endl;
303 os <<
"DomainMap_:\n" <<
DomainMap_ << std::endl;
304 os <<
"RangeMap_:\n" <<
RangeMap_ << std::endl;
308 os.width(26); os <<
"HaveColMap_: " <<
HaveColMap_;
309 os.width(25); os <<
"Filled_: " <<
Filled_;
310 os.width(25); os <<
"Allocated_: " <<
Allocated_;
311 os.width(25); os <<
"Sorted_: " <<
Sorted_ << std::endl;
320 os.width(25); os <<
"NoDiagonal_: " <<
NoDiagonal_ << std::endl;
322 os.width(25); os <<
"StaticProfile_: " <<
StaticProfile_ << std::endl << std::endl;
332 os.width(10); os <<
"IB_: " <<
IndexBase_ << std::endl;
341 os.width(10); os <<
"CV_: " <<
CV_ << std::endl;
350 os.width(11); os <<
"RC: " <<
ReferenceCount() << std::endl << std::endl;
359 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
362 throw "Epetra_CrsGraphData::Print: GlobalIndicesLongLong but no long long API";
372 os <<
"Indices_[" << i <<
"]: (" <<
data->
Indices_[i] <<
") ";
384 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
397 throw "Epetra_CrsGraphData::Print: GlobalIndicesLongLong but no long long API";
402 os <<
"***** End CrsGraphData *****" << std::endl;
407 template<
typename int_type>
412 if ( (entries_.size()==0) || ( entries_.back() < Col) )
414 entries_.push_back(Col);
419 typename std::vector<int_type>::iterator it = std::lower_bound(entries_.begin(),
429 entries_.insert(it, Col);
434 template<
typename int_type>
437 const int_type *Indices)
443 bool indicesAreSorted =
true;
444 for (
int i=1; i<numCols; ++i)
445 if (Indices[i] <= Indices[i-1]) {
446 indicesAreSorted =
false;
450 if (indicesAreSorted && numCols > 3) {
451 const int_type * curInput = &Indices[0];
452 int_type col = *curInput;
453 const int_type * endInput = &Indices[numCols];
457 if (entries_.size() == 0 || entries_.back() < col)
459 entries_.insert(entries_.end(), &Indices[0], &Indices[numCols]);
465 typename std::vector<int_type>::iterator it =
466 std::lower_bound(entries_.begin(), entries_.end(), col);
469 if (curInput == endInput)
475 if (it == entries_.end())
484 it = std::lower_bound(it, entries_.end(), col);
485 if (it == entries_.end())
490 if (curInput == endInput)
497 const int pos1 = (int) (it - entries_.begin());
498 entries_.insert (it, curInput, endInput);
499 it = entries_.begin() + pos1;
502 typename std::vector<int_type>::iterator it2 = it + (endInput - curInput);
506 while (curInput != endInput && it2 != entries_.end())
508 if (*curInput < *it2)
510 else if (*curInput == *it2)
521 while (curInput != endInput)
524 while (it2 != entries_.end())
528 const int new_size = (int) (it - entries_.begin());
529 entries_.resize (new_size);
535 for (
int i=0; i<numCols; ++i)
536 AddEntry(Indices[i]);
543 #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_
bool IndicesAreContiguous_
bool GlobalIndicesLongLong() const
Returns true if map create with long long NumGlobalElements.
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...
bool GlobalIndicesInt() const
Returns true if map create with int NumGlobalElements.
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_
int ReferenceCount() const
Get reference count.
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.
void Print(std::ostream &os, int level=3) const
Outputs state of almost all data members. (primarily used for testing purposes).
Epetra_IntSerialDenseVector IndexOffset_
long long NumGlobalBlockDiagonals_
const Epetra_Import * Importer_
long long NumGlobalDiagonals_
bool GlobalIndicesTypeMatch(const Epetra_BlockMap &other) const