File tree Expand file tree Collapse file tree 4 files changed +84
-0
lines changed
python/decompositions/sparse/cholmod Expand file tree Collapse file tree 4 files changed +84
-0
lines changed Original file line number Diff line number Diff line change @@ -156,5 +156,20 @@ if(BUILD_TESTING_SCIPY)
156156
157157 if (BUILD_WITH_CHOLMOD_SUPPORT)
158158
159+ add_python_unit_test(
160+ "py-CholmodSimplicialLLT"
161+ "unittest/python/decompositions/sparse/cholmod/test_CholmodSimplicialLLT.py"
162+ "python" )
163+
164+ add_python_unit_test(
165+ "py-CholmodSimplicialLDLT"
166+ "unittest/python/decompositions/sparse/cholmod/test_CholmodSimplicialLDLT.py"
167+ "python" )
168+
169+ add_python_unit_test(
170+ "py-CholmodSupernodalLLT"
171+ "unittest/python/decompositions/sparse/cholmod/test_CholmodSupernodalLLT.py"
172+ "python" )
173+
159174 endif (BUILD_WITH_CHOLMOD_SUPPORT)
160175endif ()
Original file line number Diff line number Diff line change 1+ import eigenpy
2+
3+ import numpy as np
4+ from scipy .sparse import csc_matrix
5+
6+ dim = 100
7+ A = np .random .rand (dim , dim )
8+ A = (A + A .T ) * 0.5 + np .diag (10.0 + np .random .rand (dim ))
9+
10+ A = csc_matrix (A )
11+
12+ llt = eigenpy .CholmodSimplicialLDLT (A )
13+
14+ assert llt .info () == eigenpy .ComputationInfo .Success
15+
16+ X = np .random .rand (dim , 20 )
17+ B = A .dot (X )
18+ X_est = llt .solve (B )
19+ assert eigenpy .is_approx (X , X_est )
20+ assert eigenpy .is_approx (A .dot (X_est ), B )
21+
22+ llt .analyzePattern (A )
23+ llt .factorize (A )
Original file line number Diff line number Diff line change 1+ import eigenpy
2+
3+ import numpy as np
4+ from scipy .sparse import csc_matrix
5+
6+ dim = 100
7+ A = np .random .rand (dim , dim )
8+ A = (A + A .T ) * 0.5 + np .diag (10.0 + np .random .rand (dim ))
9+
10+ A = csc_matrix (A )
11+
12+ llt = eigenpy .CholmodSimplicialLLT (A )
13+
14+ assert llt .info () == eigenpy .ComputationInfo .Success
15+
16+ X = np .random .rand (dim , 20 )
17+ B = A .dot (X )
18+ X_est = llt .solve (B )
19+ assert eigenpy .is_approx (X , X_est )
20+ assert eigenpy .is_approx (A .dot (X_est ), B )
21+
22+ llt .analyzePattern (A )
23+ llt .factorize (A )
Original file line number Diff line number Diff line change 1+ import eigenpy
2+
3+ import numpy as np
4+ from scipy .sparse import csc_matrix
5+
6+ dim = 100
7+ A = np .random .rand (dim , dim )
8+ A = (A + A .T ) * 0.5 + np .diag (10.0 + np .random .rand (dim ))
9+
10+ A = csc_matrix (A )
11+
12+ llt = eigenpy .CholmodSupernodalLLT (A )
13+
14+ assert llt .info () == eigenpy .ComputationInfo .Success
15+
16+ X = np .random .rand (dim , 20 )
17+ B = A .dot (X )
18+ X_est = llt .solve (B )
19+ assert eigenpy .is_approx (X , X_est )
20+ assert eigenpy .is_approx (A .dot (X_est ), B )
21+
22+ llt .analyzePattern (A )
23+ llt .factorize (A )
You can’t perform that action at this time.
0 commit comments