Complex Overview

The Analytic Information Server engine supports complex numbers as a pair of real values representing the real and imaginary parts of the complex number, respectively. A complex number is not a native type. Rather, it is a heap object since two real numbers is too large to fit into the space allotted to native types. All of the standard operations on complex numbers (add, subtract, multiply, divide, mod, sin, cos, tan, etc.) are supported. In addition, several built-in functions that are specific to complex numbers (real, imaginary, complex, conjugate, argument, modulus) are also provided.

When to Use

Use complex numbers for those functions that require complex number support.

Constant Form

Complex numbers are represented by a pair of floating-point numbers, representing the real and imaginary parts of the complex value. For example:

#C(3.14 2.718)

If the second element is omitted, the imaginary value is set to 0.0.

Object Data Types

The Complex is a Heap Object or an Object Data Type. The Analytic Information Server Object Types are stored in the Heap and are managed by the Heap manager. The Analytic Information Server Heap manager supports object resizing, garbage collection, and anti-fragmentation algorithms so that the user may concentrate on the analysis and modeling of data rather than on memory management. Without exception, all of the Object types are identified by an object id. The object id identifies a block of memory, managed by the Lambda Information Server memory manager, in which the Object's data is stored.

The Analytic Information Server Heap Object and Native Data types can be saved and loaded to and from persistent (disk file) storage at any time. Containers with immediate data are saved on disk in fixed length records equal to the size of the container. Containers with Heap object references are saved in fixed length records, which are automatically expanded to include the contents of the Heap object, and any objects referenced by the Heap object, etc. This feature is called Object Closure Management and is automatic with every Analytic Information Server container database save.

Analytic Information Server containers may be loaded from any database repository record at any time. If the data in the record is immediate, the database load fills the container with the immediate data. If the data in the record is an object closure, the database load fills the container with a Heap object reference, and all of the objects in the record are loaded back into the Heap with the same referential relationships they had when they were saved in the repository.


Data Type Functions

The Complex object can be demonstrated by the following functions.

(sym)add (sym)div (sym)mul (sym)sub
abs append argument compareEQ
compareGE compareGT compareLE compareLT
compareNE compare comparison complex
conjugate cos exp expt
imaginary isComplex isEqual isIdentical
isType log10 log2 log
logbase methodsOf mod real
ref sin sizeof sqrt
string sum sumsqr tan


Data Type Examples

The Complex object can be demonstrated by the following examples.

Example_Complex_(sym)add_002 Example_Complex_(sym)div_002 Example_Complex_(sym)div_003 Example_Complex_(sym)mul_002
Example_Complex_(sym)sub_002 Example_Complex_(sym)sub_003 Example_Complex_abs_002 Example_Complex_append_011
Example_Complex_argument_001 Example_Complex_compare_021 Example_Complex_comparison_021 Example_Complex_conjugate_001
Example_Complex_cos_002 Example_Complex_exp_002 Example_Complex_expt_002 Example_Complex_imaginary_001
Example_Complex_isComplex_001 Example_Complex_log10_002 Example_Complex_log2_002 Example_Complex_log_002
Example_Complex_logbase_010 Example_Complex_mod_002 Example_Complex_real_001 Example_Complex_sin_002
Example_Complex_sqrt_002 Example_Complex_string_001 Example_Complex_string_004 Example_Complex_tan_002