|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apfloat.samples.Pi.ChudnovskyPiCalculator
org.apfloat.samples.PiParallel.ParallelPiCalculator
protected static class PiParallel.ParallelPiCalculator
Parallel version of the Chudnovskys' binary splitting algorithm. Uses multiple threads to calculate pi in parallel.
Field Summary |
---|
Fields inherited from class org.apfloat.samples.Pi.ChudnovskyPiCalculator |
---|
precision, radix |
Constructor Summary | |
---|---|
PiParallel.ParallelPiCalculator(long precision,
int radix)
Construct a parallel pi calculator with the specified precision and radix. |
Method Summary | |
---|---|
Apfloat |
execute()
Calculate pi using the Chudnovskys' binary splitting algorithm. |
protected OperationExecutor[] |
getNodes()
Get the available set of operation executor nodes. |
protected void |
r(long n1,
long n2,
ApfloatHolder T,
ApfloatHolder Q,
ApfloatHolder P,
ApfloatHolder F,
OperationExecutor[] nodes,
Pi.ChudnovskyProgressIndicator progressIndicator)
Entry point for the parallel binary splitting algorithm. |
protected OperationExecutor[] |
recombineNodes(OperationExecutor[] nodes,
int numberNeeded)
Attempt to combine or split nodes to form the needed number of nodes. |
Methods inherited from class org.apfloat.samples.Pi.ChudnovskyPiCalculator |
---|
r |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PiParallel.ParallelPiCalculator(long precision, int radix) throws ApfloatRuntimeException
precision
- The target precision.radix
- The radix to be used.
ApfloatRuntimeException
Method Detail |
---|
protected void r(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, ApfloatHolder F, OperationExecutor[] nodes, Pi.ChudnovskyProgressIndicator progressIndicator) throws ApfloatRuntimeException
n1
- Start term.n2
- End term.T
- Algorithm parameter.Q
- Algorithm parameter.P
- Algorithm parameter.F
- Pointer to inverse square root parameter.nodes
- The operation executors to be used for the calculation.progressIndicator
- Class to print out the progress of the calculation.
ApfloatRuntimeException
protected OperationExecutor[] getNodes()
LocalOperationExecutor
s
but subclasses may return other operation executors.
protected OperationExecutor[] recombineNodes(OperationExecutor[] nodes, int numberNeeded)
nodes
- The operation executors to recombine.numberNeeded
- The requested number of operation executors.
public Apfloat execute()
execute
in interface Operation<Apfloat>
execute
in class Pi.ChudnovskyPiCalculator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |