Skip to content

Commit 03c57b1

Browse files
bump fix from htool and add clear_data to virtual lrmat generator
1 parent c250626 commit 03c57b1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/htool/hmatrix/interfaces/virtual_low_rank_generator.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,18 @@ class VirtualLowRankGeneratorPython : public VirtualLowRankGenerator<Coefficient
4040
return false;
4141
}
4242

43-
bool is_htool_owning_data() const override { return false; }
44-
4543
// lcov does not see it because of trampoline I assume
4644
virtual bool build_low_rank_approximation(const py::array_t<int, py::array::f_style> &rows, const py::array_t<int, py::array::f_style> &cols, underlying_type<CoefficientPrecision> epsilon) const = 0; // LCOV_EXCL_LINE
4745

4846
void set_U(py::array_t<CoefficientPrecision, py::array::f_style> U0) {
4947
m_mats_U.push_back(U0); // no copy here
5048
}
5149
void set_V(py::array_t<CoefficientPrecision, py::array::f_style> V0) { m_mats_V.push_back(V0); }
50+
51+
void clear_data(){
52+
m_mats_U.clear();
53+
m_mats_V.clear();
54+
}
5255
};
5356

5457
template <typename CoefficientPrecision>
@@ -76,6 +79,7 @@ void declare_custom_VirtualLowRankGenerator(py::module &m, const std::string &cl
7679
py_class.def("build_low_rank_approximation", &Class::build_low_rank_approximation);
7780
py_class.def("set_U", &Class::set_U);
7881
py_class.def("set_V", &Class::set_V);
82+
py_class.def("clear_data", &Class::clear_data);
7983
}
8084

8185
#endif

0 commit comments

Comments
 (0)