|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apfloat.samples.Pi.ChudnovskyPiCalculator
public static class 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 | |
---|---|
Apfloat |
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) 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, 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 Apfloat execute()
execute
in interface Operation<Apfloat>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |