[go: up one dir, main page]

Struct accurate::OnlineExactDot [] [src]

pub struct OnlineExactDot<F> {
    // some fields omitted
}

Calculates the dot product using product transformation and OnlineExactSum

Examples

use accurate::*;

let d = OnlineExactDot::default() + (1.0, 1.0) + (2.0, 2.0) + (3.0, 3.0);
assert_eq!(14.0f64, d.dot());

Trait Implementations

impl<F> DotAccumulator<F> for OnlineExactDot<F> where F: Float + Ieee754Ext, F::Significand: PrimInt, F::RawExponent: PrimInt
[src]

fn dot(&self) -> F

The dot product of all terms accumulated so far

fn absorb<I>(self, it: I) -> Self where I: IntoIterator<Item=(F, F)>

Absorb the items of an iterator into the accumulator Read more

impl<F> Add<(F, F)> for OnlineExactDot<F> where F: Float + Ieee754Ext, F::RawExponent: PrimInt
[src]

type Output = Self

The resulting type after applying the + operator

fn add(self, (a, b): (F, F)) -> Self::Output

The method for the + operator

impl<F> From<F> for OnlineExactDot<F> where F: Float + Ieee754Ext, F::Significand: PrimInt, F::RawExponent: PrimInt
[src]

fn from(x: F) -> Self

Performs the conversion.

impl<F> Default for OnlineExactDot<F> where F: Float + Ieee754Ext, F::Significand: PrimInt, F::RawExponent: PrimInt
[src]

fn default() -> Self

Returns the "default value" for a type. Read more