9 #ifndef __IPCOMPOUNDSYMMATRIX_HPP__ 10 #define __IPCOMPOUNDSYMMATRIX_HPP__ 19 class CompoundSymMatrixSpace;
65 return Comp(irow,jcol);
96 const std::string& name,
98 const std::string& prefix)
const;
121 std::vector<std::vector<SmartPtr<Matrix> > >
comps_;
140 if (
IsValid(comps_[irow][jcol])) {
143 else if (
IsValid(const_comps_[irow][jcol])) {
144 return GetRawPtr(const_comps_[irow][jcol]);
158 if (
IsValid(comps_[irow][jcol])) {
202 bool auto_allocate =
false);
212 return comp_spaces_[irow][jcol];
219 return ncomp_spaces_;
273 bool DimensionsSet()
const;
bool matrices_valid_
boolean indicating if the compound matrix is in a "valid" state
bool IsValid(const SmartPtr< U > &smart_ptr)
SmartPtr< const MatrixSpace > GetCompSpace(Index irow, Index jcol) const
Obtain the component MatrixSpace in block row irow and block column jcol.
Number * x
Input: Starting point Output: Optimal solution.
bool dimensions_set_
boolean indicating if the compound matrix space is in a "valid" state
std::vector< std::vector< SmartPtr< const Matrix > > > const_comps_
Vector of vectors containing the const components.
std::vector< std::vector< bool > > allocate_block_
2-dim std::vector of booleans deciding whether to allocate a new matrix for the blocks automagically ...
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
SmartPtr< const Matrix > GetComp(Index irow, Index jcol) const
Method for retrieving one block from the compound matrix.
SmartPtr< Matrix > GetCompNonConst(Index irow, Index jcol)
Non const version of GetComp.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Matrix * Comp(Index irow, Index jcol)
Internal method to return a non-const pointer to one of the comps.
~CompoundSymMatrix()
Destructor.
void SetCompNonConst(Index irow, Index jcol, Matrix &matrix)
Non const version of the same method.
double Number
Type of all numbers.
void ObjectChanged()
Objects derived from TaggedObject MUST call this method every time their internal state changes to up...
bool IsNull(const SmartPtr< U > &smart_ptr)
std::vector< Index > block_dim_
Vector of the number of rows in each comp column, Since this is symmetric, this is also the number of...
CompoundSymMatrix()
Default Constructor.
Index NComps_Dim() const
Number of block rows and columns.
EJournalLevel
Print Level Enum.
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
CompoundSymMatrix * MakeNewCompoundSymMatrix() const
Method for creating a new matrix of this specific type.
Class for symmetric matrices consisting of other matrices.
This is the base class for all derived symmetric matrix types.
virtual void PrintImpl(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
Print detailed information about the matrix.
Template class for Smart Pointers.
const Matrix * ConstComp(Index irow, Index jcol) const
Internal method to return a const pointer to one of the comps.
virtual SymMatrix * MakeNewSymMatrix() const
Overloaded MakeNew method for the SymMatrixSpace base class.
U * GetRawPtr(const SmartPtr< U > &smart_ptr)
bool MatricesValid() const
method to check wether or not the matrices are valid
MatrixSpace base class, corresponding to the Matrix base class.
std::vector< std::vector< SmartPtr< Matrix > > > comps_
Vector of vectors containing the components.
int Index
Type of all indices of vectors, matrices etc.
This is the matrix space for CompoundSymMatrix.
const CompoundSymMatrixSpace * owner_space_
Copy of the owner_space ptr as a CompoundSymMatrixSpace.
SmartPtr< CompoundSymMatrix > MakeNewCompoundSymMatrix() const
Method for creating a new matrix of this specific type.
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Index ncomp_spaces_
Number of components per row and column.
Class responsible for all message output.
void SetComp(Index irow, Index jcol, const Matrix &matrix)
Method for setting an individual component at position (irow, icol) in the compound matrix...
void operator=(const CompoundSymMatrix &)
Overloaded Equals Operator.
EJournalCategory
Category Selection Enum.
std::vector< std::vector< SmartPtr< const MatrixSpace > > > comp_spaces_
2-dim std::vector of matrix spaces for the components.
~CompoundSymMatrixSpace()
Destructor.