Ipopt 3.11.9
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// $Id: IpExpansionMatrix.hpp 1861 2010-12-21 21:34:47Z andreasw $
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
15namespace Ipopt
16{
17
19 class ExpansionMatrixSpace;
20
27 class ExpansionMatrix : public Matrix
28 {
29 public:
30
33
37
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:
118
121
125
127
128 };
129
133 {
134 public:
145 Index NSmallVec,
146 const Index *ExpPos,
147 const int offset = 0);
148
151 {
152 delete [] compressed_pos_;
153 delete [] expanded_pos_;
154 }
156
159 {
160 return new ExpansionMatrix(this);
161 }
162
165 virtual Matrix* MakeNew() const
166 {
167 return MakeNewExpansionMatrix();
168 }
169
177 {
178 return expanded_pos_;
179 }
180
189 {
190 return compressed_pos_;
191 }
192
193 private:
196 };
197
198 /* inline methods */
199 inline
204
205 inline
210
211} // namespace Ipopt
212#endif
Number * x
Input: Starting point Output: Optimal solution.
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
Overloaded MakeNew method for the MatrixSpace base class.
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 &)
Overloaded Equals 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 = beta*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:240
Matrix Base Class.
Definition IpMatrix.hpp:28
Vector Base Class.
Definition IpVector.hpp:48
EJournalCategory
Category Selection Enum.
int Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:19
EJournalLevel
Print Level Enum.
double Number
Type of all numbers.
Definition IpTypes.hpp:17