The support cluster offers some commonly needed functionality that do not belong to the kernel.
A few utility classes complement the kernel
facilities. PRIMES,
RANDOM and FIBONACCI
are part of the data structure taxonomy; the others are meant to be used as ancestors by classes needing their features.
Two classes provide basic mathematical functions such as logarithms and trigonometric functions:
SINGLE_MATH
for single precision and DOUBLE_MATH
for the double-precision variants. MATH_CONST
contains mathematical constants: p, the square root of two, Euler’s constant e.
PRIMES, RANDOM
and FIBONACCI
are data structure classes - heirs of COUNTABLE_SEQUENCE. In all of these classes function
i_th
takes an integer
argument i and will return the i-th element of the sequence under consideration - prime
numbers, pseudo-random numbers or Fibonacci numbers. These sequences are active
structures, on which forth will advance the current position and item will return the
value at the current position. A few other features are specific to each case: for example
higher_prime
will yield the smallest prime greater than or equal to a certain value, and
set_seed will define the seed to be used for starting the pseudo-random sequence.
Class INTERNAL
provides low-level access to internal object structures. It, too, is
meant to be used as ancestor by classes needing its features.
Here are some of the most useful calls and what they yield, obj being an entity
attached to an object O and i an integer:
CAUTION: Only very special cases justify the use of this class. Unless you are writing the lowest level of an interface between an Eiffel application and external tools (such as a database management system), and this requires passing to those tools information about the internals of Eiffel objects, you almost certainly should not use INTERNAL.