Package org.apfloat.samples
Class PiParallel
java.lang.Object
org.apfloat.samples.Pi
org.apfloat.samples.PiParallel
- Direct Known Subclasses:
PiDistributed
Calculates pi using multiple threads in parallel.
Note that to get any performance gain from running many threads in parallel, the JVM must be executing native threads. If the JVM is running in green threads mode, there is no advantage of having multiple threads, as the JVM will in fact execute just one thread and divide its time to multiple simulated threads.
- Version:
- 1.14.0
- Author:
- Mikko Tommila
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Parallel version of the binary splitting algorithm.static class
Class for calculating pi using the parallel Chudnovskys' binary splitting algorithm.static class
Class for calculating pi using the parallel Ramanujan's binary splitting algorithm.protected static class
Class to execute operations while settingApfloatContext.setNumberOfProcessors(int)
to some value.Nested classes/interfaces inherited from class org.apfloat.samples.Pi
Pi.AbstractBinarySplittingSeries, Pi.BinarySplittingPiCalculator, Pi.BinarySplittingProgressIndicator, Pi.BinarySplittingSeries, Pi.BorweinPiCalculator, Pi.ChudnovskyBinarySplittingSeries, Pi.ChudnovskyPiCalculator, Pi.GaussLegendrePiCalculator, Pi.RamanujanBinarySplittingSeries, Pi.RamanujanPiCalculator
-
Field Summary
-
Method Summary
-
Method Details
-
main
Command-line entry point.- Parameters:
args
- Command-line parameters.- Throws:
IOException
- In case writing the output fails.ApfloatRuntimeException
-