00001
00002
00003
00004
00005
00006
00007
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 #include <list>
00019
00020 namespace Ipopt
00021 {
00022
00033 class TSymLinearSolver: public SymLinearSolver
00034 {
00035 public:
00042 TSymLinearSolver(SmartPtr<SparseSymLinearSolverInterface> solver_interface,
00043 SmartPtr<TSymScalingMethod> scaling_method);
00044
00046 virtual ~TSymLinearSolver();
00048
00050 bool InitializeImpl(const OptionsList& options,
00051 const std::string& prefix);
00052
00058 virtual ESymSolverStatus MultiSolve(const SymMatrix &A,
00059 std::vector<SmartPtr<const Vector> >& rhsV,
00060 std::vector<SmartPtr<Vector> >& solV,
00061 bool check_NegEVals,
00062 Index numberOfNegEVals);
00063
00068 virtual Index NumberOfNegEVals() const;
00070
00071
00073
00078 virtual bool IncreaseQuality();
00079
00083 virtual bool ProvidesInertia() const;
00085
00091 bool ProvidesDegeneracyDetection() const;
00096 ESymSolverStatus DetermineDependentRows(Index n_rows, Index n_cols,
00097 Index n_jac_nz,
00098 Number* jac_c_vals,
00099 Index* jac_c_iRow,
00100 Index* jac_c_jCol,
00101 std::list<Index>& c_deps);
00103
00106 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00108
00109 private:
00119 TSymLinearSolver();
00120
00122 TSymLinearSolver(const TSymLinearSolver&);
00123
00125 void operator=(const TSymLinearSolver&);
00127
00131 TaggedObject::Tag atag_;
00132
00134 Index dim_;
00135
00139 Index nonzeros_triplet_;
00143 Index nonzeros_compressed_;
00145
00150 bool have_structure_;
00153 bool linear_scaling_on_demand_;
00156 bool initialized_;
00158
00160 SmartPtr<SparseSymLinearSolverInterface> solver_interface_;
00165 SmartPtr<TSymScalingMethod> scaling_method_;
00167 double* scaling_factors_;
00169 bool use_scaling_;
00171 bool just_switched_on_scaling_;
00173
00178 Index* airn_;
00181 Index* ajcn_;
00185 SmartPtr<TripletToCSRConverter> triplet_to_csr_converter_;
00187 SparseSymLinearSolverInterface::EMatrixFormat matrix_format_;
00189
00194 bool warm_start_same_structure_;
00196
00203 ESymSolverStatus InitializeStructure(const SymMatrix& symT_A);
00204
00207 void GiveMatrixToSolver(bool new_matrix, const SymMatrix& sym_A);
00209 };
00210
00211 }
00212 #endif