Package org.apfloat.samples
Class Pi.BinarySplittingPiCalculator
- java.lang.Object
-
- org.apfloat.samples.Pi.BinarySplittingPiCalculator
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
PiParallel.ParallelBinarySplittingPiCalculator
- Enclosing class:
- Pi
protected static class Pi.BinarySplittingPiCalculator extends java.lang.Object implements java.io.Serializable
Class for implementing the binary splitting algorithm.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private Pi.BinarySplittingSeries
series
-
Constructor Summary
Constructors Constructor Description BinarySplittingPiCalculator(Pi.BinarySplittingSeries series)
Construct a pi calculator with the specified precision and radix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Apfloat
a(long n)
private Apfloat
p(long n)
private Apfloat
q(long n)
void
r(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, Pi.BinarySplittingProgressIndicator progressIndicator)
Entry point for the binary splitting algorithm.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
series
private Pi.BinarySplittingSeries series
-
-
Constructor Detail
-
BinarySplittingPiCalculator
public BinarySplittingPiCalculator(Pi.BinarySplittingSeries series)
Construct a pi calculator with the specified precision and radix.- Parameters:
series
- The binary splitting series to be used.
-
-
Method Detail
-
r
public void r(long n1, long n2, ApfloatHolder T, ApfloatHolder Q, ApfloatHolder P, Pi.BinarySplittingProgressIndicator progressIndicator) throws ApfloatRuntimeException
Entry point for the binary splitting algorithm.- 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
-
a
private Apfloat a(long n) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
p
private Apfloat p(long n) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
q
private Apfloat q(long n) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
-