Indexing functions¶
Indexing functions build, access, combine or reshape arrays.
The following functions are available:
See also
See Constraint Programming functions for a general explanation on how to read the signature tables below.
array¶
Builds an array from its operands, of fixed or variable size. Any argument more than 1 is treated as an element of the array and all arguments must shared the same type and dimension.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
any (any dimension) |
Mandatory |
Argument >= 2 |
Additional operand(s). Same type and dimension as Argument 1, they are treated as forming a single array of one dimension greater than dimension of Argument 1. |
Optional |
at¶
Returns the element of an array or a list at the position given by the following operand(s).
Parameters
Signature 1
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
array of dimension greater than 0, list |
Mandatory |
Argument 2 |
numeric (dimension 0) |
Mandatory |
Argument >= 3 |
Additional operand(s). The number of operands must be equal to the dimension of Argument 1. |
Optional |
Signature 2
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
array of dimension greater than 0, list |
Mandatory |
Argument 2 |
array of integers of dimension 1, list |
Mandatory |
Argument >= 3 |
Additional operand(s). The number of operands must be equal to the dimension of Argument 1. |
Optional |
cat¶
Concatenates arrays along the first dimension. All arrays must have the same type and dimension.
Parameters
Signature (dimension of Argument 1: greater than 1)
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
array of dimension greater than 1 |
Mandatory |
Signature (dimension of Argument 1: greater than 0)
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
array of dimension greater than 0 |
Mandatory |
Argument 2 |
array of the same type and dimension as Argument 1 |
Mandatory |
Argument >= 3 |
Additional operand(s). Any number of these arguments can be provided; together with the previous argument(s), they are all concatenated in a unique object. |
Optional |
shift¶
Returns an array of the same type and dimension as Argument 1, with its elements shifted by the amount specified in Argument 2. The elements that are shifted out of the array are discarded, leaving an array of length lower than the original.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
array of dimension 1, list |
Mandatory |
Argument 2 |
integer |
Mandatory |
matrix¶
Returns a matrix with the specified number of rows (Argument 2) created from the input array (Argument 1). The elements are filled column-wise.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
any (dimension greater than 0) |
Mandatory |
Argument 2 |
positive integer |
Mandatory |
tensor¶
Returns a tensor with the specified number of dimensions (Argument 2) created from the input array (Argument 1). The elements are filled column-wise.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
any (dimension greater than 0) |
Mandatory |
Argument 2 |
positive integer |
Mandatory |
Argument >= 3 |
Additional operand(s). Any number of these arguments can be provided; together with the previous argument(s), they are treated as forming a single array of dimension 1. |
Optional |