Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpExpandedMultiVectorMatrix.hpp
Go to the documentation of this file.
1 // Copyright (C) 2009 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpExpandedMultiVectorMatrix.hpp 2269 2013-05-05 11:32:40Z stefan $
6 //
7 // Authors: Andreas Waechter IBM 2009-11-05
8
9 #ifndef __IPEXPANDEDMULTIVECTORMATRIX_HPP__
10 #define __IPEXPANDEDMULTIVECTORMATRIX_HPP__
11
12 #include "IpUtils.hpp"
13 #include "IpMatrix.hpp"
14 #include "IpExpansionMatrix.hpp"
15
16 namespace Ipopt
17 {
18
20 class ExpandedMultiVectorMatrixSpace;
21
29 class ExpandedMultiVectorMatrix : public Matrix
30 {
31 public:
32
35
38 ExpandedMultiVectorMatrix(const ExpandedMultiVectorMatrixSpace* owner_space);
39
41 virtual ~ExpandedMultiVectorMatrix()
42 {}
44
45 SmartPtr<ExpandedMultiVectorMatrix> MakeNewExpandedMultiVectorMatrix() const;
46
49 void SetVector(Index i, SmartPtr<const Vector> vec);
50
52 inline SmartPtr<const Vector> GetVector(Index i) const
53 {
54 DBG_ASSERT(i < NRows());
55 return vecs_[i];
56 }
57
59 SmartPtr<const VectorSpace> RowVectorSpace() const;
60
62 SmartPtr<const ExpandedMultiVectorMatrixSpace>
63 ExpandedMultiVectorMatrixOwnerSpace() const;
64
67 SmartPtr<const ExpansionMatrix> GetExpansionMatrix() const;
68
69 protected:
72 virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta,
73 Vector &y) const;
74
75 virtual void TransMultVectorImpl(Number alpha, const Vector& x,
76 Number beta, Vector& y) const;
77
80 virtual bool HasValidNumbersImpl() const;
81
82 virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
83
84 virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) const;
85
86 virtual void PrintImpl(const Journalist& jnlst,
87 EJournalLevel level,
88 EJournalCategory category,
89 const std::string& name,
90 Index indent,
91 const std::string& prefix) const;
93
94
95 private:
105 ExpandedMultiVectorMatrix();
106
108 ExpandedMultiVectorMatrix(const ExpandedMultiVectorMatrix&);
109
111 void operator=(const ExpandedMultiVectorMatrix&);
113
114 const ExpandedMultiVectorMatrixSpace* owner_space_;
115
117 std::vector<SmartPtr<const Vector> > vecs_;
118
119 };
120
123 class ExpandedMultiVectorMatrixSpace : public MatrixSpace
124 {
125 public:
131 ExpandedMultiVectorMatrixSpace(Index nrows,
132 const VectorSpace& vec_space,
133 SmartPtr<const ExpansionMatrix> exp_matrix);
135 virtual ~ExpandedMultiVectorMatrixSpace()
136 {}
138
140 ExpandedMultiVectorMatrix* MakeNewExpandedMultiVectorMatrix() const
141 {
142 return new ExpandedMultiVectorMatrix(this);
143 }
144
147 virtual Matrix* MakeNew() const
148 {
149 return MakeNewExpandedMultiVectorMatrix();
150 }
151
153 SmartPtr<const VectorSpace> RowVectorSpace() const
154 {
155 return vec_space_;
156 }
157
158 SmartPtr<const ExpansionMatrix> GetExpansionMatrix() const
159 {
160 return exp_matrix_;
161 }
162
163 private:
164 SmartPtr<const VectorSpace> vec_space_;
165
166 SmartPtr<const ExpansionMatrix> exp_matrix_;
167 };
168
169 inline
170 SmartPtr<ExpandedMultiVectorMatrix> ExpandedMultiVectorMatrix::MakeNewExpandedMultiVectorMatrix() const
171 {
172 return owner_space_->MakeNewExpandedMultiVectorMatrix();
173 }
174
175 inline
176 SmartPtr<const VectorSpace> ExpandedMultiVectorMatrix::RowVectorSpace() const
177 {
178 return owner_space_->RowVectorSpace();
179 }
180
181 inline
182 SmartPtr<const ExpansionMatrix> ExpandedMultiVectorMatrix::GetExpansionMatrix() const
183 {
184 return owner_space_->GetExpansionMatrix();
185 }
186
187 inline
188 SmartPtr<const ExpandedMultiVectorMatrixSpace>
189 ExpandedMultiVectorMatrix::ExpandedMultiVectorMatrixOwnerSpace() const
190 {
191 return owner_space_;
192 }
193
194 } // namespace Ipopt
195 #endif
Ipopt::ExpandedMultiVectorMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::ExpandedMultiVectorMatrix::MakeNewExpandedMultiVectorMatrix
SmartPtr< ExpandedMultiVectorMatrix > MakeNewExpandedMultiVectorMatrix() const
Definition: IpExpandedMultiVectorMatrix.hpp:170
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::ExpandedMultiVectorMatrix::TransMultVectorImpl
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
Ipopt::ExpandedMultiVectorMatrix::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::ExpandedMultiVectorMatrixSpace::~ExpandedMultiVectorMatrixSpace
virtual ~ExpandedMultiVectorMatrixSpace()
Destructor.
Definition: IpExpandedMultiVectorMatrix.hpp:135
IpUtils.hpp
Ipopt::ExpandedMultiVectorMatrix::RowVectorSpace
SmartPtr< const VectorSpace > RowVectorSpace() const
Vector space for the rows.
Definition: IpExpandedMultiVectorMatrix.hpp:176
Ipopt::ExpandedMultiVectorMatrix::GetExpansionMatrix
SmartPtr< const ExpansionMatrix > GetExpansionMatrix() const
Return the Expansion matrix.
Definition: IpExpandedMultiVectorMatrix.hpp:182
Ipopt::ExpandedMultiVectorMatrixSpace::MakeNew
virtual Matrix * MakeNew() const
Overloaded MakeNew method for the MatrixSpace base class.
Definition: IpExpandedMultiVectorMatrix.hpp:147
Ipopt::ExpandedMultiVectorMatrix::owner_space_
const ExpandedMultiVectorMatrixSpace * owner_space_
Definition: IpExpandedMultiVectorMatrix.hpp:114
Ipopt::ExpandedMultiVectorMatrixSpace::GetExpansionMatrix
SmartPtr< const ExpansionMatrix > GetExpansionMatrix() const
Definition: IpExpandedMultiVectorMatrix.hpp:158
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::Matrix::NRows
Index NRows() const
Number of rows.
Definition: IpMatrix.hpp:310
Ipopt::ExpandedMultiVectorMatrixSpace::vec_space_
SmartPtr< const VectorSpace > vec_space_
Definition: IpExpandedMultiVectorMatrix.hpp:164
Ipopt::ExpandedMultiVectorMatrix::HasValidNumbersImpl
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
IpMatrix.hpp
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
Ipopt::ExpandedMultiVectorMatrixSpace::RowVectorSpace
SmartPtr< const VectorSpace > RowVectorSpace() const
Accessor method for the VectorSpace for the rows.
Definition: IpExpandedMultiVectorMatrix.hpp:153
Ipopt::ExpandedMultiVectorMatrixSpace::MakeNewExpandedMultiVectorMatrix
ExpandedMultiVectorMatrix * MakeNewExpandedMultiVectorMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpExpandedMultiVectorMatrix.hpp:140
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
IpExpansionMatrix.hpp
Ipopt::ExpandedMultiVectorMatrixSpace::exp_matrix_
SmartPtr< const ExpansionMatrix > exp_matrix_
Definition: IpExpandedMultiVectorMatrix.hpp:166
Ipopt::VectorSpace
VectorSpace base class, corresponding to the Vector base class.
Definition: IpVector.hpp:390
Ipopt::Matrix
Matrix Base Class.
Definition: IpMatrix.hpp:27
Ipopt::MatrixSpace
MatrixSpace base class, corresponding to the Matrix base class.
Definition: IpMatrix.hpp:239
Ipopt::ExpandedMultiVectorMatrix
Class for Matrices with few rows that consists of Vectors, together with a premultiplied Expansion ma...
Definition: IpExpandedMultiVectorMatrix.hpp:29
Ipopt::ExpandedMultiVectorMatrix::ExpandedMultiVectorMatrix
ExpandedMultiVectorMatrix()
Default Constructor.
Ipopt::ExpandedMultiVectorMatrixSpace
This is the matrix space for ExpandedMultiVectorMatrix.
Definition: IpExpandedMultiVectorMatrix.hpp:123
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::ExpandedMultiVectorMatrix::ComputeColAMaxImpl
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Compute the max-norm of the columns in the matrix.
Ipopt::ExpandedMultiVectorMatrix::vecs_
std::vector< SmartPtr< const Vector > > vecs_
space for storing the const Vector&#39;s
Definition: IpExpandedMultiVectorMatrix.hpp:117
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::ExpandedMultiVectorMatrix::GetVector
SmartPtr< const Vector > GetVector(Index i) const
Get a Vector in a particular row as a const Vector.
Definition: IpExpandedMultiVectorMatrix.hpp:52
Ipopt::ExpandedMultiVectorMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::ExpandedMultiVectorMatrix::SetVector
void SetVector(Index i, SmartPtr< const Vector > vec)
Set a particular Vector at a given row position, replacing another vector if there has been one...
Ipopt::ExpandedMultiVectorMatrix::~ExpandedMultiVectorMatrix
virtual ~ExpandedMultiVectorMatrix()
Destructor.
Definition: IpExpandedMultiVectorMatrix.hpp:41
Ipopt::ExpandedMultiVectorMatrix::ExpandedMultiVectorMatrixOwnerSpace
SmartPtr< const ExpandedMultiVectorMatrixSpace > ExpandedMultiVectorMatrixOwnerSpace() const
Return the ExpandedMultiVectorMatrixSpace.
Definition: IpExpandedMultiVectorMatrix.hpp:189
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70
Ipopt::ExpandedMultiVectorMatrixSpace::ExpandedMultiVectorMatrixSpace
ExpandedMultiVectorMatrixSpace(Index nrows, const VectorSpace &vec_space, SmartPtr< const ExpansionMatrix > exp_matrix)
Constructor, given the number of rows (i.e., Vectors to be stored) and given the VectorSpace for the ...
Ipopt::ExpandedMultiVectorMatrix::operator=
void operator=(const ExpandedMultiVectorMatrix &)
Overloaded Equals Operator.