Trait ElementImpl

Source
pub trait ElementImpl {
    type Space: LinearSpace<F = Self::F, E = Self>;
    type F: RlstScalar;
    type View<'b>
       where Self: 'b;
    type ViewMut<'b>
       where Self: 'b;

    // Required methods
    fn space(&self) -> Rc<Self::Space>;
    fn view(&self) -> Self::View<'_>;
    fn view_mut(&mut self) -> Self::ViewMut<'_>;
    fn axpy_inplace(&mut self, alpha: Self::F, x: &Self);
    fn sub_inplace(&mut self, other: &Self);
    fn fill_inplace(&mut self, other: &Self);
    fn scale_inplace(&mut self, alpha: Self::F);

    // Provided method
    fn sum_inplace(&mut self, other: &Self) { ... }
}
Expand description

An Element of a linear spaces.

Required Associated Types§

Source

type Space: LinearSpace<F = Self::F, E = Self>

Space type

Source

type F: RlstScalar

Scalar Type

Source

type View<'b> where Self: 'b

View

Source

type ViewMut<'b> where Self: 'b

Mutable view

Required Methods§

Source

fn space(&self) -> Rc<Self::Space>

Return the associated function space.

Source

fn view(&self) -> Self::View<'_>

Get a view onto the element.

Source

fn view_mut(&mut self) -> Self::ViewMut<'_>

Get a mutable view onto the element.

Source

fn axpy_inplace(&mut self, alpha: Self::F, x: &Self)

self += alpha * x.

Source

fn sub_inplace(&mut self, other: &Self)

self -= other.

Source

fn fill_inplace(&mut self, other: &Self)

self = other.

Source

fn scale_inplace(&mut self, alpha: Self::F)

self *= alpha.

Provided Methods§

Source

fn sum_inplace(&mut self, other: &Self)

self += other.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, C: Communicator, Item: RlstScalar + Equivalence> ElementImpl for DistributedArrayVectorSpaceElement<'a, C, Item>

Source§

type F = Item

Source§

type Space = DistributedArrayVectorSpace<'a, C, Item>

Source§

type View<'b> = &'b DistributedVector<'a, C, Item> where Self: 'b

Source§

type ViewMut<'b> = &'b mut DistributedVector<'a, C, Item> where Self: 'b

Source§

impl<Item: RlstScalar> ElementImpl for ArrayVectorSpaceElement<Item>

Source§

type F = Item

Source§

type Space = ArrayVectorSpace<Item>

Source§

type View<'b> = Array<Item, ArrayRef<'b, Item, BaseArray<Item, VectorContainer<Item>, 1>, 1>, 1> where Self: 'b

Source§

type ViewMut<'b> = Array<Item, ArrayRefMut<'b, Item, BaseArray<Item, VectorContainer<Item>, 1>, 1>, 1> where Self: 'b