pub struct GaussChebyshevSecondKind { /* private fields */ }
Expand description
A Gauss-Chebyshev quadrature scheme of the second kind.
Used to integrate functions of the form f(x) * sqrt(1 - x^2) on finite intervals.
§Example
let rule = GaussChebyshevSecondKind::new(2)?;
assert_relative_eq!(rule.integrate(-1.0, 1.0, |x| x * x), PI / 8.0);
Implementations§
Source§impl GaussChebyshevSecondKind
impl GaussChebyshevSecondKind
Sourcepub fn new(degree: usize) -> Result<Self, GaussChebyshevError>
pub fn new(degree: usize) -> Result<Self, GaussChebyshevError>
Create a new GaussChebyshev
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 GaussChebyshevSecondKind
impl GaussChebyshevSecondKind
Sourcepub fn nodes(&self) -> GaussChebyshevSecondKindNodes<'_> ⓘ
pub fn nodes(&self) -> GaussChebyshevSecondKindNodes<'_> ⓘ
Returns an iterator over the nodes of the quadrature rule.
Sourcepub fn weights(&self) -> GaussChebyshevSecondKindWeights<'_> ⓘ
pub fn weights(&self) -> GaussChebyshevSecondKindWeights<'_> ⓘ
Returns an iterator over the weights of the quadrature rule.
Sourcepub fn iter(&self) -> GaussChebyshevSecondKindIter<'_> ⓘ
pub fn iter(&self) -> GaussChebyshevSecondKindIter<'_> ⓘ
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 GaussChebyshevSecondKind
impl Clone for GaussChebyshevSecondKind
Source§fn clone(&self) -> GaussChebyshevSecondKind
fn clone(&self) -> GaussChebyshevSecondKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GaussChebyshevSecondKind
impl Debug for GaussChebyshevSecondKind
Source§impl<'de> Deserialize<'de> for GaussChebyshevSecondKind
impl<'de> Deserialize<'de> for GaussChebyshevSecondKind
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<GaussChebyshevSecondKind> for GaussJacobi
Gauss-Chebyshev quadrature of the second kind is equivalent to Gauss-Jacobi quadrature with alpha
= beta
= 0.5.
impl From<GaussChebyshevSecondKind> for GaussJacobi
Gauss-Chebyshev quadrature of the second kind is equivalent to Gauss-Jacobi quadrature with alpha
= beta
= 0.5.
Source§fn from(value: GaussChebyshevSecondKind) -> Self
fn from(value: GaussChebyshevSecondKind) -> Self
Source§impl<'a> IntoIterator for &'a GaussChebyshevSecondKind
impl<'a> IntoIterator for &'a GaussChebyshevSecondKind
Source§impl PartialEq for GaussChebyshevSecondKind
impl PartialEq for GaussChebyshevSecondKind
Source§impl Serialize for GaussChebyshevSecondKind
impl Serialize for GaussChebyshevSecondKind
impl StructuralPartialEq for GaussChebyshevSecondKind
Auto Trait Implementations§
impl Freeze for GaussChebyshevSecondKind
impl RefUnwindSafe for GaussChebyshevSecondKind
impl Send for GaussChebyshevSecondKind
impl Sync for GaussChebyshevSecondKind
impl Unpin for GaussChebyshevSecondKind
impl UnwindSafe for GaussChebyshevSecondKind
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.