From 7eb19c47c07c5187ada0a79db7addde1b5f62572 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 30 Sep 2016 20:27:26 +0200 Subject: Rewrite UU matrix to be K*K*(K-1) instead of n*K*(K-1) significant memory reduction by turning the 3D UU matrix into a 2D block matrix, with significantly less dimensions --- src/gensvm_base.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/gensvm_base.c') diff --git a/src/gensvm_base.c b/src/gensvm_base.c index 2c30530..c77e704 100644 --- a/src/gensvm_base.c +++ b/src/gensvm_base.c @@ -119,7 +119,7 @@ void gensvm_allocate_model(struct GenModel *model) model->V = Calloc(double, (m+1)*(K-1)); model->Vbar = Calloc(double, (m+1)*(K-1)); model->U = Calloc(double, K*(K-1)); - model->UU = Calloc(double, n*K*(K-1)); + model->UU = Calloc(double, K*K*(K-1)); model->Q = Calloc(double, n*K); model->H = Calloc(double, n*K); model->rho = Calloc(double, n); @@ -145,9 +145,6 @@ void gensvm_reallocate_model(struct GenModel *model, long n, long m) if (model->n == n && model->m == m) return; if (model->n != n) { - model->UU = Realloc(model->UU, double, n*K*(K-1)); - Memset(model->UU, double, n*K*(K-1)); - model->Q = Realloc(model->Q, double, n*K); Memset(model->Q, double, n*K); -- cgit v1.2.3