Ipopt
trunk
|
00001 // Copyright 2009, 2011 Hans Pirnay 00002 // All Rights Reserved. 00003 // This code is published under the Eclipse Public License. 00004 // 00005 // Date : 2009-05-06 00006 00007 #ifndef __ASINDEXPCALCULATOR_HPP__ 00008 #define __ASINDEXPCALCULATOR_HPP__ 00009 00010 #include "SensPCalculator.hpp" 00011 00012 namespace Ipopt 00013 { 00014 /* Forward declarations */ 00015 class PColumn; 00016 00017 class IndexPCalculator : public PCalculator 00018 { 00022 public: 00023 00024 IndexPCalculator(SmartPtr<SensBacksolver> backsolver, 00025 SmartPtr<SchurData> A_data); 00026 00027 virtual ~IndexPCalculator(); 00028 00030 virtual bool InitializeImpl(const OptionsList& options, 00031 const std::string& prefix); 00032 00033 virtual bool ComputeP(); 00034 00035 virtual bool GetSchurMatrix(const SmartPtr<const SchurData>& B, SmartPtr<Matrix>& S); 00036 00037 virtual void PrintImpl(const Journalist& jnlst, 00038 EJournalLevel level, 00039 EJournalCategory category, 00040 const std::string& name, 00041 Index indent, 00042 const std::string& prefix) const; 00043 00044 private: 00045 00047 Index nrows_; 00048 00050 Index ncols_; 00051 00052 std::map< Index, SmartPtr<PColumn> > cols_; 00053 00054 }; 00055 00056 class PColumn : public ReferencedObject 00057 { 00061 public: 00062 PColumn(Index nrows, Number* values); 00063 00064 virtual ~PColumn(); 00065 00066 virtual void GetSchurMatrixRows(const std::vector<Index>* row_idx_B, Number* S) const; 00067 00068 virtual const Number* Values() const; 00069 00070 private: 00071 00072 Index nrows_; 00073 Number* val_; 00074 }; 00075 00076 } 00077 00078 #endif