/home/coin/SVN-release/Ipopt-3.5.5/Ipopt/src/Algorithm/Inexact/IpIterativePardisoSolverInterface.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2008 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: IpIterativePardisoSolverInterface.hpp 1393 2009-01-08 17:19:41Z andreasw $
00006 //
00007 // Authors:  Andreas Waechter            IBM    2008-09-18
00008 //            based on IpPardisoSolverInterface.hpp rev 1119
00009 
00010 
00011 #ifndef __IPITERATIVEPARDISOSOLVERINTERFACE_HPP__
00012 #define __IPITERATIVEPARDISOSOLVERINTERFACE_HPP__
00013 
00014 #include "IpSparseSymLinearSolverInterface.hpp"
00015 #include "IpInexactCq.hpp"
00016 #include "IpIterativeSolverTerminationTester.hpp"
00017 
00018 namespace Ipopt
00019 {
00020 
00025   class IterativePardisoSolverInterface: public SparseSymLinearSolverInterface
00026   {
00027   public:
00031     IterativePardisoSolverInterface(IterativeSolverTerminationTester& normal_tester,
00032                                     IterativeSolverTerminationTester& pd_tester);
00033 
00035     virtual ~IterativePardisoSolverInterface();
00037 
00039     bool InitializeImpl(const OptionsList& options,
00040                         const std::string& prefix);
00041 
00042 
00046     virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
00047         const Index *ia,
00048         const Index *ja);
00049 
00052     virtual double* GetValuesArrayPtr();
00053 
00055     virtual ESymSolverStatus MultiSolve(bool new_matrix,
00056                                         const Index* ia,
00057                                         const Index* ja,
00058                                         Index nrhs,
00059                                         double* rhs_vals,
00060                                         bool check_NegEVals,
00061                                         Index numberOfNegEVals);
00062 
00066     virtual Index NumberOfNegEVals() const;
00068 
00069     //* @name Options of Linear solver */
00071 
00073     virtual bool IncreaseQuality();
00074 
00078     virtual bool ProvidesInertia() const
00079     {
00080       return true;
00081     }
00085     EMatrixFormat MatrixFormat() const
00086     {
00087       return CSR_Format_1_Offset;
00088     }
00090 
00093     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00095 
00096   private:
00106     IterativePardisoSolverInterface();
00107 
00109     IterativePardisoSolverInterface(const IterativePardisoSolverInterface&);
00110 
00112     void operator=(const IterativePardisoSolverInterface&);
00114 
00118     Index dim_;
00119 
00121     Index nonzeros_;
00122 
00124     double* a_;
00126 
00130     Index negevals_;
00132 
00136     enum PardisoMatchingStrategy
00137     {
00138       COMPLETE,
00139       COMPLETE2x2,
00140       CONSTRAINT
00141     };
00143     PardisoMatchingStrategy match_strat_;
00146     bool have_symbolic_factorization_;
00149     bool pardiso_redo_symbolic_fact_only_if_inertia_wrong_;
00153     bool pardiso_repeated_perturbation_means_singular_;
00156     bool skip_inertia_check_;
00158 
00163     bool initialized_;
00165 
00169     void** PT_;
00172     ipfint MAXFCT_;
00174     ipfint MNUM_;
00176     ipfint MTYPE_;
00178     ipfint* IPARM_;
00180     ipfint MSGLVL_;
00182 
00185     Index debug_last_iter_;
00186     Index debug_cnt_;
00188 
00193     ESymSolverStatus SymbolicFactorization(const Index* ia,
00194                                            const Index* ja);
00195 
00198     ESymSolverStatus Factorization(const Index* ia,
00199                                    const Index* ja,
00200                                    bool check_NegEVals,
00201                                    Index numberOfNegEVals);
00202 
00205     ESymSolverStatus Solve(const Index* ia,
00206                            const Index* ja,
00207                            Index nrhs,
00208                            double *rhs_vals);
00210 
00212     InexactData& InexData()
00213     {
00214       InexactData& inexact_data =
00215         static_cast<InexactData&>(IpData().AdditionalData());
00216       DBG_ASSERT(dynamic_cast<InexactData*>(&IpData().AdditionalData()));
00217       return inexact_data;
00218     }
00219 
00221     InexactCq& InexCq()
00222     {
00223       InexactCq& inexact_cq =
00224         static_cast<InexactCq&>(IpCq().AdditionalCq());
00225       DBG_ASSERT(dynamic_cast<InexactCq*>(&IpCq().AdditionalCq()));
00226       return inexact_cq;
00227     }
00228 
00230     SmartPtr<IterativeSolverTerminationTester> normal_tester_;
00231 
00233     SmartPtr<IterativeSolverTerminationTester> pd_tester_;
00234 
00235   };
00236 
00237 } // namespace Ipopt
00238 #endif

Generated on Wed Jan 14 03:00:32 2009 by  doxygen 1.4.7