Re: C++ for combinatorial optimization problems

From: Dietmar Kuehl (dietmar_kuehl_at_yahoo.com)
Date: 09/16/04


Date: 16 Sep 2004 07:13:44 -0700

beliavsky@aol.com wrote:
> I think C and C++ are not well suited to problems involving
> multidimensional arrays, which are most of the problems I deal with.

Why not? I haven't done any stuff relating to matrix stuff myself
but my understanding is that libraries like Blitz++ are quite
effective.

> IMSL and NAG have Fortran 77, Fortran 90, and C libraries, but not
C++
> libraries AFAIK.

There can be many reasons for this. For example, it is quite likely
that these people program in Fortran since ages and are essentially
ignorant of C++. ...and I would guess that their C library is actually
just a header providing access to their Fortran library.

> They expect C++ programmers to call their C
> libraries. Do IMSL and NAG only implement "trivial" algorithms?

This is not what I claimed. Actually, you can probably implement
arbitrary algorithms in all Turing-complete programming languages. The
question is how much support you get and how easy the algorithms are
to use. I claim that the support you get from C++ is better suited for
non-trivial algorithms than the support you get from languages like
Fortrand and/or C (for trivial algorithms like searching an entry in
an array, support in most languages is sufficient).

> The Numerical Recipes C++ library is not that different from the C
> version.

Which would be an indication that the author of "Numerical Recipes C++"
is also ignorant of C++. I can't tell for this specific book but I can
tell for Sedgewick's "Algorithms in C++" (at least earlier editions: I
buoght this book around 1992 and was happy to get rid of it...) that a
better suited name would have been "Algorithms originally written in
Pascal than converted to compile with C and then converted to use C++
classes". That is, just because someone claims to use C++ doesn't mean
he indeed uses C++. There is the old saying "Real programmers program
Fortran in any language".

--
<mailto:dietmar_kuehl@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting


Relevant Pages

  • Re: List of software programs written in fortran (for engineers and scientists)
    ... were written originally in languages other than Fortran. ... Do you think, for instance, that the early algorithms that appeared ... changing any character handling, and the like. ...
    (comp.lang.fortran)
  • Re: OT: Different types of counting in loops
    ... In fortran you have: for 10 i=1,5 ... Why do all these languages do this in a different way? ... included a reasonable degree of support for the 0 based array alternative, ...
    (comp.lang.fortran)
  • Re: OT: Different types of counting in loops
    ... In fortran you have: for 10 i=1,5 ... Why have most of todays languages adopted counting/indexing from 0, ... Algol had more influence on C and Pascal ... Support the Original G95 Project: http://www.g95.org ...
    (comp.lang.fortran)
  • Re: C++ for combinatorial optimization problems
    ... Will other languages be able to ... > for effective support of non-trivial algorithms. ... IMSL and NAG have Fortran 77, Fortran 90, and C libraries, but not C++ ...
    (comp.lang.cpp)
  • Re: Fortran 2008 (was Re: New style DO syntax?)
    ... I was exaggerating of course, I don't really hate all those things I listed, I just prefer the style that much of the newer features promote. ... But I've never been a fan of ad-hoc "design" for things that I'm forced to use a lot like languages and operating systems. ... However, since it was in a separate, dedicated process, it was inherently asynchronous with the main calling process so we could have used Fortran write statements with no change in design or performance. ... Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html ...
    (comp.lang.fortran)