hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Illecker (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HAMA-905) Fix Pi Estimator Example
Date Tue, 20 May 2014 11:26:38 GMT

     [ https://issues.apache.org/jira/browse/HAMA-905?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Illecker updated HAMA-905:
---------------------------------

    Attachment: HAMA-905_2.patch

Thanks for the patch!
But I think there is an additional possible improvement.
Each peer should send its hits (in the circle) to the master task and not execute the division
{{(in / iterations)}}.
I believe it would increase the precision if the division is only done by the master task.
Please check my patch. Thanks!
{code}
mvn -Dtest=org.apache.hama.examples.PiEstimatorTest test
{code}

> Fix Pi Estimator Example
> ------------------------
>
>                 Key: HAMA-905
>                 URL: https://issues.apache.org/jira/browse/HAMA-905
>             Project: Hama
>          Issue Type: Bug
>          Components: examples
>    Affects Versions: 0.6.4
>            Reporter: Martin Illecker
>            Priority: Minor
>              Labels: example, pi_example
>             Fix For: 0.7.0
>
>         Attachments: HAMA-905.patch, HAMA-905_2.patch
>
>
> *Fix Pi Estimator Example*
> I think we should skip the *sqrt* method in \[1] and change the if condition based on
formula 6 on page 2 in \[2]. 
> {code}
> IF (x^2 + y^2 <= 1) THEN
>  SUM = SUM +1
> END IF
> {code}
> Because the Equation of the Circle is 
> {code}
> x^2 + y^2 = r^2
> x^2 + y^2 = 1 (with r=1 in unit circle)
> -> (x^2 + y^2 <= 1)
> {code}
> Thanks!
> \[1] https://github.com/apache/hama/blob/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java#L62-64
> \[2] http://arxiv.org/pdf/1404.1499v2.pdf



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message