Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Gilles Sadowski
Hi. I do not understand why a non-monotone collection should throw a IllegalArgumentException...? There is nothing wrong with the argument, it just is not in corrected order. Wouldn't it be better to return a false? We have: if (!ok abort) { throw new

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Gilles Sadowski
On Wed, Sep 21, 2011 at 08:11:00PM -0500, Greg Sterijevski wrote: One more question, there is a boolean argument called 'abort', what sense does it make to keep checking an array given you have found one observation which violates monotonicity? I think abort is redundant and could be

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Gilles Sadowski
On Wed, Sep 21, 2011 at 06:27:12PM -0700, Phil Steitz wrote: On 9/21/11 6:11 PM, Greg Sterijevski wrote: One more question, there is a boolean argument called 'abort', what sense does it make to keep checking an array given you have found one observation which violates monotonicity? I think

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Gilles Sadowski
As a side note, I notice now that NonMonotonousSequenceException is misnamed. It should be NonMonotoneSequenceException. I think it would be good to fix that for 3.0. How about compromising on NonMonotonicSequenceException? Gilles

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Greg Sterijevski
Either is fine by me... ;) In case my opinion was solicited. On Thu, Sep 22, 2011 at 5:02 AM, Gilles Sadowski gil...@harfang.homelinux.org wrote: As a side note, I notice now that NonMonotonousSequenceException is misnamed. It should be NonMonotoneSequenceException. I think it

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Gilles Sadowski
On Wed, Sep 21, 2011 at 08:31:00PM -0500, Greg Sterijevski wrote: Any objections to fixing this? Having a method public static boolean isMonotone(double[] val, OrderDirection dir, boolean strict) creates unnecessary

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Greg Sterijevski
I agree with your assessment that having almost identical methods is a pain. However, without doing this I need to return a very complicated set of information from isMonotone to be able to construct the exception. As for catching the exception, I was under the impression that CM code never

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Gilles Sadowski
On Thu, Sep 22, 2011 at 08:58:19AM -0500, Greg Sterijevski wrote: I agree with your assessment that having almost identical methods is a pain. However, without doing this I need to return a very complicated set of information from isMonotone to be able to construct the exception. Yes, this

Re: [Math] MathUtils.checkOrder

2011-09-22 Thread Phil Steitz
On 9/22/11 3:02 AM, Gilles Sadowski wrote: As a side note, I notice now that NonMonotonousSequenceException is misnamed. It should be NonMonotoneSequenceException. I think it would be good to fix that for 3.0. How about compromising on NonMonotonicSequenceException? Fine by me. Phil

[Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
Hello All, In MathUtils there exists the method: public static boolean checkOrder(double[] val, OrderDirection dir, boolean strict, boolean abort) { ...code omitted... } I would like to replace it with the method: public static boolean

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
Meant to say add, not replace. My apologies. -Greg On Wed, Sep 21, 2011 at 5:05 PM, Greg Sterijevski gsterijev...@gmail.comwrote: Hello All, In MathUtils there exists the method: public static boolean checkOrder(double[] val, OrderDirection dir,

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Gilles Sadowski
Hi. In MathUtils there exists the method: public static boolean checkOrder(double[] val, OrderDirection dir, boolean strict, boolean abort) { ...code omitted... } I would like to replace it with the method: public static boolean

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
The reason I am looking at checkOrder is your suggestion for UpdatingMultipleLinearRegression, eg checking if the variables are presented in monotonically increasing order... On Wed, Sep 21, 2011 at 5:56 PM, Gilles Sadowski gil...@harfang.homelinux.org wrote: On Wed, Sep 21, 2011 at 05:17:59PM

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
Gilles, I do not understand why a non-monotone collection should throw a IllegalArgumentException...? There is nothing wrong with the argument, it just is not in corrected order. Wouldn't it be better to return a false? We have: if (!ok abort) { throw new

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Phil Steitz
On 9/21/11 4:33 PM, Greg Sterijevski wrote: Gilles, I do not understand why a non-monotone collection should throw a IllegalArgumentException...? There is nothing wrong with the argument, it just is not in corrected order. Wouldn't it be better to return a false? I think as you guys are

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
If there are no objections, I will move the body of the current checkOrder(double[] arg, ...) into a isMonotone method. I will also create a parallel set of checkOrder, isMonotone functions for Comparable[] arrays. -Greg On Wed, Sep 21, 2011 at 7:41 PM, Phil Steitz phil.ste...@gmail.com wrote:

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
One more question, there is a boolean argument called 'abort', what sense does it make to keep checking an array given you have found one observation which violates monotonicity? I think abort is redundant and could be eliminated. Thoughts? On Wed, Sep 21, 2011 at 7:41 PM, Phil Steitz

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Phil Steitz
On 9/21/11 6:11 PM, Greg Sterijevski wrote: One more question, there is a boolean argument called 'abort', what sense does it make to keep checking an array given you have found one observation which violates monotonicity? I think abort is redundant and could be eliminated. Thoughts? Looks

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
Any objections to fixing this? On Wed, Sep 21, 2011 at 8:27 PM, Phil Steitz phil.ste...@gmail.com wrote: On 9/21/11 6:11 PM, Greg Sterijevski wrote: One more question, there is a boolean argument called 'abort', what sense does it make to keep checking an array given you have found one