pub struct PiecewiseLegendrePolyVector {
pub polyvec: Vec<PiecewiseLegendrePoly>,
}Expand description
Vector of piecewise Legendre polynomials
Fields§
§polyvec: Vec<PiecewiseLegendrePoly>Individual polynomials
Implementations§
Source§impl PiecewiseLegendrePolyVector
impl PiecewiseLegendrePolyVector
Sourcepub fn new(polyvec: Vec<PiecewiseLegendrePoly>) -> Self
pub fn new(polyvec: Vec<PiecewiseLegendrePoly>) -> Self
Constructor with a vector of PiecewiseLegendrePoly
§Panics
Panics if the input vector is empty, as empty PiecewiseLegendrePolyVector is not meaningful
Sourcepub fn get_polys(&self) -> &[PiecewiseLegendrePoly]
pub fn get_polys(&self) -> &[PiecewiseLegendrePoly]
Get the polynomials
Sourcepub fn from_3d_data(
data3d: DTensor<f64, 3>,
knots: Vec<f64>,
symm: Option<Vec<i32>>,
) -> Self
pub fn from_3d_data( data3d: DTensor<f64, 3>, knots: Vec<f64>, symm: Option<Vec<i32>>, ) -> Self
Constructor with a 3D array, knots, and symmetry vector
Sourcepub fn rescale_domain(
&self,
new_knots: Vec<f64>,
new_delta_x: Option<Vec<f64>>,
new_symm: Option<Vec<i32>>,
) -> Self
pub fn rescale_domain( &self, new_knots: Vec<f64>, new_delta_x: Option<Vec<f64>>, new_symm: Option<Vec<i32>>, ) -> Self
Rescale domain for all polynomials in the vector
Creates a new PiecewiseLegendrePolyVector where each polynomial has the same data but new knots and delta_x.
§Arguments
new_knots- New knot points (same for all polynomials)new_delta_x- Optional new segment widthsnew_symm- Optional vector of new symmetry parameters (one per polynomial)
§Returns
New vector with rescaled domains
Sourcepub fn scale_data(&self, factor: f64) -> Self
pub fn scale_data(&self, factor: f64) -> Self
Sourcepub fn get(&self, index: usize) -> Option<&PiecewiseLegendrePoly>
pub fn get(&self, index: usize) -> Option<&PiecewiseLegendrePoly>
Get polynomial by index (immutable)
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut PiecewiseLegendrePoly>
👎Deprecated: PiecewiseLegendrePolyVector is designed to be immutable. Use get() and create new instances for modifications.
pub fn get_mut(&mut self, index: usize) -> Option<&mut PiecewiseLegendrePoly>
Get polynomial by index (mutable) - deprecated, use immutable design instead
Sourcepub fn slice_single(&self, index: usize) -> Option<Self>
pub fn slice_single(&self, index: usize) -> Option<Self>
Extract a single polynomial as a vector
Sourcepub fn slice_multi(&self, indices: &[usize]) -> Self
pub fn slice_multi(&self, indices: &[usize]) -> Self
Extract multiple polynomials by indices
Sourcepub fn evaluate_at(&self, x: f64) -> Vec<f64>
pub fn evaluate_at(&self, x: f64) -> Vec<f64>
Evaluate all polynomials at a single point
Sourcepub fn evaluate_at_many(&self, xs: &[f64]) -> DTensor<f64, 2>
pub fn evaluate_at_many(&self, xs: &[f64]) -> DTensor<f64, 2>
Evaluate all polynomials at multiple points
pub fn xmin(&self) -> f64
pub fn xmax(&self) -> f64
pub fn get_knots(&self, tolerance: Option<f64>) -> Vec<f64>
pub fn get_delta_x(&self) -> Vec<f64>
pub fn get_polyorder(&self) -> usize
pub fn get_norms(&self) -> &[f64]
pub fn get_symm(&self) -> Vec<i32>
Sourcepub fn last(&self) -> &PiecewiseLegendrePoly
pub fn last(&self) -> &PiecewiseLegendrePoly
Get reference to last polynomial
C++ equivalent: u.polyvec.back()
Trait Implementations§
Source§impl Clone for PiecewiseLegendrePolyVector
impl Clone for PiecewiseLegendrePolyVector
Source§fn clone(&self) -> PiecewiseLegendrePolyVector
fn clone(&self) -> PiecewiseLegendrePolyVector
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PiecewiseLegendrePolyVector
impl Debug for PiecewiseLegendrePolyVector
Auto Trait Implementations§
impl Freeze for PiecewiseLegendrePolyVector
impl RefUnwindSafe for PiecewiseLegendrePolyVector
impl Send for PiecewiseLegendrePolyVector
impl Sync for PiecewiseLegendrePolyVector
impl Unpin for PiecewiseLegendrePolyVector
impl UnwindSafe for PiecewiseLegendrePolyVector
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoCloned<T> for T
impl<T> IntoCloned<T> for T
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>
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>
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
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.