From d10d203f946971298098945b71c260ab36cbbc29 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 09:45:22 +0100 Subject: [PATCH 01/18] add assignment operator for adagrad input --- .../algorithms/optimization_solver/adagrad/adagrad_types.h | 1 + .../algorithms/optimization_solver/adagrad/adagrad_types.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/adagrad/adagrad_types.h b/cpp/daal/include/algorithms/optimization_solver/adagrad/adagrad_types.h index b5f5a3edf6d..261d5819da1 100755 --- a/cpp/daal/include/algorithms/optimization_solver/adagrad/adagrad_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/adagrad/adagrad_types.h @@ -137,6 +137,7 @@ class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input typedef optimization_solver::iterative_solver::Input super; Input(); Input(const Input & other); + Input & operator=(const Input & other); using super::set; using super::get; diff --git a/cpp/daal/src/algorithms/optimization_solver/adagrad/adagrad_types.cpp b/cpp/daal/src/algorithms/optimization_solver/adagrad/adagrad_types.cpp index 30602f05573..8a0a49c5894 100644 --- a/cpp/daal/src/algorithms/optimization_solver/adagrad/adagrad_types.cpp +++ b/cpp/daal/src/algorithms/optimization_solver/adagrad/adagrad_types.cpp @@ -66,6 +66,10 @@ services::Status Parameter::check() const Input::Input() {} Input::Input(const Input & other) {} +Input & Input::operator=(const Input & other) +{ + return *this; +}; data_management::NumericTablePtr Input::get(OptionalDataId id) const { From e8015e7241606f7a01683ffec386a652e71ea756 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 09:49:58 +0100 Subject: [PATCH 02/18] add assignment operator for cd input --- .../coordinate_descent/coordinate_descent_types.h | 1 + .../coordinate_descent/coordinate_descent_types.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.h b/cpp/daal/include/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.h index f4f2820edc0..9022844207e 100644 --- a/cpp/daal/include/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.h @@ -124,6 +124,7 @@ class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input public: Input(); Input(const Input & other); + Input & operator=(const Input & other); using super::set; using super::get; diff --git a/cpp/daal/src/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.cpp b/cpp/daal/src/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.cpp index 979acf2fa44..0bf3be3f9c8 100644 --- a/cpp/daal/src/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.cpp +++ b/cpp/daal/src/algorithms/optimization_solver/coordinate_descent/coordinate_descent_types.cpp @@ -61,6 +61,10 @@ services::Status Parameter::check() const Input::Input() {} Input::Input(const Input & other) {} +Input & Input::operator=(const Input & other) +{ + return *this; +}; services::Status Input::check(const daal::algorithms::Parameter * par, int method) const { From 2e824d88f5391d490892bdc1ad487ac258becda8 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 09:57:18 +0100 Subject: [PATCH 03/18] add assignment operator for sumtypes input --- .../objective_function/sum_of_functions_types.h | 3 +++ .../optimization_solver/iterative_solver_types.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h index 6622221775c..4348355d38f 100644 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h @@ -118,6 +118,9 @@ class DAAL_EXPORT Input : public objective_function::Input /** Copy constructor */ Input(const Input & other); + /** Assignment operator */ + Input & operator=(const Input & other); + /** Destructor */ virtual ~Input() {} diff --git a/cpp/daal/src/algorithms/optimization_solver/iterative_solver_types.cpp b/cpp/daal/src/algorithms/optimization_solver/iterative_solver_types.cpp index baa7a5da97e..363e92d10ac 100644 --- a/cpp/daal/src/algorithms/optimization_solver/iterative_solver_types.cpp +++ b/cpp/daal/src/algorithms/optimization_solver/iterative_solver_types.cpp @@ -93,6 +93,11 @@ services::Status Parameter::check() const Input::Input() : daal::algorithms::Input(lastOptionalInputId + 1) {} Input::Input(const Input & other) : daal::algorithms::Input(other) {} +Input & Input::operator=(const Input & other) +{ + daal::algorithms::Input::operator=(other); + return *this; +} data_management::NumericTablePtr Input::get(InputId id) const { From f06e9c0ed27b5d2c99c34cea27d682783bbb0da6 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 09:59:01 +0100 Subject: [PATCH 04/18] add assignment operator for lbfgs input --- .../algorithms/optimization_solver/lbfgs/lbfgs_types.h | 1 + .../src/algorithms/optimization_solver/lbfgs/lbfgs_types.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/lbfgs/lbfgs_types.h b/cpp/daal/include/algorithms/optimization_solver/lbfgs/lbfgs_types.h index c790e3e79bc..fc7ade462a2 100755 --- a/cpp/daal/include/algorithms/optimization_solver/lbfgs/lbfgs_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/lbfgs/lbfgs_types.h @@ -154,6 +154,7 @@ class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input typedef optimization_solver::iterative_solver::Input super; Input(); Input(const Input & other); + Input & operator=(const Input & other); using super::set; using super::get; diff --git a/cpp/daal/src/algorithms/optimization_solver/lbfgs/lbfgs_types.cpp b/cpp/daal/src/algorithms/optimization_solver/lbfgs/lbfgs_types.cpp index 73bcf595776..8dcaae9f0db 100644 --- a/cpp/daal/src/algorithms/optimization_solver/lbfgs/lbfgs_types.cpp +++ b/cpp/daal/src/algorithms/optimization_solver/lbfgs/lbfgs_types.cpp @@ -85,6 +85,10 @@ services::Status Parameter::check() const Input::Input() {} Input::Input(const Input & other) {} +Input & Input::operator=(const Input & other) +{ + return *this; +} NumericTablePtr Input::get(OptionalDataId id) const { From ec8d54088b9afc133891a77cc9da1988d816ad5b Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:03:27 +0100 Subject: [PATCH 05/18] add assignment operator for crossentropyloss input --- .../objective_function/cross_entropy_loss_types.h | 3 +++ .../cross_entropy_loss/cross_entropy_loss_types.cpp | 6 ++++++ .../objective_function/sum_of_functions_types.cpp | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h index 4a4e95fea6a..c069e681e61 100755 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h @@ -130,6 +130,9 @@ class DAAL_EXPORT Input : public sum_of_functions::Input /** Copy constructor */ Input(const Input & other); + /** Assignment operator */ + Input & operator=(const Input & other); + /** Destructor */ virtual ~Input() {} diff --git a/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp b/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp index a116d8aae0e..6f1212d580f 100644 --- a/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp @@ -82,6 +82,12 @@ Input::Input() : sum_of_functions::Input(lastInputId + 1) {} Input::Input(const Input & other) : sum_of_functions::Input(other) {} +Input & Input::operator=(const Input & other) +{ + sum_of_functions::Input::operator=(other); + return *this; +} + /** * Sets one input object for Logistic loss objective function * \param[in] id Identifier of the input object diff --git a/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp b/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp index eba39b15e95..b363b8fa633 100644 --- a/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp @@ -65,6 +65,12 @@ Input::Input(size_t n) : objective_function::Input(n) {} Input::Input(const Input & other) : objective_function::Input(other) {} +Input & Input::operator=(const Input & other) +{ + objective_function::Input::operator=(other); + return *this; +} + /** * Sets one input object for Sum of functions * \param[in] id Identifier of the input object From 1db429ddc92938de5022bc31e0d96a8f3aa8d1cb Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:08:31 +0100 Subject: [PATCH 06/18] add assignment operator for crossentropyloss parameters --- .../objective_function/cross_entropy_loss_types.h | 11 +++++++++-- .../cross_entropy_loss/cross_entropy_loss_types.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h index c069e681e61..0e493a4f96c 100755 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/cross_entropy_loss_types.h @@ -98,10 +98,17 @@ struct DAAL_EXPORT Parameter : public sum_of_functions::Parameter const DAAL_UINT64 resultsToCompute = objective_function::gradient); /** - * Constructs an Parameter by copying input objects and parameters of another Parameter - * \param[in] other An object to be used as the source to initialize object + * Constructs a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to initialize from */ Parameter(const Parameter & other); + + /** + * Assigns a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to copy from + */ + Parameter & operator=(const Parameter & other); + /** * Checks the correctness of the parameter * diff --git a/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp b/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp index 6f1212d580f..7786f197700 100644 --- a/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/cross_entropy_loss/cross_entropy_loss_types.cpp @@ -66,6 +66,16 @@ Parameter::Parameter(const Parameter & other) nClasses(other.nClasses) {} +Parameter & Parameter::operator=(const Parameter & other) +{ + sum_of_functions::Parameter::operator=(other); + this->interceptFlag = other.interceptFlag; + this->penaltyL1 = other.penaltyL1; + this->penaltyL2 = other.penaltyL2; + this->nClasses = other.nClasses; + return *this; +} + /** * Checks the correctness of the parameter */ From f30c099e13fbdf1e99ae5fe439b24ca51bc129a0 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:10:33 +0100 Subject: [PATCH 07/18] add assignment operator for logisticloss input --- .../objective_function/logistic_loss_types.h | 3 +++ .../logistic_loss/logistic_loss_types.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h index a7dfbb2aff4..5813be9d980 100755 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h @@ -129,6 +129,9 @@ class DAAL_EXPORT Input : public sum_of_functions::Input /** Copy constructor */ Input(const Input & other); + /** Assignment operator */ + Input & operator=(const Input & other); + /** Destructor */ virtual ~Input() {} diff --git a/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp b/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp index cef27add29b..04a60a69787 100644 --- a/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp @@ -73,6 +73,12 @@ Input::Input() : sum_of_functions::Input(lastInputId + 1) {} Input::Input(const Input & other) : sum_of_functions::Input(other) {} +Input & Input::operator=(const Input & other) +{ + sum_of_functions::Input::operator=(other); + return *this; +} + /** * Sets one input object for Logistic loss objective function * \param[in] id Identifier of the input object From 1f2d0c22efb29fa82fcad4fae0593afe97f5646e Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:13:01 +0100 Subject: [PATCH 08/18] add assignment operator for logisticloss parameter --- .../objective_function/logistic_loss_types.h | 10 ++++++++-- .../logistic_loss/logistic_loss_types.cpp | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h index 5813be9d980..7f96c2cdc9a 100755 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h @@ -97,10 +97,16 @@ struct DAAL_EXPORT Parameter : public sum_of_functions::Parameter const DAAL_UINT64 resultsToCompute = objective_function::gradient); /** - * Constructs an Parameter by copying input objects and parameters of another Parameter - * \param[in] other An object to be used as the source to initialize object + * Constructs a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to initialize from */ Parameter(const Parameter & other); + + /** + * Assigns a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to copy from + */ + Parameter & operator=(const Parameter & other); /** * Checks the correctness of the parameter * diff --git a/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp b/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp index 04a60a69787..220ccc3b237 100644 --- a/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/logistic_loss/logistic_loss_types.cpp @@ -58,6 +58,15 @@ Parameter::Parameter(const Parameter & other) : sum_of_functions::Parameter(other), penaltyL1(other.penaltyL1), penaltyL2(other.penaltyL2), interceptFlag(other.interceptFlag) {} +Parameter & Parameter::operator=(const Parameter & other) +{ + sum_of_functions::Parameter::operator=(other); + this->penaltyL1 = other.penaltyL1; + this->penaltyL2 = other.penaltyL2; + this->interceptFlag = other.interceptFlag; + return *this; +} + /** * Checks the correctness of the parameter */ From 8cf2bef6f6f6863ceddf45962ecd6790f4d62afa Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:19:35 +0100 Subject: [PATCH 09/18] add assignment operator for mseloss parameter --- .../objective_function/logistic_loss_types.h | 1 + .../objective_function/mse_types.h | 11 +++++++++-- .../objective_function/mse/mse_types.cpp | 17 +++++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h index 7f96c2cdc9a..6a6d853604a 100755 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/logistic_loss_types.h @@ -107,6 +107,7 @@ struct DAAL_EXPORT Parameter : public sum_of_functions::Parameter * \param[in] other An object to be used as the source object to copy from */ Parameter & operator=(const Parameter & other); + /** * Checks the correctness of the parameter * diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h index 995e3fe7c44..30ed8bf9326 100755 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h @@ -118,10 +118,17 @@ struct DAAL_EXPORT Parameter : public sum_of_functions::Parameter const DAAL_UINT64 resultsToCompute = objective_function::gradient); /** - * Constructs an Parameter by copying input objects and parameters of another Parameter - * \param[in] other An object to be used as the source to initialize object + * Constructs a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to initialize from */ Parameter(const Parameter & other); + + /** + * Assigns a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to copy from + */ + Parameter & operator=(const Parameter & other); + /** * Checks the correctness of the parameter * diff --git a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp index 3da201ad0dd..521a1cd17e2 100644 --- a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp @@ -54,13 +54,26 @@ Parameter::Parameter(size_t numberOfTerms, data_management::NumericTablePtr batc {} /** - * Constructs an Parameter by copying input objects and parameters of another Parameter - * \param[in] other An object to be used as the source to initialize object + * Constructs a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to initialize from */ Parameter::Parameter(const Parameter & other) : sum_of_functions::Parameter(other), interceptFlag(other.interceptFlag), penaltyL1(other.penaltyL1), penaltyL2(other.penaltyL2) {} +/** + * Assigns a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to copy from + */ +Parameter & operator=(const Parameter & other); +{ + sum_of_functions::Parameter::operator=(other); + this->interceptFlag = other.interceptFlag; + this->penaltyL1 = other.penaltyL1; + this->penaltyL2 = other.penaltyL2; + return *this; +} + /** * Checks the correctness of the parameter */ From 86a75808ef040144ec9ddfc774175b2e083d3657 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:20:42 +0100 Subject: [PATCH 10/18] add assignment operator for mseloss input --- .../optimization_solver/objective_function/mse_types.h | 3 +++ .../src/algorithms/objective_function/mse/mse_types.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h index 30ed8bf9326..da72e727ff9 100755 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/mse_types.h @@ -155,6 +155,9 @@ class DAAL_EXPORT Input : public sum_of_functions::Input /** Copy constructor */ Input(const Input & other); + /** Assignment operator */ + Input & operator=(const Input & other); + /** Destructor */ virtual ~Input() {} diff --git a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp index 521a1cd17e2..a7dc1e747d3 100644 --- a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp @@ -87,6 +87,12 @@ Input::Input() : sum_of_functions::Input(lastInputId + 1) {} Input::Input(const Input & other) : sum_of_functions::Input(other) {} +Input & Input::operator=(const Input & other) +{ + sum_of_functions::Input::operator=(other); + return *this; +} + /** * Sets one input object for Mean squared error objective function * \param[in] id Identifier of the input object From 6467c206e194a35304e33d77cac256f7b60bd101 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:21:51 +0100 Subject: [PATCH 11/18] add assignment operator for functiontypes input --- .../objective_function/objective_function_types.h | 3 +++ .../objective_function/objective_function_types.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h index ccc4ff77567..876684eaafd 100644 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h @@ -144,6 +144,9 @@ class DAAL_EXPORT Input : public daal::algorithms::Input /** Copy constructor */ Input(const Input & other); + /** Assignment operator */ + Input & operator=(const Input & other); + /** Destructor */ virtual ~Input() {} diff --git a/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp b/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp index f2788f20444..8031026be09 100644 --- a/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp @@ -45,6 +45,11 @@ Parameter::Parameter(const Parameter & other) : resultsToCompute(other.resultsTo /** Default constructor */ Input::Input(size_t n) : daal::algorithms::Input(n) {} Input::Input(const Input & other) : daal::algorithms::Input(other) {} +Input & Input::operator=(const Input & other) +{ + daal::algorithms::Input::operator=(other); + return *this; +} /** * Sets one input object for Objective function From 6fbe95bbfe24d83c2e4628a69d76ec12d0ba9820 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:23:40 +0100 Subject: [PATCH 12/18] add assignment operator for functiontypes parameter --- .../objective_function/objective_function_types.h | 10 ++++++++-- .../objective_function/objective_function_types.cpp | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h index 876684eaafd..0499d69be4f 100644 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/objective_function_types.h @@ -120,11 +120,17 @@ struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter Parameter(const DAAL_UINT64 resultsToCompute = gradient); /** - * Constructs an Parameter by copying input objects and parameters of another Parameter - * \param[in] other An object to be used as the source to initialize object + * Constructs a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to initialize from */ Parameter(const Parameter & other); + /** + * Assigns a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to copy from + */ + Parameter & operator=(const Parameter & other); + virtual ~Parameter() {} DAAL_UINT64 resultsToCompute; /*!< 64 bit integer flag that indicates the results to compute */ diff --git a/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp b/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp index 8031026be09..407773b2d61 100644 --- a/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp @@ -42,6 +42,12 @@ Parameter::Parameter(const DAAL_UINT64 resultsToCompute) : resultsToCompute(resu Parameter::Parameter(const Parameter & other) : resultsToCompute(other.resultsToCompute) {} +Parameter & Parameter::operator=(const Parameter & other) +{ + resultsToCompute::operator=(other.resultsToCompute); + return *this; +} + /** Default constructor */ Input::Input(size_t n) : daal::algorithms::Input(n) {} Input::Input(const Input & other) : daal::algorithms::Input(other) {} From 8c0fc958d1b695eae2c540d7eaf62718096a7e40 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:29:36 +0100 Subject: [PATCH 13/18] add assignment operator for sumoffunctions parameter --- .../iterative_solver/iterative_solver_types.h | 1 + .../objective_function/sum_of_functions_types.h | 10 ++++++++-- .../objective_function/sum_of_functions_types.cpp | 9 +++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cpp/daal/include/algorithms/optimization_solver/iterative_solver/iterative_solver_types.h b/cpp/daal/include/algorithms/optimization_solver/iterative_solver/iterative_solver_types.h index 12c44379c6e..4cd47935644 100644 --- a/cpp/daal/include/algorithms/optimization_solver/iterative_solver/iterative_solver_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/iterative_solver/iterative_solver_types.h @@ -166,6 +166,7 @@ class DAAL_EXPORT Input : public daal::algorithms::Input public: Input(); Input(const Input & other); + Input & operator=(const Input & other); ~Input() DAAL_C11_OVERRIDE {} diff --git a/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h b/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h index 4348355d38f..565f99df066 100644 --- a/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/objective_function/sum_of_functions_types.h @@ -82,11 +82,17 @@ struct DAAL_EXPORT Parameter : public objective_function::Parameter const DAAL_UINT64 resultsToCompute = objective_function::gradient); /** - * Constructs an Parameter by copying input objects and parameters of another Parameter - * \param[in] other An object to be used as the source to initialize object + * Constructs a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to initialize from */ Parameter(const Parameter & other); + /** + * Assigns a Parameter by copying input objects and parameters of another Parameter + * \param[in] other An object to be used as the source object to copy from + */ + Parameter & operator=(const Parameter & other); + /** * Checks the correctness of the parameter * diff --git a/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp b/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp index b363b8fa633..48521f8bd30 100644 --- a/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/sum_of_functions_types.cpp @@ -49,6 +49,15 @@ Parameter::Parameter(const Parameter & other) featureId(other.featureId) {} +Parameter & Parameter::operator=(const Parameter & other) +{ + objective_function::Parameter::operator=(other.resultsToCompute); + this->numberOfTerms = other.numberOfTerms; + this->batchIndices = other.batchIndices; + this->featureId = other.featureId; + return *this; +} + /** * Checks the correctness of the parameter */ From 70e278a14057884e064d294137c263bee4de73d0 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:30:39 +0100 Subject: [PATCH 14/18] add assignment operator for saga input --- .../include/algorithms/optimization_solver/saga/saga_types.h | 1 + cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/cpp/daal/include/algorithms/optimization_solver/saga/saga_types.h b/cpp/daal/include/algorithms/optimization_solver/saga/saga_types.h index da1e7b5f9d4..28a104e4a89 100755 --- a/cpp/daal/include/algorithms/optimization_solver/saga/saga_types.h +++ b/cpp/daal/include/algorithms/optimization_solver/saga/saga_types.h @@ -135,6 +135,7 @@ class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input public: Input(); Input(const Input & other); + Input & operator=(const Input & other); using super::set; using super::get; diff --git a/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp b/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp index 1dd0ca5e165..db8a65bda1b 100644 --- a/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp +++ b/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp @@ -73,6 +73,7 @@ services::Status Parameter::check() const Input::Input() {} Input::Input(const Input & other) {} +Input & Input::operator=(const Input & other) {} data_management::NumericTablePtr Input::get(OptionalDataId id) const { From aa9e0eeb0a8f5de8d967cc0819ef08791481535c Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:36:40 +0100 Subject: [PATCH 15/18] missing return --- .../src/algorithms/optimization_solver/saga/saga_types.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp b/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp index db8a65bda1b..4afb2f02477 100644 --- a/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp +++ b/cpp/daal/src/algorithms/optimization_solver/saga/saga_types.cpp @@ -73,7 +73,10 @@ services::Status Parameter::check() const Input::Input() {} Input::Input(const Input & other) {} -Input & Input::operator=(const Input & other) {} +Input & Input::operator=(const Input & other) +{ + return *this; +} data_management::NumericTablePtr Input::get(OptionalDataId id) const { From 675f109e0b5814357e46c5f5901d53a78a6caf9b Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:37:57 +0100 Subject: [PATCH 16/18] fix wrong signature --- cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp index a7dc1e747d3..54a794ea653 100644 --- a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp @@ -65,7 +65,7 @@ Parameter::Parameter(const Parameter & other) * Assigns a Parameter by copying input objects and parameters of another Parameter * \param[in] other An object to be used as the source object to copy from */ -Parameter & operator=(const Parameter & other); +Parameter & Parameter::operator=(const Parameter & other); { sum_of_functions::Parameter::operator=(other); this->interceptFlag = other.interceptFlag; From 06f67ff114dbabad7be9300d8a8e1ca6a66d87f2 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:41:01 +0100 Subject: [PATCH 17/18] fix incorrect type assignment --- .../algorithms/objective_function/objective_function_types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp b/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp index 407773b2d61..4436621be97 100644 --- a/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/objective_function_types.cpp @@ -44,7 +44,7 @@ Parameter::Parameter(const Parameter & other) : resultsToCompute(other.resultsTo Parameter & Parameter::operator=(const Parameter & other) { - resultsToCompute::operator=(other.resultsToCompute); + this->resultsToCompute = other.resultsToCompute; return *this; } From 9092f6027c467552f44babb029e5e1dabd151a99 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Wed, 22 Jan 2025 10:41:44 +0100 Subject: [PATCH 18/18] remove accidental semicolon --- cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp index 54a794ea653..9db327fccee 100644 --- a/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp +++ b/cpp/daal/src/algorithms/objective_function/mse/mse_types.cpp @@ -65,7 +65,7 @@ Parameter::Parameter(const Parameter & other) * Assigns a Parameter by copying input objects and parameters of another Parameter * \param[in] other An object to be used as the source object to copy from */ -Parameter & Parameter::operator=(const Parameter & other); +Parameter & Parameter::operator=(const Parameter & other) { sum_of_functions::Parameter::operator=(other); this->interceptFlag = other.interceptFlag;