number, which certainly is a possibility. To store a complex number, a computer simply
stores two real numbers t
Let us now consider the operations above from a computers point of view. One would
like to be able to use the absolute-value function without having to know a-priori how the
argument of the function is stored in the computers memory. The computer should itself
determine by what sort of input is supplied which method to use. The generalized function
abs calls for an execution of abs, or absc depending on the input. Moreover, one would
perhaps like to be able to supply a structure for hermitian-numbers and allow the user
of that structure to use the function abs with a hermitian input. In the same way, in our
present work, we structure the Monte Carlo simulation in such a way that it is performed
in the same manner irrespective of the detailed nature of the underlying model. As long as
a new model builder supplies some sort of implementation of the necessary functions (in
the above example, an implementation of the abs-function) then a Monte Carlo simulation
of it is possible using the software developed here. In order to make the computer code
supplied usable to others, in particular, new model builders, we explain in detail the
mechanics of how this works in C++ in particular and in object oriented programming
languages in general.
Although the above example is very simple and has long ago been solved by
computer programmers it will serve illustratively here. In the object oriented approach,
a general class called simply NUMBER will be defined. For the class NUMBER special
functions (called methods or sometimes member functions) such as addition, subtraction,
multiplication, division and x v- ||x|| are named. The class NUMBER is what is called
a parent. Sometimes another class is considered a child class or said to inherit from the
base class NUMBER. Children must have implementations of all the member functions of
t Namely its real and imaginary parts (a, b), or equivalently, its length and argument
angle (r, 0) (\/a2 + b2, arctan(y/)).