You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dennis Hendriks (Created) (JIRA)" <ji...@apache.org> on 2012/01/02 10:44:31 UTC

[jira] [Created] (MATH-730) Add uniform distributions (integer and real)

Add uniform distributions (integer and real)
--------------------------------------------

                 Key: MATH-730
                 URL: https://issues.apache.org/jira/browse/MATH-730
             Project: Commons Math
          Issue Type: New Feature
            Reporter: Dennis Hendriks
             Fix For: 3.0
         Attachments: uniform-distributions.patch

Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-730) Add uniform distributions (integer and real)

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182395#comment-13182395 ] 

Sébastien Brisard commented on MATH-730:
----------------------------------------

Patch committed in {{r1229042}}, with following modifications
* minor javadoc changes,
* removed methods {{getLowerBound()}} and {{getUpperBound()}} as they are equivalent to {{getSupportLowerBound()}} and {{getSupportUpperBound()}}.

Thanks Dennis for this contribution! Are you OK if I resolve this issue?
Sébastien
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-730) Add uniform distributions (integer and real)

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182408#comment-13182408 ] 

Sébastien Brisard commented on MATH-730:
----------------------------------------

Arghhh! Changed in {{r1229050}}.
I indeed intended to handle that in a separate issue. So we close this one. Thanks again!
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-730) Add uniform distributions (integer and real)

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13179421#comment-13179421 ] 

Sébastien Brisard commented on MATH-730:
----------------------------------------

Thanks Dennis for this contribution. I'm sure other people will find that improvement useful. I'll look into it and commit it ASAP.
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Resolved] (MATH-730) Add uniform distributions (integer and real)

Posted by "Sébastien Brisard (Resolved JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sébastien Brisard resolved MATH-730.
------------------------------------

    Resolution: Fixed

Patch contributed has been successfully applied.
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-730) Add uniform distributions (integer and real)

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182404#comment-13182404 ] 

Sébastien Brisard commented on MATH-730:
----------------------------------------

{quote}
One small issue: RandomDataImpl.nextUniform(double, double) has different @throws (exception class and message) than nextUniform(double, double, boolean). They should probably be identical, as one calls the other.
{quote}
You're right, changed in {{r1229048}}. Thanks for pointing that out!

{quote}
And one question: What is the reason for not including the @throws for the 2 methods in the interface as well? Don't we expect all implementations to conform to that exception in that exact case? That would allow users to catch it, regardless of the actual implementation class.
{quote}
I know. While reviewing your patch, I actually noticed that nowhere in the {{RandomData}} interface were the exceptions specified. For the sake of homogeneity, I did the same with the two flavours of {{nextDouble}}, making a mental note about a more thorough cleaning up of the whole interface. One more point which I'll keep in mind when I do that
??All public methods advertise all exceptions that they can generate. Exceptions must be documented in {color:red}both javadoc and method signatures{color} and the documentation in the javadoc must include full description of the conditions under which exceptions are thrown.??
(see developers guide).
I'll dive into it in the coming days, if that's OK with you.
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (MATH-730) Add uniform distributions (integer and real)

Posted by "Dennis Hendriks (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-730:
---------------------------------

    Attachment: uniform-distributions.patch
    
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-730) Add uniform distributions (integer and real)

Posted by "Dennis Hendriks (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182400#comment-13182400 ] 

Dennis Hendriks commented on MATH-730:
--------------------------------------

bq. Thanks Dennis for this contribution!

Thank you for committing it.

bq. Are you OK if I resolve this issue?

One small issue: RandomDataImpl.nextUniform(double, double) has different @throws (exception class and message) than nextUniform(double, double, boolean). They should probably be identical, as one calls the other.

And one question: What is the reason for not including the @throws for the 2 methods in the interface as well? Don't we expect all implementations to conform to that exception in that exact case? That would allow users to catch it, regardless of the actual implementation class.
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-730) Add uniform distributions (integer and real)

Posted by "Dennis Hendriks (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182406#comment-13182406 ] 

Dennis Hendriks commented on MATH-730:
--------------------------------------

bq. You're right, changed in r1229048. Thanks for pointing that out!

No problem. One small typo though: "if one of the bounds is infinite of {@code NaN}" should be "if one of the bounds is infinite or {@code NaN}"

bq. I'll dive into it in the coming days, if that's OK with you.

No problem. You can do that in a different issue I think. It's OK with me to close this one.
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-730) Add uniform distributions (integer and real)

Posted by "Dennis Hendriks (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13179409#comment-13179409 ] 

Dennis Hendriks commented on MATH-730:
--------------------------------------

I was rather puzzled when I found out that uniform distributions were not available, while they are so trivial, as they correspond very closely to the underlying random number generators. I don't know if these distributions will be used very often, but I think they should be included in Commons Math, even if it is just for completeness sake.

I actually needed these for my own application, but decided to put in a bit more effort and make them Commons Math compatible, so that others may benefit from my work. What do you think, could they be included?
                
> Add uniform distributions (integer and real)
> --------------------------------------------
>
>                 Key: MATH-730
>                 URL: https://issues.apache.org/jira/browse/MATH-730
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: uniform-distributions.patch
>
>
> Add UniformIntegerDistribution and UniformRealDistribution classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira