[J3] [BULK] Re: [EXTERNAL] Complex pointer to real array and vice-versa

Van Snyder van.snyder at sbcglobal.net
Thu Apr 25 22:58:35 UTC 2024


On Thu, 2024-04-25 at 16:01 +0000, Clune, Thomas L. (GSFC-6101) via J3
wrote:
> Fair enough.   Looks like the text is from an era before we required
> a matching COMPLEX for each real kind.   And even then, I’m not 100%
> certain that the standard disallows a complex representation in terms
>  of modulus and phase.    Strongly implied though as `x.im = <expr>`
> would have interesting implementation consequences that way.

The "interesting implementation consequences" are exactly why I
proposed a function-like syntax for component denotation in 1986 when
the percent sign was still a place-holder instead of cast in concrete
-- and updaters. I no longer have my letters to X3J3 about this --
Loren Meissner has "curated" them at the Computer History Museum.

If one had developed a "my copmplex type represented by modulus and
phase" then one could write an IMAG function and IMAG updater that
would look exactly like the intrinsic ones (actually intrinsic ONE
because the standard never defined an intrinsic IMAG updater -- yeah,
we have the x%im reference now, but users can't redefine it by way of
functions and updaters). You could also write MODULUS (or CABS) and
PHASE (probably not called ATAN) functions and updaters, that would be
expensive for the intrinsic representation and cheap for your
representation.

If your profiler had told you that your application was taking more
time computing modulus and phase for (some of your) complex numbers
rather than examining or updating the real and imaginary parts, you
could change only the type of the relevant objects IN ONE PLACE, not
the sytax to use them EVERYWHERE. David Parnas wrote about this in
1970, but we refused to listen. Geschke and Mitchell, and Donald T.
Ross, had written about it a few years earlier.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20240425/6b70f272/attachment.htm>


More information about the J3 mailing list