From acf949dd2ab358a8f901eacd30087a96aec01422 Mon Sep 17 00:00:00 2001 From: Monika Jha Date: Fri, 20 Mar 2020 00:33:35 +0530 Subject: [PATCH] Solved #10 --- adaboost/core/data_structures.hpp | 16 ---------------- adaboost/core/operations.hpp | 18 ++++++++++++++++++ adaboost/core/operations_impl.cpp | 6 ++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/adaboost/core/data_structures.hpp b/adaboost/core/data_structures.hpp index 4e33051..0448913 100644 --- a/adaboost/core/data_structures.hpp +++ b/adaboost/core/data_structures.hpp @@ -66,14 +66,6 @@ namespace adaboost void set(unsigned int index, data_type_vector value); - /* - * Used for filling the vector with a given value. - * - * @param value The value with which the vector is - * to be populated. - */ - void fill(data_type_vector value); - /* * Used for obtaining the size of the vector. */ @@ -158,14 +150,6 @@ namespace adaboost unsigned int y, data_type_matrix value); - /* - * Used for filling the matrix with a given value. - * - * @param value The value with which the matrix is - * to be populated. - */ - void fill(data_type_matrix value); - /* * Used for obtaining number of rows in the vector. */ diff --git a/adaboost/core/operations.hpp b/adaboost/core/operations.hpp index 0440abd..1e5a675 100644 --- a/adaboost/core/operations.hpp +++ b/adaboost/core/operations.hpp @@ -7,6 +7,24 @@ namespace adaboost { namespace core { + /* @overload + * Used for filling the vector with a given value. + * + * @param value The value with which the vector is + * to be populated. + */ + template + void fill(data_type_vector value); + + /* @overload + * Used for filling the matrix with a given value. + * + * @param value The value with which the matrix is + * to be populated. + */ + template + void fill(data_type_matrix value); + /* * This function computes the sum of * elements of the given vector and the diff --git a/adaboost/core/operations_impl.cpp b/adaboost/core/operations_impl.cpp index 27db15f..0fa5006 100644 --- a/adaboost/core/operations_impl.cpp +++ b/adaboost/core/operations_impl.cpp @@ -48,8 +48,7 @@ namespace adaboost } template - void Vector:: - fill(data_type_vector value) + void fill(data_type_vector value); { for(unsigned int i = 0; i < this->size; i++) { @@ -59,8 +58,7 @@ namespace adaboost template - void Matrix:: - fill(data_type_matrix value) + void fill(data_type_matrix value); { for(unsigned int i = 0; i < this->rows; i++) {