Publications Details

Publications / Conference

C++ as a language for object-oriented numerics

Budge, Kent G.

C++ is commonly described as an object-oriented programming language because of its strong support for classes with multiple inheritance and polymorphism. However, for a growing community of numerical programmers, an equally important feature of C++ is its support of operator overloading on abstract data types. The authors choose to call the resulting style of programming object-oriented numerics. They believe that much of object-oriented numerics is orthogonal to conventional object-oriented programming. As a case study, they discuss two strong shock physics codes written in C++ that they're currently developing. These codes use both polymorphic classes (typical of traditional object-oriented programming) and abstract data types with overloaded operators (typical of object-oriented numerics). They believe that C++ translators can generate efficient code for many numerical objects. However, for the important case of smart arrays (which are used to represent matrices and the fields found in partial differential equations) fundamental difficulties remain. The authors discuss the two most important of these, namely, the aliasing ambiguity and the proliferation of temporaries, and present some possible solutions.