projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: Better describe the meaning of THRU in the RECODE command.
[pspp]
/
src
/
math
/
linreg.c
diff --git
a/src/math/linreg.c
b/src/math/linreg.c
index 90c62a5258640fdfb9a1eeb8b29bd4164ba77d29..47d21cf8f5fdfed7f357f96f45038493374b6aab 100644
(file)
--- a/
src/math/linreg.c
+++ b/
src/math/linreg.c
@@
-107,23
+107,29
@@
linreg_alloc (const struct variable *depvar, const struct variable **indep_vars,
c->pred = NULL;
c->resid = NULL;
c->pred = NULL;
c->resid = NULL;
+ c->refcnt = 1;
return c;
}
return c;
}
-bool
-linreg_free (void *m)
+void
+linreg_ref (linreg *c)
+{
+ c->refcnt++;
+}
+
+void
+linreg_unref (linreg *c)
{
{
- linreg *c = m;
- if (c != NULL)
+ if (c && --c->refcnt == 0)
{
gsl_vector_free (c->indep_means);
gsl_vector_free (c->indep_std);
{
gsl_vector_free (c->indep_means);
gsl_vector_free (c->indep_std);
+ gsl_vector_free (c->ss_indeps);
gsl_matrix_free (c->cov);
free (c->indep_vars);
free (c->coeff);
free (c);
}
gsl_matrix_free (c->cov);
free (c->indep_vars);
free (c->coeff);
free (c);
}
- return true;
}
static void
}
static void