Ipopt Documentation  
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 // Authors: Andreas Waechter IBM 2005-12-25
6 
7 #ifndef __IPDENSESYMMATRIX_HPP__
8 #define __IPDENSESYMMATRIX_HPP__
9 
10 #include "IpUtils.hpp"
11 #include "IpSymMatrix.hpp"
12 #include "IpMultiVectorMatrix.hpp"
13 #include "IpDenseVector.hpp"
14 
15 namespace Ipopt
16 {
17 
19 class DenseSymMatrixSpace;
20 class DenseGenMatrix;
21 
28 {
29 public:
34  const DenseSymMatrixSpace* owner_space
35  );
36 
38  ~DenseSymMatrix();
40 
42  SmartPtr<DenseSymMatrix> MakeNewDenseSymMatrix() const;
43 
51  {
52  ObjectChanged();
53  initialized_ = true;
54  return values_;
55  }
56 
62  const Number* Values() const
63  {
64  DBG_ASSERT(initialized_);
65  return values_;
66  }
67 
69  void FillIdentity(
70  Number factor = 1.
71  );
72 
77  void AddMatrix(
78  Number alpha,
79  const DenseSymMatrix& A,
80  Number beta
81  );
82 
88  void HighRankUpdate(
89  bool trans,
90  Number alpha,
91  const DenseGenMatrix& V,
92  Number beta
93  );
94 
100  void HighRankUpdateTranspose(
101  Number alpha,
102  const MultiVectorMatrix& V1,
103  const MultiVectorMatrix& V2,
104  Number beta
105  );
106 
114  void SpecialAddForLMSR1(
115  const DenseVector& D,
116  const DenseGenMatrix& L
117  );
118 
119 protected:
122  virtual void MultVectorImpl(
123  Number alpha,
124  const Vector& x,
125  Number beta,
126  Vector& y
127  ) const;
128 
129  virtual bool HasValidNumbersImpl() const;
130 
131  virtual void ComputeRowAMaxImpl(
132  Vector& rows_norms,
133  bool init
134  ) const;
135 
136  virtual void PrintImpl(
137  const Journalist& jnlst,
138  EJournalLevel level,
139  EJournalCategory category,
140  const std::string& name,
141  Index indent,
142  const std::string& prefix
143  ) const;
145 
146 private:
156  DenseSymMatrix();
157 
160  const DenseSymMatrix&
161  );
162 
164  void operator=(
165  const DenseSymMatrix&
166  );
168 
170 
173 
176 };
177 
180 {
181 public:
189  Index nDim
190  );
191 
194  { }
196 
199  {
200  return new DenseSymMatrix(this);
201  }
202 
203  virtual SymMatrix* MakeNewSymMatrix() const
204  {
205  return MakeNewDenseSymMatrix();
206  }
207 
208 };
209 
211 {
213 }
214 
215 } // namespace Ipopt
216 #endif
IpUtils.hpp
Ipopt::DenseSymMatrix::owner_space_
const DenseSymMatrixSpace * owner_space_
Definition: IpDenseSymMatrix.hpp:169
Ipopt::DenseSymMatrixSpace
This is the matrix space for DenseSymMatrix.
Definition: IpDenseSymMatrix.hpp:179
Ipopt::MultiVectorMatrix
Class for Matrices with few columns that consists of Vectors.
Definition: IpMultiVectorMatrix.hpp:24
Ipopt::DenseSymMatrix::values_
Number * values_
Array for storing the matrix elements (one columns after each other)
Definition: IpDenseSymMatrix.hpp:172
IpMultiVectorMatrix.hpp
Ipopt::DenseGenMatrix
Class for dense general matrices.
Definition: IpDenseGenMatrix.hpp:25
Ipopt
This file contains a base class for all exceptions and a set of macros to help with exceptions.
Definition: IpInexactAlgBuilder.hpp:13
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Ipopt::DenseSymMatrixSpace::~DenseSymMatrixSpace
~DenseSymMatrixSpace()
Destructor.
Definition: IpDenseSymMatrix.hpp:193
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:31
Ipopt::DenseSymMatrix::Values
const Number * Values() const
Retrieve the array that stores the matrix elements.
Definition: IpDenseSymMatrix.hpp:62
Ipopt::DenseSymMatrix::Values
Number * Values()
Retrieve the array for storing the matrix elements.
Definition: IpDenseSymMatrix.hpp:50
IPOPTLIB_EXPORT
#define IPOPTLIB_EXPORT
Definition: config_default.h:16
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:171
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:51
IpDenseVector.hpp
IpSymMatrix.hpp
Ipopt::DenseSymMatrixSpace::MakeNewDenseSymMatrix
DenseSymMatrix * MakeNewDenseSymMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpDenseSymMatrix.hpp:198
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:116
Ipopt::SymMatrix
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:20
Ipopt::DenseSymMatrix
Class for dense symmetric matrices.
Definition: IpDenseSymMatrix.hpp:27
Ipopt::DenseSymMatrix::initialized_
bool initialized_
Flag indicating whether the values_ array has been initialized.
Definition: IpDenseSymMatrix.hpp:175
Ipopt::DenseVector
Dense Vector Implementation.
Definition: IpDenseVector.hpp:40
Ipopt::SymMatrixSpace
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:85
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:28
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::DenseSymMatrix::MakeNewDenseSymMatrix
SmartPtr< DenseSymMatrix > MakeNewDenseSymMatrix() const
Create a new DenseSymMatrix from same MatrixSpace.
Definition: IpDenseSymMatrix.hpp:210
Ipopt::DenseSymMatrixSpace::MakeNewSymMatrix
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
Definition: IpDenseSymMatrix.hpp:203