Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Re: OCaml speed
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Thorsten Ohl <ohl@h...>
Subject: Re: [Caml-list] Re: complex bigarrays
shiv@mac.com writes:

> But most of the LAPACK complex routines do expect to see regular
> FORTRAN COMPLEX arrays

You're right.  I was incorrectly generalizing from DGEEV etc. that
take real arrays as input return (among others) complex vectors.  The
latter are represented as two real array.  Routines that take complex
inputs represent them as COMPLEX arrays.

> So I would vote to represent complex bigarrays using a single array 
> with real and imaginary parts of each element adjacent to each other in 
> that order.

I fully agree.  Even if my generalization had been correct, I would
still have voted for this, because it conforms to the Fortran language
definition.

> I have read (some where) that this might cause problems with some C
> compilers on some machines. That is, if we define struct {float re;
> float im} A[10]; Then the entries in A may not be packed together as
> we might expect.

AFAIK, the C compiler is free to pad structures for better alignment,
resulting in better performance.  Isn't it even free to reorder
elements?
-- 
Thorsten Ohl, Physics Department, TU Darmstadt -- ohl@hep.tu-darmstadt.de
http://heplix.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr