Ipopt  3.11.9
IpExpandedMultiVectorMatrix.hpp
Go to the documentation of this file.
1 // Copyright (C) 2009 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpExpandedMultiVectorMatrix.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Andreas Waechter IBM 2009-11-05
8 
9 #ifndef __IPEXPANDEDMULTIVECTORMATRIX_HPP__
10 #define __IPEXPANDEDMULTIVECTORMATRIX_HPP__
11 
12 #include "IpUtils.hpp"
13 #include "IpMatrix.hpp"
14 #include "IpExpansionMatrix.hpp"
15 
16 namespace Ipopt
17 {
18 
20  class ExpandedMultiVectorMatrixSpace;
21 
30  {
31  public:
32 
35 
39 
42  {}
44 
46 
50 
53  {
54  DBG_ASSERT(i < NRows());
55  return vecs_[i];
56  }
57 
60 
64 
68 
69  protected:
72  virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta,
73  Vector &y) const;
74 
75  virtual void TransMultVectorImpl(Number alpha, const Vector& x,
76  Number beta, Vector& y) const;
77 
80  virtual bool HasValidNumbersImpl() const;
81 
82  virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
83 
84  virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) const;
85 
86  virtual void PrintImpl(const Journalist& jnlst,
87  EJournalLevel level,
88  EJournalCategory category,
89  const std::string& name,
90  Index indent,
91  const std::string& prefix) const;
93 
94 
95  private:
106 
109 
113 
115 
117  std::vector<SmartPtr<const Vector> > vecs_;
118 
119  };
120 
124  {
125  public:
132  const VectorSpace& vec_space,
136  {}
138 
141  {
142  return new ExpandedMultiVectorMatrix(this);
143  }
144 
147  virtual Matrix* MakeNew() const
148  {
150  }
151 
154  {
155  return vec_space_;
156  }
157 
159  {
160  return exp_matrix_;
161  }
162 
163  private:
165 
167  };
168 
169  inline
171  {
173  }
174 
175  inline
177  {
178  return owner_space_->RowVectorSpace();
179  }
180 
181  inline
183  {
185  }
186 
187  inline
190  {
191  return owner_space_;
192  }
193 
194 } // namespace Ipopt
195 #endif
IpUtils.hpp
Ipopt::ExpandedMultiVectorMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::MatrixSpace
MatrixSpace base class, corresponding to the Matrix base class.
Definition: IpMatrix.hpp:239
Ipopt::ExpandedMultiVectorMatrix::~ExpandedMultiVectorMatrix
virtual ~ExpandedMultiVectorMatrix()
Destructor.
Definition: IpExpandedMultiVectorMatrix.hpp:41
Ipopt::ExpandedMultiVectorMatrix::SetVector
void SetVector(Index i, SmartPtr< const Vector > vec)
Set a particular Vector at a given row position, replacing another vector if there has been one.
Ipopt::ExpandedMultiVectorMatrixSpace::ExpandedMultiVectorMatrixSpace
ExpandedMultiVectorMatrixSpace(Index nrows, const VectorSpace &vec_space, SmartPtr< const ExpansionMatrix > exp_matrix)
Constructor, given the number of rows (i.e., Vectors to be stored) and given the VectorSpace for the ...
Ipopt::ExpandedMultiVectorMatrix::ExpandedMultiVectorMatrixOwnerSpace
SmartPtr< const ExpandedMultiVectorMatrixSpace > ExpandedMultiVectorMatrixOwnerSpace() const
Return the ExpandedMultiVectorMatrixSpace.
Definition: IpExpandedMultiVectorMatrix.hpp:189
Ipopt::ExpandedMultiVectorMatrix::MakeNewExpandedMultiVectorMatrix
SmartPtr< ExpandedMultiVectorMatrix > MakeNewExpandedMultiVectorMatrix() const
Definition: IpExpandedMultiVectorMatrix.hpp:170
Ipopt::ExpandedMultiVectorMatrixSpace::MakeNew
virtual Matrix * MakeNew() const
Overloaded MakeNew method for the MatrixSpace base class.
Definition: IpExpandedMultiVectorMatrix.hpp:147
Ipopt::ExpandedMultiVectorMatrix::TransMultVectorImpl
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
Ipopt
Definition: matlabjournal.hpp:14
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::ExpandedMultiVectorMatrix::RowVectorSpace
SmartPtr< const VectorSpace > RowVectorSpace() const
Vector space for the rows.
Definition: IpExpandedMultiVectorMatrix.hpp:176
Ipopt::ExpandedMultiVectorMatrixSpace::vec_space_
SmartPtr< const VectorSpace > vec_space_
Definition: IpExpandedMultiVectorMatrix.hpp:164
Ipopt::Matrix
Matrix Base Class.
Definition: IpMatrix.hpp:27
Ipopt::ExpandedMultiVectorMatrix::GetExpansionMatrix
SmartPtr< const ExpansionMatrix > GetExpansionMatrix() const
Return the Expansion matrix.
Definition: IpExpandedMultiVectorMatrix.hpp:182
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::ExpandedMultiVectorMatrix::owner_space_
const ExpandedMultiVectorMatrixSpace * owner_space_
Definition: IpExpandedMultiVectorMatrix.hpp:114
Ipopt::ExpandedMultiVectorMatrix::ExpandedMultiVectorMatrix
ExpandedMultiVectorMatrix()
Default Constructor.
Ipopt::ExpandedMultiVectorMatrix::PrintImpl
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.
Ipopt::ExpandedMultiVectorMatrixSpace::MakeNewExpandedMultiVectorMatrix
ExpandedMultiVectorMatrix * MakeNewExpandedMultiVectorMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpExpandedMultiVectorMatrix.hpp:140
Ipopt::ExpandedMultiVectorMatrix::operator=
void operator=(const ExpandedMultiVectorMatrix &)
Overloaded Equals Operator.
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:182
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70
Ipopt::Matrix::NRows
Index NRows() const
Number of rows.
Definition: IpMatrix.hpp:310
Ipopt::ExpandedMultiVectorMatrix::ComputeColAMaxImpl
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Compute the max-norm of the columns in the matrix.
Ipopt::ExpandedMultiVectorMatrixSpace::~ExpandedMultiVectorMatrixSpace
virtual ~ExpandedMultiVectorMatrixSpace()
Destructor.
Definition: IpExpandedMultiVectorMatrix.hpp:135
Ipopt::ExpandedMultiVectorMatrix
Class for Matrices with few rows that consists of Vectors, together with a premultiplied Expansion ma...
Definition: IpExpandedMultiVectorMatrix.hpp:29
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::ExpandedMultiVectorMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::VectorSpace
VectorSpace base class, corresponding to the Vector base class.
Definition: IpVector.hpp:390
IpMatrix.hpp
Ipopt::ExpandedMultiVectorMatrixSpace::RowVectorSpace
SmartPtr< const VectorSpace > RowVectorSpace() const
Accessor method for the VectorSpace for the rows.
Definition: IpExpandedMultiVectorMatrix.hpp:153
Ipopt::ExpandedMultiVectorMatrixSpace::GetExpansionMatrix
SmartPtr< const ExpansionMatrix > GetExpansionMatrix() const
Definition: IpExpandedMultiVectorMatrix.hpp:158
Ipopt::ExpandedMultiVectorMatrixSpace
This is the matrix space for ExpandedMultiVectorMatrix.
Definition: IpExpandedMultiVectorMatrix.hpp:123
Ipopt::ExpandedMultiVectorMatrixSpace::exp_matrix_
SmartPtr< const ExpansionMatrix > exp_matrix_
Definition: IpExpandedMultiVectorMatrix.hpp:166
Ipopt::ExpandedMultiVectorMatrix::GetVector
SmartPtr< const Vector > GetVector(Index i) const
Get a Vector in a particular row as a const Vector.
Definition: IpExpandedMultiVectorMatrix.hpp:52
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::ExpandedMultiVectorMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
IpExpansionMatrix.hpp
Ipopt::ExpandedMultiVectorMatrix::vecs_
std::vector< SmartPtr< const Vector > > vecs_
space for storing the const Vector's
Definition: IpExpandedMultiVectorMatrix.hpp:117
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47