bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] gsl_matrix_fread


From: Annett Keller
Subject: [Bug-gsl] gsl_matrix_fread
Date: Tue, 22 Apr 2003 12:48:00 +0200 (MEST)

Hi,

I tried to use gsl_matrix_fread() to read in a matrix but failed as soon as
I did not use the example program given in the manual.

My working enviroment is: PC, Windows 2000 Professional, Visual C++ 6.0, in
addition to the default settings of the program I activated the 'Disabled
Language Extensions' and  switched to 'Multithresded DLL' (I do need this
enviroment for the rest of my program). 

I do get the following error message:

"gsl: C:\Windows\Desktop\gsl-1.3\block\fwrite_source.c:64: ERROR: fread
failed
Default GSL error handler invoked.

abnormal program termination"

the test programm looks as follows:
#include <stdio.h>
#include <gsl/gsl_matrix.h>

void main()
{
        gsl_matrix *mat = gsl_matrix_alloc(10,10);
        int i,j;
        FILE *f = fopen("readin.bin","w");

        for (i=0;i<10;i++)
        {
                for (j=0;j<10;j++)
                {
                        double tmp = (5*i+7.8*j)/10.0;
                        gsl_matrix_set(mat,i,j,tmp);
                }
        }
        gsl_matrix_fwrite(f,mat);
        fclose(f);

        {
                f = fopen("readin.bin","r");
                gsl_matrix_fread(f,mat);
                fclose(f);
        }
        gsl_matrix_fprintf(stderr,mat,"%.4f");
        printf("\n");
        gsl_matrix_free(mat);

        return;
}

Thanks a lot.
Annett

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte l├Ącheln! Fotogalerie online mit GMX ohne eigene Homepage!





reply via email to

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