10 #ifndef EIGEN_UMFPACKSUPPORT_H    11 #define EIGEN_UMFPACKSUPPORT_H    21 { umfpack_di_defaults(control); }
    24 { umfpack_zi_defaults(control); }
    27 { umfpack_di_free_numeric(Numeric); *Numeric = 0; }
    30 { umfpack_zi_free_numeric(Numeric); *Numeric = 0; }
    33 { umfpack_di_free_symbolic(Symbolic); *Symbolic = 0; }
    36 { umfpack_zi_free_symbolic(Symbolic); *Symbolic = 0; }
    39                             const int Ap[], 
const int Ai[], 
const double Ax[], 
void **Symbolic,
    40                             const double Control [UMFPACK_CONTROL], 
double Info [UMFPACK_INFO])
    42   return umfpack_di_symbolic(n_row,n_col,Ap,Ai,Ax,Symbolic,Control,
Info);
    46                             const int Ap[], 
const int Ai[], 
const std::complex<double> Ax[], 
void **Symbolic,
    47                             const double Control [UMFPACK_CONTROL], 
double Info [UMFPACK_INFO])
    49   return umfpack_zi_symbolic(n_row,n_col,Ap,Ai,&numext::real_ref(Ax[0]),0,Symbolic,Control,
Info);
    53                             void *Symbolic, 
void **Numeric,
    54                             const double Control[UMFPACK_CONTROL],
double Info [UMFPACK_INFO])
    56   return umfpack_di_numeric(Ap,Ai,Ax,Symbolic,Numeric,Control,
Info);
    59 inline int umfpack_numeric( 
const int Ap[], 
const int Ai[], 
const std::complex<double> Ax[],
    60                             void *Symbolic, 
void **Numeric,
    61                             const double Control[UMFPACK_CONTROL],
double Info [UMFPACK_INFO])
    63   return umfpack_zi_numeric(Ap,Ai,&numext::real_ref(Ax[0]),0,Symbolic,Numeric,Control,
Info);
    66 inline int umfpack_solve( 
int sys, 
const int Ap[], 
const int Ai[], 
const double Ax[],
    67                           double X[], 
const double B[], 
void *Numeric,
    68                           const double Control[UMFPACK_CONTROL], 
double Info[UMFPACK_INFO])
    70   return umfpack_di_solve(sys,Ap,Ai,Ax,X,B,Numeric,Control,
Info);
    73 inline int umfpack_solve( 
int sys, 
const int Ap[], 
const int Ai[], 
const std::complex<double> Ax[],
    74                           std::complex<double> X[], 
const std::complex<double> B[], 
void *Numeric,
    75                           const double Control[UMFPACK_CONTROL], 
double Info[UMFPACK_INFO])
    77   return umfpack_zi_solve(sys,Ap,Ai,&numext::real_ref(Ax[0]),0,&numext::real_ref(X[0]),0,&numext::real_ref(B[0]),0,Numeric,Control,
Info);
    80 inline int umfpack_get_lunz(
int *lnz, 
int *unz, 
int *n_row, 
int *n_col, 
int *nz_udiag, 
void *Numeric, 
double)
    82   return umfpack_di_get_lunz(lnz,unz,n_row,n_col,nz_udiag,Numeric);
    85 inline int umfpack_get_lunz(
int *lnz, 
int *unz, 
int *n_row, 
int *n_col, 
int *nz_udiag, 
void *Numeric, std::complex<double>)
    87   return umfpack_zi_get_lunz(lnz,unz,n_row,n_col,nz_udiag,Numeric);
    91                                int P[], 
int Q[], 
double Dx[], 
int *do_recip, 
double Rs[], 
void *Numeric)
    93   return umfpack_di_get_numeric(Lp,Lj,Lx,Up,Ui,Ux,P,Q,Dx,do_recip,Rs,Numeric);
    96 inline int umfpack_get_numeric(
int Lp[], 
int Lj[], std::complex<double> Lx[], 
int Up[], 
int Ui[], std::complex<double> Ux[],
    97                                int P[], 
int Q[], std::complex<double> Dx[], 
int *do_recip, 
double Rs[], 
void *Numeric)
    99   double& lx0_real = numext::real_ref(Lx[0]);
   100   double& ux0_real = numext::real_ref(Ux[0]);
   101   double& dx0_real = numext::real_ref(Dx[0]);
   102   return umfpack_zi_get_numeric(Lp,Lj,Lx?&lx0_real:0,0,Up,Ui,Ux?&ux0_real:0,0,P,Q,
   103                                 Dx?&dx0_real:0,0,do_recip,Rs,Numeric);
   108   return umfpack_di_get_determinant(Mx,Ex,NumericHandle,User_Info);
   111 inline int umfpack_get_determinant(std::complex<double> *Mx, 
double *Ex, 
void *NumericHandle, 
double User_Info [UMFPACK_INFO])
   113   double& mx_real = numext::real_ref(*Mx);
   114   return umfpack_zi_get_determinant(&mx_real,0,Ex,NumericHandle,User_Info);
   133 template<
typename _MatrixType>
   142     typedef typename MatrixType::Scalar 
Scalar;
   166     template<
typename InputMatrixType>
   222     template<
typename InputMatrixType>
   227       grab(matrix.derived());
   238     template<
typename InputMatrixType>
   244       grab(matrix.derived());
   288     template<
typename InputMatrixType>
   295       grab(matrix.derived());
   301     template<
typename BDerived,
typename XDerived>
   324                                    internal::convert_index<int>(
mp_matrix.cols()),
   345     template<
typename MatrixDerived>
   352     void grab(
const UmfpackMatrixRef &A)
   367     mutable IntColVectorType 
m_p;
   368     mutable IntRowVectorType 
m_q;
   386 template<
typename MatrixType>
   414 template<
typename MatrixType>
   422 template<
typename MatrixType>
   423 template<
typename BDerived,
typename XDerived>
   426   Index rhsCols = b.cols();
   428   eigen_assert((XDerived::Flags&RowMajorBit)==0 && 
"UmfPackLU backend does not support non col-major result yet");
   429   eigen_assert(b.derived().data() != x.derived().data() && 
" Umfpack does not support inplace solve");
   434   if(x.innerStride()!=1)
   437     x_ptr = x_tmp.
data();
   439   for (
int j=0; j<rhsCols; ++j)
   441     if(x.innerStride()==1)
   442       x_ptr = &x.
col(j).coeffRef(0);
   446     if(x.innerStride()!=1)
   457 #endif // EIGEN_UMFPACKSUPPORT_H 
EIGEN_DEVICE_FUNC ColXpr col(Index i)
Matrix< int, MatrixType::RowsAtCompileTime, 1 > IntColVectorType
int umfpack_get_lunz(int *lnz, int *unz, int *n_row, int *n_col, int *nz_udiag, void *Numeric, double)
A sparse LU factorization and solver based on UmfPack. 
const Scalar * valuePtr() const
void factorize(const InputMatrixType &matrix)
const IntColVectorType & permutationP() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
void compute(const InputMatrixType &matrix)
void analyzePattern(const InputMatrixType &matrix)
void umfpack_defaults(double control[UMFPACK_CONTROL], double)
A base class for sparse solvers. 
void resizeNonZeros(Index size)
Matrix< Scalar, Dynamic, 1 > Vector
ComputationInfo info() const
Reports whether previous computation was successful. 
const unsigned int RowMajorBit
MatrixType::RealScalar RealScalar
UmfpackMatrixType m_dummy
SparseMatrix< Scalar > LUMatrixType
void umfpack_free_numeric(void **Numeric, double)
void _solve_impl(const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
void grab(const UmfpackMatrixRef &A)
MatrixType::StorageIndex StorageIndex
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
const LUMatrixType & matrixU() const
int umfpack_numeric(const int Ap[], const int Ai[], const double Ax[], void *Symbolic, void **Numeric, const double Control[UMFPACK_CONTROL], double Info [UMFPACK_INFO])
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API. 
UmfpackMatrixRef mp_matrix
void resize(Index rows, Index cols)
const UmfpackControl & umfpackControl() const
int umfpack_symbolic(int n_row, int n_col, const int Ap[], const int Ai[], const double Ax[], void **Symbolic, const double Control [UMFPACK_CONTROL], double Info [UMFPACK_INFO])
void grab(const EigenBase< MatrixDerived > &A)
const StorageIndex * innerIndexPtr() const
Ref< const UmfpackMatrixType, StandardCompressedFormat > UmfpackMatrixRef
Array< double, UMFPACK_CONTROL, 1 > UmfpackControl
void analyzePattern_impl()
int umfpackFactorizeReturncode() const
bool m_extractedDataAreDirty
const LUMatrixType & matrixL() const
Matrix< int, 1, MatrixType::ColsAtCompileTime > IntRowVectorType
const StorageIndex * outerIndexPtr() const
int umfpack_get_numeric(int Lp[], int Lj[], double Lx[], int Up[], int Ui[], double Ux[], int P[], int Q[], double Dx[], int *do_recip, double Rs[], void *Numeric)
MatrixType::Scalar Scalar
UmfpackControl & umfpackControl()
const IntRowVectorType & permutationQ() const
bool _solve_impl(const MatrixBase< BDerived > &b, MatrixBase< XDerived > &x) const
int umfpack_solve(int sys, const int Ap[], const int Ai[], const double Ax[], double X[], const double B[], void *Numeric, const double Control[UMFPACK_CONTROL], double Info[UMFPACK_INFO])
UmfPackLU(const UmfPackLU &)
UmfPackLU(const InputMatrixType &matrix)
EIGEN_DEVICE_FUNC Derived & derived()
Scalar determinant() const
SparseSolverBase< UmfPackLU< _MatrixType > > Base
Base class for all dense matrices, vectors, and expressions. 
int umfpack_get_determinant(double *Mx, double *Ex, void *NumericHandle, double User_Info [UMFPACK_INFO])
void umfpack_free_symbolic(void **Symbolic, double)
SparseMatrix< Scalar, ColMajor, int > UmfpackMatrixType