The OpenD Programming Language

WSummator

Output range for wsum.

Members

Functions

put
void put(Slice1 s, Slice2 w)
put
void put(SliceLike1 s, SliceLike2 w)
put
void put(Range r)
put
void put(RangeA r, RangeB w)
put
void put(T x, U w)
put
void put(T x)
put
void put(WSummator!(F, summation, G) wm)
wsum
F wsum()

Variables

wsummator
Summator!(T, summation) wsummator;

Examples

import mir.math.sum: Summation;
import mir.ndslice.slice: sliced;
import mir.test: should;

WSummator!(double, Summation.pairwise) x;
x.put([0.0, 1, 2, 3, 4].sliced, [1, 2, 3, 4, 5].sliced);
x.wsum.should == 40;
x.put(5, 6);
x.wsum.should == 70;

Assume no weights, like Summator

import mir.math.sum: Summation;
import mir.ndslice.slice: sliced;
import mir.test: should;

WSummator!(double, Summation.pairwise) x;
x.put([0.0, 1, 2, 3, 4].sliced);
x.wsum.should == 10;
x.put(5);
x.wsum.should == 15;

Meta