org.apfloat.samples
Class PiParallel.ParallelRamanujanPiCalculator

java.lang.Object
  extended by org.apfloat.samples.PiParallel.ParallelRamanujanPiCalculator
All Implemented Interfaces:
Serializable, Operation<Apfloat>
Direct Known Subclasses:
PiDistributed.DistributedRamanujanPiCalculator
Enclosing class:
PiParallel

public static class PiParallel.ParallelRamanujanPiCalculator
extends Object
implements Operation<Apfloat>

Class for calculating pi using the parallel Ramanujan's binary splitting algorithm.

See Also:
Serialized Form

Constructor Summary
  PiParallel.ParallelRamanujanPiCalculator(long precision, int radix)
          Construct a pi calculator with the specified precision and radix.
protected PiParallel.ParallelRamanujanPiCalculator(PiParallel.ParallelBinarySplittingPiCalculator calculator, long precision, int radix)
          Construct a pi calculator with the specified parallel binary splitting algorithm.
 
Method Summary
 Apfloat execute()
          Calculate pi using the Ramanujan's binary splitting algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PiParallel.ParallelRamanujanPiCalculator

public PiParallel.ParallelRamanujanPiCalculator(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

PiParallel.ParallelRamanujanPiCalculator

protected PiParallel.ParallelRamanujanPiCalculator(PiParallel.ParallelBinarySplittingPiCalculator calculator,
                                                   long precision,
                                                   int radix)
                                            throws ApfloatRuntimeException
Construct a pi calculator with the specified parallel 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()
Calculate pi using the Ramanujan's binary splitting algorithm.

Specified by:
execute in interface Operation<Apfloat>
Returns:
Return value of the operation.