Class DoubleSequenceGenerator
- Namespace
- LfrlAnvil.Generators
- Assembly
- LfrlAnvil.Core.dll
Represents double sequence generator of values within specified range.
public class DoubleSequenceGenerator : SequenceGeneratorBase<double>, ISequenceGenerator<double>, IBoundGenerator<double>, IGenerator<double>, IGenerator
- Inheritance
-
DoubleSequenceGenerator
- Implements
- Inherited Members
- Extension Methods
Constructors
DoubleSequenceGenerator()
Creates a new DoubleSequenceGenerator instance that starts with 0, with Step equal to 1 and with greatest possible Bounds.
public DoubleSequenceGenerator()
DoubleSequenceGenerator(Bounds<double>)
Creates a new DoubleSequenceGenerator instance that starts with
minimum possible value defined by bounds
, with Step equal to 1.
public DoubleSequenceGenerator(Bounds<double> bounds)
Parameters
DoubleSequenceGenerator(Bounds<double>, double, double)
Creates a new DoubleSequenceGenerator instance.
public DoubleSequenceGenerator(Bounds<double> bounds, double start, double step = 1)
Parameters
bounds
Bounds<double>Range of values that can be generated.
start
doubleNext value to generate.
step
doubleDifference between two consecutively generated values. Equal to 1 by default.
Exceptions
- ArgumentOutOfRangeException
When
bounds
do not containstart
.- ArgumentException
When
step
is equal to 0 or any of the values is not a finite number.
DoubleSequenceGenerator(double, double)
Creates a new DoubleSequenceGenerator instance with greatest possible Bounds.
public DoubleSequenceGenerator(double start, double step = 1)
Parameters
start
doubleNext value to generate.
step
doubleDifference between two consecutively generated values. Equal to 1 by default.
Exceptions
- ArgumentException
When
step
is equal to 0 or any of the values is not a finite number.
Methods
AddStep(double)
Adds Step to the previously generated value in order to calculate the next value to generate.
protected override sealed double AddStep(double value)
Parameters
value
doublePreviously generated value.
Returns
- double
Next value to generate.
Exceptions
- OverflowException
When an arithmetic overflow occurred.