Matrix
A dimensionally type-safe matrix of doubles.
The dimensions R (rows) and C (columns) are encoded at the type level using Nat types, allowing the compiler to catch dimension mismatches at compile time.
Example:
val a: Matrix<N2, N3> = Matrix.zero(N2, N3) // 2x3 matrix
val b: Matrix<N3, N4> = Matrix.zero(N3, N4) // 3x4 matrix
val c: Matrix<N2, N4> = a * b // 2x4 matrix - compiles!
// val d = a * a // Would not compile - N3 != N2Content copied to clipboard
Type Parameters
R
The row dimension type
C
The column dimension type
Inheritors
Properties
Functions
Link copied to clipboard
Multiplies this matrix by another matrix. The inner dimensions must match: (R x C) * (C x K) = (R x K)
Multiplies this matrix by a vector. The vector's length must be equal to C.
Multiplies this matrix by a scalar.
Link copied to clipboard
Converts to a DynamicMatrix.
Link copied to clipboard
Negates all elements of this matrix.