Ipopt Documentation  
 
Loading...
Searching...
No Matches
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// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6
7#ifndef __IPEXPANSIONMATRIX_HPP__
8#define __IPEXPANSIONMATRIX_HPP__
9
10#include "IpUtils.hpp"
11#include "IpMatrix.hpp"
12
13namespace Ipopt
14{
15
17class ExpansionMatrixSpace;
18
28{
29public:
32
36 );
37
41
50 const Index* ExpandedPosIndices() const;
51
61 const Index* CompressedPosIndices() const;
62
63protected:
66 virtual void MultVectorImpl(
68 const Vector& x,
70 Vector& y
71 ) const;
72
73 virtual void TransMultVectorImpl(
75 const Vector& x,
77 Vector& y
78 ) const;
79
80 virtual void AddMSinvZImpl(
82 const Vector& S,
83 const Vector& Z,
84 Vector& X
85 ) const;
86
87 virtual void SinvBlrmZMTdBrImpl(
89 const Vector& S,
90 const Vector& R,
91 const Vector& Z,
92 const Vector& D,
93 Vector& X
94 ) const;
95
96 virtual void ComputeRowAMaxImpl(
98 bool init
99 ) const;
100
101 virtual void ComputeColAMaxImpl(
103 bool init
104 ) const;
105
106 virtual void PrintImpl(
107 const Journalist& jnlst,
110 const std::string& name,
112 const std::string& prefix
113 ) const
114 {
115 PrintImplOffset(jnlst, level, category, name, indent, prefix, 1, 1);
116 }
118
120 const Journalist& jnlst,
123 const std::string& name,
125 const std::string& prefix,
128 ) const;
129
130 friend class ParExpansionMatrix;
131
132private:
142
144
147 const ExpansionMatrix&
148 );
149
152 const ExpansionMatrix&
153 );
155
157
158};
159
162{
163public:
166
178 const Index* ExpPos,
179 const int offset = 0
180 );
181
184 {
185 delete[] compressed_pos_;
186 delete[] expanded_pos_;
187 }
189
192 {
193 return new ExpansionMatrix(this);
194 }
195
196 virtual Matrix* MakeNew() const
197 {
198 return MakeNewExpansionMatrix();
199 }
200
210 {
211 return expanded_pos_;
212 }
213
224 {
225 return compressed_pos_;
226 }
227
228private:
231};
232
233/* inline methods */
235{
236 return owner_space_->ExpandedPosIndices();
237}
238
240{
241 return owner_space_->CompressedPosIndices();
242}
243
244} // namespace Ipopt
245#endif
Templated class which stores one entry for the CachedResult class.
This is the matrix space for ExpansionMatrix.
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...
virtual Matrix * MakeNew() const
Pure virtual method for creating a new Matrix of the corresponding type.
const Index * CompressedPosIndices() const
Accessor Method to obtain the Index array (of length NLargeVec=NRows()) that stores the mapping from ...
ExpansionMatrix * MakeNewExpansionMatrix() const
Method for creating a new matrix of this specific type.
const Index * ExpandedPosIndices() const
Accessor Method to obtain the Index array (of length NSmallVec=NCols()) that stores the mapping from ...
Class for expansion/projection matrices.
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.
ExpansionMatrix(const ExpansionMatrix &)
Copy Constructor.
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).
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
const Index * ExpandedPosIndices() const
Return the vector of indices marking the expanded position.
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Compute the max-norm of the columns in the matrix.
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
~ExpansionMatrix()
Destructor.
const Index * CompressedPosIndices() const
Return the vector of indices marking the compressed position.
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
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
void operator=(const ExpansionMatrix &)
Default Assignment Operator.
const ExpansionMatrixSpace * owner_space_
ExpansionMatrix(const ExpansionMatrixSpace *owner_space)
Constructor, taking the owner_space.
virtual void AddMSinvZImpl(Number alpha, const Vector &S, const Vector &Z, Vector &X) const
X = X + alpha*(Matrix S^{-1} Z).
ExpansionMatrix()
Default Constructor.
Class responsible for all message output.
MatrixSpace base class, corresponding to the Matrix base class.
Definition IpMatrix.hpp:327
Matrix Base Class.
Definition IpMatrix.hpp:28
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