Ipopt Documentation  
 
Loading...
Searching...
No Matches
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
13namespace Ipopt
14{
15
21{
22public:
23
26
29 );
30
34
36 void SetDiag(
37 const Vector& diag
38 )
39 {
40 diag_ = &diag;
41 }
42
45 {
46 return diag_;
47 }
48
49protected:
52 virtual void MultVectorImpl(
54 const Vector& x,
56 Vector& y
57 ) const;
58
59 virtual bool HasValidNumbersImpl() const;
60
61 virtual void ComputeRowAMaxImpl(
63 bool init
64 ) const;
65
66 virtual void PrintImpl(
67 const Journalist& jnlst,
70 const std::string& name,
72 const std::string& prefix
73 ) const;
75
76private:
85
87
90 const DiagMatrix&
91 );
92
95 const DiagMatrix&
96 );
98
101};
102
105{
106public:
109
111 Index dim
112 )
114 { }
115
118 { }
120
122 {
123 return MakeNewDiagMatrix();
124 }
125
128 {
129 return new DiagMatrix(this);
130 }
131
132private:
141
143
146 const DiagMatrixSpace&
147 );
148
151 const DiagMatrixSpace&
152 );
154
155};
156
157} // namespace Ipopt
158#endif
Templated class which stores one entry for the CachedResult class.
This is the matrix space for DiagMatrix.
DiagMatrix * MakeNewDiagMatrix() const
Method for creating a new matrix of this specific type.
DiagMatrixSpace(Index dim)
Constructor, given the dimension of the matrix.
DiagMatrixSpace(const DiagMatrixSpace &)
Copy Constructor.
DiagMatrixSpace()
Default Constructor.
void operator=(const DiagMatrixSpace &)
Default Assignment Operator.
virtual ~DiagMatrixSpace()
Destructor.
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
Class for diagonal matrices.
DiagMatrix()
Default Constructor.
SmartPtr< const Vector > GetDiag() const
Get the diagonal elements.
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.
DiagMatrix(const SymMatrixSpace *owner_space)
Constructor, given the corresponding matrix space.
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
void operator=(const DiagMatrix &)
Default Assignment Operator.
~DiagMatrix()
Destructor.
void SetDiag(const Vector &diag)
Set the diagonal elements (as a Vector).
SmartPtr< const Vector > diag_
Vector storing the diagonal elements.
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
DiagMatrix(const DiagMatrix &)
Copy Constructor.
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