Skip to content

Commit 4063481

Browse files
committed
decompositions: Reordered methods in SparseLU
1 parent 13f0dcd commit 4063481

File tree

1 file changed

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

1 file changed

+31
-19
lines changed

include/eigenpy/decompositions/sparse/LU.hpp

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,49 +37,61 @@ struct SparseLUVisitor : public boost::python::def_visitor<
3737
.def(bp::init<MatrixType>(bp::args("self", "matrix"),
3838
"Constructs and performs the LU "
3939
"factorization from a given matrix."))
40+
41+
.def("determinant", &Solver::determinant, bp::arg("self"),
42+
"Returns the determinant of the matrix.")
43+
.def("signDeterminant", &Solver::signDeterminant, bp::arg("self"),
44+
"A number representing the sign of the determinant. ")
4045
.def("absDeterminant", &Solver::absDeterminant, bp::arg("self"),
4146
"Returns the absolute value of the determinant of the matrix of "
4247
"which *this is the QR decomposition.")
43-
.def("analyzePattern", &Solver::analyzePattern, bp::args("self", "mat"),
44-
"Compute the column permutation to minimize the fill-in.")
48+
.def("logAbsDeterminant", &Solver::logAbsDeterminant, bp::arg("self"),
49+
"Returns the natural log of the absolute value of the determinant "
50+
"of the matrix of which *this is the QR decomposition")
51+
4552
.def("colsPermutation", &Solver::colsPermutation, bp::arg("self"),
4653
"Returns a reference to the column matrix permutation PTc such "
4754
"that Pr A PTc = LU.",
4855
bp::return_value_policy<bp::copy_const_reference>())
56+
.def("rowsPermutation", &Solver::rowsPermutation, bp::arg("self"),
57+
"Returns a reference to the row matrix permutation Pr such that "
58+
"Pr A PTc = LU",
59+
bp::return_value_policy<bp::copy_const_reference>())
60+
4961
.def("compute", &Solver::compute, bp::args("self", "matrix"),
5062
"Compute the symbolic and numeric factorization of the input "
5163
"sparse matrix. "
5264
"The input matrix should be in column-major storage. ")
53-
.def("determinant", &Solver::determinant, bp::arg("self"),
54-
"Returns the determinant of the matrix.")
65+
66+
.def("analyzePattern", &Solver::analyzePattern,
67+
bp::args("self", "matrix"),
68+
"Compute the column permutation to minimize the fill-in.")
5569
.def("factorize", &Solver::factorize, bp::args("self", "matrix"),
5670
"Performs a numeric decomposition of a given matrix.\n"
5771
"The given matrix must has the same sparcity than the matrix on "
5872
"which the symbolic decomposition has been performed.")
73+
.def("simplicialfactorize", &Solver::simplicialfactorize,
74+
bp::args("self", "matrix"))
5975

60-
.def("info", &Solver::info, bp::arg("self"),
61-
"NumericalIssue if the input contains INF or NaN values or "
62-
"overflow occured. Returns Success otherwise.")
76+
// TODO: Expose so that the return type are convertible to np arrays
77+
// transpose()
78+
// adjoint()
79+
// matrixL()
80+
// matrixU()
6381

6482
.def("isSymmetric", &Solver::isSymmetric, bp::args("self", "sym"),
6583
"Indicate that the pattern of the input matrix is symmetric. ")
66-
.def("lastErrorMessage", &Solver::lastErrorMessage, bp::arg("self"),
67-
"Returns a string describing the type of error. ")
68-
.def("logAbsDeterminant", &Solver::logAbsDeterminant, bp::arg("self"),
69-
"Returns the natural log of the absolute value of the determinant "
70-
"of the "
71-
"matrix of which *this is the QR decomposition")
7284

73-
.def("rowsPermutation", &Solver::rowsPermutation, bp::arg("self"),
74-
"Returns a reference to the row matrix permutation Pr such that "
75-
"Pr A PTc = LU",
76-
bp::return_value_policy<bp::copy_const_reference>())
7785
.def("setPivotThreshold", &Solver::setPivotThreshold,
7886
bp::args("self", "thresh"),
7987
"Set the threshold used for a diagonal entry to be an acceptable "
8088
"pivot.")
81-
.def("signDeterminant", &Solver::signDeterminant, bp::arg("self"),
82-
"A number representing the sign of the determinant. ")
89+
90+
.def("info", &Solver::info, bp::arg("self"),
91+
"NumericalIssue if the input contains INF or NaN values or "
92+
"overflow occured. Returns Success otherwise.")
93+
.def("lastErrorMessage", &Solver::lastErrorMessage, bp::arg("self"),
94+
"Returns a string describing the type of error. ")
8395

8496
.def(SparseSolverBaseVisitor<Solver>());
8597
}

0 commit comments

Comments
 (0)