44#ifndef EPETRA_CRSGRAPH_H
45#define EPETRA_CRSGRAPH_H
315#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
318#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
332#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
335#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
450#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
453#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
481#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
484#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
535#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
539#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
558#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
560 if(
RowMap().GlobalIndicesInt())
562 throw "Epetra_CrsGraph::NumGlobalRows: GlobalIndices not int.";
578#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
580 if(
RowMap().GlobalIndicesInt())
582 throw "Epetra_CrsGraph::NumGlobalCols: GlobalIndices not int.";
594#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
596 if(
RowMap().GlobalIndicesInt())
598 throw "Epetra_CrsGraph::NumGlobalNonzeros: GlobalIndices not int.";
607#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
609 if(
RowMap().GlobalIndicesInt())
611 throw "Epetra_CrsGraph::NumGlobalDiagonals: GlobalIndices not int.";
626#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
628 if(
RowMap().GlobalIndicesInt())
630 throw "Epetra_CrsGraph::NumGlobalBlockRows: GlobalIndices not int.";
645#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
647 if(
RowMap().GlobalIndicesInt())
649 throw "Epetra_CrsGraph::NumGlobalBlockCols: GlobalIndices not int.";
664#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
666 if(
RowMap().GlobalIndicesInt())
668 throw "Epetra_CrsGraph::NumGlobalBlockDiagonals: GlobalIndices not int.";
677#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
679 if(
RowMap().GlobalIndicesInt())
681 throw "Epetra_CrsGraph::NumGlobalEntries: GlobalIndices not int.";
722 int NumGlobalIndices(
long long Row)
const;
725 int NumAllocatedGlobalIndices(
long long Row)
const;
766 else return(
CrsGraphData_->NumAllocatedIndicesPerRow_[Row]);}
769#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
772 if(
RowMap().GlobalIndicesInt())
774 throw "Epetra_CrsGraph::IndexBase: GlobalIndices not int.";
858#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
862#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
863 int LRID(
long long GRID_in)
const {
return(
RowMap().LID(GRID_in));}
866#if defined(EPETRA_NO_32BIT_GLOBAL_INDICES) && defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
869 int LRID(
long long GRID_in)
const {
return(RowMap().LID(GRID_in));}
873#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
875 if(
RowMap().GlobalIndicesInt())
876 return (
int)
GRID64(LRID_in);
877 throw "Epetra_CrsGraph::GRID: GlobalIndices not int.";
886#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
893#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
894 int LCID(
long long GCID_in)
const
904#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
906 if(
RowMap().GlobalIndicesInt())
907 return (
int)
GCID64(LCID_in);
908 throw "Epetra_CrsGraph::GCID: GlobalIndices not int.";
917#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
918 bool MyGRID(
int GRID_in)
const {
return(
LRID(GRID_in) != -1);}
921#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
922 bool MyGRID(
long long GRID_in)
const {
return(
LRID(GRID_in) != -1);}
932#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
933 bool MyGCID(
int GCID_in)
const {
return(
LCID(GCID_in) != -1);}
936#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
937 bool MyGCID(
long long GCID_in)
const {
return(
LCID(GCID_in) != -1);}
977 virtual void Print(std::ostream& os)
const;
990 int TransformToLocal();
1048 if (!
StorageOptimized())
throw ReportError(
"This method: int *All_Indices() cannot be called when StorageOptimized()==false", -1);
1050#if defined(Epetra_ENABLE_MKL_SPARSE) && !defined(Epetra_DISABLE_MKL_SPARSE_MM)
1051 int *All_IndicesPlus1()
const;
1054 if (!
StorageOptimized())
throw ReportError(
"This method: int *IndexOffset() cannot be called when StorageOptimized()==false", -1);
1057 if (
StorageOptimized())
throw ReportError(
"This method: int* NumIndicesPerRow() cannot be called when StorageOptimized()==true", -1);
1060 if (
StorageOptimized())
throw ReportError(
"This method: int* NumAllocatedIndicesPerRow() cannot be called when StorageOptimized()==true", -1);
1061 else return(
CrsGraphData_->NumAllocatedIndicesPerRow_.Values());}
1069 template<
typename int_type>
1071 if (
StorageOptimized())
throw ReportError(
"This method: int_type** TIndices() cannot be called when StorageOptimized()==true", -1);
1074 template<
typename int_type>
1077 else return(
CrsGraphData_->Data<int_type>().Indices_[LocalRow]);}
1083 bool GlobalConstantsComputed()
const;
1084#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
1085 bool FindGlobalIndexLoc(
int LocalRow,
int Index,
int Start,
int& Loc)
const;
1086 bool FindGlobalIndexLoc(
int NumIndices,
const int* Indices,
int Index,
int Start,
int& Loc)
const;
1088#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
1089 bool FindGlobalIndexLoc(
int LocalRow,
long long Index,
int Start,
int& Loc)
const;
1090 bool FindGlobalIndexLoc(
int NumIndices,
const long long* Indices,
long long Index,
int Start,
int& Loc)
const;
1093 bool FindMyIndexLoc(
int LocalRow,
int Index,
int Start,
int& Loc)
const;
1094 bool FindMyIndexLoc(
int NumIndices,
const int* Indices,
int Index,
int Start,
int& Loc)
const;
1096 int InsertIndices(
int Row,
int NumIndices,
int* Indices);
1097 int InsertIndicesIntoSorted(
int Row,
int NumIndices,
int* Indices);
1099 int InsertIndices(
int Row,
int NumIndices,
long long* Indices);
1100 int InsertIndicesIntoSorted(
int Row,
int NumIndices,
long long* Indices);
1121 int RemoveRedundantIndices();
1122 int DetermineTriangular();
1131 void ComputeIndexState();
1133#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
1136#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
1139 int Allocate(
const int* NumIndicesPerRow,
int Inc,
bool StaticProfile);
1141 int ComputeGlobalConstants();
1152 int* PermuteFromLIDs,
1159 int* PermuteFromLIDs,
1163 template<
typename int_type>
1168 int* PermuteFromLIDs,
1176 int* PermuteFromLIDs,
1180 template<
typename int_type>
1185 int* PermuteFromLIDs,
1233 template<
typename int_type>
1234 int TAllocate(
const int* numIndicesPerRow,
int Inc,
bool staticProfile);
1236 template<
typename int_type>
1239 template<
typename int_type>
1242 template<
typename int_type>
1245 template<
typename int_type>
1248 template<
typename int_type>
1251 template<
typename int_type>
1254 template<
typename int_type>
1257 template<
typename int_type>
1260 template<
typename int_type>
1261 int ExtractMyRowCopy(
int Row,
int LenOfIndices,
int& NumIndices, int_type* targIndices)
const;
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
Epetra_Comm: The Epetra Communication Abstract Base Class.
Epetra_CrsGraphData: The Epetra CrsGraph Data Class.
Epetra_CrsGraph: A class for constructing and using sparse compressed row graphs.
int InsertGlobalIndices(int GlobalRow, int NumIndices, int *Indices)
Enter a list of elements in a specified global row of the graph.
bool Filled() const
If FillComplete() has been called, this query returns true, otherwise it returns false.
int ExtractMyRowView(int LocalRow, int &NumIndices, int *&Indices) const
Get a view of the elements in a specified local row of the graph.
int MaxNumNonzeros() const
Returns the maximum number of nonzero points across all rows on this processor.
const Epetra_Export * Exporter() const
Returns the Exporter associated with this graph.
int MaxNumIndices() const
Returns the maximum number of nonzero entries across all rows on this processor.
int NumGlobalBlockRows() const
Returns the number of Block matrix rows in global matrix.
int NumMyBlockCols() const
Returns the number of Block matrix columns on this processor.
const Epetra_BlockMap & DomainMap() const
Returns the DomainMap associated with this graph.
int RemoveMyIndices(int LocalRow, int NumIndices, int *Indices)
Remove a list of elements from a specified local row of the graph.
bool StaticProfile() const
friend class Epetra_FECrsGraph
int IndexBase() const
Returns the index base for row and column indices for this graph.
bool IndicesAreLocal() const
If column indices are in local range, this query returns true, otherwise it returns false.
bool StorageOptimized() const
If OptimizeStorage() has been called, this query returns true, otherwise it returns false.
int * NumIndicesPerRow() const
const Epetra_BlockMap & RowMap() const
Returns the RowMap associated with this graph.
int NumMyDiagonals() const
Returns the number of diagonal entries in the local graph, based on global row/column index compariso...
bool IndicesAreContiguous() const
int NumAllocatedMyIndices(int Row) const
Returns the allocated number of nonzero entries in specified local row on this processor.
bool FindGlobalIndexLoc(int LocalRow, int Index, int Start, int &Loc) const
int GlobalMaxRowDim() const
Returns the max row dimension of block entries across all processors.
int TRemoveGlobalIndices(long long Row)
bool MyGRID(long long GRID_in) const
long long NumGlobalEntries64() const
int GlobalMaxNumNonzeros() const
Returns the maximun number of nonzero points across all rows across all processors.
const Epetra_CrsGraphData * DataPtr() const
Returns a pointer to the CrsGraphData instance this CrsGraph uses.
friend class Epetra_OffsetIndex
int ReferenceCount() const
Returns the reference count of CrsGraphData.
void SetIndicesAreLocal(bool Flag)
int * All_Indices() const
void SetIndicesAreContiguous(bool Flag)
bool MyLCID(int LCID_in) const
Returns true if the LRID passed in belongs to the calling processor in this map, otherwise returns fa...
int MaxColDim() const
Returns the max column dimension of block entries on the processor.
int GCID(int LCID_in) const
Returns the global column index for give local column index, returns IndexBase-1 if we don't have thi...
int_type ** TIndices() const
int * IndexOffset() const
int GlobalMaxNumIndices() const
Returns the maximun number of nonzero entries across all rows across all processors.
bool LowerTriangular() const
If graph is lower triangular in local index space, this query returns true, otherwise it returns fals...
int TAllocate(const int *numIndicesPerRow, int Inc, bool staticProfile)
long long GCID64(int LCID_in) const
Epetra_CrsGraphData * CrsGraphData_
bool HaveColMap() const
Returns true if we have a well-defined ColMap, and returns false otherwise.
long long NumGlobalDiagonals64() const
bool Sorted() const
If SortIndices() has been called, this query returns true, otherwise it returns false.
int ExtractGlobalRowView(int GlobalRow, int &NumIndices, int *&Indices) const
Get a view of the elements in a specified global row of the graph.
void SetNoRedundancies(bool Flag)
bool IndicesAreGlobal() const
If column indices are in global range, this query returns true, otherwise it returns false.
int NumGlobalEntries() const
Returns the number of entries in the global graph.
void SetSorted(bool Flag)
long long NumGlobalBlockRows64() const
int RemoveGlobalIndices(int GlobalRow, int NumIndices, int *Indices)
Remove a list of elements from a specified global row of the graph.
void SetAllocated(bool Flag)
int ExtractMyRowCopy(int LocalRow, int LenOfIndices, int &NumIndices, int *Indices) const
Extract a list of elements in a specified local row of the graph. Put into storage allocated by calli...
bool MyLRID(int LRID_in) const
Returns true if the LRID passed in belongs to the calling processor in this map, otherwise returns fa...
bool UpperTriangular() const
If graph is upper triangular in local index space, this query returns true, otherwise it returns fals...
long long NumGlobalBlockDiagonals64() const
int FillComplete()
Tranform to local index space. Perform other operations to allow optimal matrix operations.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this graph.
void PrintGraphData(std::ostream &os) const
int GlobalMaxColDim() const
Returns the max column dimension of block entries across all processors.
bool NoRedundancies() const
If RemoveRedundantIndices() has been called, this query returns true, otherwise it returns false.
int NumMyIndices(int Row) const
Returns the current number of nonzero entries in specified local row on this processor.
int_type * TIndices(int LocalRow) const
void SetFilled(bool Flag)
int NumMyEntries() const
Returns the number of entries on this processor.
int * Indices(int LocalRow) const
bool MyGRID(int GRID_in) const
Returns true if the GRID passed in belongs to the calling processor in this map, otherwise returns fa...
int GRID(int LRID_in) const
Returns the global row index for give local row index, returns IndexBase-1 if we don't have this loca...
bool MyGCID(long long GCID_in) const
int NumMyBlockRows() const
Returns the number of block matrix rows on this processor.
int LCID(long long GCID_in) const
int NumGlobalBlockCols() const
Returns the number of Block matrix columns in global matrix.
int NumGlobalDiagonals() const
Returns the number of diagonal entries in the global graph, based on global row/column index comparis...
long long NumGlobalRows64() const
int InsertMyIndices(int LocalRow, int NumIndices, int *Indices)
Enter a list of elements in a specified local row of the graph.
friend class Epetra_CrsMatrix
int NumMyRows() const
Returns the number of matrix rows on this processor.
int NumGlobalNonzeros() const
Returns the number of indices in the global graph.
void SetIndicesAreGlobal(bool Flag)
int NumGlobalRows() const
Returns the number of matrix rows in global matrix.
Epetra_CrsGraph(Epetra_DataAccess CV, const Epetra_BlockMap &RowMap, const int *NumIndicesPerRow, bool StaticProfile=false)
Epetra_CrsGraph constuctor with variable number of indices per row.
int NumMyCols() const
Returns the number of entries in the set of column-indices that appear on this processor.
int ExtractGlobalRowCopy(int GlobalRow, int LenOfIndices, int &NumIndices, int *Indices) const
Extract a list of elements in a specified global row of the graph. Put into storage allocated by call...
long long NumGlobalNonzeros64() const
void PrintGraphData(std::ostream &os, int level) const
const Epetra_BlockMap & ImportMap() const
Use ColMap() instead.
long long GRID64(int LRID_in) const
int NumMyBlockDiagonals() const
Returns the number of Block diagonal entries in the local graph, based on global row/column index com...
int NumGlobalBlockDiagonals() const
Returns the number of Block diagonal entries in the global graph, based on global row/column index co...
int * operator[](int Loc) const
int LRID(long long GRID_in) const
long long NumGlobalBlockCols64() const
bool MyGlobalRow(int GID) const
Returns true of GID is owned by the calling processor, otherwise it returns false.
int * NumAllocatedIndicesPerRow() const
int MaxRowDim() const
Returns the max row dimension of block entries on the processor.
friend class Epetra_FECrsMatrix
friend class Epetra_FEVbrMatrix
void SetGlobalConstantsComputed(bool Flag)
void SortGhostsAssociatedWithEachProcessor(bool Flag)
Forces FillComplete() to locally order ghostnodes associated with each remote processor in ascending ...
const Epetra_BlockMap & RangeMap() const
Returns the RangeMap associated with this graph.
const Epetra_BlockMap & ColMap() const
Returns the Column Map associated with this graph.
int TInsertIndicesIntoSorted(int Row, int NumIndices, int_type *Indices)
int TInsertIndices(int Row, int NumIndices, int_type *Indices)
bool MyGlobalRow(long long GID) const
long long IndexBase64() const
long long NumGlobalCols64() const
int NumMyNonzeros() const
Returns the number of indices in the local graph.
friend class Epetra_VbrMatrix
bool MyGCID(int GCID_in) const
Returns true if the GCID passed in belongs to the calling processor in this map, otherwise returns fa...
int * operator[](int Loc)
Inlined bracket operator for fast access to data. (Const and Non-const versions)
const Epetra_Import * Importer() const
Returns the Importer associated with this graph.
int NumGlobalCols() const
Returns the number of matrix columns in global matrix.
int OptimizeStorage()
Make consecutive row index sections contiguous, minimize internal storage used for constructing graph...
int LRID(int GRID_in) const
Returns the local row index for given global row index, returns -1 if no local row for this global ro...
bool NoDiagonal() const
If graph has no diagonal entries in global index space, this query returns true, otherwise it returns...
int LCID(int GCID_in) const
Returns the local column index for given global column index, returns -1 if no local column for this ...
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.
virtual int CheckSizes(const Epetra_SrcDistObject &Source)=0
Allows the source and target (this) objects to be compared for compatibility, return nonzero if not.
virtual int UnpackAndCombine(const Epetra_SrcDistObject &Source, int NumImportIDs, int *ImportLIDs, int LenImports, char *Imports, int &SizeOfPacket, Epetra_Distributor &Distor, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor)=0
Perform any unpacking and combining after call to DoTransfer().
virtual int PackAndPrepare(const Epetra_SrcDistObject &Source, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, Epetra_Distributor &Distor)=0
Perform any packing or preparation required for call to DoTransfer().
virtual int CopyAndPermute(const Epetra_SrcDistObject &Source, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor, Epetra_CombineMode CombineMode=Zero)=0
Perform ID copies and permutations that are on processor.
Epetra_DistObject & operator=(const Epetra_DistObject &src)
const Epetra_Comm & Comm() const
Returns the address of the Epetra_Comm for this multi-vector.
Epetra_DistObject(const Epetra_BlockMap &Map)
Basic Epetra_DistObject constuctor.
virtual void Print(std::ostream &os) const
Print method.
Epetra_Distributor: The Epetra Gather/Scatter Setup Base Class.
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements.
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
virtual int ReportError(const std::string Message, int ErrorCode) const
Error reporting method.
Epetra_OffsetIndex: This class builds index for efficient mapping of data from one Epetra_CrsGraph ba...
Epetra_RowMatrix: A pure virtual class for using real-valued double-precision row matrices.
Epetra_SrcDistObject: A class for supporting flexible source distributed objects for import/export op...
Epetra_Time: The Epetra Timing Class.
Epetra_Util: The Epetra Util Wrapper Class.