Skip to content

Commit 4b12210

Browse files
authored
Merge pull request #274 from jcarpent/devel
Apply pre-commit on all the project
2 parents 4a44fac + ff48cba commit 4b12210

File tree

90 files changed

+5412
-5617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+5412
-5617
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/mirrors-clang-format
3+
rev: v13.0.1
4+
hooks:
5+
- id: clang-format
6+
args: [-i, --style=Google]
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.1.0
9+
hooks:
10+
- id: trailing-whitespace

cmake

doc/package.css

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ a:link {
4545
color:#0066CC
4646
}
4747

48-
a:hover, a:active {
49-
text-decoration: underline;
48+
a:hover, a:active {
49+
text-decoration: underline;
5050
color: #3C9A35;
5151
}
5252

@@ -57,7 +57,7 @@ a:visited {
5757
}
5858

5959
DIV.memitem
60-
{
60+
{
6161
spacing: 10px;
6262
width:100%;
6363
background:#FFFFFF;
@@ -70,7 +70,7 @@ DIV.memitem
7070
}
7171

7272
DIV.memproto
73-
{
73+
{
7474
width:100%;
7575
background:#F0F0F0;
7676
font-size:100%;
@@ -82,7 +82,7 @@ DIV.memproto
8282
}
8383

8484
DIV.memdoc
85-
{
85+
{
8686
padding: 10px;
8787
width:100%;
8888
font-size:100%;
@@ -189,7 +189,7 @@ DIV.nav
189189
}
190190

191191
DIV.groupHeader
192-
{
192+
{
193193
padding-top: 30px;
194194
padding-bottom: 20px;
195195
background : none;
@@ -201,23 +201,23 @@ DIV.groupHeader
201201
color:#0066CC;
202202
}
203203

204-
.directory p
205-
{
206-
margin: 0px;
207-
white-space: nowrap;
204+
.directory p
205+
{
206+
margin: 0px;
207+
white-space: nowrap;
208208
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
209209
font-size: 10pt;
210210
font-weight: normal;
211211
}
212212

213213

214-
.directory h3
215-
{
214+
.directory h3
215+
{
216216
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
217-
margin: 0px;
218-
margin-top: 1em;
217+
margin: 0px;
218+
margin-top: 1em;
219219
padding-bottom: 20px;
220-
font-size: 12pt;
220+
font-size: 12pt;
221221
font-variant: small-caps;
222222
text-align: center;
223223
}

include/eigenpy/angle-axis.hpp

Lines changed: 126 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -5,147 +5,133 @@
55
#ifndef __eigenpy_angle_axis_hpp__
66
#define __eigenpy_angle_axis_hpp__
77

8-
#include "eigenpy/eigenpy.hpp"
9-
108
#include <Eigen/Core>
119
#include <Eigen/Geometry>
1210

13-
namespace eigenpy
14-
{
15-
16-
namespace bp = boost::python;
17-
18-
template<typename AngleAxis> class AngleAxisVisitor;
19-
20-
template<typename Scalar>
21-
struct call< Eigen::AngleAxis<Scalar> >
22-
{
23-
typedef Eigen::AngleAxis<Scalar> AngleAxis;
24-
25-
static inline void expose()
26-
{
27-
AngleAxisVisitor<AngleAxis>::expose();
28-
}
29-
30-
static inline bool isApprox(const AngleAxis & self, const AngleAxis & other,
31-
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
32-
{
33-
return self.isApprox(other,prec);
34-
}
35-
};
36-
37-
template<typename AngleAxis>
38-
class AngleAxisVisitor
39-
: public bp::def_visitor< AngleAxisVisitor<AngleAxis> >
40-
{
41-
42-
typedef typename AngleAxis::Scalar Scalar;
43-
typedef typename AngleAxis::Vector3 Vector3;
44-
typedef typename AngleAxis::Matrix3 Matrix3;
45-
46-
typedef typename Eigen::Quaternion<Scalar,0> Quaternion;
47-
typedef Eigen::RotationBase<AngleAxis,3> RotationBase;
48-
49-
BOOST_PYTHON_FUNCTION_OVERLOADS(isApproxAngleAxis_overload,call<AngleAxis>::isApprox,2,3)
50-
51-
public:
52-
53-
template<class PyClass>
54-
void visit(PyClass& cl) const
55-
{
56-
cl
57-
.def(bp::init<>(bp::arg("self"),"Default constructor"))
58-
.def(bp::init<Scalar,Vector3>
59-
((bp::arg("self"),bp::arg("angle"),bp::arg("axis")),
11+
#include "eigenpy/eigenpy.hpp"
12+
13+
namespace eigenpy {
14+
15+
namespace bp = boost::python;
16+
17+
template <typename AngleAxis>
18+
class AngleAxisVisitor;
19+
20+
template <typename Scalar>
21+
struct call<Eigen::AngleAxis<Scalar> > {
22+
typedef Eigen::AngleAxis<Scalar> AngleAxis;
23+
24+
static inline void expose() { AngleAxisVisitor<AngleAxis>::expose(); }
25+
26+
static inline bool isApprox(
27+
const AngleAxis& self, const AngleAxis& other,
28+
const Scalar& prec = Eigen::NumTraits<Scalar>::dummy_precision()) {
29+
return self.isApprox(other, prec);
30+
}
31+
};
32+
33+
template <typename AngleAxis>
34+
class AngleAxisVisitor : public bp::def_visitor<AngleAxisVisitor<AngleAxis> > {
35+
typedef typename AngleAxis::Scalar Scalar;
36+
typedef typename AngleAxis::Vector3 Vector3;
37+
typedef typename AngleAxis::Matrix3 Matrix3;
38+
39+
typedef typename Eigen::Quaternion<Scalar, 0> Quaternion;
40+
typedef Eigen::RotationBase<AngleAxis, 3> RotationBase;
41+
42+
BOOST_PYTHON_FUNCTION_OVERLOADS(isApproxAngleAxis_overload,
43+
call<AngleAxis>::isApprox, 2, 3)
44+
45+
public:
46+
template <class PyClass>
47+
void visit(PyClass& cl) const {
48+
cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
49+
.def(bp::init<Scalar, Vector3>(
50+
(bp::arg("self"), bp::arg("angle"), bp::arg("axis")),
6051
"Initialize from angle and axis."))
61-
.def(bp::init<Matrix3>
62-
((bp::arg("self"),bp::arg("R")),
63-
"Initialize from a rotation matrix"))
64-
.def(bp::init<Quaternion>((bp::arg("self"),bp::arg("quaternion")),
65-
"Initialize from a quaternion."))
66-
.def(bp::init<AngleAxis>((bp::arg("self"),bp::arg("copy")),
67-
"Copy constructor."))
68-
69-
/* --- Properties --- */
70-
.add_property("axis",
71-
bp::make_function((Vector3 & (AngleAxis::*)())&AngleAxis::axis,
72-
bp::return_internal_reference<>()),
73-
&AngleAxisVisitor::setAxis,"The rotation axis.")
74-
.add_property("angle",
75-
(Scalar (AngleAxis::*)()const)&AngleAxis::angle,
76-
&AngleAxisVisitor::setAngle,"The rotation angle.")
77-
78-
/* --- Methods --- */
79-
.def("inverse",&AngleAxis::inverse,
80-
bp::arg("self"),
81-
"Return the inverse rotation.")
82-
.def("fromRotationMatrix",&AngleAxis::template fromRotationMatrix<Matrix3>,
83-
(bp::arg("self"),bp::arg("rotation matrix")),
84-
"Sets *this from a 3x3 rotation matrix",
85-
bp::return_self<>())
86-
.def("toRotationMatrix",
87-
&AngleAxis::toRotationMatrix,
88-
// bp::arg("self"),
89-
"Constructs and returns an equivalent rotation matrix.")
90-
.def("matrix",&AngleAxis::matrix,
91-
bp::arg("self"),
92-
"Returns an equivalent rotation matrix.")
93-
94-
.def("isApprox",
95-
&call<AngleAxis>::isApprox,
96-
isApproxAngleAxis_overload(bp::args("self","other","prec"),
97-
"Returns true if *this is approximately equal to other, within the precision determined by prec."))
98-
99-
/* --- Operators --- */
100-
.def(bp::self * bp::other<Vector3>())
101-
.def(bp::self * bp::other<Quaternion>())
102-
.def(bp::self * bp::self)
103-
.def("__eq__",&AngleAxisVisitor::__eq__)
104-
.def("__ne__",&AngleAxisVisitor::__ne__)
105-
106-
.def("__str__",&print)
107-
.def("__repr__",&print)
108-
;
109-
}
110-
111-
private:
112-
113-
static void setAxis(AngleAxis & self, const Vector3 & axis)
114-
{ self.axis() = axis; }
115-
116-
static void setAngle( AngleAxis & self, const Scalar & angle)
117-
{ self.angle() = angle; }
118-
119-
static bool __eq__(const AngleAxis & u, const AngleAxis & v)
120-
{ return u.axis() == v.axis() && v.angle() == u.angle(); }
121-
122-
static bool __ne__(const AngleAxis & u, const AngleAxis & v)
123-
{ return !__eq__(u,v); }
124-
125-
static std::string print(const AngleAxis & self)
126-
{
127-
std::stringstream ss;
128-
ss << "angle: " << self.angle() << std::endl;
129-
ss << "axis: " << self.axis().transpose() << std::endl;
130-
131-
return ss.str();
132-
}
133-
134-
public:
135-
136-
static void expose()
137-
{
138-
bp::class_<AngleAxis>("AngleAxis",
139-
"AngleAxis representation of a rotation.\n\n",
140-
bp::no_init)
141-
.def(AngleAxisVisitor<AngleAxis>());
142-
143-
// Cast to Eigen::RotationBase
144-
bp::implicitly_convertible<AngleAxis,RotationBase>();
145-
}
146-
147-
};
148-
149-
} // namespace eigenpy
150-
151-
#endif //ifndef __eigenpy_angle_axis_hpp__
52+
.def(bp::init<Matrix3>((bp::arg("self"), bp::arg("R")),
53+
"Initialize from a rotation matrix"))
54+
.def(bp::init<Quaternion>((bp::arg("self"), bp::arg("quaternion")),
55+
"Initialize from a quaternion."))
56+
.def(bp::init<AngleAxis>((bp::arg("self"), bp::arg("copy")),
57+
"Copy constructor."))
58+
59+
/* --- Properties --- */
60+
.add_property(
61+
"axis",
62+
bp::make_function((Vector3 & (AngleAxis::*)()) & AngleAxis::axis,
63+
bp::return_internal_reference<>()),
64+
&AngleAxisVisitor::setAxis, "The rotation axis.")
65+
.add_property("angle",
66+
(Scalar(AngleAxis::*)() const) & AngleAxis::angle,
67+
&AngleAxisVisitor::setAngle, "The rotation angle.")
68+
69+
/* --- Methods --- */
70+
.def("inverse", &AngleAxis::inverse, bp::arg("self"),
71+
"Return the inverse rotation.")
72+
.def("fromRotationMatrix",
73+
&AngleAxis::template fromRotationMatrix<Matrix3>,
74+
(bp::arg("self"), bp::arg("rotation matrix")),
75+
"Sets *this from a 3x3 rotation matrix", bp::return_self<>())
76+
.def("toRotationMatrix", &AngleAxis::toRotationMatrix,
77+
// bp::arg("self"),
78+
"Constructs and returns an equivalent rotation matrix.")
79+
.def("matrix", &AngleAxis::matrix, bp::arg("self"),
80+
"Returns an equivalent rotation matrix.")
81+
82+
.def("isApprox", &call<AngleAxis>::isApprox,
83+
isApproxAngleAxis_overload(
84+
bp::args("self", "other", "prec"),
85+
"Returns true if *this is approximately equal to other, "
86+
"within the precision determined by prec."))
87+
88+
/* --- Operators --- */
89+
.def(bp::self * bp::other<Vector3>())
90+
.def(bp::self * bp::other<Quaternion>())
91+
.def(bp::self * bp::self)
92+
.def("__eq__", &AngleAxisVisitor::__eq__)
93+
.def("__ne__", &AngleAxisVisitor::__ne__)
94+
95+
.def("__str__", &print)
96+
.def("__repr__", &print);
97+
}
98+
99+
private:
100+
static void setAxis(AngleAxis& self, const Vector3& axis) {
101+
self.axis() = axis;
102+
}
103+
104+
static void setAngle(AngleAxis& self, const Scalar& angle) {
105+
self.angle() = angle;
106+
}
107+
108+
static bool __eq__(const AngleAxis& u, const AngleAxis& v) {
109+
return u.axis() == v.axis() && v.angle() == u.angle();
110+
}
111+
112+
static bool __ne__(const AngleAxis& u, const AngleAxis& v) {
113+
return !__eq__(u, v);
114+
}
115+
116+
static std::string print(const AngleAxis& self) {
117+
std::stringstream ss;
118+
ss << "angle: " << self.angle() << std::endl;
119+
ss << "axis: " << self.axis().transpose() << std::endl;
120+
121+
return ss.str();
122+
}
123+
124+
public:
125+
static void expose() {
126+
bp::class_<AngleAxis>(
127+
"AngleAxis", "AngleAxis representation of a rotation.\n\n", bp::no_init)
128+
.def(AngleAxisVisitor<AngleAxis>());
129+
130+
// Cast to Eigen::RotationBase
131+
bp::implicitly_convertible<AngleAxis, RotationBase>();
132+
}
133+
};
134+
135+
} // namespace eigenpy
136+
137+
#endif // ifndef __eigenpy_angle_axis_hpp__

include/eigenpy/computation-info.hpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@
77

88
#include "eigenpy/fwd.hpp"
99

10-
namespace eigenpy
11-
{
12-
inline void exposeComputationInfo()
13-
{
14-
boost::python::enum_<Eigen::ComputationInfo>("ComputationInfo")
15-
.value("Success",Eigen::Success)
16-
.value("NumericalIssue",Eigen::NumericalIssue)
17-
.value("NoConvergence",Eigen::NoConvergence)
18-
.value("InvalidInput",Eigen::InvalidInput)
19-
;
20-
}
21-
} // namespace eigenpy
10+
namespace eigenpy {
11+
inline void exposeComputationInfo() {
12+
boost::python::enum_<Eigen::ComputationInfo>("ComputationInfo")
13+
.value("Success", Eigen::Success)
14+
.value("NumericalIssue", Eigen::NumericalIssue)
15+
.value("NoConvergence", Eigen::NoConvergence)
16+
.value("InvalidInput", Eigen::InvalidInput);
17+
}
18+
} // namespace eigenpy
2219

23-
#endif // define __eigenpy_decompositions_computation_info_hpp__
20+
#endif // define __eigenpy_decompositions_computation_info_hpp__

0 commit comments

Comments
 (0)