Vector
A dimensionally type-safe column vector of doubles.
The dimension N is encoded at the type level using Nat types, allowing the compiler to catch dimension mismatches at compile time.
Example:
val a: SizedVector<N3> = SizedVector.of(N3, 1.0, 2.0, 3.0)
val b: SizedVector<N3> = SizedVector.of(N3, 4.0, 5.0, 6.0)
val c: SizedVector<N3> = a + b // Compiles!
val dot: Double = a dot b
// val d: SizedVector<N2> = a + SizedVector.zero(N2) // Won't compile - dimensions don't matchContent copied to clipboard
Type Parameters
N
The dimension type
Properties
Functions
Link copied to clipboard
Returns a normalized (unit) vector in the same direction.
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 vector by a scalar.
Link copied to clipboard
Converts to a DynamicMatrix.
Link copied to clipboard
Converts to a DynamicVector.
Link copied to clipboard
Negates all elements of this vector.