Ipopt Documentation  
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 
13 namespace Ipopt
14 {
15 
18 {
19 public:
26  const SymMatrixSpace* owner_space
27  );
28 
32 
34  void SetFactor(
35  Number factor
36  )
37  {
38  factor_ = factor;
39  }
40 
42  Number GetFactor() const
43  {
44  return factor_;
45  }
46 
48  Index Dim() const;
49 
50 protected:
53  virtual void MultVectorImpl(
54  Number alpha,
55  const Vector& x,
56  Number beta,
57  Vector& y
58  ) const;
59 
60  virtual void AddMSinvZImpl(
61  Number alpha,
62  const Vector& S,
63  const Vector& Z,
64  Vector& X
65  ) const;
66 
67  virtual bool HasValidNumbersImpl() const;
68 
69  virtual void ComputeRowAMaxImpl(
70  Vector& rows_norms,
71  bool init
72  ) const;
73 
74  virtual void PrintImpl(
75  const Journalist& jnlst,
76  EJournalLevel level,
77  EJournalCategory category,
78  const std::string& name,
79  Index indent,
80  const std::string& prefix
81  ) const;
83 
84 private:
96 
99  const IdentityMatrix&
100  );
101 
103  void operator=(
104  const IdentityMatrix&
105  );
107 
110 };
111 
114 {
115 public:
120  Index dim
121  )
122  : SymMatrixSpace(dim)
123  { }
124 
127  { }
129 
130  virtual SymMatrix* MakeNewSymMatrix() const
131  {
132  return MakeNewIdentityMatrix();
133  }
134 
137  {
138  return new IdentityMatrix(this);
139  }
140 
141 private:
153 
156  const IdentityMatrixSpace&
157  );
158 
160  void operator=(
161  const IdentityMatrixSpace&
162  );
164 };
165 
166 } // namespace Ipopt
167 #endif
Ipopt::IdentityMatrixSpace
This is the matrix space for IdentityMatrix.
Definition: IpIdentityMatrix.hpp:114
IpUtils.hpp
Ipopt::IdentityMatrix::~IdentityMatrix
~IdentityMatrix()
Destructor.
Ipopt::IdentityMatrix::AddMSinvZImpl
virtual void AddMSinvZImpl(Number alpha, const Vector &S, const Vector &Z, Vector &X) const
X = X + alpha*(Matrix S^{-1} Z).
Ipopt::IdentityMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Ipopt::IdentityMatrix::IdentityMatrix
IdentityMatrix(const SymMatrixSpace *owner_space)
Constructor, initializing with dimensions of the matrix (true identity matrix).
Ipopt
This file contains a base class for all exceptions and a set of macros to help with exceptions.
Definition: IpInexactAlgBuilder.hpp:14
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Ipopt::IdentityMatrix::factor_
Number factor_
Scaling factor for this identity matrix.
Definition: IpIdentityMatrix.hpp:109
Ipopt::IdentityMatrix::SetFactor
void SetFactor(Number factor)
Method for setting the factor for the identity matrix.
Definition: IpIdentityMatrix.hpp:34
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:32
Ipopt::IdentityMatrixSpace::~IdentityMatrixSpace
virtual ~IdentityMatrixSpace()
Destructor.
Definition: IpIdentityMatrix.hpp:126
IPOPTLIB_EXPORT
#define IPOPTLIB_EXPORT
Definition: config_default.h:16
Ipopt::IdentityMatrixSpace::operator=
void operator=(const IdentityMatrixSpace &)
Default Assignment Operator.
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Ipopt::IdentityMatrix::GetFactor
Number GetFactor() const
Method for getting the factor for the identity matrix.
Definition: IpIdentityMatrix.hpp:42
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:52
Ipopt::IdentityMatrixSpace::IdentityMatrixSpace
IdentityMatrixSpace(Index dim)
Constructor, given the dimension of the matrix.
Definition: IpIdentityMatrix.hpp:119
Ipopt::IdentityMatrix
Class for Matrices which are multiples of the identity matrix.
Definition: IpIdentityMatrix.hpp:18
Ipopt::IdentityMatrix::IdentityMatrix
IdentityMatrix(const IdentityMatrix &)
Copy Constructor.
IpSymMatrix.hpp
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::IdentityMatrix::operator=
void operator=(const IdentityMatrix &)
Default Assignment Operator.
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:117
Ipopt::SymMatrix
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:21
Ipopt::IdentityMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::IdentityMatrix::IdentityMatrix
IdentityMatrix()
Default Constructor.
Ipopt::IdentityMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::SymMatrixSpace
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:86
Ipopt::IdentityMatrix::Dim
Index Dim() const
Method for obtaining the dimension of the matrix.
Ipopt::IdentityMatrixSpace::IdentityMatrixSpace
IdentityMatrixSpace()
Default Constructor.
Ipopt::IdentityMatrixSpace::IdentityMatrixSpace
IdentityMatrixSpace(const IdentityMatrixSpace &)
Copy Constructor.
Ipopt::IdentityMatrixSpace::MakeNewIdentityMatrix
IdentityMatrix * MakeNewIdentityMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpIdentityMatrix.hpp:136
Ipopt::IdentityMatrixSpace::MakeNewSymMatrix
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
Definition: IpIdentityMatrix.hpp:130
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:48