Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpSumSymMatrix.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: IpSumSymMatrix.hpp 2269 2013-05-05 11:32:40Z stefan $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9 #ifndef __IPSUMSYMMATRIX_HPP__
10 #define __IPSUMSYMMATRIX_HPP__
11
12 #include "IpUtils.hpp"
13 #include "IpSymMatrix.hpp"
14
15 namespace Ipopt
16 {
17
18 /* forward declarations */
19 class SumSymMatrixSpace;
20
24 class SumSymMatrix : public SymMatrix
25 {
26 public:
27
30
34 SumSymMatrix(const SumSymMatrixSpace* owner_space);
35
37 ~SumSymMatrix();
39
42 void SetTerm(Index iterm, Number factor, const SymMatrix& matrix);
43
46 void GetTerm(Index iterm, Number& factor, SmartPtr<const SymMatrix>& matrix) const;
47
49 Index NTerms() const;
50
51 protected:
54 virtual void MultVectorImpl(Number alpha, const Vector& x,
55 Number beta, Vector& y) const;
56
59 virtual bool HasValidNumbersImpl() const;
60
61 virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
62
63 virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) const;
64
65 virtual void PrintImpl(const Journalist& jnlst,
66 EJournalLevel level,
67 EJournalCategory category,
68 const std::string& name,
69 Index indent,
70 const std::string& prefix) const;
72
73 private:
83 SumSymMatrix();
84
86 SumSymMatrix(const SumSymMatrix&);
87
89 void operator=(const SumSymMatrix&);
91
93 std::vector<Number> factors_;
94
96 std::vector<SmartPtr<const SymMatrix> > matrices_;
97
99 const SumSymMatrixSpace* owner_space_;
100 };
101
103 class SumSymMatrixSpace : public SymMatrixSpace
104 {
105 public:
110 SumSymMatrixSpace(Index ndim, Index nterms)
111 :
112 SymMatrixSpace(ndim),
113 nterms_(nterms)
114 {}
115
117 ~SumSymMatrixSpace()
118 {}
120
124 Index NTerms() const
125 {
126 return nterms_;
127 }
129
133 void SetTermSpace(Index term_idx, const SymMatrixSpace& space);
134
136 SmartPtr<const SymMatrixSpace> GetTermSpace(Index term_idx) const;
137
139 SumSymMatrix* MakeNewSumSymMatrix() const;
140
143 virtual SymMatrix* MakeNewSymMatrix() const;
144
145 private:
146 Index nterms_;
147
148 std::vector< SmartPtr<const SymMatrixSpace> > term_spaces_;
149 };
150
151 } // namespace Ipopt
152 #endif
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::SumSymMatrixSpace::MakeNewSymMatrix
virtual SymMatrix * MakeNewSymMatrix() const
Overloaded MakeNew method for the SymMatrixSpace base class.
IpUtils.hpp
Ipopt::SumSymMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::SumSymMatrix::factors_
std::vector< Number > factors_
std::vector storing the factors for each term.
Definition: IpSumSymMatrix.hpp:93
Ipopt::SumSymMatrixSpace::GetTermSpace
SmartPtr< const SymMatrixSpace > GetTermSpace(Index term_idx) const
Get the matix space for a particular term.
IpSymMatrix.hpp
Ipopt::SumSymMatrix::matrices_
std::vector< SmartPtr< const SymMatrix > > matrices_
std::vector storing the matrices for each term.
Definition: IpSumSymMatrix.hpp:96
Ipopt::SumSymMatrixSpace::SetTermSpace
void SetTermSpace(Index term_idx, const SymMatrixSpace &space)
Use this method to set the matrix spaces for the various terms.
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::SumSymMatrixSpace::term_spaces_
std::vector< SmartPtr< const SymMatrixSpace > > term_spaces_
Definition: IpSumSymMatrix.hpp:148
Ipopt::SumSymMatrixSpace::NTerms
Index NTerms() const
Number of terms in the sum.
Definition: IpSumSymMatrix.hpp:124
Ipopt::SumSymMatrixSpace
Class for matrix space for SumSymMatrix.
Definition: IpSumSymMatrix.hpp:103
Ipopt::SumSymMatrix::NTerms
Index NTerms() const
Return the number of terms.
Ipopt::SumSymMatrixSpace::~SumSymMatrixSpace
~SumSymMatrixSpace()
Destructor.
Definition: IpSumSymMatrix.hpp:117
Ipopt::SumSymMatrix::operator=
void operator=(const SumSymMatrix &)
Overloaded Equals Operator.
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
Ipopt::SumSymMatrix::~SumSymMatrix
~SumSymMatrix()
Destructor.
Ipopt::SumSymMatrixSpace::SumSymMatrixSpace
SumSymMatrixSpace(Index ndim, Index nterms)
Constructor, given the dimension of the matrix and the number of terms in the sum.
Definition: IpSumSymMatrix.hpp:110
Ipopt::SymMatrix
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:23
Ipopt::SumSymMatrix::GetTerm
void GetTerm(Index iterm, Number &factor, SmartPtr< const SymMatrix > &matrix) const
Method for getting term iterm for the sum.
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::SumSymMatrixSpace::MakeNewSumSymMatrix
SumSymMatrix * MakeNewSumSymMatrix() const
Method for creating a new matrix of this specific type.
Ipopt::SumSymMatrix
Class for Matrices which are sum of symmetric matrices.
Definition: IpSumSymMatrix.hpp:24
Ipopt::SumSymMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::SymMatrixSpace
SymMatrixSpace base class, corresponding to the SymMatrix base class.
Definition: IpSymMatrix.hpp:81
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::SumSymMatrix::owner_space_
const SumSymMatrixSpace * owner_space_
Copy of the owner_space as a SumSymMatrixSpace.
Definition: IpSumSymMatrix.hpp:99
Ipopt::SumSymMatrix::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::SumSymMatrixSpace::nterms_
Index nterms_
Definition: IpSumSymMatrix.hpp:146
Ipopt::SumSymMatrix::SumSymMatrix
SumSymMatrix()
Default Constructor.
Ipopt::SumSymMatrix::ComputeColAMaxImpl
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Since the matrix is symmetric, the row and column max norms are identical.
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70
Ipopt::SumSymMatrix::SetTerm
void SetTerm(Index iterm, Number factor, const SymMatrix &matrix)
Method for setting term iterm for the sum.
Ipopt::SumSymMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).