[Top][All Lists]

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

[Help-gsl] Storing matrices on disk w/ gsl_matrix_complex_fwrite and gsl

From: Matthias Sitte
Subject: [Help-gsl] Storing matrices on disk w/ gsl_matrix_complex_fwrite and gsl_matrix_complex_fread
Date: Thu, 13 Oct 2011 11:19:01 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110831 Thunderbird/3.1.13


while writing a program that uses exact diagonalization techniques I've
encountered a strange problem with gsl_matrix_complex_fwrite() and its
counterpart gsl_matrix_complex_fread(). Somehow the data is not stored
correctly on the disk...

So, here's a short overview of the program:

1) Create a complex Hermitian matrix.
2) Diagonalize this matrix.
3) Store the eigensystem on the disk, using separate files for the
eigenvectors and eigenvalues.

In later steps I'll use the eigensystem to transform other complex
matrices. Actually, there's quite a number of matrices, and the
dimensions of the matrices can be of the order of 8000 by 8000. Because
I cannot keep all of those matrices in memory, I want to store them on
the disk temporarily.

However, using the appropriate fwrite() and fread() methods is quite an
issue, so it seems. After writing the matrix of eigenvectors to the disk
and reloading them immediately afterwards, the matrix is useless,
because rows are somehow missing then.

I've written a small program that should demonstrate my problem. I
kindly ask you to run this program and verify/falsify my observation
that the matrix of eigenvectors before writing to and after reading from
the disk differ. If you find any other GSL-related errors in my code,
I'd be happy to know about them as well!



Description: application/shellscript

Attachment: test2.c
Description: Text Data

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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