00001 // Copyright (C) 2004, 2006 International Business Machines and others. 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // 00005 // $Id: IpTSymLinearSolver.hpp 759 2006-07-07 03:07:08Z andreasw $ 00006 // 00007 // Authors: Carl Laird, Andreas Waechter IBM 2004-03-17 00008 00009 #ifndef __IPTSYMLINEARSOLVER_HPP__ 00010 #define __IPTSYMLINEATSOLVER_HPP__ 00011 00012 #include "IpSymLinearSolver.hpp" 00013 #include "IpSparseSymLinearSolverInterface.hpp" 00014 #include "IpTSymScalingMethod.hpp" 00015 #include "IpSymMatrix.hpp" 00016 #include "IpTripletToCSRConverter.hpp" 00017 #include <vector> 00018 00019 namespace Ipopt 00020 { 00021 00032 class TSymLinearSolver: public SymLinearSolver 00033 { 00034 public: 00041 TSymLinearSolver(SmartPtr<SparseSymLinearSolverInterface> solver_interface, 00042 SmartPtr<TSymScalingMethod> scaling_method); 00043 00045 virtual ~TSymLinearSolver(); 00047 00049 bool InitializeImpl(const OptionsList& options, 00050 const std::string& prefix); 00051 00057 virtual ESymSolverStatus MultiSolve(const SymMatrix &A, 00058 std::vector<SmartPtr<const Vector> >& rhsV, 00059 std::vector<SmartPtr<Vector> >& solV, 00060 bool check_NegEVals, 00061 Index numberOfNegEVals); 00062 00067 virtual Index NumberOfNegEVals() const; 00069 00070 //* @name Options of Linear solver */ 00072 00077 virtual bool IncreaseQuality(); 00078 00082 virtual bool ProvidesInertia() const; 00084 00087 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions); 00089 00090 private: 00100 TSymLinearSolver(); 00101 00103 TSymLinearSolver(const TSymLinearSolver&); 00104 00106 void operator=(const TSymLinearSolver&); 00108 00112 TaggedObject::Tag atag_; 00113 00115 Index dim_; 00116 00120 Index nonzeros_triplet_; 00124 Index nonzeros_compressed_; 00126 00131 bool have_structure_; 00134 bool linear_scaling_on_demand_; 00137 bool initialized_; 00139 00141 SmartPtr<SparseSymLinearSolverInterface> solver_interface_; 00146 SmartPtr<TSymScalingMethod> scaling_method_; 00148 double* scaling_factors_; 00150 bool use_scaling_; 00152 bool just_switched_on_scaling_; 00154 00159 Index* airn_; 00162 Index* ajcn_; 00166 SmartPtr<TripletToCSRConverter> triplet_to_csr_converter_; 00168 SparseSymLinearSolverInterface::EMatrixFormat matrix_format_; 00170 00175 bool warm_start_same_structure_; 00177 00184 ESymSolverStatus InitializeStructure(const SymMatrix& symT_A); 00185 00188 void GiveMatrixToSolver(bool new_matrix, const SymMatrix& sym_A); 00190 }; 00191 00192 } // namespace Ipopt 00193 #endif