IpMa77SolverInterface.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2009, Jonathan Hogg <jdh41.at.cantab.net>
00002 // Copyright (C) 2004, 2007 International Business Machines and others.
00003 // All Rights Reserved.
00004 // This code is published under the Eclipse Public License.
00005 //
00006 // $Id: IpMa77SolverInterface.hpp 2085 2012-02-16 11:01:51Z stefan $
00007 //
00008 // Authors: Jonathan Hogg                           2009-07-29 
00009 //          Carl Laird, Andreas Waechter     IBM    2004-03-17
00010 
00011 #ifndef __IPMA77SOLVERINTERFACE_HPP__
00012 #define __IPMA77SOLVERINTERFACE_HPP__
00013 
00014 #include "IpSparseSymLinearSolverInterface.hpp"
00015 
00016 extern "C" {
00017 #include "hsl_ma77d.h"
00018 }
00019 
00020 namespace Ipopt
00021 {
00022 
00102   class Ma77SolverInterface: public SparseSymLinearSolverInterface
00103   {
00104   private:
00105     int ndim_; // Number of dimensions
00106     double *val_; // Storage for variables
00107     int numneg_; // Number of negative pivots in last factorization
00108     void *keep_; // Stores pointer to factors (only understood by Fortran code!)
00109     bool pivtol_changed_; // indicates if pivtol has been changed
00110 
00111     /* Options */
00112     struct ma77_control control_;
00113     double umax_;
00114 
00115   public:
00116 
00117     Ma77SolverInterface() :
00118         val_(NULL), keep_(NULL), pivtol_changed_(false)
00119     {}
00120     ~Ma77SolverInterface();
00121 
00122     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00123 
00124     bool InitializeImpl(const OptionsList& options,
00125                         const std::string& prefix);
00126 
00135     ESymSolverStatus InitializeStructure(Index dim, Index nonzeros,
00136                                          const Index* ia,
00137                                          const Index* ja);
00138 
00145     double* GetValuesArrayPtr() { return val_; }
00146 
00179     ESymSolverStatus MultiSolve(bool new_matrix,
00180                                 const Index* ia,
00181                                 const Index* ja,
00182                                 Index nrhs,
00183                                 double* rhs_vals,
00184                                 bool check_NegEVals,
00185                                 Index numberOfNegEVals);
00186 
00193     Index NumberOfNegEVals() const { return numneg_; }
00195 
00196     //* @name Options of Linear solver */
00198 
00204     bool IncreaseQuality();
00205 
00209     bool ProvidesInertia() const { return true; }
00210 
00214     EMatrixFormat MatrixFormat() const { return CSR_Full_Format_0_Offset; }
00216 
00222     bool ProvidesDegeneracyDetection() const { return false; }
00225     ESymSolverStatus DetermineDependentRows(const Index* ia,
00226                                             const Index* ja,
00227                                             std::list<Index>& c_deps)
00228     {
00229       return SYMSOLVER_FATAL_ERROR;
00230     }
00231 
00233     static void MetisOrder(const int dim, const Index *ptr, const Index *row, Index *perm);
00234   };
00235 
00236 } // namespace Ipopt
00237 
00238 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 8 May 2013 for Ipopt by  doxygen 1.6.1