org.apfloat.samples
Class PiParallel.ParallelBinarySplittingPiCalculator

java.lang.Object
  extended by org.apfloat.samples.Pi.BinarySplittingPiCalculator
      extended by 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:
Serialized Form

Constructor Summary
PiParallel.ParallelBinarySplittingPiCalculator(Pi.BinarySplittingSeries series)
          Construct a parallel pi calculator with the specified precision and radix.
 
Method Summary
 void r(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, Pi.BinarySplittingProgressIndicator progressIndicator)
          Entry point for the binary splitting algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PiParallel.ParallelBinarySplittingPiCalculator

public PiParallel.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 class Pi.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