Trait gad::array::ArrayAlgebra [−][src]
pub trait ArrayAlgebra<Value> { type Dims; type Scalar; fn flat(&mut self, v: &Value) -> Value; fn moddims(&mut self, v: &Value, dims: Self::Dims) -> Result<Value>; fn tile_as(&mut self, v: &Value, dims: Self::Dims) -> Result<Value>; fn sum_as(&mut self, v: &Value, dims: Self::Dims) -> Result<Value>; fn constant_as(&mut self, v: &Self::Scalar, dims: Self::Dims) -> Value; fn as_scalar(&mut self, v: &Value) -> Result<Self::Scalar>; fn scale(&mut self, lambda: &Self::Scalar, v: &Value) -> Value; fn dot(&mut self, v1: &Value, v2: &Value) -> Result<Self::Scalar>; fn norm2(&mut self, v: &Value) -> Self::Scalar { ... } }
Array operations.
Associated Types
Loading content...Required methods
fn flat(&mut self, v: &Value) -> Value
[src]
Re-shape the input into a single dimension array.
fn moddims(&mut self, v: &Value, dims: Self::Dims) -> Result<Value>
[src]
Re-shape the input into an array of the given dimensions.
fn tile_as(&mut self, v: &Value, dims: Self::Dims) -> Result<Value>
[src]
Repeats the input to match the given shape.
fn sum_as(&mut self, v: &Value, dims: Self::Dims) -> Result<Value>
[src]
Sums some of the dimension of the input to fit the given shape.
fn constant_as(&mut self, v: &Self::Scalar, dims: Self::Dims) -> Value
[src]
Fill an array of the given shape with the given scalar value.
fn as_scalar(&mut self, v: &Value) -> Result<Self::Scalar>
[src]
Read the scalar value in a one-element array.
fn scale(&mut self, lambda: &Self::Scalar, v: &Value) -> Value
[src]
Multiply the array element-wise by the given scalar.
fn dot(&mut self, v1: &Value, v2: &Value) -> Result<Self::Scalar>
[src]
Compute the dot-product of two arrays of the same shape.
Provided methods
Loading content...Implementors
impl ArrayAlgebra<Dim4> for Check
[src]
type Dims = Dim4
type Scalar = ()
fn flat(&mut self, v: &Dim4) -> Dim4
[src]
fn moddims(&mut self, v: &Dim4, dims: Dim4) -> Result<Dim4>
[src]
fn tile_as(&mut self, v: &Dim4, rdims: Dim4) -> Result<Dim4>
[src]
fn sum_as(&mut self, v: &Dim4, rdims: Dim4) -> Result<Dim4>
[src]
fn constant_as(&mut self, _v: &(), dims: Dim4) -> Dim4
[src]
fn as_scalar(&mut self, v: &Dim4) -> Result<()>
[src]
fn scale(&mut self, _lambda: &(), v: &Dim4) -> Dim4
[src]
fn dot(&mut self, v1: &Dim4, v2: &Dim4) -> Result<()>
[src]
impl<D, E, T, Dims> ArrayAlgebra<Value<D>> for Graph<Config1<E>> where
E: Default + Clone + CoreAlgebra<D, Value = D> + CoreAlgebra<T, Value = T> + LinkedAlgebra<Value<D>, D> + LinkedAlgebra<Value<T>, T> + ArrayAlgebra<D, Scalar = T, Dims = Dims>,
Dims: PartialEq + Clone + Copy + Debug + Default + 'static + Send + Sync,
D: HasDims<Dims = Dims> + Clone + 'static + Send + Sync,
T: Number,
[src]
E: Default + Clone + CoreAlgebra<D, Value = D> + CoreAlgebra<T, Value = T> + LinkedAlgebra<Value<D>, D> + LinkedAlgebra<Value<T>, T> + ArrayAlgebra<D, Scalar = T, Dims = Dims>,
Dims: PartialEq + Clone + Copy + Debug + Default + 'static + Send + Sync,
D: HasDims<Dims = Dims> + Clone + 'static + Send + Sync,
T: Number,
type Dims = Dims
type Scalar = Value<T>
fn flat(&mut self, v: &Value<D>) -> Value<D>
[src]
fn moddims(&mut self, v: &Value<D>, rdims: Dims) -> Result<Value<D>>
[src]
fn tile_as(&mut self, v: &Value<D>, rdims: Dims) -> Result<Value<D>>
[src]
fn sum_as(&mut self, v: &Value<D>, rdims: Dims) -> Result<Value<D>>
[src]
fn constant_as(&mut self, v: &Value<T>, dims: Dims) -> Value<D>
[src]
fn as_scalar(&mut self, v: &Value<D>) -> Result<Value<T>>
[src]
fn scale(&mut self, v1: &Value<T>, v2: &Value<D>) -> Value<D>
[src]
fn dot(&mut self, v1: &Value<D>, v2: &Value<D>) -> Result<Value<T>>
[src]
impl<D, E, T, Dims> ArrayAlgebra<Value<D>> for Graph<ConfigN<E>> where
E: Default + Clone + CoreAlgebra<D, Value = D> + CoreAlgebra<T, Value = T> + LinkedAlgebra<Value<D>, D> + LinkedAlgebra<Value<T>, T> + ArrayAlgebra<D, Scalar = T, Dims = Dims>,
Dims: PartialEq + Clone + Copy + Debug + Default + 'static + Send + Sync,
D: HasDims<Dims = Dims> + Clone + 'static + Send + Sync,
T: Number,
[src]
E: Default + Clone + CoreAlgebra<D, Value = D> + CoreAlgebra<T, Value = T> + LinkedAlgebra<Value<D>, D> + LinkedAlgebra<Value<T>, T> + ArrayAlgebra<D, Scalar = T, Dims = Dims>,
Dims: PartialEq + Clone + Copy + Debug + Default + 'static + Send + Sync,
D: HasDims<Dims = Dims> + Clone + 'static + Send + Sync,
T: Number,
type Dims = Dims
type Scalar = Value<T>
fn flat(&mut self, v: &Value<D>) -> Value<D>
[src]
fn moddims(&mut self, v: &Value<D>, rdims: Dims) -> Result<Value<D>>
[src]
fn tile_as(&mut self, v: &Value<D>, rdims: Dims) -> Result<Value<D>>
[src]
fn sum_as(&mut self, v: &Value<D>, rdims: Dims) -> Result<Value<D>>
[src]
fn constant_as(&mut self, v: &Value<T>, dims: Dims) -> Value<D>
[src]
fn as_scalar(&mut self, v: &Value<D>) -> Result<Value<T>>
[src]
fn scale(&mut self, v1: &Value<T>, v2: &Value<D>) -> Value<D>
[src]
fn dot(&mut self, v1: &Value<D>, v2: &Value<D>) -> Result<Value<T>>
[src]
impl<T> ArrayAlgebra<Array<T>> for Eval where
T: Float,
[src]
T: Float,