File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 11#
22# Copyright (c) 2014-2019 CNRS
3- # Copyright (c) 2018-2020 INRIA
3+ # Copyright (c) 2018-2021 INRIA
44#
55
66MACRO (ADD_LIB_UNIT_TEST test )
@@ -62,3 +62,6 @@ SET_TESTS_PROPERTIES("py-LLT" PROPERTIES DEPENDS ${PYWRAP})
6262
6363ADD_PYTHON_UNIT_TEST("py-LDLT" "unittest/python/test_LDLT.py" "python/eigenpy;unittest" )
6464SET_TESTS_PROPERTIES ("py-LDLT" PROPERTIES DEPENDS ${PYWRAP} )
65+
66+ ADD_PYTHON_UNIT_TEST("py-MINRES" "unittest/python/test_MINRES.py" "python/eigenpy;unittest" )
67+ SET_TESTS_PROPERTIES ("py-MINRES" PROPERTIES DEPENDS ${PYWRAP} )
Original file line number Diff line number Diff line change 1+ import eigenpy
2+
3+ import numpy as np
4+ import numpy .linalg as la
5+
6+ dim = 100
7+ A = np .random .rand (dim ,dim )
8+
9+ A = (A + A .T )* 0.5 + np .diag (10. + np .random .rand (dim ))
10+
11+ minres = eigenpy .MINRES (A )
12+
13+ X = np .random .rand (dim ,20 )
14+ B = A .dot (X )
15+ X_est = minres .solve (B )
16+ assert eigenpy .is_approx (X ,X_est )
17+ assert eigenpy .is_approx (A .dot (X_est ),B )
You can’t perform that action at this time.
0 commit comments