Ipopt Documentation  
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
31 
35  const ExpansionMatrixSpace* owner_space
36  );
37 
39  ~ExpansionMatrix();
41 
50  const Index* ExpandedPosIndices() const;
51 
61  const Index* CompressedPosIndices() const;
62 
63 protected:
65  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:
141 
143  ExpansionMatrix();
144 
147  const ExpansionMatrix&
148  );
149 
151  void operator=(
152  const ExpansionMatrix&
153  );
155 
157 
158 };
159 
162 {
163 public:
165 
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
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Vector Base Class.
Definition: IpVector.hpp:47
const Index * CompressedPosIndices() const
Accessor Method to obtain the Index array (of length NLargeVec=NRows()) that stores the mapping from ...
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.
EJournalLevel
Print Level Enum.
Matrix Base Class.
Definition: IpMatrix.hpp:27
const Index * CompressedPosIndices() const
Return the vector of indices marking the compressed position.
MatrixSpace base class, corresponding to the Matrix base class.
Definition: IpMatrix.hpp:326
This is the matrix space for ExpansionMatrix.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Class for expansion/projection matrices.
#define IPOPTLIB_EXPORT
Class responsible for all message output.
virtual Matrix * MakeNew() const
Pure virtual method for creating a new Matrix of the corresponding type.
const Index * ExpandedPosIndices() const
Accessor Method to obtain the Index array (of length NSmallVec=NCols()) that stores the mapping from ...
const Index * ExpandedPosIndices() const
Return the vector of indices marking the expanded position.
const ExpansionMatrixSpace * owner_space_
ExpansionMatrix * MakeNewExpansionMatrix() const
Method for creating a new matrix of this specific type.
EJournalCategory
Category Selection Enum.