From 19a13e8e1f393e1f36cbb876d8612ba7f5a359c5 Mon Sep 17 00:00:00 2001 From: Tom Janson Date: Thu, 30 Mar 2017 00:12:23 +0200 Subject: [PATCH] SparseMatrix: add hasTrivialRowGrouping accessor --- src/storage/matrix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/storage/matrix.cpp b/src/storage/matrix.cpp index b0e06da..9152157 100644 --- a/src/storage/matrix.cpp +++ b/src/storage/matrix.cpp @@ -37,6 +37,7 @@ void define_sparse_matrix(py::module& m) { .def_property_readonly("nr_columns", &SparseMatrix::getColumnCount, "Number of columns") .def_property_readonly("nr_entries", &SparseMatrix::getEntryCount, "Number of non-zero entries") .def_property_readonly("_row_group_indices", &SparseMatrix::getRowGroupIndices, "Starting rows of row groups") + .def_property_readonly("has_trivial_row_grouping", &SparseMatrix::hasTrivialRowGrouping, "Trivial row grouping") .def("get_row", [](SparseMatrix& matrix, entry_index row) { return matrix.getRows(row, row+1); }, py::return_value_policy::reference, py::keep_alive<1, 0>(), py::arg("row"), "Get row") @@ -82,6 +83,7 @@ void define_sparse_matrix(py::module& m) { .def_property_readonly("nr_columns", &SparseMatrix::getColumnCount, "Number of columns") .def_property_readonly("nr_entries", &SparseMatrix::getEntryCount, "Number of non-zero entries") .def_property_readonly("_row_group_indices", &SparseMatrix::getRowGroupIndices, "Starting rows of row groups") + .def_property_readonly("has_trivial_row_grouping", &SparseMatrix::hasTrivialRowGrouping, "Trivial row grouping") .def("get_row", [](SparseMatrix& matrix, entry_index row) { return matrix.getRows(row, row+1); }, py::return_value_policy::reference, py::keep_alive<1, 0>(), py::arg("row"), "Get row")