42 #ifndef EPETRAEXT_BLOCKCRSMATRIX_H 43 #define EPETRAEXT_BLOCKCRSMATRIX_H 47 #include "Epetra_ConfigDefs.h" 48 #include "Epetra_CrsMatrix.h" 74 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 75 BlockCrsMatrix(
const Epetra_CrsGraph & BaseGraph,
const std::vector<int> & RowStencil,
int RowIndex,
const Epetra_Comm & GlobalComm );
77 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 78 BlockCrsMatrix(
const Epetra_CrsGraph & BaseGraph,
const std::vector<long long> & RowStencil,
long long RowIndex,
const Epetra_Comm & GlobalComm );
91 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 92 BlockCrsMatrix(
const Epetra_CrsGraph & BaseGraph,
const std::vector< std::vector<int> > & RowStencil,
const std::vector<int> & RowIndices,
const Epetra_Comm & GlobalComm );
94 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 95 BlockCrsMatrix(
const Epetra_CrsGraph & BaseGraph,
const std::vector< std::vector<long long> > & RowStencil,
const std::vector<long long> & RowIndices,
const Epetra_Comm & GlobalComm );
99 BlockCrsMatrix(
const Epetra_CrsGraph & BaseGraph,
const Epetra_CrsGraph& LocalBlockGraph,
const Epetra_Comm & GlobalComm );
101 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 102 BlockCrsMatrix(
const Epetra_RowMatrix & BaseMatrix,
const std::vector< std::vector<int> > & RowStencil,
const std::vector<int> & RowIndices,
const Epetra_Comm & GlobalComm );
104 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 105 BlockCrsMatrix(
const Epetra_RowMatrix & BaseMatrix,
const std::vector< std::vector<long long> > & RowStencil,
const std::vector<long long> & RowIndices,
const Epetra_Comm & GlobalComm );
115 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 116 const std::vector<int> &
Stencil(
int i = 0 ) {
121 throw "EpetraExt::BlockCrsMatrix::Stencil: Global Indices not int";
129 throw "EpetraExt::BlockCrsMatrix::RowIndex: Global Indices not int";
133 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 134 const std::vector<long long> &
Stencil64(
int i = 0 ) {
136 if(
BaseGraph_.RowMap().GlobalIndicesLongLong())
139 throw "EpetraExt::BlockCrsMatrix::Stencil: Global Indices not long long";
144 if(
BaseGraph_.RowMap().GlobalIndicesLongLong())
147 throw "EpetraExt::BlockCrsMatrix::RowIndex: Global Indices not long long";
153 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 154 void LoadBlock(
const Epetra_RowMatrix & BaseMatrix,
const int Row,
const int Col);
156 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 157 void LoadBlock(
const Epetra_RowMatrix & BaseMatrix,
const long long Row,
const long long Col);
162 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 163 void SumIntoBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const int Row,
const int Col);
165 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 166 void SumIntoBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const long long Row,
const long long Col);
171 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 172 void SumIntoGlobalBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const int Row,
const int Col);
174 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 175 void SumIntoGlobalBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const long long Row,
const long long Col);
180 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 182 double* Values,
const int* Indices,
const int Row,
const int Col);
184 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 186 double* Values,
const long long* Indices,
const long long Row,
const long long Col);
189 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 191 double* Values,
const int* Indices,
const int Row,
const int Col);
193 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 195 double* Values,
const long long* Indices,
const long long Row,
const long long Col);
198 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 200 double*& Values,
const int Row,
const int Col);
202 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 204 double*& Values,
const long long Row,
const long long Col);
207 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 208 void ExtractBlock(Epetra_CrsMatrix & BaseMatrix,
const int Row,
const int Col);
210 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 211 void ExtractBlock(Epetra_CrsMatrix & BaseMatrix,
const long long Row,
const long long Col);
218 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 223 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 233 template<
typename int_type>
234 void TLoadBlock(
const Epetra_RowMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
236 template<
typename int_type>
237 void TSumIntoBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
239 template<
typename int_type>
240 void TSumIntoGlobalBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
242 template<
typename int_type>
244 double* Values,
const int_type* Indices,
const int_type Row,
const int_type Col);
246 template<
typename int_type>
248 double* Values,
const int_type* Indices,
const int_type Row,
const int_type Col);
250 template<
typename int_type>
252 double*& Values,
const int_type Row,
const int_type Col);
254 template<
typename int_type>
255 void TExtractBlock(Epetra_CrsMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
257 template<
typename int_type>
258 std::vector< std::vector<int_type> >&
TRowStencil();
260 template<
typename int_type>
264 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 268 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
void LoadBlock(const Epetra_RowMatrix &BaseMatrix, const int Row, const int Col)
Routine for loading a base matrices values into the large Block Matrix The Row and Col arguments are ...
void TBlockReplaceGlobalValues(const int_type BaseRow, int NumIndices, double *Values, const int_type *Indices, const int_type Row, const int_type Col)
std::vector< std::vector< int_type > > & TRowStencil()
std::vector< std::vector< int > > RowStencil_int_
void BlockReplaceGlobalValues(const int BaseRow, int NumIndices, double *Values, const int *Indices, const int Row, const int Col)
std::vector< long long > RowIndices_LL_
void ExtractBlock(Epetra_CrsMatrix &BaseMatrix, const int Row, const int Col)
int RowIndex(int i=0)
RowIndex.
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.
void BlockExtractGlobalRowView(const int BaseRow, int &NumEntries, double *&Values, const int Row, const int Col)
std::vector< std::vector< long long > > RowStencil_LL_
const std::vector< int > & Stencil(int i=0)
Local Stencil Info.
std::vector< int_type > & TRowIndices()
std::vector< int > RowIndices_int_
void SumIntoGlobalBlock(double alpha, const Epetra_RowMatrix &BaseMatrix, const int Row, const int Col)
Routine for summing base matrices values into the large Block Matrix The Row and Col arguments are gl...
void TBlockExtractGlobalRowView(const int_type BaseRow, int &NumEntries, double *&Values, const int_type Row, const int_type Col)
void TSumIntoGlobalBlock(double alpha, const Epetra_RowMatrix &BaseMatrix, const int_type Row, const int_type Col)
virtual ~BlockCrsMatrix()
Destructor.
BlockCrsMatrix(const Epetra_CrsGraph &BaseGraph, const std::vector< int > &RowStencil, int RowIndex, const Epetra_Comm &GlobalComm)
BlockCrsMatrix constuctor with one block row per processor.
const std::vector< long long > & Stencil64(int i=0)
Local Stencil Info.
void SumIntoBlock(double alpha, const Epetra_RowMatrix &BaseMatrix, const int Row, const int Col)
Routine for summing base matrices values into the large Block Matrix The Row and Col arguments are in...
Epetra_CrsGraph BaseGraph_
void BlockSumIntoGlobalValues(const int BaseRow, int NumIndices, double *Values, const int *Indices, const int Row, const int Col)
Sum Entries into Block matrix using base-matrix numbering plus block Row and Col The Row and Col argu...
void TExtractBlock(Epetra_CrsMatrix &BaseMatrix, const int_type Row, const int_type Col)
long long RowIndex64(int i=0)
RowIndex.
void TLoadBlock(const Epetra_RowMatrix &BaseMatrix, const int_type Row, const int_type Col)
void TSumIntoBlock(double alpha, const Epetra_RowMatrix &BaseMatrix, const int_type Row, const int_type Col)
void TBlockSumIntoGlobalValues(const int_type BaseRow, int NumIndices, double *Values, const int_type *Indices, const int_type Row, const int_type Col)