47 MatSetOption(
m_A, MAT_ROW_ORIENTED, PETSC_FALSE);
51 #ifdef CEPS_DEBUG_ENABLED
52 for (
CepsUInt i=0; i<subMat.rows(); i++)
53 for (
CepsUInt j=0; j<subMat.cols(); j++)
55 CepsString(
"while inserting coefficient in matrix at position (") +
59 addValues(subMat.data(),N,M,indicesI.data(),indicesJ.data());
72 MatSetOption (
m_A, MAT_ROW_ORIENTED, PETSC_FALSE);
76 getValues (subMat.data (), N, N, indicesI.data (), indicesJ.data ());
std::basic_string< CepsChar > CepsString
C++ format string.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
int32_t CepsInt
Need 32 bit integer.
Eigen::Matrix< CepsScalar, Eigen::Dynamic, Eigen::Dynamic > CepsMathDynamic2D
Dynamic 2D array, eigen format.
void getSubMatrix(const CepsVector< CepsGlobalIndex > &indicesI, const CepsVector< CepsGlobalIndex > &indicesJ, CepsMathDynamic2D &subMat)
Insert each element of a distributed matrix in a small Eigen submatrix.
const PetscMatrix & getMatrix() const
The underlying matrix.
void addSubMatrix(const CepsMathDynamic2D &subMat, const CepsVector< CepsGlobalIndex > &indicesI, const CepsVector< CepsGlobalIndex > &indicesJ)
Add each element of a small square matrix in a distributed matrix.
void addValues(const CepsMathScalar *values, CepsInt nbRows, CepsInt nbColumns, const CepsGlobalIndex *rowIndices, const CepsGlobalIndex *columnIndices)
Add multiple values in the matrix at once.
PetscMatrix m_A
The main object.
void getValues(CepsMathScalar *values, CepsInt nbRows, CepsInt nbColumns, const CepsGlobalIndex *rowIndices, const CepsGlobalIndex *columnIndices)
Get multiple values in the matrix.
CepsString toString(_Tp value)
Convert a given value to a string (input has to be compatible with std::to_string)
void checkNanOrInf(CepsReal v, CepsString message="")
Stops if value is NaN or infty.