algebra

Scalar, vector, and matrix helpers, including transcendental functions, interpolation, vector products, transposition, and determinant-based matrix operations.


Shape constructors and scalars


Shape compatibility


Value operations


Vector-only operations


Matrix-only operations


Examples

Vector addition and dot product

"algebra" use
"control" use

{} () {} [
  v: (1i32 2i32 3i32);
  w: (4i32 5i32 6i32);
  v w + printStack _:;
  v w dot printStack _:;
] "main" exportFunction

Expected Output During Compilation

(5 7 9)
32

Matrix determinant

"algebra" use
"control" use

{} () {} [
  m: ((1i32 2i32) (3i32 4i32));
  m det printStack _:;
] "main" exportFunction

Expected Output During Compilation

-2

Runtime vector check

"algebra" use
"String" use
"control" use

{} Int32 {} [
  v: (1i32 2i32 3i32);
  w: (4i32 5i32 6i32);
  sum: v w +;
  expected: (5i32 7i32 9i32);
  sum expected = print
  LF print
  v w dot 32 same print
  LF print
  0
] "main" exportFunction

Expected Output

TRUE
TRUE

See also