Skip to content

Commit 41def8e

Browse files
committed
decompositions: Put ordering option AMD in SparseQR
1 parent dc289aa commit 41def8e

File tree

1 file changed

+19
-9
lines changed
  • include/eigenpy/decompositions/sparse

1 file changed

+19
-9
lines changed

include/eigenpy/decompositions/sparse/QR.hpp

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

1717
template <typename _MatrixType,
18-
typename _Ordering = Eigen::COLAMDOrdering<
18+
typename _Ordering = Eigen::AMDOrdering<
1919
typename _MatrixType::StorageIndex>> // TODO: Check ordering
2020
struct SparseQRVisitor : public boost::python::def_visitor<
2121
SparseQRVisitor<_MatrixType, _Ordering>> {
@@ -40,33 +40,43 @@ struct SparseQRVisitor : public boost::python::def_visitor<
4040
.def(bp::init<MatrixType>(
4141
bp::args("self", "mat"),
4242
"Construct a QR factorization of the matrix mat."))
43-
.def("analyzePattern", &Solver::analyzePattern, bp::args("self", "mat"),
44-
"Compute the column permutation to minimize the fill-in.")
43+
4544
.def("cols", &Solver::cols, bp::arg("self"),
4645
"Returns the number of columns of the represented matrix. ")
47-
.def("colsPermutation", &Solver::colsPermutation, bp::arg("self"),
48-
"Returns a reference to the column matrix permutation PTc such "
49-
"that Pr A PTc = LU.",
50-
bp::return_value_policy<bp::copy_const_reference>())
46+
.def("rows", &Solver::rows, bp::arg("self"),
47+
"Returns the number of rows of the represented matrix. ")
48+
5149
.def("compute", &Solver::compute, bp::args("self", "matrix"),
5250
"Compute the symbolic and numeric factorization of the input "
5351
"sparse matrix. "
5452
"The input matrix should be in column-major storage. ")
53+
.def("analyzePattern", &Solver::analyzePattern, bp::args("self", "mat"),
54+
"Compute the column permutation to minimize the fill-in.")
5555
.def("factorize", &Solver::factorize, bp::args("self", "matrix"),
5656
"Performs a numeric decomposition of a given matrix.\n"
5757
"The given matrix must has the same sparcity than the matrix on "
5858
"which the symbolic decomposition has been performed.")
59+
60+
// TODO: Expose so that the return type are convertible to np arrays
61+
// matrixQ
62+
// matrixR
63+
64+
.def("colsPermutation", &Solver::colsPermutation, bp::arg("self"),
65+
"Returns a reference to the column matrix permutation PTc such "
66+
"that Pr A PTc = LU.",
67+
bp::return_value_policy<bp::copy_const_reference>())
68+
5969
.def("info", &Solver::info, bp::arg("self"),
6070
"NumericalIssue if the input contains INF or NaN values or "
6171
"overflow occured. Returns Success otherwise.")
6272
.def("lastErrorMessage", &Solver::lastErrorMessage, bp::arg("self"),
6373
"Returns a string describing the type of error. ")
74+
6475
.def("rank", &Solver::rank, bp::arg("self"),
6576
"Returns the number of non linearly dependent columns as "
6677
"determined "
6778
"by the pivoting threshold. ")
68-
.def("rows", &Solver::rows, bp::arg("self"),
69-
"Returns the number of rows of the represented matrix. ")
79+
7080
.def("setPivotThreshold", &Solver::setPivotThreshold,
7181
bp::args("self", "thresh"),
7282
"Set the threshold used for a diagonal entry to be an acceptable "

0 commit comments

Comments
 (0)