Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
eigenpy
Commits
32515e72
Commit
32515e72
authored
1 year ago
by
Joris Vaillant
Committed by
Justin Carpentier
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
core: Fix std_vector unit tests
parent
727fad66
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
unittest/python/test_std_vector.py
+10
-6
10 additions, 6 deletions
unittest/python/test_std_vector.py
unittest/std_vector.cpp
+3
-2
3 additions, 2 deletions
unittest/std_vector.cpp
with
13 additions
and
8 deletions
unittest/python/test_std_vector.py
+
10
−
6
View file @
32515e72
...
...
@@ -85,11 +85,15 @@ print("-----------------")
# pprint.pprint(list(l4))
# checkZero(l4)
# T
ODO fail
l5_copy
=
std_vector
.
StdVec_Mat2d
(
l5
)
# T
est StdVec_Mat2d that had been registered
# before calling exposeStdVectorEigenSpecificType
# test l5 == l5_copy == l5_py
# Test conversion and tolistl5 == l5_copy == l5_py
l5_copy
=
std_vector
.
StdVec_Mat2d
(
l5
)
l5_py
=
l5_copy
.
tolist
()
# Test l5[0] is zero
l5
[
0
].
setZero
()
# TODO test
checkAllValues
(
l5
,
l5_copy
)
checkAllValues
(
l5
,
l5_py
)
# Test mutable __getitem__
l5
[
0
][:]
=
0.0
assert
np
.
allclose
(
l5
[
0
],
0.0
)
This diff is collapsed.
Click to expand it.
unittest/std_vector.cpp
+
3
−
2
View file @
32515e72
...
...
@@ -52,9 +52,10 @@ BOOST_PYTHON_MODULE(std_vector) {
// Test matrix modification
// Mat2d don't have tolist, reserve, mutable __getitem__ and from list
// conversion exposeStdVectorEigenSpecificType must add those methods to Mat2d
// conversion
// exposeStdVectorEigenSpecificType must add those methods to StdVec_Mat2d
bp
::
class_
<
std
::
vector
<
Eigen
::
Matrix2d
>
>
(
"StdVec_Mat2d"
)
.
def
(
boost
::
python
::
vector_indexing_suite
<
std
::
vector
<
Eigen
::
Matrix2d
>
>
());
exposeStdVectorEigenSpecificType
<
Eigen
::
Matrix
3
d
>
(
"Mat2d"
);
exposeStdVectorEigenSpecificType
<
Eigen
::
Matrix
2
d
>
(
"Mat2d"
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment