From 47b5cab33083557a52ffea167742db1c9877cf20 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 2 Jul 2014 13:21:20 +0200 Subject: moved realloc around, fix for kernels in trainmsvmmaj and fix memory leak consistency repeats --- src/trainMSVMMaj.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/trainMSVMMaj.c') diff --git a/src/trainMSVMMaj.c b/src/trainMSVMMaj.c index 66f6450..af07fe7 100644 --- a/src/trainMSVMMaj.c +++ b/src/trainMSVMMaj.c @@ -95,12 +95,15 @@ int main(int argc, char **argv) model->m = data->m; model->K = data->K; model->data_file = input_filename; - + + // allocate model + msvmmaj_allocate_model(model); + // initialize kernel (if necessary) msvmmaj_make_kernel(model, data); - // allocate model and initialize weights - msvmmaj_allocate_model(model); + // reallocate model and initialize weights + msvmmaj_reallocate_model(model, data->n, data->m); msvmmaj_initialize_weights(data, model); // seed the random number generator (only place in programs is in -- cgit v1.2.3