Re: Request for comment: follow-up to Summer of Code
- From: David Golden <david.golden@xxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 00:45:06 +0100
beliavsky@xxxxxxx wrote:
> In my earlier message I compared Fortran to C, not C++. I think the
> functionality of Fortran's multidimensional arrays (elemental
> functions, array slices) is more extensive than that of C++, whose
> arrays have the same properties as those of C.
People masochistic enough to work by choice in C++ would usually use
the Boost or Blitz++ multidim arrays, which both make extensive
use of templates and operator overloading to embed multidim-array
little languages into C++:
Boost:
http://www.boost.org/libs/multi_array/doc/user.html
Blitz++:
http://www.oonumerics.org/blitz/manual/blitz02.html#l30
>From Blitz++ example:
#include <blitz/array.h>
using namespace blitz;
int main()
{
Array<float,2> A(3,3), B(3,3), C(3,3);
A = 1, 0, 0,
2, 2, 2,
1, 0, 0;
B = 0, 0, 7,
0, 8, 0,
9, 9, 9;
C = A + B;
cout << "A = " << A << endl
<< "B = " << B << endl
<< "C = " << C << endl;
return 0;
}
As you can see, a bit of a step up from C arrays. I know many C++
programmers don't consider C++ a complete language without Boost.
Fortran 90 or above is still a nicer choice IMHO, really, it makes for
clearer code (to the countless scientists and engineers who know and
"love" fortran) and still integrates better with the vast corpus of
fortran numerics libraries built up over the past decades, but anyway.
.
- References:
- Request for comment: follow-up to Summer of Code
- From: matthewknox
- Re: Request for comment: follow-up to Summer of Code
- From: beliavsky
- Re: Request for comment: follow-up to Summer of Code
- From: Eric Lavigne
- Re: Request for comment: follow-up to Summer of Code
- From: beliavsky
- Request for comment: follow-up to Summer of Code
- Prev by Date: Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
- Next by Date: Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
- Previous by thread: Re: Request for comment: follow-up to Summer of Code
- Next by thread: Re: Request for comment: follow-up to Summer of Code
- Index(es):
Relevant Pages
|