caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Thorsten Ohl <ohl@hep.tu-darmstadt.de>
To: caml-list@inria.fr, shiv@mac.com
Subject: Re: [Caml-list] Re: complex bigarrays
Date: Thu, 8 Nov 2001 18:56:09 +0100	[thread overview]
Message-ID: <15338.51001.121416.677202@heplix4.ikp.physik.tu-darmstadt.de> (raw)
In-Reply-To: <81DA66D2-D46E-11D5-82F9-003065BDAA76@mac.com>

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


  parent reply	other threads:[~2001-11-08 17:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-06  9:05 [Caml-list] Re: OCaml speed Rolf Wester
2001-11-06 10:44 ` Markus Mottl
2001-11-08  9:28 ` [Caml-list] Re: complex bigarrays Xavier Leroy
2001-11-08 14:59   ` Rolf Wester
2001-11-08 15:35   ` Thorsten Ohl
     [not found]     ` <81DA66D2-D46E-11D5-82F9-003065BDAA76@mac.com>
2001-11-08 17:56       ` Thorsten Ohl [this message]
2001-11-08 18:12         ` Joerg Czeranski
2001-11-08 18:20         ` Ken Rose
2001-11-08 18:35         ` David McClain
2001-11-08 23:13 David Gurr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15338.51001.121416.677202@heplix4.ikp.physik.tu-darmstadt.de \
    --to=ohl@hep.tu-darmstadt.de \
    --cc=caml-list@inria.fr \
    --cc=shiv@mac.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).