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);
55 queso_not_implemented();
61 queso_not_implemented();
68 queso_not_implemented();
75 queso_not_implemented();
82 queso_not_implemented();
88 queso_not_implemented();
107 unsigned int totalCols = 0;
109 for (
unsigned int i = 0; i < this->
m_blocks.size(); i++) {
110 totalCols += this->
m_blocks[i]->numCols();
114 queso_error_msg(
"block matrix and rhs have incompatible sizes");
118 queso_error_msg(
"solution and rhs have incompatible sizes");
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++) {
Class for matrix operations using GSL library.
virtual unsigned int numCols() const
Not implemented yet.
virtual int chol()
Not implemented yet.
virtual void print(std::ostream &os) const
Print method. Defines the behavior of operator<< inherited from the Object class. ...
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
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...
Class for matrix operations (virtual).
virtual unsigned int numRowsGlobal() const
Not implemented yet.
Class for representing block matrices using GSL library.
~GslBlockMatrix()
Destructor.
A class representing a vector space.
unsigned int numBlocks() const
Return the number of blocks in the block diagonal matrix.
virtual unsigned int numRowsLocal() const
Not implemented yet.
Class for vector operations using GSL library.
std::vector< VectorSpace< GslVector, GslMatrix > * > m_vectorSpaces
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.
void print(std::ostream &os) const
Print method. Defines the behavior of the ostream << operator inherited from the Object class...
const BaseEnvironment & m_env
QUESO environment variable.
virtual void zeroLower(bool includeDiagonal=false)
Not implemented yet.
std::vector< GslMatrix * > m_blocks
GslMatrix & getBlock(unsigned int i) const
Return block i in the block diagonal matrix.
unsigned int sizeLocal() const
Returns the length of this vector.
virtual void zeroUpper(bool includeDiagonal=false)
Not implemented yet.