pub struct FaerVec<T>where
T: FaerScalar,{ /* private fields */ }Implementations§
Source§impl<T> FaerVec<T>where
T: FaerScalar,
impl<T> FaerVec<T>where
T: FaerScalar,
pub fn check_for_nan(&self, label: &str) -> bool
Trait Implementations§
Source§impl<T> Add<&FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
impl<T> Add<&FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
Source§impl<T> Add<&FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Add<&FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> Add<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Add<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> Add<FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
impl<T> Add<FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
Source§impl<T> Add<FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Add<FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> Add<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Add<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> AddAssign for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> AddAssign for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn add_assign(&mut self, rhs: FaerVec<T>)
fn add_assign(&mut self, rhs: FaerVec<T>)
Performs the
+= operation. Read moreSource§impl<T> AddAssign<&FaerVec<T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> AddAssign<&FaerVec<T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn add_assign(&mut self, rhs: &FaerVec<T>)
fn add_assign(&mut self, rhs: &FaerVec<T>)
Performs the
+= operation. Read moreSource§impl<T> AddAssign<&FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
impl<T> AddAssign<&FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
Source§fn add_assign(&mut self, rhs: &FaerVec<T>)
fn add_assign(&mut self, rhs: &FaerVec<T>)
Performs the
+= operation. Read moreSource§impl<T> AddAssign<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> AddAssign<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn add_assign(&mut self, rhs: &FaerVecRef<'_, T>)
fn add_assign(&mut self, rhs: &FaerVecRef<'_, T>)
Performs the
+= operation. Read moreSource§impl<T> AddAssign<FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
impl<T> AddAssign<FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
Source§fn add_assign(&mut self, rhs: FaerVec<T>)
fn add_assign(&mut self, rhs: FaerVec<T>)
Performs the
+= operation. Read moreSource§impl<T> AddAssign<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> AddAssign<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn add_assign(&mut self, rhs: FaerVecRef<'_, T>)
fn add_assign(&mut self, rhs: FaerVecRef<'_, T>)
Performs the
+= operation. Read moreSource§impl<T> DefaultDenseMatrix for FaerVec<T>where
T: FaerScalar,
impl<T> DefaultDenseMatrix for FaerVec<T>where
T: FaerScalar,
Source§impl<'a, T> MulAssign<Scale<T>> for FaerVec<T>where
T: FaerScalar,
impl<'a, T> MulAssign<Scale<T>> for FaerVec<T>where
T: FaerScalar,
Source§fn mul_assign(&mut self, rhs: Scale<T>)
fn mul_assign(&mut self, rhs: Scale<T>)
Performs the
*= operation. Read moreimpl<T> StructuralPartialEq for FaerVec<T>where
T: PartialEq + FaerScalar,
Source§impl<T> Sub<&FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
impl<T> Sub<&FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
Source§impl<T> Sub<&FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Sub<&FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> Sub<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Sub<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> Sub<FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
impl<T> Sub<FaerVec<T>> for FaerVecRef<'_, T>where
T: Scalar + FaerScalar,
Source§impl<T> Sub<FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Sub<FaerVecRef<'_, T>> for &FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> Sub<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> Sub<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> SubAssign for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> SubAssign for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn sub_assign(&mut self, rhs: FaerVec<T>)
fn sub_assign(&mut self, rhs: FaerVec<T>)
Performs the
-= operation. Read moreSource§impl<T> SubAssign<&FaerVec<T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> SubAssign<&FaerVec<T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn sub_assign(&mut self, rhs: &FaerVec<T>)
fn sub_assign(&mut self, rhs: &FaerVec<T>)
Performs the
-= operation. Read moreSource§impl<T> SubAssign<&FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
impl<T> SubAssign<&FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
Source§fn sub_assign(&mut self, rhs: &FaerVec<T>)
fn sub_assign(&mut self, rhs: &FaerVec<T>)
Performs the
-= operation. Read moreSource§impl<T> SubAssign<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> SubAssign<&FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn sub_assign(&mut self, rhs: &FaerVecRef<'_, T>)
fn sub_assign(&mut self, rhs: &FaerVecRef<'_, T>)
Performs the
-= operation. Read moreSource§impl<T> SubAssign<FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
impl<T> SubAssign<FaerVec<T>> for FaerVecMut<'_, T>where
T: Scalar + FaerScalar,
Source§fn sub_assign(&mut self, rhs: FaerVec<T>)
fn sub_assign(&mut self, rhs: FaerVec<T>)
Performs the
-= operation. Read moreSource§impl<T> SubAssign<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> SubAssign<FaerVecRef<'_, T>> for FaerVec<T>where
T: Scalar + FaerScalar,
Source§fn sub_assign(&mut self, rhs: FaerVecRef<'_, T>)
fn sub_assign(&mut self, rhs: FaerVecRef<'_, T>)
Performs the
-= operation. Read moreSource§impl<T> Vector for FaerVec<T>where
T: FaerScalar,
impl<T> Vector for FaerVec<T>where
T: FaerScalar,
type View<'a> = FaerVecRef<'a, T>
type ViewMut<'a> = FaerVecMut<'a, T>
type Index = FaerVecIndex
Source§fn context(&self) -> &<FaerVec<T> as VectorCommon>::C
fn context(&self) -> &<FaerVec<T> as VectorCommon>::C
Get the context associated with this vector (for device placement, threading, etc.).
Source§fn inner_mut(&mut self) -> &mut <FaerVec<T> as VectorCommon>::Inner
fn inner_mut(&mut self) -> &mut <FaerVec<T> as VectorCommon>::Inner
Get a mutable reference to the inner representation of the vector.
Source§fn len(&self) -> usize
fn len(&self) -> usize
Get the per-batch length (number of states) in this vector.
For batched vectors, this returns
nstates, not nstates * nbatch.Source§fn get_index(&self, index: usize) -> <FaerVec<T> as VectorCommon>::T
fn get_index(&self, index: usize) -> <FaerVec<T> as VectorCommon>::T
Get the value at the specified index.
Source§fn set_index(&mut self, index: usize, value: <FaerVec<T> as VectorCommon>::T)
fn set_index(&mut self, index: usize, value: <FaerVec<T> as VectorCommon>::T)
Set the value at the specified index to
value.Source§fn squared_norm(
&self,
y: &FaerVec<T>,
atol: &FaerVec<T>,
rtol: <FaerVec<T> as VectorCommon>::T,
) -> <FaerVec<T> as VectorCommon>::T
fn squared_norm( &self, y: &FaerVec<T>, atol: &FaerVec<T>, rtol: <FaerVec<T> as VectorCommon>::T, ) -> <FaerVec<T> as VectorCommon>::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) -> <FaerVec<T> as Vector>::View<'_>
fn as_view(&self) -> <FaerVec<T> as Vector>::View<'_>
Create an immutable view of this vector.
Source§fn as_view_mut(&mut self) -> <FaerVec<T> as Vector>::ViewMut<'_>
fn as_view_mut(&mut self) -> <FaerVec<T> as Vector>::ViewMut<'_>
Create a mutable view of this vector.
Source§fn get_batch(&self, batch: usize) -> <FaerVec<T> as Vector>::View<'_>
fn get_batch(&self, batch: usize) -> <FaerVec<T> as Vector>::View<'_>
Get an immutable view of a single batch (with nbatch=1 context).
Source§fn get_batch_mut(&mut self, batch: usize) -> <FaerVec<T> as Vector>::ViewMut<'_>
fn get_batch_mut(&mut self, batch: usize) -> <FaerVec<T> as Vector>::ViewMut<'_>
Get a mutable view of a single batch (with nbatch=1 context).
Source§fn copy_from_view(&mut self, other: &<FaerVec<T> as Vector>::View<'_>)
fn copy_from_view(&mut self, other: &<FaerVec<T> as Vector>::View<'_>)
Copy all values from a vector view into this vector.
Source§fn fill(&mut self, value: <FaerVec<T> as VectorCommon>::T)
fn fill(&mut self, value: <FaerVec<T> as VectorCommon>::T)
Fill all elements of this vector with
value.Source§fn from_element(
nstates: usize,
value: <FaerVec<T> as VectorCommon>::T,
ctx: <FaerVec<T> as VectorCommon>::C,
) -> FaerVec<T>
fn from_element( nstates: usize, value: <FaerVec<T> as VectorCommon>::T, ctx: <FaerVec<T> as VectorCommon>::C, ) -> FaerVec<T>
Create a vector of length
nstates with all elements initialized to value.Source§fn from_vec(
vec: Vec<<FaerVec<T> as VectorCommon>::T>,
ctx: <FaerVec<T> as VectorCommon>::C,
) -> FaerVec<T>
fn from_vec( vec: Vec<<FaerVec<T> as VectorCommon>::T>, ctx: <FaerVec<T> as VectorCommon>::C, ) -> FaerVec<T>
Create a vector from a Rust
Vec.Source§fn from_slice(
slice: &[<FaerVec<T> as VectorCommon>::T],
ctx: <FaerVec<T> as VectorCommon>::C,
) -> FaerVec<T>
fn from_slice( slice: &[<FaerVec<T> as VectorCommon>::T], ctx: <FaerVec<T> as VectorCommon>::C, ) -> FaerVec<T>
Create a vector from a slice.
Source§fn clone_as_vec(&self) -> Vec<<FaerVec<T> as VectorCommon>::T>
fn clone_as_vec(&self) -> Vec<<FaerVec<T> as VectorCommon>::T>
Clone this vector as a Rust
Vec.Source§fn zeros(nstates: usize, ctx: <FaerVec<T> as VectorCommon>::C) -> FaerVec<T>
fn zeros(nstates: usize, ctx: <FaerVec<T> as VectorCommon>::C) -> FaerVec<T>
Create a vector of length
nstates with all elements set to zero.Source§fn axpy(
&mut self,
alpha: <FaerVec<T> as VectorCommon>::T,
x: &FaerVec<T>,
beta: <FaerVec<T> as VectorCommon>::T,
)
fn axpy( &mut self, alpha: <FaerVec<T> as VectorCommon>::T, x: &FaerVec<T>, beta: <FaerVec<T> as VectorCommon>::T, )
Compute the AXPY operation: self = alpha * x + beta * self
Source§fn axpy_v(
&mut self,
alpha: <FaerVec<T> as VectorCommon>::T,
x: &<FaerVec<T> as Vector>::View<'_>,
beta: <FaerVec<T> as VectorCommon>::T,
)
fn axpy_v( &mut self, alpha: <FaerVec<T> as VectorCommon>::T, x: &<FaerVec<T> as Vector>::View<'_>, beta: <FaerVec<T> as VectorCommon>::T, )
Compute the AXPY operation with a vector view: self = alpha * x + beta * self
Source§fn batched_axpy(
&mut self,
alpha: &[<FaerVec<T> as VectorCommon>::T],
x: &FaerVec<T>,
beta: <FaerVec<T> as VectorCommon>::T,
)
fn batched_axpy( &mut self, alpha: &[<FaerVec<T> as VectorCommon>::T], x: &FaerVec<T>, beta: <FaerVec<T> as VectorCommon>::T, )
Per-batch AXPY:
self[i]_b = alpha[b] * x[i]_b + beta * self[i]_b Read moreSource§fn component_mul_assign(&mut self, other: &FaerVec<T>)
fn component_mul_assign(&mut self, other: &FaerVec<T>)
Element-wise multiplication: self_i *= other_i
Source§fn component_div_assign(&mut self, other: &FaerVec<T>)
fn component_div_assign(&mut self, other: &FaerVec<T>)
Element-wise division: self_i /= other_i
Source§fn root_finding(
&self,
g1: &FaerVec<T>,
) -> (bool, <FaerVec<T> as VectorCommon>::T, i32)
fn root_finding( &self, g1: &FaerVec<T>, ) -> (bool, <FaerVec<T> as VectorCommon>::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: &<FaerVec<T> as Vector>::Index,
value: <FaerVec<T> as VectorCommon>::T,
)
fn assign_at_indices( &mut self, indices: &<FaerVec<T> as Vector>::Index, value: <FaerVec<T> as VectorCommon>::T, )
Assign
value to all elements at the specified indices.Source§fn copy_from_indices(
&mut self,
other: &FaerVec<T>,
indices: &<FaerVec<T> as Vector>::Index,
)
fn copy_from_indices( &mut self, other: &FaerVec<T>, indices: &<FaerVec<T> as Vector>::Index, )
Copy values from
other at the specified indices: self[indices[i]] = other[indices[i]]Source§fn gather(
&mut self,
other: &FaerVec<T>,
indices: &<FaerVec<T> as Vector>::Index,
)
fn gather( &mut self, other: &FaerVec<T>, indices: &<FaerVec<T> as Vector>::Index, )
Gather values from
other at indices: self[i] = other[indices[i]]Source§fn scatter(
&self,
indices: &<FaerVec<T> as Vector>::Index,
other: &mut FaerVec<T>,
)
fn scatter( &self, indices: &<FaerVec<T> as Vector>::Index, other: &mut FaerVec<T>, )
Scatter values to
other at indices: other[indices[i]] = self[i]Source§fn total_len(&self) -> usize
fn total_len(&self) -> usize
Get the total number of elements stored, including all batches.
Returns
self.len() * self.context().nbatch().Source§fn assert_eq_st(&self, other: &Self, tol: Self::T)
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,
)
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 moreSource§fn assert_eq(&self, other: &Self, tol: &Self)
fn assert_eq(&self, other: &Self, tol: &Self)
Assert that this vector equals
other using a vector of per-element tolerances.fn assert_eq_vec(s: Vec<Self::T>, other: Vec<Self::T>, tol: Vec<Self::T>)
Source§impl<T> VectorCommon for FaerVec<T>where
T: Scalar + FaerScalar,
impl<T> VectorCommon for FaerVec<T>where
T: Scalar + FaerScalar,
Source§impl<T> VectorHost for FaerVec<T>where
T: FaerScalar,
impl<T> VectorHost for FaerVec<T>where
T: FaerScalar,
Source§fn as_mut_slice(&mut self) -> &mut [<FaerVec<T> as VectorCommon>::T]
fn as_mut_slice(&mut self) -> &mut [<FaerVec<T> as VectorCommon>::T]
Get the vector data as a mutable slice.
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>where
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, Right> ClosedAdd<Right> for T
impl<T, Right> ClosedAddAssign<Right> for T
impl<T, Right> ClosedMul<Right> for T
impl<T, Right> ClosedMulAssign<Right> for T
impl<T, Right> ClosedSub<Right> for T
impl<T, Right> ClosedSubAssign<Right> for T
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.