Ipopt 3.11.9
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// $Id: IpLowRankUpdateSymMatrix.hpp 1861 2010-12-21 21:34:47Z andreasw $
6//
7// Authors: Andreas Waechter IBM 2005-12-25
8
9#ifndef __IPLOWRANKUPDATESYMMATRIX_HPP__
10#define __IPLOWRANKUPDATESYMMATRIX_HPP__
11
12#include "IpUtils.hpp"
13#include "IpSymMatrix.hpp"
15
16namespace Ipopt
17{
18
19 /* forward declarations */
20 class LowRankUpdateSymMatrixSpace;
21
32 {
33 public:
34
37
40
44
46 void SetDiag(const Vector& D)
47 {
48 D_ = &D;
50 }
51
54 {
55 return D_;
56 }
57
59 void SetV(const MultiVectorMatrix& V)
60 {
61 V_ = &V;
63 }
64
67 {
68 return V_;
69 }
70
72 void SetU(const MultiVectorMatrix& U)
73 {
74 U_ = &U;
76 }
77
80 {
81 return U_;
82 }
83
87
91
94 bool ReducedDiag() const;
95
96 protected:
99 virtual void MultVectorImpl(Number alpha, const Vector& x,
100 Number beta, Vector& y) const;
101
104 virtual bool HasValidNumbersImpl() const;
105
106 virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
107
108 virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) const;
109
110 virtual void PrintImpl(const Journalist& jnlst,
111 EJournalLevel level,
112 EJournalCategory category,
113 const std::string& name,
114 Index indent,
115 const std::string& prefix) const;
117
118 private:
129
132
136
139
142
145
148 };
149
152 {
153 public:
160 bool reduced_diag)
161 :
162 SymMatrixSpace(dim),
165 reduced_diag_(reduced_diag)
166 {
168 }
169
172 {}
174
178 {
180 }
181
184 {
185 return new LowRankUpdateSymMatrix(this);
186 }
187
189 {
190 return P_LowRank_;
191 }
192
194 {
196 }
197
198 bool ReducedDiag() const
199 {
200 return reduced_diag_;
201 }
202
203 private:
214
217
221
226
230
234 };
235
236 inline
238 {
239 return owner_space_->P_LowRank();
240 }
241
242 inline
244 {
245 return owner_space_->LowRankVectorSpace();
246 }
247
248 inline
250 {
251 return owner_space_->ReducedDiag();
252 }
253
254} // namespace Ipopt
255#endif
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Number * x
Input: Starting point Output: Optimal solution.
Class responsible for all message output.
This is the matrix space for LowRankUpdateSymMatrix.
SmartPtr< const Matrix > P_LowRank_
Expansion matrix to lift the low-rank approximation into a possibly higher-dimensional space.
SmartPtr< const Matrix > P_LowRank() const
LowRankUpdateSymMatrix * MakeNewLowRankUpdateSymMatrix() const
Method for creating a new matrix of this specific type.
LowRankUpdateSymMatrixSpace(Index dim, SmartPtr< const Matrix > P_LowRank, SmartPtr< const VectorSpace > LowRankVectorSpace, bool reduced_diag)
Constructor, given the dimension of the matrix.
LowRankUpdateSymMatrixSpace()
Default Constructor.
void operator=(const LowRankUpdateSymMatrixSpace &)
Overloaded Equals Operator.
SmartPtr< const VectorSpace > LowRankVectorSpace() const
bool reduced_diag_
Flag indicating whether the diagonal matrix is nonzero only in the space of V or in the full space.
virtual SymMatrix * MakeNewSymMatrix() const
Overloaded MakeNew method for the SymMatrixSpace base class.
SmartPtr< const VectorSpace > lowrank_vector_space_
Vector space for the space in which the low-rank approximation lives.
LowRankUpdateSymMatrixSpace(const LowRankUpdateSymMatrixSpace &)
Copy Constructor.
Class for symmetric matrices, represented as low-rank updates.
SmartPtr< const Matrix > P_LowRank() const
Return the expansion matrix to lift the low-rank update to the higher-dimensional space.
SmartPtr< const Vector > D_
Vector storing the diagonal matrix D.
SmartPtr< const Vector > GetDiag() const
Method for getting the diagonal elements.
SmartPtr< const MultiVectorMatrix > U_
Vector storing the negative low-rank update.
void SetDiag(const Vector &D)
Method for setting the diagonal elements (as a Vector).
SmartPtr< const VectorSpace > LowRankVectorSpace() const
Return the vector space in with the low-rank update vectors live.
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Since the matrix is symmetric, the row and column max norms are identical.
SmartPtr< const MultiVectorMatrix > GetU() const
Method for getting the negative low-rank update part.
SmartPtr< const LowRankUpdateSymMatrixSpace > owner_space_
corresponding matrix space
SmartPtr< const MultiVectorMatrix > GetV() const
Method for getting the positive low-rank update part.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
LowRankUpdateSymMatrix()
Default Constructor.
bool ReducedDiag() const
Flag indicating whether the diagonal term lives in the smaller space (from P_LowRank) or in the full ...
LowRankUpdateSymMatrix(const LowRankUpdateSymMatrixSpace *owner_space)
Constructor, given the corresponding matrix space.
void SetU(const MultiVectorMatrix &U)
Method for setting the negative low-rank update part.
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
void SetV(const MultiVectorMatrix &V)
Method for setting the positive low-rank update part.
SmartPtr< const MultiVectorMatrix > V_
Vector storing the positive low-rank update.
~LowRankUpdateSymMatrix()
Destructor.
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 LowRankUpdateSymMatrix &)
Overloaded Equals Operator.
LowRankUpdateSymMatrix(const LowRankUpdateSymMatrix &)
Copy Constructor.
Class for Matrices with few columns that consists of Vectors.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:183
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:82
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:24
void ObjectChanged()
Objects derived from TaggedObject MUST call this method every time their internal state changes to up...
Vector Base Class.
Definition: IpVector.hpp:48
bool IsValid(const SmartPtr< U > &smart_ptr)
Definition: IpSmartPtr.hpp:589
EJournalCategory
Category Selection Enum.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
EJournalLevel
Print Level Enum.
double Number
Type of all numbers.
Definition: IpTypes.hpp:17