- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/SVN-release/Ipopt-3.5.1/Ipopt/src/LinAlg/IpExpansionMatrix.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2004, 2008 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Common Public License.
    00004 //
    00005 // $Id: IpExpansionMatrix.hpp 1290 2008-08-25 15:48:22Z andreasw $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    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 ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
    00082
    00083     virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) const;
    00084
    00085     virtual void PrintImpl(const Journalist& jnlst,
    00086                            EJournalLevel level,
    00087                            EJournalCategory category,
    00088                            const std::string& name,
    00089                            Index indent,
    00090                            const std::string& prefix) const;
    00092
    00093
    00094   private:
    00104     ExpansionMatrix();
    00105
    00107     ExpansionMatrix(const ExpansionMatrix&);
    00108
    00110     void operator=(const ExpansionMatrix&);
    00112
    00113     const ExpansionMatrixSpace* owner_space_;
    00114
    00115   };
    00116
    00119   class ExpansionMatrixSpace : public MatrixSpace
    00120   {
    00121   public:
    00131     ExpansionMatrixSpace(Index NLargeVec,
    00132                          Index NSmallVec,
    00133                          const Index *ExpPos,
    00134                          const int offset = 0);
    00135
    00137     ~ExpansionMatrixSpace()
    00138     {
    00139       delete [] compressed_pos_;
    00140       delete [] expanded_pos_;
    00141     }
    00143
    00145     ExpansionMatrix* MakeNewExpansionMatrix() const
    00146     {
    00147       return new ExpansionMatrix(this);
    00148     }
    00149
    00152     virtual Matrix* MakeNew() const
    00153     {
    00154       return MakeNewExpansionMatrix();
    00155     }
    00156
    00163     const Index* ExpandedPosIndices() const
    00164     {
    00165       return expanded_pos_;
    00166     }
    00167
    00175     const Index* CompressedPosIndices() const
    00176     {
    00177       return compressed_pos_;
    00178     }
    00179
    00180   private:
    00181     Index *expanded_pos_;
    00182     Index *compressed_pos_;
    00183   };
    00184
    00185   /* inline methods */
    00186   inline
    00187   const Index* ExpansionMatrix::ExpandedPosIndices() const
    00188   {
    00189     return owner_space_->ExpandedPosIndices();
    00190   }
    00191
    00192   inline
    00193   const Index* ExpansionMatrix::CompressedPosIndices() const
    00194   {
    00195     return owner_space_->CompressedPosIndices();
    00196   }
    00197
    00198 } // namespace Ipopt
    00199 #endif