pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src regression.q


From: Jason H Stover
Subject: [Pspp-cvs] pspp/src regression.q
Date: Fri, 16 Dec 2005 17:00:07 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Branch:         
Changes by:     Jason H Stover <address@hidden> 05/12/16 17:00:07

Modified files:
        src            : regression.q 

Log message:
        Fixed exported C syntax

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/regression.q.diff?tr1=1.21&tr2=1.22&r1=text&r2=text

Patches:
Index: pspp/src/regression.q
diff -u pspp/src/regression.q:1.21 pspp/src/regression.q:1.22
--- pspp/src/regression.q:1.21  Fri Dec 16 01:13:31 2005
+++ pspp/src/regression.q       Fri Dec 16 17:00:07 2005
@@ -485,14 +485,14 @@
       assert (fp != NULL);
       fp = fopen (handle_get_filename (model_file), "w");
       fprintf (fp, "#include <string.h>\n\n");
-      fprintf (fp, "double\npspp_reg_estimate (const double *var_vals, const 
char *[] var_names)\n{\n\tchar *model_depvars[%d] = {", c->n_indeps);
+      fprintf (fp, "double\npspp_reg_estimate (const double *var_vals, const 
char *var_names[])\n{\n\tchar *model_depvars[%d] = {", c->n_indeps);
       for (i = 1; i < c->n_indeps; i++)
        {
          coeff = c->coeff[i];
-         fprintf (fp, "%s,\n\t\t", coeff.v->name);
+         fprintf (fp, "\"%s\",\n\t\t", coeff.v->name);
        }
       coeff = c->coeff[i];
-      fprintf (fp, "%s};\n\t", coeff.v->name);
+      fprintf (fp, "\"%s\"};\n\t", coeff.v->name);
       fprintf (fp, "double model_coeffs[%d] = {", c->n_indeps);
       for (i = 1; i < c->n_indeps; i++)
        {
@@ -502,11 +502,11 @@
       coeff = c->coeff[i];
       fprintf (fp, "%.15e};\n\t", coeff.estimate);
       coeff = c->coeff[0];
-      fprintf (fp, "double estimate = %.15e\n\t", coeff.estimate);
+      fprintf (fp, "double estimate = %.15e;\n\t", coeff.estimate);
       fprintf (fp, "int i;\n\tint j;\n\n\t");
       fprintf (fp, "for (i = 0; i < %d; i++)\n\t", c->n_indeps);
       fprintf (fp, "{\n\t\tfor (j = 0; j < %d; j++)\n\t\t", c->n_indeps);
-      fprintf (fp, "{\n\t\t\tif (strcmp (var_names[i], model_names[j]) == 
0)\n");
+      fprintf (fp, "{\n\t\t\tif (strcmp (var_names[i], model_depvars[j]) == 
0)\n");
       fprintf (fp, "\t\t\t{\n\t\t\t\testimate += var_vals[i] * 
model_coeffs[j];\n");
       fprintf (fp, "\t\t\t}\n\t\t}\n\t}\n\treturn estimate;\n}\n");
       fclose (fp);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]