USML
seq_data Class Reference
Collaboration diagram for seq_data:

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.

Member Typedef Documentation

typedef vector_reference<self_type> closure_type
typedef const vector_reference<const self_type> const_closure_type
typedef seq_data self_type
private

Constructor & Destructor Documentation

virtual ~seq_data ( )
inlinevirtual

Virtual destructor.

seq_data ( size_type  size)
inline

Initialize sequence sub-class using number of elements.

Parameters
sizeLength of the sequence to create.
seq_data ( const double *  data,
unsigned  size 
)
inline

Construct sequence from a standard C array.

Ensures that the sequence is a monotonic sequence.

Parameters
dataSet of data elements to use.
sizeNumber of elements in data.
Exceptions
invalid_argumentIf 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
dataSet of data elements to use.
Exceptions
invalid_argumentIf series not monotonic
seq_data ( const seq_data copy)
inline

Copies data from another seq_data object.

Parameters
copyThe object to be copied.

Member Function Documentation

virtual seq_vector* clone ( ) const
inlinevirtual

Create a copy using a reference to the base class.

Implements seq_vector.

virtual size_type find_index ( value_type  value)
inlinevirtual

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 garuntee that there is always an index to the right of the returned index.

Parameters
valueValue 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,
unsigned  size 
)
inlineprotected
Parameters
dataSet of data elements to use.
sizeNumber of elements in this set.
Exceptions
invalid_argumentIf 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.