Skip to content

Commit 1f1ec82

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 25bdd61 commit 1f1ec82

Some content is hidden

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

46 files changed

+578
-580
lines changed

include/eigenpy/alignment.hpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ struct aligned_storage {
2323

2424
template <class Data>
2525
struct aligned_instance {
26-
PyObject_VAR_HEAD PyObject *dict;
27-
PyObject *weakrefs;
28-
boost::python::instance_holder *objects;
26+
PyObject_VAR_HEAD PyObject* dict;
27+
PyObject* weakrefs;
28+
boost::python::instance_holder* objects;
2929

3030
typename aligned_storage<sizeof(Data)>::type storage;
3131
};
3232

33-
inline void *aligned_malloc(
33+
inline void* aligned_malloc(
3434
std::size_t size, std::size_t alignment = EIGENPY_DEFAULT_ALIGN_BYTES) {
35-
void *original = std::malloc(size + alignment);
35+
void* original = std::malloc(size + alignment);
3636
if (original == 0) return 0;
3737
if (is_aligned(original, alignment)) return original;
38-
void *aligned =
39-
reinterpret_cast<void *>((reinterpret_cast<std::size_t>(original) &
40-
~(std::size_t(alignment - 1))) +
41-
alignment);
42-
*(reinterpret_cast<void **>(aligned) - 1) = original;
38+
void* aligned =
39+
reinterpret_cast<void*>((reinterpret_cast<std::size_t>(original) &
40+
~(std::size_t(alignment - 1))) +
41+
alignment);
42+
*(reinterpret_cast<void**>(aligned) - 1) = original;
4343
return aligned;
4444
}
4545

@@ -52,50 +52,50 @@ namespace detail {
5252
template <typename Scalar, int Rows, int Cols, int Options, int MaxRows,
5353
int MaxCols>
5454
struct referent_storage<
55-
Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> {
55+
Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols>&> {
5656
typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> T;
5757
typedef
58-
typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
58+
typename eigenpy::aligned_storage<referent_size<T&>::value>::type type;
5959
};
6060

6161
template <typename Scalar, int Rows, int Cols, int Options, int MaxRows,
6262
int MaxCols>
6363
struct referent_storage<
64-
const Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> {
64+
const Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols>&> {
6565
typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> T;
6666
typedef
67-
typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
67+
typename eigenpy::aligned_storage<referent_size<T&>::value>::type type;
6868
};
6969

7070
#ifdef EIGENPY_WITH_TENSOR_SUPPORT
7171
template <typename Scalar, int Rank, int Options, typename IndexType>
72-
struct referent_storage<Eigen::Tensor<Scalar, Rank, Options, IndexType> &> {
72+
struct referent_storage<Eigen::Tensor<Scalar, Rank, Options, IndexType>&> {
7373
typedef Eigen::Tensor<Scalar, Rank, Options, IndexType> T;
7474
typedef
75-
typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
75+
typename eigenpy::aligned_storage<referent_size<T&>::value>::type type;
7676
};
7777

7878
template <typename Scalar, int Rank, int Options, typename IndexType>
7979
struct referent_storage<
80-
const Eigen::Tensor<Scalar, Rank, Options, IndexType> &> {
80+
const Eigen::Tensor<Scalar, Rank, Options, IndexType>&> {
8181
typedef Eigen::Tensor<Scalar, Rank, Options, IndexType> T;
8282
typedef
83-
typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
83+
typename eigenpy::aligned_storage<referent_size<T&>::value>::type type;
8484
};
8585
#endif
8686

8787
template <typename Scalar, int Options>
88-
struct referent_storage<Eigen::Quaternion<Scalar, Options> &> {
88+
struct referent_storage<Eigen::Quaternion<Scalar, Options>&> {
8989
typedef Eigen::Quaternion<Scalar, Options> T;
9090
typedef
91-
typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
91+
typename eigenpy::aligned_storage<referent_size<T&>::value>::type type;
9292
};
9393

9494
template <typename Scalar, int Options>
95-
struct referent_storage<const Eigen::Quaternion<Scalar, Options> &> {
95+
struct referent_storage<const Eigen::Quaternion<Scalar, Options>&> {
9696
typedef Eigen::Quaternion<Scalar, Options> T;
9797
typedef
98-
typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
98+
typename eigenpy::aligned_storage<referent_size<T&>::value>::type type;
9999
};
100100

101101
} // namespace detail
@@ -119,10 +119,10 @@ namespace eigenpy {
119119

120120
template <class T>
121121
struct call_destructor {
122-
static void run(void *bytes) {
122+
static void run(void* bytes) {
123123
typedef typename boost::remove_const<
124124
typename boost::remove_reference<T>::type>::type T_;
125-
static_cast<T_ *>((void *)bytes)->~T_();
125+
static_cast<T_*>((void*)bytes)->~T_();
126126
}
127127
};
128128

@@ -143,22 +143,22 @@ struct rvalue_from_python_data
143143

144144
// The usual constructor
145145
rvalue_from_python_data(
146-
::boost::python::converter::rvalue_from_python_stage1_data const
147-
&_stage1) {
146+
::boost::python::converter::rvalue_from_python_stage1_data const&
147+
_stage1) {
148148
this->stage1 = _stage1;
149149
}
150150

151151
// This constructor just sets m_convertible -- used by
152152
// implicitly_convertible<> to perform the final step of the
153153
// conversion, where the construct() function is already known.
154-
rvalue_from_python_data(void *convertible) {
154+
rvalue_from_python_data(void* convertible) {
155155
this->stage1.convertible = convertible;
156156
}
157157

158158
// Destroys any object constructed in the storage.
159159
~rvalue_from_python_data() {
160160
if (this->stage1.convertible == this->storage.bytes) {
161-
void *storage = reinterpret_cast<void *>(this->storage.bytes);
161+
void* storage = reinterpret_cast<void*>(this->storage.bytes);
162162
call_destructor<T>::run(storage);
163163
}
164164
}

include/eigenpy/decompositions/BDCSVD.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct BDCSVDVisitor
2323
typedef typename MatrixType::Scalar Scalar;
2424

2525
template <class PyClass>
26-
void visit(PyClass &cl) const {
26+
void visit(PyClass& cl) const {
2727
cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
2828
.def(bp::init<Eigen::DenseIndex, Eigen::DenseIndex,
2929
bp::optional<unsigned int>>(
@@ -37,7 +37,7 @@ struct BDCSVDVisitor
3737
"Returns the number of columns. ")
3838
.def(
3939
"compute",
40-
+[](Solver &self, const MatrixType &matrix) -> Solver & {
40+
+[](Solver& self, const MatrixType& matrix) -> Solver& {
4141
return self.compute(matrix);
4242
},
4343
bp::args("self", "matrix"),
@@ -48,8 +48,8 @@ struct BDCSVDVisitor
4848
bp::return_self<>())
4949
.def(
5050
"compute",
51-
+[](Solver &self, const MatrixType &matrix,
52-
unsigned int computationOptions) -> Solver & {
51+
+[](Solver& self, const MatrixType& matrix,
52+
unsigned int computationOptions) -> Solver& {
5353
return self.compute(matrix, computationOptions);
5454
},
5555
bp::args("self", "matrix", "computationOptions"),
@@ -69,7 +69,7 @@ struct BDCSVDVisitor
6969
expose(classname);
7070
}
7171

72-
static void expose(const std::string &name) {
72+
static void expose(const std::string& name) {
7373
bp::class_<Solver, boost::noncopyable>(
7474
name.c_str(),
7575
"Class Bidiagonal Divide and Conquer SVD.\n\n"

include/eigenpy/decompositions/ColPivHouseholderQR.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct ColPivHouseholderQRSolverVisitor
2828
typedef Solver Self;
2929

3030
template <class PyClass>
31-
void visit(PyClass &cl) const {
31+
void visit(PyClass& cl) const {
3232
cl.def(bp::init<>(bp::arg("self"),
3333
"Default constructor.\n"
3434
"The default constructor is useful in cases in which the "
@@ -107,7 +107,7 @@ struct ColPivHouseholderQRSolverVisitor
107107
"you can control by calling setThreshold(threshold).")
108108

109109
.def("setThreshold",
110-
(Self & (Self::*)(const RealScalar &)) & Self::setThreshold,
110+
(Self & (Self::*)(const RealScalar&)) & Self::setThreshold,
111111
bp::args("self", "threshold"),
112112
"Allows to prescribe a threshold to be used by certain methods, "
113113
"such as rank(), who need to determine when pivots are to be "
@@ -138,7 +138,7 @@ struct ColPivHouseholderQRSolverVisitor
138138

139139
.def(
140140
"compute",
141-
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType> &matrix)) &
141+
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType>& matrix)) &
142142
Solver::compute,
143143
bp::args("self", "matrix"),
144144
"Computes the QR factorization of given matrix.",
@@ -159,7 +159,7 @@ struct ColPivHouseholderQRSolverVisitor
159159
expose(classname);
160160
}
161161

162-
static void expose(const std::string &name) {
162+
static void expose(const std::string& name) {
163163
bp::class_<Solver>(
164164
name.c_str(),
165165
"This class performs a rank-revealing QR decomposition of a matrix A "
@@ -178,10 +178,10 @@ struct ColPivHouseholderQRSolverVisitor
178178

179179
private:
180180
template <typename MatrixOrVector>
181-
static MatrixOrVector solve(const Solver &self, const MatrixOrVector &vec) {
181+
static MatrixOrVector solve(const Solver& self, const MatrixOrVector& vec) {
182182
return self.solve(vec);
183183
}
184-
static MatrixXs inverse(const Self &self) { return self.inverse(); }
184+
static MatrixXs inverse(const Self& self) { return self.inverse(); }
185185
};
186186

187187
} // namespace eigenpy

include/eigenpy/decompositions/CompleteOrthogonalDecomposition.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct CompleteOrthogonalDecompositionSolverVisitor
2828
typedef Solver Self;
2929

3030
template <class PyClass>
31-
void visit(PyClass &cl) const {
31+
void visit(PyClass& cl) const {
3232
cl.def(bp::init<>(bp::arg("self"),
3333
"Default constructor.\n"
3434
"The default constructor is useful in cases in which the "
@@ -117,7 +117,7 @@ struct CompleteOrthogonalDecompositionSolverVisitor
117117
"you can control by calling setThreshold(threshold).")
118118

119119
.def("setThreshold",
120-
(Self & (Self::*)(const RealScalar &)) & Self::setThreshold,
120+
(Self & (Self::*)(const RealScalar&)) & Self::setThreshold,
121121
bp::args("self", "threshold"),
122122
"Allows to prescribe a threshold to be used by certain methods, "
123123
"such as rank(), who need to determine when pivots are to be "
@@ -152,7 +152,7 @@ struct CompleteOrthogonalDecompositionSolverVisitor
152152

153153
.def(
154154
"compute",
155-
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType> &matrix)) &
155+
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType>& matrix)) &
156156
Solver::compute,
157157
bp::args("self", "matrix"),
158158
"Computes the complete orthogonal factorization of given matrix.",
@@ -174,7 +174,7 @@ struct CompleteOrthogonalDecompositionSolverVisitor
174174
expose(classname);
175175
}
176176

177-
static void expose(const std::string &name) {
177+
static void expose(const std::string& name) {
178178
bp::class_<Solver>(
179179
name.c_str(),
180180
"This class performs a rank-revealing complete orthogonal "
@@ -190,10 +190,10 @@ struct CompleteOrthogonalDecompositionSolverVisitor
190190

191191
private:
192192
template <typename MatrixOrVector>
193-
static MatrixOrVector solve(const Solver &self, const MatrixOrVector &vec) {
193+
static MatrixOrVector solve(const Solver& self, const MatrixOrVector& vec) {
194194
return self.solve(vec);
195195
}
196-
static MatrixXs pseudoInverse(const Self &self) {
196+
static MatrixXs pseudoInverse(const Self& self) {
197197
return self.pseudoInverse();
198198
}
199199
};

include/eigenpy/decompositions/FullPivHouseholderQR.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct FullPivHouseholderQRSolverVisitor
2828
typedef Solver Self;
2929

3030
template <class PyClass>
31-
void visit(PyClass &cl) const {
31+
void visit(PyClass& cl) const {
3232
cl.def(bp::init<>(bp::arg("self"),
3333
"Default constructor.\n"
3434
"The default constructor is useful in cases in which the "
@@ -103,7 +103,7 @@ struct FullPivHouseholderQRSolverVisitor
103103
"you can control by calling setThreshold(threshold).")
104104

105105
.def("setThreshold",
106-
(Self & (Self::*)(const RealScalar &)) & Self::setThreshold,
106+
(Self & (Self::*)(const RealScalar&)) & Self::setThreshold,
107107
bp::args("self", "threshold"),
108108
"Allows to prescribe a threshold to be used by certain methods, "
109109
"such as rank(), who need to determine when pivots are to be "
@@ -131,7 +131,7 @@ struct FullPivHouseholderQRSolverVisitor
131131

132132
.def(
133133
"compute",
134-
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType> &matrix)) &
134+
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType>& matrix)) &
135135
Solver::compute,
136136
bp::args("self", "matrix"),
137137
"Computes the QR factorization of given matrix.",
@@ -152,7 +152,7 @@ struct FullPivHouseholderQRSolverVisitor
152152
expose(classname);
153153
}
154154

155-
static void expose(const std::string &name) {
155+
static void expose(const std::string& name) {
156156
bp::class_<Solver>(
157157
name.c_str(),
158158
"This class performs a rank-revealing QR decomposition of a matrix A "
@@ -172,10 +172,10 @@ struct FullPivHouseholderQRSolverVisitor
172172

173173
private:
174174
template <typename MatrixOrVector>
175-
static MatrixOrVector solve(const Solver &self, const MatrixOrVector &vec) {
175+
static MatrixOrVector solve(const Solver& self, const MatrixOrVector& vec) {
176176
return self.solve(vec);
177177
}
178-
static MatrixXs inverse(const Self &self) { return self.inverse(); }
178+
static MatrixXs inverse(const Self& self) { return self.inverse(); }
179179
};
180180

181181
} // namespace eigenpy

0 commit comments

Comments
 (0)