Ipopt Documentation  
 
Loading...
Searching...
No Matches
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// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6
7#ifndef __IPIDENTITYMATRIX_HPP__
8#define __IPIDENTITYMATRIX_HPP__
9
10#include "IpUtils.hpp"
11#include "IpSymMatrix.hpp"
12
13namespace Ipopt
14{
15
18{
19public:
22
27 );
28
32
36 )
37 {
38 factor_ = factor;
39 }
40
43 {
44 return factor_;
45 }
46
48 Index Dim() const;
49
50protected:
53 virtual void MultVectorImpl(
55 const Vector& x,
57 Vector& y
58 ) const;
59
60 virtual void AddMSinvZImpl(
62 const Vector& S,
63 const Vector& Z,
64 Vector& X
65 ) const;
66
67 virtual bool HasValidNumbersImpl() const;
68
69 virtual void ComputeRowAMaxImpl(
71 bool init
72 ) const;
73
74 virtual void PrintImpl(
75 const Journalist& jnlst,
78 const std::string& name,
80 const std::string& prefix
81 ) const;
83
84private:
94
96
99 const IdentityMatrix&
100 );
101
104 const IdentityMatrix&
105 );
107
110};
111
114{
115public:
118
120 Index dim
121 )
123 { }
124
127 { }
129
131 {
132 return MakeNewIdentityMatrix();
133 }
134
137 {
138 return new IdentityMatrix(this);
139 }
140
141private:
151
153
157 );
158
162 );
164};
165
166} // namespace Ipopt
167#endif
Templated class which stores one entry for the CachedResult class.
This is the matrix space for IdentityMatrix.
IdentityMatrixSpace()
Default Constructor.
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
void operator=(const IdentityMatrixSpace &)
Default Assignment Operator.
IdentityMatrix * MakeNewIdentityMatrix() const
Method for creating a new matrix of this specific type.
IdentityMatrixSpace(const IdentityMatrixSpace &)
Copy Constructor.
IdentityMatrixSpace(Index dim)
Constructor, given the dimension of the matrix.
virtual ~IdentityMatrixSpace()
Destructor.
Class for Matrices which are multiples of the identity matrix.
IdentityMatrix()
Default Constructor.
virtual void AddMSinvZImpl(Number alpha, const Vector &S, const Vector &Z, Vector &X) const
X = X + alpha*(Matrix S^{-1} Z).
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
void operator=(const IdentityMatrix &)
Default Assignment Operator.
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Number factor_
Scaling factor for this identity matrix.
Number GetFactor() const
Method for getting the factor for the identity matrix.
Index Dim() const
Method for obtaining the dimension of the matrix.
void SetFactor(Number factor)
Method for setting the factor for the identity matrix.
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
IdentityMatrix(const SymMatrixSpace *owner_space)
Constructor, initializing with dimensions of the matrix (true identity matrix).
IdentityMatrix(const IdentityMatrix &)
Copy Constructor.
~IdentityMatrix()
Destructor.
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.
Class responsible for all message output.
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