Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpExpansionMatrix.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2009 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpExpansionMatrix.hpp 2269 2013-05-05 11:32:40Z stefan $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9 #ifndef __IPEXPANSIONMATRIX_HPP__
10 #define __IPEXPANSIONMATRIX_HPP__
11
12 #include "IpUtils.hpp"
13 #include "IpMatrix.hpp"
14
15 namespace Ipopt
16 {
17
19 class ExpansionMatrixSpace;
20
27 class ExpansionMatrix : public Matrix
28 {
29 public:
30
33
36 ExpansionMatrix(const ExpansionMatrixSpace* owner_space);
37
39 ~ExpansionMatrix();
41
49 const Index* ExpandedPosIndices() const;
50
59 const Index* CompressedPosIndices() const;
60
61 protected:
64 virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta,
65 Vector &y) const;
66
67 virtual void TransMultVectorImpl(Number alpha, const Vector& x,
68 Number beta, Vector& y) const;
69
72 virtual void AddMSinvZImpl(Number alpha, const Vector& S, const Vector& Z,
73 Vector& X) const;
74
77 virtual void SinvBlrmZMTdBrImpl(Number alpha, const Vector& S,
78 const Vector& R, const Vector& Z,
79 const Vector& D, Vector& X) const;
80
81 virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
82
83 virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) const;
84
85 virtual void PrintImpl(const Journalist& jnlst,
86 EJournalLevel level,
87 EJournalCategory category,
88 const std::string& name,
89 Index indent,
90 const std::string& prefix) const
91 {
92 PrintImplOffset(jnlst, level, category, name, indent, prefix, 1, 1);
93 }
95
96 void PrintImplOffset(const Journalist& jnlst,
97 EJournalLevel level,
98 EJournalCategory category,
99 const std::string& name,
100 Index indent,
101 const std::string& prefix,
102 Index row_offset,
103 Index col_offset) const;
104
105 friend class ParExpansionMatrix;
106
107 private:
117 ExpansionMatrix();
118
120 ExpansionMatrix(const ExpansionMatrix&);
121
123 void operator=(const ExpansionMatrix&);
125
126 const ExpansionMatrixSpace* owner_space_;
127
128 };
129
132 class ExpansionMatrixSpace : public MatrixSpace
133 {
134 public:
144 ExpansionMatrixSpace(Index NLargeVec,
145 Index NSmallVec,
146 const Index *ExpPos,
147 const int offset = 0);
148
150 ~ExpansionMatrixSpace()
151 {
152 delete [] compressed_pos_;
153 delete [] expanded_pos_;
154 }
156
158 ExpansionMatrix* MakeNewExpansionMatrix() const
159 {
160 return new ExpansionMatrix(this);
161 }
162
165 virtual Matrix* MakeNew() const
166 {
167 return MakeNewExpansionMatrix();
168 }
169
176 const Index* ExpandedPosIndices() const
177 {
178 return expanded_pos_;
179 }
180
188 const Index* CompressedPosIndices() const
189 {
190 return compressed_pos_;
191 }
192
193 private:
194 Index *expanded_pos_;
195 Index *compressed_pos_;
196 };
197
198 /* inline methods */
199 inline
200 const Index* ExpansionMatrix::ExpandedPosIndices() const
201 {
202 return owner_space_->ExpandedPosIndices();
203 }
204
205 inline
206 const Index* ExpansionMatrix::CompressedPosIndices() const
207 {
208 return owner_space_->CompressedPosIndices();
209 }
210
211 } // namespace Ipopt
212 #endif
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::ExpansionMatrix::ComputeColAMaxImpl
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Compute the max-norm of the columns in the matrix.
IpUtils.hpp
Ipopt::ExpansionMatrix::SinvBlrmZMTdBrImpl
virtual void SinvBlrmZMTdBrImpl(Number alpha, const Vector &S, const Vector &R, const Vector &Z, const Vector &D, Vector &X) const
X = S^{-1} (r + alpha*Z*M^Td).
Ipopt::ExpansionMatrix::TransMultVectorImpl
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::ExpansionMatrixSpace::CompressedPosIndices
const Index * CompressedPosIndices() const
Accessor Method to obtain the Index array (of length NLargeVec=NRows()) that stores the mapping from ...
Definition: IpExpansionMatrix.hpp:188
IpMatrix.hpp
Ipopt::ExpansionMatrix::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.
Definition: IpExpansionMatrix.hpp:85
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
Ipopt::ExpansionMatrixSpace::~ExpansionMatrixSpace
~ExpansionMatrixSpace()
Destructor.
Definition: IpExpansionMatrix.hpp:150
Ipopt::ExpansionMatrix::PrintImplOffset
void PrintImplOffset(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix, Index row_offset, Index col_offset) const
Ipopt::ExpansionMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
Ipopt::Matrix
Matrix Base Class.
Definition: IpMatrix.hpp:27
Ipopt::ExpansionMatrix::AddMSinvZImpl
virtual void AddMSinvZImpl(Number alpha, const Vector &S, const Vector &Z, Vector &X) const
X = beta*X + alpha*(Matrix S^{-1} Z).
Ipopt::ExpansionMatrixSpace::expanded_pos_
Index * expanded_pos_
Definition: IpExpansionMatrix.hpp:194
Ipopt::ExpansionMatrix::CompressedPosIndices
const Index * CompressedPosIndices() const
Return the vector of indices marking the compressed position.
Definition: IpExpansionMatrix.hpp:206
Ipopt::MatrixSpace
MatrixSpace base class, corresponding to the Matrix base class.
Definition: IpMatrix.hpp:239
Ipopt::ExpansionMatrixSpace
This is the matrix space for ExpansionMatrix.
Definition: IpExpansionMatrix.hpp:132
Ipopt::ExpansionMatrixSpace::ExpansionMatrixSpace
ExpansionMatrixSpace(Index NLargeVec, Index NSmallVec, const Index *ExpPos, const int offset=0)
Constructor, given the list of elements of the large vector (of size NLargeVec) to be filtered into t...
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::ExpansionMatrix
Class for expansion/projection matrices.
Definition: IpExpansionMatrix.hpp:27
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::ExpansionMatrixSpace::MakeNew
virtual Matrix * MakeNew() const
Overloaded MakeNew method for the MatrixSpace base class.
Definition: IpExpansionMatrix.hpp:165
Ipopt::ExpansionMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Ipopt::ExpansionMatrix::ExpansionMatrix
ExpansionMatrix()
Default Constructor.
Ipopt::ExpansionMatrix::ParExpansionMatrix
friend class ParExpansionMatrix
Definition: IpExpansionMatrix.hpp:105
Ipopt::ExpansionMatrixSpace::ExpandedPosIndices
const Index * ExpandedPosIndices() const
Accessor Method to obtain the Index array (of length NSmallVec=NCols()) that stores the mapping from ...
Definition: IpExpansionMatrix.hpp:176
Ipopt::ExpansionMatrix::ExpandedPosIndices
const Index * ExpandedPosIndices() const
Return the vector of indices marking the expanded position.
Definition: IpExpansionMatrix.hpp:200
Ipopt::ExpansionMatrix::owner_space_
const ExpansionMatrixSpace * owner_space_
Definition: IpExpansionMatrix.hpp:126
Ipopt::ExpansionMatrixSpace::compressed_pos_
Index * compressed_pos_
Definition: IpExpansionMatrix.hpp:195
Ipopt::ExpansionMatrixSpace::MakeNewExpansionMatrix
ExpansionMatrix * MakeNewExpansionMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpExpansionMatrix.hpp:158
Ipopt::ExpansionMatrix::~ExpansionMatrix
~ExpansionMatrix()
Destructor.
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70
Ipopt::ExpansionMatrix::operator=
void operator=(const ExpansionMatrix &)
Overloaded Equals Operator.