ScalarField

Trait ScalarField 

Source
pub trait ScalarField {
    type Point;
    type Scalar;

    // Required method
    fn value(&self, point: Self::Point) -> Self::Scalar;

    // Provided methods
    fn map<S, F>(self, func: F) -> MapField<Self, F>
       where Self: Sized,
             F: Fn(Self::Scalar) -> S { ... }
    fn transform<P, F>(self, func: F) -> TransformField<Self, P, F>
       where Self: Sized,
             F: Fn(P) -> Self::Point { ... }
}

Required Associated Types§

Required Methods§

Source

fn value(&self, point: Self::Point) -> Self::Scalar

Provided Methods§

Source

fn map<S, F>(self, func: F) -> MapField<Self, F>
where Self: Sized, F: Fn(Self::Scalar) -> S,

Source

fn transform<P, F>(self, func: F) -> TransformField<Self, P, F>
where Self: Sized, F: Fn(P) -> Self::Point,

Trait Implementations§

Source§

impl<Rhs, P, S> Add<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Add<Rhs::Scalar>,

Source§

type Output = AddField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Rhs) -> Self::Output

Performs the + operation. Read more
Source§

impl<Rhs, P, S> BitAnd<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: BitAnd<Rhs::Scalar>,

Source§

type Output = BitAndField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Rhs) -> Self::Output

Performs the & operation. Read more
Source§

impl<Rhs, P, S> BitOr<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: BitOr<Rhs::Scalar>,

Source§

type Output = BitOrField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Rhs) -> Self::Output

Performs the | operation. Read more
Source§

impl<Rhs, P, S> BitXor<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: BitXor<Rhs::Scalar>,

Source§

type Output = BitXorField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Rhs) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<Rhs, P, S> Div<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Div<Rhs::Scalar>,

Source§

type Output = DivField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Rhs) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs, P, S> Mul<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Mul<Rhs::Scalar>,

Source§

type Output = MulField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Rhs) -> Self::Output

Performs the * operation. Read more
Source§

impl<P, S> Neg for Box<dyn ScalarField<Point = P, Scalar = S>>
where <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Neg,

Source§

type Output = NegField<Box<dyn ScalarField<Point = P, Scalar = S>>>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<P, S> Not for Box<dyn ScalarField<Point = P, Scalar = S>>
where <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Not,

Source§

type Output = NotField<Box<dyn ScalarField<Point = P, Scalar = S>>>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<Rhs, P, S> Rem<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Rem<Rhs::Scalar>,

Source§

type Output = RemField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Rhs) -> Self::Output

Performs the % operation. Read more
Source§

impl<P, S> ScalarField for Box<dyn ScalarField<Point = P, Scalar = S>>

Source§

type Point = P

Source§

type Scalar = S

Source§

fn value(&self, point: Self::Point) -> Self::Scalar

Source§

fn map<S, F>(self, func: F) -> MapField<Self, F>
where Self: Sized, F: Fn(Self::Scalar) -> S,

Source§

fn transform<P, F>(self, func: F) -> TransformField<Self, P, F>
where Self: Sized, F: Fn(P) -> Self::Point,

Source§

impl<Rhs, P, S> Shl<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Shl<Rhs::Scalar>,

Source§

type Output = ShlField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Rhs) -> Self::Output

Performs the << operation. Read more
Source§

impl<Rhs, P, S> Shr<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Shr<Rhs::Scalar>,

Source§

type Output = ShrField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Rhs) -> Self::Output

Performs the >> operation. Read more
Source§

impl<Rhs, P, S> Sub<Rhs> for Box<dyn ScalarField<Point = P, Scalar = S>>
where Rhs: ScalarField<Point = <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Point>, <Box<dyn ScalarField<Point = P, Scalar = S>> as ScalarField>::Scalar: Sub<Rhs::Scalar>,

Source§

type Output = SubField<Box<dyn ScalarField<Point = P, Scalar = S>>, Rhs>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Rhs) -> Self::Output

Performs the - operation. Read more

Implementations on Foreign Types§

Source§

impl<P, S> ScalarField for Box<dyn ScalarField<Point = P, Scalar = S>>

Source§

type Point = P

Source§

type Scalar = S

Source§

fn value(&self, point: Self::Point) -> Self::Scalar

Implementors§

Source§

impl<I, P, F> ScalarField for TransformField<I, P, F>
where I: ScalarField, F: Fn(P) -> I::Point,

Source§

impl<I, S, F> ScalarField for MapField<I, F>
where I: ScalarField, F: Fn(I::Scalar) -> S,

Source§

impl<L, R> ScalarField for AddField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: Add<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for BitAndField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: BitAnd<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for BitOrField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: BitOr<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for BitXorField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: BitXor<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for DivField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: Div<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for MulField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: Mul<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for RemField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: Rem<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for ShlField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: Shl<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for ShrField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: Shr<R::Scalar>, L::Point: Clone,

Source§

impl<L, R> ScalarField for SubField<L, R>
where L: ScalarField, R: ScalarField<Point = L::Point>, L::Scalar: Sub<R::Scalar>, L::Point: Clone,

Source§

impl<P, S, F> ScalarField for FunctionField<P, F>
where F: Fn(P) -> S,

Source§

type Point = P

Source§

type Scalar = S

Source§

impl<P, S: Clone> ScalarField for ConstantField<P, S>

Source§

type Point = P

Source§

type Scalar = S

Source§

impl<T> ScalarField for IdentityField<T>

Source§

type Point = T

Source§

type Scalar = T

Source§

impl<T> ScalarField for NegField<T>
where T: ScalarField, T::Scalar: Neg,

Source§

impl<T> ScalarField for NotField<T>
where T: ScalarField, T::Scalar: Not,

Source§

impl<T: ScalarField> ScalarField for ScalarFieldWrapper<T>