Ipopt Documentation  
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
const Number * Values() const
Retrieve the array that stores the matrix elements.
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
const DenseSymMatrixSpace * owner_space_
Number * Values()
Retrieve the array for storing the matrix elements.
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Vector Base Class.
Definition: IpVector.hpp:47
Class for dense symmetric matrices.
Dense Vector Implementation.
Number * values_
Array for storing the matrix elements (one columns after each other)
EJournalLevel
Print Level Enum.
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:20
SmartPtr< DenseSymMatrix > MakeNewDenseSymMatrix() const
Create a new DenseSymMatrix from same MatrixSpace.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:171
This is the matrix space for DenseSymMatrix.
bool initialized_
Flag indicating whether the values_ array has been initialized.
Class for Matrices with few columns that consists of Vectors.
DenseSymMatrix * MakeNewDenseSymMatrix() const
Method for creating a new matrix of this specific type.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:28
#define IPOPTLIB_EXPORT
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:85
Class for dense general matrices.
Class responsible for all message output.
EJournalCategory
Category Selection Enum.