Struct matrixable::strategies::RotateR
source · pub struct RotateR;
Expand description
Performs a clockwise rotation.
§Example
use matrixable::{ MatrixExt, strategies::{ TransformStrategy, RotateR }};
let m = [
[ 0, 1 ],
[ 2, 3 ],
[ 4, 5 ]
];
let expected = [
[ 4, 2, 0 ],
[ 5, 3, 1 ]
];
// `m` is borrowed.
let access = m.access(RotateR);
assert!(expected.iter().eq(access.iter()));
// `m` is consumed.
let t = RotateR.out_of(m);
assert_eq!(expected, t);
Trait Implementations§
source§impl<M: MatrixExt> AccessStrategy<M> for RotateR
impl<M: MatrixExt> AccessStrategy<M> for RotateR
source§fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>
fn access(&self, m: &M, i: usize, j: usize) -> Option<(usize, usize)>
Gives the location (if it exists) of the element in a matrix that
should match the indexes (subscripts) provided according to the access strategy. Read more
source§impl<M: SwapsDimensions> InPlace<M> for RotateR
impl<M: SwapsDimensions> InPlace<M> for RotateR
source§impl Ord for RotateR
impl Ord for RotateR
source§impl PartialEq for RotateR
impl PartialEq for RotateR
source§impl PartialOrd for RotateR
impl PartialOrd for RotateR
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<M: MatrixExt> TransformStrategy<M> for RotateRwhere
Transpose: TransformStrategy<M>,
<Transpose as TransformStrategy<M>>::Output: MatrixExt,
FlipH: TransformStrategy<<Transpose as TransformStrategy<M>>::Output>,
impl<M: MatrixExt> TransformStrategy<M> for RotateRwhere
Transpose: TransformStrategy<M>,
<Transpose as TransformStrategy<M>>::Output: MatrixExt,
FlipH: TransformStrategy<<Transpose as TransformStrategy<M>>::Output>,
impl Copy for RotateR
impl Eq for RotateR
impl StructuralPartialEq for RotateR
Auto Trait Implementations§
impl RefUnwindSafe for RotateR
impl Send for RotateR
impl Sync for RotateR
impl Unpin for RotateR
impl UnwindSafe for RotateR
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more