Ipopt Documentation  
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 
13 namespace Ipopt
14 {
15 
17 class ExpansionMatrixSpace;
18 
28 {
29 public:
35  const ExpansionMatrixSpace* owner_space
36  );
37 
39  ~ExpansionMatrix();
41 
50  const Index* ExpandedPosIndices() const;
51 
61  const Index* CompressedPosIndices() const;
62 
63 protected:
66  virtual void MultVectorImpl(
67  Number alpha,
68  const Vector& x,
69  Number beta,
70  Vector& y
71  ) const;
72 
73  virtual void TransMultVectorImpl(
74  Number alpha,
75  const Vector& x,
76  Number beta,
77  Vector& y
78  ) const;
79 
80  virtual void AddMSinvZImpl(
81  Number alpha,
82  const Vector& S,
83  const Vector& Z,
84  Vector& X
85  ) const;
86 
87  virtual void SinvBlrmZMTdBrImpl(
88  Number alpha,
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(
97  Vector& rows_norms,
98  bool init
99  ) const;
100 
101  virtual void ComputeColAMaxImpl(
102  Vector& cols_norms,
103  bool init
104  ) const;
105 
106  virtual void PrintImpl(
107  const Journalist& jnlst,
108  EJournalLevel level,
109  EJournalCategory category,
110  const std::string& name,
111  Index indent,
112  const std::string& prefix
113  ) const
114  {
115  PrintImplOffset(jnlst, level, category, name, indent, prefix, 1, 1);
116  }
118 
119  void PrintImplOffset(
120  const Journalist& jnlst,
121  EJournalLevel level,
122  EJournalCategory category,
123  const std::string& name,
124  Index indent,
125  const std::string& prefix,
126  Index row_offset,
127  Index col_offset
128  ) const;
129 
130  friend class ParExpansionMatrix;
131 
132 private:
143  ExpansionMatrix();
144 
147  const ExpansionMatrix&
148  );
149 
151  void operator=(
152  const ExpansionMatrix&
153  );
155 
157 
158 };
159 
162 {
163 public:
176  Index NLargeVec,
177  Index NSmallVec,
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 
209  const Index* ExpandedPosIndices() const
210  {
211  return expanded_pos_;
212  }
213 
224  {
225  return compressed_pos_;
226  }
227 
228 private:
231 };
232 
233 /* inline methods */
235 {
237 }
238 
240 {
242 }
243 
244 } // namespace Ipopt
245 #endif
IpUtils.hpp
Ipopt::MatrixSpace
MatrixSpace base class, corresponding to the Matrix base class.
Definition: IpMatrix.hpp:326
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:106
Ipopt
This file contains a base class for all exceptions and a set of macros to help with exceptions.
Definition: IpInexactAlgBuilder.hpp:13
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Ipopt::Matrix
Matrix Base Class.
Definition: IpMatrix.hpp:27
Ipopt::ExpansionMatrix::CompressedPosIndices
const Index * CompressedPosIndices() const
Return the vector of indices marking the compressed position.
Definition: IpExpansionMatrix.hpp:239
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:31
IPOPTLIB_EXPORT
#define IPOPTLIB_EXPORT
Definition: config_default.h:16
Ipopt::ExpansionMatrixSpace::expanded_pos_
Index * expanded_pos_
Definition: IpExpansionMatrix.hpp:229
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Ipopt::ExpansionMatrixSpace
This is the matrix space for ExpansionMatrix.
Definition: IpExpansionMatrix.hpp:161
Ipopt::ExpansionMatrixSpace::MakeNew
virtual Matrix * MakeNew() const
Pure virtual method for creating a new Matrix of the corresponding type.
Definition: IpExpansionMatrix.hpp:196
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:51
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:223
Ipopt::ExpansionMatrixSpace::~ExpansionMatrixSpace
~ExpansionMatrixSpace()
Destructor.
Definition: IpExpansionMatrix.hpp:183
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:116
Ipopt::ExpansionMatrixSpace::compressed_pos_
Index * compressed_pos_
Definition: IpExpansionMatrix.hpp:230
IpMatrix.hpp
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:209
Ipopt::ExpansionMatrix::owner_space_
const ExpansionMatrixSpace * owner_space_
Definition: IpExpansionMatrix.hpp:156
Ipopt::ExpansionMatrix
Class for expansion/projection matrices.
Definition: IpExpansionMatrix.hpp:27
Ipopt::ExpansionMatrix::ExpandedPosIndices
const Index * ExpandedPosIndices() const
Return the vector of indices marking the expanded position.
Definition: IpExpansionMatrix.hpp:234
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::ExpansionMatrixSpace::MakeNewExpansionMatrix
ExpansionMatrix * MakeNewExpansionMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpExpansionMatrix.hpp:191