pub struct GaussChebyshevFirstKind { /* private fields */ }
Expand description
A Gauss-Chebyshev quadrature scheme of the first kind.
Used to integrate functions of the form f(x) / sqrt(1 - x^2) on finite intervals.
§Example
let rule = GaussChebyshevFirstKind::new(2)?;
assert_relative_eq!(rule.integrate(0.0, 2.0, |x| x), PI);
Implementations§
Source§impl GaussChebyshevFirstKind
impl GaussChebyshevFirstKind
Sourcepub fn new(degree: usize) -> Result<Self, GaussChebyshevError>
pub fn new(degree: usize) -> Result<Self, GaussChebyshevError>
Create a new GaussChebyshevFirstKind
rule that can integrate functions of the form f(x) / sqrt(1 - x^2).
§Errors
Returns an error if degree
is less than 2.
Sourcepub fn par_new(degree: usize) -> Result<Self, GaussChebyshevError>
Available on crate feature rayon
only.
pub fn par_new(degree: usize) -> Result<Self, GaussChebyshevError>
rayon
only.Same as new
but runs in parallel.
Source§impl GaussChebyshevFirstKind
impl GaussChebyshevFirstKind
Sourcepub fn nodes(&self) -> GaussChebyshevFirstKindNodes<'_> ⓘ
pub fn nodes(&self) -> GaussChebyshevFirstKindNodes<'_> ⓘ
Returns an iterator over the nodes of the quadrature rule.
Sourcepub fn weights(&self) -> GaussChebyshevFirstKindWeights<'_> ⓘ
pub fn weights(&self) -> GaussChebyshevFirstKindWeights<'_> ⓘ
Returns an iterator over the weights of the quadrature rule.
Sourcepub fn iter(&self) -> GaussChebyshevFirstKindIter<'_> ⓘ
pub fn iter(&self) -> GaussChebyshevFirstKindIter<'_> ⓘ
Returns an iterator over the node-weight pairs of the quadrature rule.
Sourcepub fn as_node_weight_pairs(&self) -> &[(Node, Weight)]
pub fn as_node_weight_pairs(&self) -> &[(Node, Weight)]
Returns a slice of all the node-weight pairs of the quadrature rule.
Sourcepub fn into_node_weight_pairs(self) -> Vec<(Node, Weight)>
pub fn into_node_weight_pairs(self) -> Vec<(Node, Weight)>
Converts the quadrature rule into a vector of node-weight pairs.
This function just returns the underlying vector without any computation or cloning.
Trait Implementations§
Source§impl Clone for GaussChebyshevFirstKind
impl Clone for GaussChebyshevFirstKind
Source§fn clone(&self) -> GaussChebyshevFirstKind
fn clone(&self) -> GaussChebyshevFirstKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GaussChebyshevFirstKind
impl Debug for GaussChebyshevFirstKind
Source§impl<'de> Deserialize<'de> for GaussChebyshevFirstKind
impl<'de> Deserialize<'de> for GaussChebyshevFirstKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<GaussChebyshevFirstKind> for GaussJacobi
Gauss-Chebyshev quadrature of the first kind is equivalent to Gauss-Jacobi quadrature with alpha
= beta
= -0.5.
impl From<GaussChebyshevFirstKind> for GaussJacobi
Gauss-Chebyshev quadrature of the first kind is equivalent to Gauss-Jacobi quadrature with alpha
= beta
= -0.5.
Source§fn from(value: GaussChebyshevFirstKind) -> Self
fn from(value: GaussChebyshevFirstKind) -> Self
Source§impl<'a> IntoIterator for &'a GaussChebyshevFirstKind
impl<'a> IntoIterator for &'a GaussChebyshevFirstKind
Source§impl PartialEq for GaussChebyshevFirstKind
impl PartialEq for GaussChebyshevFirstKind
Source§impl Serialize for GaussChebyshevFirstKind
impl Serialize for GaussChebyshevFirstKind
impl StructuralPartialEq for GaussChebyshevFirstKind
Auto Trait Implementations§
impl Freeze for GaussChebyshevFirstKind
impl RefUnwindSafe for GaussChebyshevFirstKind
impl Send for GaussChebyshevFirstKind
impl Sync for GaussChebyshevFirstKind
impl Unpin for GaussChebyshevFirstKind
impl UnwindSafe for GaussChebyshevFirstKind
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> 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.