From 538ac8b46bef51a7549f339d0431dbb32dddce2f Mon Sep 17 00:00:00 2001 From: Michal Kravcenko <michal.kravcenko@vsb.cz> Date: Tue, 19 Mar 2019 19:55:12 +0100 Subject: [PATCH] MOD: changed the return type of add_connection_constant --- src/Network/NeuralNetwork.cpp | 4 +++- src/Network/NeuralNetwork.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Network/NeuralNetwork.cpp b/src/Network/NeuralNetwork.cpp index a51d704c..d48bfa27 100644 --- a/src/Network/NeuralNetwork.cpp +++ b/src/Network/NeuralNetwork.cpp @@ -506,7 +506,7 @@ namespace lib4neuro { return this->connection_list->size() - 1; } - void + size_t NeuralNetwork::add_connection_constant(size_t n1_idx, size_t n2_idx, double weight) { ConnectionFunctionConstant *con_weight_u1u2 = new ConnectionFunctionConstant( weight ); @@ -517,6 +517,8 @@ namespace lib4neuro { this->add_inward_connection(n2_idx, n1_idx, conn_idx); this->layers_analyzed = false; + + return conn_idx; } void NeuralNetwork::add_existing_connection(size_t n1_idx, size_t n2_idx, size_t connection_idx, diff --git a/src/Network/NeuralNetwork.h b/src/Network/NeuralNetwork.h index 8edb9e87..00d18921 100644 --- a/src/Network/NeuralNetwork.h +++ b/src/Network/NeuralNetwork.h @@ -279,7 +279,7 @@ namespace lib4neuro { * @param n2_idx * @param weight */ - LIB4NEURO_API void add_connection_constant(size_t n1_idx, size_t n2_idx, double weight); + LIB4NEURO_API size_t add_connection_constant(size_t n1_idx, size_t n2_idx, double weight); /** * Take the existing connection with index 'connection_idx' in 'parent_network' and adds it to the structure of this -- GitLab