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
117 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
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
265template<>
inline std::vector<int>& BlockCrsMatrix::TRowIndices() {
return RowIndices_int_; }
266template<>
inline std::vector< std::vector<int> >& BlockCrsMatrix::TRowStencil() {
return RowStencil_int_; }
268#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
269template<>
inline std::vector<long long>& BlockCrsMatrix::TRowIndices() {
return RowIndices_LL_; }
270template<>
inline std::vector< std::vector<long long> >& BlockCrsMatrix::TRowStencil() {
return RowStencil_LL_; }
const std::vector< long long > & Stencil64(int i=0)
Local Stencil Info.
BlockCrsMatrix(const Epetra_RowMatrix &BaseMatrix, const std::vector< std::vector< int > > &RowStencil, const std::vector< int > &RowIndices, const Epetra_Comm &GlobalComm)
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...
std::vector< std::vector< int > > RowStencil_int_
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...
void BlockExtractGlobalRowView(const int BaseRow, int &NumEntries, double *&Values, const int Row, const int Col)
BlockCrsMatrix(const Epetra_RowMatrix &BaseMatrix, const std::vector< std::vector< long long > > &RowStencil, const std::vector< long long > &RowIndices, const Epetra_Comm &GlobalComm)
virtual ~BlockCrsMatrix()
Destructor.
Epetra_CrsGraph BaseGraph_
void ExtractBlock(Epetra_CrsMatrix &BaseMatrix, const int Row, const int Col)
std::vector< std::vector< long long > > RowStencil_LL_
BlockCrsMatrix(const Epetra_CrsGraph &BaseGraph, const std::vector< long long > &RowStencil, long long RowIndex, const Epetra_Comm &GlobalComm)
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.
void BlockReplaceGlobalValues(const int BaseRow, int NumIndices, double *Values, const int *Indices, const int Row, const int Col)
int RowIndex(int i=0)
RowIndex.
const std::vector< int > & Stencil(int i=0)
Local Stencil Info.
std::vector< long long > RowIndices_LL_
BlockCrsMatrix(const Epetra_CrsGraph &BaseGraph, const std::vector< std::vector< long long > > &RowStencil, const std::vector< long long > &RowIndices, const Epetra_Comm &GlobalComm)
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 ...
BlockCrsMatrix(const Epetra_CrsGraph &BaseGraph, const std::vector< std::vector< int > > &RowStencil, const std::vector< int > &RowIndices, const Epetra_Comm &GlobalComm)
BlockCrsMatrix constuctor with multiple block rows per processor.
BlockCrsMatrix(const Epetra_CrsGraph &BaseGraph, const std::vector< int > &RowStencil, int RowIndex, const Epetra_Comm &GlobalComm)
BlockCrsMatrix constuctor with one block row per processor.
bool GlobalIndicesInt() const
bool GlobalIndicesLongLong() const
const Epetra_BlockMap & RowMap() const
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.