Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function adjacent_difference

boost::time_series::adjacent_difference — Calculate the adjacent difference of a series.

Synopsis

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


template<typename Series, typename Out> 
  ordered_inserter< Out > 
  adjacent_difference(Series const & series, ordered_inserter< Out > out);
template<typename Series> 
  sparse_series< typename concepts::TimeSeries< Series const  >::value_type typename concepts::TimeSeries< Series const  >::discretization_type, typename concepts::TimeSeries< Series const  >::offset_type > 
  adjacent_difference(Series const & series);

Description

Calculate the adjacent difference of a series, much like std::adjacent_difference.

Parameters:
out

The ordered inserter to receive the adjacent difference result.

series

The input series.

Requires:

Series is a model of the TimeSeries concept.

Out is a model of the OrderedInserter concept.

For variaibles x and y of the series' value_type, the expression (x-y) must be convertible to value_type.

Returns:

A sparse_series<> if no ordered inserter is specified; otherwise, the ordered inserter.

Notes:

If using the version that takes an OrderedInserter, you must call .commit() on the returned OrderedInserter when you are done with it.


PrevUpHomeNext