Struct matmath::vector_class::Vector [−][src]
pub struct Vector<T> { /* fields omitted */ }
A Vector with generic type items.
Can be indexed by vector[i]
Methods
impl<T> Vector<T>
[src]
impl<T> Vector<T>
pub fn new(data: Vec<T>) -> Self
[src]
pub fn new(data: Vec<T>) -> Self
pub fn dim(&self) -> usize
[src]
pub fn dim(&self) -> usize
pub fn scaled<U, O>(self, scalar: U) -> Vector<O> where
T: Mul<U, Output = O>,
U: Clone,
[src]
pub fn scaled<U, O>(self, scalar: U) -> Vector<O> where
T: Mul<U, Output = O>,
U: Clone,
Multiplies the vector with a scalar
pub fn zip<U>(self, other: Vector<U>) -> Vector<(T, U)>
[src]
pub fn zip<U>(self, other: Vector<U>) -> Vector<(T, U)>
pub fn map<F, U>(self, f: F) -> Vector<U> where
F: Fn(T) -> U,
[src]
pub fn map<F, U>(self, f: F) -> Vector<U> where
F: Fn(T) -> U,
Applies a function to every element of the vector
Trait Implementations
impl<T, U, O> Mul<Vector<U>> for Matrix<T> where
T: Mul<U, Output = O> + Clone,
U: Clone,
O: Add<O, Output = O>,
[src]
impl<T, U, O> Mul<Vector<U>> for Matrix<T> where
T: Mul<U, Output = O> + Clone,
U: Clone,
O: Add<O, Output = O>,
Matrix-Vector Multiplication
type Output = Vector<O>
The resulting type after applying the *
operator.
fn mul(self, rhs: Vector<U>) -> Vector<O>
[src]
fn mul(self, rhs: Vector<U>) -> Vector<O>
Performs the *
operation.
impl<T: Debug> Debug for Vector<T>
[src]
impl<T: Debug> Debug for Vector<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Clone> Clone for Vector<T>
[src]
impl<T: Clone> Clone for Vector<T>
fn clone(&self) -> Vector<T>
[src]
fn clone(&self) -> Vector<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: PartialEq> PartialEq for Vector<T>
[src]
impl<T: PartialEq> PartialEq for Vector<T>
fn eq(&self, other: &Vector<T>) -> bool
[src]
fn eq(&self, other: &Vector<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vector<T>) -> bool
[src]
fn ne(&self, other: &Vector<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Vector<T>
[src]
impl<T: Eq> Eq for Vector<T>
impl<T> Display for Vector<T> where
T: Display + Clone,
[src]
impl<T> Display for Vector<T> where
T: Display + Clone,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Into<Matrix<T>> for Vector<T>
[src]
impl<T> Into<Matrix<T>> for Vector<T>
A Vector can be cast to a matrix and back
impl<T> From<Matrix<T>> for Vector<T>
[src]
impl<T> From<Matrix<T>> for Vector<T>
A Vector can be cast to a matrix and back
impl<T> Index<usize> for Vector<T>
[src]
impl<T> Index<usize> for Vector<T>
type Output = T
The returned type after indexing.
fn index(&self, i: usize) -> &T
[src]
fn index(&self, i: usize) -> &T
Performs the indexing (container[index]
) operation.
impl<T> IndexMut<usize> for Vector<T>
[src]
impl<T> IndexMut<usize> for Vector<T>
fn index_mut(&mut self, i: usize) -> &mut T
[src]
fn index_mut(&mut self, i: usize) -> &mut T
Performs the mutable indexing (container[index]
) operation.
impl<T, U, O> Add<Vector<U>> for Vector<T> where
T: Add<U, Output = O>,
[src]
impl<T, U, O> Add<Vector<U>> for Vector<T> where
T: Add<U, Output = O>,
Adds two vectors element by element
type Output = Vector<O>
The resulting type after applying the +
operator.
fn add(self, rhs: Vector<U>) -> Vector<O>
[src]
fn add(self, rhs: Vector<U>) -> Vector<O>
Performs the +
operation.
impl<T, U, O> Sub<Vector<U>> for Vector<T> where
T: Sub<U, Output = O>,
[src]
impl<T, U, O> Sub<Vector<U>> for Vector<T> where
T: Sub<U, Output = O>,
Subtracts two vectors element by element
type Output = Vector<O>
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector<U>) -> Vector<O>
[src]
fn sub(self, rhs: Vector<U>) -> Vector<O>
Performs the -
operation.
impl<T, O> Neg for Vector<T> where
T: Neg<Output = O>,
[src]
impl<T, O> Neg for Vector<T> where
T: Neg<Output = O>,
type Output = Vector<O>
The resulting type after applying the -
operator.
fn neg(self) -> Vector<O>
[src]
fn neg(self) -> Vector<O>
Performs the unary -
operation.
impl<T, U, O> Rem<U> for Vector<T> where
T: Rem<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> Rem<U> for Vector<T> where
T: Rem<U, Output = O>,
U: Clone,
type Output = Vector<O>
The resulting type after applying the %
operator.
fn rem(self, rhs: U) -> Vector<O>
[src]
fn rem(self, rhs: U) -> Vector<O>
Performs the %
operation.
impl<T, U, O> BitAnd<U> for Vector<T> where
T: BitAnd<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> BitAnd<U> for Vector<T> where
T: BitAnd<U, Output = O>,
U: Clone,
type Output = Vector<O>
The resulting type after applying the &
operator.
fn bitand(self, rhs: U) -> Vector<O>
[src]
fn bitand(self, rhs: U) -> Vector<O>
Performs the &
operation.
impl<T, U, O> BitOr<U> for Vector<T> where
T: BitOr<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> BitOr<U> for Vector<T> where
T: BitOr<U, Output = O>,
U: Clone,
type Output = Vector<O>
The resulting type after applying the |
operator.
fn bitor(self, rhs: U) -> Vector<O>
[src]
fn bitor(self, rhs: U) -> Vector<O>
Performs the |
operation.
impl<T, U, O> BitXor<U> for Vector<T> where
T: BitXor<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> BitXor<U> for Vector<T> where
T: BitXor<U, Output = O>,
U: Clone,
type Output = Vector<O>
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: U) -> Vector<O>
[src]
fn bitxor(self, rhs: U) -> Vector<O>
Performs the ^
operation.
impl<T, O> Not for Vector<T> where
T: Not<Output = O>,
[src]
impl<T, O> Not for Vector<T> where
T: Not<Output = O>,
type Output = Vector<O>
The resulting type after applying the !
operator.
fn not(self) -> Vector<O>
[src]
fn not(self) -> Vector<O>
Performs the unary !
operation.
impl<T, U, O> Shl<U> for Vector<T> where
T: Shl<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> Shl<U> for Vector<T> where
T: Shl<U, Output = O>,
U: Clone,
type Output = Vector<O>
The resulting type after applying the <<
operator.
fn shl(self, rhs: U) -> Vector<O>
[src]
fn shl(self, rhs: U) -> Vector<O>
Performs the <<
operation.
impl<T, U, O> Shr<U> for Vector<T> where
T: Shr<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> Shr<U> for Vector<T> where
T: Shr<U, Output = O>,
U: Clone,