25 #include <queso/GslBlockMatrix.h>
31 :
Matrix(v.env(), v.map()),
32 m_vectorSpaces(blockSizes.size()),
33 m_blocks(blockSizes.size())
37 "block_param_", blockSizes[i], NULL);
107 unsigned int totalCols = 0;
109 for (
unsigned int i = 0; i < this->
m_blocks.size(); i++) {
110 totalCols += this->
m_blocks[i]->numCols();
121 unsigned int blockOffset = 0;
124 for (
unsigned int i = 0; i < this->
m_blocks.size(); i++) {
129 for (
unsigned int j = 0; j < this->
m_blocks[i]->numCols(); j++) {
130 blockRHS[j] = b[blockOffset + j];
134 this->
m_blocks[i]->invertMultiply(blockRHS, blockSol);
137 for (
unsigned int j = 0; j < this->
m_blocks[i]->numCols(); j++) {
138 x[blockOffset + j] = blockSol[j];
143 blockOffset += this->
m_blocks[i]->numCols();
150 for (
unsigned int i = 0; i < this->
numBlocks(); i++) {
virtual void zeroLower(bool includeDiagonal=false)
Not implemented yet.
Class for matrix operations using GSL library.
const BaseEnvironment & m_env
QUESO environment variable.
Class for matrix operations (virtual).
GslBlockMatrix(const std::vector< unsigned int > &blockSizes, const GslVector &v, double diagValue)
Creates a square matrix with size defined by v and diagonal values all equal to diagValue.
unsigned int sizeLocal() const
Returns the length of this vector.
virtual void zeroUpper(bool includeDiagonal=false)
Not implemented yet.
#define queso_error_msg(msg)
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::vector< GslMatrix * > m_blocks
virtual unsigned int numCols() const
Not implemented yet.
GslMatrix & getBlock(unsigned int i) const
Return block i in the block diagonal matrix.
virtual int chol()
Not implemented yet.
Class for representing block matrices using GSL library.
void print(std::ostream &os) const
Print method. Defines the behavior of the ostream << operator inherited from the Object class...
Class for vector operations using GSL library.
#define queso_not_implemented()
virtual unsigned int numRowsGlobal() const
Not implemented yet.
~GslBlockMatrix()
Destructor.
virtual void print(std::ostream &os) const
Print method. Defines the behavior of operator<< inherited from the Object class. ...
void invertMultiply(const GslVector &b, GslVector &x) const
This function calculates the inverse of this matrix, multiplies it with vector b and stores the resul...
virtual unsigned int numRowsLocal() const
Not implemented yet.
A class representing a vector space.
std::vector< VectorSpace< GslVector, GslMatrix > * > m_vectorSpaces
unsigned int numBlocks() const
Return the number of blocks in the block diagonal matrix.