- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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

Go to the documentation of this file.

    00001 // Copyright (C) 2004, 2006 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Common Public License.
    00004 //
    00005 // $Id: IpIdentityMatrix.hpp 759 2006-07-07 03:07:08Z andreasw $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    00008
    00009 #ifndef __IPIDENTITYMATRIX_HPP__
    00010 #define __IPIDENTITYMATRIX_HPP__
    00011
    00012 #include "IpUtils.hpp"
    00013 #include "IpSymMatrix.hpp"
    00014
    00015 namespace Ipopt
    00016 {
    00017
    00021   class IdentityMatrix : public SymMatrix
    00022   {
    00023   public:
    00024
    00027
    00031     IdentityMatrix(const SymMatrixSpace* owner_space);
    00032
    00034     ~IdentityMatrix();
    00036
    00038     void SetFactor(Number factor)
    00039     {
    00040       factor_ = factor;
    00041     }
    00042
    00044     Number GetFactor() const
    00045     {
    00046       return factor_;
    00047     }
    00048
    00050     Index Dim() const;
    00051
    00052   protected:
    00055     virtual void MultVectorImpl(Number alpha, const Vector& x,
    00056                                 Number beta, Vector& y) const;
    00057
    00058     virtual void AddMSinvZImpl(Number alpha, const Vector& S,
    00059                                const Vector& Z, Vector& X) const;
    00060
    00063     virtual bool HasValidNumbersImpl() const;
    00064
    00065     virtual void PrintImpl(const Journalist& jnlst,
    00066                            EJournalLevel level,
    00067                            EJournalCategory category,
    00068                            const std::string& name,
    00069                            Index indent,
    00070                            const std::string& prefix) const;
    00072
    00073   private:
    00083     IdentityMatrix();
    00084
    00086     IdentityMatrix(const IdentityMatrix&);
    00087
    00089     void operator=(const IdentityMatrix&);
    00091
    00093     Number factor_;
    00094   };
    00095
    00097   class IdentityMatrixSpace : public SymMatrixSpace
    00098   {
    00099   public:
    00103     IdentityMatrixSpace(Index dim)
    00104         :
    00105         SymMatrixSpace(dim)
    00106     {}
    00107
    00109     virtual ~IdentityMatrixSpace()
    00110     {}
    00112
    00115     virtual SymMatrix* MakeNewSymMatrix() const
    00116     {
    00117       return MakeNewIdentityMatrix();
    00118     }
    00119
    00121     IdentityMatrix* MakeNewIdentityMatrix() const
    00122     {
    00123       return new IdentityMatrix(this);
    00124     }
    00125
    00126   private:
    00136     IdentityMatrixSpace();
    00137
    00139     IdentityMatrixSpace(const IdentityMatrixSpace&);
    00140
    00142     void operator=(const IdentityMatrixSpace&);
    00144   };
    00145
    00146 } // namespace Ipopt
    00147 #endif