aboutsummaryrefslogtreecommitdiff
path: root/src/gensvm_task.c
diff options
context:
space:
mode:
authorGertjan van den Burg <burg@ese.eur.nl>2016-11-03 15:55:03 +0100
committerGertjan van den Burg <burg@ese.eur.nl>2016-11-03 15:55:03 +0100
commitc3edde20d385614f0016b74e03575344b7c5081a (patch)
tree314d386874ea60dccf8e111fa856bac06c9f656a /src/gensvm_task.c
parentupdate copyright information (diff)
downloadgensvm-c3edde20d385614f0016b74e03575344b7c5081a.tar.gz
gensvm-c3edde20d385614f0016b74e03575344b7c5081a.zip
prepare for gridsearch unit testing
Diffstat (limited to 'src/gensvm_task.c')
-rw-r--r--src/gensvm_task.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gensvm_task.c b/src/gensvm_task.c
index 986bee4..2de0280 100644
--- a/src/gensvm_task.c
+++ b/src/gensvm_task.c
@@ -72,3 +72,27 @@ void gensvm_free_task(struct GenTask *t)
free(t);
t = NULL;
}
+
+/**
+ * @brief Copy parameters from GenTask to GenModel
+ *
+ * @details
+ * A GenTask struct only contains the parameters of the GenModel to be estimated.
+ * This function is used to copy these parameters.
+ *
+ * @param[in] task GenTask instance with parameters
+ * @param[in,out] model GenModel to which the parameters are copied
+ */
+void gensvm_task_to_model(struct GenTask *task, struct GenModel *model)
+{
+ // copy basic model parameters
+ model->weight_idx = task->weight_idx;
+ model->epsilon = task->epsilon;
+ model->p = task->p;
+ model->kappa = task->kappa;
+ model->lambda = task->lambda;
+
+ // copy kernel parameters
+ model->kerneltype = task->kerneltype;
+ model->kernelparam = task->kernelparam;
+}