[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Attachment: math-1130.patch

Added replace and remove methods into MathArrays. these have two flavours one 
with full array and another flavour with (values, begin, length) just to be 
consistent with verifyValues and copyOf where length is a parameter.  I am 
willing to change to make use of start and end indices but felt that signature 
in verifyValues seemed more natural for me and hence continued the same 
tradition even to these methods. (For eg: copyOf, verifyValues, 
System.arraycopy where a start index/indices and a length is good to drive)

Added a canEqual method into MathUtils and have added testEquals and 
testCanEqual to indicate canEqual runs faster. if you closely observe in 
testEquals i have reduced the for loop iteration counts as otherwise if we made 
the same numbers as that of testCanEqual it would take very long time.I have 
also tried with Precision.equalsIncludingNan but without much a success in 
speed. I just added these high iteration counts to verify why canEqual may be 
better.

So either we could go with adding this new method
or alter MathUtils.equals or Precision.equasIncludingNaN methods.

Please let me know your thoughts



 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans and as well as both +ve and -ve Infinities faster and then move to a 
 detailed Double.compare(..) method. This avoids the Double.compare call for 
 infinities and NaN with faster reference equal check (i.e == ).



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


[jira] [Commented] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040564#comment-14040564
 ] 

Venkatesha Murthy TS commented on MATH-1130:


I missed adding about checkNotNan(values, begin, length) in MathArrays which 
essentially adds a a range for check. 

One more point; 
If we are supporting replace and remove for entire array; naming them as 
removeInRange or replaceInRange IMO may not be a good fit. Instead without the 
InRange suffix ; we could  to support both the flavours viz one with full array 
and another with a range with [begin, begin+length).

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans and as well as both +ve and -ve Infinities faster and then move to a 
 detailed Double.compare(..) method. This avoids the Double.compare call for 
 infinities and NaN with faster reference equal check (i.e == ).



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


[jira] [Commented] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040575#comment-14040575
 ] 

Venkatesha Murthy TS commented on MATH-1120:


Any concerns do we see if the bUilder approach is modifed as 
Percentile.Builder().nanStrategy(REMOVED).pivotingStrategy(MEDIAN_OF_3).quantile(50),build();

B'cos i see that with the with approach suggested; we will keep creating 
additional instances of percentle. So if instead we went with a build method 
only one Builder Helper instance will be used untill we call build() method. I 
can send that patch if that thought is acceptable. Please let know
ofcourse all builder attribute setters are fluent in nature and are optional. 
So for eg:

Also with Math-1130 changes coming in for remove and replace; i can add the 
refactored replace and remove methods as well. Please let know if i can modify 
with these changes and send the patch again.



 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: 18-jun-percentile-with-estimation-patch, 
 excel-percentile-patch, percentile-with-estimation-patch, r-output.txt

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 Please let me know if i could submit this as a patch.



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


[jira] [Comment Edited] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040575#comment-14040575
 ] 

Venkatesha Murthy TS edited comment on MATH-1120 at 6/23/14 9:42 AM:
-

Any concerns do we see if the bUilder approach is modifed as 
Percentile.Builder().nanStrategy(REMOVED).pivotingStrategy(MEDIAN_OF_3).quantile(50),build();

B'cos i see that with the with approach suggested; we will keep creating 
additional instances of percentle. So if instead we went with a build method 
only one Builder Helper instance will be used untill we call build() method. I 
can send that patch if that thought is acceptable. Please let know
ofcourse all builder attribute setters are fluent in nature and are optional. 

Also with Math-1130 changes coming in for remove and replace; i can add the 
refactored replace and remove methods as well. Please let know if i can modify 
with these changes and send the patch again.




was (Author: vmurthy):
Any concerns do we see if the bUilder approach is modifed as 
Percentile.Builder().nanStrategy(REMOVED).pivotingStrategy(MEDIAN_OF_3).quantile(50),build();

B'cos i see that with the with approach suggested; we will keep creating 
additional instances of percentle. So if instead we went with a build method 
only one Builder Helper instance will be used untill we call build() method. I 
can send that patch if that thought is acceptable. Please let know
ofcourse all builder attribute setters are fluent in nature and are optional. 
So for eg:

Also with Math-1130 changes coming in for remove and replace; i can add the 
refactored replace and remove methods as well. Please let know if i can modify 
with these changes and send the patch again.



 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: 18-jun-percentile-with-estimation-patch, 
 excel-percentile-patch, percentile-with-estimation-patch, r-output.txt

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 Please let me know if i could submit this as a patch.



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


[jira] [Comment Edited] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040575#comment-14040575
 ] 

Venkatesha Murthy TS edited comment on MATH-1120 at 6/23/14 10:00 AM:
--

Regarding medianOf3() method:
--
If we didnt throw exception then it means the user would presume that it may 
still be possible to modify the selection logic with changing medianof3 logic. 
Instead i was thinking that  if we deprecate and throw the 
MathIllegalArgumentException; then a clear message is given saying that any 
invocation is really of no consequence and hence throwing exception out. 
Ofcourse some one may still try override and put some logic in there but aleast 
our intent in deprecating and the exception throwing would be coherrent in the 
existing code.
Please let know. 

Regarding Builder:
---
Any concerns do we see if the bUilder approach is modifed as 
Percentile.Builder().nanStrategy(REMOVED).pivotingStrategy(MEDIAN_OF_3).quantile(50),build();

B'cos i see that with the with approach suggested; we will keep creating 
additional instances of percentle. So if instead we went with a build method 
only one Builder Helper instance will be used untill we call build() method. I 
can send that patch if that thought is acceptable. Please let know
ofcourse all builder attribute setters are fluent in nature and are optional. 

Regarding replace and remove
---
Also with Math-1130 changes coming in for remove and replace; i can add the 
refactored replace and remove methods as well. Please let know if i can modify 
with these changes and send the patch again.




was (Author: vmurthy):
Any concerns do we see if the bUilder approach is modifed as 
Percentile.Builder().nanStrategy(REMOVED).pivotingStrategy(MEDIAN_OF_3).quantile(50),build();

B'cos i see that with the with approach suggested; we will keep creating 
additional instances of percentle. So if instead we went with a build method 
only one Builder Helper instance will be used untill we call build() method. I 
can send that patch if that thought is acceptable. Please let know
ofcourse all builder attribute setters are fluent in nature and are optional. 

Also with Math-1130 changes coming in for remove and replace; i can add the 
refactored replace and remove methods as well. Please let know if i can modify 
with these changes and send the patch again.



 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: 18-jun-percentile-with-estimation-patch, 
 excel-percentile-patch, percentile-with-estimation-patch, r-output.txt

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 Please let me know if i could submit this as a patch.



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


[jira] [Commented] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-23 Thread Luc Maisonobe (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040590#comment-14040590
 ] 

Luc Maisonobe commented on MATH-1120:
-

Yes, but the intermediate instances only copy references, so its only a few 
bytes.
We use the same pattern elsewhere (currently only in a small part of 
optimization) and intend to use it further (for example in ODE). Having the 
instance themselves implement the withXxx allow the following use case:

{code}
 Algo a = new Algo().withX().withY();
 double result1 = a.doSomeHugeComputation();
 Algo b = a.withZ();
 double result2 = b.doSomeHugeComputation();
 double delta = result2 - result1; // here, we have the differential effect of 
the withZ() setting
{code}

 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: 18-jun-percentile-with-estimation-patch, 
 excel-percentile-patch, percentile-with-estimation-patch, r-output.txt

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 Please let me know if i could submit this as a patch.



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


[jira] [Commented] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Gilles (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040711#comment-14040711
 ] 

Gilles commented on MATH-1130:
--

Please make _separate_ patches for each new functionality. It will be clearer 
and easier to discuss them.

You should also post on the dev ML, to avoid wasting time on something in 
case it is objected to there.

In particular, I still don't get the purpose of canEqual. It looks like a 
duplicate of equalsIncludingNaN.

bq. If we are supporting replace and remove for entire array; naming them as 
removeInRange or replaceInRange IMO may not be a good fit.

We could have remove(double[] a, double v) and removeInRange(double[] a, int 
from, int to, double v), with
{code}
public static double[] remove(double[] a, double v) {
return removeInRange(a, 0, a.length, v);
}
{code}

bq. signature in verifyValues seemed more natural for me and hence continued 
the same tradition even to these methods.

MathArrays was intended to collect methods akin to those in java.lang.Arrays 
and most methods there use from and to indices.
verifyValues predates the creation of the MathArrays utility class...

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans and as well as both +ve and -ve Infinities faster and then move to a 
 detailed Double.compare(..) method. This avoids the Double.compare call for 
 infinities and NaN with faster reference equal check (i.e == ).



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


[jira] [Commented] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Gilles (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040715#comment-14040715
 ] 

Gilles commented on MATH-1130:
--

bq. verifyValues predates the creation of the MathArrays utility class...

Oops. I'm wrong: it is from 3.3!
I have missed it. Otherwise I would have pushed for another syntax. :(

It is possible to deprecate those in 3.4 and switch to the other syntax...

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans and as well as both +ve and -ve Infinities faster and then move to a 
 detailed Double.compare(..) method. This avoids the Double.compare call for 
 infinities and NaN with faster reference equal check (i.e == ).



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


[jira] [Commented] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040861#comment-14040861
 ] 

Venkatesha Murthy TS commented on MATH-1130:


When you mean separate patch; are you saying 3 separate patch files for the 
same MATH-1130 issue? Just wanted to be sure.
Say for eg: math-1130-remove.patch, math-1130-replace.patch , 
math-1130-canequal.patch

Also when you mean from and to is to Inclusive or excluded. IMO when end index 
must be inclusive so that means when in a for loop
for(int index = from; index = end; index++){
...
...
}


 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans and as well as both +ve and -ve Infinities faster and then move to a 
 detailed Double.compare(..) method. This avoids the Double.compare call for 
 infinities and NaN with faster reference equal check (i.e == ).



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


[jira] [Commented] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Gilles (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040884#comment-14040884
 ] 

Gilles commented on MATH-1130:
--

bq. 3 separate patch files

Yes.
Changes should be as small as possible in order to ease reviewing.

bq. same MATH-1130

Nothing forbids you to open separate issues (or create sub-tasks -- see the 
More tab on this page).

bq. is to Inclusive or excluded.

Excluded. See 
[Arrays.copyOfRange|http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#copyOfRange(double\[\],
 int, int)]


 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans and as well as both +ve and -ve Infinities faster and then move to a 
 detailed Double.compare(..) method. This avoids the Double.compare call for 
 infinities and NaN with faster reference equal check (i.e == ).



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


[jira] [Updated] (VFS-530) Update HDFS to latest release in prep for VFS 2.1 release

2014-06-23 Thread Chris Nauroth (JIRA)

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

Chris Nauroth updated VFS-530:
--

Attachment: winutils.exe
hadoop.dll
VFS-530-3.patch

Hello, [~b.eckenfels].  I work on Hadoop, and I had replied to your question to 
the hdfs-dev list:

https://mail-archives.apache.org/mod_mbox/hadoop-hdfs-dev/201406.mbox/%3CCABCYYb8U0KUDZLZVgsZ6%3DDa9xfxOT1c9SC%3D5bcTmb-Q4CMi_%2Bw%40mail.gmail.com%3E

To summarize, we have a weakness in that the Apache releases don't yet bundle 
the Windows native build artifacts, and I also think it will take a lot of work 
(and possibly cause some problematic behavior) to try to provide a no-native 
fallback code path.

I've had a chance to check out the Commons VFS code and experiment a bit, and I 
have a suggestion to unblock the Windows tests for your new release.  Would you 
consider checking in the built binaries of winutils.exe and hadoop.dll and 
adding pom.xml changes to reference these files during test runs?  This would 
be a quick and easy fix.  The downside is that you may need to refresh these 
builds later when you upgrade your Hadoop version again.  This would only be 
required if we add new native code.  If Commons VFS doesn't have the 
infrastructure to rebuild these Hadoop artifacts, then I or someone else from 
the Hadoop community would be glad to help in your future versions.

I'm attaching 3 files.  VFS-530-3.patch is almost the same as VFS-530-2.patch, 
but adds configuration to maven-surefire-plugin so that test runs can find 
winutils.exe and hadoop.dll.  The winutils.exe and hadoop.dll are built from 
the Apache Hadoop 2.4.0 source.  These need to go in a new directory, core/bin, 
and it's important that they get checked in with 755 permissions.  I have the 
whole change visible in a private GitHub branch here:

https://github.com/cnauroth/commons-vfs/tree/VFS-530

With these changes, I successfully ran {{HdfsFileProviderTest}} and 
{{HdfsFileProviderTestCase}} on my Windows machine.

I hope this helps, and let me know if you have any other questions.

 Update HDFS to latest release in prep for VFS 2.1 release
 -

 Key: VFS-530
 URL: https://issues.apache.org/jira/browse/VFS-530
 Project: Commons VFS
  Issue Type: Task
Affects Versions: 2.1
Reporter: Dave Marion
 Fix For: 2.1

 Attachments: VFS-530-1.patch, VFS-530-2.patch, VFS-530-3.patch, 
 hadoop.dll, winutils.exe






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


[jira] [Updated] (MATH-418) add a storeless version of Percentile

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-418:
--

Attachment: psquare-23-june.patch

Hi Phil,

Thanks for committing.

A small change however and i have attached the patch against today.
a) the public double quantile() method is a simple getter method which just 
returns the set quantile during construction. So its not the result. Basically 
its the  p/100 value which is within [0.0-1.0]

b) Next in the test method testDistribution() of PSquarePercentileTest.java the 
fixed seed random generator need to be used even in here as well. '

Regards
Venkatesh

 add a storeless version of Percentile
 -

 Key: MATH-418
 URL: https://issues.apache.org/jira/browse/MATH-418
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 2.1
Reporter: Luc Maisonobe
 Fix For: 3.4

 Attachments: 30-may-2014-418-psquare-patch, 418-psquare-patch, 
 psquare-23-june.patch, psquare-patch


 The Percentile class can handle only in-memory data.
 It would be interesting to use an on-line algorithm to estimate quantiles as 
 a storeless statistic.
 An example of such an algorithm is the exponentially weighted stochastic 
 approximation  described in a 2000 paper by Fei Chen ,  Diane Lambert  and 
 José C. Pinheiro Incremental Quantile Estimation for Massive Tracking which 
 can be retrieved from CiteSeerX at 
 [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.105.1580].



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


[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Attachment: math-1130-checknotnan.patch
math-1130-canequal.patch
math-1130-remove.patch
math-1130-replace.patch

I have split the changes into independently appliable patches.

a) checknotnan : a new method which handles ranges
b) canequal : A faster equals method for nan equality tests when compared to 
Math,equals or Precision.equalsIncludingNaN (please check the test code here 
where the performance difference can be seen
c) remove : contains remove and removeInRange as discussed with a small helper 
private static method called findInRange.
d) replace : contains replace and replaceInRange

Both removeInRange and replaceInRange  methods make use of canEqual

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-canequal.patch, math-1130-checknotnan.patch, 
 math-1130-remove.patch, math-1130-replace.patch, math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans and as well as both +ve and -ve Infinities faster and then move to a 
 detailed Double.compare(..) method. This avoids the Double.compare call for 
 infinities and NaN with faster reference equal check (i.e == ).



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


[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Description: 
These are utility functions mostly required as part of MathArrays.

MathArrays:
=
The requirement is as follows:

a) double[] copyOf(double[] values, int begin, int length) ;

Similar to most other functions that support slice defined  by  the array part 
from [begin, begin+length) ;its a requirement to copy a slice which is not 
available (the closest is copyOf(array, int len) which misses out the begin 
index)

b) double[] removeAll(double[] values, int begin, int length, double removable);

Need a function to remove a value from array slice defined by 
[begin,begin+length) and return the filtered version.

c) double[] replaceAll(double[] values, int begin, int length, double oldValue, 
double newValue);

Need a function to replace inplace an oldValue substituted with newValue in the 
array slice defined by [begin,begin+length) and return the original  complete 
array with just replaced values only in the segment [begin,begin+length)

MathUtils
=
boolean canEqual(double d1, double d2) ;

provide a canEqual function that is slightly better than exisitng 
MathUtils.equals. We could also improve existing equals method however.
So the change here is that the new enhanced canEqual can do a quick check on 
Nans  and then move to a detailed Double.compare(..) method. This avoids the 
Double.compare call when any one of them is NaN.


  was:
These are utility functions mostly required as part of MathArrays.

MathArrays:
=
The requirement is as follows:

a) double[] copyOf(double[] values, int begin, int length) ;

Similar to most other functions that support slice defined  by  the array part 
from [begin, begin+length) ;its a requirement to copy a slice which is not 
available (the closest is copyOf(array, int len) which misses out the begin 
index)

b) double[] removeAll(double[] values, int begin, int length, double removable);

Need a function to remove a value from array slice defined by 
[begin,begin+length) and return the filtered version.

c) double[] replaceAll(double[] values, int begin, int length, double oldValue, 
double newValue);

Need a function to replace inplace an oldValue substituted with newValue in the 
array slice defined by [begin,begin+length) and return the original  complete 
array with just replaced values only in the segment [begin,begin+length)

MathUtils
=
boolean canEqual(double d1, double d2) ;

provide a canEqual function that is slightly better than exisitng 
MathUtils.equals. We could also improve existing equals method however.
So the change here is that the new enhanced canEqual can do a quick check on 
Nans and as well as both +ve and -ve Infinities faster and then move to a 
detailed Double.compare(..) method. This avoids the Double.compare call for 
infinities and NaN with faster reference equal check (i.e == ).



 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-canequal.patch, math-1130-checknotnan.patch, 
 math-1130-remove.patch, math-1130-replace.patch, math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when 

[jira] [Comment Edited] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14041058#comment-14041058
 ] 

Venkatesha Murthy TS edited comment on MATH-1130 at 6/23/14 6:16 PM:
-

I have split the changes into independently appliable patches.

a) math-1130-checknotnan : a new method which handles ranges
b) math-1130-canequal : A faster equals method for nan equality tests when 
compared to Math,equals or Precision.equalsIncludingNaN. Sure yes, 
Precision.equalsIncludingNaN does check for both being NaN but falls short of 
covering the case of one of them being NaN, (please check the test code in this 
patch on how much it matters)
c) math-1130-remove : contains remove and removeInRange as discussed with a 
small helper private static method called findInRange.
d) math-1130-replace : contains replace and replaceInRange

Both removeInRange and replaceInRange  methods make use of canEqual


was (Author: vmurthy):
I have split the changes into independently appliable patches.

a) checknotnan : a new method which handles ranges
b) canequal : A faster equals method for nan equality tests when compared to 
Math,equals or Precision.equalsIncludingNaN (please check the test code here 
where the performance difference can be seen
c) remove : contains remove and removeInRange as discussed with a small helper 
private static method called findInRange.
d) replace : contains replace and replaceInRange

Both removeInRange and replaceInRange  methods make use of canEqual

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-canequal.patch, math-1130-checknotnan.patch, 
 math-1130-remove.patch, math-1130-replace.patch, math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when any one of them is NaN.



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


[jira] [Commented] (MATH-1120) Need Percentile computations that can be matched with standard spreadsheet formula

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14041084#comment-14041084
 ] 

Venkatesha Murthy TS commented on MATH-1120:


Got the view point on Builder.

However on the medianOf3: just want to make my point clear. If we add any code 
except a one liner for throwing exception; the user is going to be mislead 
assuming it is being used where as it is not. 

On the remove and replace refactoring, please give me some time as MATH-1130 is 
in progress.

 Need Percentile computations that can be matched with standard spreadsheet 
 formula
 --

 Key: MATH-1120
 URL: https://issues.apache.org/jira/browse/MATH-1120
 Project: Commons Math
  Issue Type: Improvement
Affects Versions: 3.2
Reporter: Venkatesha Murthy TS
  Labels: Percentile
 Fix For: 4.0

 Attachments: 18-jun-percentile-with-estimation-patch, 
 excel-percentile-patch, percentile-with-estimation-patch, r-output.txt

   Original Estimate: 504h
  Remaining Estimate: 504h

 The current Percentile implementation assumes and hard-codes the quantile pth 
 position as 
 p * (N+1)/100 and provides a kth selected value.
 However if we need to verify compare/contrast with standard statistical tools 
 such as say MS Excel; it would be good to provide an extensible way of 
 morphing this selection of position than hard code.
 For example in order to generate the percentile closely matching with MS 
 Excel the position required may be [p*(N-1)/100]+1.
 Please let me know if i could submit this as a patch.



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


[jira] [Created] (JCS-132) EnsureCDIIsTestedWhenTCKsRunTest fails on Java 1.6

2014-06-23 Thread Sebb (JIRA)
Sebb created JCS-132:


 Summary: EnsureCDIIsTestedWhenTCKsRunTest fails on Java 1.6
 Key: JCS-132
 URL: https://issues.apache.org/jira/browse/JCS-132
 Project: Commons JCS
  Issue Type: Bug
Reporter: Sebb


EnsureCDIIsTestedWhenTCKsRunTest fails on Java 1.6 because it tries to load 
javax.cache.annotation.BeanProvider.class

Unfortunately the jar in which is is contained appears to have been built for 
Java 1.7 (unlike the rest of the javax jars).

Some possible workrounds:
- use a different class if there is another that is suitable
- get the providers to release a version that works for Java 1.6
- catch the failure, and convert it to a warning on Java 1.6



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


[jira] [Commented] (JCS-132) EnsureCDIIsTestedWhenTCKsRunTest fails on Java 1.6

2014-06-23 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/JCS-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14041521#comment-14041521
 ] 

Sebb commented on JCS-132:
--

I checked a few of the older versions of the jar and they all have the same 
problem.

 EnsureCDIIsTestedWhenTCKsRunTest fails on Java 1.6
 --

 Key: JCS-132
 URL: https://issues.apache.org/jira/browse/JCS-132
 Project: Commons JCS
  Issue Type: Bug
Reporter: Sebb

 EnsureCDIIsTestedWhenTCKsRunTest fails on Java 1.6 because it tries to load 
 javax.cache.annotation.BeanProvider.class
 Unfortunately the jar in which is is contained appears to have been built for 
 Java 1.7 (unlike the rest of the javax jars).
 Some possible workrounds:
 - use a different class if there is another that is suitable
 - get the providers to release a version that works for Java 1.6
 - catch the failure, and convert it to a warning on Java 1.6



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


[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Attachment: (was: math-1130-remove.patch)

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-checknotnan.patch, math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when any one of them is NaN.



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


[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Attachment: (was: math-1130-replace.patch)

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-checknotnan.patch, math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when any one of them is NaN.



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


[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Attachment: (was: math-1130-canequal.patch)

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-checknotnan.patch, math-1130.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when any one of them is NaN.



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


[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Attachment: (was: math-1130.patch)

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-checknotnan.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when any one of them is NaN.



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


[jira] [Updated] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

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

Venkatesha Murthy TS updated MATH-1130:
---

Attachment: math-1130-precision-equals.patch
math-1130-remove.patch
math-1130-replace.patch

Removed old patch files and attached here is a re worked patch with a small 
change for Precision.equalsIncludingNaN

So essentially:
math-1130-precision-equals: has the fix for early detection of one of them 
being NaN. both double and float variants have the changes

math-1130-remove and math-1130-replace: Have incorporated to use 
Precision.equalsIncludingNaN

Removed math-1130-canEqual as per discussion.

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-checknotnan.patch, 
 math-1130-precision-equals.patch, math-1130-remove.patch, 
 math-1130-replace.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when any one of them is NaN.



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


[jira] [Comment Edited] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array

2014-06-23 Thread Venkatesha Murthy TS (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14041668#comment-14041668
 ] 

Venkatesha Murthy TS edited comment on MATH-1130 at 6/24/14 4:30 AM:
-

As per discussion i agree not to add another equals method (namely the 
canEqual) just for nan check speed up. Instead as suggested i am assuming here 
to make corrections to Precision.equalsIncludingNaN as it pertains clearly to 
handling nan as a special case while checking for equality. 

Hence removed old patch files and attached here is a re worked patch with a 
small change for Precision.equalsIncludingNaN

So essentially:
math-1130-precision-equals: has the fix for early detection of one of them 
being NaN. both double and float variants have the changes

math-1130-remove and math-1130-replace: Have incorporated to make use of 
Precision.equalsIncludingNaN

Removed math-1130-canEqual and the big patch file math-1130 as smaller patch 
files are more desirable for review. So each of the patch files right now are 
independent. Should i also need to submit a complete total changes patch for 
overall committing. Please let know what is suitable here..


was (Author: vmurthy):
Removed old patch files and attached here is a re worked patch with a small 
change for Precision.equalsIncludingNaN

So essentially:
math-1130-precision-equals: has the fix for early detection of one of them 
being NaN. both double and float variants have the changes

math-1130-remove and math-1130-replace: Have incorporated to use 
Precision.equalsIncludingNaN

Removed math-1130-canEqual as per discussion.

 A new set of functions for copyof, remove and replace a given value on a 
 slice of array
 ---

 Key: MATH-1130
 URL: https://issues.apache.org/jira/browse/MATH-1130
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 3.4
Reporter: Venkatesha Murthy TS
 Attachments: math-1130-checknotnan.patch, 
 math-1130-precision-equals.patch, math-1130-remove.patch, 
 math-1130-replace.patch


 These are utility functions mostly required as part of MathArrays.
 MathArrays:
 =
 The requirement is as follows:
 a) double[] copyOf(double[] values, int begin, int length) ;
 Similar to most other functions that support slice defined  by  the array 
 part from [begin, begin+length) ;its a requirement to copy a slice which is 
 not available (the closest is copyOf(array, int len) which misses out the 
 begin index)
 b) double[] removeAll(double[] values, int begin, int length, double 
 removable);
 Need a function to remove a value from array slice defined by 
 [begin,begin+length) and return the filtered version.
 c) double[] replaceAll(double[] values, int begin, int length, double 
 oldValue, double newValue);
 Need a function to replace inplace an oldValue substituted with newValue in 
 the array slice defined by [begin,begin+length) and return the original  
 complete array with just replaced values only in the segment 
 [begin,begin+length)
 MathUtils
 =
 boolean canEqual(double d1, double d2) ;
 provide a canEqual function that is slightly better than exisitng 
 MathUtils.equals. We could also improve existing equals method however.
 So the change here is that the new enhanced canEqual can do a quick check on 
 Nans  and then move to a detailed Double.compare(..) method. This avoids the 
 Double.compare call when any one of them is NaN.



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