/home/coin/SVN-release/Ipopt-3.6.0/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 1438 2009-04-30 01:41:54Z 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 
00161     Index pardiso_max_iter_;
00162     Index pardiso_dropping_schur_exponent_;
00163     Index pardiso_dropping_factor_exponent_;
00164     Index pardiso_inverse_norm_factor_;
00165 
00166     Index normal_pardiso_max_iter_;
00167     Index normal_pardiso_dropping_schur_exponent_;
00168     Index normal_pardiso_dropping_factor_exponent_;
00169     Index normal_pardiso_inverse_norm_factor_;
00171 
00176     bool initialized_;
00178 
00182     void** PT_;
00185     ipfint MAXFCT_;
00187     ipfint MNUM_;
00189     ipfint MTYPE_;
00191     ipfint* IPARM_;
00193     ipfint MSGLVL_;
00195 
00198     Index debug_last_iter_;
00199     Index debug_cnt_;
00201 
00206     ESymSolverStatus SymbolicFactorization(const Index* ia,
00207                                            const Index* ja);
00208 
00211     ESymSolverStatus Factorization(const Index* ia,
00212                                    const Index* ja,
00213                                    bool check_NegEVals,
00214                                    Index numberOfNegEVals);
00215 
00218     ESymSolverStatus Solve(const Index* ia,
00219                            const Index* ja,
00220                            Index nrhs,
00221                            double *rhs_vals);
00223 
00225     InexactData& InexData()
00226     {
00227       InexactData& inexact_data =
00228         static_cast<InexactData&>(IpData().AdditionalData());
00229       DBG_ASSERT(dynamic_cast<InexactData*>(&IpData().AdditionalData()));
00230       return inexact_data;
00231     }
00232 
00234     InexactCq& InexCq()
00235     {
00236       InexactCq& inexact_cq =
00237         static_cast<InexactCq&>(IpCq().AdditionalCq());
00238       DBG_ASSERT(dynamic_cast<InexactCq*>(&IpCq().AdditionalCq()));
00239       return inexact_cq;
00240     }
00241 
00243     SmartPtr<IterativeSolverTerminationTester> normal_tester_;
00244 
00246     SmartPtr<IterativeSolverTerminationTester> pd_tester_;
00247 
00248   };
00249 
00250 } // namespace Ipopt
00251 #endif

Generated on Thu Apr 30 03:04:06 2009 by  doxygen 1.4.7