Ipopt Documentation  
IpTSymLinearSolver.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2007 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors: Carl Laird, Andreas Waechter IBM 2004-03-17
6 
7 #ifndef __IPTSYMLINEARSOLVER_HPP__
8 #define __IPTSYMLINEARSOLVER_HPP__
9 
10 #include "IpSymLinearSolver.hpp"
12 #include "IpTSymScalingMethod.hpp"
13 #include "IpSymMatrix.hpp"
15 #include <vector>
16 #include <list>
17 
18 namespace Ipopt
19 {
20 
34 {
35 public:
37 
47  SmartPtr<TSymScalingMethod> scaling_method
48  );
49 
51  virtual ~TSymLinearSolver();
53 
54  bool InitializeImpl(
55  const OptionsList& options,
56  const std::string& prefix);
57 
61  const SymMatrix& A,
62  std::vector<SmartPtr<const Vector> >& rhsV,
63  std::vector<SmartPtr<Vector> >& solV,
64  bool check_NegEVals,
65  Index numberOfNegEVals
66  );
67 
68  virtual Index NumberOfNegEVals() const;
70 
71  //* @name Options of Linear solver */
73  virtual bool IncreaseQuality();
74 
75  virtual bool ProvidesInertia() const;
77 
81  bool ProvidesDegeneracyDetection() const;
83 
85  Index n_rows,
86  Index n_cols,
87  Index n_jac_nz,
88  Number* jac_c_vals,
89  Index* jac_c_iRow,
90  Index* jac_c_jCol,
91  std::list<Index>& c_deps
92  );
94 
96  static void RegisterOptions(
99  );
101 
102 private:
110 
113 
116  const TSymLinearSolver&
117  );
118 
120  void operator=(
121  const TSymLinearSolver&
122  );
124 
126 
129 
132 
146 
148 
163 
167 
181 
183 
197 
199 
205 
207 
214  const SymMatrix& symT_A
215  );
216 
220  void GiveMatrixToSolver(
221  bool new_matrix,
222  const SymMatrix& sym_A
223  );
225 };
226 
227 } // namespace Ipopt
228 #endif
SmartPtr< SparseSymLinearSolverInterface > solver_interface_
Strategy Object for an interface to a linear solver.
bool have_structure_
Flag indicating if the internal structures are initialized.
SmartPtr< TSymScalingMethod > scaling_method_
Strategy Object for a method that computes scaling factors for the matrices.
ESymSolverStatus
Enum to report outcome of a linear solve.
SparseSymLinearSolverInterface::EMatrixFormat matrix_format_
Flag indicating what matrix data format the solver requires.
bool just_switched_on_scaling_
Flag indicating whether we just switched on the scaling.
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
virtual ~TSymLinearSolver()
Destructor.
bool warm_start_same_structure_
Flag indicating whether the TNLP with identical structure has already been solved before...
General driver for linear solvers for sparse indefinite symmetric matrices.
bool ProvidesDegeneracyDetection() const
virtual ESymSolverStatus MultiSolve(const SymMatrix &A, std::vector< SmartPtr< const Vector > > &rhsV, std::vector< SmartPtr< Vector > > &solV, bool check_NegEVals, Index numberOfNegEVals)
Solve operation for multiple right hand sides.
Index * airn_
row indices of matrix in triplet (MA27) format.
ESymSolverStatus InitializeStructure(const SymMatrix &symT_A)
Initialize nonzero structure.
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class...
TSymLinearSolver()
Default Constructor.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:20
This file contains a base class for all exceptions and a set of macros to help with exceptions...
This is the base class for all derived symmetric matrix types.
Definition: IpSymMatrix.hpp:20
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:164
This class stores a list of user set options.
Index nonzeros_triplet_
Number of nonzeros of the matrix in triplet format.
void GiveMatrixToSolver(bool new_matrix, const SymMatrix &sym_A)
Copy the elements of the matrix in the required format into the array that is provided by the solver ...
ESymSolverStatus DetermineDependentRows(Index n_rows, Index n_cols, Index n_jac_nz, Number *jac_c_vals, Index *jac_c_iRow, Index *jac_c_jCol, std::list< Index > &c_deps)
Index * ajcn_
column indices of matrix in triplet (MA27) format.
void operator=(const TSymLinearSolver &)
Default Assignment Operator.
SmartPtr< TripletToCSRConverter > triplet_to_csr_converter_
Pointer to object for conversion from triplet to compressed format.
bool linear_scaling_on_demand_
Flag indicating whether the scaling objected is to be switched on when increased quality is requested...
bool use_scaling_
Flag indicating whether scaling should be performed.
ipnumber Number
Type of all numbers.
Definition: IpTypes.hpp:17
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.
unsigned int Tag
Type for the Tag values.
EMatrixFormat
Enum to specify sparse matrix format.
Number * scaling_factors_
Array storing the scaling factors.
TaggedObject::Tag atag_
Tag for the incoming matrix.
Base class for all derived symmetric linear solvers.
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
Index dim_
Number of rows and columns of the matrix.
bool initialized_
Flag indicating if the InitializeStructure method has been called for the linear solver.
Index nonzeros_compressed_
Number of nonzeros in compressed format.