Struct TensorVector

Source
pub struct TensorVector<T>(/* private fields */)
where
    T: Tensor;

Implementations§

Source§

impl<const D: usize, const I: usize> TensorVector<TensorRank1<D, I>>

Source

pub fn zero(len: usize) -> Self

Source§

impl<const D: usize, const I: usize, const J: usize> TensorVector<TensorRank2<D, I, J>>

Source

pub fn zero(len: usize) -> Self

Source§

impl<const D: usize, const I: usize, const J: usize> TensorVector<TensorVector<TensorRank2<D, I, J>>>

Source

pub fn zero(len: usize) -> Self

Source§

impl<T> TensorVector<T>
where T: Tensor,

Source

pub const fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer valid for zero sized reads if the vector didn’t allocate.

Trait Implementations§

Source§

impl<T> Add<&TensorVector<T>> for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the + operator.
Source§

fn add(self, tensor_vec: &Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<T> Add for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T> AddAssign<&TensorVector<T>> for TensorVector<T>
where T: Tensor,

Source§

fn add_assign(&mut self, tensor_vec: &Self)

Performs the += operation. Read more
Source§

impl<T> AddAssign for TensorVector<T>
where T: Tensor,

Source§

fn add_assign(&mut self, tensor_vec: Self)

Performs the += operation. Read more
Source§

impl<T> Clone for TensorVector<T>
where T: Tensor + Clone,

Source§

fn clone(&self) -> TensorVector<T>

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<T> Debug for TensorVector<T>
where T: Tensor + Debug,

Source§

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

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

impl<T> Default for TensorVector<T>
where T: Tensor,

Source§

fn default() -> Self

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

impl<T> Display for TensorVector<T>
where T: Tensor,

Source§

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

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

impl<T> Div<&f64> for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the / operator.
Source§

fn div(self, tensor_rank_0: &TensorRank0) -> Self::Output

Performs the / operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Div<TensorVector<TensorVector<TensorRank2<D, I, J>>>> for &TensorRank1Vec<D, I>

Source§

type Output = TensorVector<TensorRank1<D, J>>

The resulting type after applying the / operator.
Source§

fn div(self, _tensor_rank_2_vec_2d: TensorRank2Vec2D<D, I, J>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T> Div<f64> for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the / operator.
Source§

fn div(self, tensor_rank_0: TensorRank0) -> Self::Output

Performs the / operation. Read more
Source§

impl<T> DivAssign<&f64> for TensorVector<T>
where T: Tensor,

Source§

fn div_assign(&mut self, tensor_rank_0: &TensorRank0)

Performs the /= operation. Read more
Source§

impl<T> DivAssign<f64> for TensorVector<T>
where T: Tensor,

Source§

fn div_assign(&mut self, tensor_rank_0: TensorRank0)

Performs the /= operation. Read more
Source§

impl<T> From<&[T]> for TensorVector<T>
where T: Tensor,

Source§

fn from(slice: &[T]) -> Self

Converts to this type from the input type.
Source§

impl<T, const N: usize> From<[T; N]> for TensorVector<T>
where T: Tensor,

Source§

fn from(array: [T; N]) -> Self

Converts to this type from the input type.
Source§

impl From<TensorVector<TensorRank1<3, 0>>> for TensorRank1Vec<3, 1>

Source§

fn from(tensor_rank_1_vec: TensorRank1Vec<3, 0>) -> Self

Converts to this type from the input type.
Source§

impl From<TensorVector<TensorRank1<3, 1>>> for TensorRank1Vec<3, 0>

Source§

fn from(tensor_rank_1_vec: TensorRank1Vec<3, 1>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize, const I: usize> From<TensorVector<TensorRank1<D, I>>> for Vec<[TensorRank0; D]>

Source§

fn from(tensor_rank_1_vec: TensorRank1Vec<D, I>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize, const I: usize> From<TensorVector<TensorRank1<D, I>>> for Vec<Vec<TensorRank0>>

Source§

fn from(tensor_rank_1_vec: TensorRank1Vec<D, I>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize, const I: usize> From<TensorVector<TensorRank1<D, I>>> for Vector

Source§

fn from(tensor_rank_1_vec: TensorRank1Vec<D, I>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize, const I: usize, const J: usize> From<TensorVector<TensorVector<TensorRank2<D, I, J>>>> for SquareMatrix

Source§

fn from(tensor_rank_2_vec_2d: TensorRank2Vec2D<D, I, J>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Vec<T>> for TensorVector<T>
where T: Tensor,

Source§

fn from(vec: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> FromIterator<T> for TensorVector<T>
where T: Tensor,

Source§

fn from_iter<Ii: IntoIterator<Item = T>>(into_iterator: Ii) -> Self

Creates a value from an iterator. Read more
Source§

impl<T> Index<usize> for TensorVector<T>
where T: Tensor,

Source§

type Output = T

The returned type after indexing.
Source§

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

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

impl<T> IndexMut<usize> for TensorVector<T>
where T: Tensor,

Source§

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

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

impl<T> IntoIterator for TensorVector<T>
where T: Tensor,

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<TensorVector<T> as IntoIterator>::Item>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<const D: usize, const I: usize> Mul<&TensorVector<TensorRank1<D, I>>> for &Matrix

Source§

type Output = Vector

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_1_vec: &TensorRank1Vec<D, I>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize> Mul<&TensorVector<TensorRank1<D, I>>> for &Vector

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_1_vec: &TensorRank1Vec<D, I>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Mul<&TensorVector<TensorRank1<D, J>>> for &TensorRank2<D, I, J>

Source§

type Output = TensorVector<TensorRank1<D, I>>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_1_vec: &TensorRank1Vec<D, J>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Mul<&TensorVector<TensorRank1<D, J>>> for TensorRank2<D, I, J>

Source§

type Output = TensorVector<TensorRank1<D, I>>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_1_vec: &TensorRank1Vec<D, J>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T> Mul<&f64> for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_0: &TensorRank0) -> Self::Output

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Mul<TensorVector<TensorRank1<D, J>>> for &TensorRank2<D, I, J>

Source§

type Output = TensorVector<TensorRank1<D, I>>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_1_vec: TensorRank1Vec<D, J>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Mul<TensorVector<TensorRank1<D, J>>> for TensorRank2<D, I, J>

Source§

type Output = TensorVector<TensorRank1<D, I>>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_1_vec: TensorRank1Vec<D, J>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize, const K: usize> Mul<TensorVector<TensorVector<TensorRank2<D, J, K>>>> for &TensorRank2<D, I, J>

Source§

type Output = TensorVector<TensorVector<TensorRank2<D, I, K>>>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_2_list_2d: TensorRank2Vec2D<D, J, K>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize, const K: usize> Mul<TensorVector<TensorVector<TensorRank2<D, J, K>>>> for TensorRank2<D, I, J>

Source§

type Output = TensorVector<TensorVector<TensorRank2<D, I, K>>>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_2_list_2d: TensorRank2Vec2D<D, J, K>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T> Mul<f64> for &TensorVector<T>
where T: Tensor, for<'a> &'a T: Mul<&'a TensorRank0, Output = T>,

Source§

type Output = TensorVector<T>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_0: TensorRank0) -> Self::Output

Performs the * operation. Read more
Source§

impl<T> Mul<f64> for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the * operator.
Source§

fn mul(self, tensor_rank_0: TensorRank0) -> Self::Output

Performs the * operation. Read more
Source§

impl<T> MulAssign<&f64> for TensorVector<T>
where T: Tensor,

Source§

fn mul_assign(&mut self, tensor_rank_0: &TensorRank0)

Performs the *= operation. Read more
Source§

impl<T> MulAssign<f64> for TensorVector<T>
where T: Tensor,

Source§

fn mul_assign(&mut self, tensor_rank_0: TensorRank0)

Performs the *= operation. Read more
Source§

impl<T> PartialEq for TensorVector<T>
where T: Tensor + PartialEq,

Source§

fn eq(&self, other: &TensorVector<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Sub<&TensorVector<T>> for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the - operator.
Source§

fn sub(self, tensor_vec: &Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<T> Sub for &TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T> Sub for TensorVector<T>
where T: Tensor,

Source§

type Output = TensorVector<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T> SubAssign<&TensorVector<T>> for TensorVector<T>
where T: Tensor,

Source§

fn sub_assign(&mut self, tensor_vec: &Self)

Performs the -= operation. Read more
Source§

impl<T> SubAssign for TensorVector<T>
where T: Tensor,

Source§

fn sub_assign(&mut self, tensor_vec: Self)

Performs the -= operation. Read more
Source§

impl<T> Sum for TensorVector<T>
where T: Tensor,

Source§

fn sum<Ii>(iter: Ii) -> Self
where Ii: Iterator<Item = Self>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<T> Tensor for TensorVector<T>
where T: Tensor,

Source§

type Item = T

The type of item encountered when iterating over the tensor.
Source§

fn iter(&self) -> impl Iterator<Item = &Self::Item>

Returns an iterator. Read more
Source§

fn iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Item>

Returns an iterator that allows modifying each value. Read more
Source§

fn len(&self) -> usize

Returns the number of elements, also referred to as the ‘length’.
Source§

fn size(&self) -> usize

Returns the total number of entries.
Source§

fn error_count( &self, other: &Self, tol_abs: &Scalar, tol_rel: &Scalar, ) -> Option<usize>

Returns number of different entries given absolute and relative tolerances.
Source§

fn full_contraction(&self, tensor: &Self) -> TensorRank0

Returns the full contraction with another tensor.
Source§

fn is_zero(&self) -> bool

Checks whether the tensor is the zero tensor.
Source§

fn norm(&self) -> TensorRank0

Returns the tensor norm.
Source§

fn norm_inf(&self) -> TensorRank0

Returns the infinity norm.
Source§

fn norm_squared(&self) -> TensorRank0

Returns the tensor norm squared.
Source§

fn normalize(&mut self)

Normalizes the tensor.
Source§

fn normalized(self) -> Self

Returns the tensor normalized.
Source§

fn sub_abs(&self, other: &Self) -> Self

Returns the positive difference of the two tensors.
Source§

fn sub_rel(&self, other: &Self) -> Self

Returns the relative difference of the two tensors.
Source§

impl<T> TensorVec for TensorVector<T>
where T: Tensor,

Source§

type Item = T

The type of element encountered when iterating over the tensor.
Source§

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

Moves all the elements of other into self, leaving other empty.
Source§

fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without reallocating.
Source§

fn is_empty(&self) -> bool

Returns true if the vector contains no elements.
Source§

fn new() -> Self

Constructs a new, empty Vec, not allocating until elements are pushed onto it.
Source§

fn push(&mut self, item: Self::Item)

Appends an element to the back of the Vec.
Source§

fn remove(&mut self, index: usize) -> Self::Item

Removes an element from the Vec and returns it, shifting elements to the left.
Source§

fn retain<F>(&mut self, f: F)
where F: FnMut(&Self::Item) -> bool,

Retains only the elements specified by the predicate.
Source§

fn swap_remove(&mut self, index: usize) -> Self::Item

Removes an element from the Vec and returns it, replacing it with the last element.
Source§

impl<T> StructuralPartialEq for TensorVector<T>
where T: Tensor,

Auto Trait Implementations§

§

impl<T> Freeze for TensorVector<T>

§

impl<T> RefUnwindSafe for TensorVector<T>
where T: RefUnwindSafe,

§

impl<T> Send for TensorVector<T>
where T: Send,

§

impl<T> Sync for TensorVector<T>
where T: Sync,

§

impl<T> Unpin for TensorVector<T>
where T: Unpin,

§

impl<T> UnwindSafe for TensorVector<T>
where T: 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<A, Y, U> OdeSolver<Y, U> for A
where A: Debug, Y: Tensor, U: TensorVec<Item = Y>,