- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/SVN-release/Ipopt-3.2.1/Ipopt/src/LinAlg/IpDenseSymMatrix.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2005, 2006 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Common Public License.
    00004 //
    00005 // $Id: IpDenseSymMatrix.hpp 759 2006-07-07 03:07:08Z andreasw $
    00006 //
    00007 // Authors:  Andreas Waechter             IBM    2005-12-25
    00008
    00009 #ifndef __IPDENSESYMMATRIX_HPP__
    00010 #define __IPDENSESYMMATRIX_HPP__
    00011
    00012 #include "IpUtils.hpp"
    00013 #include "IpSymMatrix.hpp"
    00014 #include "IpMultiVectorMatrix.hpp"
    00015 #include "IpDenseVector.hpp"
    00016
    00017 namespace Ipopt
    00018 {
    00019
    00021   class DenseSymMatrixSpace;
    00022
    00025   class DenseGenMatrix;
    00026
    00031   class DenseSymMatrix : public SymMatrix
    00032   {
    00033   public:
    00034
    00037
    00040     DenseSymMatrix(const DenseSymMatrixSpace* owner_space);
    00041
    00043     ~DenseSymMatrix();
    00045
    00047     SmartPtr<DenseSymMatrix> MakeNewDenseSymMatrix() const;
    00048
    00053     Number* Values()
    00054     {
    00055       ObjectChanged();
    00056       initialized_ = true;
    00057       return values_;
    00058     }
    00059
    00063     const Number* Values() const
    00064     {
    00065       DBG_ASSERT(initialized_);
    00066       return values_;
    00067     }
    00068
    00070     void FillIdentity(Number factor=1.);
    00071
    00074     void AddMatrix(Number alpha, const DenseSymMatrix& A, Number beta);
    00075
    00079     void HighRankUpdate(bool trans, Number alpha, const DenseGenMatrix& V,
    00080                         Number beta);
    00081
    00085     void HighRankUpdateTranspose(Number alpha,
    00086                                  const MultiVectorMatrix& V1,
    00087                                  const MultiVectorMatrix& V2,
    00088                                  Number beta);
    00089
    00095     void SpecialAddForLMSR1(const DenseVector& D, const DenseGenMatrix& L);
    00096
    00097   protected:
    00100     virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta,
    00101                                 Vector &y) const;
    00102
    00105     virtual bool HasValidNumbersImpl() const;
    00106
    00107     virtual void PrintImpl(const Journalist& jnlst,
    00108                            EJournalLevel level,
    00109                            EJournalCategory category,
    00110                            const std::string& name,
    00111                            Index indent,
    00112                            const std::string& prefix) const;
    00114
    00115
    00116   private:
    00126     DenseSymMatrix();
    00127
    00129     DenseSymMatrix(const DenseSymMatrix&);
    00130
    00132     void operator=(const DenseSymMatrix&);
    00134
    00135     const DenseSymMatrixSpace* owner_space_;
    00136
    00139     Number* values_;
    00140
    00142     bool initialized_;
    00143   };
    00144
    00147   class DenseSymMatrixSpace : public SymMatrixSpace
    00148   {
    00149   public:
    00155     DenseSymMatrixSpace(Index nDim);
    00156
    00158     ~DenseSymMatrixSpace()
    00159     {}
    00161
    00163     DenseSymMatrix* MakeNewDenseSymMatrix() const
    00164     {
    00165       return new DenseSymMatrix(this);
    00166     }
    00167
    00170     virtual SymMatrix* MakeNewSymMatrix() const
    00171     {
    00172       return MakeNewDenseSymMatrix();
    00173     }
    00174
    00175   };
    00176
    00177   inline
    00178   SmartPtr<DenseSymMatrix> DenseSymMatrix::MakeNewDenseSymMatrix() const
    00179   {
    00180     return owner_space_->MakeNewDenseSymMatrix();
    00181   }
    00182
    00183 } // namespace Ipopt
    00184 #endif