9 #ifndef _fei_MatrixTraits_FillableMat_hpp_
10 #define _fei_MatrixTraits_FillableMat_hpp_
27 {
return(
"FillableMat"); }
62 length = matrixrow->
size();
83 int row,
int len,
double* coefs,
int* indices)
88 const std::vector<int>& row_indices = matrixrow->
indices();
89 const std::vector<double>& row_coefs = matrixrow->
coefs();
90 const int rowlen = row_indices.size();
91 for(
int i=0; i<rowlen; ++i) {
93 coefs[i] = row_coefs[i];
94 indices[i] = row_indices[i];
107 int numRows,
const int* rows,
108 int numCols,
const int* cols,
109 const double*
const* values,
112 if (numCols < 1 || numRows < 1)
return(0);
114 for(
int i=0; i<numRows; ++i) {
115 mat->
sumInRow(rows[i], cols, values[i], numCols);
119 for(
int i=0; i<numRows; ++i) {
120 mat->
putRow(rows[i], cols, values[i], numCols);
146 if (fvx == NULL || fvy == NULL) {
162 #endif // _fei_MatrixTraits_FillableMat_hpp_
static int matvec(FillableMat *mat, fei::Vector *x, fei::Vector *y)
static const char * typeName()
static int getNumLocalRows(FillableMat *mat, int &numRows)
std::vector< int > & indices()
const CSVec * getRow(int row) const
static int getOffset(FillableMat *, int, int)
static int globalAssemble(FillableMat *mat)
static int putValuesIn(FillableMat *mat, int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sum_into)
static int copyOutRow(FillableMat *mat, int row, int len, double *coefs, int *indices)
static double * getBeginPointer(FillableMat *)
static int getRowLength(FillableMat *mat, int row, int &length)
void putRow(int row, const int *cols, const double *coefs, unsigned len)
void setValues(double value)
void sumInRow(int row, const int *cols, const double *coefs, unsigned len)
T * getUnderlyingVector()
void multiply_CSRMat_CSVec(const CSRMat &A, const CSVec &x, CSVec &y)
unsigned getNumRows() const
static int setValues(FillableMat *mat, double scalar)
std::vector< double > & coefs()