Struct accurate::sum::OnlineExactSum
[−]
[src]
pub struct OnlineExactSum<F> { /* fields omitted */ }
Calculates a sum using separate accumulators for each possible exponent
Examples
use accurate::traits::*; use accurate::sum::OnlineExactSum; let s = OnlineExactSum::zero() + 1.0 + 2.0 + 3.0; assert_eq!(6.0f64, s.sum());
References
Based on Zhu and Hayes 10
Trait Implementations
impl<F: Clone> Clone for OnlineExactSum<F>
[src]
fn clone(&self) -> OnlineExactSum<F>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<F: Debug> Debug for OnlineExactSum<F>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<F> SumAccumulator<F> for OnlineExactSum<F> where
F: Float + TwoSum + IFastSum + FloatFormat + RawExponent,
[src]
F: Float + TwoSum + IFastSum + FloatFormat + RawExponent,
fn zero() -> Self
[src]
Initial value for an accumulator
fn sum(self) -> F
[src]
The sum of all terms accumulated so far
fn absorb<I>(self, it: I) -> Self where
I: IntoIterator<Item = F>,
[src]
I: IntoIterator<Item = F>,
Absorb the items of an iterator into the accumulator Read more
impl<F> Add<F> for OnlineExactSum<F> where
OnlineExactSum<F>: AddAssign<F>,
[src]
OnlineExactSum<F>: AddAssign<F>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: F) -> Self::Output
[src]
Performs the +
operation.
impl<F> From<F> for OnlineExactSum<F> where
F: TwoSum + FloatFormat + RawExponent,
[src]
F: TwoSum + FloatFormat + RawExponent,
impl<F> Add for OnlineExactSum<F> where
F: Float + TwoSum + IFastSum + FloatFormat + RawExponent,
[src]
F: Float + TwoSum + IFastSum + FloatFormat + RawExponent,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
Performs the +
operation.
impl<F> Send for OnlineExactSum<F> where
F: Send,
[src]
F: Send,
impl<F> AddAssign<F> for OnlineExactSum<F> where
F: TwoSum + FloatFormat + RawExponent,
[src]
F: TwoSum + FloatFormat + RawExponent,
fn add_assign(&mut self, rhs: F)
[src]
Performs the +=
operation.
Auto Trait Implementations
impl<F> Sync for OnlineExactSum<F> where
F: Sync,
F: Sync,