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

#include <arithmetic_progression.h>

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

Public Member Functions

 ArithmeticProgression (long stepsize=1, long start=0)
 
- Public Member Functions inherited from dsac::design::Progression
 Progression (long start=0)
 
virtual ~Progression ()
 Destructs the progression.
 
long next_value ()
 
void print_progression (int n)
 

Protected Member Functions

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

Protected Attributes

long increment
 
- Protected Attributes inherited from dsac::design::Progression
long current
 

Constructor & Destructor Documentation

◆ ArithmeticProgression()

dsac::design::ArithmeticProgression::ArithmeticProgression ( long  stepsize = 1,
long  start = 0 
)
inline

Constructs an arithmetic progression with given start value (default: 0) and given stepsize (default: 1)

Parameters
stepsizethe increment value for the arithmetic progression
startthe first value of the arithmetic progression

Member Function Documentation

◆ advance()

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

Adds the arithmetic increment to the current value.

Reimplemented from dsac::design::Progression.

Field Documentation

◆ increment

long dsac::design::ArithmeticProgression::increment
protected

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