Module matrix

Module matrix 

Source
Expand description

Matrix operations for MATLAB-compatible arithmetic

Implements element-wise and matrix operations following MATLAB semantics.

Functions§

complex_matrix_power
Complex matrix power: C = A^n (for positive integer n) Uses binary exponentiation with complex matrix multiply
matrix_add
Matrix addition: C = A + B
matrix_eye
Create identity matrix
matrix_mul
Matrix multiplication: C = A * B
matrix_power
Matrix power: C = A^n (for positive integer n) This computes A * A * … * A (n times) via repeated multiplication
matrix_scalar_mul
Scalar multiplication: C = A * s
matrix_sub
Matrix subtraction: C = A - B
matrix_transpose
Matrix transpose: C = A’
value_matmul
GPU-aware matmul entry: if both inputs are GpuTensor handles, call provider; otherwise fall back to CPU.