Ipopt Documentation  
IpWsmpSolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, 2010 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 2005-03-17
6 
7 #ifndef __IPWSMPSOLVERINTERFACE_HPP__
8 #define __IPWSMPSOLVERINTERFACE_HPP__
9 
11 #include "IpPardisoSolverInterface.hpp" // for IPOPT_DECL_SMAT_REORDERING_PARDISO_WSMP
12 #include "IpTypes.h"
13 
14 namespace Ipopt
15 {
16 
21 {
22 public:
24 
27 #ifdef PARDISO_MATCHING_PREPROCESS
28  SmartPtr<LibraryLoader> pardisoloader_
29 #endif
30  );
31 
33  virtual ~WsmpSolverInterface();
35 
36  bool InitializeImpl(
37  const OptionsList& options,
38  const std::string& prefix
39  );
40 
44  Index dim,
45  Index nonzeros,
46  const Index* ia,
47  const Index* ja
48  );
49 
50  virtual double* GetValuesArrayPtr();
51 
53  bool new_matrix,
54  const Index* ia,
55  const Index* ja,
56  Index nrhs,
57  double* rhs_vals,
58  bool check_NegEVals,
59  Index numberOfNegEVals
60  );
61 
62  virtual Index NumberOfNegEVals() const;
64 
65  //* @name Options of Linear solver */
67  virtual bool IncreaseQuality();
68 
69  virtual bool ProvidesInertia() const
70  {
71  return true;
72  }
73 
75  {
76  return CSR_Format_1_Offset;
77  }
79 
81  static void RegisterOptions(
83  );
84 
86  static void GetVersion(
87  int& V,
88  int& R,
89  int& M
90  );
92 
93  virtual bool ProvidesDegeneracyDetection() const;
94 
96  const Index* ia,
97  const Index* ja,
98  std::list<Index>& c_deps
99  );
100 
101 private:
109 
112  const WsmpSolverInterface&
113  );
114 
116  void operator=(
117  const WsmpSolverInterface&
118  );
120 
122 
125 
128 
130  double* a_;
131 
132 #ifdef PARDISO_MATCHING_PREPROCESS
133 
134  Index* ia2;
136  Index* ja2;
137  double* a2_;
138  Index* perm2;
139  double* scale2;
141 #endif
142 
144 
146 
167 
170 
172 
176 
178 
200 
202 
206  double* DPARM_;
214 
218 #ifdef PARDISO_MATCHING_PREPROCESS
219  SmartPtr<LibraryLoader> pardisoloader;
220  IPOPT_DECL_SMAT_REORDERING_PARDISO_WSMP(*smat_reordering_pardiso_wsmp);
221 #endif
222 
225 
228  const Index* ia,
229  const Index* ja
230  );
231 
234  const Index* ia,
235  const Index* ja,
236  Index numberOfNegEVals
237  );
238 
241  const Index* ia,
242  const Index* ja,
243  bool check_NegEVals,
244  Index numberOfNegEVals
245  );
246 
249  const Index* ia,
250  const Index* ja,
251  Index nrhs,
252  double* rhs_vals
253  );
255 };
256 
257 } // namespace Ipopt
258 #endif
static void GetVersion(int &V, int &R, int &M)
give WSMP version
Index dim_
Number of rows and columns of the matrix.
virtual double * GetValuesArrayPtr()
Method returning an internal array into which the nonzero elements (in the same order as ja) will be ...
ESymSolverStatus
Enum to report outcome of a linear solve.
Index matrix_file_number_
Counter for matrix file numbers.
virtual ESymSolverStatus InitializeStructure(Index dim, Index nonzeros, const Index *ia, const Index *ja)
Method for initializing internal structures.
Base class for interfaces to symmetric indefinite linear solvers for sparse matrices.
Index negevals_
Number of negative eigenvalues.
Index * MRP_
WSSMP&#39;s internal MRP array.
virtual Index NumberOfNegEVals() const
Number of negative eigenvalues detected during last factorization.
bool initialized_
Flag indicating if internal data is initialized.
virtual ESymSolverStatus DetermineDependentRows(const Index *ia, const Index *ja, std::list< Index > &c_deps)
This method determines the list of row indices of the linearly dependent rows.
bool wsmp_no_pivoting_
Flag indicating whether the positive definite version of WSMP should be used.
bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class...
EMatrixFormat MatrixFormat() const
Query of requested matrix type that the linear solver understands.
ESymSolverStatus InternalSymFact(const Index *ia, const Index *ja, Index numberOfNegEVals)
Call Wsmp to really do the analysis phase.
WsmpSolverInterface()
Constructor.
Index * IPARM_
Integer parameter array for WSSMP.
bool skip_inertia_check_
Flag indicating if the inertia is always assumed to be correct.
Index factorizations_since_recomputed_ordering_
Counter indicating how many factorizations have been done sine the last recomputation of the ordering...
ipindex Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:20
#define IPOPT_DECL_SMAT_REORDERING_PARDISO_WSMP(x)
Compressed sparse row format for upper triangular part, with 1 offset.
This file contains a base class for all exceptions and a set of macros to help with exceptions...
bool pivtol_changed_
Flag indicating if the matrix has to be refactorized because the pivot tolerance has been changed...
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:164
virtual ESymSolverStatus MultiSolve(bool new_matrix, const Index *ia, const Index *ja, Index nrhs, double *rhs_vals, bool check_NegEVals, Index numberOfNegEVals)
Solve operation for multiple right hand sides.
This class stores a list of user set options.
virtual ~WsmpSolverInterface()
Destructor.
ESymSolverStatus SymbolicFactorization(const Index *ia, const Index *ja)
Call Wsmp to do the analysis phase.
Index * INVP_
WSSMP&#39;s inverse permutation vector.
virtual bool ProvidesDegeneracyDetection() const
Query whether the indices of linearly dependent rows/columns can be determined by this linear solver...
ipnumber Number
Type of all numbers.
Definition: IpTypes.hpp:17
Index wsmp_num_threads_
Option that controls the matching strategy.
Number wsmp_pivtol_
Pivot tolerance.
Index * PERM_
WSSMP&#39;s permutation vector.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
double * DPARM_
Double precision parameter array for WSSMP.
bool printed_num_threads_
Flag indicating if we already printed how many threads are used by WSMP.
EMatrixFormat
Enum to specify sparse matrix format.
virtual bool IncreaseQuality()
Request to increase quality of solution for next solve.
Index wsmp_scaling_
Indicating which of WSMP&#39;s scaling methods should be used.
ESymSolverStatus Factorization(const Index *ia, const Index *ja, bool check_NegEVals, Index numberOfNegEVals)
Call Wsmp to factorize the Matrix.
Number wsmp_singularity_threshold_
WSMP&#39;s singularity threshold.
Interface to the linear solver Wsmp, derived from SparseSymLinearSolverInterface. ...
void operator=(const WsmpSolverInterface &)
Default Assignment Operator.
bool have_symbolic_factorization_
Flag indicating whether symbolic factorization and order has already been performed.
Index nonzeros_
Number of nonzeros of the matrix in triplet representation.
Index wsmp_write_matrix_iteration_
iteration number in which matrices are to be written out
ESymSolverStatus Solve(const Index *ia, const Index *ja, Index nrhs, double *rhs_vals)
Call Wsmp to do the Solve.
Number wsmp_pivtolmax_
Maximal pivot tolerance.
double * a_
Array for storing the values of the matrix.
virtual bool ProvidesInertia() const
Query whether inertia is computed by linear solver.