Package org.apfloat.samples
Class PiParallel.ParallelBinarySplittingPiCalculator
- java.lang.Object
-
- org.apfloat.samples.Pi.BinarySplittingPiCalculator
-
- org.apfloat.samples.PiParallel.ParallelBinarySplittingPiCalculator
-
- All Implemented Interfaces:
java.io.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ParallelBinarySplittingPiCalculator(Pi.BinarySplittingSeries series)
Construct a parallel pi calculator with the specified precision and radix.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
r(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, Pi.BinarySplittingProgressIndicator progressIndicator)
Entry point for the binary splitting algorithm.private static boolean
split(long n1, long n2, int numberOfProcessors)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
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
-
split
private static boolean split(long n1, long n2, int numberOfProcessors)
-
-