projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7e20fcd
)
allocate space to store independent variable list
fc11-i386-build86
fc11-x64-build83
lenny-x64-build101
sid-i386-build153
author
Jason H Stover
<jhs@franz.gcsu.edu>
Sat, 30 Jan 2010 04:15:07 +0000
(23:15 -0500)
committer
Jason H Stover
<jhs@franz.gcsu.edu>
Sat, 30 Jan 2010 04:15:07 +0000
(23:15 -0500)
src/math/linreg.c
patch
|
blob
|
history
diff --git
a/src/math/linreg.c
b/src/math/linreg.c
index bb4de0c21c57a08faaf46e76022d52485c8f800f..c5ecf5ac9495ba10ccd7fa3bc1372a93224cf71c 100644
(file)
--- a/
src/math/linreg.c
+++ b/
src/math/linreg.c
@@
-70,10
+70,15
@@
linreg_alloc (const struct variable *depvar, const struct variable **indep_vars,
double n, size_t p)
{
linreg *c;
double n, size_t p)
{
linreg *c;
+ size_t i;
c = xmalloc (sizeof (linreg));
c->depvar = depvar;
c = xmalloc (sizeof (linreg));
c->depvar = depvar;
- c->indep_vars = indep_vars;
+ c->indep_vars = xnmalloc (p, sizeof (*indep_vars));
+ for (i = 0; i < p; i++)
+ {
+ c->indep_vars[i] = indep_vars[i];
+ }
c->indep_means = gsl_vector_alloc (p);
c->indep_std = gsl_vector_alloc (p);
c->ssx = gsl_vector_alloc (p); /* Sums of squares for the
c->indep_means = gsl_vector_alloc (p);
c->indep_std = gsl_vector_alloc (p);
c->ssx = gsl_vector_alloc (p); /* Sums of squares for the
@@
-111,6
+116,7
@@
linreg_free (void *m)
gsl_vector_free (c->indep_std);
gsl_matrix_free (c->cov);
gsl_vector_free (c->ssx);
gsl_vector_free (c->indep_std);
gsl_matrix_free (c->cov);
gsl_vector_free (c->ssx);
+ free (c->indep_vars);
free (c->coeff);
free (c);
}
free (c->coeff);
free (c);
}