Trait beagle::consts::Array
[−]
[src]
pub trait Array<T>: Constant { type RawType; type Type; fn from_value(v: T) -> Self::Type
where
T: Clone; fn apply<F: FnMut(T)>(a0: Self::Type, f: F); fn apply2<U, F>(a0: Self::Type, a1: Self::Type, f: F)
where
Self: Array<U>,
F: FnMut(T, U); fn fold<O, F>(a0: Self::Type, init: O, f: F) -> O
where
F: FnMut(O, T) -> O; fn fold2<U, O, F>(a0: Self::Type, a1: Self::Type, init: O, f: F) -> O
where
Self: Array<U>,
F: FnMut(O, T, U) -> O; fn map<O, F>(a0: Self::Type, f: F) -> Self::Type
where
Self: Array<O>,
F: FnMut(T) -> O; fn map_into_2<O1, O2, F>(a0: Self::Type, f: F) -> (Self::Type, Self::Type)
where
Self: Array<O1> + Array<O2>,
F: FnMut(T) -> (O1, O2); fn map2<U, O, F>(a0: Self::Type, a1: Self::Type, f: F) -> Self::Type
where
Self: Array<U> + Array<O>,
F: FnMut(T, U) -> O; fn map3<T2, T3, O, F>(
a0: Self::Type,
a1: Self::Type,
a2: Self::Type,
f: F
) -> Self::Type
where
Self: Array<T2> + Array<T3> + Array<O>,
F: FnMut(T, T2, T3) -> O; fn transpose<U, S>(a0: Self::Type) -> <U as Array<Self::Type>>::Type
where
Self: Array<S>,
U: Dim<S, Type = T> + Dim<Self::Type>,
U::Smaller: Array<S> + Array<Self::Type>; fn transpose_helper<U>(a0: <U as Array<Self::Type>>::Type) -> Self::Type
where
U: Array<Self::Type> + Array<T>,
Self: Array<<U as Array<T>>::Type>; }
Types that represent an array
Associated Types
type RawType
A raw array of the size equal to the dimension this type represents.
type Type
A custom array of the size equal to the dimension this type represents.
Required Methods
fn from_value(v: T) -> Self::Type where
T: Clone,
T: Clone,
Construct an array from a single value v
, replicating it to all positions in the array.
fn apply<F: FnMut(T)>(a0: Self::Type, f: F)
Apply f
to all the elements of the array
fn apply2<U, F>(a0: Self::Type, a1: Self::Type, f: F) where
Self: Array<U>,
F: FnMut(T, U),
Self: Array<U>,
F: FnMut(T, U),
Apply f
to all elements of two arrays.
fn fold<O, F>(a0: Self::Type, init: O, f: F) -> O where
F: FnMut(O, T) -> O,
F: FnMut(O, T) -> O,
Fold all the elements of the array with function f
fn fold2<U, O, F>(a0: Self::Type, a1: Self::Type, init: O, f: F) -> O where
Self: Array<U>,
F: FnMut(O, T, U) -> O,
Self: Array<U>,
F: FnMut(O, T, U) -> O,
Fold all the elements of two arrays with function f
fn map<O, F>(a0: Self::Type, f: F) -> Self::Type where
Self: Array<O>,
F: FnMut(T) -> O,
Self: Array<O>,
F: FnMut(T) -> O,
Map all the elements of the array with function f
fn map_into_2<O1, O2, F>(a0: Self::Type, f: F) -> (Self::Type, Self::Type) where
Self: Array<O1> + Array<O2>,
F: FnMut(T) -> (O1, O2),
Self: Array<O1> + Array<O2>,
F: FnMut(T) -> (O1, O2),
Map all the elements into two arrays with function f
fn map2<U, O, F>(a0: Self::Type, a1: Self::Type, f: F) -> Self::Type where
Self: Array<U> + Array<O>,
F: FnMut(T, U) -> O,
Self: Array<U> + Array<O>,
F: FnMut(T, U) -> O,
Map all the elements of two arrays with function f
fn map3<T2, T3, O, F>(
a0: Self::Type,
a1: Self::Type,
a2: Self::Type,
f: F
) -> Self::Type where
Self: Array<T2> + Array<T3> + Array<O>,
F: FnMut(T, T2, T3) -> O,
a0: Self::Type,
a1: Self::Type,
a2: Self::Type,
f: F
) -> Self::Type where
Self: Array<T2> + Array<T3> + Array<O>,
F: FnMut(T, T2, T3) -> O,
Map all the elements of three arrays with function f
fn transpose<U, S>(a0: Self::Type) -> <U as Array<Self::Type>>::Type where
Self: Array<S>,
U: Dim<S, Type = T> + Dim<Self::Type>,
U::Smaller: Array<S> + Array<Self::Type>,
Self: Array<S>,
U: Dim<S, Type = T> + Dim<Self::Type>,
U::Smaller: Array<S> + Array<Self::Type>,
Transpose the elements of a 2d array
fn transpose_helper<U>(a0: <U as Array<Self::Type>>::Type) -> Self::Type where
U: Array<Self::Type> + Array<T>,
Self: Array<<U as Array<T>>::Type>,
U: Array<Self::Type> + Array<T>,
Self: Array<<U as Array<T>>::Type>,
A helper to transpose the elements of a 2d array (recursion)