mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
Fix compilation of iterative solvers with dense matrices
This commit is contained in:
parent
d4317a85e8
commit
fd78874888
@ -185,7 +185,7 @@ public:
|
|||||||
{
|
{
|
||||||
typedef typename internal::conditional<UpLo==(Lower|Upper),
|
typedef typename internal::conditional<UpLo==(Lower|Upper),
|
||||||
Ref<const MatrixType>&,
|
Ref<const MatrixType>&,
|
||||||
SparseSelfAdjointView<const Ref<const MatrixType>, UpLo>
|
typename Ref<const MatrixType>::template ConstSelfAdjointViewReturnType<UpLo>::Type
|
||||||
>::type MatrixWrapperType;
|
>::type MatrixWrapperType;
|
||||||
m_iterations = Base::maxIterations();
|
m_iterations = Base::maxIterations();
|
||||||
m_error = Base::m_tolerance;
|
m_error = Base::m_tolerance;
|
||||||
|
@ -52,9 +52,9 @@ public:
|
|||||||
* this class becomes invalid. Call compute() to update it with the new
|
* this class becomes invalid. Call compute() to update it with the new
|
||||||
* matrix A, or modify a copy of A.
|
* matrix A, or modify a copy of A.
|
||||||
*/
|
*/
|
||||||
template<typename SparseMatrixDerived>
|
template<typename MatrixDerived>
|
||||||
explicit IterativeSolverBase(const SparseMatrixBase<SparseMatrixDerived>& A)
|
explicit IterativeSolverBase(const EigenBase<MatrixDerived>& A)
|
||||||
: mp_matrix(A)
|
: mp_matrix(A.derived())
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
compute(mp_matrix);
|
compute(mp_matrix);
|
||||||
@ -67,8 +67,8 @@ public:
|
|||||||
* Currently, this function mostly calls analyzePattern on the preconditioner. In the future
|
* Currently, this function mostly calls analyzePattern on the preconditioner. In the future
|
||||||
* we might, for instance, implement column reordering for faster matrix vector products.
|
* we might, for instance, implement column reordering for faster matrix vector products.
|
||||||
*/
|
*/
|
||||||
template<typename SparseMatrixDerived>
|
template<typename MatrixDerived>
|
||||||
Derived& analyzePattern(const SparseMatrixBase<SparseMatrixDerived>& A)
|
Derived& analyzePattern(const EigenBase<MatrixDerived>& A)
|
||||||
{
|
{
|
||||||
grab(A.derived());
|
grab(A.derived());
|
||||||
m_preconditioner.analyzePattern(mp_matrix);
|
m_preconditioner.analyzePattern(mp_matrix);
|
||||||
@ -87,8 +87,8 @@ public:
|
|||||||
* this class becomes invalid. Call compute() to update it with the new
|
* this class becomes invalid. Call compute() to update it with the new
|
||||||
* matrix A, or modify a copy of A.
|
* matrix A, or modify a copy of A.
|
||||||
*/
|
*/
|
||||||
template<typename SparseMatrixDerived>
|
template<typename MatrixDerived>
|
||||||
Derived& factorize(const SparseMatrixBase<SparseMatrixDerived>& A)
|
Derived& factorize(const EigenBase<MatrixDerived>& A)
|
||||||
{
|
{
|
||||||
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
||||||
grab(A.derived());
|
grab(A.derived());
|
||||||
@ -108,8 +108,8 @@ public:
|
|||||||
* this class becomes invalid. Call compute() to update it with the new
|
* this class becomes invalid. Call compute() to update it with the new
|
||||||
* matrix A, or modify a copy of A.
|
* matrix A, or modify a copy of A.
|
||||||
*/
|
*/
|
||||||
template<typename SparseMatrixDerived>
|
template<typename MatrixDerived>
|
||||||
Derived& compute(const SparseMatrixBase<SparseMatrixDerived>& A)
|
Derived& compute(const EigenBase<MatrixDerived>& A)
|
||||||
{
|
{
|
||||||
grab(A.derived());
|
grab(A.derived());
|
||||||
m_preconditioner.compute(mp_matrix);
|
m_preconditioner.compute(mp_matrix);
|
||||||
@ -223,11 +223,11 @@ protected:
|
|||||||
m_tolerance = NumTraits<Scalar>::epsilon();
|
m_tolerance = NumTraits<Scalar>::epsilon();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename SparseMatrixDerived>
|
template<typename MatrixDerived>
|
||||||
void grab(const SparseMatrixBase<SparseMatrixDerived> &A)
|
void grab(const EigenBase<MatrixDerived> &A)
|
||||||
{
|
{
|
||||||
mp_matrix.~Ref<const MatrixType>();
|
mp_matrix.~Ref<const MatrixType>();
|
||||||
::new (&mp_matrix) Ref<const MatrixType>(A);
|
::new (&mp_matrix) Ref<const MatrixType>(A.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
void grab(const Ref<const MatrixType> &A)
|
void grab(const Ref<const MatrixType> &A)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user