method

basis

v2_4_6 - Show latest stable - Class: Vector
basis(size:, index:)
public

Returns a standard basis n-vector, where k is the index.

Vector.basis(size:, index:) # => Vector[0, 1, 0]