Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
a82e0fe0
Verified
Commit
a82e0fe0
authored
Aug 05, 2021
by
Justin Carpentier
Browse files
test: add MINRES test
parent
2733b4cb
Pipeline
#15526
failed with stage
in 1 minute and 20 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
unittest/CMakeLists.txt
View file @
a82e0fe0
#
# Copyright (c) 2014-2019 CNRS
# Copyright (c) 2018-202
0
INRIA
# Copyright (c) 2018-202
1
INRIA
#
MACRO
(
ADD_LIB_UNIT_TEST test
)
...
...
@@ -62,3 +62,6 @@ SET_TESTS_PROPERTIES("py-LLT" PROPERTIES DEPENDS ${PYWRAP})
ADD_PYTHON_UNIT_TEST
(
"py-LDLT"
"unittest/python/test_LDLT.py"
"python/eigenpy;unittest"
)
SET_TESTS_PROPERTIES
(
"py-LDLT"
PROPERTIES DEPENDS
${
PYWRAP
}
)
ADD_PYTHON_UNIT_TEST
(
"py-MINRES"
"unittest/python/test_MINRES.py"
"python/eigenpy;unittest"
)
SET_TESTS_PROPERTIES
(
"py-MINRES"
PROPERTIES DEPENDS
${
PYWRAP
}
)
unittest/python/test_MINRES.py
0 → 100644
View file @
a82e0fe0
import
eigenpy
import
numpy
as
np
import
numpy.linalg
as
la
dim
=
100
A
=
np
.
random
.
rand
(
dim
,
dim
)
A
=
(
A
+
A
.
T
)
*
0.5
+
np
.
diag
(
10.
+
np
.
random
.
rand
(
dim
))
minres
=
eigenpy
.
MINRES
(
A
)
X
=
np
.
random
.
rand
(
dim
,
20
)
B
=
A
.
dot
(
X
)
X_est
=
minres
.
solve
(
B
)
assert
eigenpy
.
is_approx
(
X
,
X_est
)
assert
eigenpy
.
is_approx
(
A
.
dot
(
X_est
),
B
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment