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
77 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
91 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
94 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
101 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
104 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
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 ) {
139 throw "EpetraExt::BlockCrsMatrix::Stencil: Global Indices not long long";
147 throw "EpetraExt::BlockCrsMatrix::RowIndex: Global Indices not long long";
153 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
156 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
162 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
165 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
171 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
174 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
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
210 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
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>
243 void TBlockSumIntoGlobalValues(
const int_type BaseRow,
int NumIndices,
244 double* Values,
const int_type* Indices,
const int_type Row,
const int_type Col);
246 template<
typename int_type>
247 void TBlockReplaceGlobalValues(
const int_type BaseRow,
int NumIndices,
248 double* Values,
const int_type* Indices,
const int_type Row,
const int_type Col);
250 template<
typename int_type>
251 void TBlockExtractGlobalRowView(
const int_type BaseRow,
int& NumEntries,
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>
261 std::vector<int_type>& TRowIndices();
264 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
265 template<>
inline std::vector<int>& BlockCrsMatrix::TRowIndices() {
return RowIndices_int_; }
266 template<>
inline std::vector< std::vector<int> >& BlockCrsMatrix::TRowStencil() {
return RowStencil_int_; }
268 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
269 template<>
inline std::vector<long long>& BlockCrsMatrix::TRowIndices() {
return RowIndices_LL_; }
270 template<>
inline std::vector< std::vector<long long> >& BlockCrsMatrix::TRowStencil() {
return RowStencil_LL_; }
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 ...
bool GlobalIndicesLongLong() const
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)
bool GlobalIndicesInt() const
int RowIndex(int i=0)
RowIndex.
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 > 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...
const Epetra_BlockMap & RowMap() const
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...
long long RowIndex64(int i=0)
RowIndex.