seq_data Class Reference
[Data Grids and Sequences]

Collaboration diagram for seq_data:
Collaboration graph
[legend]

Detailed Description

Sequence defined by an unevenly spaced vector of points.

This class has much worse performance than seq_linear or seq_log and should be avoided when one of those classes could be used instead. But, some grids are just not defined using an evenly spaced sequence of points and this class is needed for completeness.

The find_index() routine in this implementation tries to speed up the search by using the last search as the initial guess for the next search.


Constructor & Destructor Documentation

virtual ~seq_data (  )  [inline, virtual]

Virtual destructor.

seq_data ( size_type  size  )  [inline]

Initialize sequence sub-class using number of elements.

Parameters:
size Length of the sequence to create.
seq_data ( const double *  data,
size_t  size 
) [inline]

Construct sequence from a standard C array.

Ensures that the sequence is a monotonic sequence.

Parameters:
data Set of data elements to use.
size Number of elements in data.
Exceptions:
invalid_argument If series not monotonic
seq_data ( const vector< T, A > &  data  )  [inline]

Construct sequence from a uBLAS vector.

Ensures that the sequence is a monotonic sequence.

Parameters:
data Set of data elements to use.
Exceptions:
invalid_argument If series not monotonic
seq_data ( const seq_data copy  )  [inline]

Copies data from another seq_data object.

Parameters:
copy The object to be copied.

Member Function Documentation

virtual seq_vector* clone (  )  const [inline, virtual]

Create a copy using a reference to the base class.

Implements seq_vector.

virtual size_type find_index ( value_type  value  )  [inline, virtual]

Search for a value in this sequence.

If the value is outside of the legal range, the index for the nearest endpoint will be returned, unless the nearest endpoint is that last index, in which the second to last index will be returned. This is to guarantee that there is always an index to the right of the returned index.

Parameters:
value Value of the element to find.
Returns:
Index of the largest value that is not greater than the argument.

Implements seq_vector.

void init ( const double *  data,
size_t  size 
) [inline, protected]

Initialize sequence from a uBLAS vector.

Ensures that the sequence is a monotonic sequence.

Parameters:
data Set of data elements to use.
size Number of data elements.
Exceptions:
invalid_argument If series not monotonic

Member Data Documentation

size_type _index [protected]

index number from the last search

value_type _index_data [protected]

axis value that corresponds to _index

value_type _sign [protected]

Sign value is 1 if the sequence is increasing, -1 if decreasing.

value_type _value [protected]

Value from the last search.

Speeds up redundant searches.


Generated on 4 May 2015 for USML by  doxygen 1.6.1