Package org.apfloat.samples
Class PiParallel.ParallelRamanujanPiCalculator
java.lang.Object
org.apfloat.samples.Pi.RamanujanPiCalculator
org.apfloat.samples.PiParallel.ParallelRamanujanPiCalculator
- All Implemented Interfaces:
Serializable
,Operation<Apfloat>
- Direct Known Subclasses:
PiDistributed.DistributedRamanujanPiCalculator
- Enclosing class:
PiParallel
Class for calculating pi using the parallel Ramanujan's binary splitting algorithm.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionParallelRamanujanPiCalculator
(long precision, int radix) Construct a pi calculator with the specified precision and radix.protected
ParallelRamanujanPiCalculator
(Pi.BinarySplittingPiCalculator calculator, long precision, int radix) Construct a pi calculator with the specified binary splitting algorithm. -
Method Summary
-
Constructor Details
-
ParallelRamanujanPiCalculator
Construct a pi calculator with the specified precision and radix.- Parameters:
precision
- The target precision.radix
- The radix to be used.- Throws:
ApfloatRuntimeException
-
ParallelRamanujanPiCalculator
protected ParallelRamanujanPiCalculator(Pi.BinarySplittingPiCalculator calculator, long precision, int radix) throws ApfloatRuntimeException Construct a pi calculator with the specified binary splitting algorithm.- Parameters:
calculator
- The binary splitting algorithm to be used.precision
- The target precision.radix
- The radix to be used.- Throws:
ApfloatRuntimeException
-
-
Method Details
-
execute
Description copied from class:Pi.RamanujanPiCalculator
Calculate pi using the Ramanujan binary splitting algorithm.- Specified by:
execute
in interfaceOperation<Apfloat>
- Overrides:
execute
in classPi.RamanujanPiCalculator
- Returns:
- Return value of the operation.
-