Operations
Basic mathematical built-in operators and functions are available.
In addition to basic mathematical operators such as +
, -
, *
, /
, ^
, and conditionals, Stride also supports the following functions:
Functions
Function | Description |
---|---|
abs(x) | Absolute value |
sqrt(x) | Square root |
max(x_1, x_2, ...) | Maximum value |
min(x_1, x_2, ...) | Minimum value |
sum(x_1, x_2, ...) | Sum |
prod(x_1, x_2, ...) | Product |
log(x) | Natural log |
log10(x) | Base 10 log |
log2(x) | Base 2 log |
Matrix Operations
Shortcut | Operator | Description |
---|---|---|
* | * or Β· | Matrix multiplication (cross product for matrices, dot product for vectors) |
.* | β | Element-wise multiplication |
./ | β | Element-wise division |
.^ | Xα΅ΚΈ | Element-wise exponentiation, where X is a matrix and y is a scalar |
Matrix Functions
Function | Description |
---|---|
det(A) | Determinant |
inv(A) | Inverse |
transpose(A) | Transpose |
identity(n) | Identity matrix of size n |
diag(v) | Matrix with vector v on the diagonal |
Last updated on