Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes
dsac::design::Progression Class Reference

#include <progression.h>

Inheritance diagram for dsac::design::Progression:
Inheritance graph
Collaboration diagram for dsac::design::Progression:
Collaboration graph

Public Member Functions

 Progression (long start=0)
 
virtual ~Progression ()
 Destructs the progression.
 
long next_value ()
 
void print_progression (int n)
 

Protected Member Functions

virtual void advance ()
 Advances the current value to the next value of the progression.
 

Protected Attributes

long current
 

Constructor & Destructor Documentation

◆ Progression()

dsac::design::Progression::Progression ( long  start = 0)
inline

Constructs a progression with given start value (default: 0)

Parameters
startthe first value of the progression

◆ ~Progression()

virtual dsac::design::Progression::~Progression ( )
inlinevirtual

Destructs the progression.

Member Function Documentation

◆ advance()

virtual void dsac::design::Progression::advance ( )
inlineprotectedvirtual

Advances the current value to the next value of the progression.

Reimplemented in dsac::design::ArithmeticProgression, dsac::design::FibonacciProgression, and dsac::design::GeometricProgression.

◆ next_value()

long dsac::design::Progression::next_value ( )
inline

Returns the next value of the progression

Returns
the next value of the progression
Here is the call graph for this function:

◆ print_progression()

void dsac::design::Progression::print_progression ( int  n)
inline

Prints the next n values of the progression, separate by spaces

Parameters
nnumber of terms to print
Here is the call graph for this function:

Field Documentation

◆ current

long dsac::design::Progression::current
protected

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