Ipopt 3.11.9
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 1861 2010-12-21 21:34:47Z andreasw $
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"
15#include "IpDenseVector.hpp"
16
17namespace Ipopt
18{
19
21 class DenseSymMatrixSpace;
22
25 class DenseGenMatrix;
26
32 {
33 public:
34
37
41
45
48
54 {
56 initialized_ = true;
57 return values_;
58 }
59
63 const Number* Values() const
64 {
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
86 const MultiVectorMatrix& V1,
87 const MultiVectorMatrix& V2,
88 Number beta);
89
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:
129
132
136
138
142
145 };
146
150 {
151 public:
158
161 {}
163
166 {
167 return new DenseSymMatrix(this);
168 }
169
173 {
174 return MakeNewDenseSymMatrix();
175 }
176
177 };
178
179 inline
181 {
183 }
184
185} // namespace Ipopt
186#endif
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Number * x
Input: Starting point Output: Optimal solution.
Class for dense general matrices.
This is the matrix space for DenseSymMatrix.
virtual SymMatrix * MakeNewSymMatrix() const
Overloaded MakeNew method for the MatrixSpace base class.
DenseSymMatrixSpace(Index nDim)
Constructor for matrix space for DenseSymMatrices.
DenseSymMatrix * MakeNewDenseSymMatrix() const
Method for creating a new matrix of this specific type.
Class for dense symetrix matrices.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
SmartPtr< DenseSymMatrix > MakeNewDenseSymMatrix() const
Create a new DenseSymMatrix from same MatrixSpace.
DenseSymMatrix()
Default Constructor.
void HighRankUpdateTranspose(Number alpha, const MultiVectorMatrix &V1, const MultiVectorMatrix &V2, Number beta)
Method for adding a high-rank update to this matrix.
Number * Values()
Retrieve the array for storing the matrix elements.
void SpecialAddForLMSR1(const DenseVector &D, const DenseGenMatrix &L)
Method for doing a specialized Add operation, required in the limited memory SR1 update.
const Number * Values() const
Retrieve the array that stores the matrix elements.
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
void operator=(const DenseSymMatrix &)
Overloaded Equals Operator.
bool initialized_
Flag indicating whether the values_ array has been initialized.
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 FillIdentity(Number factor=1.)
Set this matrix to be a multiple of the identity matrix.
Number * values_
Array for storing the matrix elements (one columns after each other)
const DenseSymMatrixSpace * owner_space_
void HighRankUpdate(bool trans, Number alpha, const DenseGenMatrix &V, Number beta)
Method for adding a high-rank update to this matrix.
void AddMatrix(Number alpha, const DenseSymMatrix &A, Number beta)
Method for adding another matrix to this one.
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
DenseSymMatrix(const DenseSymMatrix &)
Copy Constructor.
DenseSymMatrix(const DenseSymMatrixSpace *owner_space)
Constructor, taking the owner_space.
~DenseSymMatrix()
Destructor.
Dense Vector Implementation.
Class responsible for all message output.
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
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