Ipopt Documentation  
 
Loading...
Searching...
No Matches
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"
13#include "IpDenseVector.hpp"
14
15namespace Ipopt
16{
17
19class DenseSymMatrixSpace;
20class DenseGenMatrix;
21
28{
29public:
32
35 );
36
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
70 Number factor = 1.
71 );
72
79 const DenseSymMatrix& A,
81 );
82
89 bool trans,
91 const DenseGenMatrix& V,
93 );
94
102 const MultiVectorMatrix& V1,
103 const MultiVectorMatrix& V2,
105 );
106
115 const DenseVector& D,
116 const DenseGenMatrix& L
117 );
118
119protected:
122 virtual void MultVectorImpl(
124 const Vector& x,
125 Number beta,
126 Vector& y
127 ) const;
128
129 virtual bool HasValidNumbersImpl() const;
130
131 virtual void ComputeRowAMaxImpl(
133 bool init
134 ) const;
135
136 virtual void PrintImpl(
137 const Journalist& jnlst,
140 const std::string& name,
142 const std::string& prefix
143 ) const;
145
146private:
155
157
160 const DenseSymMatrix&
161 );
162
165 const DenseSymMatrix&
166 );
168
170
173
176};
177
180{
181public:
184
189 Index nDim
190 );
191
196
199 {
200 return new DenseSymMatrix(this);
201 }
202
204 {
205 return MakeNewDenseSymMatrix();
206 }
207
208};
209
211{
212 return owner_space_->MakeNewDenseSymMatrix();
213}
214
215} // namespace Ipopt
216#endif
#define DBG_ASSERT(test)
Definition IpDebug.hpp:27
Class for dense general matrices.
This is the matrix space for DenseSymMatrix.
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
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 symmetric 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 &)
Default Assignment 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.
Templated class which stores one entry for the CachedResult class.
Class responsible for all message output.
Class for Matrices with few columns that consists of Vectors.
SymMatrixSpace base class, corresponding to the SymMatrix base class.
This is the base class for all derived symmetric matrix types.
Vector Base Class.
Definition IpVector.hpp:48
#define IPOPTLIB_EXPORT
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:20
EJournalCategory
Category Selection Enum.
EJournalLevel
Print Level Enum.
ipnumber Number
Type of all numbers.
Definition IpTypes.hpp:17