VecINT

| HOME | BACK |

Overview

VecINT is an object designed to use for a one dimensional array integer data (4 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.

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

{Vecint} ret  =  VECINT([{int} argm1])

argm1 = max no of data in the vector    (default = 1)

Example:

->v1 = VecINT() create a vector with max size = 1

->v1 = VecINT(200)

create a vector with max size = 200

 

Lfunction

object({int} argm1)   =  {int} left-value

argm1 = vector index

Example:

->v1(0) = 35 set value of the 1st element to 35

 

Class function

 ( ) DOUBLE  EXTEND FIND  
FINDALL FINDFROM     HSORT
INIT LAST LINGEN LOAD  
 MATRIX MAX  MAXSIZE MEDIAN MIN
 MPUSHBACK        
 PUSHBACK QFIND  REMALL REMOVE REMSORT
 REVERSE SAVE  SIZE SORT TRUNCATE
 UNSTACK WINDOW      

 


| HOME | BACK |