Package org.apfloat.samples
Class PiParallel.ParallelChudnovskyPiCalculator
- java.lang.Object
-
- org.apfloat.samples.Pi.ChudnovskyPiCalculator
-
- org.apfloat.samples.PiParallel.ParallelChudnovskyPiCalculator
-
- Direct Known Subclasses:
PiDistributed.DistributedChudnovskyPiCalculator
- Enclosing class:
- PiParallel
public static class PiParallel.ParallelChudnovskyPiCalculator extends Pi.ChudnovskyPiCalculator
Class for calculating pi using the parallel Chudnovskys' binary splitting algorithm.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description ParallelChudnovskyPiCalculator(long precision, int radix)
Construct a pi calculator with the specified precision and radix.protected
ParallelChudnovskyPiCalculator(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 Apfloat
execute()
Calculate pi using the Chudnovskys' binary splitting algorithm.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParallelChudnovskyPiCalculator
public ParallelChudnovskyPiCalculator(long precision, int radix) throws ApfloatRuntimeException
Construct a pi calculator with the specified precision and radix.- Parameters:
precision
- The target precision.radix
- The radix to be used.- Throws:
ApfloatRuntimeException
-
ParallelChudnovskyPiCalculator
protected ParallelChudnovskyPiCalculator(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.ChudnovskyPiCalculator
Calculate pi using the Chudnovskys' binary splitting algorithm.- Specified by:
execute
in interfaceOperation<Apfloat>
- Overrides:
execute
in classPi.ChudnovskyPiCalculator
- Returns:
- Return value of the operation.
-
-