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
b77b9aa1
"git@gitlab.laas.fr:loco-3d/ndcurves.git" did not exist on "d2f18b6857ffcc423de48de2498b991c4641e342"
Commit
b77b9aa1
authored
7 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Test] Add unit test for Ref
parent
02e96c2d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
unittest/CMakeLists.txt
+2
-1
2 additions, 1 deletion
unittest/CMakeLists.txt
unittest/ref.cpp
+59
-0
59 additions, 0 deletions
unittest/ref.cpp
with
61 additions
and
1 deletion
unittest/CMakeLists.txt
+
2
−
1
View file @
b77b9aa1
#
#
# Copyright (c) 2016 CNRS
# Copyright (c) 2016
-2018
CNRS
#
#
# This file is part of eigenpy
# This file is part of eigenpy
# eigenpy is free software: you can redistribute it
# eigenpy is free software: you can redistribute it
...
@@ -40,4 +40,5 @@ ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
...
@@ -40,4 +40,5 @@ ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
ADD_LIB_UNIT_TEST
(
matrix
"eigen3"
)
ADD_LIB_UNIT_TEST
(
matrix
"eigen3"
)
ADD_LIB_UNIT_TEST
(
geometry
"eigen3"
)
ADD_LIB_UNIT_TEST
(
geometry
"eigen3"
)
ADD_LIB_UNIT_TEST
(
ref
"eigen3"
)
This diff is collapsed.
Click to expand it.
unittest/ref.cpp
0 → 100644
+
59
−
0
View file @
b77b9aa1
/*
* Copyright 2018, Justin Carpentier <jcarpent@laas.fr>, LAAS-CNRS
*
* This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* eigenpy is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with eigenpy. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"eigenpy/eigenpy.hpp"
#include
<iostream>
using
namespace
Eigen
;
using
namespace
eigenpy
;
template
<
typename
MatType
>
void
printMatrix
(
const
eigenpy
::
Ref
<
MatType
>
&
mat
)
{
if
(
MatType
::
IsVectorAtCompileTime
)
std
::
cout
<<
"isVector"
<<
std
::
endl
;
std
::
cout
<<
"size: cols "
<<
mat
.
cols
()
<<
" rows "
<<
mat
.
rows
()
<<
std
::
endl
;
std
::
cout
<<
mat
<<
std
::
endl
;
}
template
<
typename
MatType
>
void
printVector
(
const
eigenpy
::
Ref
<
MatType
>
&
mat
)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY
(
MatType
);
printMatrix
(
mat
);
}
template
<
typename
MatType
>
void
setOnes
(
eigenpy
::
Ref
<
MatType
>
mat
)
{
mat
.
setOnes
();
}
BOOST_PYTHON_MODULE
(
ref
)
{
namespace
bp
=
boost
::
python
;
eigenpy
::
enableEigenPy
();
bp
::
def
(
"printMatrix"
,
printMatrix
<
Vector3d
>
);
bp
::
def
(
"printMatrix"
,
printMatrix
<
VectorXd
>
);
bp
::
def
(
"printMatrix"
,
printMatrix
<
MatrixXd
>
);
bp
::
def
(
"printVector"
,
printVector
<
VectorXd
>
);
bp
::
def
(
"setOnes"
,
setOnes
<
Vector3d
>
);
bp
::
def
(
"setOnes"
,
setOnes
<
VectorXd
>
);
bp
::
def
(
"setOnes"
,
setOnes
<
MatrixXd
>
);
}
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