42#ifndef EPETRAEXT_BLOCKCRSMATRIX_H
43#define EPETRAEXT_BLOCKCRSMATRIX_H
45#if defined(EpetraExt_SHOW_DEPRECATED_WARNINGS)
47#warning "The EpetraExt package is deprecated"
53#include "Epetra_ConfigDefs.h"
54#include "Epetra_CrsMatrix.h"
80#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
83#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
97#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
100#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
107#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
110#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
121#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
123 const std::vector<int> &
Stencil(
int i = 0 ) {
127 throw "EpetraExt::BlockCrsMatrix::Stencil: Global Indices not int";
135 throw "EpetraExt::BlockCrsMatrix::RowIndex: Global Indices not int";
139#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
142 if(
BaseGraph_.RowMap().GlobalIndicesLongLong())
145 throw "EpetraExt::BlockCrsMatrix::Stencil: Global Indices not long long";
150 if(
BaseGraph_.RowMap().GlobalIndicesLongLong())
153 throw "EpetraExt::BlockCrsMatrix::RowIndex: Global Indices not long long";
159#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
162#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
168#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
171#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
177#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
180#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
186#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
188 double* Values,
const int* Indices,
const int Row,
const int Col);
190#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
192 double* Values,
const long long* Indices,
const long long Row,
const long long Col);
195#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
197 double* Values,
const int* Indices,
const int Row,
const int Col);
199#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
201 double* Values,
const long long* Indices,
const long long Row,
const long long Col);
204#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
206 double*& Values,
const int Row,
const int Col);
208#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
210 double*& Values,
const long long Row,
const long long Col);
213#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
216#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
224#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
229#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
239 template<
typename int_type>
240 void TLoadBlock(
const Epetra_RowMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
242 template<
typename int_type>
243 void TSumIntoBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
245 template<
typename int_type>
246 void TSumIntoGlobalBlock(
double alpha,
const Epetra_RowMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
248 template<
typename int_type>
249 void TBlockSumIntoGlobalValues(
const int_type BaseRow,
int NumIndices,
250 double* Values,
const int_type* Indices,
const int_type Row,
const int_type Col);
252 template<
typename int_type>
253 void TBlockReplaceGlobalValues(
const int_type BaseRow,
int NumIndices,
254 double* Values,
const int_type* Indices,
const int_type Row,
const int_type Col);
256 template<
typename int_type>
257 void TBlockExtractGlobalRowView(
const int_type BaseRow,
int& NumEntries,
258 double*& Values,
const int_type Row,
const int_type Col);
260 template<
typename int_type>
261 void TExtractBlock(
Epetra_CrsMatrix & BaseMatrix,
const int_type Row,
const int_type Col);
263 template<
typename int_type>
264 std::vector< std::vector<int_type> >&
TRowStencil();
266 template<
typename int_type>
270#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
274#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
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)
std::vector< std::vector< int > > RowStencil_int_
void SumIntoBlock(double alpha, const Epetra_RowMatrix &BaseMatrix, const int Row, const int Col)
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< int > > & TRowStencil()
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)
long long RowIndex64(int i=0)
RowIndex.
std::vector< int > & TRowIndices()
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)
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.
Epetra_CrsMatrix(Epetra_DataAccess CV, const Epetra_Map &RowMap, const int *NumEntriesPerRow, bool StaticProfile=false)
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.