Skip to main content

1997 | OriginalPaper | Buchkapitel

On the Numerical Efficiency of C++ in Scientific Computing

verfasst von : Erlend Arge, Are Magnus Bruaset, Phillip B. Calvin, Joseph F. Kanney, Hans Petter Langtangen, Cass T. Miller

Erschienen in: Numerical Methods and Software Tools in Industrial Mathematics

Verlag: Birkhäuser Boston

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

We investigate the relative efficiency of C++ and C code versus FORTRAN 77 code through numerical experiments conducted on a range of computer platforms. The problem areas cover basic linear algebra and finite element solution of porous media fluid flow and species transport problems. The C++ codes are short and make extensive use of Diffpack, a generic library based on object-oriented programming techniques, while the FORTRAN and C programs are either based on vendor supplied numerical libraries or written and tuned particularly for the test problem. Challenges encountered in optimizing C++ codes and the efficiency of dynamic memory handling in C++ are also addressed.Differences in computational efficiency observed for the problem areas studied were small, and tended to be problem dependent. Based on our experience with optimizing C++ code, we conclude that the use of object-oriented techniques should be confined to high-level administrative tasks, while CPU intensive numerics should be implemented using low-level C code and carefully constructed for-loops.

Metadaten
Titel
On the Numerical Efficiency of C++ in Scientific Computing
verfasst von
Erlend Arge
Are Magnus Bruaset
Phillip B. Calvin
Joseph F. Kanney
Hans Petter Langtangen
Cass T. Miller
Copyright-Jahr
1997
Verlag
Birkhäuser Boston
DOI
https://doi.org/10.1007/978-1-4612-1984-2_5