From c82313bd335dd406c128cdbbeaf6b4fcb20f98c1 Mon Sep 17 00:00:00 2001 From: Bridger Holt Date: Tue, 10 Jul 2018 16:35:00 -0600 Subject: [PATCH] Added get_weights and set_weights to fann_cpp.h The functions fann_get_weights and fann_set_weights have been in the C API for a while but not the C++ API. --- src/include/fann_cpp.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/include/fann_cpp.h b/src/include/fann_cpp.h index 6f54b34a..0a5ca01e 100644 --- a/src/include/fann_cpp.h +++ b/src/include/fann_cpp.h @@ -1909,6 +1909,36 @@ namespace FANN { fann_set_weight(ann, from_neuron, to_neuron, weight); } } + + /* Method: get_weights + + Get all the network weights. + + See also: + + + This function appears in FANN >= x.y.z + */ + void get_weights(fann_type *weights) { + if (ann != NULL) { + fann_get_weights(ann, weights); + } + } + + /* Method: set_weights + + Set network weights. + + See also: + + + This function appears in FANN >= x.y.z + */ + void set_weights(fann_type *weights) { + if (ann != NULL) { + fann_set_weights(ann, weights); + } + } /*********************************************************************/