Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function clip

boost::time_series::clip — Clips a TimeSeries to a [start,stop) range.

Synopsis

// In header: <boost/time_series/numeric/clip.hpp>


template<typename Series, typename Start, typename Stop> 
  clipped_series< Series > const clip(Series & series, Start start, Stop stop);
template<typename Series, typename Start, typename Stop> 
  clipped_series< Series const  > const 
  clip(Series const & series, Start start, Stop stop);

Description

Clips a TimeSeries to a [start,stop) range, where the resulting series view has zeros outside of the specified range.

Parameters:
series

The series to clip

start

The start offset of the clipped range, inclusive.

stop

The stop offset of the clipped range, exclusive.

Requires:

The input series is a model of the TimeSeries concept.

Offset is convertible to the offset_type of the input series.

Returns:

A clipped_series<> view that models TimeSeries as well as Range.

Notes:

The complexity is O(log N), where N is the number of runs in the input series.


PrevUpHomeNext