Lines 141-147
class PastixBase : public SparseSolverBase<Derived>
Link Here
|
141 |
clean(); |
141 |
clean(); |
142 |
} |
142 |
} |
143 |
|
143 |
|
144 |
template<typename Rhs,typename Dest> |
144 |
template<typename Rhs, typename Dest> |
145 |
bool _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const; |
145 |
bool _solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const; |
146 |
|
146 |
|
147 |
/** Returns a reference to the integer vector IPARM of PaStiX parameters |
147 |
/** Returns a reference to the integer vector IPARM of PaStiX parameters |
Lines 157-163
class PastixBase : public SparseSolverBase<Derived>
Link Here
|
157 |
/** Return a reference to a particular index parameter of the IPARM vector |
157 |
/** Return a reference to a particular index parameter of the IPARM vector |
158 |
* \sa iparm() |
158 |
* \sa iparm() |
159 |
*/ |
159 |
*/ |
160 |
|
|
|
161 |
int& iparm(int idxparam) |
160 |
int& iparm(int idxparam) |
162 |
{ |
161 |
{ |
163 |
return m_iparm(idxparam); |
162 |
return m_iparm(idxparam); |
Lines 276-282
void PastixBase<Derived>::init()
Link Here
|
276 |
template <class Derived> |
275 |
template <class Derived> |
277 |
void PastixBase<Derived>::compute(ColSpMatrix& mat) |
276 |
void PastixBase<Derived>::compute(ColSpMatrix& mat) |
278 |
{ |
277 |
{ |
279 |
eigen_assert(mat.rows() == mat.cols() && "The input matrix should be squared"); |
278 |
eigen_assert(mat.rows() == mat.cols() && "The input matrix should be square"); |
280 |
|
279 |
|
281 |
analyzePattern(mat); |
280 |
analyzePattern(mat); |
282 |
factorize(mat); |
281 |
factorize(mat); |
Lines 288-294
void PastixBase<Derived>::compute(ColSpMatrix& mat)
Link Here
|
288 |
template <class Derived> |
287 |
template <class Derived> |
289 |
void PastixBase<Derived>::analyzePattern(ColSpMatrix& mat) |
288 |
void PastixBase<Derived>::analyzePattern(ColSpMatrix& mat) |
290 |
{ |
289 |
{ |
291 |
eigen_assert(m_initisOk && "The initialization of PaSTiX failed"); |
290 |
eigen_assert(m_initisOk && "The initialization of PaStiX failed"); |
292 |
|
291 |
|
293 |
// clean previous calls |
292 |
// clean previous calls |
294 |
if(m_size>0) |
293 |
if(m_size>0) |
Lines 320-326
template <class Derived>
Link Here
|
320 |
void PastixBase<Derived>::factorize(ColSpMatrix& mat) |
319 |
void PastixBase<Derived>::factorize(ColSpMatrix& mat) |
321 |
{ |
320 |
{ |
322 |
// if(&m_cpyMat != &mat) m_cpyMat = mat; |
321 |
// if(&m_cpyMat != &mat) m_cpyMat = mat; |
323 |
eigen_assert(m_analysisIsOk && "The analysis phase should be called before the factorization phase"); |
322 |
eigen_assert(m_analysisIsOk && "analyzePattern() should be called before factorize()"); |
324 |
m_iparm(IPARM_START_TASK) = API_TASK_NUMFACT; |
323 |
m_iparm(IPARM_START_TASK) = API_TASK_NUMFACT; |
325 |
m_iparm(IPARM_END_TASK) = API_TASK_NUMFACT; |
324 |
m_iparm(IPARM_END_TASK) = API_TASK_NUMFACT; |
326 |
m_size = internal::convert_index<int>(mat.rows()); |
325 |
m_size = internal::convert_index<int>(mat.rows()); |
Lines 341-347
void PastixBase<Derived>::factorize(ColSpMatrix& mat)
Link Here
|
341 |
} |
340 |
} |
342 |
} |
341 |
} |
343 |
|
342 |
|
344 |
/* Solve the system */ |
|
|
345 |
template<typename Base> |
343 |
template<typename Base> |
346 |
template<typename Rhs,typename Dest> |
344 |
template<typename Rhs,typename Dest> |
347 |
bool PastixBase<Base>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const |
345 |
bool PastixBase<Base>::_solve_impl(const MatrixBase<Rhs> &b, MatrixBase<Dest> &x) const |
Lines 403-413
class PastixLU : public PastixBase< PastixLU<_MatrixType> >
Link Here
|
403 |
init(); |
401 |
init(); |
404 |
} |
402 |
} |
405 |
|
403 |
|
406 |
explicit PastixLU(const MatrixType& matrix):Base() |
404 |
explicit PastixLU(const MatrixType& matrix) : Base() |
407 |
{ |
405 |
{ |
408 |
init(); |
406 |
init(); |
409 |
compute(matrix); |
407 |
compute(matrix); |
410 |
} |
408 |
} |
|
|
409 |
|
411 |
/** Compute the LU supernodal factorization of \p matrix. |
410 |
/** Compute the LU supernodal factorization of \p matrix. |
412 |
* iparm and dparm can be used to tune the PaStiX parameters. |
411 |
* iparm and dparm can be used to tune the PaStiX parameters. |
413 |
* see the PaStiX user's manual |
412 |
* see the PaStiX user's manual |
Lines 420-425
class PastixLU : public PastixBase< PastixLU<_MatrixType> >
Link Here
|
420 |
grabMatrix(matrix, temp); |
419 |
grabMatrix(matrix, temp); |
421 |
Base::compute(temp); |
420 |
Base::compute(temp); |
422 |
} |
421 |
} |
|
|
422 |
|
423 |
/** Compute the LU symbolic factorization of \p matrix using its sparsity pattern. |
423 |
/** Compute the LU symbolic factorization of \p matrix using its sparsity pattern. |
424 |
* Several ordering methods can be used at this step. See the PaStiX user's manual. |
424 |
* Several ordering methods can be used at this step. See the PaStiX user's manual. |
425 |
* The result of this operation can be used with successive matrices having the same pattern as \p matrix |
425 |
* The result of this operation can be used with successive matrices having the same pattern as \p matrix |
Lines 465-476
class PastixLU : public PastixBase< PastixLU<_MatrixType> >
Link Here
|
465 |
{ |
465 |
{ |
466 |
// update the transposed structure |
466 |
// update the transposed structure |
467 |
m_transposedStructure = matrix.transpose(); |
467 |
m_transposedStructure = matrix.transpose(); |
468 |
|
|
|
469 |
m_transposedStructure.coeffs() = 0.0; |
468 |
m_transposedStructure.coeffs() = 0.0; |
470 |
|
469 |
|
471 |
m_structureIsUptodate = true; |
470 |
m_structureIsUptodate = true; |
472 |
} |
471 |
} |
473 |
|
|
|
474 |
out = m_transposedStructure + matrix; |
472 |
out = m_transposedStructure + matrix; |
475 |
} |
473 |
} |
476 |
internal::c_to_fortran_numbering(out); |
474 |
internal::c_to_fortran_numbering(out); |
Lines 520-526
class PastixLLT : public PastixBase< PastixLLT<_MatrixType, _UpLo> >
Link Here
|
520 |
compute(matrix); |
518 |
compute(matrix); |
521 |
} |
519 |
} |
522 |
|
520 |
|
523 |
/** Compute the L factor of the LL^T supernodal factorization of \p matrix |
521 |
/** |
|
|
522 |
* Compute the L factor of the LL^T supernodal factorization of \p matrix |
524 |
* \sa analyzePattern() factorize() |
523 |
* \sa analyzePattern() factorize() |
525 |
*/ |
524 |
*/ |
526 |
void compute (const MatrixType& matrix) |
525 |
void compute (const MatrixType& matrix) |
Lines 530-538
class PastixLLT : public PastixBase< PastixLLT<_MatrixType, _UpLo> >
Link Here
|
530 |
Base::compute(temp); |
529 |
Base::compute(temp); |
531 |
} |
530 |
} |
532 |
|
531 |
|
533 |
/** Compute the LL^T symbolic factorization of \p matrix using its sparsity pattern |
532 |
/** Compute the LL^T symbolic factorization of \p matrix using its sparsity |
534 |
* The result of this operation can be used with successive matrices having the same pattern as \p matrix |
533 |
* pattern. The result of this operation can be used with successive matrices |
535 |
* \sa factorize() |
534 |
* which have the same pattern as \p matrix \sa factorize() |
536 |
*/ |
535 |
*/ |
537 |
void analyzePattern(const MatrixType& matrix) |
536 |
void analyzePattern(const MatrixType& matrix) |
538 |
{ |
537 |
{ |
Lines 540-554
class PastixLLT : public PastixBase< PastixLLT<_MatrixType, _UpLo> >
Link Here
|
540 |
grabMatrix(matrix, temp); |
539 |
grabMatrix(matrix, temp); |
541 |
Base::analyzePattern(temp); |
540 |
Base::analyzePattern(temp); |
542 |
} |
541 |
} |
543 |
/** Compute the LL^T supernodal numerical factorization of \p matrix |
542 |
|
544 |
* \sa analyzePattern() |
543 |
/** |
545 |
*/ |
544 |
* Compute the LL^T supernodal numerical factorization of \p matrix |
|
|
545 |
* \sa analyzePattern() |
546 |
*/ |
546 |
void factorize(const MatrixType& matrix) |
547 |
void factorize(const MatrixType& matrix) |
547 |
{ |
548 |
{ |
548 |
ColSpMatrix temp; |
549 |
ColSpMatrix temp; |
549 |
grabMatrix(matrix, temp); |
550 |
grabMatrix(matrix, temp); |
550 |
Base::factorize(temp); |
551 |
Base::factorize(temp); |
551 |
} |
552 |
} |
|
|
553 |
|
552 |
protected: |
554 |
protected: |
553 |
using Base::m_iparm; |
555 |
using Base::m_iparm; |
554 |
|
556 |
|