Computing in Object-Oriented Parallel Environments

Efficient and elegant complex numbers are one of the preconditions for the use of Java in scientific computing. This paper introduces a preprocessor and its translation rules that map a new basic type complex and its operations to pure Java. For the mapping is insufficient to just replace one complex-variable with two double-variables. Compared to code that uses Complex objects and method invocations to express arithmetic operations the new basic type increases readability and it is also executed faster. On average, the versions of our benchmark programs that use the basic type outperform the class-based versions by a factor of 2 up to 21 (depending on the JVM used).