Vector

Struct Vector 

Source
pub struct Vector<K> {
    pub _d: Vec<K>,
}

Fields§

§_d: Vec<K>

Implementations§

Source§

impl<K: Scalar> Vector<K>

Source

pub fn zero(size: usize) -> Self

Source

pub fn size(&self) -> usize

Source

pub fn first(&self) -> Option<&K>

Source

pub fn is_empty(&self) -> bool

Source

pub fn add(&mut self, v: &Vector<K>)

Source

pub fn sub(&mut self, vec: &Vector<K>)

Source

pub fn scl(&mut self, a: K)

Source

pub fn norm_1(&self) -> K::AbsOutput

Source

pub fn norm(&self) -> K::AbsOutput

Source

pub fn norm_inf(&self) -> K::AbsOutput

Trait Implementations§

Source§

impl<K: Scalar> Add for Vector<K>

Source§

type Output = Vector<K>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<K: Scalar> AddAssign<&Vector<K>> for Vector<K>

Source§

fn add_assign(&mut self, rhs: &Vector<K>)

Performs the += operation. Read more
Source§

impl Angle for Vector<Complex>

Source§

impl Angle for Vector<f32>

Source§

impl Angle for Vector<f64>

Source§

impl<K: Clone> Clone for Vector<K>

Source§

fn clone(&self) -> Vector<K>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Scalar> Debug for Vector<K>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: Default> Default for Vector<K>

Source§

fn default() -> Vector<K>

Returns the “default value” for a type. Read more
Source§

impl Dot<Complex> for Vector<Complex>

Source§

fn dot(&self, v: &Vector<Complex>) -> Complex

Source§

impl Dot<f32> for Vector<f32>

Source§

fn dot(&self, v: &Vector<f32>) -> f32

Source§

impl Dot<f64> for Vector<f64>

Source§

fn dot(&self, v: &Vector<f64>) -> f64

Source§

impl<K: Clone, const N: usize> From<[K; N]> for Vector<K>

Source§

fn from(data: [K; N]) -> Self

Converts to this type from the input type.
Source§

impl<K> From<Vec<K>> for Vector<K>

Source§

fn from(data: Vec<K>) -> Self

Converts to this type from the input type.
Source§

impl<K> Index<usize> for Vector<K>

Source§

type Output = K

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Lerp for Vector<Complex>

Source§

fn lerp(u: Self, v: Self, t: f32) -> Self

Source§

impl Lerp for Vector<f32>

Source§

fn lerp(u: Self, v: Self, t: f32) -> Self

Source§

impl Lerp for Vector<f64>

Source§

fn lerp(u: Self, v: Self, t: f32) -> Self

Source§

impl Mul<&[Complex]> for &Vector<Complex>

Source§

type Output = Complex

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &[Complex]) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&[f32]> for &Vector<f32>

Source§

type Output = f32

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &[f32]) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&[f64]> for &Vector<f64>

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &[f64]) -> Self::Output

Performs the * operation. Read more
Source§

impl<K: Scalar + Mul<U, Output = K>, U: Scalar> Mul<&U> for &Vector<K>

Source§

type Output = Vector<K>

The resulting type after applying the * operator.
Source§

fn mul(self, a: &U) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vec<Complex>> for &Vector<Complex>

Source§

type Output = Complex

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec<Complex>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vec<f32>> for &Vector<f32>

Source§

type Output = f32

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec<f32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vec<f64>> for &Vector<f64>

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<Complex>> for &[Complex]

Source§

type Output = Complex

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<Complex>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<Complex>> for &Vector<Complex>

Source§

type Output = Complex

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<Complex>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, K: Scalar> Mul<&Vector<K>> for &Matrix<K>
where [K]: Dot<K>,

Source§

type Output = Vector<K>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<K>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<f32>> for &[f32]

Source§

type Output = f32

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<f32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<f32>> for &Vec<f32>

Source§

type Output = f32

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<f32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<f32>> for &Vector<f32>

Source§

type Output = f32

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<f32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<f64>> for &[f64]

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<f64>> for &Vec<f64>

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vector<f64>> for &Vector<f64>

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl<K: Scalar + Mul<U, Output = K>, U: Scalar> Mul<U> for Vector<K>

Source§

type Output = Vector<K>

The resulting type after applying the * operator.
Source§

fn mul(self, a: U) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAdd<Complex, Vector<Complex>> for Vector<Complex>

Source§

fn mul_add(self, a: &Complex, b: &Vector<Complex>) -> Self

Source§

impl MulAdd<f32, Vector<f32>> for Vector<f32>

Source§

fn mul_add(self, a: &f32, b: &Vector<f32>) -> Self

Source§

impl MulAdd<f64, Vector<Complex>> for Vector<Complex>

Source§

fn mul_add(self, a: &f64, b: &Vector<Complex>) -> Self

Source§

impl MulAdd<f64, Vector<f64>> for Vector<f64>

Source§

fn mul_add(self, a: &f64, b: &Vector<f64>) -> Self

Source§

impl<K: Scalar + MulAssign<U>, U: Scalar> MulAssign<&U> for Vector<K>

Source§

fn mul_assign(&mut self, a: &U)

Performs the *= operation. Read more
Source§

impl<K: Scalar> Sub for Vector<K>

Source§

type Output = Vector<K>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<K: Scalar> SubAssign<&Vector<K>> for Vector<K>

Source§

fn sub_assign(&mut self, rhs: &Vector<K>)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<K> Freeze for Vector<K>

§

impl<K> RefUnwindSafe for Vector<K>
where K: RefUnwindSafe,

§

impl<K> Send for Vector<K>
where K: Send,

§

impl<K> Sync for Vector<K>
where K: Sync,

§

impl<K> Unpin for Vector<K>
where K: Unpin,

§

impl<K> UnwindSafe for Vector<K>
where K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.