- Main Page
- Classes
- Files

- File List
- File Members

# src/LinAlg/IpSumSymMatrix.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 Eclipse Public License.
    00004 //
    00005 // $Id: IpSumSymMatrix.hpp 1861 2010-12-21 21:34:47Z 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 ComputeRowAMaxImpl(Vector& rows_norms, bool init) const;
    00062
    00063     virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) 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     SumSymMatrix();
    00084
    00086     SumSymMatrix(const SumSymMatrix&);
    00087
    00089     void operator=(const SumSymMatrix&);
    00091
    00093     std::vector<Number> factors_;
    00094
    00096     std::vector<SmartPtr<const SymMatrix> > matrices_;
    00097
    00099     const SumSymMatrixSpace* owner_space_;
    00100   };
    00101
    00103   class SumSymMatrixSpace : public SymMatrixSpace
    00104   {
    00105   public:
    00110     SumSymMatrixSpace(Index ndim, Index nterms)
    00111         :
    00112         SymMatrixSpace(ndim),
    00113         nterms_(nterms)
    00114     {}
    00115
    00117     ~SumSymMatrixSpace()
    00118     {}
    00120
    00124     Index NTerms() const
    00125     {
    00126       return nterms_;
    00127     }
    00129
    00133     void SetTermSpace(Index term_idx, const SymMatrixSpace& space);
    00134
    00136     SmartPtr<const SymMatrixSpace> GetTermSpace(Index term_idx) const;
    00137
    00139     SumSymMatrix* MakeNewSumSymMatrix() const;
    00140
    00143     virtual SymMatrix* MakeNewSymMatrix() const;
    00144
    00145   private:
    00146     Index nterms_;
    00147
    00148     std::vector< SmartPtr<const SymMatrixSpace> > term_spaces_;
    00149   };
    00150
    00151 } // namespace Ipopt
    00152 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines