home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!agate!overload.lbl.gov!lll-winken!sundance!moonshine!jac
- From: jac@moonshine.llnl.gov (James A. Crotinger)
- Newsgroups: comp.lang.c++
- Subject: Re: Que: Double-Precision Complex Arrays
- Message-ID: <jac.714099380@moonshine>
- Date: 18 Aug 92 00:56:20 GMT
- References: <92230.141240K3006E7@ALIJKU11.BITNET>
- Sender: news@sundance.llnl.gov (News Administrator)
- Organization: Magnetic Fusion Energy - LLNL
- Lines: 34
-
- K3006E7@ALIJKU11.BITNET writes:
-
- > How does one declare a complex array?
- > static complex array_name[2][2];
- > doesn't work, for example.
-
- I think the problem is that the AT&T complex class doesn't
- have a complex::complex() constructor. Rather, I think it has
- complex::complex(float re=0.0, float im=0.0), and in some older
- implementations, this latter constructor could not be used in
- the construction of arrays. Although it is a hack, I think you
- can fix the problem by editing <complex.h> and adding an inline
- complex::complex() constructor which simply initializes the
- members to zero.
-
- BTW, a better solution is to write a ComplexMatrix class (or
- Matrix<complex> if you have templates). C "Arrays" suck.
-
- > 2) How does one declare double precision complex numbers? And
- > double precision complex arrays? Does one have to fiddle with
- > the complex.h file itself in order to get double precision?
-
- The Sun C++ (AT&T CFRONT) complex.h is based on "double". If yours
- isn't, fixing things will be more complex 8-) than just modifying
- complex.h.
-
-
- Jim
-
- --
- -------------------------------------------------/\--------------------------
- James A. Crotinger Lawrence Livermore N'Lab // \ The above views are mine
- jac@moonshine.llnl.gov P.O. Box 808; L-630 \\ //---\ and are not neces-
- (510) 422-0259 Livermore CA 94550 \\/Amiga\ sarily those of LLNL.
-