Skip to main content

FaerVec

Struct FaerVec 

Source
pub struct FaerVec<T: FaerScalar> { /* private fields */ }

Trait Implementations§

Source§

impl<T: Scalar + FaerScalar> Add<&FaerVec<T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &FaerVec<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<&FaerVec<T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &FaerVec<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<&FaerVec<T>> for FaerVecRef<'_, T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &FaerVec<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<&FaerVecRef<'_, T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &FaerVecRef<'_, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<&FaerVecRef<'_, T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &FaerVecRef<'_, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<FaerVec<T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: FaerVec<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<FaerVec<T>> for FaerVecRef<'_, T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: FaerVec<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<FaerVecRef<'_, T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: FaerVecRef<'_, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add<FaerVecRef<'_, T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: FaerVecRef<'_, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> Add for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: FaerVec<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Scalar + FaerScalar> AddAssign<&FaerVec<T>> for FaerVec<T>

Source§

fn add_assign(&mut self, rhs: &FaerVec<T>)

Performs the += operation. Read more
Source§

impl<T: Scalar + FaerScalar> AddAssign<&FaerVec<T>> for FaerVecMut<'_, T>

Source§

fn add_assign(&mut self, rhs: &FaerVec<T>)

Performs the += operation. Read more
Source§

impl<T: Scalar + FaerScalar> AddAssign<&FaerVecRef<'_, T>> for FaerVec<T>

Source§

fn add_assign(&mut self, rhs: &FaerVecRef<'_, T>)

Performs the += operation. Read more
Source§

impl<T: Scalar + FaerScalar> AddAssign<FaerVec<T>> for FaerVecMut<'_, T>

Source§

fn add_assign(&mut self, rhs: FaerVec<T>)

Performs the += operation. Read more
Source§

impl<T: Scalar + FaerScalar> AddAssign<FaerVecRef<'_, T>> for FaerVec<T>

Source§

fn add_assign(&mut self, rhs: FaerVecRef<'_, T>)

Performs the += operation. Read more
Source§

impl<T: Scalar + FaerScalar> AddAssign for FaerVec<T>

Source§

fn add_assign(&mut self, rhs: FaerVec<T>)

Performs the += operation. Read more
Source§

impl<T: Clone + FaerScalar> Clone for FaerVec<T>

Source§

fn clone(&self) -> FaerVec<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 + FaerScalar> Debug for FaerVec<T>

Source§

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

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

impl<T: FaerScalar> DefaultDenseMatrix for FaerVec<T>

Source§

type M = FaerMat<T>

Source§

impl<'a, T: FaerScalar> Div<Scale<T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Scale<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: FaerScalar> From<Col<Own<T>>> for FaerVec<T>

Source§

fn from(data: Col<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Scalar + FaerScalar> Index<usize> for FaerVec<T>

Source§

type Output = T

The returned type after indexing.
Source§

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

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

impl<T: Scalar + FaerScalar> IndexMut<usize> for FaerVec<T>

Source§

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

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

impl<T: FaerScalar> Mul<Scale<T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: FaerScalar> Mul<Scale<T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, T: FaerScalar> MulAssign<Scale<T>> for FaerVec<T>

Source§

fn mul_assign(&mut self, rhs: Scale<T>)

Performs the *= operation. Read more
Source§

impl<T: PartialEq + FaerScalar> PartialEq for FaerVec<T>

Source§

fn eq(&self, other: &FaerVec<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: Scalar + FaerScalar> Sub<&FaerVec<T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &FaerVec<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<&FaerVec<T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &FaerVec<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<&FaerVec<T>> for FaerVecRef<'_, T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &FaerVec<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<&FaerVecRef<'_, T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &FaerVecRef<'_, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<&FaerVecRef<'_, T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &FaerVecRef<'_, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<FaerVec<T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<FaerVec<T>> for FaerVecRef<'_, T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<FaerVecRef<'_, T>> for &FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: FaerVecRef<'_, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub<FaerVecRef<'_, T>> for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: FaerVecRef<'_, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> Sub for FaerVec<T>

Source§

type Output = FaerVec<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Scalar + FaerScalar> SubAssign<&FaerVec<T>> for FaerVec<T>

Source§

fn sub_assign(&mut self, rhs: &FaerVec<T>)

Performs the -= operation. Read more
Source§

impl<T: Scalar + FaerScalar> SubAssign<&FaerVec<T>> for FaerVecMut<'_, T>

Source§

fn sub_assign(&mut self, rhs: &FaerVec<T>)

Performs the -= operation. Read more
Source§

impl<T: Scalar + FaerScalar> SubAssign<&FaerVecRef<'_, T>> for FaerVec<T>

Source§

fn sub_assign(&mut self, rhs: &FaerVecRef<'_, T>)

Performs the -= operation. Read more
Source§

impl<T: Scalar + FaerScalar> SubAssign<FaerVec<T>> for FaerVecMut<'_, T>

Source§

fn sub_assign(&mut self, rhs: FaerVec<T>)

Performs the -= operation. Read more
Source§

impl<T: Scalar + FaerScalar> SubAssign<FaerVecRef<'_, T>> for FaerVec<T>

Source§

fn sub_assign(&mut self, rhs: FaerVecRef<'_, T>)

Performs the -= operation. Read more
Source§

impl<T: Scalar + FaerScalar> SubAssign for FaerVec<T>

Source§

fn sub_assign(&mut self, rhs: FaerVec<T>)

Performs the -= operation. Read more
Source§

impl<T: FaerScalar> Vector for FaerVec<T>

Source§

type View<'a> = FaerVecRef<'a, T>

Source§

type ViewMut<'a> = FaerVecMut<'a, T>

Source§

type Index = FaerVecIndex

Source§

fn context(&self) -> &Self::C

Get the context associated with this vector (for device placement, threading, etc.).
Source§

fn inner_mut(&mut self) -> &mut Self::Inner

Get a mutable reference to the inner representation of the vector.
Source§

fn len(&self) -> IndexType

Get the length (number of elements) in this vector.
Source§

fn get_index(&self, index: IndexType) -> Self::T

Get the value at the specified index.
Source§

fn set_index(&mut self, index: IndexType, value: Self::T)

Set the value at the specified index to value.
Source§

fn norm(&self, k: i32) -> T

Compute the $\ell_k$ norm: $(\sum_i |x_i|^k)^{1/k}$
Source§

fn squared_norm(&self, y: &Self, atol: &Self, rtol: Self::T) -> Self::T

Compute the squared weighted norm for error control: $\sum_i (x_i / (|y_i| \cdot \text{rtol} + \text{atol}_i))^2$ Read more
Source§

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

Create an immutable view of this vector.
Source§

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

Create a mutable view of this vector.
Source§

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

Copy all values from other into this vector.
Source§

fn copy_from_view(&mut self, other: &Self::View<'_>)

Copy all values from a vector view into this vector.
Source§

fn fill(&mut self, value: Self::T)

Fill all elements of this vector with value.
Source§

fn from_element(nstates: usize, value: Self::T, ctx: Self::C) -> Self

Create a vector of length nstates with all elements initialized to value.
Source§

fn from_vec(vec: Vec<Self::T>, ctx: Self::C) -> Self

Create a vector from a Rust Vec.
Source§

fn from_slice(slice: &[Self::T], ctx: Self::C) -> Self

Create a vector from a slice.
Source§

fn clone_as_vec(&self) -> Vec<Self::T>

Clone this vector as a Rust Vec.
Source§

fn zeros(nstates: usize, ctx: Self::C) -> Self

Create a vector of length nstates with all elements set to zero.
Source§

fn axpy(&mut self, alpha: Self::T, x: &Self, beta: Self::T)

Compute the AXPY operation: self = alpha * x + beta * self
Source§

fn axpy_v(&mut self, alpha: Self::T, x: &Self::View<'_>, beta: Self::T)

Compute the AXPY operation with a vector view: self = alpha * x + beta * self
Source§

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

Element-wise multiplication: self_i *= other_i
Source§

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

Element-wise division: self_i /= other_i
Source§

fn root_finding(&self, g1: &Self) -> (bool, Self::T, i32)

Detect roots (zero crossings) between this vector (as g0) and another vector (g1). Read more
Source§

fn assign_at_indices(&mut self, indices: &Self::Index, value: Self::T)

Assign value to all elements at the specified indices.
Source§

fn copy_from_indices(&mut self, other: &Self, indices: &Self::Index)

Copy values from other at the specified indices: self[indices[i]] = other[indices[i]]
Source§

fn gather(&mut self, other: &Self, indices: &Self::Index)

Gather values from other at indices: self[i] = other[indices[i]]
Source§

fn scatter(&self, indices: &Self::Index, other: &mut Self)

Scatter values to other at indices: other[indices[i]] = self[i]
Source§

fn is_empty(&self) -> bool

Check if the vector is empty.
Source§

fn assert_eq_st(&self, other: &Self, tol: Self::T)

Assert that this vector equals other within a scalar tolerance tol.
Source§

fn assert_eq_norm( &self, other: &Self, atol: &Self, rtol: Self::T, factor: Self::T, )

Assert that this vector equals other using a weighted norm (same as used by ODE solvers). Read more
Source§

fn assert_eq(&self, other: &Self, tol: &Self)

Assert that this vector equals other using a vector of per-element tolerances.
Source§

fn assert_eq_vec(s: Vec<Self::T>, other: Vec<Self::T>, tol: Vec<Self::T>)

Source§

impl<T: Scalar + FaerScalar> VectorCommon for FaerVec<T>

Source§

type T = T

Source§

type C = FaerContext

Source§

type Inner = Col<Own<T>>

Source§

fn inner(&self) -> &Self::Inner

Source§

impl<T: FaerScalar> VectorHost for FaerVec<T>

Source§

fn as_mut_slice(&mut self) -> &mut [Self::T]

Get the vector data as a mutable slice.
Source§

fn as_slice(&self) -> &[Self::T]

Get the vector data as an immutable slice.
Source§

impl<T: FaerScalar> StructuralPartialEq for FaerVec<T>

Auto Trait Implementations§

§

impl<T> Freeze for FaerVec<T>

§

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

§

impl<T> Send for FaerVec<T>

§

impl<T> Sync for FaerVec<T>

§

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

§

impl<T> UnsafeUnpin for FaerVec<T>

§

impl<T> UnwindSafe for FaerVec<T>

Blanket Implementations§

Source§

impl<Rhs, Lhs, Output> AddByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Add<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn add_by_ref(&self, rhs: &Rhs) -> <Lhs as AddByRef<Rhs>>::Output

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Rhs, Lhs, Output> SubByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Sub<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn sub_by_ref(&self, rhs: &Rhs) -> <Lhs as SubByRef<Rhs>>::Output

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T, Right> ClosedAdd<Right> for T
where T: Add<Right, Output = T> + AddAssign<Right>,

Source§

impl<T, Right> ClosedAddAssign<Right> for T
where T: ClosedAdd<Right> + AddAssign<Right>,

Source§

impl<T, Right> ClosedMul<Right> for T
where T: Mul<Right, Output = T> + MulAssign<Right>,

Source§

impl<T, Right> ClosedMulAssign<Right> for T
where T: ClosedMul<Right> + MulAssign<Right>,

Source§

impl<T, Right> ClosedSub<Right> for T
where T: Sub<Right, Output = T> + SubAssign<Right>,

Source§

impl<T, Right> ClosedSubAssign<Right> for T
where T: ClosedSub<Right> + SubAssign<Right>,

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<V, Rhs> VectorMutOpsByValue<Rhs> for V
where V: VectorCommon + AddAssign<Rhs> + SubAssign<Rhs>,

Source§

impl<V, Rhs, Output> VectorOpsByValue<Rhs, Output> for V
where V: VectorCommon + Add<Rhs, Output = Output> + Sub<Rhs, Output = Output>,

Source§

impl<RefT, V> VectorRef<V> for RefT
where V: Vector, RefT: VectorOpsByValue<V, V> + for<'a> VectorOpsByValue<&'a V, V> + for<'a> VectorOpsByValue<<V as Vector>::View<'a>, V> + for<'a, 'b> VectorOpsByValue<&'a <V as Vector>::View<'b>, V> + Mul<Scale<<V as VectorCommon>::T>, Output = V>,