pub trait VectorView<'a>:
VectorOpsByValue<Self, Self::Owned>
+ VectorOpsByValue<Self::Owned, Self::Owned>
+ for<'b> VectorOpsByValue<&'b Self::Owned, Self::Owned>
+ for<'b> VectorOpsByValue<&'b Self, Self::Owned>
+ Mul<Scale<Self::T>, Output = Self::Owned> {
type Owned;
// Required methods
fn squared_norm(
&self,
y: &Self::Owned,
atol: &Self::Owned,
rtol: Self::T,
) -> Self::T;
fn into_owned(self) -> Self::Owned;
}Expand description
A borrowed immutable view of a vector, supporting read-only arithmetic operations.
This trait represents a temporary immutable reference to a vector’s data, allowing read-only
operations like addition, subtraction, and scalar multiplication. Vector views can be created
via the as_view() method on a Vector and are cheaper to create than cloning.
Required Associated Types§
Required Methods§
Sourcefn squared_norm(
&self,
y: &Self::Owned,
atol: &Self::Owned,
rtol: Self::T,
) -> Self::T
fn squared_norm( &self, y: &Self::Owned, atol: &Self::Owned, rtol: Self::T, ) -> Self::T
Compute the squared weighted norm: sum_i ((self_i) / (|y_i| * rtol + atol_i))^2
This is commonly used for error control in ODE solvers.
Sourcefn into_owned(self) -> Self::Owned
fn into_owned(self) -> Self::Owned
Convert this view into an owned vector, cloning the data if necessary.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.