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.
virtual ~seq_data | ( | ) | [inline, virtual] |
Virtual destructor.
Initialize sequence sub-class using number of elements.
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.
data | Set of data elements to use. | |
size | Number of elements in data. |
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.
data | Set of data elements to use. |
invalid_argument | If series not monotonic |
Copies data from another seq_data object.
copy | The object to be copied. |
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.
value | Value of the element to find. |
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.
data | Set of data elements to use. | |
size | Number of data elements. |
invalid_argument | If series not monotonic |
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.