From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA19265; Thu, 8 Nov 2001 16:35:59 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA18914 for ; Thu, 8 Nov 2001 16:35:58 +0100 (MET) Received: from heplix4.ikp.physik.tu-darmstadt.de (heplix4.ikp.physik.tu-darmstadt.de [130.83.210.158]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id fA8FZqX25358; Thu, 8 Nov 2001 16:35:53 +0100 (MET) Received: (from ohl@localhost) by heplix4.ikp.physik.tu-darmstadt.de (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id fA8FZqi16565; Thu, 8 Nov 2001 16:35:52 +0100 From: Thorsten Ohl MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15338.42584.498751.200158@heplix4.ikp.physik.tu-darmstadt.de> Date: Thu, 8 Nov 2001 16:35:52 +0100 To: caml-list@inria.fr Cc: Xavier Leroy Subject: Re: [Caml-list] Re: complex bigarrays In-Reply-To: <20011108102833.A9260@pauillac.inria.fr> References: <3BE7C3FF.29312.161FE94D@localhost> <20011108102833.A9260@pauillac.inria.fr> X-Mailer: VM 6.84 under Emacs 20.7.1 Reply-To: ohl@hep.tu-darmstadt.de Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Xavier Leroy writes: > while in Fortran some codes use the C representation (one array of > pairs) while others use a pair of arrays. >>From section 4.3.1.3 of the Fortran standard: The values a complex type are ordered pairs of real values. The first real value is called the real second real value is called the imaginary part. and from section 14.6.3.1 of the Fortran standard: (1) A nonpointer scalar object of type default integer, default real, or default logic occupies a single numeric storage unit; (2) A nonpointer scalar object of type double precision real or default complex occupies two contiguous numeric storage units; If you declare COMPLEX C(2) it is layed out as Re[C(1)] Im[C(1)] Re[C(2)] Im[C(2)] Fortran compilers have no freedom here, because they must support EQUIVALENCE and COMMON aliasing. OTOH, there are many numerical libraries (e.g. LAPACK) that explicitely declare two REAL arrays and use the entries as real and imaginary parts. However, this is a library choice and sidesteps Fortran's COMPLEX type altogether. -- 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