You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.6 KiB

  1. // This file is part of Eigen, a lightweight C++ template library
  2. // for linear algebra.
  3. //
  4. // Copyright (C) 2011 Gael Guennebaud <g.gael@free.fr>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla
  7. // Public License v. 2.0. If a copy of the MPL was not distributed
  8. // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. #include "sparse_solver.h"
  10. template<typename T> void test_simplicial_cholesky_T()
  11. {
  12. SimplicialCholesky<SparseMatrix<T>, Lower> chol_colmajor_lower;
  13. SimplicialCholesky<SparseMatrix<T>, Upper> chol_colmajor_upper;
  14. SimplicialLLT<SparseMatrix<T>, Lower> llt_colmajor_lower;
  15. SimplicialLDLT<SparseMatrix<T>, Upper> llt_colmajor_upper;
  16. SimplicialLDLT<SparseMatrix<T>, Lower> ldlt_colmajor_lower;
  17. SimplicialLDLT<SparseMatrix<T>, Upper> ldlt_colmajor_upper;
  18. check_sparse_spd_solving(chol_colmajor_lower);
  19. check_sparse_spd_solving(chol_colmajor_upper);
  20. check_sparse_spd_solving(llt_colmajor_lower);
  21. check_sparse_spd_solving(llt_colmajor_upper);
  22. check_sparse_spd_solving(ldlt_colmajor_lower);
  23. check_sparse_spd_solving(ldlt_colmajor_upper);
  24. check_sparse_spd_determinant(chol_colmajor_lower);
  25. check_sparse_spd_determinant(chol_colmajor_upper);
  26. check_sparse_spd_determinant(llt_colmajor_lower);
  27. check_sparse_spd_determinant(llt_colmajor_upper);
  28. check_sparse_spd_determinant(ldlt_colmajor_lower);
  29. check_sparse_spd_determinant(ldlt_colmajor_upper);
  30. }
  31. void test_simplicial_cholesky()
  32. {
  33. CALL_SUBTEST_1(test_simplicial_cholesky_T<double>());
  34. CALL_SUBTEST_2(test_simplicial_cholesky_T<std::complex<double> >());
  35. }