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++) {
virtual unsigned int numCols() const
Not implemented yet.
A class representing a vector space.
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 numRowsGlobal() const
Not implemented yet.
virtual unsigned int numRowsLocal() const
Not implemented yet.
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
virtual void print(std::ostream &os) const
Print method. Defines the behavior of operator<< inherited from the Object class. ...
std::vector< VectorSpace< GslVector, GslMatrix > * > m_vectorSpaces
Class for matrix operations using GSL library.
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.
virtual void zeroLower(bool includeDiagonal=false)
Not implemented yet.
unsigned int numBlocks() const
Return the number of blocks in the block diagonal matrix.
Class for matrix operations (virtual).
~GslBlockMatrix()
Destructor.
Class for representing block matrices using GSL library.
GslMatrix & getBlock(unsigned int i) const
Return block i in the block diagonal matrix.
Class for vector operations using GSL library.
void print(std::ostream &os) const
Print method. Defines the behavior of the ostream << operator inherited from the Object class...
std::vector< GslMatrix * > m_blocks
unsigned int sizeLocal() const
Returns the length of this vector.
const BaseEnvironment & m_env
QUESO environment variable.
virtual int chol()
Not implemented yet.
virtual void zeroUpper(bool includeDiagonal=false)
Not implemented yet.