From 235ba86eaece4b1669b3d18aa76a23efd0b00d2b Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 12 Feb 2023 15:47:48 +0100 Subject: [PATCH] Register MLPPStat into the ClassDB. --- mlpp/stat/stat.cpp | 3 +++ mlpp/stat/stat.h | 9 ++++++++- register_types.cpp | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mlpp/stat/stat.cpp b/mlpp/stat/stat.cpp index 622f133..067d20b 100644 --- a/mlpp/stat/stat.cpp +++ b/mlpp/stat/stat.cpp @@ -270,3 +270,6 @@ real_t MLPPStat::logMean(const real_t x, const real_t y) { } return (y - x) / (log(y) - std::log(x)); } + +void MLPPStat::_bind_methods() { +} diff --git a/mlpp/stat/stat.h b/mlpp/stat/stat.h index 7718834..8397e30 100644 --- a/mlpp/stat/stat.h +++ b/mlpp/stat/stat.h @@ -10,12 +10,16 @@ #include "core/math/math_defs.h" +#include "core/object/reference.h" + #include "../lin_alg/mlpp_matrix.h" #include "../lin_alg/mlpp_vector.h" #include -class MLPPStat { +class MLPPStat : public Reference { + GDCLASS(MLPPStat, Reference); + public: // These functions are for univariate lin reg module- not for users. real_t b0Estimation(const std::vector &x, const std::vector &y); @@ -58,6 +62,9 @@ public: real_t stolarskyMean(const real_t x, const real_t y, const real_t p); real_t identricMean(const real_t x, const real_t y); real_t logMean(const real_t x, const real_t y); + +protected: + static void _bind_methods(); }; #endif /* Stat_hpp */ diff --git a/register_types.cpp b/register_types.cpp index fc280e9..546781d 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -32,6 +32,7 @@ SOFTWARE. #include "mlpp/regularization/reg.h" #include "mlpp/transforms/transforms.h" #include "mlpp/utilities/utilities.h" +#include "mlpp/stat/stat.h" #include "mlpp/hidden_layer/hidden_layer.h" #include "mlpp/multi_output_layer/multi_output_layer.h" @@ -63,6 +64,7 @@ void register_pmlpp_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class();