|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apfloat.samples.Pi.ChudnovskyPiCalculator
Basic class for calculating pi using the Chudnovskys' binary splitting algorithm.
Field Summary | |
protected long |
precision
Target precision. |
protected int |
radix
Radix to be used. |
Constructor Summary | |
Pi.ChudnovskyPiCalculator(long precision,
int radix)
Construct a pi calculator with the specified precision and radix. |
Method Summary | |
java.lang.Object |
execute()
Calculate pi using the Chudnovskys' binary splitting algorithm. |
protected void |
r(long n1,
long n2,
ApfloatHolder T,
ApfloatHolder Q,
ApfloatHolder P,
Pi.ChudnovskyProgressIndicator 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 |
Field Detail |
protected long precision
protected int radix
Constructor Detail |
public Pi.ChudnovskyPiCalculator(long precision, int radix)
precision
- The target precision.radix
- The radix to be used.Method Detail |
protected void r(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, Pi.ChudnovskyProgressIndicator progressIndicator) throws ApfloatRuntimeException
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.
ApfloatRuntimeException
public java.lang.Object execute()
execute
in interface Operation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |