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"? Fin

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 w

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 catche

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 duplicat

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 t

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 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

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 > elimin

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) { > thro

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 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 > > whi

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
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 wrote: > O

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 wrote: > On 9/21/11 4:33 PM,

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
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 NonMonoto

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:59

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Greg Sterijevski
I would not want to remove the current implementation (the one with double[] as an arg). However, I might want to check lists to make sure that they are monotonically increasing. I want to avoid writing a checkOrder method for int[], long[], float[],..., if it is possible. Also, one should be able

Re: [Math] MathUtils.checkOrder

2011-09-21 Thread Gilles Sadowski
On Wed, Sep 21, 2011 at 05:17:59PM -0500, Greg Sterijevski wrote: > Meant to say add, not replace. My apologies. -Greg I like this better! ;-) [But, still, please check the intended meaning of the first argument of (sub-classes of) "MathIllegalArgumentException".] Gilles

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 boo

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 wrote: > Hello All, > > In MathUtils there exists the method: > > public static boolean checkOrder(double[] val, OrderDirection dir, > boolean strict, bool

[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 checkOrder(Co