From 977d4aa54fa886daeb58872006add1eb1867c5a1 Mon Sep 17 00:00:00 2001 From: Ellon Mendes Date: Tue, 17 Nov 2015 16:29:16 +0100 Subject: [PATCH] Add 'bases' for noiseModel classes While here, add comments and TODOs --- python/handwritten/noiseModel_python.cpp | 34 +++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/python/handwritten/noiseModel_python.cpp b/python/handwritten/noiseModel_python.cpp index e23a5b630..f33bc0e8b 100644 --- a/python/handwritten/noiseModel_python.cpp +++ b/python/handwritten/noiseModel_python.cpp @@ -1,3 +1,27 @@ +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file noiseModel_python.cpp + * @brief wraps the noise model classes into the noiseModel module + * @author Ellon Paiva Mendes (LAAS-CNRS) + **/ + + /** TODOs Summary: + * + * TODO(Ellon): Don't know yet it it's worth/needed to add 'Wrap structs' for each of the noise models. + * I think it's only worthy if we want to access virtual the virtual functions from python. + * TODO(Ellon): Wrap non-pure virtual methods of Base on BaseWrap + */ + #include #include @@ -43,6 +67,8 @@ struct BaseWrap : Base, wrapper this->get_override("WhitenSystem")(); } + // TODO(Ellon) Wrap non-pure virtual methods here. See: http://www.boost.org/doc/libs/1_59_0/libs/python/doc/tutorial/doc/html/python/exposing.html#python.virtual_functions_with_default_implementations + }; BOOST_PYTHON_MODULE(libnoiseModel_python) @@ -76,7 +102,7 @@ class_("Base") .def("print", pure_virtual(&Base::print)) ; -class_, bases >("Gaussian", no_init) +class_, bases >("Gaussian", no_init) .def("SqrtInformation",&Gaussian::SqrtInformation) .staticmethod("SqrtInformation") .def("Information",&Gaussian::Information) @@ -85,7 +111,7 @@ class_, bases >("Gaussian", no_init) .staticmethod("Covariance") ; -class_ >("Diagonal", no_init) +class_, bases >("Diagonal", no_init) .def("Sigmas",&Diagonal::Sigmas) .staticmethod("Sigmas") .def("Variances",&Diagonal::Variances) @@ -94,7 +120,7 @@ class_ >("Diagonal", no_init) .staticmethod("Precisions") ; -class_ >("Isotropic", no_init) +class_, bases >("Isotropic", no_init) .def("Sigma",&Isotropic::Sigma) .staticmethod("Sigma") .def("Variance",&Isotropic::Variance) @@ -103,7 +129,7 @@ class_ >("Isotropic", no_init) .staticmethod("Precision") ; -class_ >("Unit", no_init) +class_, bases >("Unit", no_init) .def("Create",&Unit::Create) .staticmethod("Create") ;