Trait peroxide::traits::math::Vector

source ·
pub trait Vector {
    type Scalar;

    // Required methods
    fn add_vec(&self, rhs: &Self) -> Self;
    fn sub_vec(&self, rhs: &Self) -> Self;
    fn mul_scalar(&self, rhs: Self::Scalar) -> Self;
}
Expand description

Mathematical Vector

§Description

Vector has two operations : addition, scalar multiplication. And a space of the vector should closed for that operations.

Required Associated Types§

Required Methods§

source

fn add_vec(&self, rhs: &Self) -> Self

source

fn sub_vec(&self, rhs: &Self) -> Self

source

fn mul_scalar(&self, rhs: Self::Scalar) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Vector for f64

§

type Scalar = f64

source§

fn add_vec(&self, rhs: &Self) -> Self

source§

fn sub_vec(&self, rhs: &Self) -> Self

source§

fn mul_scalar(&self, rhs: Self::Scalar) -> Self

source§

impl Vector for Vec<AD>

§

type Scalar = AD

source§

fn add_vec(&self, rhs: &Self) -> Self

source§

fn sub_vec(&self, rhs: &Self) -> Self

source§

fn mul_scalar(&self, rhs: Self::Scalar) -> Self

source§

impl Vector for Vec<f64>

§

type Scalar = f64

source§

fn add_vec(&self, rhs: &Self) -> Self

source§

fn sub_vec(&self, rhs: &Self) -> Self

source§

fn mul_scalar(&self, rhs: Self::Scalar) -> Self

Implementors§