# package phantom-algebra

Legend:
Library
Module
Module type
Parameter
Class
Class type

Index data type

type (+'dim, +'len, +'rank, +'group) index

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' : (, , , [ `xyzw ]) index

XYZW group

val y' : (, , , [ `xyzw ]) index
val z' : (, , , [ `xyzw ]) index
val w' : ([< ], , , [ `xyzw ]) index
val xx' : (, , , [ `xyzw ]) index
val yx' : ([< | `four ], , , [ `xyzw ]) index
val zx' : ([< | `four ], , , [ `xyzw ]) index
val wx' : ([< ], , , [ `xyzw ]) index
val xy' : (, , , [ `xyzw ]) index
val yy' : (, , , [ `xyzw ]) index
val zy' : (, , , [ `xyzw ]) index
val wy' : ([< ], , , [ `xyzw ]) index
val xz' : (, , , [ `xyzw ]) index
val yz' : (, , , [ `xyzw ]) index
val zz' : (, , , [ `xyzw ]) index
val wz' : ([< ], , , [ `xyzw ]) index
val xw' : (, , , [ `xyzw ]) index
val yw' : (, , , [ `xyzw ]) index
val zw' : (, , , [ `xyzw ]) index
val ww' : (, , , [ `xyzw ]) index
val r' : (, , , [ `rgba ]) index

RGBA

val g' : (, , , [ `rgba ]) index
val b' : (, , , [ `rgba ]) index
val a' : ([< ], , , [ `rgba ]) index
val rr' : (, , , [ `rgba ]) index
val gr' : ([< | `four ], , , [ `rgba ]) index
val br' : ([< | `four ], , , [ `rgba ]) index
val ar' : ([< ], , , [ `rgba ]) index
val rg' : (, , , [ `rgba ]) index
val gg' : (, , , [ `rgba ]) index
val bg' : (, , , [ `rgba ]) index
val ag' : ([< ], , , [ `rgba ]) index
val rb' : (, , , [ `rgba ]) index
val gb' : (, , , [ `rgba ]) index
val bb' : (, , , [ `rgba ]) index
val ab' : ([< ], , , [ `rgba ]) index
val ra' : (, , , [ `rgba ]) index
val ga' : (, , , [ `rgba ]) index
val ba' : (, , , [ `rgba ]) index
val aa' : (, , , [ `rgba ]) index
val s' : (, , , [ `stpq ]) index

STPQ group

val t' : (, , , [ `stpq ]) index
val p' : (, , , [ `stpq ]) index
val q' : ([< ], , , [ `stpq ]) index
val ss' : (, , , [ `stpq ]) index
val ts' : ([< | `four ], , , [ `stpq ]) index
val ps' : ([< | `four ], , , [ `stpq ]) index
val qs' : ([< ], , , [ `stpq ]) index
val st' : (, , , [ `stpq ]) index
val tt' : (, , , [ `stpq ]) index
val pt' : (, , , [ `stpq ]) index
val qt' : ([< ], , , [ `stpq ]) index
val sp' : (, , , [ `stpq ]) index
val tp' : (, , , [ `stpq ]) index
val pp' : (, , , [ `stpq ]) index
val qp' : ([< ], , , [ `stpq ]) index
val sq' : (, , , [ `stpq ]) index
val tq' : (, , , [ `stpq ]) index
val pq' : (, , , [ `stpq ]) index
val qq' : (, , , [ `stpq ]) index

Innovation. Community. Security.

##### Ecosystem
Packages Community Events OCaml Planet Jobs
##### Policies
Carbon Footprint Governance Privacy Code of Conduct