Ipopt Documentation  
IpDiagMatrix.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 __IPDIAGMATRIX_HPP__
8 #define __IPDIAGMATRIX_HPP__
9 
10 #include "IpUtils.hpp"
11 #include "IpSymMatrix.hpp"
12 
13 namespace Ipopt
14 {
15 
21 {
22 public:
23 
28  const SymMatrixSpace* owner_space
29  );
30 
34 
36  void SetDiag(
37  const Vector& diag
38  )
39  {
40  diag_ = &diag;
41  }
42 
45  {
46  return diag_;
47  }
48 
49 protected:
52  virtual void MultVectorImpl(
53  Number alpha,
54  const Vector& x,
55  Number beta,
56  Vector& y
57  ) const;
58 
59  virtual bool HasValidNumbersImpl() const;
60 
61  virtual void ComputeRowAMaxImpl(
62  Vector& rows_norms,
63  bool init
64  ) const;
65 
66  virtual void PrintImpl(
67  const Journalist& jnlst,
68  EJournalLevel level,
69  EJournalCategory category,
70  const std::string& name,
71  Index indent,
72  const std::string& prefix
73  ) const;
75 
76 private:
87 
90  const DiagMatrix&
91  );
92 
94  void operator=(
95  const DiagMatrix&
96  );
98 
101 };
102 
105 {
106 public:
111  Index dim
112  )
113  : SymMatrixSpace(dim)
114  { }
115 
118  { }
120 
121  virtual SymMatrix* MakeNewSymMatrix() const
122  {
123  return MakeNewDiagMatrix();
124  }
125 
128  {
129  return new DiagMatrix(this);
130  }
131 
132 private:
143 
146  const DiagMatrixSpace&
147  );
148 
150  void operator=(
151  const DiagMatrixSpace&
152  );
154 
155 };
156 
157 } // namespace Ipopt
158 #endif
Ipopt::DiagMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
IpUtils.hpp
Ipopt::DiagMatrixSpace
This is the matrix space for DiagMatrix.
Definition: IpDiagMatrix.hpp:105
Ipopt::DiagMatrixSpace::DiagMatrixSpace
DiagMatrixSpace()
Default Constructor.
Ipopt::DiagMatrix::SetDiag
void SetDiag(const Vector &diag)
Set the diagonal elements (as a Vector).
Definition: IpDiagMatrix.hpp:36
Ipopt::DiagMatrix::diag_
SmartPtr< const Vector > diag_
Vector storing the diagonal elements.
Definition: IpDiagMatrix.hpp:100
Ipopt::DiagMatrixSpace::~DiagMatrixSpace
virtual ~DiagMatrixSpace()
Destructor.
Definition: IpDiagMatrix.hpp:117
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::DiagMatrix::DiagMatrix
DiagMatrix()
Default Constructor.
Ipopt::DiagMatrixSpace::MakeNewSymMatrix
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
Definition: IpDiagMatrix.hpp:121
Ipopt::DiagMatrix::~DiagMatrix
~DiagMatrix()
Destructor.
Ipopt::DiagMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:32
IPOPTLIB_EXPORT
#define IPOPTLIB_EXPORT
Definition: config_default.h:16
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Ipopt::DiagMatrix::GetDiag
SmartPtr< const Vector > GetDiag() const
Get the diagonal elements.
Definition: IpDiagMatrix.hpp:44
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:52
Ipopt::DiagMatrixSpace::MakeNewDiagMatrix
DiagMatrix * MakeNewDiagMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpDiagMatrix.hpp:127
IpSymMatrix.hpp
Ipopt::DiagMatrixSpace::operator=
void operator=(const DiagMatrixSpace &)
Default Assignment Operator.
Ipopt::DiagMatrix
Class for diagonal matrices.
Definition: IpDiagMatrix.hpp:21
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::DiagMatrixSpace::DiagMatrixSpace
DiagMatrixSpace(const DiagMatrixSpace &)
Copy Constructor.
Ipopt::DiagMatrix::DiagMatrix
DiagMatrix(const SymMatrixSpace *owner_space)
Constructor, given the corresponding matrix space.
Ipopt::SymMatrixSpace
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:86
Ipopt::DiagMatrix::DiagMatrix
DiagMatrix(const DiagMatrix &)
Copy Constructor.
Ipopt::DiagMatrix::operator=
void operator=(const DiagMatrix &)
Default Assignment Operator.
Ipopt::DiagMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:48
Ipopt::DiagMatrix::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::DiagMatrixSpace::DiagMatrixSpace
DiagMatrixSpace(Index dim)
Constructor, given the dimension of the matrix.
Definition: IpDiagMatrix.hpp:110