The Design of C++ Classes for Scientific Computing
We consider the design of C++ classes for abstract data types that are useful in scientific computing, such as vectors and matrices that appear and disappear dynamically, have varying sizes, may be sparse, and that respond to the natural arithmetic operators. These classes should be memory-safe, in the sense that all dynamically allocated memory is automatically released when no longer needed, and copy-efficient in the sense that no data should be unnecessarily copied when objects are passed to or from functions and operators. A framework for designing such classes is developed. We introduce as a simple example the case of a dynamic array of numbers. We then expand this framework to more general container classes, exemplified by a dynamic array with elements of any type by use of a template. The design of C++ and possible extensions to the language are discussed informally along the way.
Authors: | Nielsen, Soren |
---|---|
Institutions: | Society for Computational Economics - SCE |
Saved in:
freely available
Saved in favorites
Similar items by person
-
DeLarosiere, Jose J. Haspa, (2017)
-
Public Policy for Venture Capital
Keuschnigg, Christian, (2001)
-
On the Phenomenon of Vacant Land.
Keuschnigg, Christian, (1996)
- More ...