4 #define EIGEN_SUPERLU_SUPPORT 5 #define EIGEN_UMFPACK_SUPPORT 6 #include <Eigen/Sparse> 26 #define MINDENSITY 0.0004 35 for (int _j=0; _j<NBTRIES; ++_j) { \ 37 for (int _k=0; _k<REPEAT; ++_k) { \ 48 std::cout << name <<
"..." << std::flush;
53 std::cout <<
":\t" << timer.
value() << endl;
56 std::cout <<
":\t FAILED" << endl;
65 std::cout <<
" solve:\t" << timer.
value() << endl;
67 std::cout <<
" solve:\t" <<
" FAILED" << endl;
72 int main(
int argc,
char *argv[])
82 bool densedone =
false;
95 std::cout <<
"Eigen Dense\t" << density*100 <<
"%\n";
103 std::cout <<
"Eigen/dense:\t" << timer.
value() << endl;
109 std::cout <<
" solve:\t" << timer.
value() << endl;
115 #ifdef EIGEN_UMFPACK_SUPPORT 117 doEigen<Eigen::UmfPack>(
"Eigen/UmfPack (auto)", sm1,
b,
x, 0);
120 #ifdef EIGEN_SUPERLU_SUPPORT 125 doEigen<Eigen::SuperLU>(
"Eigen/SuperLU (COLAMD)", sm1,
b,
x, Eigen::ColApproxMinimumDegree);
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
const Solve< FullPivLU< _MatrixType >, Rhs > solve(const MatrixBase< Rhs > &b) const
Matrix< Scalar, Dynamic, 1 > VectorX
const Solve< SparseLU< _MatrixType, _OrderingType >, Rhs > solve(const MatrixBase< Rhs > &b) const
double value(int TIMER=CPU_TIMER) const
Sparse supernodal LU factorization for general matrices.
int main(int argc, char *argv[])
void eiToDense(const EigenSparseMatrix &src, DenseMatrix &dst)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Eigen::FullPivLU< Matrix5x3 > lu(m)
void fillMatrix(float density, int rows, int cols, EigenSparseMatrix &dst)
void doEigen(const char *name, const EigenSparseMatrix &sm1, const VectorX &b, VectorX &x, int flags=0)
LU decomposition of a matrix with complete pivoting, and related features.
Annotation for function names.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x