Package org.apfloat.samples
Class PiParallel.ParallelBinarySplittingPiCalculator
java.lang.Object
org.apfloat.samples.Pi.BinarySplittingPiCalculator
org.apfloat.samples.PiParallel.ParallelBinarySplittingPiCalculator
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
PiDistributed.DistributedBinarySplittingPiCalculator
- Enclosing class:
PiParallel
protected static class PiParallel.ParallelBinarySplittingPiCalculator
extends Pi.BinarySplittingPiCalculator
Parallel version of the binary splitting algorithm.
Uses multiple threads to calculate pi in parallel.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a parallel pi calculator with the specified precision and radix. -
Method Summary
Modifier and TypeMethodDescriptionvoid
r
(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, Pi.BinarySplittingProgressIndicator progressIndicator) Entry point for the binary splitting algorithm.
-
Constructor Details
-
ParallelBinarySplittingPiCalculator
public ParallelBinarySplittingPiCalculator(Pi.BinarySplittingSeries series) throws ApfloatRuntimeException Construct a parallel pi calculator with the specified precision and radix.- Parameters:
series
- The binary splitting series to be used.- Throws:
ApfloatRuntimeException
-
-
Method Details
-
r
public void r(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, Pi.BinarySplittingProgressIndicator progressIndicator) throws ApfloatRuntimeException Description copied from class:Pi.BinarySplittingPiCalculator
Entry point for the binary splitting algorithm.- Overrides:
r
in classPi.BinarySplittingPiCalculator
- Parameters:
n1
- Start term.n2
- End term.T
- Algorithm parameter.Q
- Algorithm parameter.P
- Algorithm parameter.progressIndicator
- Class to print out the progress of the calculation.- Throws:
ApfloatRuntimeException
-