diff --git a/src/base/construction.rs b/src/base/construction.rs index ae8c10d4..f810acdf 100644 --- a/src/base/construction.rs +++ b/src/base/construction.rs @@ -1011,6 +1011,14 @@ where N: Scalar + Zero + One, DefaultAllocator: Allocator, { + /// The column vector with `val` as its i-th component. + #[inline] + pub fn ith(i: usize, val: N) -> Self { + let mut res = Self::zeros(); + res[i] = val; + res + } + /// The column vector with a 1 as its first component, and zero elsewhere. #[inline] pub fn x() -> Self