19 if (values.
size() <= 1)
21 cerr <<
"Error -- vector size should be greater than 1"
22 <<
" in first_difference(const dvector&)" <<
endl;
26 int indexmax = values.
indexmax() - 1;
27 dvector differences(indexmin, indexmax);
28 for (
int i = indexmin; i <= indexmax; ++i)
30 differences.
elem(i) = values.
elem(i + 1) - values.
elem(i);
Vector of double precision numbers.
int indexmin() const
Get minimum valid index.
prnstream & endl(prnstream &)
int indexmax() const
Get maximum valid index.
dvector first_difference(const dvector &values)
Returns dvector containing the differences of an values(i) and values(i + 1) for i = 1 to values...
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
unsigned int size() const
Get number of elements in array.