[cl-gsl-cvs] CVS update: cl-gsl/c/cwrapperstub.c
cl-gsl-cvs at common-lisp.net
cl-gsl-cvs at common-lisp.net
Sat Apr 30 22:38:44 UTC 2005
Update of /project/cl-gsl/cvsroot/cl-gsl/c
In directory common-lisp.net:/tmp/cvs-serv4368
Modified Files:
cwrapperstub.c
Log Message:
Added wrappers to read and write permutations from file.
Date: Sun May 1 00:38:43 2005
Author: edenny
Index: cl-gsl/c/cwrapperstub.c
diff -u cl-gsl/c/cwrapperstub.c:1.4 cl-gsl/c/cwrapperstub.c:1.5
--- cl-gsl/c/cwrapperstub.c:1.4 Fri Apr 22 04:41:33 2005
+++ cl-gsl/c/cwrapperstub.c Sun May 1 00:38:43 2005
@@ -817,3 +817,53 @@
return ret;
}
+
+/* ----------------------------------------------------------------- */
+
+int wrap_gsl_permutation_fwrite(char *fn, const gsl_permutation *m)
+{
+ FILE* stream;
+ int ret;
+
+ stream = fopen(fn, "wb");
+ ret = gsl_permutation_fwrite(stream, m);
+ fclose(stream);
+
+ return ret;
+}
+
+int wrap_gsl_permutation_fread(char *fn, gsl_permutation *m)
+{
+ FILE* stream;
+ int ret;
+
+ stream = fopen(fn, "rb");
+ ret = gsl_permutation_fread(stream, m);
+ fclose(stream);
+
+ return ret;
+}
+
+int wrap_gsl_permutation_fprintf(char *fn, const gsl_permutation *m)
+{
+ FILE* stream;
+ int ret;
+
+ stream = fopen(fn, "w");
+ ret = gsl_permutation_fprintf(stream, m, "%d");
+ fclose(stream);
+
+ return ret;
+}
+
+int wrap_gsl_permutation_fscanf(char *fn, gsl_permutation *m)
+{
+ FILE* stream;
+ int ret;
+
+ stream = fopen(fn, "r");
+ ret = gsl_permutation_fscanf(stream, m);
+ fclose(stream);
+
+ return ret;
+}
More information about the Cl-gsl-cvs
mailing list