9 #ifndef __IPSUMMATRIX_HPP__
10 #define __IPSUMMATRIX_HPP__
68 const std::string& name,
70 const std::string& prefix)
const;
Number * x
Input: Starting point Output: Optimal solution.
Class responsible for all message output.
MatrixSpace base class, corresponding to the Matrix base class.
Template class for Smart Pointers.
Class for matrix space for SumMatrix.
SmartPtr< const MatrixSpace > GetTermSpace(Index term_idx) const
Get the matrix space for a particular term.
virtual ~SumMatrixSpace()
Destructor.
void SetTermSpace(Index term_idx, const MatrixSpace &mat_space)
Set the appropriate matrix space for each term.
SumMatrix * MakeNewSumMatrix() const
Method for creating a new matrix of this specific type.
SumMatrixSpace(const SumMatrixSpace &)
Copy Constructor.
Index NTerms() const
Accessor functions to get the number of terms in the sum.
SumMatrixSpace(Index nrows, Index ncols, Index nterms)
Constructor, given the number of row and columns, as well as the number of terms in the sum.
std::vector< SmartPtr< const MatrixSpace > > term_spaces_
SumMatrixSpace & operator=(const SumMatrixSpace &)
Overloaded Equals Operator.
SumMatrixSpace()
Default constructor.
virtual Matrix * MakeNew() const
Overloaded MakeNew method for the MatrixSpace base class.
Class for Matrices which are sum of matrices.
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
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.
void operator=(const SumMatrix &)
Overloaded Equals Operator.
SumMatrix(const SumMatrixSpace *owner_space)
Constructor, taking the owner_space.
Index NTerms() const
Return the number of terms.
SumMatrix()
Default Constructor.
const SumMatrixSpace * owner_space_
Copy of the owner_space as a SumMatrixSpace.
void GetTerm(Index iterm, Number &factor, SmartPtr< const Matrix > &matrix) const
Method for getting term iterm for the sum.
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
void SetTerm(Index iterm, Number factor, const Matrix &matrix)
Method for setting term iterm for the sum.
std::vector< Number > factors_
std::vector storing the factors for each term.
virtual ~SumMatrix()
Destructor.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
std::vector< SmartPtr< const Matrix > > matrices_
std::vector storing the matrices for each term.
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
SumMatrix(const SumMatrix &)
Copy Constructor.
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Compute the max-norm of the columns in the matrix.
EJournalCategory
Category Selection Enum.
int Index
Type of all indices of vectors, matrices etc.
EJournalLevel
Print Level Enum.
double Number
Type of all numbers.