Skip to content
Snippets Groups Projects
Commit fdf991c1 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[bindings] export matching vector/matrix backends as property

parent 23b74f7c
No related branches found
No related tags found
No related merge requests found
...@@ -97,6 +97,8 @@ typename std::enable_if<is_matrix<C>::value, pybind11::class_<C>>::type bind_Mat ...@@ -97,6 +97,8 @@ typename std::enable_if<is_matrix<C>::value, pybind11::class_<C>>::type bind_Mat
py::class_<C> c(m, std::string(id).c_str(), std::string(id).c_str()); py::class_<C> c(m, std::string(id).c_str(), std::string(id).c_str());
c.def_property_readonly_static("vector_type", [](py::object /*self*/) { return C::vector_type; });
internal::addbind_Matrix<C, sparse>::template ctor<S>(c); internal::addbind_Matrix<C, sparse>::template ctor<S>(c);
c.def("__init__", c.def("__init__",
[](C& self, const ssize_t rows, const ssize_t cols, const SparsityPatternDefault& pattern) { [](C& self, const ssize_t rows, const ssize_t cols, const SparsityPatternDefault& pattern) {
......
...@@ -42,6 +42,9 @@ typename std::enable_if<is_vector<C>::value, pybind11::class_<C>>::type bind_Vec ...@@ -42,6 +42,9 @@ typename std::enable_if<is_vector<C>::value, pybind11::class_<C>>::type bind_Vec
py::class_<C> c(m, std::string(id).c_str(), std::string(id).c_str()); py::class_<C> c(m, std::string(id).c_str(), std::string(id).c_str());
c.def_property_readonly_static("dense_matrix_type", [](py::object /*self*/) { return C::dense_matrix_type; });
c.def_property_readonly_static("sparse_matrix_type", [](py::object /*self*/) { return C::sparse_matrix_type; });
c.def("__init__", c.def("__init__",
[](C& vec, const ssize_t size, const S& value) { [](C& vec, const ssize_t size, const S& value) {
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment