The OpenD Programming Language

mir_series.opIndexOpAssign

Special [] op= index-op-assign operator for index-series. Op-assigns data from r with index intersection. If a index index in r is not in the index index for this series, then no op-assign will take place. This and r series are assumed to be sorted.

struct mir_series(IndexIterator_, Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous)
void
opIndexOpAssign
(
string op
IndexIterator_
Iterator_
size_t N_
SliceKind kind_
)
(
auto ref Series!(IndexIterator_, Iterator_, N_, kind_) rSeries
)

Parameters

rSeries Series!(IndexIterator_, Iterator_, N_, kind_)

rvalue index-series

Examples

auto index = [1, 2, 3, 4];
auto data = [10.0, 10, 10, 10];
auto series = index.series(data);

auto rindex = [0, 2, 4, 5];
auto rdata = [1.0, 2, 3, 4];
auto rseries = rindex.series(rdata);

series[] += rseries;
assert(series.data == [10, 12, 10, 13]);

Meta