From 7188782620158110414
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8f99fb45cc0aac84
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-11-29 10:16:01 PST
Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Scott Robert Ladd" <scott@coyotegulch.com>
Newsgroups: comp.std.c++
Subject: Re: Some Thoughts on Numerical C++
Date: Thu, 29 Nov 2001 18:15:02 GMT
Organization: RoadRunner - TampaBay
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <fRuN7.135809$Yb.36257319@typhoon.tampabay.rr.com>
References: <VbNM7.147814$zK1.40388237@typhoon.tampabay.rr.com> <flelmhergk.fsf@riz.cmla.ens-cachan.fr>
X-Trace: mail2news.demon.co.uk 1007057709 mail2news:21668 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Date: Thu, 29 Nov 2001 13:09:15 EST
Lines: 43
Xref: archiver1.google.com comp.std.c++:8368

"Gabriel Dos Reis" <dosreis@cmla.ens-cachan.fr> wrote
> Could you point me to a normative text in the standard that say that
> you can mix Fortran and C++ code?

I'm not quite sure what you're driving at here. Why would Standard C++ say
anything about Fortran? I'm talking about the ease of linking Fortran and
C++ object code into a single application, something that is generally easy
to do on most platforms. This allows critical numerical code to be written
in Fortran and housekeeping code to be developed in C++. But I don't see why
Standard C++ would say anything about Fortran, any more than it needs to
talk about assembler language...

> Concretely, what does that mean to take "an object-oriented approach
> to numerical programming"?

A simple example: C99 and Fortran implement complex numbers as intrinsic
(POD) types; C++ uses a class template. The C++ approach is likely a bit
less efficient but more extensible and flexible.

I use my own real<> template in some of my work, which takes a template
argument defining the underlying type. For no practical cost in efficiency,
I gain the ability to switch between single and double precision (or
fixed-point, or BCD, or whatever) by changing a template argument. This is
similar to Fortran's "kind" capability.

C99 uses a function library to control precision, exception-handling, and
other characteristics of the floating-point system. I'd like to see
something like a "floating point model" class that encapsulates the complete
state of FP calculation.

--
Scott Robert Ladd
Master of Complexity, Destroyer of Order and Chaos
  Visit CoyoteGulch at http://www.coyotegulch.com
    No ads -- just info, algorithms, and very free code.


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



