Skip to content

Commit e34083f

Browse files
committed
decompositions: Fixed computation options in BDCSVD
1 parent 10d21fb commit e34083f

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

include/eigenpy/decompositions/BDCSVD.hpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,18 @@ struct BDCSVDVisitor
2525
template <class PyClass>
2626
void visit(PyClass &cl) const {
2727
cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
28-
// TODO: Management of _Options, put default options for default
29-
// constructor
3028
.def(bp::init<Eigen::DenseIndex, Eigen::DenseIndex>(
3129
bp::args("self", "rows", "cols"),
3230
"Default Constructor with memory preallocation. "))
3331
.def(bp::init<Eigen::DenseIndex, Eigen::DenseIndex, unsigned int>(
34-
bp::args("self", "rows", "cols", "computationOptions "),
35-
"Default Constructor with memory preallocation. \n\n"
36-
"Like the default constructor but with preallocation of the "
37-
"internal "
38-
"data according to the specified problem size and the "
39-
"computationOptions. "))
32+
bp::args("self", "rows", "cols", "computationOptions"),
33+
"Default Constructor with memory preallocation. "))
4034
.def(bp::init<MatrixType>(
4135
bp::args("self", "matrix"),
4236
"Constructor performing the decomposition of given matrix. "))
4337
.def(bp::init<MatrixType, unsigned int>(
44-
bp::args("self", "matrix", "computationOptions "),
45-
"Constructor performing the decomposition of given matrix. \n\n"
46-
"One cannot request unitiaries using both the Options template "
47-
"parameter "
48-
"and the constructor. If possible, prefer using the Options "
49-
"template parameter."))
38+
bp::args("self", "matrix", "computationOptions"),
39+
"Constructor performing the decomposition of given matrix. "))
5040

5141
.def("cols", &Solver::cols, bp::arg("self"),
5242
"Returns the number of columns. ")

include/eigenpy/decompositions/sparse/QR.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
namespace eigenpy {
1616

1717
template <typename _MatrixType,
18-
typename _Ordering = Eigen::AMDOrdering<
19-
typename _MatrixType::StorageIndex>>
18+
typename _Ordering =
19+
Eigen::AMDOrdering<typename _MatrixType::StorageIndex>>
2020
struct SparseQRVisitor : public boost::python::def_visitor<
2121
SparseQRVisitor<_MatrixType, _Ordering>> {
2222
typedef SparseQRVisitor<_MatrixType, _Ordering> Visitor;

unittest/python/test_BDCSVD.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
A = rng.random((dim, dim))
99
A = (A + A.T) * 0.5 + np.diag(10.0 + rng.random(dim))
1010

11-
bdcsvd = eigenpy.BDCSVD(A, 24)
11+
bdcsvd = eigenpy.BDCSVD(
12+
A,
13+
eigenpy.DecompositionOptions.ComputeFullU
14+
| eigenpy.DecompositionOptions.ComputeFullV,
15+
)
16+
assert bdcsvd.info() == eigenpy.ComputationInfo.Success
1217

1318
# Solve
1419
X = rng.random((dim, 20))
@@ -18,8 +23,6 @@
1823
assert eigenpy.is_approx(A.dot(X_est), B)
1924

2025
# Others
21-
assert bdcsvd.info() == eigenpy.ComputationInfo.Success
22-
2326
cols = bdcsvd.cols()
2427
rows = bdcsvd.rows()
2528

0 commit comments

Comments
 (0)