[Beowulf] Threaded code (& Fortran)

Robert G. Brown rgb at phy.duke.edu
Wed Aug 18 10:25:29 PDT 2004


On Wed, 18 Aug 2004, Jeff Layton wrote:

> But Bob, you're a physicist. Fortran is based on real mathematics, unlike C.
> Only recently did C get a complex data type. Imagine math, physics, and
> everything else without complex numbers (ask Arthur Anderson about complex
> numbers in accounting). :)

Oh, NOW you're gonna be sorry.  Real Physicists don't mess with complex
numbers per se any more -- complex numbers are just one of the lowest
rank examples of a geometric algebra, where higher order examples are
generalizations of quaternions and other what used to be called clifford
algebras until clifford algebra was redone correctly as geometric
algebra.  And fortran doesn't know anything about quaternions or
geometric algebras (beyond complex types).

C, on the other hand, lets me trivially define algebraic entities such
as:

typedef struct {

  double r;
  double i;

} Complex;

or

typedef struct {

  double q0;
  double q1;
  double q2;
  double q3;

} Quaternion;

or entities that are Nth rank tensors, including ones that are not
rectangular and do not have indices that run from 1 to N.

C++ afficionados would doubtless chime in at this point that their
favorite language provides maximal structured support for this sort of
game, since one gets constructors, destructors, and methods, and in
methods one can define e.g. a multiplication or division operation (note
that we are talking about creating division algebras here -- ones where
the concepts of factorization and decomposition make sense:-).  C lovers
such as myself would then say fooey on you, can do in C too, and we'd
get into the usual...

No, fortran has a single real advantage over C.  It has a binary
exponentiation operator.  I've never forgiven the C mavins for not
implementing something like x**y, even though yes I understand why
pow(x,y) is a library call and better that way.

> Just ribbing you... :)

Oh, you'll regret this, yes you will.  Fortran based on "real
mathematics", harruummph.  Right, and in real mathematics ALL physical
quanties that begin with the letters I through N are integers, right?
And equations, they are ALWAYS written only in between columns 7 and
72...in capital letters.  I keep forgetting.

I've written a few boxes full of genuine punch cards filled with Fortran
(Fortran IV, yet) in my day and it isn't clear to me that I'd touch it
again even if you DID back up a small truck and snatch Buttercup from my
driveway (she's a wee bit overweight, bring a hoist).

  rgb

-- 
Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb at phy.duke.edu






More information about the Beowulf mailing list