89 VectorXf
b = VectorXf::Random(
cols);
90 VectorXf
x = VectorXf::Random(
cols);
92 bool densedone =
false;
98 std::cout <<
"Generate sparse matrix (might take a while)...\n";
100 std::cout <<
"DONE\n\n";
106 std::cout <<
"Eigen Dense\t" <<
density * 100 <<
"%\n";
110 m1.diagonal() *= 0.5;
119 std::cout <<
"dense:\t" <<
timer.value() << endl;
124 std::cout <<
"dense: "
125 <<
"nnz = " << count <<
"\n";
131 doEigen<Eigen::DefaultBackend>(
"Eigen/Sparse", sm1, Eigen::IncompleteFactorization);
133 #ifdef EIGEN_CHOLMOD_SUPPORT
134 doEigen<Eigen::Cholmod>(
"Eigen/Cholmod", sm1, Eigen::IncompleteFactorization);
137 #ifdef EIGEN_TAUCS_SUPPORT
138 doEigen<Eigen::Taucs>(
"Eigen/Taucs", sm1, Eigen::IncompleteFactorization);
144 taucs_ccs_matrix
A = sm1.asTaucsMatrix();
150 taucs_ccs_matrix* chol = taucs_ccs_factor_llt(&
A, 0, 0);
154 for (
int i=chol->colptr[
j]; i<chol->colptr[
j+1]; ++
i)
155 std::cout << chol->values.d[
i] <<
" ";
160 #ifdef EIGEN_CHOLMOD_SUPPORT
167 A = sm1.asCholmodMatrix();
171 std::vector<int> perm(
cols);
179 c.method [0].ordering = CHOLMOD_NATURAL;
183 L = cholmod_analyze_p(&
A, &perm[0], &perm[0],
cols, &
c);
185 std::cout <<
"cholmod/analyze:\t" <<
timer.value() << endl;
188 cholmod_factorize(&
A,
L, &
c);
190 std::cout <<
"cholmod/factorize:\t" <<
timer.value() << endl;
192 cholmod_sparse* cholmat = cholmod_factor_to_sparse(
L, &
c);
194 cholmod_print_factor(
L,
"Factors", &
c);
196 cholmod_print_sparse(cholmat,
"Chol", &
c);
197 cholmod_write_sparse(
stdout, cholmat, 0, 0, &
c);
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
void eiToDense(const EigenSparseMatrix &src, DenseMatrix &dst)
Definition: BenchSparseUtil.h:54
MatrixXd L
Definition: LLT_example.cpp:6
Scalar * b
Definition: benchVecAdd.cpp:17
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:70
A versatible sparse matrix representation.
Definition: SparseMatrix.h:121
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: MathFunctions.h:1916
int c
Definition: calibrate.py:100
list x
Definition: plotDoE.py:28
#define SIZE
Definition: sparse_cholesky.cpp:22
#define DENSITY
Definition: sparse_cholesky.cpp:26
void fillSpdMatrix(float density, int rows, int cols, EigenSparseSelfAdjointMatrix &dst)
Definition: sparse_cholesky.cpp:56
internal::nested_eval< T, 1 >::type eval(const T &xpr)
Definition: sparse_permutations.cpp:47