Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpDenseSymMatrix.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: IpDenseSymMatrix.hpp 2269 2013-05-05 11:32:40Z stefan $
6 //
7 // Authors: Andreas Waechter IBM 2005-12-25
8
9 #ifndef __IPDENSESYMMATRIX_HPP__
10 #define __IPDENSESYMMATRIX_HPP__
11
12 #include "IpUtils.hpp"
13 #include "IpSymMatrix.hpp"
14 #include "IpMultiVectorMatrix.hpp"
15 #include "IpDenseVector.hpp"
16
17 namespace Ipopt
18 {
19
21 class DenseSymMatrixSpace;
22
25 class DenseGenMatrix;
26
31 class DenseSymMatrix : public SymMatrix
32 {
33 public:
34
37
40 DenseSymMatrix(const DenseSymMatrixSpace* owner_space);
41
43 ~DenseSymMatrix();
45
47 SmartPtr<DenseSymMatrix> MakeNewDenseSymMatrix() const;
48
53 Number* Values()
54 {
55 ObjectChanged();
56 initialized_ = true;
57 return values_;
58 }
59
63 const Number* Values() const
64 {
65 DBG_ASSERT(initialized_);
66 return values_;
67 }
68
70 void FillIdentity(Number factor=1.);
71
74 void AddMatrix(Number alpha, const DenseSymMatrix& A, Number beta);
75
79 void HighRankUpdate(bool trans, Number alpha, const DenseGenMatrix& V,
80 Number beta);
81
85 void HighRankUpdateTranspose(Number alpha,
86 const MultiVectorMatrix& V1,
87 const MultiVectorMatrix& V2,
88 Number beta);
89
95 void SpecialAddForLMSR1(const DenseVector& D, const DenseGenMatrix& L);
96
97 protected:
100 virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta,
101 Vector &y) const;
102
105 virtual bool HasValidNumbersImpl() const;
106
107 virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
108
109 virtual void PrintImpl(const Journalist& jnlst,
110 EJournalLevel level,
111 EJournalCategory category,
112 const std::string& name,
113 Index indent,
114 const std::string& prefix) const;
116
117
118 private:
128 DenseSymMatrix();
129
131 DenseSymMatrix(const DenseSymMatrix&);
132
134 void operator=(const DenseSymMatrix&);
136
137 const DenseSymMatrixSpace* owner_space_;
138
141 Number* values_;
142
144 bool initialized_;
145 };
146
149 class DenseSymMatrixSpace : public SymMatrixSpace
150 {
151 public:
157 DenseSymMatrixSpace(Index nDim);
158
160 ~DenseSymMatrixSpace()
161 {}
163
165 DenseSymMatrix* MakeNewDenseSymMatrix() const
166 {
167 return new DenseSymMatrix(this);
168 }
169
172 virtual SymMatrix* MakeNewSymMatrix() const
173 {
174 return MakeNewDenseSymMatrix();
175 }
176
177 };
178
179 inline
180 SmartPtr<DenseSymMatrix> DenseSymMatrix::MakeNewDenseSymMatrix() const
181 {
182 return owner_space_->MakeNewDenseSymMatrix();
183 }
184
185 } // namespace Ipopt
186 #endif
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::DenseSymMatrix::FillIdentity
void FillIdentity(Number factor=1.)
Set this matrix to be a multiple of the identity matrix.
Ipopt::DenseSymMatrix::Values
const Number * Values() const
Retrieve the array that stores the matrix elements.
Definition: IpDenseSymMatrix.hpp:63
IpUtils.hpp
Ipopt::DenseSymMatrixSpace::DenseSymMatrixSpace
DenseSymMatrixSpace(Index nDim)
Constructor for matrix space for DenseSymMatrices.
Ipopt::DenseSymMatrixSpace::MakeNewSymMatrix
virtual SymMatrix * MakeNewSymMatrix() const
Overloaded MakeNew method for the MatrixSpace base class.
Definition: IpDenseSymMatrix.hpp:172
IpSymMatrix.hpp
Ipopt::DenseSymMatrix::owner_space_
const DenseSymMatrixSpace * owner_space_
Definition: IpDenseSymMatrix.hpp:137
Ipopt::DenseSymMatrix::Values
Number * Values()
Retrieve the array for storing the matrix elements.
Definition: IpDenseSymMatrix.hpp:53
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::TaggedObject::ObjectChanged
void ObjectChanged()
Objects derived from TaggedObject MUST call this method every time their internal state changes to up...
Definition: IpTaggedObject.hpp:117
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::DenseSymMatrix
Class for dense symetrix matrices.
Definition: IpDenseSymMatrix.hpp:31
Ipopt::DenseVector
Dense Vector Implementation.
Definition: IpDenseVector.hpp:40
Ipopt::DenseSymMatrix::~DenseSymMatrix
~DenseSymMatrix()
Destructor.
Ipopt::DenseSymMatrix::values_
Number * values_
Array for storing the matrix elements (one columns after each other)
Definition: IpDenseSymMatrix.hpp:141
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
IpMultiVectorMatrix.hpp
Ipopt::DenseSymMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::SymMatrix
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:23
Ipopt::DenseSymMatrix::MakeNewDenseSymMatrix
SmartPtr< DenseSymMatrix > MakeNewDenseSymMatrix() const
Create a new DenseSymMatrix from same MatrixSpace.
Definition: IpDenseSymMatrix.hpp:180
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::DenseSymMatrixSpace
This is the matrix space for DenseSymMatrix.
Definition: IpDenseSymMatrix.hpp:149
Ipopt::DenseSymMatrix::initialized_
bool initialized_
Flag indicating whether the values_ array has been initialized.
Definition: IpDenseSymMatrix.hpp:144
Ipopt::DenseSymMatrix::AddMatrix
void AddMatrix(Number alpha, const DenseSymMatrix &A, Number beta)
Method for adding another matrix to this one.
Ipopt::DenseSymMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::DenseSymMatrix::operator=
void operator=(const DenseSymMatrix &)
Overloaded Equals Operator.
Ipopt::DenseSymMatrix::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::MultiVectorMatrix
Class for Matrices with few columns that consists of Vectors.
Definition: IpMultiVectorMatrix.hpp:25
Ipopt::DenseSymMatrixSpace::~DenseSymMatrixSpace
~DenseSymMatrixSpace()
Destructor.
Definition: IpDenseSymMatrix.hpp:160
Ipopt::DenseSymMatrix::DenseSymMatrix
DenseSymMatrix()
Default Constructor.
Ipopt::DenseSymMatrixSpace::MakeNewDenseSymMatrix
DenseSymMatrix * MakeNewDenseSymMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpDenseSymMatrix.hpp:165
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
IpDenseVector.hpp
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::DenseSymMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Ipopt::SymMatrixSpace
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:81
Ipopt::DenseGenMatrix
Class for dense general matrices.
Definition: IpDenseGenMatrix.hpp:26
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::DenseSymMatrix::HighRankUpdateTranspose
void HighRankUpdateTranspose(Number alpha, const MultiVectorMatrix &V1, const MultiVectorMatrix &V2, Number beta)
Method for adding a high-rank update to this matrix.
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70
Ipopt::DenseSymMatrix::HighRankUpdate
void HighRankUpdate(bool trans, Number alpha, const DenseGenMatrix &V, Number beta)
Method for adding a high-rank update to this matrix.
Ipopt::DenseSymMatrix::SpecialAddForLMSR1
void SpecialAddForLMSR1(const DenseVector &D, const DenseGenMatrix &L)
Method for doing a specialized Add operation, required in the limited memory SR1 update.