HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
PastixInterface.hpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef PASTIX_INTERFACE_H
11 #define PASTIX_INTERFACE_H
12 
13 #include <Eigen/SparseCore>
14 #include <pastix.h>
15 
16 namespace Eigen {
17 
24 #if defined(DCOMPLEX)
25  #define PASTIX_COMPLEX COMPLEX
26  #define PASTIX_DCOMPLEX DCOMPLEX
27 #else
28  #define PASTIX_COMPLEX std::complex<float>
29  #define PASTIX_DCOMPLEX std::complex<double>
30 #endif
31 
32 
33 template<typename _MatrixType, bool IsStrSym = false> class PastixLU;
34 template<typename _MatrixType, int Options> class PastixLLT;
35 template<typename _MatrixType, int Options> class PastixLDLT;
36 
37 namespace internal
38 {
39 
40  template<class Pastix> struct pastix_traits;
41 
42  template<typename _MatrixType>
43  struct pastix_traits< PastixLU<_MatrixType> >
44  {
45  typedef _MatrixType MatrixType;
46  typedef typename _MatrixType::Scalar Scalar;
47  typedef typename _MatrixType::RealScalar RealScalar;
48  typedef typename _MatrixType::StorageIndex StorageIndex;
49  };
50 
51  template<typename _MatrixType, int Options>
52  struct pastix_traits< PastixLLT<_MatrixType,Options> >
53  {
54  typedef _MatrixType MatrixType;
55  typedef typename _MatrixType::Scalar Scalar;
56  typedef typename _MatrixType::RealScalar RealScalar;
57  typedef typename _MatrixType::StorageIndex StorageIndex;
58  };
59 
60  template<typename _MatrixType, int Options>
61  struct pastix_traits< PastixLDLT<_MatrixType,Options> >
62  {
63  typedef _MatrixType MatrixType;
64  typedef typename _MatrixType::Scalar Scalar;
65  typedef typename _MatrixType::RealScalar RealScalar;
66  typedef typename _MatrixType::StorageIndex StorageIndex;
67  };
68 
69  inline int eigen_pastix(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, int n, int *ptr, int *idx, float *vals, int *perm, int * invp, float *x, int nbrhs, int *iparm, double *dparm)
70  {
71  if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
72  if (nbrhs == 0) {x = NULL; nbrhs=1;}
73  return pastix(pastix_data, pastix_comm, n, ptr, idx, vals, perm, invp, x, nbrhs, iparm, dparm);
74  }
75 
76  inline int eigen_pastix(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, int n, int *ptr, int *idx, double *vals, int *perm, int * invp, double *x, int nbrhs, int *iparm, double *dparm)
77  {
78  if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
79  if (nbrhs == 0) {x = NULL; nbrhs=1;}
80  return pastix(pastix_data, pastix_comm, n, ptr, idx, vals, perm, invp, x, nbrhs, iparm, dparm);
81  }
82 
83  inline int eigen_pastix(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, int n, int *ptr, int *idx, std::complex<float> *vals, int *perm, int * invp, std::complex<float> *x, int nbrhs, int *iparm, double *dparm)
84  {
85  if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
86  if (nbrhs == 0) {x = NULL; nbrhs=1;}
87  return pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<PASTIX_COMPLEX*>(vals), perm, invp, reinterpret_cast<PASTIX_COMPLEX*>(x), nbrhs, iparm, dparm);
88  }
89 
90  inline int eigen_pastix(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, int n, int *ptr, int *idx, std::complex<double> *vals, int *perm, int * invp, std::complex<double> *x, int nbrhs, int *iparm, double *dparm)
91  {
92  if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
93  if (nbrhs == 0) {x = NULL; nbrhs=1;}
94  return pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<PASTIX_DCOMPLEX*>(vals), perm, invp, reinterpret_cast<PASTIX_DCOMPLEX*>(x), nbrhs, iparm, dparm);
95  }
96 
97  // Convert the matrix to Fortran-style Numbering
98  template <typename MatrixType>
99  void c_to_fortran_numbering (MatrixType& mat)
100  {
101  if ( !(mat.outerIndexPtr()[0]) )
102  {
103  int i;
104  for(i = 0; i <= mat.rows(); ++i)
105  ++mat.outerIndexPtr()[i];
106  for(i = 0; i < mat.nonZeros(); ++i)
107  ++mat.innerIndexPtr()[i];
108  }
109  }
110 
111  // Convert to C-style Numbering
112  template <typename MatrixType>
113  void fortran_to_c_numbering (MatrixType& mat)
114  {
115  // Check the Numbering
116  if ( mat.outerIndexPtr()[0] == 1 )
117  { // Convert to C-style numbering
118  int i;
119  for(i = 0; i <= mat.rows(); ++i)
120  --mat.outerIndexPtr()[i];
121  for(i = 0; i < mat.nonZeros(); ++i)
122  --mat.innerIndexPtr()[i];
123  }
124  }
125 }
126 
127 // This is the base class to interface with PaStiX functions.
128 // Users should not used this class directly.
129 template <class Derived>
130 class PastixBase : public SparseSolverBase<Derived>
131 {
132  protected:
133  typedef SparseSolverBase<Derived> Base;
134  using Base::derived;
135  using Base::m_isInitialized;
136  public:
137  using Base::_solve_impl;
138 
141  typedef typename MatrixType::Scalar Scalar;
142  typedef typename MatrixType::RealScalar RealScalar;
143  typedef typename MatrixType::StorageIndex StorageIndex;
144  typedef Matrix<Scalar,Dynamic,1> Vector;
145  typedef SparseMatrix<Scalar, ColMajor> ColSpMatrix;
146  enum {
147  ColsAtCompileTime = MatrixType::ColsAtCompileTime,
148  MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
149  };
150 
151  public:
152 
154  {
155  init();
156  }
157 
159  {
160  clean();
161  }
162 
163  template<typename Rhs,typename Dest>
164  bool _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const;
165 
172  {
173  return m_iparm;
174  }
175 
180  int& iparm(int idxparam)
181  {
182  return m_iparm(idxparam);
183  }
184 
190  {
191  return m_dparm;
192  }
193 
194 
198  double& dparm(int idxparam)
199  {
200  return m_dparm(idxparam);
201  }
202 
203  inline Index cols() const { return m_size; }
204  inline Index rows() const { return m_size; }
205 
214  ComputationInfo info() const
215  {
216  eigen_assert(m_isInitialized && "Decomposition is not initialized.");
217  return m_info;
218  }
219 
220  //Initialize the Pastix data structure, check the matrix
221  void init(double eps_refinement = -1.0, double eps_ctrl = -1.0);
222  protected:
223 
224  // Initialize the Pastix data structure, check the matrix
225  //void init();
226 
227  // Compute the ordering and the symbolic factorization
229 
230  // Compute the numerical factorization
232 
233  // Free all the data allocated by Pastix
234  void clean()
235  {
236  eigen_assert(m_initisOk && "The Pastix structure should be allocated first");
237  m_iparm(IPARM_START_TASK) = PastixTaskClean;
238  m_iparm(IPARM_END_TASK) = PastixTaskClean;
239  internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, 0, 0, 0, (Scalar*)0,
240  m_perm.data(), m_invp.data(), 0, 0, m_iparm.data(), m_dparm.data());
241  }
242 
244 
248  mutable ComputationInfo m_info;
249  mutable pastix_data_t *m_pastixdata; // Data structure for pastix
250  mutable int m_comm; // The MPI communicator identifier
251  mutable Array<int,IPARM_SIZE,1> m_iparm; // integer vector for the input parameters
252  mutable Array<double,DPARM_SIZE,1> m_dparm; // Scalar vector for the input parameters
253  mutable Matrix<StorageIndex,Dynamic,1> m_perm; // Permutation vector
254  mutable Matrix<StorageIndex,Dynamic,1> m_invp; // Inverse permutation vector
255  mutable int m_size; // Size of the matrix
256 };
257 
262 template <class Derived>
263 void PastixBase<Derived>::init(double eps_refinement, double eps_ctrl)
264 {
265  m_size = 0;
266  m_iparm.setZero(IPARM_SIZE);
267  m_dparm.setZero(DPARM_SIZE);
268 
269  m_iparm(IPARM_MODIFY_PARAMETER) = 0;
270  pastix(&m_pastixdata, MPI_COMM_WORLD,
271  0, 0, 0, 0,
272  0, 0, 0, 1, m_iparm.data(), m_dparm.data());
273 
275  m_iparm[IPARM_FLOAT] = PastixDouble;
276  m_iparm[IPARM_MTX_TYPE] = PastixGeneral; // Will be updated if LDLT or LLT is called
277  m_iparm[IPARM_VERBOSE] = PastixVerboseNot;
278  m_iparm[IPARM_ORDERING] = PastixOrderScotch;
279  m_iparm[IPARM_INCOMPLETE] = 0;
283 
284  // RD RD RD
285  m_iparm[IPARM_ITERMAX] = 2000;
286  if( eps_refinement >= 0.0) {
287  m_dparm[DPARM_EPSILON_REFINEMENT] = eps_refinement;
288  }
289  if( eps_ctrl >= 0.0) {
290  m_dparm[DPARM_EPSILON_MAGN_CTRL] = eps_ctrl;
291  }
292 
293  m_iparm(IPARM_START_TASK) = PastixTaskInit;
294  m_iparm(IPARM_END_TASK) = PastixTaskInit;
295  int rc = internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, 0, 0, 0, (Scalar*)0,
296  0, 0, 0, 0, m_iparm.data(), m_dparm.data());
297 
298  // Check the returned error
299  if(rc != PASTIX_SUCCESS) {
300  m_info = InvalidInput;
301  m_initisOk = false;
302  }
303  else {
304  m_info = Success;
305  m_initisOk = true;
306  }
307 }
308 
309 template <class Derived>
311 {
312  eigen_assert(mat.rows() == mat.cols() && "The input matrix should be squared");
313 
314  analyzePattern(mat);
315  factorize(mat);
316 
318 }
319 
320 
321 template <class Derived>
323 {
324  eigen_assert(m_initisOk && "The initialization of PaSTiX failed");
325 
326  // clean previous calls
327  if(m_size>0)
328  clean();
329 
330  m_size = internal::convert_index<int>(mat.rows());
331  m_perm.resize(m_size);
332  m_invp.resize(m_size);
333 
334  m_iparm(IPARM_START_TASK) = PastixTaskOrdering;
335  m_iparm(IPARM_END_TASK) = PastixTaskAnalyze;
336  int rc = internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, m_size, mat.outerIndexPtr(), mat.innerIndexPtr(),
337  mat.valuePtr(), m_perm.data(), m_invp.data(), 0, 0, m_iparm.data(), m_dparm.data());
338 
339  // Check the returned error
340  if(rc != PASTIX_SUCCESS)
341  {
342  m_info = NumericalIssue;
343  m_analysisIsOk = false;
344  }
345  else
346  {
347  m_info = Success;
348  m_analysisIsOk = true;
349  }
350 }
351 
352 template <class Derived>
354 {
355 // if(&m_cpyMat != &mat) m_cpyMat = mat;
356  eigen_assert(m_analysisIsOk && "The analysis phase should be called before the factorization phase");
357  m_iparm(IPARM_START_TASK) = PastixTaskNumfact;
358  m_iparm(IPARM_END_TASK) = PastixTaskNumfact;
359  m_size = internal::convert_index<int>(mat.rows());
360 
361  int rc = internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, m_size, mat.outerIndexPtr(), mat.innerIndexPtr(),
362  mat.valuePtr(), m_perm.data(), m_invp.data(), 0, 0, m_iparm.data(), m_dparm.data());
363 
364  // Check the returned error
365  if(rc != PASTIX_SUCCESS)
366  {
367  m_info = NumericalIssue;
368  m_factorizationIsOk = false;
369  m_isInitialized = false;
370  }
371  else
372  {
373  m_info = Success;
374  m_factorizationIsOk = true;
375  m_isInitialized = true;
376  }
377 }
378 
379 /* Solve the system */
380 template<typename Base>
381 template<typename Rhs,typename Dest>
382 bool PastixBase<Base>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const
383 {
384  eigen_assert(m_isInitialized && "The matrix should be factorized first");
385  EIGEN_STATIC_ASSERT((Dest::Flags&RowMajorBit)==0,
386  THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
387  int rhs = 1;
388 
389  x = b; /* on return, x is overwritten by the computed solution */
390 
391  for (int i = 0; i < b.cols(); i++){
392  m_iparm[IPARM_START_TASK] = PastixTaskSolve;
393  m_iparm[IPARM_END_TASK] = PastixTaskRefine;
394 
395  internal::eigen_pastix(&m_pastixdata, MPI_COMM_WORLD, internal::convert_index<int>(x.rows()), 0, 0, 0,
396  m_perm.data(), m_invp.data(), &x(0, i), rhs, m_iparm.data(), m_dparm.data());
397  }
398 
399  // Check the returned error
401 
403  return 0;
404 }
405 
407 
422 template<typename _MatrixType, bool IsStrSym>
423 class PastixLU : public PastixBase< PastixLU<_MatrixType> >
424 {
425  public:
428  typedef typename Base::ColSpMatrix ColSpMatrix;
429  typedef typename MatrixType::StorageIndex StorageIndex;
430 
431  public:
433  {
434  init();
435  }
436 
437  explicit PastixLU(const MatrixType& matrix):Base()
438  {
439  init();
440  compute(matrix);
441  }
447  void compute (const MatrixType& matrix)
448  {
449  m_structureIsUptodate = false;
450  ColSpMatrix temp;
451  grabMatrix(matrix, temp);
452  Base::compute(temp);
453  }
459  void analyzePattern(const MatrixType& matrix)
460  {
461  m_structureIsUptodate = false;
462  ColSpMatrix temp;
463  grabMatrix(matrix, temp);
464  Base::analyzePattern(temp);
465  }
466 
472  void factorize(const MatrixType& matrix)
473  {
474  ColSpMatrix temp;
475  grabMatrix(matrix, temp);
476  Base::factorize(temp);
477  }
478 
479  void init(double eps_refinement = -1.0, double eps_ctrl = -1.0)
480  {
481  m_structureIsUptodate = false;
482  m_iparm(IPARM_FACTORIZATION) = PastixFactLU;
483  if( eps_refinement >= 0.0) {
484  m_dparm[DPARM_EPSILON_REFINEMENT] = eps_refinement;
485  }
486  if( eps_ctrl >= 0.0) {
487  m_dparm[DPARM_EPSILON_MAGN_CTRL] = eps_ctrl;
488  }
489  }
490  protected:
491 
492  //void init()
493  //{
494  // m_structureIsUptodate = false;
495  // m_iparm(IPARM_FACTORIZATION) = PastixFactLU;
496  //}
497 
498  void grabMatrix(const MatrixType& matrix, ColSpMatrix& out)
499  {
500  if(IsStrSym)
501  out = matrix;
502  else
503  {
505  {
506  // update the transposed structure
507  m_transposedStructure = matrix.transpose();
508 
509  // Set the elements of the matrix to zero
510  for (Index j=0; j<m_transposedStructure.outerSize(); ++j)
511  for(typename ColSpMatrix::InnerIterator it(m_transposedStructure, j); it; ++it)
512  it.valueRef() = 0.0;
513 
514  m_structureIsUptodate = true;
515  }
516 
517  out = m_transposedStructure + matrix;
518  }
520  }
521 
522  using Base::m_iparm;
523  using Base::m_dparm;
524 
527 };
528 
530 
541 template<typename _MatrixType, int _UpLo>
542 class PastixLLT : public PastixBase< PastixLLT<_MatrixType, _UpLo> >
543 {
544  public:
547  typedef typename Base::ColSpMatrix ColSpMatrix;
548 
549  public:
550  enum { UpLo = _UpLo };
552  {
553  init();
554  }
555 
556  explicit PastixLLT(const MatrixType& matrix):Base()
557  {
558  init();
559  compute(matrix);
560  }
561 
565  void compute (const MatrixType& matrix)
566  {
567  ColSpMatrix temp;
568  grabMatrix(matrix, temp);
569  Base::compute(temp);
570  }
571 
576  void analyzePattern(const MatrixType& matrix)
577  {
578  ColSpMatrix temp;
579  grabMatrix(matrix, temp);
580  Base::analyzePattern(temp);
581  }
585  void factorize(const MatrixType& matrix)
586  {
587  ColSpMatrix temp;
588  grabMatrix(matrix, temp);
589  Base::factorize(temp);
590  }
591  protected:
592  using Base::m_iparm;
593 
594  void init()
595  {
596  m_iparm[IPARM_MTX_TYPE] = PastixSymmetric; // Was initialised as "PastixGeneral" with PastixBase
597  m_iparm(IPARM_FACTORIZATION) = PastixFactLLT;
598  }
599 
600  void grabMatrix(const MatrixType& matrix, ColSpMatrix& out)
601  {
602  out.resize(matrix.rows(), matrix.cols());
603  // Pastix supports only lower, column-major matrices
604  out.template selfadjointView<Lower>() = matrix.template selfadjointView<UpLo>();
606  }
607 };
608 
609 
611 
622 template<typename _MatrixType, int _UpLo>
623 class PastixLDLT : public PastixBase< PastixLDLT<_MatrixType, _UpLo> >
624 {
625  public:
628  typedef typename Base::ColSpMatrix ColSpMatrix;
629 
630  public:
631  enum { UpLo = _UpLo };
633  {
634  init();
635  }
636 
637  explicit PastixLDLT(const MatrixType& matrix):Base()
638  {
639  init();
640  compute(matrix);
641  }
642 
646  void compute (const MatrixType& matrix)
647  {
648  ColSpMatrix temp;
649  grabMatrix(matrix, temp);
650  Base::compute(temp);
651  }
652 
657  void analyzePattern(const MatrixType& matrix)
658  {
659  ColSpMatrix temp;
660  grabMatrix(matrix, temp);
661  Base::analyzePattern(temp);
662  }
666  void factorize(const MatrixType& matrix)
667  {
668  ColSpMatrix temp;
669  grabMatrix(matrix, temp);
670  Base::factorize(temp);
671  }
672 
673  protected:
674  using Base::m_iparm;
675 
676  void init()
677  {
678  m_iparm[IPARM_MTX_TYPE] = PastixSymmetric; // Was initialised as "PastixGeneral" with PastixBase
679  m_iparm(IPARM_FACTORIZATION) = PastixFactLDLT;
680  }
681 
682  void grabMatrix(const MatrixType& matrix, ColSpMatrix& out)
683  {
684  // Pastix supports only lower, column-major matrices
685  out.resize(matrix.rows(), matrix.cols());
686  out.template selfadjointView<Lower>() = matrix.template selfadjointView<UpLo>();
688  }
689 };
690 
691 } // end namespace Eigen
692 
693 #endif
Definition: PastixInterface.hpp:131
Class to invoke the Pastix LDLT solver.
Definition: PastixInterface.hpp:624
Array< int, IPARM_SIZE, 1 > m_iparm
Definition: PastixInterface.hpp:251
Class to invoke the Pastix LLT solver.
Definition: PastixInterface.hpp:543
Array< int, IPARM_SIZE, 1 > m_iparm
Definition: PastixInterface.hpp:251
Class to invoke the Pastix LU solver.
Definition: PastixInterface.hpp:424
Array< double, DPARM_SIZE, 1 > m_dparm
Definition: PastixInterface.hpp:252
Array< int, IPARM_SIZE, 1 > m_iparm
Definition: PastixInterface.hpp:251
mat
Definition: compute_eigs.m:7
Compute max and min eigenvalues of all matrices for i
Definition: compute_eigs.m:5
@ Scalar
Definition: basis.hpp:66
void analyzePattern(const MatrixType &matrix)
Definition: PastixInterface.hpp:657
Index rows() const
Definition: PastixInterface.hpp:204
_MatrixType::StorageIndex StorageIndex
Definition: PastixInterface.hpp:57
PastixLLT()
Definition: PastixInterface.hpp:551
Array< double, DPARM_SIZE, 1 > m_dparm
Definition: PastixInterface.hpp:252
_MatrixType::RealScalar RealScalar
Definition: PastixInterface.hpp:56
void factorize(const MatrixType &matrix)
Definition: PastixInterface.hpp:666
_MatrixType::StorageIndex StorageIndex
Definition: PastixInterface.hpp:48
PastixLU()
Definition: PastixInterface.hpp:432
void analyzePattern(ColSpMatrix &mat)
Definition: PastixInterface.hpp:322
int m_factorizationIsOk
Definition: PastixInterface.hpp:247
Base::ColSpMatrix ColSpMatrix
Definition: PastixInterface.hpp:628
void fortran_to_c_numbering(MatrixType &mat)
Definition: PastixInterface.hpp:113
Matrix< StorageIndex, Dynamic, 1 > m_invp
Definition: PastixInterface.hpp:254
void grabMatrix(const MatrixType &matrix, ColSpMatrix &out)
Definition: PastixInterface.hpp:498
MatrixType::StorageIndex StorageIndex
Definition: PastixInterface.hpp:143
_MatrixType::RealScalar RealScalar
Definition: PastixInterface.hpp:65
MatrixType::StorageIndex StorageIndex
Definition: PastixInterface.hpp:429
internal::pastix_traits< Derived >::MatrixType _MatrixType
Definition: PastixInterface.hpp:139
_MatrixType MatrixType
Definition: PastixInterface.hpp:426
Array< StorageIndex, IPARM_SIZE, 1 > & iparm()
Definition: PastixInterface.hpp:171
Matrix< StorageIndex, Dynamic, 1 > m_perm
Definition: PastixInterface.hpp:253
MatrixType::RealScalar RealScalar
Definition: PastixInterface.hpp:142
void c_to_fortran_numbering(MatrixType &mat)
Definition: PastixInterface.hpp:99
void compute(ColSpMatrix &mat)
Definition: PastixInterface.hpp:310
ComputationInfo info() const
Reports whether previous computation was successful.
Definition: PastixInterface.hpp:214
int eigen_pastix(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, int n, int *ptr, int *idx, float *vals, int *perm, int *invp, float *x, int nbrhs, int *iparm, double *dparm)
Definition: PastixInterface.hpp:69
void init()
Definition: PastixInterface.hpp:594
PastixBase()
Definition: PastixInterface.hpp:153
#define PASTIX_DCOMPLEX
Definition: PastixInterface.hpp:29
void compute(const MatrixType &matrix)
Definition: PastixInterface.hpp:565
int & iparm(int idxparam)
Definition: PastixInterface.hpp:180
void grabMatrix(const MatrixType &matrix, ColSpMatrix &out)
Definition: PastixInterface.hpp:682
Array< int, IPARM_SIZE, 1 > m_iparm
Definition: PastixInterface.hpp:251
void init(double eps_refinement=-1.0, double eps_ctrl=-1.0)
Definition: PastixInterface.hpp:479
_MatrixType MatrixType
Definition: PastixInterface.hpp:54
bool _solve_impl(const MatrixBase< Rhs > &b, MatrixBase< Dest > &x) const
Definition: PastixInterface.hpp:382
void factorize(const MatrixType &matrix)
Definition: PastixInterface.hpp:585
void analyzePattern(const MatrixType &matrix)
Definition: PastixInterface.hpp:576
Index cols() const
Definition: PastixInterface.hpp:203
_MatrixType MatrixType
Definition: PastixInterface.hpp:140
double & dparm(int idxparam)
Definition: PastixInterface.hpp:198
#define PASTIX_COMPLEX
Definition: PastixInterface.hpp:28
PastixBase< PastixLDLT< MatrixType, _UpLo > > Base
Definition: PastixInterface.hpp:627
PastixLU(const MatrixType &matrix)
Definition: PastixInterface.hpp:437
PastixLDLT(const MatrixType &matrix)
Definition: PastixInterface.hpp:637
PastixLDLT()
Definition: PastixInterface.hpp:632
void init(double eps_refinement=-1.0, double eps_ctrl=-1.0)
Definition: PastixInterface.hpp:263
void grabMatrix(const MatrixType &matrix, ColSpMatrix &out)
Definition: PastixInterface.hpp:600
_MatrixType MatrixType
Definition: PastixInterface.hpp:545
_MatrixType::Scalar Scalar
Definition: PastixInterface.hpp:46
int m_analysisIsOk
Definition: PastixInterface.hpp:246
_MatrixType::Scalar Scalar
Definition: PastixInterface.hpp:64
MatrixType::Scalar Scalar
Definition: PastixInterface.hpp:141
_MatrixType::StorageIndex StorageIndex
Definition: PastixInterface.hpp:66
Matrix< Scalar, Dynamic, 1 > Vector
Definition: PastixInterface.hpp:144
int m_initisOk
Definition: PastixInterface.hpp:245
void clean()
Definition: PastixInterface.hpp:234
Base::ColSpMatrix ColSpMatrix
Definition: PastixInterface.hpp:428
int m_size
Definition: PastixInterface.hpp:255
_MatrixType::RealScalar RealScalar
Definition: PastixInterface.hpp:47
void analyzePattern(const MatrixType &matrix)
Definition: PastixInterface.hpp:459
void compute(const MatrixType &matrix)
Definition: PastixInterface.hpp:646
~PastixBase()
Definition: PastixInterface.hpp:158
void factorize(const MatrixType &matrix)
Definition: PastixInterface.hpp:472
_MatrixType::Scalar Scalar
Definition: PastixInterface.hpp:55
void factorize(ColSpMatrix &mat)
Definition: PastixInterface.hpp:353
PastixBase< PastixLU< MatrixType > > Base
Definition: PastixInterface.hpp:427
_MatrixType MatrixType
Definition: PastixInterface.hpp:45
ColSpMatrix m_transposedStructure
Definition: PastixInterface.hpp:525
void init()
Definition: PastixInterface.hpp:676
bool m_structureIsUptodate
Definition: PastixInterface.hpp:526
Base::ColSpMatrix ColSpMatrix
Definition: PastixInterface.hpp:547
void compute(const MatrixType &matrix)
Definition: PastixInterface.hpp:447
pastix_data_t * m_pastixdata
Definition: PastixInterface.hpp:249
_MatrixType MatrixType
Definition: PastixInterface.hpp:626
ComputationInfo m_info
Definition: PastixInterface.hpp:248
_MatrixType MatrixType
Definition: PastixInterface.hpp:63
SparseMatrix< Scalar, ColMajor > ColSpMatrix
Definition: PastixInterface.hpp:145
int m_comm
Definition: PastixInterface.hpp:250
PastixLLT(const MatrixType &matrix)
Definition: PastixInterface.hpp:556
PastixBase< PastixLLT< MatrixType, _UpLo > > Base
Definition: PastixInterface.hpp:546
Array< double, DPARM_SIZE, 1 > & dparm()
Definition: PastixInterface.hpp:189
SparseSolverBase< Derived > Base
Definition: PastixInterface.hpp:133
@ UpLo
Definition: PastixInterface.hpp:550
@ UpLo
Definition: PastixInterface.hpp:631
@ ColsAtCompileTime
Definition: PastixInterface.hpp:147
@ MaxColsAtCompileTime
Definition: PastixInterface.hpp:148
std::vector< std::vector< std::size_t > > Array
Type definition for a matrix of unsigned ints.
Definition: DirectedGraph.hpp:30
for j
Definition: mmread.m:174
Definition: PastixInterface.hpp:16
Definition: PastixInterface.hpp:40