Package org.apfloat.samples
Class PiParallel.ParallelRamanujanPiCalculator
- java.lang.Object
-
- org.apfloat.samples.Pi.RamanujanPiCalculator
-
- org.apfloat.samples.PiParallel.ParallelRamanujanPiCalculator
-
- Direct Known Subclasses:
PiDistributed.DistributedRamanujanPiCalculator
- Enclosing class:
- PiParallel
public static class PiParallel.ParallelRamanujanPiCalculator extends Pi.RamanujanPiCalculator
Class for calculating pi using the parallel Ramanujan's binary splitting algorithm.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description ParallelRamanujanPiCalculator(long precision, int radix)Construct a pi calculator with the specified precision and radix.protectedParallelRamanujanPiCalculator(Pi.BinarySplittingPiCalculator calculator, long precision, int radix)Construct a pi calculator with the specified binary splitting algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Apfloatexecute()Calculate pi using the Ramanujan binary splitting algorithm.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParallelRamanujanPiCalculator
public ParallelRamanujanPiCalculator(long precision, int radix) throws ApfloatRuntimeExceptionConstruct 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 Detail
-
execute
public Apfloat execute()
Description copied from class:Pi.RamanujanPiCalculatorCalculate pi using the Ramanujan binary splitting algorithm.- Specified by:
executein interfaceOperation<Apfloat>- Overrides:
executein classPi.RamanujanPiCalculator- Returns:
- Return value of the operation.
-
-