Class FpDivHardToDRoundIterator
- java.lang.Object
-
- ru.ispras.testbase.knowledge.floating.div.FpDivHardToDRoundIterator
-
- All Implemented Interfaces:
Iterator<GeneratorResult<FpNumber>>
public final class FpDivHardToDRoundIterator extends java.lang.Object implements Iterator<GeneratorResult<FpNumber>>
FpDivHardToDRoundIterator
implements an iterator of hard-to-round test cases for the division operation operating in the directed round modes (toward zero, toward plus infinity, and toward minus infinity).The implementation is based on the following works of David Matula and Lee McFearin:
- D. Matula, L. McFearin. Number Theoretic Foundations of Binary Floating Point Division with Rounding. Real Numbers and Computers, 2000.
- D. Matula, L. McFearin. Generation and Analysis of Hard to Round Cases for Binary Floating Point Division. Symposium on Computer Arithmetic, 2001.
- D. Matula, L. McFearin. Selecting a Well Distributed Hard Case Test Suite for IEEE Standard Floating Point Division. International Conference on Computer Design, 2001.
- D. Matula, L. McFearin. A p x p Bit Fraction Model of Binary Floating Point Division and Extremal Rounding Cases. Theoretical Computer Science, 2003.
- D. Matula, L. McFearin. A Formal Model and Efficient Traversal Algorithm for Generating Testbenches for Verification of IEEE Standard Floating Point Division. Conference on Design, Automation and Test in Europe, 2006.
- D. Matula, L. McFearin. Generating a Benchmark Set of Extremal Rounding Boundary Instances for IEEE Standard Floating Point Division. (link)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FpDivHardToDRoundIterator(FpDivHardToDRoundIterator r)
Constructs a copy of the iterator.FpDivHardToDRoundIterator(FpFormat format)
Constructs a division hard-to-round iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FpDivHardToDRoundIterator
clone()
Creates a copy of the iterator.boolean
hasValue()
Checks if the iterator is not exhausted (a value is available).void
init()
Initializes the iterator.void
next()
Makes an iteration.void
stop()
Stops the iterator.GeneratorResult<FpNumber>
value()
Returns the current value of the iterator.
-
-
-
Constructor Detail
-
FpDivHardToDRoundIterator
public FpDivHardToDRoundIterator(FpFormat format)
Constructs a division hard-to-round iterator.- Parameters:
format
- the format.
-
FpDivHardToDRoundIterator
protected FpDivHardToDRoundIterator(FpDivHardToDRoundIterator r)
Constructs a copy of the iterator.- Parameters:
r
- the iterator to be copied.
-
-
Method Detail
-
init
public void init()
Description copied from interface:Iterator
Initializes the iterator.- Specified by:
init
in interfaceIterator<GeneratorResult<FpNumber>>
-
hasValue
public boolean hasValue()
Description copied from interface:Iterator
Checks if the iterator is not exhausted (a value is available).- Specified by:
hasValue
in interfaceIterator<GeneratorResult<FpNumber>>
- Returns:
true
if the iterator is not exhausted;false
otherwise.
-
value
public GeneratorResult<FpNumber> value()
Description copied from interface:Iterator
Returns the current value of the iterator.- Specified by:
value
in interfaceIterator<GeneratorResult<FpNumber>>
- Returns:
- the current value of the iterator.
-
next
public void next()
Description copied from interface:Iterator
Makes an iteration.- Specified by:
next
in interfaceIterator<GeneratorResult<FpNumber>>
-
stop
public void stop()
Description copied from interface:Iterator
Stops the iterator.- Specified by:
stop
in interfaceIterator<GeneratorResult<FpNumber>>
-
clone
public FpDivHardToDRoundIterator clone()
Description copied from interface:Iterator
Creates a copy of the iterator.- Specified by:
clone
in interfaceIterator<GeneratorResult<FpNumber>>
- Overrides:
clone
in classjava.lang.Object
- Returns:
- A copy of the iterator.
-
-