commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Artem Barger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (RNG-5) Create API usage demo example application.
Date Fri, 12 Aug 2016 20:16:21 GMT

    [ https://issues.apache.org/jira/browse/RNG-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15419390#comment-15419390
] 

Artem Barger commented on RNG-5:
--------------------------------

I think this comment on main method of ComputePi is not quite accurate. 

{code:java}
    /**
     * Arguments:
     * <ul>
     *  <li>
     *   Error on the approximation: computation will stop when the
     *   absolute difference between successive approximations is lower
     *   than the given value.
     *  </li>
     *  <li>
     *   {@link RandomSource Random source identifier}.
     *  </li>
     * </ul>
     */
{code}

I think that Monte-Carlo method doesn't restricted for integration on [0..1]^d, while for
user guide demo it could be fine. 
Also I think that 
{code:java}
private double[] generateU01()
{code}

Could be generalized to produce numbers within interval [a..b]
{code:java}
private double[] generate(double a, double b)
{code}

and generate numbers with
{code:java}
rand[i] = (b - a) * rng.nextDouble() + a;
{code}

And last, can you explain why convergence scheme wasn't good?



> Create API usage demo example application.
> ------------------------------------------
>
>                 Key: RNG-5
>                 URL: https://issues.apache.org/jira/browse/RNG-5
>             Project: Commons RNG
>          Issue Type: Task
>            Reporter: Artem Barger
>         Attachments: ComputePiDemo.java
>
>
> Need to create a demo application for user guide to demonstrate how to use the API and
show possible application.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message