EconPapers    
Economics at your fingertips  
 

On the Numerical Efficiency of C++ in Scientific Computing

Erlend Arge (), Are Magnus Bruaset (), Phillip B. Calvin (), Joseph F. Kanney (), Hans Petter Langtangen () and Cass T. Miller ()
Additional contact information
Erlend Arge: SINTEF
Are Magnus Bruaset: SINTEF
Phillip B. Calvin: University of North Carolina, Dept. of Environmental Sciences and Engineering
Joseph F. Kanney: University of North Carolina
Hans Petter Langtangen: University of Oslo, Dept. of Mathematics
Cass T. Miller: University of North Carolina

Chapter 5 in Numerical Methods and Software Tools in Industrial Mathematics, 1997, pp 91-118 from Springer

Abstract: Abstract 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.

Keywords: FORTRAN Code; Dynamic Memory; Numerical Efficiency; Basic Linear Algebra; Memory Segment (search for similar items in EconPapers)
Date: 1997
References: Add references at CitEc
Citations:

There are no downloads for this item, see the EconPapers FAQ for hints about obtaining it.

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:spr:sprchp:978-1-4612-1984-2_5

Ordering information: This item can be ordered from
http://www.springer.com/9781461219842

DOI: 10.1007/978-1-4612-1984-2_5

Access Statistics for this chapter

More chapters in Springer Books from Springer
Bibliographic data for series maintained by Sonal Shukla () and Springer Nature Abstracting and Indexing ().

 
Page updated 2026-07-12
Handle: RePEc:spr:sprchp:978-1-4612-1984-2_5