ADD: added other eigen lib

This commit is contained in:
Henry Winkel
2022-12-21 16:19:04 +01:00
parent a570766dc6
commit 9e56c7f2c0
832 changed files with 36586 additions and 20006 deletions

View File

@@ -0,0 +1,3 @@
#ifndef EIGEN_KLUSUPPORT_MODULE_H
#error "Please include Eigen/KLUSupport instead of including headers inside the src directory directly."
#endif

View File

@@ -10,6 +10,8 @@
#ifndef EIGEN_KLUSUPPORT_H
#define EIGEN_KLUSUPPORT_H
#include "./InternalHeaderCheck.h"
namespace Eigen {
/* TODO extract L, extract U, compute det, etc... */
@@ -23,7 +25,7 @@ namespace Eigen {
*
* \warning The input matrix A should be in a \b compressed and \b column-major form.
* Otherwise an expensive copy will be made. You can call the inexpensive makeCompressed() to get a compressed matrix.
* \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<>
* \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<>
*
* \implsparsesolverconcept
*
@@ -56,15 +58,15 @@ inline klu_numeric* klu_factor(int Ap[], int Ai[], std::complex<double> Ax[], kl
}
template<typename _MatrixType>
class KLU : public SparseSolverBase<KLU<_MatrixType> >
template<typename MatrixType_>
class KLU : public SparseSolverBase<KLU<MatrixType_> >
{
protected:
typedef SparseSolverBase<KLU<_MatrixType> > Base;
typedef SparseSolverBase<KLU<MatrixType_> > Base;
using Base::m_isInitialized;
public:
using Base::_solve_impl;
typedef _MatrixType MatrixType;
typedef MatrixType_ MatrixType;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef typename MatrixType::StorageIndex StorageIndex;
@@ -263,16 +265,16 @@ class KLU : public SparseSolverBase<KLU<_MatrixType> >
template<typename MatrixDerived>
void grab(const EigenBase<MatrixDerived> &A)
{
mp_matrix.~KLUMatrixRef();
::new (&mp_matrix) KLUMatrixRef(A.derived());
internal::destroy_at(&mp_matrix);
internal::construct_at(&mp_matrix, A.derived());
}
void grab(const KLUMatrixRef &A)
{
if(&(A.derived()) != &mp_matrix)
{
mp_matrix.~KLUMatrixRef();
::new (&mp_matrix) KLUMatrixRef(A);
internal::destroy_at(&mp_matrix);
internal::construct_at(&mp_matrix, A);
}
}