diff options
| author | Gertjan van den Burg <burg@ese.eur.nl> | 2016-09-30 20:27:26 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <burg@ese.eur.nl> | 2016-09-30 20:27:26 +0200 |
| commit | 7eb19c47c07c5187ada0a79db7addde1b5f62572 (patch) | |
| tree | fe9e6b73f4f375839bdfcd8eb314246897337ba5 /src/gensvm_base.c | |
| parent | Remove category matrix from implementation (diff) | |
| download | gensvm-7eb19c47c07c5187ada0a79db7addde1b5f62572.tar.gz gensvm-7eb19c47c07c5187ada0a79db7addde1b5f62572.zip | |
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
Diffstat (limited to 'src/gensvm_base.c')
| -rw-r--r-- | src/gensvm_base.c | 5 |
1 files changed, 1 insertions, 4 deletions
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); |
