- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/SVN-release/Ipopt-3.2.1/Ipopt/src/LinAlg/IpSumSymMatrix.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: IpSumSymMatrix.hpp 759 2006-07-07 03:07:08Z andreasw $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    00008
    00009 #ifndef __IPSUMSYMMATRIX_HPP__
    00010 #define __IPSUMSYMMATRIX_HPP__
    00011
    00012 #include "IpUtils.hpp"
    00013 #include "IpSymMatrix.hpp"
    00014
    00015 namespace Ipopt
    00016 {
    00017
    00018   /* forward declarations */
    00019   class SumSymMatrixSpace;
    00020
    00024   class SumSymMatrix : public SymMatrix
    00025   {
    00026   public:
    00027
    00030
    00034     SumSymMatrix(const SumSymMatrixSpace* owner_space);
    00035
    00037     ~SumSymMatrix();
    00039
    00042     void SetTerm(Index iterm, Number factor, const SymMatrix& matrix);
    00043
    00046     void GetTerm(Index iterm, Number& factor, SmartPtr<const SymMatrix>& matrix) const;
    00047
    00049     Index NTerms() const;
    00050
    00051   protected:
    00054     virtual void MultVectorImpl(Number alpha, const Vector& x,
    00055                                 Number beta, Vector& y) const;
    00056
    00059     virtual bool HasValidNumbersImpl() const;
    00060
    00061     virtual void PrintImpl(const Journalist& jnlst,
    00062                            EJournalLevel level,
    00063                            EJournalCategory category,
    00064                            const std::string& name,
    00065                            Index indent,
    00066                            const std::string& prefix) const;
    00068
    00069   private:
    00079     SumSymMatrix();
    00080
    00082     SumSymMatrix(const SumSymMatrix&);
    00083
    00085     void operator=(const SumSymMatrix&);
    00087
    00089     std::vector<Number> factors_;
    00090
    00092     std::vector<SmartPtr<const SymMatrix> > matrices_;
    00093
    00095     const SumSymMatrixSpace* owner_space_;
    00096   };
    00097
    00099   class SumSymMatrixSpace : public SymMatrixSpace
    00100   {
    00101   public:
    00106     SumSymMatrixSpace(Index ndim, Index nterms)
    00107         :
    00108         SymMatrixSpace(ndim),
    00109         nterms_(nterms)
    00110     {}
    00111
    00113     ~SumSymMatrixSpace()
    00114     {}
    00116
    00120     Index NTerms() const
    00121     {
    00122       return nterms_;
    00123     }
    00125
    00129     void SetTermSpace(Index term_idx, const SymMatrixSpace& space);
    00130
    00132     SmartPtr<const SymMatrixSpace> GetTermSpace(Index term_idx) const;
    00133
    00135     SumSymMatrix* MakeNewSumSymMatrix() const;
    00136
    00139     virtual SymMatrix* MakeNewSymMatrix() const;
    00140
    00141   private:
    00142     Index nterms_;
    00143
    00144     std::vector< SmartPtr<const SymMatrixSpace> > term_spaces_;
    00145   };
    00146
    00147 } // namespace Ipopt
    00148 #endif