The OpenD Programming Language

mir_series.opIndexAssign

Special [] = index-assign operator for index-series. 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
opIndexAssign
(
IndexIterator_
Iterator_
size_t N_
SliceKind kind_
)
(
Series!(IndexIterator_, Iterator_, N_, kind_) r
)

Parameters

r 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;
series[] = rseries;
assert(series.data == [10, 2, 10, 3]);

Meta