Trait nalgebra::Indexable
[−]
[src]
pub trait Indexable<I, N>: Shape<I> + IndexMut<I, Output=N> { fn swap(&mut self, i: I, j: I); unsafe fn unsafe_at(&self, i: I) -> N; unsafe fn unsafe_set(&mut self, i: I, N); }
This is a workaround of current Rust limitations.
It exists because the I
trait cannot be used to express write access.
Thus, this is the same as the I
trait but without the syntactic sugar and with a method
to write to a specific index.
Required Methods
fn swap(&mut self, i: I, j: I)
Swaps the i
-th element of self
with its j
-th element.
unsafe fn unsafe_at(&self, i: I) -> N
Reads the i
-th element of self
.
i
is not checked.
unsafe fn unsafe_set(&mut self, i: I, N)
Writes to the i
-th element of self
.
i
is not checked.
Implementors
impl<N: Copy> Indexable<(usize, usize), N> for DMatrix<N>
impl<N: Copy> Indexable<(usize, usize), N> for DMatrix1<N>
impl<N: Copy> Indexable<(usize, usize), N> for DMatrix2<N>
impl<N: Copy> Indexable<(usize, usize), N> for DMatrix3<N>
impl<N: Copy> Indexable<(usize, usize), N> for DMatrix4<N>
impl<N: Copy> Indexable<(usize, usize), N> for DMatrix5<N>
impl<N: Copy> Indexable<(usize, usize), N> for DMatrix6<N>
impl<N: Copy> Indexable<usize, N> for DVector<N>
impl<N: Copy> Indexable<usize, N> for DVector1<N>
impl<N: Copy> Indexable<usize, N> for DVector2<N>
impl<N: Copy> Indexable<usize, N> for DVector3<N>
impl<N: Copy> Indexable<usize, N> for DVector4<N>
impl<N: Copy> Indexable<usize, N> for DVector5<N>
impl<N: Copy> Indexable<usize, N> for DVector6<N>
impl<N: Copy> Indexable<usize, N> for Vector1<N>
impl<N: Copy> Indexable<usize, N> for Vector2<N>
impl<N: Copy> Indexable<usize, N> for Vector3<N>
impl<N: Copy> Indexable<usize, N> for Vector4<N>
impl<N: Copy> Indexable<usize, N> for Vector5<N>
impl<N: Copy> Indexable<usize, N> for Vector6<N>
impl<N: Copy> Indexable<usize, N> for Point1<N>
impl<N: Copy> Indexable<usize, N> for Point2<N>
impl<N: Copy> Indexable<usize, N> for Point3<N>
impl<N: Copy> Indexable<usize, N> for Point4<N>
impl<N: Copy> Indexable<usize, N> for Point5<N>
impl<N: Copy> Indexable<usize, N> for Point6<N>
impl<N: Copy> Indexable<usize, N> for Quaternion<N>
impl<N: Copy> Indexable<(usize, usize), N> for Matrix1<N>
impl<N: Copy> Indexable<(usize, usize), N> for Matrix2<N>
impl<N: Copy> Indexable<(usize, usize), N> for Matrix3<N>
impl<N: Copy> Indexable<(usize, usize), N> for Matrix4<N>
impl<N: Copy> Indexable<(usize, usize), N> for Matrix5<N>
impl<N: Copy> Indexable<(usize, usize), N> for Matrix6<N>