Monte Carlo Integration using DispatchQueue and concurrentPerform in Swift 5 Part 2 of 4

preview_player
Показать описание
This program uses Monte Carlo Integration to calculate the integral of exp(-x) from 0 to 1. Monte Carlo Integration is slow as the calculation improves with the sqrt(N) where N is the number of guesses. One can get valuable speed up In the calculation by threading the calculation and utilizing multiple processors or cores. This program utilizes Swift 5 and DispatchQueue (specifically concurrentPerform) to thread the calculation of the integral.

Рекомендации по теме