From cdbcac61eb95cefd695322ef7871834a5c4abcdb Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 26 Jan 2023 16:02:45 +0100 Subject: [PATCH] Added Matrix and vector skeleton classes. --- SCsub | 3 +++ config.py | 3 ++- mlpp/lin_alg/mlpp_matrix.cpp | 12 ++++++++++++ mlpp/lin_alg/mlpp_matrix.h | 17 +++++++++++++++++ mlpp/lin_alg/mlpp_vector.cpp | 12 ++++++++++++ mlpp/lin_alg/mlpp_vector.h | 17 +++++++++++++++++ register_types.cpp | 5 +++++ 7 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 mlpp/lin_alg/mlpp_matrix.cpp create mode 100644 mlpp/lin_alg/mlpp_matrix.h create mode 100644 mlpp/lin_alg/mlpp_vector.cpp create mode 100644 mlpp/lin_alg/mlpp_vector.h diff --git a/SCsub b/SCsub index 0a086eb..8d7c266 100644 --- a/SCsub +++ b/SCsub @@ -7,6 +7,9 @@ module_env = env.Clone() sources = [ "register_types.cpp", + "mlpp/lin_alg/mlpp_vector.cpp", + "mlpp/lin_alg/mlpp_matrix.cpp", + "mlpp/activation/activation.cpp", "mlpp/ann/ann.cpp", "mlpp/auto_encoder/auto_encoder.cpp", diff --git a/config.py b/config.py index a53910e..24650e7 100644 --- a/config.py +++ b/config.py @@ -6,8 +6,9 @@ def configure(env): def get_doc_classes(): return [ + "MLPPVector", + "MLPPMatrix", - "MLPPTests", ] diff --git a/mlpp/lin_alg/mlpp_matrix.cpp b/mlpp/lin_alg/mlpp_matrix.cpp new file mode 100644 index 0000000..b4cdeeb --- /dev/null +++ b/mlpp/lin_alg/mlpp_matrix.cpp @@ -0,0 +1,12 @@ + +#include "mlpp_matrix.h" + +MLPPMatrix::MLPPMatrix() { +} + +MLPPMatrix::~MLPPMatrix() { +} + +void MLPPMatrix::_bind_methods() { + //ClassDB::bind_method(D_METHOD(""), &MLPPMatrix::); +} diff --git a/mlpp/lin_alg/mlpp_matrix.h b/mlpp/lin_alg/mlpp_matrix.h new file mode 100644 index 0000000..b12cdd6 --- /dev/null +++ b/mlpp/lin_alg/mlpp_matrix.h @@ -0,0 +1,17 @@ +#ifndef MLPP_MATRIX_H +#define MLPP_MATRIX_H + +#include "core/object/reference.h" + +class MLPPMatrix : public Reference { + GDCLASS(MLPPMatrix, Reference); + +public: + MLPPMatrix(); + ~MLPPMatrix(); + +protected: + static void _bind_methods(); +}; + +#endif diff --git a/mlpp/lin_alg/mlpp_vector.cpp b/mlpp/lin_alg/mlpp_vector.cpp new file mode 100644 index 0000000..4b62cd5 --- /dev/null +++ b/mlpp/lin_alg/mlpp_vector.cpp @@ -0,0 +1,12 @@ + +#include "mlpp_vector.h" + +MLPPVector::MLPPVector() { +} + +MLPPVector::~MLPPVector() { +} + +void MLPPVector::_bind_methods() { + //ClassDB::bind_method(D_METHOD(""), &MLPPVector::); +} diff --git a/mlpp/lin_alg/mlpp_vector.h b/mlpp/lin_alg/mlpp_vector.h new file mode 100644 index 0000000..37b316f --- /dev/null +++ b/mlpp/lin_alg/mlpp_vector.h @@ -0,0 +1,17 @@ +#ifndef MLPP_VECTOR_H +#define MLPP_VECTOR_H + +#include "core/object/reference.h" + +class MLPPVector : public Reference { + GDCLASS(MLPPVector, Reference); + +public: + MLPPVector(); + ~MLPPVector(); + +protected: + static void _bind_methods(); +}; + +#endif diff --git a/register_types.cpp b/register_types.cpp index 78af669..5dcd88c 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -24,11 +24,16 @@ SOFTWARE. #include "register_types.h" #include "mlpp/data/data.h" +#include "mlpp/lin_alg/mlpp_vector.h" +#include "mlpp/lin_alg/mlpp_matrix.h" #include "test/mlpp_tests.h" void register_pmlpp_types(ModuleRegistrationLevel p_level) { if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) { + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class();