Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Index data type
An index of type (+'dim,'+len,+'rank,'group) index
can be used to index a tensor, each type parameter informs on which kind of tensor can be used ('dim
and 'rank
), on the type of the resulting vector ('len
and 'rank
), or on with which indices it can be combined when swizzling. More precisely,
`dim
is the list of tensor dimension compatible with the index, for instance `x` works for all dimension, whereas `w` is only meaningful for a 4-vector.`rank
is the number of coordinate specified by the index, a tensor can be indexed only if its own rank is equal or superior to the index rank. For instance, xx
is a rank 2 tensor and can only index matrices, whereas x
is a valid index for both vector and tensor. When slicing, the rank of the slice will be the difference between the tensor rank and the index rank. For a vector v
and a matrix m
, v.%x
is a scalar (1 - 1 = 0
) like m.%[xx]
( 2 - 2 = 0
) but m.%x
is a vector (2-1=0
) corresponding to the first row of the matrix'len
is the number of indices combined in the aggregated index by swizzling, if 'len > 1
it increases the rank of the resulting tensor by one and sets its dimension to 'len
. See the slice function for more information.'group
corresponds to the index namespace, only index of the same namespace can be combined by swizzling. Availaibles namespace are `xyzx
,`rgba
and `stpq
.val (&) :
('dim, ('len1, 'len2, 'len3, _) Type_functions.simple_sum, 'rank, 'group)
index ->
('dim, 'len2, 'rank, 'group) index ->
('dim, 'len3, 'rank, 'group) index
Index concatenation
val x' :
([< _ Type_functions.one
| _ Type_functions.two
| _ Type_functions.three
| _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `xyzw ])
index
XYZW group
val y' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `xyzw ])
index
val z' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `xyzw ])
index
val w' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `xyzw ])
index
val xx' :
([< _ Type_functions.one
| _ Type_functions.two
| _ Type_functions.three
| _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val yx' :
([< _ Type_functions.two | _ Type_functions.three | `four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val zx' :
([< _ Type_functions.three | `four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val wx' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val xy' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val yy' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val zy' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val wy' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val xz' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val yz' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val zz' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val wz' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val xw' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val yw' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val zw' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val ww' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `xyzw ])
index
val r' :
([< _ Type_functions.one
| _ Type_functions.two
| _ Type_functions.three
| _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `rgba ])
index
RGBA
val g' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `rgba ])
index
val b' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `rgba ])
index
val a' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `rgba ])
index
val rr' :
([< _ Type_functions.one
| _ Type_functions.two
| _ Type_functions.three
| _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val gr' :
([< _ Type_functions.two | _ Type_functions.three | `four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val br' :
([< _ Type_functions.three | `four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val ar' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val rg' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val gg' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val bg' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val ag' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val rb' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val gb' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val bb' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val ab' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val ra' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val ga' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val ba' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val aa' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `rgba ])
index
val s' :
([< _ Type_functions.one
| _ Type_functions.two
| _ Type_functions.three
| _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `stpq ])
index
STPQ group
val t' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `stpq ])
index
val p' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `stpq ])
index
val q' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.one,
[ `stpq ])
index
val ss' :
([< _ Type_functions.one
| _ Type_functions.two
| _ Type_functions.three
| _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val ts' :
([< _ Type_functions.two | _ Type_functions.three | `four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val ps' :
([< _ Type_functions.three | `four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val qs' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val st' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val tt' :
([< _ Type_functions.two | _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val pt' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val qt' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val sp' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val tp' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val pp' :
([< _ Type_functions.three | _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val qp' :
([< _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val sq' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val tq' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val pq' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index
val qq' :
([ _ Type_functions.four ],
_ Type_functions.one,
_ Type_functions.two,
[ `stpq ])
index