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

#include <geometric_progression.h>

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

Public Member Functions

 GeometricProgression (long b=2, long start=1)
 
- 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 ()
 Multiply the current value by the geometric base.
 
virtual void advance ()
 Advances the current value to the next value of the progression.
 

Protected Attributes

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

Constructor & Destructor Documentation

◆ GeometricProgression()

dsac::design::GeometricProgression::GeometricProgression ( long  b = 2,
long  start = 1 
)
inline

Constructs a geometric progression with given base and start

Parameters
basethe base of the geometric progression (default: 2)
startthe first value of the geometric progression (default: 1)

Member Function Documentation

◆ advance()

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

Multiply the current value by the geometric base.

Reimplemented from dsac::design::Progression.

Field Documentation

◆ base

long dsac::design::GeometricProgression::base
protected

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