NumMatrix

 

NumMatrix Overview

A Number Matrix (NumMatrix) is a Heap object containing zero or more IEEE 64 bit double precision real numbers, which are arranged in from one to three dimensions. (Note: NumMatrix objects may be dynamically arranged with one, two, or three dimensions).

This command creates a new NumMatrix of rand one with 2 elements:

(setq X (new Matrix: number: 1 2 11.433 -2.6))

11.433
-2.6

The NumMatrix is a dynamic data type: it can grow to containing new elements or contract as elements are deleted. An element is accessed by an index from 0 to n-1 where n is the number of elements in the NumMatrix. When an element is added, it is appended to the end.

11.433
-2.6
5

Or we might sort the NumMatrix

-2.6
5
11.433

Or we might delete a key by specify the index of the item to be deleted (2)

-2.6
5

When to Use

The NumMatrix object is useful for storing data of the "same" type (i.e. Numbers). (homogeneous) or "different" types (heterogeneous) . The NumMatrix object is very fast and has minimum memory overhead due to the indexed access of its values. If you require a random access strategy or a keyed access strategy see the Dictionary or Structure data types.

Constant Form

The NumMatrix native data type has a constant form. A NumMatrix constant is enclosed in brackets and preceded by the sharp symbol (#).

For Example:

#(nummat| 0 1 2 3 4 5 6 7 8 9)

Object Data Types

The NumMatrix 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 Examples

The NumMatrix object can be demonstrated by the following examples.

Example_NumMatrix_addMethod_027 Example_NumMatrix_append_012 Example_NumMatrix_apply_009 Example_NumMatrix_binaryInsert_007
Example_NumMatrix_binarySearch_007 Example_NumMatrix_cdr_011 Example_NumMatrix_compareEQ_023 Example_NumMatrix_compareGE_023
Example_NumMatrix_compareGT_023 Example_NumMatrix_compareLE_023 Example_NumMatrix_compareLT_023 Example_NumMatrix_compareNE_023
Example_NumMatrix_compare_023 Example_NumMatrix_comparison_023 Example_NumMatrix_copy_011 Example_NumMatrix_count_009
Example_NumMatrix_defmethod_024 Example_NumMatrix_delete_014 Example_NumMatrix_insert_009 Example_NumMatrix_inside_009
Example_NumMatrix_isAtom_012 Example_NumMatrix_isEqual_020 Example_NumMatrix_isIdentical_020 Example_NumMatrix_isInside_011
Example_NumMatrix_isMember_010 Example_NumMatrix_isNumberMatrix_001 Example_NumMatrix_isObject_014 Example_NumMatrix_isType_022
Example_NumMatrix_length_017 Example_NumMatrix_makeGaussianMatrix_001 Example_NumMatrix_makeGramMatrix_001 Example_NumMatrix_map_010
Example_NumMatrix_mapc_009 Example_NumMatrix_matrixGaussianEliminate_001 Example_NumMatrix_matrixGaussianSubstitute_001 Example_NumMatrix_member_005
Example_NumMatrix_member_009 Example_NumMatrix_methodsOf_024 Example_NumMatrix_new_015 Example_NumMatrix_objectToNumMatrix_001
Example_NumMatrix_rank_002 Example_NumMatrix_ref_035 Example_NumMatrix_remove_008 Example_NumMatrix_resize_011
Example_NumMatrix_reverse_004 Example_NumMatrix_send_027 Example_NumMatrix_setCdr_013 Example_NumMatrix_setLastCdr_012
Example_NumMatrix_sizeof_028 Example_NumMatrix_sort_005 Example_NumMatrix_sort_020 Example_NumMatrix_type_025
Example_NumMatrix_vectorFill_008