Syntax: |
vout = v1 /& v2
|
The intersection operator, /&
, is a binary operator that only accepts vectors
as operands, and returns a vector which contains the intersection of the elements of
these two vectors.
All vectors have an order property. Vectors are either in ascending order, descending
order, or un-ordered. The type is displayed in the
SHOW
command. For now, being ordered only has an affect on the vector union,
/|
, and the vector intersection, /&
. These operations are
much faster if the vector operands are ordered. The
WHERE
function produces an ascending order vector, as does the
SORT/UP
command. The SORT/DOWN
command produces a
descending order vector. This vector property will be utilized more in the future to
enhance speed and efficiency.
Example
To illustrate vector intersection, suppose you have two vectors:
X = [1;2;3;4;5;6;7]
and Y = [-2;-1;0;1;2]
Then: X/&Y = [1;2]