Matrix construction and access
Construct matrices from ordered rows or from identity, zero, and diagonal families. Shape and entry access preserve row-major ordering.
Constructors#
matrix#
Explicit context
func matrix(rows: [[UniffiExpression]]) -> UniffiMatrixBuild a matrix from ordered rows. Direct Python construction and the facade
module function use the shared default context. The raw wasm-bindgen
compatibility layer retains (rows, columns, flat_entries); new JavaScript
code should use the nested facade form.
matrix_identity#
Explicit context
func matrixIdentity(size: UInt64) -> UniffiMatrixThe identity; size 0 raises.
matrix_zero#
Explicit context
func matrixZero(rows: UInt64, columns: UInt64) -> UniffiMatrixThe zero matrix.
matrix_diagonal#
Explicit context
func matrixDiagonal(entries: [UniffiExpression]) -> UniffiMatrixSquare matrix with the given main diagonal and zeros elsewhere; the empty list raises.
Shape and access#
rows#
UniffiMatrix method
func rows() -> UInt64columns#
UniffiMatrix method
func columns() -> UInt64entry#
UniffiMatrix method
func entry(row: UInt64, column: UInt64) -> UniffiExpressionElement access. Notes: Python uses indexing m[row, column] instead.
Example#
Additional API#
diagonal_matrix#
Explicit context
func diagonalMatrix(subject: UniffiMatrix) -> UniffiAssumptionPropositionProvides the diagonal_matrix operation on this mobile object.
identity_matrix#
Explicit context
func identityMatrix(subject: UniffiMatrix) -> UniffiAssumptionPropositionProvides the identity_matrix operation on this mobile object.
zero_matrix#
Explicit context
func zeroMatrix(subject: UniffiMatrix) -> UniffiAssumptionPropositionProvides the zero_matrix operation on this mobile object.