Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpIdentityMatrix.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2008 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpIdentityMatrix.hpp 2269 2013-05-05 11:32:40Z stefan $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9 #ifndef __IPIDENTITYMATRIX_HPP__
10 #define __IPIDENTITYMATRIX_HPP__
11
12 #include "IpUtils.hpp"
13 #include "IpSymMatrix.hpp"
14
15 namespace Ipopt
16 {
17
21 class IdentityMatrix : public SymMatrix
22 {
23 public:
24
27
31 IdentityMatrix(const SymMatrixSpace* owner_space);
32
34 ~IdentityMatrix();
36
38 void SetFactor(Number factor)
39 {
40 factor_ = factor;
41 }
42
44 Number GetFactor() const
45 {
46 return factor_;
47 }
48
50 Index Dim() const;
51
52 protected:
55 virtual void MultVectorImpl(Number alpha, const Vector& x,
56 Number beta, Vector& y) const;
57
58 virtual void AddMSinvZImpl(Number alpha, const Vector& S,
59 const Vector& Z, Vector& X) const;
60
63 virtual bool HasValidNumbersImpl() const;
64
65 virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
66
67 virtual void PrintImpl(const Journalist& jnlst,
68 EJournalLevel level,
69 EJournalCategory category,
70 const std::string& name,
71 Index indent,
72 const std::string& prefix) const;
74
75 private:
85 IdentityMatrix();
86
88 IdentityMatrix(const IdentityMatrix&);
89
91 void operator=(const IdentityMatrix&);
93
95 Number factor_;
96 };
97
99 class IdentityMatrixSpace : public SymMatrixSpace
100 {
101 public:
105 IdentityMatrixSpace(Index dim)
106 :
107 SymMatrixSpace(dim)
108 {}
109
111 virtual ~IdentityMatrixSpace()
112 {}
114
117 virtual SymMatrix* MakeNewSymMatrix() const
118 {
119 return MakeNewIdentityMatrix();
120 }
121
123 IdentityMatrix* MakeNewIdentityMatrix() const
124 {
125 return new IdentityMatrix(this);
126 }
127
128 private:
138 IdentityMatrixSpace();
139
141 IdentityMatrixSpace(const IdentityMatrixSpace&);
142
144 void operator=(const IdentityMatrixSpace&);
146 };
147
148 } // namespace Ipopt
149 #endif
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::IdentityMatrix::AddMSinvZImpl
virtual void AddMSinvZImpl(Number alpha, const Vector &S, const Vector &Z, Vector &X) const
X = X + alpha*(Matrix S^{-1} Z).
IpUtils.hpp
Ipopt::IdentityMatrix::factor_
Number factor_
Scaling factor for this identity matrix.
Definition: IpIdentityMatrix.hpp:95
Ipopt::IdentityMatrix::Dim
Index Dim() const
Method for obtaining the dimention of the matrix.
IpSymMatrix.hpp
Ipopt::IdentityMatrixSpace::IdentityMatrixSpace
IdentityMatrixSpace()
Default Constructor.
Ipopt::IdentityMatrix::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::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
Ipopt::SymMatrix
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:23
Ipopt::IdentityMatrix::IdentityMatrix
IdentityMatrix()
Default Constructor.
Ipopt::IdentityMatrixSpace
This is the matrix space for IdentityMatrix.
Definition: IpIdentityMatrix.hpp:99
Ipopt::IdentityMatrix
Class for Matrices which are multiples of the identity matrix.
Definition: IpIdentityMatrix.hpp:21
Ipopt::IdentityMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Ipopt::IdentityMatrixSpace::MakeNewIdentityMatrix
IdentityMatrix * MakeNewIdentityMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpIdentityMatrix.hpp:123
Ipopt::IdentityMatrixSpace::MakeNewSymMatrix
virtual SymMatrix * MakeNewSymMatrix() const
Overloaded MakeNew method for the SymMatrixSpace base class.
Definition: IpIdentityMatrix.hpp:117
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::IdentityMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::IdentityMatrix::SetFactor
void SetFactor(Number factor)
Method for setting the factor for the identity matrix.
Definition: IpIdentityMatrix.hpp:38
Ipopt::IdentityMatrixSpace::~IdentityMatrixSpace
virtual ~IdentityMatrixSpace()
Destructor.
Definition: IpIdentityMatrix.hpp:111
Ipopt::SymMatrixSpace
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:81
Ipopt::IdentityMatrix::operator=
void operator=(const IdentityMatrix &)
Overloaded Equals Operator.
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::IdentityMatrixSpace::operator=
void operator=(const IdentityMatrixSpace &)
Overloaded Equals Operator.
Ipopt::IdentityMatrixSpace::IdentityMatrixSpace
IdentityMatrixSpace(Index dim)
Constructor, given the dimension of the matrix.
Definition: IpIdentityMatrix.hpp:105
Ipopt::IdentityMatrix::GetFactor
Number GetFactor() const
Method for getting the factor for the identity matrix.
Definition: IpIdentityMatrix.hpp:44
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70
Ipopt::IdentityMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::IdentityMatrix::~IdentityMatrix
~IdentityMatrix()
Destructor.