#include <IpMultiVectorMatrix.hpp>
Those matrices are for example useful in the implementation of limited memory quasi-Newton methods.
Public Member Functions | |
SmartPtr< MultiVectorMatrix > | MakeNewMultiVectorMatrix () const |
Create a new MultiVectorMatrix from same MatrixSpace. | |
SmartPtr< const Vector > | GetVector (Index i) const |
Get a Vector in a particular column as a const Vector. | |
SmartPtr< Vector > | GetVectorNonConst (Index i) |
Get a Vector in a particular column as a non-const Vector. | |
void | ScaleRows (const Vector &scal_vec) |
Method for scaling the rows of the matrix, using the ElementWiseMultiply method for each column vector. | |
void | ScaleColumns (const Vector &scal_vec) |
Method for scaling the columns of the matrix, using the Scal method for each column vector. | |
void | AddOneMultiVectorMatrix (Number a, const MultiVectorMatrix &mv1, Number c) |
Adding another MultiVectorMatrix, using the AddOneVector methods for the individual column vectors. | |
void | AddRightMultMatrix (Number a, const MultiVectorMatrix &U, const Matrix &C, Number b) |
Multiplying a Matrix C (for now assumed to be a DenseGenMatrix) from the right to a MultiVectorMatrix U and adding the result to this MultiVectorMatrix V. | |
void | FillWithNewVectors () |
Method for initializing all Vectors with new (uninitialized) Vectors. | |
void | LRMultVector (Number alpha, const Vector &x, Number beta, Vector &y) const |
Method for adding the low-rank update matrix corresponding to this matrix to a vector. | |
SmartPtr< const VectorSpace > | ColVectorSpace () const |
Vector space for the columns. | |
SmartPtr< const MultiVectorMatrixSpace > | MultiVectorMatrixOwnerSpace () const |
Return the MultiVectorMatrixSpace. | |
Constructors / Destructors | |
MultiVectorMatrix (const MultiVectorMatrixSpace *owner_space) | |
Constructor, taking the owner_space. | |
~MultiVectorMatrix () | |
Destructor. | |
void | SetVector (Index i, const Vector &vec) |
Set a particular Vector at a given column position, replacing another vector if there has been one. | |
void | SetVectorNonConst (Index i, Vector &vec) |
Set a particular Vector at a given column position, replacing another vector if there has been one. | |
Protected Member Functions | |
Overloaded methods from Matrix base class | |
virtual void | MultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan). | |
virtual void | TransMultVectorImpl (Number alpha, const Vector &x, Number beta, Vector &y) const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan). | |
virtual bool | HasValidNumbersImpl () const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan). | |
virtual void | PrintImpl (const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan). |
MultiVectorMatrix | ( | const MultiVectorMatrixSpace * | owner_space | ) |
Constructor, taking the owner_space.
~MultiVectorMatrix | ( | ) | [inline] |
Destructor.
SmartPtr< MultiVectorMatrix > MakeNewMultiVectorMatrix | ( | ) | const [inline] |
Create a new MultiVectorMatrix from same MatrixSpace.
References MultiVectorMatrixSpace::MakeNewMultiVectorMatrix().
Set a particular Vector at a given column position, replacing another vector if there has been one.
Depending on whether the Vector is const or not, it is stored in the const or non-const internal column.
References DBG_ASSERT, Matrix::NCols(), and TaggedObject::ObjectChanged().
Set a particular Vector at a given column position, replacing another vector if there has been one.
Depending on whether the Vector is const or not, it is stored in the const or non-const internal column.
References DBG_ASSERT, Matrix::NCols(), and TaggedObject::ObjectChanged().
Get a Vector in a particular column as a const Vector.
Referenced by MultiVectorMatrix::AddOneMultiVectorMatrix(), DenseSymMatrix::HighRankUpdateTranspose(), and DenseGenMatrix::HighRankUpdateTranspose().
Get a Vector in a particular column as a non-const Vector.
This is fail if the column has currently only a non-const Vector stored.
References TaggedObject::ObjectChanged().
void ScaleRows | ( | const Vector & | scal_vec | ) |
Method for scaling the rows of the matrix, using the ElementWiseMultiply method for each column vector.
References DBG_ASSERT, Vector::Dim(), Vector::ElementWiseMultiply(), fkinkryx::i, Matrix::NCols(), Matrix::NRows(), and TaggedObject::ObjectChanged().
void ScaleColumns | ( | const Vector & | scal_vec | ) |
Method for scaling the columns of the matrix, using the Scal method for each column vector.
References DBG_ASSERT, Vector::Dim(), fkinkryx::i, Matrix::NCols(), TaggedObject::ObjectChanged(), and Vector::Scal().
void AddOneMultiVectorMatrix | ( | Number | a, | |
const MultiVectorMatrix & | mv1, | |||
Number | c | |||
) |
Adding another MultiVectorMatrix, using the AddOneVector methods for the individual column vectors.
References Vector::AddOneVector(), DBG_ASSERT, MultiVectorMatrix::FillWithNewVectors(), MultiVectorMatrix::GetVector(), fkinkryx::i, Matrix::NCols(), Matrix::NRows(), and TaggedObject::ObjectChanged().
void AddRightMultMatrix | ( | Number | a, | |
const MultiVectorMatrix & | U, | |||
const Matrix & | C, | |||
Number | b | |||
) |
Multiplying a Matrix C (for now assumed to be a DenseGenMatrix) from the right to a MultiVectorMatrix U and adding the result to this MultiVectorMatrix V.
V = a * U * C + b * V.
References DBG_ASSERT, MultiVectorMatrix::FillWithNewVectors(), fkinkryx::i, Matrix::MultVector(), Matrix::NCols(), Matrix::NRows(), TaggedObject::ObjectChanged(), and DenseGenMatrix::Values().
void FillWithNewVectors | ( | ) |
Method for initializing all Vectors with new (uninitialized) Vectors.
References MultiVectorMatrixSpace::ColVectorSpace(), fkinkryx::i, Matrix::NCols(), and TaggedObject::ObjectChanged().
Referenced by MultiVectorMatrix::AddOneMultiVectorMatrix(), and MultiVectorMatrix::AddRightMultMatrix().
Method for adding the low-rank update matrix corresponding to this matrix to a vector.
If V is this MultiVectorMatrix, the operation is y = beta*y + alpha*V*V^T*x.
References Vector::AddOneVector(), DBG_ASSERT, DBG_PRINT, DBG_PRINT_VECTOR, DBG_START_METH, Vector::Dim(), fkinkryx::i, Matrix::NCols(), Matrix::NRows(), Vector::Scal(), and Vector::Set().
SmartPtr< const VectorSpace > ColVectorSpace | ( | ) | const [inline] |
SmartPtr< const MultiVectorMatrixSpace > MultiVectorMatrixOwnerSpace | ( | ) | const [inline] |
Return the MultiVectorMatrixSpace.
void MultVectorImpl | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [protected, virtual] |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Implements Matrix.
References Vector::AddOneVector(), DBG_ASSERT, Vector::Dim(), fkinkryx::i, DenseVector::IsHomogeneous(), Matrix::NCols(), Matrix::NRows(), Vector::Scal(), DenseVector::Scalar(), Vector::Set(), and DenseVector::Values().
void TransMultVectorImpl | ( | Number | alpha, | |
const Vector & | x, | |||
Number | beta, | |||
Vector & | y | |||
) | const [protected, virtual] |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Implements Matrix.
References DBG_ASSERT, Vector::Dim(), Vector::Dot(), fkinkryx::i, Matrix::NCols(), and Matrix::NRows().
bool HasValidNumbersImpl | ( | ) | const [protected, virtual] |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Reimplemented from Matrix.
References Vector::HasValidNumbers(), fkinkryx::i, and Matrix::NCols().
void PrintImpl | ( | const Journalist & | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent, | |||
const std::string & | prefix | |||
) | const [protected, virtual] |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Implements Matrix.
References DBG_ASSERT, fkinkryx::i, Matrix::NCols(), Vector::Print(), Journalist::Printf(), and Journalist::PrintfIndented().