From 1b6448a8076d2493979ca4c104380789330af801 Mon Sep 17 00:00:00 2001 From: Shyam Sankaran Date: Sat, 6 May 2023 19:17:14 -0400 Subject: [PATCH] fixes for python --- python/example/example.py | 5 +++++ python/pybind11 | 2 +- python/wrapper/pyhodlrlib.cpp | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/python/example/example.py b/python/example/example.py index b176098..dd43301 100644 --- a/python/example/example.py +++ b/python/example/example.py @@ -66,3 +66,8 @@ def getMatrixEntry(self, i, j): # Directly obtaining the symmetric factor matrix: W = T.getSymmetricFactor() print('Error in Getting Symmetric Factor:', np.mean(abs(W @ W.T - A))) + +print('Tree Details:') +T.printTreeDetails() +T.plotTree('plot.png') +print('Done!') diff --git a/python/pybind11 b/python/pybind11 index 9bb3313..f701654 160000 --- a/python/pybind11 +++ b/python/pybind11 @@ -1 +1 @@ -Subproject commit 9bb3313162c0b856125e481ceece9d8faa567716 +Subproject commit f70165463328c218d118204efc13aac93783d17b diff --git a/python/wrapper/pyhodlrlib.cpp b/python/wrapper/pyhodlrlib.cpp index 3df2072..d13373a 100644 --- a/python/wrapper/pyhodlrlib.cpp +++ b/python/wrapper/pyhodlrlib.cpp @@ -51,5 +51,7 @@ PYBIND11_MODULE(pyhodlrlib, m) .def("symmetricFactorProduct", &HODLR::symmetricFactorProduct) .def("symmetricFactorTransposeProduct", &HODLR::symmetricFactorTransposeProduct) .def("getSymmetricFactor", &HODLR::getSymmetricFactor) - .def("logDeterminant", &HODLR::logDeterminant); + .def("logDeterminant", &HODLR::logDeterminant) + .def("plotTree", &HODLR::plotTree) + .def("printTreeDetails", &HODLR::printTreeDetails); }