Skip to content

Commit 13f0dcd

Browse files
committed
Removed some useless compute_proxy and other adjustments
1 parent 4363083 commit 13f0dcd

File tree

5 files changed

+17
-45
lines changed

5 files changed

+17
-45
lines changed

include/eigenpy/decompositions/ComplexSchur.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ struct ComplexSchurVisitor
2727
.def(bp::init<MatrixType, bp::optional<bool>>(
2828
bp::args("matrix", "computeU"), "Computes Schur of given matrix"))
2929

30+
.def("matrixU", &Solver::matrixU, bp::arg("self"),
31+
"Returns the unitary matrix in the Schur decomposition. ",
32+
bp::return_value_policy<bp::copy_const_reference>())
33+
.def("matrixT", &Solver::matrixT, bp::arg("self"),
34+
"Returns the triangular matrix in the Schur decomposition. ",
35+
bp::return_value_policy<bp::copy_const_reference>())
36+
3037
.def("compute", &ComplexSchurVisitor::compute_proxy<MatrixType>,
3138
bp::args("self", "matrix"), "Computes the Schur of given matrix.",
3239
bp::return_self<>())
@@ -46,13 +53,6 @@ struct ComplexSchurVisitor
4653
"Compute Schur decomposition from a given Hessenberg matrix. ",
4754
bp::return_self<>())
4855

49-
.def("matrixT", &Solver::matrixT, bp::arg("self"),
50-
"Returns the triangular matrix in the Schur decomposition. ",
51-
bp::return_value_policy<bp::copy_const_reference>())
52-
.def("matrixU", &Solver::matrixU, bp::arg("self"),
53-
"Returns the unitary matrix in the Schur decomposition. ",
54-
bp::return_value_policy<bp::copy_const_reference>())
55-
5656
.def("info", &Solver::info, bp::arg("self"),
5757
"NumericalIssue if the input contains INF or NaN values or "
5858
"overflow occured. Returns Success otherwise.")

include/eigenpy/decompositions/HessenbergDecomposition.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ struct HessenbergDecompositionVisitor
6464
.def(HessenbergDecompositionVisitor())
6565
.def(IdVisitor<Solver>());
6666
}
67-
68-
private:
69-
template <typename MatrixType>
70-
static Solver& compute_proxy(Solver& self,
71-
const Eigen::EigenBase<MatrixType>& matrix) {
72-
return self.compute(matrix);
73-
}
7467
};
7568

7669
} // namespace eigenpy

include/eigenpy/decompositions/RealSchur.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ struct RealSchurVisitor
6363
.def("setMaxIterations", &Solver::setMaxIterations,
6464
bp::args("self", "max_iter"),
6565
"Sets the maximum number of iterations allowed.",
66-
bp::return_self<>());
66+
bp::return_self<>())
67+
.def("getMaxIterations", &Solver::getMaxIterations, bp::arg("self"),
68+
"Returns the maximum number of iterations.");
6769
}
6870

6971
static void expose() {

include/eigenpy/decompositions/Tridiagonalization.hpp

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ struct TridiagonalizationVisitor : public boost::python::def_visitor<
2929
"Constructor; computes tridiagonal "
3030
"decomposition of given matrix. "))
3131

32-
.def("compute", &TridiagonalizationVisitor::compute_proxy<MatrixType>,
33-
bp::args("self", "matrix"),
34-
"Computes tridiagonal decomposition of given matrix. ",
35-
bp::return_self<>())
3632
.def(
3733
"compute",
3834
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType>& matrix)) &
@@ -41,22 +37,21 @@ struct TridiagonalizationVisitor : public boost::python::def_visitor<
4137
"Computes tridiagonal decomposition of given matrix. ",
4238
bp::return_self<>())
4339

44-
.def("diagonal", &Solver::diagonal, bp::arg("self"),
45-
"Returns the diagonal of the tridiagonal matrix T in the "
46-
"decomposition. ")
47-
4840
.def("householderCoefficients", &Solver::householderCoefficients,
4941
bp::arg("self"), "Returns the Householder coefficients. ")
42+
.def("packedMatrix", &Solver::packedMatrix, bp::arg("self"),
43+
"Returns the internal representation of the decomposition. ",
44+
bp::return_value_policy<bp::copy_const_reference>())
5045

46+
// TODO: Expose so that the return type are convertible to np arrays
5147
.def("matrixQ", &Solver::matrixQ, bp::arg("self"),
5248
"Returns the unitary matrix Q in the decomposition. ")
5349
.def("matrixT", &Solver::matrixT, bp::arg("self"),
5450
"Returns the unitary matrix T in the decomposition. ")
5551

56-
.def("packedMatrix", &Solver::packedMatrix, bp::arg("self"),
57-
"Returns the internal representation of the decomposition. ",
58-
bp::return_value_policy<bp::copy_const_reference>())
59-
52+
.def("diagonal", &Solver::diagonal, bp::arg("self"),
53+
"Returns the diagonal of the tridiagonal matrix T in the "
54+
"decomposition. ")
6055
.def("subDiagonal", &Solver::subDiagonal, bp::arg("self"),
6156
"Returns the subdiagonal of the tridiagonal matrix T in the "
6257
"decomposition.");
@@ -73,13 +68,6 @@ struct TridiagonalizationVisitor : public boost::python::def_visitor<
7368
.def(TridiagonalizationVisitor())
7469
.def(IdVisitor<Solver>());
7570
}
76-
77-
private:
78-
template <typename MatrixType>
79-
static Solver& compute_proxy(Solver& self,
80-
const Eigen::EigenBase<MatrixType>& matrix) {
81-
return self.compute(matrix);
82-
}
8371
};
8472

8573
} // namespace eigenpy

unittest/python/test_tridiagonalization.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,3 @@
77
A = rng.random((dim, dim))
88

99
tri = eigenpy.Tridiagonalization(A)
10-
11-
# Q = tri.matrixQ()
12-
# print("Q")
13-
# print(Q)
14-
# Q_conj = Q.conj().T
15-
16-
# T = tri.matrixT()
17-
# print("T")
18-
# print(T)
19-
20-
# assert eigenpy.is_approx(A, Q @ T @ Q_conj)

0 commit comments

Comments
 (0)