diff --git a/python/py_solver.cc b/python/py_solver.cc index 7ac4674e2..a0146642d 100644 --- a/python/py_solver.cc +++ b/python/py_solver.cc @@ -1,47 +1,53 @@ /* -------------------------------------------------------------------------- */ #include "py_solver.hh" #include "py_aka_array.hh" /* -------------------------------------------------------------------------- */ #include #include #include /* -------------------------------------------------------------------------- */ #include #include #include /* -------------------------------------------------------------------------- */ namespace py = pybind11; /* -------------------------------------------------------------------------- */ namespace akantu { /* -------------------------------------------------------------------------- */ void register_solvers(py::module & mod) { py::class_(mod, "SparseMatrix") .def("getMatrixType", &SparseMatrix::getMatrixType) .def("size", &SparseMatrix::size) .def("zero", &SparseMatrix::zero) .def("saveProfile", &SparseMatrix::saveProfile) .def("saveMatrix", &SparseMatrix::saveMatrix) .def( "add", [](SparseMatrix & self, UInt i, UInt j) { self.add(i, j); }, "Add entry in the profile") .def( "add", [](SparseMatrix & self, UInt i, UInt j, Real value) { self.add(i, j, value); }, "Add the value to the matrix") + .def( + "add", + [](SparseMatrix & self, SparseMatrix & A, Real alpha) { + self.add(A, alpha); + }, + "Add a matrix to the matrix", py::arg("A"), py::arg("alpha") = 1.) .def("__call__", [](const SparseMatrix & self, UInt i, UInt j) { return self(i, j); }); py::class_(mod, "SparseMatrixAIJ") .def("getIRN", &SparseMatrixAIJ::getIRN) .def("getJCN", &SparseMatrixAIJ::getJCN) .def("getA", &SparseMatrixAIJ::getA); py::class_(mod, "SolverVector"); } } // namespace akantu