diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2014-01-15 00:35:21 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2014-01-15 00:35:21 +0100 |
| commit | ddbd423f54e2fd92659a0d277ee844659eee8ba1 (patch) | |
| tree | 316a82d463009364a6cdf07892bc3e28330698db /src/msvmmaj_init.c | |
| parent | remove note in read_data (diff) | |
| download | gensvm-ddbd423f54e2fd92659a0d277ee844659eee8ba1.tar.gz gensvm-ddbd423f54e2fd92659a0d277ee844659eee8ba1.zip | |
added documentation, restart git usage, start implementing kernels
Diffstat (limited to 'src/msvmmaj_init.c')
| -rw-r--r-- | src/msvmmaj_init.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/msvmmaj_init.c b/src/msvmmaj_init.c new file mode 100644 index 0000000..14278f9 --- /dev/null +++ b/src/msvmmaj_init.c @@ -0,0 +1,64 @@ +/** + * @file msvmmaj_init.c + * @author Gertjan van den Burg + * @date January 7, 2014 + * @brief Functions for initializing model and data structures + * + * @details + * This file contains functions for initializing a MajModel instance + * and a MajData instance. In addition, default values for these + * structures are defined here (and only here). + * + */ + +#include <math.h> + +#include "msvmmaj.h" +#include "msvmmaj_init.h" + +/** + * @brief Initialize a MajModel structure + * + * @details + * A MajModel structure is initialized and the default value for the + * parameters are set. A pointer to the initialized model is returned. + * + * @returns initialized MajModel + */ +struct MajModel *msvmmaj_init_model() +{ + struct MajModel *model = Malloc(struct MajModel, 1); + + // set default values + model->p = 1.0; + model->lambda = pow(2, -8.0); + model->epsilon = 1e-6; + model->kappa = 0.0; + model->weight_idx = 1; + model->kerneltype = K_LINEAR; + model->use_cholesky = false; + + return model; +} + +/** + * @brief Initialize a MajData structure + * + * @details + * A MajData structure is initialized and default values are set. + * A pointer to the initialized data is returned. + * + * @returns initialized MajData + * + */ +struct MajData *msvmmaj_init_data() +{ + struct MajData *data = Malloc(struct MajData, 1); + + // set default values + data->kerneltype = K_LINEAR; + data->use_cholesky = false; + + return data; +} + |
