All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
kjb::Interval_sequence Class Reference

#include <m_sequence.h>

Public Member Functions

 Interval_sequence (double start, double interval, double end)
virtual double operator[] (size_t index) const
std::vector< double > to_vector () const

Detailed Description

A sequence of numbers defined by a starting value, ending value and an interval.

Constructor & Destructor Documentation

kjb::Interval_sequence::Interval_sequence ( double  start,
double  interval,
double  end 

define a sequence {start, start + interval, start + 2 * interval, ..., start + N * interval} where end - interval < N * interval <= end

This is simlar to matlab's "start:interval:end" notation for generating sequences

It also provides a concise way to populate a vector with a sequence: vec = Interval_sequence(0,2,100).to_vector()

Storage is constant, so any size sequence is possible (up to the limits of double).

Kyle Simek

Member Function Documentation

double kjb::Interval_sequence::operator[] ( size_t  index) const
std::vector< double > kjb::Interval_sequence::to_vector ( ) const

The documentation for this class was generated from the following files: