IpExpansionMatrix.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __IPEXPANSIONMATRIX_HPP__
00010 #define __IPEXPANSIONMATRIX_HPP__
00011
00012 #include "IpUtils.hpp"
00013 #include "IpMatrix.hpp"
00014
00015 namespace Ipopt
00016 {
00017
00019 class ExpansionMatrixSpace;
00020
00027 class ExpansionMatrix : public Matrix
00028 {
00029 public:
00030
00033
00036 ExpansionMatrix(const ExpansionMatrixSpace* owner_space);
00037
00039 ~ExpansionMatrix();
00041
00049 const Index* ExpandedPosIndices() const;
00050
00059 const Index* CompressedPosIndices() const;
00060
00061 protected:
00064 virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta,
00065 Vector &y) const;
00066
00067 virtual void TransMultVectorImpl(Number alpha, const Vector& x,
00068 Number beta, Vector& y) const;
00069
00072 virtual void AddMSinvZImpl(Number alpha, const Vector& S, const Vector& Z,
00073 Vector& X) const;
00074
00077 virtual void SinvBlrmZMTdBrImpl(Number alpha, const Vector& S,
00078 const Vector& R, const Vector& Z,
00079 const Vector& D, Vector& X) const;
00080
00081 virtual void PrintImpl(const Journalist& jnlst,
00082 EJournalLevel level,
00083 EJournalCategory category,
00084 const std::string& name,
00085 Index indent,
00086 const std::string& prefix) const;
00088
00089
00090 private:
00100 ExpansionMatrix();
00101
00103 ExpansionMatrix(const ExpansionMatrix&);
00104
00106 void operator=(const ExpansionMatrix&);
00108
00109 const ExpansionMatrixSpace* owner_space_;
00110
00111 };
00112
00115 class ExpansionMatrixSpace : public MatrixSpace
00116 {
00117 public:
00127 ExpansionMatrixSpace(Index NLargeVec,
00128 Index NSmallVec,
00129 const Index *ExpPos,
00130 const int offset = 0);
00131
00133 ~ExpansionMatrixSpace()
00134 {
00135 delete [] compressed_pos_;
00136 delete [] expanded_pos_;
00137 }
00139
00141 ExpansionMatrix* MakeNewExpansionMatrix() const
00142 {
00143 return new ExpansionMatrix(this);
00144 }
00145
00148 virtual Matrix* MakeNew() const
00149 {
00150 return MakeNewExpansionMatrix();
00151 }
00152
00159 const Index* ExpandedPosIndices() const
00160 {
00161 return expanded_pos_;
00162 }
00163
00171 const Index* CompressedPosIndices() const
00172 {
00173 return compressed_pos_;
00174 }
00175
00176 private:
00177 Index *expanded_pos_;
00178 Index *compressed_pos_;
00179 };
00180
00181
00182 inline
00183 const Index* ExpansionMatrix::ExpandedPosIndices() const
00184 {
00185 return owner_space_->ExpandedPosIndices();
00186 }
00187
00188 inline
00189 const Index* ExpansionMatrix::CompressedPosIndices() const
00190 {
00191 return owner_space_->CompressedPosIndices();
00192 }
00193
00194 }
00195 #endif