Shot in the dark: Anyone ever use CLAPACK routines?
Jerry Feldman
gaf at blu.org
Sun May 23 07:20:13 EDT 2010
On 05/22/2010 12:22 PM, Bruce Labitt wrote:
> Because in C the array (matrix) does not have
> to be contiguous in memory.
This can be true. First, a struct must be aligned on a natural boundary,
which is usually a 64-bit boundary. In your case doublecomplex. Since
doubles are also 64-bit the doublecomplex struct array should line up
with no fillers. One way to test this would be to define a double complex:
doublecomplex a[9][9];
The sizeof a should be 1296 if I did my arithmetic. I just tested this
with g++, and it came out to 1296. If I recall correctly, you specified
row-major in the first 2 parameters to the function. But, using malloc
(A = malloc( LDA*N*sizeof(double) );) has another advantage in that you
are allocating the array on the heap and not the stack. If I recall, you
allocated 3 matricies on the stack. I forget what the default stack size
in, but it is possible that your original problem could be stack
overflow situation.
Actually, shouldn't A = malloc( LDA*N*sizeof(double) ) be A = malloc(
LDA*N*sizeof(doublecomplex) );
--
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB CA3B 4607 4319 537C 5846
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20100523/4b7b980a/attachment.bin
More information about the gnhlug-discuss
mailing list