Ipopt Documentation  
IpLowRankUpdateSymMatrix.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, 2008 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors: Andreas Waechter IBM 2005-12-25
6 
7 #ifndef __IPLOWRANKUPDATESYMMATRIX_HPP__
8 #define __IPLOWRANKUPDATESYMMATRIX_HPP__
9 
10 #include "IpUtils.hpp"
11 #include "IpSymMatrix.hpp"
12 #include "IpMultiVectorMatrix.hpp"
13 
14 namespace Ipopt
15 {
16 
17 /* forward declarations */
18 class LowRankUpdateSymMatrixSpace;
19 
32 {
33 public:
38  const LowRankUpdateSymMatrixSpace* owner_space
39  );
40 
44 
46  void SetDiag(
47  const Vector& D
48  )
49  {
50  D_ = &D;
51  ObjectChanged();
52  }
53 
56  {
57  return D_;
58  }
59 
61  void SetV(
62  const MultiVectorMatrix& V
63  )
64  {
65  V_ = &V;
66  ObjectChanged();
67  }
68 
71  {
72  return V_;
73  }
74 
76  void SetU(
77  const MultiVectorMatrix& U
78  )
79  {
80  U_ = &U;
81  ObjectChanged();
82  }
83 
86  {
87  return U_;
88  }
89 
94 
97 
101  bool ReducedDiag() const;
102 
103 protected:
106  virtual void MultVectorImpl(
107  Number alpha,
108  const Vector& x,
109  Number beta,
110  Vector& y
111  ) const;
112 
113  virtual bool HasValidNumbersImpl() const;
114 
115  virtual void ComputeRowAMaxImpl(
116  Vector& rows_norms,
117  bool init
118  ) const;
119 
120  virtual void ComputeColAMaxImpl(
121  Vector& cols_norms,
122  bool init
123  ) const;
124 
125  virtual void PrintImpl(
126  const Journalist& jnlst,
127  EJournalLevel level,
128  EJournalCategory category,
129  const std::string& name,
130  Index indent,
131  const std::string& prefix
132  ) const;
134 
135 private:
147 
151  );
152 
154  void operator=(
156  );
158 
161 
164 
167 
170 };
171 
174 {
175 public:
180  Index dim,
183  bool reduced_diag
184  )
185  : SymMatrixSpace(dim),
188  reduced_diag_(reduced_diag)
189  {
191  }
192 
195  { }
197 
198  virtual SymMatrix* MakeNewSymMatrix() const
199  {
201  }
202 
205  {
206  return new LowRankUpdateSymMatrix(this);
207  }
208 
210  {
211  return P_LowRank_;
212  }
213 
215  {
216  return lowrank_vector_space_;
217  }
218 
219  bool ReducedDiag() const
220  {
221  return reduced_diag_;
222  }
223 
224 private:
236 
240  );
241 
243  void operator=(
245  );
247 
254 
257 
262 };
263 
265 {
266  return owner_space_->P_LowRank();
267 }
268 
270 {
271  return owner_space_->LowRankVectorSpace();
272 }
273 
275 {
276  return owner_space_->ReducedDiag();
277 }
278 
279 } // namespace Ipopt
280 #endif
IpUtils.hpp
Ipopt::LowRankUpdateSymMatrixSpace
This is the matrix space for LowRankUpdateSymMatrix.
Definition: IpLowRankUpdateSymMatrix.hpp:174
Ipopt::LowRankUpdateSymMatrix::ComputeColAMaxImpl
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Implementation of ComputeColAMaxImpl, which calls ComputeRowAMaxImpl.
Ipopt::LowRankUpdateSymMatrix::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::LowRankUpdateSymMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Ipopt::MultiVectorMatrix
Class for Matrices with few columns that consists of Vectors.
Definition: IpMultiVectorMatrix.hpp:25
Ipopt::LowRankUpdateSymMatrix::SetV
void SetV(const MultiVectorMatrix &V)
Method for setting the positive low-rank update part.
Definition: IpLowRankUpdateSymMatrix.hpp:61
Ipopt::LowRankUpdateSymMatrix::GetDiag
SmartPtr< const Vector > GetDiag() const
Method for getting the diagonal elements.
Definition: IpLowRankUpdateSymMatrix.hpp:55
Ipopt::LowRankUpdateSymMatrixSpace::ReducedDiag
bool ReducedDiag() const
Definition: IpLowRankUpdateSymMatrix.hpp:219
Ipopt::LowRankUpdateSymMatrixSpace::MakeNewLowRankUpdateSymMatrix
LowRankUpdateSymMatrix * MakeNewLowRankUpdateSymMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpLowRankUpdateSymMatrix.hpp:204
Ipopt::LowRankUpdateSymMatrixSpace::lowrank_vector_space_
SmartPtr< const VectorSpace > lowrank_vector_space_
Vector space for the space in which the low-rank approximation lives.
Definition: IpLowRankUpdateSymMatrix.hpp:256
Ipopt::LowRankUpdateSymMatrix::GetU
SmartPtr< const MultiVectorMatrix > GetU() const
Method for getting the negative low-rank update part.
Definition: IpLowRankUpdateSymMatrix.hpp:85
IpMultiVectorMatrix.hpp
Ipopt::LowRankUpdateSymMatrix::LowRankUpdateSymMatrix
LowRankUpdateSymMatrix()
Default Constructor.
Ipopt::LowRankUpdateSymMatrixSpace::LowRankVectorSpace
SmartPtr< const VectorSpace > LowRankVectorSpace() const
Definition: IpLowRankUpdateSymMatrix.hpp:214
Ipopt::LowRankUpdateSymMatrix::owner_space_
SmartPtr< const LowRankUpdateSymMatrixSpace > owner_space_
corresponding matrix space
Definition: IpLowRankUpdateSymMatrix.hpp:160
Ipopt::LowRankUpdateSymMatrix::LowRankVectorSpace
SmartPtr< const VectorSpace > LowRankVectorSpace() const
Return the vector space in with the low-rank update vectors live.
Definition: IpLowRankUpdateSymMatrix.hpp:269
Ipopt
This file contains a base class for all exceptions and a set of macros to help with exceptions.
Definition: IpInexactAlgBuilder.hpp:14
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Ipopt::LowRankUpdateSymMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::TaggedObject::ObjectChanged
void ObjectChanged()
Objects derived from TaggedObject MUST call this method every time their internal state changes to up...
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:32
Ipopt::LowRankUpdateSymMatrixSpace::LowRankUpdateSymMatrixSpace
LowRankUpdateSymMatrixSpace(Index dim, SmartPtr< const Matrix > P_LowRank, SmartPtr< const VectorSpace > LowRankVectorSpace, bool reduced_diag)
Constructor, given the dimension of the matrix.
Definition: IpLowRankUpdateSymMatrix.hpp:179
Ipopt::LowRankUpdateSymMatrixSpace::~LowRankUpdateSymMatrixSpace
virtual ~LowRankUpdateSymMatrixSpace()
Destructor.
Definition: IpLowRankUpdateSymMatrix.hpp:194
Ipopt::LowRankUpdateSymMatrix::D_
SmartPtr< const Vector > D_
Vector storing the diagonal matrix D.
Definition: IpLowRankUpdateSymMatrix.hpp:163
Ipopt::LowRankUpdateSymMatrix::ReducedDiag
bool ReducedDiag() const
Flag indicating whether the diagonal term lives in the smaller space (from P_LowRank) or in the full ...
Definition: IpLowRankUpdateSymMatrix.hpp:274
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Ipopt::LowRankUpdateSymMatrix::LowRankUpdateSymMatrix
LowRankUpdateSymMatrix(const LowRankUpdateSymMatrixSpace *owner_space)
Constructor, given the corresponding matrix space.
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::LowRankUpdateSymMatrix::SetDiag
void SetDiag(const Vector &D)
Method for setting the diagonal elements (as a Vector).
Definition: IpLowRankUpdateSymMatrix.hpp:46
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:52
Ipopt::LowRankUpdateSymMatrixSpace::LowRankUpdateSymMatrixSpace
LowRankUpdateSymMatrixSpace(const LowRankUpdateSymMatrixSpace &)
Copy Constructor.
Ipopt::LowRankUpdateSymMatrixSpace::LowRankUpdateSymMatrixSpace
LowRankUpdateSymMatrixSpace()
Default Constructor.
Ipopt::LowRankUpdateSymMatrix::P_LowRank
SmartPtr< const Matrix > P_LowRank() const
Return the expansion matrix to lift the low-rank update to the higher-dimensional space.
Definition: IpLowRankUpdateSymMatrix.hpp:264
IpSymMatrix.hpp
Ipopt::LowRankUpdateSymMatrix::~LowRankUpdateSymMatrix
~LowRankUpdateSymMatrix()
Destructor.
Ipopt::LowRankUpdateSymMatrixSpace::P_LowRank
SmartPtr< const Matrix > P_LowRank() const
Definition: IpLowRankUpdateSymMatrix.hpp:209
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:117
Ipopt::LowRankUpdateSymMatrixSpace::operator=
void operator=(const LowRankUpdateSymMatrixSpace &)
Default Assignment Operator.
Ipopt::LowRankUpdateSymMatrixSpace::MakeNewSymMatrix
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
Definition: IpLowRankUpdateSymMatrix.hpp:198
Ipopt::SymMatrix
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:21
Ipopt::LowRankUpdateSymMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::LowRankUpdateSymMatrix::GetV
SmartPtr< const MultiVectorMatrix > GetV() const
Method for getting the positive low-rank update part.
Definition: IpLowRankUpdateSymMatrix.hpp:70
Ipopt::SymMatrixSpace
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:86
Ipopt::IsValid
bool IsValid(const SmartPtr< U > &smart_ptr)
Definition: IpSmartPtr.hpp:674
Ipopt::LowRankUpdateSymMatrix::V_
SmartPtr< const MultiVectorMatrix > V_
Vector storing the positive low-rank update.
Definition: IpLowRankUpdateSymMatrix.hpp:166
Ipopt::LowRankUpdateSymMatrixSpace::P_LowRank_
SmartPtr< const Matrix > P_LowRank_
Expansion matrix to lift the low-rank approximation into a possibly higher-dimensional space.
Definition: IpLowRankUpdateSymMatrix.hpp:253
Ipopt::LowRankUpdateSymMatrix::LowRankUpdateSymMatrix
LowRankUpdateSymMatrix(const LowRankUpdateSymMatrix &)
Copy Constructor.
Ipopt::LowRankUpdateSymMatrix::SetU
void SetU(const MultiVectorMatrix &U)
Method for setting the negative low-rank update part.
Definition: IpLowRankUpdateSymMatrix.hpp:76
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:28
Ipopt::LowRankUpdateSymMatrixSpace::reduced_diag_
bool reduced_diag_
Flag indicating whether the diagonal matrix is nonzero only in the space of V or in the full space.
Definition: IpLowRankUpdateSymMatrix.hpp:261
Ipopt::LowRankUpdateSymMatrix::operator=
void operator=(const LowRankUpdateSymMatrix &)
Default Assignment Operator.
Ipopt::LowRankUpdateSymMatrix
Class for symmetric matrices, represented as low-rank updates.
Definition: IpLowRankUpdateSymMatrix.hpp:32
Ipopt::LowRankUpdateSymMatrix::U_
SmartPtr< const MultiVectorMatrix > U_
Vector storing the negative low-rank update.
Definition: IpLowRankUpdateSymMatrix.hpp:169
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:48