FltVector

 

FltVector Overview

A Float Vector (FltVector) is a Heap object containing zero or more IEEE 32 bit single precision real numbers. FltVectors allow access to stored floats (small floating point) values using an integer key. A FloatVector is a data structure composed of an arbitrary number of Floats. Assuming there are n elements in a vector, the elements of the vector are accessed as elements 0 thru n-1. A FloatVector also has a tail in the same sense that a Pair has a tail.

This sets an FltVector of one value.

(setq X (new Vector: float: 2 3.141592 2.16412))

3.141592
2.16412

The FltVector 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 FltVector. When an element is added, it is appended to the end.

3.141592
2.16412
0.41567

Or we might sort the vector

0.41567
2.16412
3.141592

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

0.41567
2.16412

When to Use

The FltVector is a subtype of the Vector Data Type. The FltVector object is useful for storing floating point numbers. The FltVector 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.

Visual Basic Comparison

An Analytic Information Server NumVector is similar to the single dimensioned dynamic array in Visual Basic. The Visual Basic array is created at compile time (the Visual Basic Array still requires a "ReDim" to specify a dimension), whereas the Analytic Information Server structure is created, expanded, or contracted dynamically at run time.

Dim DayArray(50)

DayArray is an array of Variants with 51 elements indexed, from 0 thru 50.

Constant Form

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

For Example:

#(flt| 2.16412 3.141592)

Object Data Types

The FltVector 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 FltVector object can be demonstrated by the following examples.

Example_FltVector_addMethod_019 Example_FltVector_apply_005 Example_FltVector_binaryInsert_004 Example_FltVector_binarySearch_005
Example_FltVector_cdr_006 Example_FltVector_compareEQ_014 Example_FltVector_compareGE_014 Example_FltVector_compareGT_014
Example_FltVector_compareLE_014 Example_FltVector_compareLT_014 Example_FltVector_compareNE_014 Example_FltVector_compare_014
Example_FltVector_comparison_014 Example_FltVector_copy_006 Example_FltVector_defmethod_017 Example_FltVector_delete_009
Example_FltVector_insert_005 Example_FltVector_isAtom_005 Example_FltVector_isEqual_013 Example_FltVector_isFloatVector_001
Example_FltVector_isIdentical_012 Example_FltVector_isObject_007 Example_FltVector_isType_016 Example_FltVector_length_008
Example_FltVector_map_005 Example_FltVector_mapc_005 Example_FltVector_methodsOf_017 Example_FltVector_new_009
Example_FltVector_ref_022 Example_FltVector_resize_006 Example_FltVector_reverse_003 Example_FltVector_send_015
Example_FltVector_setCdr_006 Example_FltVector_setLastCdr_006 Example_FltVector_setq_019 Example_FltVector_sizeof_014
Example_FltVector_sort_013 Example_FltVector_type_016 Example_FltVector_uniqueInsert_004 Example_FltVector_vectorFill_003