File tree Expand file tree Collapse file tree 3 files changed +24
-15
lines changed
Expand file tree Collapse file tree 3 files changed +24
-15
lines changed Original file line number Diff line number Diff line change 11add_library (MetricOptimizationLib
22 area.cpp
33 constraint.cpp
4+ common.cpp
45 cone_metric.cpp
56 convergence.cpp
67 embedding.cpp
Original file line number Diff line number Diff line change 1+ #include " common.hh"
2+
3+ #ifdef USE_SUITESPARSE
4+ #include < Eigen/CholmodSupport>
5+ #endif
6+
7+ namespace CurvatureMetric {
8+
9+
10+ VectorX solve_psd_system (const MatrixX& A, const VectorX&b)
11+ {
12+ #ifdef USE_SUITESPARSE
13+ Eigen::CholmodSupernodalLLT<MatrixX> solver;
14+ #else
15+ Eigen::SimplicialLDLT<MatrixX> solver;
16+ #endif
17+
18+ solver.compute (A);
19+ return solver.solve (b);
20+ }
21+
22+ }
Original file line number Diff line number Diff line change 1717#include " spdlog/sinks/basic_file_sink.h"
1818#include " spdlog/sinks/ostream_sink.h"
1919
20- #ifdef USE_SUITESPARSE
21- #include < Eigen/CholmodSupport>
22- #endif
23-
2420namespace CurvatureMetric {
2521
2622// / *************************
@@ -406,17 +402,7 @@ compute_condition_number(
406402 return sigma_1 / sigma_n;
407403}
408404
409- inline VectorX solve_psd_system (const MatrixX& A, const VectorX&b)
410- {
411- #ifdef USE_SUITESPARSE
412- Eigen::CholmodSupernodalLLT<MatrixX> solver;
413- #else
414- Eigen::SimplicialLDLT<MatrixX> solver;
415- #endif
416-
417- solver.compute (A);
418- return solver.solve (b);
419- }
405+ VectorX solve_psd_system (const MatrixX& A, const VectorX&b);
420406
421407// / ********************
422408// / Data Type Conversion
You can’t perform that action at this time.
0 commit comments