From 5d90bf31bed30885b00efe62a2758d22c57e7206 Mon Sep 17 00:00:00 2001 From: Andru Liu <90433630+WallabyLester@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:10:45 -0700 Subject: [PATCH] Implemented weight setter. --- CPP_Implementation/rbf_model.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CPP_Implementation/rbf_model.cpp b/CPP_Implementation/rbf_model.cpp index a1b6782..8c7c27c 100644 --- a/CPP_Implementation/rbf_model.cpp +++ b/CPP_Implementation/rbf_model.cpp @@ -81,3 +81,10 @@ double RBFModel::get_weight(int index) const { return weights[index]; } +/** + * @brief Set the weight at a specific index. + */ +void RBFModel::set_weight(int index, double value) { + if (index < 0 || index >= numCenters) return; + weights[index] = value; +}