Vector |
Overview
Vector is an object designed to use for a one dimensional array double precision floating data (8 bytes). It is more convenient than a matrix in term of tracking number of elements, however less computation capability than a matrix. A vector is empty when initiated, and it keeps tracking the number of elements in it whenever there is an insertion or deletion.
The "pushback" function is, most of the time, used for input data into a vector object.
It is possible to convert between vector and matrix back and forth.
Member data
Name | Data type | Meaning |
size | int | no of data in the vector |
maxsize | int | no of maximum data can be stored in a vector |
Operator
plus (+) concatenate two vectors e.g. v3 = v1 + v2
minus (-) subtract one vector from the other e.g. v3 = v1 - v2
and (&) find intersection of two vectors e.g. v3 = v1 & v2
or ( | ) find union of two vectors e.g. v3 = v1 | v2
Construction function
{Vector} ret = VECTOR([{int} argm1])
argm1 = max no of data in the vector (default = 1)
Example:
->v1 = Vector() | create a vector with max size = 1 |
->v1 = Vector(200) |
create a vector with max size = 200 |
Lfunction
object({int} argm1) = {double} left-value
argm1 = vector index
Example:
->v1(0) = 35 | set value of the 1st element to 35 |
Class function
( ) | EXTEND | FIND | FINDALL | FINDFROM |
HSORT | ||||
INIT | INT | LAST | LINGEN | LOAD |
MATRIX | MAX | MAXSIZE | MEDIAN | MIN |
MPUSHBACK | ||||
PUSHBACK | QFIND | REMALL | REMOVE | REMSORT |
REVERSE | SAVE | SIZE | SORT | TRUNCATE |
UNSTACK | WINDOW |