[jira] [Commented] (FILEUPLOAD-269) CommonsFileUploadSupport ignores fileSizeMax

2021-06-04 Thread Arturo Bernal (Jira)


[ 
https://issues.apache.org/jira/browse/FILEUPLOAD-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357752#comment-17357752
 ] 

Arturo Bernal commented on FILEUPLOAD-269:
--

 Hi [~sergiuo]

Don't understand the exactly problem here. AFAIK Those class that you comment 
are from Spring. On the other hand, the maximum size is used in 
FileItemIterator, FileItemStreamImpl, among others . 

Pls cl

TY

 

> CommonsFileUploadSupport ignores fileSizeMax 
> -
>
> Key: FILEUPLOAD-269
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-269
> Project: Commons FileUpload
>  Issue Type: Bug
>Affects Versions: 1.3.1
>Reporter: Sergiu Ojog
>Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Code:
> long fileSizeMax = 1024*1024;
> CommonsMultipartResolver commonsMultipartResolver = new 
> CommonsMultipartResolver(servletContext);
>   commonsMultipartResolver.getFileUpload().setFileSizeMax(fileSizeMax);
> commonsMultipartResolver.resolveMultipart(request);
> Observed:
> The fileSizeMax is not used, 
> CommonsFileUploadSupport.prepareFileUpload creates a new FileUpload and does 
> not propagate the existing fileSizeMax.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (MATH-1412) "KalmanFilterTest" is shaky

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved MATH-1412.
---
Fix Version/s: (was: 4.0)
   Resolution: Cannot Reproduce

Using random seeds as of commit ac25b3b9f35218f1c5ba9b2ded9e5389ab035e50, the 
test still passes.

> "KalmanFilterTest" is shaky
> ---
>
> Key: MATH-1412
> URL: https://issues.apache.org/jira/browse/MATH-1412
> Project: Commons Math
>  Issue Type: Test
>Reporter: Gilles Sadowski
>Priority: Minor
>  Labels: unit-test
>
> Test method "testCannonball" is too sensitive to the seed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RNG-142) Return type of method "withUniformRandomProvider"

2021-06-04 Thread Gilles Sadowski (Jira)
Gilles Sadowski created RNG-142:
---

 Summary: Return type of method "withUniformRandomProvider"
 Key: RNG-142
 URL: https://issues.apache.org/jira/browse/RNG-142
 Project: Commons RNG
  Issue Type: Improvement
  Components: sampling
Reporter: Gilles Sadowski


Expected usage:
{code:java}
NormalizedGaussianSampler n01 = 
ZigguratNormalizedGaussianSampler.of(RandomSource.create(RandomSource.KISS));

GaussianSampler g = 
GaussianSampler.of(n01.withUniformRandomProvider(RandomSource.create(RandomSource.JSF_64)),
 0.43, 2.1);
{code}
Code doesn't compile: Method {{withUniformRandomProvider}} returns a 
{{SharedStateContinuousSampler}} whereas a {{NormalizedGaussianSampler}} is 
required.

Am I missing something?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-jexl] henrib merged pull request #57: More parser compatibility fixes for JavaCC/JJTree

2021-06-04 Thread GitBox


henrib merged pull request #57:
URL: https://github.com/apache/commons-jexl/pull/57


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (NUMBERS-156) SafeNorm 3D overload

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/NUMBERS-156?focusedWorklogId=607225=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-607225
 ]

ASF GitHub Bot logged work on NUMBERS-156:
--

Author: ASF GitHub Bot
Created on: 04/Jun/21 17:56
Start Date: 04/Jun/21 17:56
Worklog Time Spent: 10m 
  Work Description: darkma773r commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r645753894



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see 

[GitHub] [commons-numbers] darkma773r commented on a change in pull request #92: NUMBERS-156: replacing SafeNorm with Norms and Summation

2021-06-04 Thread GitBox


darkma773r commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r645753894



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double[] v) {
+double sum = 0d;
+double comp = 0d;
+
+for (int i = 0; i < v.length; ++i) {
+final double x = Math.abs(v[i]);
+final double sx = sum + x;
+comp += ExtendedPrecision.twoSumLow(sum, x, sx);
+sum = sx;
+

[GitHub] [commons-jexl] coveralls commented on pull request #57: More parser compatibility fixes for JavaCC/JJTree

2021-06-04 Thread GitBox


coveralls commented on pull request #57:
URL: https://github.com/apache/commons-jexl/pull/57#issuecomment-854902123


   
   [![Coverage 
Status](https://coveralls.io/builds/40318027/badge)](https://coveralls.io/builds/40318027)
   
   Coverage remained the same at 87.042% when pulling 
**74dcd97613a047a7ff031cf7537f6878447fe761 on csamak:master** into 
**93f0a96be935a6a476147bee4e3913262c910f4f on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-jexl] csamak opened a new pull request #57: More parser compatibility fixes for JavaCC/JJTree

2021-06-04 Thread GitBox


csamak opened a new pull request #57:
URL: https://github.com/apache/commons-jexl/pull/57


   I'm not sure why STATIC=false was commented out? Without it, generating
   the parser with JavaCC does not work.
   
   The Parser constructor taking String throws ParseException (a checked
   exception) when generated with JavaCC. I'm not sure why, but the
   StringProvider exception does not.
   
   For the pragmaValue changes, unreachable statements were generated. See
   http://consoliii.blogspot.com/2014/05/javacc-modern-mode-how-to-resolve.html
   
   With these changes I'm able to use JavaCC and everything passes again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Commented] (JEXL-350) map[null] throws "unsolvable property" when a Sandbox is used

2021-06-04 Thread Henri Biestro (Jira)


[ 
https://issues.apache.org/jira/browse/JEXL-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357479#comment-17357479
 ] 

Henri Biestro commented on JEXL-350:


Not fixing yet as 3.2 RC1 is already under review; will reintegrate if/when RC2.

https://github.com/apache/commons-jexl/tree/93f0a96be935a6a476147bee4e3913262c910f4f

> map[null] throws "unsolvable property" when a Sandbox is used
> -
>
> Key: JEXL-350
> URL: https://issues.apache.org/jira/browse/JEXL-350
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.1
> Environment: jdk-11.0.5_10-hotspot
> JEXL git pull on 2021-06-03
>  
>Reporter: David Costanzo
>Assignee: Henri Biestro
>Priority: Major
>
> In JEXL 3.2 SNAPSHOT, you can can access a null property in a map if you have 
> no sandbox, but you cannot access a null property in a map if you have an 
> "allow box" sandbox.  This asymmetry is weird and might be an oversight.
> The fix for JEXL-327 allows setting a null property in a map using the array 
> syntax, but only for the case where there is no sandbox.  The fix for 
> JEXL-291 allows array-style access to values in a map when using a sandbox.  
> What remains is the intersection of these two use cases: accessing a null 
> property in a map using the array-access syntax when there's a sandbox.
>  
> *Impact:*
> In my domain (working with data from clinical trials), a null numeric value 
> means "missing", which is a valid value.  Our JEXL programmers implement 
> "switch" statements using a map, so you might see an expression that 
> translates a coded variable named "DMSEX" into an English description like:
> {code:java}
> {
>null : "Unknown",
>1: "MALE",
>2: "FEMALE"
> }[DMSEX]{code}
> Not being able to read the "Unknown" value when DMSEX=null is a problem that 
> we've had to work around by copying the internal class SandboxUberspect and 
> hacking it to allow this.
>  
> *Technical Details:*
> I think the problem starts in SandboxUbserspect.getPropertyGet() because 
> identifier is null.  In this case, the most of the logic is skipped and null 
> is returned, indicating that the property is undefined.
> {code:java}
> @Override
> public JexlPropertyGet getPropertyGet(final List resolvers,
>   final Object obj,
>   final Object identifier) {
> if (obj != null && identifier != null) {
> final String property = identifier.toString();
> final String actual = sandbox.read(obj.getClass(), property);
> if (actual != null) {
>  // no transformation, strict equality: use identifier before 
> string conversion
> final Object pty = actual == property? identifier : actual;
> return uberspect.getPropertyGet(resolvers, obj, pty);
> }
> }
> return null;
> }
> {code}
> In my superficial understanding, the Sandbox.read() method doesn't have a way 
> to distinguish between "null is the property you want to read" and "access is 
> blocked" so in my hack, I had to always allow read access of null.
>  
> *Steps to Reproduce:*
> Below are some unit tests which show the four possibilities of with/without 
> sandbox and get/set null.  I've included the behavior in JEXL 3.1 and a 
> recent build of github as comments.
> {code:java}
> @Test
> public void testGetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, works
> // JEXL 3.2, works
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> 
> @Test
> public void testGetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> JexlSandbox(true)).create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, throws JexlException$Property "undefined property 
> '.'"
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> @Test
> public void testSetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null] = 
> 'bar'");
> 
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, works
> expression.evaluate(jc);
> }
> @Test
> public void testSetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> 

[jira] [Comment Edited] (JEXL-350) map[null] throws "unsolvable property" when a Sandbox is used

2021-06-04 Thread Henri Biestro (Jira)


[ 
https://issues.apache.org/jira/browse/JEXL-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357276#comment-17357276
 ] 

Henri Biestro edited comment on JEXL-350 at 6/4/21, 4:40 PM:
-

Thank you David for this precise ticket (as usual), appreciated :-)

Fix enables being explicit about the 'null' property read/write permissions.

https://github.com/apache/commons-jexl/tree/be81fa5325fadb28a51b0140da6eb17cb8538429


was (Author: henrib):
Thank you David for this precise ticket (as usual), appreciated :-)

Fix will enable being explicit about the 'null' property read/write permissions.

> map[null] throws "unsolvable property" when a Sandbox is used
> -
>
> Key: JEXL-350
> URL: https://issues.apache.org/jira/browse/JEXL-350
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.1
> Environment: jdk-11.0.5_10-hotspot
> JEXL git pull on 2021-06-03
>  
>Reporter: David Costanzo
>Assignee: Henri Biestro
>Priority: Major
>
> In JEXL 3.2 SNAPSHOT, you can can access a null property in a map if you have 
> no sandbox, but you cannot access a null property in a map if you have an 
> "allow box" sandbox.  This asymmetry is weird and might be an oversight.
> The fix for JEXL-327 allows setting a null property in a map using the array 
> syntax, but only for the case where there is no sandbox.  The fix for 
> JEXL-291 allows array-style access to values in a map when using a sandbox.  
> What remains is the intersection of these two use cases: accessing a null 
> property in a map using the array-access syntax when there's a sandbox.
>  
> *Impact:*
> In my domain (working with data from clinical trials), a null numeric value 
> means "missing", which is a valid value.  Our JEXL programmers implement 
> "switch" statements using a map, so you might see an expression that 
> translates a coded variable named "DMSEX" into an English description like:
> {code:java}
> {
>null : "Unknown",
>1: "MALE",
>2: "FEMALE"
> }[DMSEX]{code}
> Not being able to read the "Unknown" value when DMSEX=null is a problem that 
> we've had to work around by copying the internal class SandboxUberspect and 
> hacking it to allow this.
>  
> *Technical Details:*
> I think the problem starts in SandboxUbserspect.getPropertyGet() because 
> identifier is null.  In this case, the most of the logic is skipped and null 
> is returned, indicating that the property is undefined.
> {code:java}
> @Override
> public JexlPropertyGet getPropertyGet(final List resolvers,
>   final Object obj,
>   final Object identifier) {
> if (obj != null && identifier != null) {
> final String property = identifier.toString();
> final String actual = sandbox.read(obj.getClass(), property);
> if (actual != null) {
>  // no transformation, strict equality: use identifier before 
> string conversion
> final Object pty = actual == property? identifier : actual;
> return uberspect.getPropertyGet(resolvers, obj, pty);
> }
> }
> return null;
> }
> {code}
> In my superficial understanding, the Sandbox.read() method doesn't have a way 
> to distinguish between "null is the property you want to read" and "access is 
> blocked" so in my hack, I had to always allow read access of null.
>  
> *Steps to Reproduce:*
> Below are some unit tests which show the four possibilities of with/without 
> sandbox and get/set null.  I've included the behavior in JEXL 3.1 and a 
> recent build of github as comments.
> {code:java}
> @Test
> public void testGetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, works
> // JEXL 3.2, works
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> 
> @Test
> public void testGetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> JexlSandbox(true)).create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, throws JexlException$Property "undefined property 
> '.'"
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> @Test
> public void testSetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null] = 
> 

[jira] [Updated] (CLI-309) MissingArgumentException when DefaultParser processes an option value which starts with hyphen/dash.

2021-06-04 Thread ilia (Jira)


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

ilia updated CLI-309:
-
Description: 
 

When processing option value which starts with hyphen/dash like *-sec-attr 
-password1* , exception [1] occurs. If the current token start with dash, it 
will be processed as an option and therefore this will not be set as a value to 
the previous option, which will cause [1]. The only way to set such value is to 
use equals sign like *-sec-attr=-password1*. In this case the whole token is 
processed as option=value pair and the correct value will be set.

 

[1] 
{code:java}
org.apache.commons.cli.MissingArgumentException: Missing argument for option: 
xorg.apache.commons.cli.MissingArgumentException: Missing argument for option: 
x at 
org.apache.commons.cli.DefaultParser.checkRequiredArgs(DefaultParser.java:211) 
at org.apache.commons.cli.DefaultParser.handleOption(DefaultParser.java:612) at 
org.apache.commons.cli.DefaultParser.handleConcatenatedOptions(DefaultParser.java:691)
 at 
org.apache.commons.cli.DefaultParser.handleShortAndLongOption(DefaultParser.java:533)
 at org.apache.commons.cli.DefaultParser.handleToken(DefaultParser.java:243) at 
org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:120) at 
org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:81) {code}

  was:
 

When processing option value which starts with hyphen/dash like *--sec-attr 
-password1* , exception [1] occurs. If the current token start with dash, it 
will be processed as an option and therefore this will not be set as a value to 
the previous option, which will cause [1]. The only way to set such value is to 
use equals sign like *--sec-attr=-password1*. In this case the whole token is 
processed as option=value pair and the correct value will be set.

 

[1] 
{code:java}

org.apache.commons.cli.MissingArgumentException: Missing argument for option: 
xorg.apache.commons.cli.MissingArgumentException: Missing argument for option: 
x at 
org.apache.commons.cli.DefaultParser.checkRequiredArgs(DefaultParser.java:211) 
at org.apache.commons.cli.DefaultParser.handleOption(DefaultParser.java:612) at 
org.apache.commons.cli.DefaultParser.handleConcatenatedOptions(DefaultParser.java:691)
 at 
org.apache.commons.cli.DefaultParser.handleShortAndLongOption(DefaultParser.java:533)
 at org.apache.commons.cli.DefaultParser.handleToken(DefaultParser.java:243) at 
org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:120) at 
org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:81) {code}


> MissingArgumentException when DefaultParser processes an option value which 
> starts with hyphen/dash.
> 
>
> Key: CLI-309
> URL: https://issues.apache.org/jira/browse/CLI-309
> Project: Commons CLI
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 1.4
>Reporter: ilia
>Priority: Major
>
>  
> When processing option value which starts with hyphen/dash like *-sec-attr 
> -password1* , exception [1] occurs. If the current token start with dash, it 
> will be processed as an option and therefore this will not be set as a value 
> to the previous option, which will cause [1]. The only way to set such value 
> is to use equals sign like *-sec-attr=-password1*. In this case the whole 
> token is processed as option=value pair and the correct value will be set.
>  
> [1] 
> {code:java}
> org.apache.commons.cli.MissingArgumentException: Missing argument for option: 
> xorg.apache.commons.cli.MissingArgumentException: Missing argument for 
> option: x at 
> org.apache.commons.cli.DefaultParser.checkRequiredArgs(DefaultParser.java:211)
>  at org.apache.commons.cli.DefaultParser.handleOption(DefaultParser.java:612) 
> at 
> org.apache.commons.cli.DefaultParser.handleConcatenatedOptions(DefaultParser.java:691)
>  at 
> org.apache.commons.cli.DefaultParser.handleShortAndLongOption(DefaultParser.java:533)
>  at org.apache.commons.cli.DefaultParser.handleToken(DefaultParser.java:243) 
> at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:120) at 
> org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:81) {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (NUMBERS-156) SafeNorm 3D overload

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/NUMBERS-156?focusedWorklogId=607173=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-607173
 ]

ASF GitHub Bot logged work on NUMBERS-156:
--

Author: ASF GitHub Bot
Created on: 04/Jun/21 16:03
Start Date: 04/Jun/21 16:03
Worklog Time Spent: 10m 
  Work Description: aherbert commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r645687076



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see 

[GitHub] [commons-numbers] aherbert commented on a change in pull request #92: NUMBERS-156: replacing SafeNorm with Norms and Summation

2021-06-04 Thread GitBox


aherbert commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r645687076



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double[] v) {
+double sum = 0d;
+double comp = 0d;
+
+for (int i = 0; i < v.length; ++i) {
+final double x = Math.abs(v[i]);
+final double sx = sum + x;
+comp += ExtendedPrecision.twoSumLow(sum, x, sx);
+sum = sx;
+}

[jira] [Created] (CLI-309) MissingArgumentException when DefaultParser processes an option value which starts with hyphen/dash.

2021-06-04 Thread ilia (Jira)
ilia created CLI-309:


 Summary: MissingArgumentException when DefaultParser processes an 
option value which starts with hyphen/dash.
 Key: CLI-309
 URL: https://issues.apache.org/jira/browse/CLI-309
 Project: Commons CLI
  Issue Type: Bug
  Components: Parser
Affects Versions: 1.4
Reporter: ilia


 

When processing option value which starts with hyphen/dash like *--sec-attr 
-password1* , exception [1] occurs. If the current token start with dash, it 
will be processed as an option and therefore this will not be set as a value to 
the previous option, which will cause [1]. The only way to set such value is to 
use equals sign like *--sec-attr=-password1*. In this case the whole token is 
processed as option=value pair and the correct value will be set.

 

[1] 
{code:java}

org.apache.commons.cli.MissingArgumentException: Missing argument for option: 
xorg.apache.commons.cli.MissingArgumentException: Missing argument for option: 
x at 
org.apache.commons.cli.DefaultParser.checkRequiredArgs(DefaultParser.java:211) 
at org.apache.commons.cli.DefaultParser.handleOption(DefaultParser.java:612) at 
org.apache.commons.cli.DefaultParser.handleConcatenatedOptions(DefaultParser.java:691)
 at 
org.apache.commons.cli.DefaultParser.handleShortAndLongOption(DefaultParser.java:533)
 at org.apache.commons.cli.DefaultParser.handleToken(DefaultParser.java:243) at 
org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:120) at 
org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:81) {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (NUMBERS-156) SafeNorm 3D overload

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/NUMBERS-156?focusedWorklogId=607118=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-607118
 ]

ASF GitHub Bot logged work on NUMBERS-156:
--

Author: ASF GitHub Bot
Created on: 04/Jun/21 14:50
Start Date: 04/Jun/21 14:50
Worklog Time Spent: 10m 
  Work Description: darkma773r commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r645632793



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see 

[GitHub] [commons-numbers] darkma773r commented on a change in pull request #92: NUMBERS-156: replacing SafeNorm with Norms and Summation

2021-06-04 Thread GitBox


darkma773r commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r645632793



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double[] v) {
+double sum = 0d;
+double comp = 0d;
+
+for (int i = 0; i < v.length; ++i) {
+final double x = Math.abs(v[i]);
+final double sx = sum + x;
+comp += ExtendedPrecision.twoSumLow(sum, x, sx);
+sum = sx;
+

[jira] [Updated] (LANG-1654) isAnyBlank method of StringUtils doesn't do null check

2021-06-04 Thread Xandra McCoy (Jira)


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

Xandra McCoy updated LANG-1654:
---
Attachment: image.png

> isAnyBlank method of StringUtils doesn't do null check
> --
>
> Key: LANG-1654
> URL: https://issues.apache.org/jira/browse/LANG-1654
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 2.6
>Reporter: zalak pathak
>Priority: Major
>  Labels: Lang3, StringUtils
> Attachments: image-2021-03-31-16-51-10-002.png, 
> image-2021-03-31-17-15-47-453.png, image.png
>
>
> my string-a is null. i tried calling StringUtis.isNoneBlank(a) method which 
> gives true when string a is null.
> i debugged it and found that isNoneBlank() in turn calls isAnyBlank() method 
> which gives false when the string a is null.
> !image-2021-03-31-17-15-47-453.png!
> and in isNoneBlank() method ,it returns ! isAnyBlank(css) so it gives me true 
> where it should give false.
> We have used commonsLangVersion = '2.6' version in gradle and the package 
> imported is org.apache.commons.lang3
>  
> !image-2021-03-31-16-51-10-002.png!
>  
> Let me know in case of any query.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (NUMBERS-161) PlaneAngle Numerical Accuracy

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved NUMBERS-161.
-
Resolution: Fixed

> PlaneAngle Numerical Accuracy
> -
>
> Key: NUMBERS-161
> URL: https://issues.apache.org/jira/browse/NUMBERS-161
> Project: Commons Numbers
>  Issue Type: Improvement
>Reporter: Matt Juntunen
>Assignee: Gilles Sadowski
>Priority: Major
>
> The current {{PlaneAngle}} class introduces unnecessary round-off errors 
> during use since it internally converts all values to turns. For example, it 
> is currently impossible to represent the radians value {{Double.MIN_NORMAL}} 
> exactly since the internal multiplication introduces errors: 
> {{PlaneAngle.ofRadians(Double.MIN_NORMAL).toRadians()}} does not equal 
> {{Double.MIN_NORMAL}}. We should restructure this API so that values are 
> stored exactly and multiplication is only performed when required.
> This issue was discovered during work on GEOMETRY-124. Use of the new 
> {{Reduce}} class added two more floating point operations to angle 
> normalization and caused a regression in commons-geometry-spherical.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RNG-141) Cross-reference links not found (web site)

2021-06-04 Thread Gilles Sadowski (Jira)
Gilles Sadowski created RNG-141:
---

 Summary: Cross-reference links not found (web site)
 Key: RNG-141
 URL: https://issues.apache.org/jira/browse/RNG-141
 Project: Commons RNG
  Issue Type: Bug
Reporter: Gilles Sadowski


At the top of pages generated by the cross-referencing tool (e.g. [this 
one|http://commons.apache.org/proper/commons-rng/xref/org/apache/commons/rng/examples/sampling/ExamplesSamplingApplication.html]),
 there is a link named [View 
Javadoc|http://commons.apache.org/proper/commons-rng/apidocs/org/apache/commons/rng/examples/sampling/ExamplesSamplingApplication.html]
 which when clicked on leads to "Not Found".

The issue seems to occur in a multi-module project (also in [Geometry] and 
[Numbers]) because when starting from [this 
page|http://commons.apache.org/proper/commons-rng/apidocs/org/apache/commons/rng/examples/sampling/ExamplesSamplingApplication.html],
 the link works.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (JEXL-350) map[null] throws "unsolvable property" when a Sandbox is used

2021-06-04 Thread Henri Biestro (Jira)


[ 
https://issues.apache.org/jira/browse/JEXL-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357276#comment-17357276
 ] 

Henri Biestro edited comment on JEXL-350 at 6/4/21, 11:52 AM:
--

Thank you David for this precise ticket (as usual), appreciated :-)

Fix will enable being explicit about the 'null' property read/write permissions.


was (Author: henrib):
Thank you David for this precise ticket -as usual-, appreciated :-)

Fix will enable being explicit about the 'null' property read/write permissions.

> map[null] throws "unsolvable property" when a Sandbox is used
> -
>
> Key: JEXL-350
> URL: https://issues.apache.org/jira/browse/JEXL-350
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.1
> Environment: jdk-11.0.5_10-hotspot
> JEXL git pull on 2021-06-03
>  
>Reporter: David Costanzo
>Assignee: Henri Biestro
>Priority: Major
>
> In JEXL 3.2 SNAPSHOT, you can can access a null property in a map if you have 
> no sandbox, but you cannot access a null property in a map if you have an 
> "allow box" sandbox.  This asymmetry is weird and might be an oversight.
> The fix for JEXL-327 allows setting a null property in a map using the array 
> syntax, but only for the case where there is no sandbox.  The fix for 
> JEXL-291 allows array-style access to values in a map when using a sandbox.  
> What remains is the intersection of these two use cases: accessing a null 
> property in a map using the array-access syntax when there's a sandbox.
>  
> *Impact:*
> In my domain (working with data from clinical trials), a null numeric value 
> means "missing", which is a valid value.  Our JEXL programmers implement 
> "switch" statements using a map, so you might see an expression that 
> translates a coded variable named "DMSEX" into an English description like:
> {code:java}
> {
>null : "Unknown",
>1: "MALE",
>2: "FEMALE"
> }[DMSEX]{code}
> Not being able to read the "Unknown" value when DMSEX=null is a problem that 
> we've had to work around by copying the internal class SandboxUberspect and 
> hacking it to allow this.
>  
> *Technical Details:*
> I think the problem starts in SandboxUbserspect.getPropertyGet() because 
> identifier is null.  In this case, the most of the logic is skipped and null 
> is returned, indicating that the property is undefined.
> {code:java}
> @Override
> public JexlPropertyGet getPropertyGet(final List resolvers,
>   final Object obj,
>   final Object identifier) {
> if (obj != null && identifier != null) {
> final String property = identifier.toString();
> final String actual = sandbox.read(obj.getClass(), property);
> if (actual != null) {
>  // no transformation, strict equality: use identifier before 
> string conversion
> final Object pty = actual == property? identifier : actual;
> return uberspect.getPropertyGet(resolvers, obj, pty);
> }
> }
> return null;
> }
> {code}
> In my superficial understanding, the Sandbox.read() method doesn't have a way 
> to distinguish between "null is the property you want to read" and "access is 
> blocked" so in my hack, I had to always allow read access of null.
>  
> *Steps to Reproduce:*
> Below are some unit tests which show the four possibilities of with/without 
> sandbox and get/set null.  I've included the behavior in JEXL 3.1 and a 
> recent build of github as comments.
> {code:java}
> @Test
> public void testGetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, works
> // JEXL 3.2, works
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> 
> @Test
> public void testGetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> JexlSandbox(true)).create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, throws JexlException$Property "undefined property 
> '.'"
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> @Test
> public void testSetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null] = 
> 'bar'");
> 
> // JEXL 3.1, throws JexlException$Property "unsolvable property 

[jira] [Commented] (JEXL-350) map[null] throws "unsolvable property" when a Sandbox is used

2021-06-04 Thread Henri Biestro (Jira)


[ 
https://issues.apache.org/jira/browse/JEXL-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357276#comment-17357276
 ] 

Henri Biestro commented on JEXL-350:


Thank you David for this precise ticket -as usual-, appreciated :-)

Fix will enable being explicit about the 'null' property read/write permissions.

> map[null] throws "unsolvable property" when a Sandbox is used
> -
>
> Key: JEXL-350
> URL: https://issues.apache.org/jira/browse/JEXL-350
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.1
> Environment: jdk-11.0.5_10-hotspot
> JEXL git pull on 2021-06-03
>  
>Reporter: David Costanzo
>Assignee: Henri Biestro
>Priority: Major
>
> In JEXL 3.2 SNAPSHOT, you can can access a null property in a map if you have 
> no sandbox, but you cannot access a null property in a map if you have an 
> "allow box" sandbox.  This asymmetry is weird and might be an oversight.
> The fix for JEXL-327 allows setting a null property in a map using the array 
> syntax, but only for the case where there is no sandbox.  The fix for 
> JEXL-291 allows array-style access to values in a map when using a sandbox.  
> What remains is the intersection of these two use cases: accessing a null 
> property in a map using the array-access syntax when there's a sandbox.
>  
> *Impact:*
> In my domain (working with data from clinical trials), a null numeric value 
> means "missing", which is a valid value.  Our JEXL programmers implement 
> "switch" statements using a map, so you might see an expression that 
> translates a coded variable named "DMSEX" into an English description like:
> {code:java}
> {
>null : "Unknown",
>1: "MALE",
>2: "FEMALE"
> }[DMSEX]{code}
> Not being able to read the "Unknown" value when DMSEX=null is a problem that 
> we've had to work around by copying the internal class SandboxUberspect and 
> hacking it to allow this.
>  
> *Technical Details:*
> I think the problem starts in SandboxUbserspect.getPropertyGet() because 
> identifier is null.  In this case, the most of the logic is skipped and null 
> is returned, indicating that the property is undefined.
> {code:java}
> @Override
> public JexlPropertyGet getPropertyGet(final List resolvers,
>   final Object obj,
>   final Object identifier) {
> if (obj != null && identifier != null) {
> final String property = identifier.toString();
> final String actual = sandbox.read(obj.getClass(), property);
> if (actual != null) {
>  // no transformation, strict equality: use identifier before 
> string conversion
> final Object pty = actual == property? identifier : actual;
> return uberspect.getPropertyGet(resolvers, obj, pty);
> }
> }
> return null;
> }
> {code}
> In my superficial understanding, the Sandbox.read() method doesn't have a way 
> to distinguish between "null is the property you want to read" and "access is 
> blocked" so in my hack, I had to always allow read access of null.
>  
> *Steps to Reproduce:*
> Below are some unit tests which show the four possibilities of with/without 
> sandbox and get/set null.  I've included the behavior in JEXL 3.1 and a 
> recent build of github as comments.
> {code:java}
> @Test
> public void testGetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, works
> // JEXL 3.2, works
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> 
> @Test
> public void testGetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> JexlSandbox(true)).create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, throws JexlException$Property "undefined property 
> '.'"
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> @Test
> public void testSetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null] = 
> 'bar'");
> 
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, works
> expression.evaluate(jc);
> }
> @Test
> public void testSetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> JexlSandbox(true)).create();
>  

[jira] [Updated] (MATH-1213) LaguerreSolver complex solve methods do not allow maxEval limit

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1213:
--
Fix Version/s: (was: 4.0)
   4.X

> LaguerreSolver complex solve methods do not allow maxEval limit
> ---
>
> Key: MATH-1213
> URL: https://issues.apache.org/jira/browse/MATH-1213
> Project: Commons Math
>  Issue Type: Bug
>Affects Versions: 3.4.1
>Reporter: Phil Steitz
>Priority: Major
> Fix For: 4.X
>
>
> The methods solveAllComplex and solveComplex in the LaguerreSolver should 
> allow the user to specify a maximum number of function evaluations, similarly 
> to the real solvers.  Currently, the calls to setup have Integer.MAX_VALUE 
> hard-coded.  Additional versions of these methods that take a maxEval 
> parameter should be added.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1275) EventHandler and StepHandler interfaces do not provide derivatives

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1275:
--
Fix Version/s: (was: 4.X)
   4.0

> EventHandler and StepHandler interfaces do not provide derivatives
> --
>
> Key: MATH-1275
> URL: https://issues.apache.org/jira/browse/MATH-1275
> Project: Commons Math
>  Issue Type: Bug
>Affects Versions: 3.5
>Reporter: Luc Maisonobe
>Priority: Major
> Fix For: 4.0
>
>
> The EventHandler and StepHandler interfaces allow passing the current state 
> vector to user code, but not its derivatives. This is a pity because the 
> integrator does know these derivatives as they are the basis from which 
> everything else is computed. The data is lying around, just not passed to 
> user.
> This is a design issue and as it affects user interfaces, it cannot be fixed 
> before 4.0. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1275) EventHandler and StepHandler interfaces do not provide derivatives

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1275:
--
Fix Version/s: (was: 4.0)
   4.X

> EventHandler and StepHandler interfaces do not provide derivatives
> --
>
> Key: MATH-1275
> URL: https://issues.apache.org/jira/browse/MATH-1275
> Project: Commons Math
>  Issue Type: Bug
>Affects Versions: 3.5
>Reporter: Luc Maisonobe
>Priority: Major
> Fix For: 4.X
>
>
> The EventHandler and StepHandler interfaces allow passing the current state 
> vector to user code, but not its derivatives. This is a pity because the 
> integrator does know these derivatives as they are the basis from which 
> everything else is computed. The data is lying around, just not passed to 
> user.
> This is a design issue and as it affects user interfaces, it cannot be fixed 
> before 4.0. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (MATH-1551) Compute Percentile with Weighted Samples

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved MATH-1551.
---
Resolution: Implemented

> Compute Percentile with Weighted Samples
> 
>
> Key: MATH-1551
> URL: https://issues.apache.org/jira/browse/MATH-1551
> Project: Commons Math
>  Issue Type: New Feature
>Affects Versions: 4.0
>Reporter: institute for information industry
>Priority: Major
>  Labels: features, newbie
> Fix For: 4.0
>
> Attachments: Percentile.java
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> The class Percentile only support estimation on non-weighted samples.
> I've implement some function to estimate percentiles of weighted samples.
> here is the reference: 
> [https://stats.stackexchange.com/questions/13169/defining-quantiles-over-a-weighted-sample]!https://mail.google.com/mail/u/0?ui=2=6059a2f2a6=0.1=msg-a:r-8896240918589631988=1737bdaafc3e228f=fimg=s0-l75-ft=ANGjdJ_GwCQ-hqi0o7ZJTEqcl6JLYbFiR2Y1sqxPL8jDNzheraAkX0beEUtAM4BYI2v_5XGvzCPj2gTBQutHT9bF8hYh7MgdiGYZhn0HtDuVswuCSuwy8aJVsvy3EqI=emb=ii_kcyrjgea0!
>  
> When all weights are equal to each other, it works like estimation on 
> non-weighted samples under R-7.
> I can't find formulas for other rules but at least, now it can evaluate 
> percentile for weighted samples.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1567) Harmonic Mean Calculation

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1567:
--
Fix Version/s: (was: 4.0)
   4.X

> Harmonic Mean Calculation
> -
>
> Key: MATH-1567
> URL: https://issues.apache.org/jira/browse/MATH-1567
> Project: Commons Math
>  Issue Type: New Feature
>Affects Versions: 3.6.1
>Reporter: Hasan Diwan
>Priority: Trivial
>  Labels: easyfix, newbie, patch
> Fix For: 4.X
>
> Attachments: harmonicMean.pat
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Patch adds harmonic mean support to StatsUtils.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1113) "FastMath.atan" is slow

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1113:
--
Fix Version/s: (was: 4.0)
   4.X

> "FastMath.atan" is slow
> ---
>
> Key: MATH-1113
> URL: https://issues.apache.org/jira/browse/MATH-1113
> Project: Commons Math
>  Issue Type: Improvement
>Affects Versions: 3.2
>Reporter: Gilles Sadowski
>Priority: Minor
>  Labels: perfomance
> Fix For: 4.X
>
>
> This issue is related to
>   MATH-740
>   MATH-901
> Micro-benchmarks show that "FastMath.atan2" is faster than "Math.atan2" but 
> that "FastMath.atan" is slower than "Math.atan". However, both 
> "FastMath.atan2" and "Math.atan" call the internal method 
> "FastMath.atan(double,double,boolean)".
> It seems that some performance improvement could be achieved, through 
> understanding why the results seem contradictory.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-740) Some "FastMath" functions are slow

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-740:
-
Fix Version/s: (was: 4.0)
   4.X

> Some "FastMath" functions are slow
> --
>
> Key: MATH-740
> URL: https://issues.apache.org/jira/browse/MATH-740
> Project: Commons Math
>  Issue Type: Wish
>Reporter: Gilles Sadowski
>Priority: Minor
> Fix For: 4.X
>
> Attachments: jafamatests.zip
>
>
> From the two benchmarks we currently have in "FastMathTestPerfomance", we 
> have that the following functions are much slower in "FastMath" than in 
> either "Math" or "StrictMath" (the performance *loss*, for each of the 
> benchmarks, is given in parentheses):
> * log10 (46%, 36%)
> * log1p (68%, 112%)
> * tan (11%, 61%)
> * atan (26%, 125%)
> * atan2 (44%, 40%)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1171) clustering implementations have unnecessary overhead

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1171:
--
Fix Version/s: (was: 4.0)
   4.X

> clustering implementations have unnecessary overhead
> 
>
> Key: MATH-1171
> URL: https://issues.apache.org/jira/browse/MATH-1171
> Project: Commons Math
>  Issue Type: Bug
>Reporter: Mark
>Priority: Major
> Fix For: 4.X
>
> Attachments: image_clustering_example.png
>
>
> I want to apply clustering algorithms like KMeansPlusPlusClusterer to 
> pictures. And creating a point instance for each pixel is not a good idea.
> Therefore the interface should not be based on Collections, but on some 
> interface that provides sort of "get(index)" accessors to data that is 
> potentially stored in a pixel array etc.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1016) Making the first and second moments reducable. So should Storeless stats in general.

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1016:
--
Fix Version/s: (was: 4.0)
   4.X

> Making the first and second moments reducable. So should Storeless stats in 
> general.
> 
>
> Key: MATH-1016
> URL: https://issues.apache.org/jira/browse/MATH-1016
> Project: Commons Math
>  Issue Type: New Feature
>Reporter: Ajo Fod
>Priority: Major
> Fix For: 4.X
>
> Attachments: patch.txt, patch2.txt
>
>
> The storeless stats in general should be "Reducable" to be used in the 
> Map/Reduce framework.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1219) Improve performance of TournamentSelection for large populations

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1219:
--
Fix Version/s: (was: 4.0)
   4.X

> Improve performance of TournamentSelection for large populations
> 
>
> Key: MATH-1219
> URL: https://issues.apache.org/jira/browse/MATH-1219
> Project: Commons Math
>  Issue Type: Improvement
>Reporter: Thomas Neidhart
>Priority: Major
> Fix For: 4.X
>
> Attachments: MATH-1219.patch
>
>
> The TournamentSelection can become quite slow when using large populations. 
> The implemented algorithm clones the original population and picks randomly 
> some chromosomes from it. Everytime a chromosome has been picked, it is also 
> removed from this population.
> When assuming that the chosen arity << population size, it is usually faster 
> to repeat the picking.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1262) Heap overflow in org.apache.commons.math4.special.BesselJ

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1262:
--
Fix Version/s: (was: 4.0)
   4.X

> Heap overflow in org.apache.commons.math4.special.BesselJ
> -
>
> Key: MATH-1262
> URL: https://issues.apache.org/jira/browse/MATH-1262
> Project: Commons Math
>  Issue Type: Bug
>Affects Versions: 4.0
>Reporter: Neil Walkinshaw
>Priority: Minor
>  Labels: newbie, performance
> Fix For: 4.X
>
>
> This test case:
> {code:java}
> import org.apache.commons.math4.special.BesselJ;
> public class BesselJHeapBug {
> public static void main(String[] args) {
> BesselJ.value(1182054491, 3.589635306407856E-8D);
> }
> }
> {code}
> throws the following exception:
> {code}
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>   at org.apache.commons.math4.special.BesselJ.rjBesl(BesselJ.java:247)
>   at org.apache.commons.math4.special.BesselJ.value(BesselJ.java:161)
>   at BesselJHeapBug.main(BesselJHeapBug.java:5)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1228) First Moment is not public

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1228:
--
Fix Version/s: (was: 4.0)
   4.X

> First Moment is not public
> --
>
> Key: MATH-1228
> URL: https://issues.apache.org/jira/browse/MATH-1228
> Project: Commons Math
>  Issue Type: Bug
>Affects Versions: 3.5
>Reporter: Fabian Lange
>Priority: Major
> Fix For: 4.X
>
>
> Hi there,
> is there a specific reason FirstMoment is not public?
> I want to calculate a mean over a List, for that I want to loop over 
> that list and invoke Mean.increment(listValue), however this is slower than 
> it could be. Every increment call makes a check to incMoment.
> I could avoid that if I use a FirstMoment directly, but I cannot create an 
> instance, because it is protected.
> Also this effectively means that the public constructor Mean(FirstMoment) is 
> not usable.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1353) "EmpiricalDistribution" has various shortcomings

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1353:
--
Fix Version/s: (was: 4.0)
   4.X

> "EmpiricalDistribution" has various shortcomings
> 
>
> Key: MATH-1353
> URL: https://issues.apache.org/jira/browse/MATH-1353
> Project: Commons Math
>  Issue Type: Improvement
>Reporter: Gilles Sadowski
>Priority: Minor
>  Labels: refactoring
> Fix For: 4.X
>
>
> * Class uses file IO (CM should not be concerned with data persistence)
> * Class uses the "java.net" API (ditto)
> I'd think that the core functionality could be provided without supporting 
> data loading (from a file or a URL).
> Data input would be via any of
> * Collection
> * Iterable
> * Stream (Java 8)
> A redesign goal should be to make the class immutable.
> E.g. data source must be set in the constructor (rather than via a "load" 
> method); there would thus be a one-to-one correspondence between data source 
> and distribution instance.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (MATH-1467) Avoid throwing exceptions when using default locale

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved MATH-1467.
---
Resolution: Fixed

> Avoid throwing exceptions when using default locale
> ---
>
> Key: MATH-1467
> URL: https://issues.apache.org/jira/browse/MATH-1467
> Project: Commons Math
>  Issue Type: Improvement
>Affects Versions: 3.6.1
>Reporter: Gregory Jevardat
>Priority: Major
> Fix For: 4.0
>
> Attachments: LocalizedFormats.java, LocalizedFormatsTest.java
>
>
> In the LocalizedFormats class the method getLocalizedString systematically 
> throws an exception when the US or EN locale is used.
> It occurs because it tries to load the bundle  in any case and obviously the 
> properties file for EN does not exist. 
> Maybe a little check if an EN locale is used and then returning the 
> sourceFormat would avoid trying to load the bundle and throw exceptions.
> In my case we have intensive (billions) statistical computations and Java 
> Mission Control reports 10-100k's of MissingResourcesExceptions caused by 
> that.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1494) Find exponential curve fit to data using Jacquelin method

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1494:
--
Fix Version/s: (was: 4.0)
   4.X

> Find exponential curve fit to data using Jacquelin method
> -
>
> Key: MATH-1494
> URL: https://issues.apache.org/jira/browse/MATH-1494
> Project: Commons Math
>  Issue Type: New Feature
>Reporter: Tom Prodehl
>Priority: Major
>  Labels: curvefitter, exponential, fitting
> Fix For: 4.X
>
>   Original Estimate: 336h
>  Time Spent: 10m
>  Remaining Estimate: 335h 50m
>
> Function to fit an exponential decay (negarive beta) or positive beta without 
> initial guessing
>  Based on [https://stackoverflow.com/a/39436209/545346]
>  Original source: Regressions et Equations integrales, Jean Jacquelin
>  [https://www.scribd.com/doc/14674814/Regressions-et-equations-integrales]
> The class will allow for the usual variety of providing inputs of x and y.
> Once computed the instance can be queried for Amplitude, Beta, and Constant, 
> defining a curve for y= Amplitude * exp(Beta * x) + Constant



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1515) Enhance clustering API

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1515:
--
Fix Version/s: (was: 4.0)
   4.X

> Enhance clustering API
> --
>
> Key: MATH-1515
> URL: https://issues.apache.org/jira/browse/MATH-1515
> Project: Commons Math
>  Issue Type: Improvement
>Affects Versions: 3.6.1
>Reporter: Gilles Sadowski
>Priority: Minor
> Fix For: 4.X
>
>
> It had been noted (cf. other JIRA reports) quite some ago that the API 
> defined in package {{o.a.c.math4.ml.clustering}} could be improved.
> Interest in this code has been recently renewed (cf. [this thread on the 
> "dev" ML|https://markmail.org/message/vpablvbjou4nhrac]).
> This report will collect specific refactoring tasks.
> Linked reports should serve as a guide towards a flexible API and efficient 
> implementations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1526) Review "MultiKMeansPlusPlusClusterer"

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1526:
--
Fix Version/s: (was: 4.0)
   4.X

> Review "MultiKMeansPlusPlusClusterer"
> -
>
> Key: MATH-1526
> URL: https://issues.apache.org/jira/browse/MATH-1526
> Project: Commons Math
>  Issue Type: Sub-task
>Reporter: Gilles Sadowski
>Priority: Major
> Fix For: 4.X
>
>
> Unit tests in {{MultiKMeansPlusPlusClustererTest}} pass whatever the order of 
> the alternatives in method {{ClusterEvaluator.ranking(ClusterEvaluator 
> eval)}}!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1517) "Cluster" leaks internal data

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1517:
--
Fix Version/s: (was: 4.0)
   4.X

> "Cluster" leaks internal data
> -
>
> Key: MATH-1517
> URL: https://issues.apache.org/jira/browse/MATH-1517
> Project: Commons Math
>  Issue Type: Bug
>Reporter: Gilles Sadowski
>Priority: Major
> Fix For: 4.X
>
> Attachments: MATH-1517_cluster_points_leak
>
>
> Method {{getPoints()}} returns a reference to a mutable instance field.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (NUMBERS-161) PlaneAngle Numerical Accuracy

2021-06-04 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/NUMBERS-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357261#comment-17357261
 ] 

Matt Juntunen commented on NUMBERS-161:
---

commons-geometry builds with this so it's good from my perspective.

> PlaneAngle Numerical Accuracy
> -
>
> Key: NUMBERS-161
> URL: https://issues.apache.org/jira/browse/NUMBERS-161
> Project: Commons Numbers
>  Issue Type: Improvement
>Reporter: Matt Juntunen
>Assignee: Gilles Sadowski
>Priority: Major
>
> The current {{PlaneAngle}} class introduces unnecessary round-off errors 
> during use since it internally converts all values to turns. For example, it 
> is currently impossible to represent the radians value {{Double.MIN_NORMAL}} 
> exactly since the internal multiplication introduces errors: 
> {{PlaneAngle.ofRadians(Double.MIN_NORMAL).toRadians()}} does not equal 
> {{Double.MIN_NORMAL}}. We should restructure this API so that values are 
> stored exactly and multiplication is only performed when required.
> This issue was discovered during work on GEOMETRY-124. Use of the new 
> {{Reduce}} class added two more floating point operations to angle 
> normalization and caused a regression in commons-geometry-spherical.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1527) Coverage of package "o.a.c.math4.ml" is too low

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1527:
--
Fix Version/s: (was: 4.0)
   4.X

> Coverage of package "o.a.c.math4.ml" is too low
> ---
>
> Key: MATH-1527
> URL: https://issues.apache.org/jira/browse/MATH-1527
> Project: Commons Math
>  Issue Type: Bug
>Reporter: Gilles Sadowski
>Priority: Major
>  Labels: coverage, unit-test
> Fix For: 4.X
>
>
> See https://coveralls.io/github/apache/commons-math



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (MATH-1550) SimplexTableau (linear programming)

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski updated MATH-1550:
--
Fix Version/s: (was: 4.0)

> SimplexTableau (linear programming)
> ---
>
> Key: MATH-1550
> URL: https://issues.apache.org/jira/browse/MATH-1550
> Project: Commons Math
>  Issue Type: Improvement
>Affects Versions: 3.6.1
>Reporter: Gilles Sadowski
>Priority: Minor
>  Labels: design
> Fix For: 4.X
>
>
> Class {{SimplexTableau}} is package private and does not seem designed for 
> inheritance, but it contains "protected" methods.
> There are several instance fields that should preferably be made "final" (for 
> thread safety). It seems that to do this, some design changes are necessary 
> (a.o. the relationship with {{SimplexSolver}} should be clarified).
>  
> {{SimplexSolver}} also contains a protected method ({{solvePhase1}}) that is 
> not documented for inheritance.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (MATH-1562) Module name missing

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved MATH-1562.
---
Fix Version/s: (was: 3.7)
   Resolution: Fixed

> Module name missing
> ---
>
> Key: MATH-1562
> URL: https://issues.apache.org/jira/browse/MATH-1562
> Project: Commons Math
>  Issue Type: Bug
>Affects Versions: 3.6.1
>Reporter: Frank Ulbricht
>Priority: Major
> Fix For: 4.0
>
>
> This library is not a Java module yet (because of its Java version 
> requirements). Nevertheless, the library should provide a stable automatic 
> module name via its MANIFEST.MF. Otherwise the module name will be created 
> from the file name which is not stable, depending on the dependency 
> management system.
> [Automatic-Module-Name: Calling All Java Library 
> Maintainers|https://dzone.com/articles/automatic-module-name-calling-all-java-library-maintainers]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (MATH-1578) Create "neuralnet" module

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved MATH-1578.
---
Resolution: Implemented

> Create "neuralnet" module
> -
>
> Key: MATH-1578
> URL: https://issues.apache.org/jira/browse/MATH-1578
> Project: Commons Math
>  Issue Type: Sub-task
>Reporter: Gilles Sadowski
>Assignee: Gilles Sadowski
>Priority: Major
>  Labels: modularization, refactoring
> Fix For: 4.0
>
>
> Move codes currently in {{o.a.c.math4.legacy.ml.neuralnet}} into a dedicated 
> maven module.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (MATH-1582) Create "transform" module

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved MATH-1582.
---
Resolution: Implemented

> Create "transform" module
> -
>
> Key: MATH-1582
> URL: https://issues.apache.org/jira/browse/MATH-1582
> Project: Commons Math
>  Issue Type: Sub-task
>Reporter: Gilles Sadowski
>Assignee: Gilles Sadowski
>Priority: Major
>  Labels: modularization, refactoring
> Fix For: 4.0
>
>
> Move codes currently in {{o.a.c.math4.legacy.transform}} into a dedicated 
> maven module.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MATH-1536) Sensitivity to RNG (unit tests)

2021-06-04 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/MATH-1536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357254#comment-17357254
 ] 

Gilles Sadowski commented on MATH-1536:
---

bq. document the requirements

Or we provide an API that ensures (through hard-coding) that the requirements 
are met:
* [normalized uniform 
distribution|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/CorrelatedVectorFactory.java;h=2fc3a600c65fc70d16563080ba4271217a4d7ad0;hb=HEAD#l124]
* [normalized gaussian 
distribution|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/CorrelatedVectorFactory.java;h=2fc3a600c65fc70d16563080ba4271217a4d7ad0;hb=HEAD#l133]


> Sensitivity to RNG (unit tests)
> ---
>
> Key: MATH-1536
> URL: https://issues.apache.org/jira/browse/MATH-1536
> Project: Commons Math
>  Issue Type: Task
>Reporter: Gilles Sadowski
>Priority: Major
>  Labels: rng, unit-test
> Fix For: 4.0
>
>
> Several unit tests fail when upgrading to version 1.3 of "Commons RNG":
> {noformat}
> [ERROR] Failures: 
> [ERROR]   LogitTest.testDerivativesWithInverseFunction:195 maxOrder = 2 
> expected:<0.0> but was:<1.0658141036401503E-14>
> [ERROR]   EnumeratedIntegerDistributionTest.testMath1533:196
> [ERROR]   EnumeratedIntegerDistributionTest.testSample:174 expected:<7.84> 
> but was:<7.857073891264003>
> [ERROR]   MiniBatchKMeansClustererTest.testCompareToKMeans:86 Different score 
> ratio 46.645378%!, diff points ratio: 34.716981%
> [ERROR]   CalinskiHarabaszTest.test_compare_to_skLearn:102 
> expected:<597.7763150683217> but was:<559.2829020672648>
> [ERROR]   MultiStartMultivariateOptimizerTest.testCircleFitting:76 
> expected:<69.9597> but was:<69.96228624385736>
> [ERROR]   MultiStartMultivariateOptimizerTest.testRosenbrock:114 numEval=873
> [ERROR]   GaussianRandomGeneratorTest.testMeanAndStandardDeviation:37 
> expected:<1.0> but was:<0.9715310171501561>
> [ERROR]   NaturalRankingTest.testNaNsFixedTiesRandom:227 Array comparison 
> failure
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (MATH-1607) "FastMath" benchmark

2021-06-04 Thread Gilles Sadowski (Jira)
Gilles Sadowski created MATH-1607:
-

 Summary: "FastMath" benchmark
 Key: MATH-1607
 URL: https://issues.apache.org/jira/browse/MATH-1607
 Project: Commons Math
  Issue Type: Sub-task
Reporter: Gilles Sadowski
 Fix For: 4.0


[FastMathTestPerformance|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=src/userguide/java/org/apache/commons/math4/userguide/FastMathTestPerformance.java;h=d140393d224b4ff6592224f48b59e8950963b49b;hb=HEAD]
 must be updated
* to use the new 
[class|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=commons-math-legacy-core/src/main/java/org/apache/commons/math4/legacy/core/jdkmath/AccurateMath.java;h=a6307fb3643ccd5e54b78aa466491ebaa77180a3;hb=HEAD]
 and package names, and
* to use JMH.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (MATH-1606) Distribution example applications

2021-06-04 Thread Gilles Sadowski (Jira)
Gilles Sadowski created MATH-1606:
-

 Summary: Distribution example applications
 Key: MATH-1606
 URL: https://issues.apache.org/jira/browse/MATH-1606
 Project: Commons Math
  Issue Type: Sub-task
Reporter: Gilles Sadowski
 Fix For: 4.0


[IntegerDistributionComparison|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=src/userguide/java/org/apache/commons/math4/userguide/IntegerDistributionComparison.java;h=74a5cb6fafd80b27d5a40bf8b440c74a0d575cde;hb=HEAD]
 and 
[RealDistributionComparison|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=src/userguide/java/org/apache/commons/math4/userguide/RealDistributionComparison.java;h=098c943441eceb4ace9f8c2ac394ca42002e2012;hb=HEAD]
 illustrate codes that were moved to [Statistics].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (MATH-1605) Geometry example application

2021-06-04 Thread Gilles Sadowski (Jira)
Gilles Sadowski created MATH-1605:
-

 Summary: Geometry example application
 Key: MATH-1605
 URL: https://issues.apache.org/jira/browse/MATH-1605
 Project: Commons Math
  Issue Type: Sub-task
Reporter: Gilles Sadowski
 Fix For: 4.0


The 
[example|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=src/userguide/java/org/apache/commons/math4/userguide/geometry/GeometryExample.java;h=8bdb1ab244c0346721a539a8a3b83f2860aa958e;hb=HEAD]
 illustrates functionality that was moved to [Geometry].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (MATH-1604) Userguide

2021-06-04 Thread Gilles Sadowski (Jira)
Gilles Sadowski created MATH-1604:
-

 Summary: Userguide
 Key: MATH-1604
 URL: https://issues.apache.org/jira/browse/MATH-1604
 Project: Commons Math
  Issue Type: Sub-task
Reporter: Gilles Sadowski
 Fix For: 4.0


Review 
[contents|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=tree;f=src/site/xdoc/userguide;h=ac16fa8ddccf2d131958dbee64795e14bcc44b74;hb=HEAD]
 and
* (x) update links, classes and packages according to the new package layout 
(cf. MATH-1575)
* (x) replace sections about utilities moved elsewhere with a link to the web 
site of the respective components:
** (x) "Commons RNG" https://commons.apache.org/rng
** (x) "Commons Numbers" https://commons.apache.org/numbers
** (x) "Commons Geometry" https://commons.apache.org/geometry
** (x) "Commons Statistics" https://commons.apache.org/statistics
* (x) check whether some of the documentation should be moved to another 
component (in which case an issue should be filed on the corresponding JIRA 
project):
** (x) "Commons RNG" https://issues.apache.org/jira/browse/RNG
** (x) "Commons Numbers" https://issues.apache.org/jira/browse/NUMBERS
** (x) "Commons Geometry" https://issues.apache.org/jira/browse/GEOMETRY
** (x) "Commons Statistics" https://issues.apache.org/jira/browse/STATISTICS




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (MATH-1602) Purpose of "RngAdaptor"

2021-06-04 Thread Gilles Sadowski (Jira)


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

Gilles Sadowski resolved MATH-1602.
---
Fix Version/s: 4.0
   Resolution: Done

Removed in commit e24e0a8555c31fa00ee401c9ca67564a91219c59 ("master" branch).

> Purpose of "RngAdaptor"
> ---
>
> Key: MATH-1602
> URL: https://issues.apache.org/jira/browse/MATH-1602
> Project: Commons Math
>  Issue Type: Sub-task
>Reporter: Gilles Sadowski
>Priority: Minor
> Fix For: 4.0
>
>
> [{{RngAdaptor}}|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/RngAdaptor.java;h=c16587dc08162ef184fcccbbcc7b4fe9bbdcf237;hb=HEAD]
>  was created to allow "skeptics" to test the then new RNG implementations in 
> "Commons RNG" and compare with the RNG implementations in "Commons Math" (up 
> to v3.6.1).
> Since then, the RNG codes pass stringent tests ("Diehard", "TestU01"); hence 
> that rationale is moot.
> Is there another reason to keep this class?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (MATH-1603) Clean up userguide

2021-06-04 Thread Gilles Sadowski (Jira)
Gilles Sadowski created MATH-1603:
-

 Summary: Clean up userguide
 Key: MATH-1603
 URL: https://issues.apache.org/jira/browse/MATH-1603
 Project: Commons Math
  Issue Type: Task
Reporter: Gilles Sadowski
 Fix For: 4.0


[User 
guide|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=tree;f=src/site/xdoc/userguide;h=ac16fa8ddccf2d131958dbee64795e14bcc44b74;hb=HEAD]
 and [example 
applications|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=tree;f=src/userguide;h=93f18100369eac159a827db8a9ab65a6425fccc4;hb=HEAD]
 should be adapted to the current state of the code base.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-jexl] henrib merged pull request #54: Use the "modern" parser template

2021-06-04 Thread GitBox


henrib merged pull request #54:
URL: https://github.com/apache/commons-jexl/pull/54


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-jexl] henrib merged pull request #55: Fix small typos in comments throughout

2021-06-04 Thread GitBox


henrib merged pull request #55:
URL: https://github.com/apache/commons-jexl/pull/55


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-jexl] henrib merged pull request #56: Call Lock.lock before the try

2021-06-04 Thread GitBox


henrib merged pull request #56:
URL: https://github.com/apache/commons-jexl/pull/56


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-dbutils] dependabot[bot] commented on pull request #70: Bump mockito-core from 3.7.0 to 3.10.0

2021-06-04 Thread GitBox


dependabot[bot] commented on pull request #70:
URL: https://github.com/apache/commons-dbutils/pull/70#issuecomment-854373340


   Superseded by #73.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-io] coveralls commented on pull request #242: Bump mockito-inline from 3.10.0 to 3.11.0

2021-06-04 Thread GitBox


coveralls commented on pull request #242:
URL: https://github.com/apache/commons-io/pull/242#issuecomment-854380676


   
   [![Coverage 
Status](https://coveralls.io/builds/40300118/badge)](https://coveralls.io/builds/40300118)
   
   Coverage increased (+0.06%) to 89.438% when pulling 
**9b4391c698c9f05c9170b5e8eec5908ac1156a10 on 
dependabot/maven/org.mockito-mockito-inline-3.11.0** into 
**e4ff4a589b7c00bd9031de54270f050cdb2f2c8e on master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-dbutils] dependabot[bot] closed pull request #70: Bump mockito-core from 3.7.0 to 3.10.0

2021-06-04 Thread GitBox


dependabot[bot] closed pull request #70:
URL: https://github.com/apache/commons-dbutils/pull/70


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-compress] dependabot[bot] closed pull request #191: Bump mockito-core from 3.8.0 to 3.10.0

2021-06-04 Thread GitBox


dependabot[bot] closed pull request #191:
URL: https://github.com/apache/commons-compress/pull/191


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-compress] coveralls commented on pull request #201: Bump mockito-core from 3.8.0 to 3.11.0

2021-06-04 Thread GitBox


coveralls commented on pull request #201:
URL: https://github.com/apache/commons-compress/pull/201#issuecomment-854374679


   
   [![Coverage 
Status](https://coveralls.io/builds/40299894/badge)](https://coveralls.io/builds/40299894)
   
   Coverage remained the same at 86.787% when pulling 
**359b3e13665f24c465374613bcd902c47c0345df on 
dependabot/maven/org.mockito-mockito-core-3.11.0** into 
**f1218e2ce44ba7939ed07ed81e218bc97a8ee93c on master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-csv] coveralls commented on pull request #154: Bump mockito-core from 3.7.7 to 3.11.0

2021-06-04 Thread GitBox


coveralls commented on pull request #154:
URL: https://github.com/apache/commons-csv/pull/154#issuecomment-854375687


   
   [![Coverage 
Status](https://coveralls.io/builds/40299929/badge)](https://coveralls.io/builds/40299929)
   
   Coverage remained the same at 98.463% when pulling 
**5764af6ebc33db56a3f2d9f1b682bbc3085beef5 on 
dependabot/maven/org.mockito-mockito-core-3.11.0** into 
**b80eb6548fba593829eef5941b74c53a1c07 on master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-csv] dependabot[bot] commented on pull request #148: Bump mockito-core from 3.7.7 to 3.10.0

2021-06-04 Thread GitBox


dependabot[bot] commented on pull request #148:
URL: https://github.com/apache/commons-csv/pull/148#issuecomment-854374184


   Superseded by #154.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-text] coveralls commented on pull request #236: Bump mockito-inline from 3.10.0 to 3.11.0

2021-06-04 Thread GitBox


coveralls commented on pull request #236:
URL: https://github.com/apache/commons-text/pull/236#issuecomment-854375081


   
   [![Coverage 
Status](https://coveralls.io/builds/40299903/badge)](https://coveralls.io/builds/40299903)
   
   Coverage remained the same at 97.961% when pulling 
**8cb02dc02cb455e8ddebb181307e4eb65d0c892b on 
dependabot/maven/org.mockito-mockito-inline-3.11.0** into 
**d0c8320596f1a8a95bd9163da00226a84bca3c04 on master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-csv] dependabot[bot] closed pull request #148: Bump mockito-core from 3.7.7 to 3.10.0

2021-06-04 Thread GitBox


dependabot[bot] closed pull request #148:
URL: https://github.com/apache/commons-csv/pull/148


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-dbutils] coveralls commented on pull request #73: Bump mockito-core from 3.7.0 to 3.11.0

2021-06-04 Thread GitBox


coveralls commented on pull request #73:
URL: https://github.com/apache/commons-dbutils/pull/73#issuecomment-854374380


   
   [![Coverage 
Status](https://coveralls.io/builds/40299886/badge)](https://coveralls.io/builds/40299886)
   
   Coverage remained the same at 65.619% when pulling 
**6737ae52d417f9aed64f3a1909b3ce90a2d3de80 on 
dependabot/maven/org.mockito-mockito-core-3.11.0** into 
**84ab5488a862b2aaca9dac669f9b65cd6d358dbb on master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-compress] dependabot[bot] commented on pull request #191: Bump mockito-core from 3.8.0 to 3.10.0

2021-06-04 Thread GitBox


dependabot[bot] commented on pull request #191:
URL: https://github.com/apache/commons-compress/pull/191#issuecomment-854372619


   Superseded by #201.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (COLLECTIONS-795) provide a PairIterator to zip two iterators of different types.

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/COLLECTIONS-795?focusedWorklogId=606864=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606864
 ]

ASF GitHub Bot logged work on COLLECTIONS-795:
--

Author: ASF GitHub Bot
Created on: 04/Jun/21 08:32
Start Date: 04/Jun/21 08:32
Worklog Time Spent: 10m 
  Work Description: anantdamle commented on pull request #238:
URL: 
https://github.com/apache/commons-collections/pull/238#issuecomment-854278433


   @garydgregory there is one big difference with ZippingIterator, 
ZippingIterator allows iterating over iteratord of same generic type, whereas 
the proposed solution allows using two different types and hence needs a Pair 
equivalent class.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 606864)
Time Spent: 5.5h  (was: 5h 20m)

> provide a PairIterator to zip two iterators of different types.
> ---
>
> Key: COLLECTIONS-795
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-795
> Project: Commons Collections
>  Issue Type: New Feature
>  Components: Iterator
>Reporter: Anant Damle
>Priority: Minor
>  Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> ZippingIterator provides a way to simulatenously iterate over multiple 
> iterators of the *same-type.*
> The proposed pair iterator allows simultaneously iterating over two iterators 
> of different type, like the example below:
> {code:java}
> Iterator leftIterator =  ...;
> Iterator rightIterator = ...;
> PairIterator pairIterator = PairIterator.of(leftIterator, rightIterator);
> while (pairIterator.hasNext()) {
>ImmutablePair item = pairIterator.next();
>...
> }{code}
>  
> Another convenience could be to use an Iterable for easy for-each constructs.
> {code:java}
> List studentIds = ...
> List studentNames = ...
> for (PairedItem items : 
> IterableUtils.pairedIterable(studentIds, studentNames) {
>   Integer studentId = item.getLeft();
>   String studentName = item.getRight();
>   ...
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-collections] anantdamle commented on pull request #238: [COLLECTIONS-795] Add a new Iterator to allowing zipping over two iterators of different types

2021-06-04 Thread GitBox


anantdamle commented on pull request #238:
URL: 
https://github.com/apache/commons-collections/pull/238#issuecomment-854278433


   @garydgregory there is one big difference with ZippingIterator, 
ZippingIterator allows iterating over iteratord of same generic type, whereas 
the proposed solution allows using two different types and hence needs a Pair 
equivalent class.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-jexl] coveralls commented on pull request #56: Call Lock.lock before the try

2021-06-04 Thread GitBox


coveralls commented on pull request #56:
URL: https://github.com/apache/commons-jexl/pull/56#issuecomment-854327337


   
   [![Coverage 
Status](https://coveralls.io/builds/40297415/badge)](https://coveralls.io/builds/40297415)
   
   Coverage remained the same at 86.764% when pulling 
**c45b35726534513d131069e00b07aa7e734629c3 on csamak:obtain-lock** into 
**3bbdc91d649a085564561a6e93ba9e052d841508 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (IO-732) Char equivalent of UnsynchronizedByteArrayOutputStream (and InputStream)

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-732?focusedWorklogId=606766=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606766
 ]

ASF GitHub Bot logged work on IO-732:
-

Author: ASF GitHub Bot
Created on: 04/Jun/21 08:22
Start Date: 04/Jun/21 08:22
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #235:
URL: https://github.com/apache/commons-io/pull/235#issuecomment-844244542


   
   [![Coverage 
Status](https://coveralls.io/builds/40291528/badge)](https://coveralls.io/builds/40291528)
   
   Coverage decreased (-0.5%) to 88.743% when pulling 
**4f2641b31c9eaa10debaf1f05b682c65f0b34b61 on pjfanning:string-writer** into 
**651496937d094d5dabd166897136f934ed573c7a on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 606766)
Time Spent: 1.5h  (was: 1h 20m)

> Char equivalent of UnsynchronizedByteArrayOutputStream (and InputStream)
> 
>
> Key: IO-732
> URL: https://issues.apache.org/jira/browse/IO-732
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: PJ Fanning
>Priority: Major
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> I was thinking of writing this and submitting it but just want to see if 
> people think it makes sense first.
> The idea is to take AbstractByteArrayOutputStream and to replace the byte[] 
> with char[] (maybe called AbstractCharArrayWriter) and to create an 
> UnsynchronizedCharArrayWriter that extends it. Could so something similar 
> with UnsynchronizedByteArrayInputStream - to get an 
> UnsynchronizedStringReader.
> The nice thing about AbstractByteArrayOutputStream is the way it avoids 
> arraycopy. The existing commons-io StringBuilderWriter still has arraycopy 
> under the hood (in the java.lang.StringBuilder).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] coveralls edited a comment on pull request #235: [IO-732] CharArrayWriter

2021-06-04 Thread GitBox


coveralls edited a comment on pull request #235:
URL: https://github.com/apache/commons-io/pull/235#issuecomment-844244542


   
   [![Coverage 
Status](https://coveralls.io/builds/40291528/badge)](https://coveralls.io/builds/40291528)
   
   Coverage decreased (-0.5%) to 88.743% when pulling 
**4f2641b31c9eaa10debaf1f05b682c65f0b34b61 on pjfanning:string-writer** into 
**651496937d094d5dabd166897136f934ed573c7a on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-jexl] henrib merged pull request #50: Update to ph-javacc-maven-plugin 4.1.4

2021-06-04 Thread GitBox


henrib merged pull request #50:
URL: https://github.com/apache/commons-jexl/pull/50


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (NUMBERS-156) SafeNorm 3D overload

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/NUMBERS-156?focusedWorklogId=606652=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606652
 ]

ASF GitHub Bot logged work on NUMBERS-156:
--

Author: ASF GitHub Bot
Created on: 04/Jun/21 08:09
Start Date: 04/Jun/21 08:09
Worklog Time Spent: 10m 
  Work Description: darkma773r commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r644726647



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see 

[GitHub] [commons-numbers] darkma773r commented on a change in pull request #92: NUMBERS-156: replacing SafeNorm with Norms and Summation

2021-06-04 Thread GitBox


darkma773r commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r644726647



##
File path: 
commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/Norms.java
##
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.arrays;
+
+/** Class providing methods to compute various norm values.
+ *
+ * This class uses a variety of techniques to increase numerical accuracy
+ * and reduce errors. Primary sources for the included algorithms are the
+ * 2005 paper https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547;>
+ * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
+ * and Shin'ichi Oishi published in SIAM J. Sci. Comput and the
+ * http://www.netlib.org/minpack;>minpack "enorm" subroutine.
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)">Norm
+ */
+public final class Norms {
+
+/** Threshold for scaling small numbers. */
+private static final double SMALL_THRESH = 0x1.0p-500;
+
+/** Threshold for scaling large numbers. */
+private static final double LARGE_THRESH = 0x1.0p+500;
+
+/** Threshold for scaling up without risking overflow. */
+private static final double SAFE_SCALE_UP_THRESH = 0x1.0p-200;
+
+/** Value used to scale down large numbers. */
+private static final double SCALE_DOWN = 0x1.0p-600;
+
+/** Value used to scale up small numbers. */
+private static final double SCALE_UP = 0x1.0p+600;
+
+/** Utility class; no instantiation. */
+private Norms() {}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y|\), i.e., the sum of the absolute 
values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If either value is NaN, then the result is NaN.
+ *  If either value is infinite and the other value is not NaN, then 
the result is positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y) {
+return Math.abs(x) + Math.abs(y);
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the arguments.
+ * The result is equal to \(|x| + |y| + |z|\), i.e., the sum of the 
absolute values of the arguments.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ * 
+ * @param x first input value
+ * @param y second input value
+ * @param z third input value
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double x, final double y, final 
double z) {
+return Summation.value(
+Math.abs(x),
+Math.abs(y),
+Math.abs(z));
+}
+
+/** Compute the Manhattan norm (also known as the Taxicab norm or L1 norm) 
of the given values.
+ * The result is equal to \(|v_0| + ... + |v_i|\), i.e., the sum of the 
absolute values of the input elements.
+ *
+ * Special cases:
+ * 
+ *  If any value is NaN, then the result is NaN.
+ *  If any value is infinite and no value is NaN, then the result is 
positive infinity.
+ *  If the array is empty, then the result is 0.
+ * 
+ * @param v input values
+ * @return Manhattan norm
+ * @see https://en.wikipedia.org/wiki/Norm_(mathematics)#Taxicab_norm_or_Manhattan_norm">Manhattan
 norm
+ */
+public static double manhattan(final double[] v) {
+double sum = 0d;
+double comp = 0d;
+
+for (int i = 0; i < v.length; ++i) {
+final double x = Math.abs(v[i]);
+final double sx = sum + x;
+comp += ExtendedPrecision.twoSumLow(sum, x, sx);
+sum = sx;
+

[GitHub] [commons-jexl] coveralls commented on pull request #54: Use the "modern" parser template

2021-06-04 Thread GitBox


coveralls commented on pull request #54:
URL: https://github.com/apache/commons-jexl/pull/54#issuecomment-854270029


   
   [![Coverage 
Status](https://coveralls.io/builds/40295423/badge)](https://coveralls.io/builds/40295423)
   
   Coverage remained the same at 86.764% when pulling 
**2dce6b9b4626fe9a5e518a585a6e4d4bd10a250b on csamak:master** into 
**3bbdc91d649a085564561a6e93ba9e052d841508 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-text] coveralls edited a comment on pull request #233: A More Efficient Implementation for Calculating Size of Longest Common Subsequence

2021-06-04 Thread GitBox


coveralls edited a comment on pull request #233:
URL: https://github.com/apache/commons-text/pull/233#issuecomment-846470672


   
   [![Coverage 
Status](https://coveralls.io/builds/40258642/badge)](https://coveralls.io/builds/40258642)
   
   Coverage decreased (-0.2%) to 97.772% when pulling 
**f84aede939309cd99bcbf02dd6379ab7f692f8e4 on 
ali-ghanbari:lcs-with-linear-space-complexity** into 
**9b6bcb4ec6bbde2948850d5740e8df9164185b74 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (COLLECTIONS-795) provide a PairIterator to zip two iterators of different types.

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/COLLECTIONS-795?focusedWorklogId=606576=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606576
 ]

ASF GitHub Bot logged work on COLLECTIONS-795:
--

Author: ASF GitHub Bot
Created on: 04/Jun/21 07:59
Start Date: 04/Jun/21 07:59
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on a change in pull request #238:
URL: 
https://github.com/apache/commons-collections/pull/238#discussion_r645116336



##
File path: src/main/java/org/apache/commons/collections4/IterableUtils.java
##
@@ -554,6 +555,34 @@
 };
 }
 
+/**
+ * Provides iteration over the elements contained in a pair of Iterables 
in-tandem.
+ * 
+ * The returned iterable has an iterator that traverses the elements in 
{@code a}
+ * and {@code b} together until one of the iterables is traversed 
completely.
+ * 

Review comment:
   Close HTML tags.

##
File path: src/main/java/org/apache/commons/collections4/IteratorUtils.java
##
@@ -127,7 +87,7 @@ private IteratorUtils() {}
  * @return an iterator over nothing
  */
 public static  ResettableIterator emptyIterator() {
-return EmptyIterator.resettableEmptyIterator();
+return EmptyIterator.resettableEmptyIterator();

Review comment:
   These changes are unrelated, small PRs are better for reviewers ;-)

##
File path: src/main/java/org/apache/commons/collections4/IterableUtils.java
##
@@ -554,6 +555,34 @@
 };
 }
 
+/**
+ * Provides iteration over the elements contained in a pair of Iterables 
in-tandem.
+ * 
+ * The returned iterable has an iterator that traverses the elements in 
{@code a}
+ * and {@code b} together until one of the iterables is traversed 
completely.
+ * 
+ * The returned iterable's iterator does NOT support {@code remove()}.
+ *
+ * @param  the left elements' type
+ * @param  the right elements' type
+ * @param left the iterable for the left side elements
+ * @param right the iterable for the right side elements
+ * @return an iterable, over the decorated iterables to traverse them 
together until one is
+ * exhausted
+ * @throws NullPointerException if any iterator is null
+ */

Review comment:
   New public and protected method should have `@since 4.5` Javadoc tags.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 606576)
Time Spent: 5h 20m  (was: 5h 10m)

> provide a PairIterator to zip two iterators of different types.
> ---
>
> Key: COLLECTIONS-795
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-795
> Project: Commons Collections
>  Issue Type: New Feature
>  Components: Iterator
>Reporter: Anant Damle
>Priority: Minor
>  Time Spent: 5h 20m
>  Remaining Estimate: 0h
>
> ZippingIterator provides a way to simulatenously iterate over multiple 
> iterators of the *same-type.*
> The proposed pair iterator allows simultaneously iterating over two iterators 
> of different type, like the example below:
> {code:java}
> Iterator leftIterator =  ...;
> Iterator rightIterator = ...;
> PairIterator pairIterator = PairIterator.of(leftIterator, rightIterator);
> while (pairIterator.hasNext()) {
>ImmutablePair item = pairIterator.next();
>...
> }{code}
>  
> Another convenience could be to use an Iterable for easy for-each constructs.
> {code:java}
> List studentIds = ...
> List studentNames = ...
> for (PairedItem items : 
> IterableUtils.pairedIterable(studentIds, studentNames) {
>   Integer studentId = item.getLeft();
>   String studentName = item.getRight();
>   ...
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-collections] garydgregory commented on a change in pull request #238: [COLLECTIONS-795] Add a new Iterator to allowing zipping over two iterators of different types

2021-06-04 Thread GitBox


garydgregory commented on a change in pull request #238:
URL: 
https://github.com/apache/commons-collections/pull/238#discussion_r645116336



##
File path: src/main/java/org/apache/commons/collections4/IterableUtils.java
##
@@ -554,6 +555,34 @@
 };
 }
 
+/**
+ * Provides iteration over the elements contained in a pair of Iterables 
in-tandem.
+ * 
+ * The returned iterable has an iterator that traverses the elements in 
{@code a}
+ * and {@code b} together until one of the iterables is traversed 
completely.
+ * 

Review comment:
   Close HTML tags.

##
File path: src/main/java/org/apache/commons/collections4/IteratorUtils.java
##
@@ -127,7 +87,7 @@ private IteratorUtils() {}
  * @return an iterator over nothing
  */
 public static  ResettableIterator emptyIterator() {
-return EmptyIterator.resettableEmptyIterator();
+return EmptyIterator.resettableEmptyIterator();

Review comment:
   These changes are unrelated, small PRs are better for reviewers ;-)

##
File path: src/main/java/org/apache/commons/collections4/IterableUtils.java
##
@@ -554,6 +555,34 @@
 };
 }
 
+/**
+ * Provides iteration over the elements contained in a pair of Iterables 
in-tandem.
+ * 
+ * The returned iterable has an iterator that traverses the elements in 
{@code a}
+ * and {@code b} together until one of the iterables is traversed 
completely.
+ * 
+ * The returned iterable's iterator does NOT support {@code remove()}.
+ *
+ * @param  the left elements' type
+ * @param  the right elements' type
+ * @param left the iterable for the left side elements
+ * @param right the iterable for the right side elements
+ * @return an iterable, over the decorated iterables to traverse them 
together until one is
+ * exhausted
+ * @throws NullPointerException if any iterator is null
+ */

Review comment:
   New public and protected method should have `@since 4.5` Javadoc tags.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (COLLECTIONS-795) provide a PairIterator to zip two iterators of different types.

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/COLLECTIONS-795?focusedWorklogId=606545=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606545
 ]

ASF GitHub Bot logged work on COLLECTIONS-795:
--

Author: ASF GitHub Bot
Created on: 04/Jun/21 07:56
Start Date: 04/Jun/21 07:56
Worklog Time Spent: 10m 
  Work Description: anantdamle edited a comment on pull request #238:
URL: 
https://github.com/apache/commons-collections/pull/238#issuecomment-854278433






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 606545)
Time Spent: 5h 10m  (was: 5h)

> provide a PairIterator to zip two iterators of different types.
> ---
>
> Key: COLLECTIONS-795
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-795
> Project: Commons Collections
>  Issue Type: New Feature
>  Components: Iterator
>Reporter: Anant Damle
>Priority: Minor
>  Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> ZippingIterator provides a way to simulatenously iterate over multiple 
> iterators of the *same-type.*
> The proposed pair iterator allows simultaneously iterating over two iterators 
> of different type, like the example below:
> {code:java}
> Iterator leftIterator =  ...;
> Iterator rightIterator = ...;
> PairIterator pairIterator = PairIterator.of(leftIterator, rightIterator);
> while (pairIterator.hasNext()) {
>ImmutablePair item = pairIterator.next();
>...
> }{code}
>  
> Another convenience could be to use an Iterable for easy for-each constructs.
> {code:java}
> List studentIds = ...
> List studentNames = ...
> for (PairedItem items : 
> IterableUtils.pairedIterable(studentIds, studentNames) {
>   Integer studentId = item.getLeft();
>   String studentName = item.getRight();
>   ...
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-collections] anantdamle edited a comment on pull request #238: [COLLECTIONS-795] Add a new Iterator to allowing zipping over two iterators of different types

2021-06-04 Thread GitBox


anantdamle edited a comment on pull request #238:
URL: 
https://github.com/apache/commons-collections/pull/238#issuecomment-854278433






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-jexl] coveralls commented on pull request #55: Fix small typos in comments throughout

2021-06-04 Thread GitBox


coveralls commented on pull request #55:
URL: https://github.com/apache/commons-jexl/pull/55#issuecomment-854323470


   
   [![Coverage 
Status](https://coveralls.io/builds/40297296/badge)](https://coveralls.io/builds/40297296)
   
   Coverage remained the same at 86.764% when pulling 
**36a7f8da6676f4bdd8a1597189610aa4e55cb4d9 on csamak:typos** into 
**3bbdc91d649a085564561a6e93ba9e052d841508 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (IO-732) Char equivalent of UnsynchronizedByteArrayOutputStream (and InputStream)

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-732?focusedWorklogId=606470=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606470
 ]

ASF GitHub Bot logged work on IO-732:
-

Author: ASF GitHub Bot
Created on: 04/Jun/21 07:46
Start Date: 04/Jun/21 07:46
Worklog Time Spent: 10m 
  Work Description: pjfanning commented on pull request #235:
URL: https://github.com/apache/commons-io/pull/235#issuecomment-853392091


   @jochenw  I guess the point is that this CharArrayWriter can also be used to 
generate a String but I suppose commons-io already has StringBuilderWriter and 
maybe that is a better choice if building a String is what you want. I can 
remove the line from the Javadoc - I'm neutral abut whether it is needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 606470)
Time Spent: 1h 20m  (was: 1h 10m)

> Char equivalent of UnsynchronizedByteArrayOutputStream (and InputStream)
> 
>
> Key: IO-732
> URL: https://issues.apache.org/jira/browse/IO-732
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: PJ Fanning
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> I was thinking of writing this and submitting it but just want to see if 
> people think it makes sense first.
> The idea is to take AbstractByteArrayOutputStream and to replace the byte[] 
> with char[] (maybe called AbstractCharArrayWriter) and to create an 
> UnsynchronizedCharArrayWriter that extends it. Could so something similar 
> with UnsynchronizedByteArrayInputStream - to get an 
> UnsynchronizedStringReader.
> The nice thing about AbstractByteArrayOutputStream is the way it avoids 
> arraycopy. The existing commons-io StringBuilderWriter still has arraycopy 
> under the hood (in the java.lang.StringBuilder).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] pjfanning commented on pull request #235: [IO-732] CharArrayWriter

2021-06-04 Thread GitBox


pjfanning commented on pull request #235:
URL: https://github.com/apache/commons-io/pull/235#issuecomment-853392091


   @jochenw  I guess the point is that this CharArrayWriter can also be used to 
generate a String but I suppose commons-io already has StringBuilderWriter and 
maybe that is a better choice if building a String is what you want. I can 
remove the line from the Javadoc - I'm neutral abut whether it is needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Work logged] (IO-732) Char equivalent of UnsynchronizedByteArrayOutputStream (and InputStream)

2021-06-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-732?focusedWorklogId=606453=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606453
 ]

ASF GitHub Bot logged work on IO-732:
-

Author: ASF GitHub Bot
Created on: 04/Jun/21 07:44
Start Date: 04/Jun/21 07:44
Worklog Time Spent: 10m 
  Work Description: jochenw commented on pull request #235:
URL: https://github.com/apache/commons-io/pull/235#issuecomment-853377897






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 606453)
Time Spent: 1h 10m  (was: 1h)

> Char equivalent of UnsynchronizedByteArrayOutputStream (and InputStream)
> 
>
> Key: IO-732
> URL: https://issues.apache.org/jira/browse/IO-732
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: PJ Fanning
>Priority: Major
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> I was thinking of writing this and submitting it but just want to see if 
> people think it makes sense first.
> The idea is to take AbstractByteArrayOutputStream and to replace the byte[] 
> with char[] (maybe called AbstractCharArrayWriter) and to create an 
> UnsynchronizedCharArrayWriter that extends it. Could so something similar 
> with UnsynchronizedByteArrayInputStream - to get an 
> UnsynchronizedStringReader.
> The nice thing about AbstractByteArrayOutputStream is the way it avoids 
> arraycopy. The existing commons-io StringBuilderWriter still has arraycopy 
> under the hood (in the java.lang.StringBuilder).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] jochenw commented on pull request #235: [IO-732] CharArrayWriter

2021-06-04 Thread GitBox


jochenw commented on pull request #235:
URL: https://github.com/apache/commons-io/pull/235#issuecomment-853377897






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Updated] (JEXL-350) map[null] throws "unsolvable property" when a Sandbox is used

2021-06-04 Thread Henri Biestro (Jira)


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

Henri Biestro updated JEXL-350:
---
Assignee: Henri Biestro

> map[null] throws "unsolvable property" when a Sandbox is used
> -
>
> Key: JEXL-350
> URL: https://issues.apache.org/jira/browse/JEXL-350
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.1
> Environment: jdk-11.0.5_10-hotspot
> JEXL git pull on 2021-06-03
>  
>Reporter: David Costanzo
>Assignee: Henri Biestro
>Priority: Major
>
> In JEXL 3.2 SNAPSHOT, you can can access a null property in a map if you have 
> no sandbox, but you cannot access a null property in a map if you have an 
> "allow box" sandbox.  This asymmetry is weird and might be an oversight.
> The fix for JEXL-327 allows setting a null property in a map using the array 
> syntax, but only for the case where there is no sandbox.  The fix for 
> JEXL-291 allows array-style access to values in a map when using a sandbox.  
> What remains is the intersection of these two use cases: accessing a null 
> property in a map using the array-access syntax when there's a sandbox.
>  
> *Impact:*
> In my domain (working with data from clinical trials), a null numeric value 
> means "missing", which is a valid value.  Our JEXL programmers implement 
> "switch" statements using a map, so you might see an expression that 
> translates a coded variable named "DMSEX" into an English description like:
> {code:java}
> {
>null : "Unknown",
>1: "MALE",
>2: "FEMALE"
> }[DMSEX]{code}
> Not being able to read the "Unknown" value when DMSEX=null is a problem that 
> we've had to work around by copying the internal class SandboxUberspect and 
> hacking it to allow this.
>  
> *Technical Details:*
> I think the problem starts in SandboxUbserspect.getPropertyGet() because 
> identifier is null.  In this case, the most of the logic is skipped and null 
> is returned, indicating that the property is undefined.
> {code:java}
> @Override
> public JexlPropertyGet getPropertyGet(final List resolvers,
>   final Object obj,
>   final Object identifier) {
> if (obj != null && identifier != null) {
> final String property = identifier.toString();
> final String actual = sandbox.read(obj.getClass(), property);
> if (actual != null) {
>  // no transformation, strict equality: use identifier before 
> string conversion
> final Object pty = actual == property? identifier : actual;
> return uberspect.getPropertyGet(resolvers, obj, pty);
> }
> }
> return null;
> }
> {code}
> In my superficial understanding, the Sandbox.read() method doesn't have a way 
> to distinguish between "null is the property you want to read" and "access is 
> blocked" so in my hack, I had to always allow read access of null.
>  
> *Steps to Reproduce:*
> Below are some unit tests which show the four possibilities of with/without 
> sandbox and get/set null.  I've included the behavior in JEXL 3.1 and a 
> recent build of github as comments.
> {code:java}
> @Test
> public void testGetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, works
> // JEXL 3.2, works
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> 
> @Test
> public void testGetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> JexlSandbox(true)).create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null]");
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, throws JexlException$Property "undefined property 
> '.'"
> Object o = expression.evaluate(jc);
> Assert.assertEquals("foo", o);
> }
> @Test
> public void testSetNullKeyWithNoSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null] = 
> 'bar'");
> 
> // JEXL 3.1, throws JexlException$Property "unsolvable property 
> '.'"
> // JEXL 3.2, works
> expression.evaluate(jc);
> }
> @Test
> public void testSetNullKeyWithSandbox() throws Exception {
> JexlEngine jexl = new JexlBuilder().sandbox(new 
> JexlSandbox(true)).create();
> JexlContext jc = new MapContext();
> JexlExpression expression = jexl.createExpression("{null : 'foo'}[null] = 
> 'bar'");
> // JEXL 3.1, throws 

[jira] [Commented] (MATH-1602) Purpose of "RngAdaptor"

2021-06-04 Thread Alex Herbert (Jira)


[ 
https://issues.apache.org/jira/browse/MATH-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17357108#comment-17357108
 ] 

Alex Herbert commented on MATH-1602:


I use a similar wrapper class to allow use of the classes in Commons Math 3 
that require a random source.

In CM4 all these classes have either been updated to UniformRandomProvider or 
moved to new projects, e.g. the distributions have moved to Commons Statistics. 
With the release plan to release dependencies such as Statistics before CM4 
there is not a reason to keep the adaptor. Users should upgrade to 
UniformRandomProvider to use the new code.

RngAdaptor is the only class that references the interface RandomGenerator. So 
it seems both these classes can be removed.

 

 

> Purpose of "RngAdaptor"
> ---
>
> Key: MATH-1602
> URL: https://issues.apache.org/jira/browse/MATH-1602
> Project: Commons Math
>  Issue Type: Sub-task
>Reporter: Gilles Sadowski
>Priority: Minor
>
> [{{RngAdaptor}}|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/RngAdaptor.java;h=c16587dc08162ef184fcccbbcc7b4fe9bbdcf237;hb=HEAD]
>  was created to allow "skeptics" to test the then new RNG implementations in 
> "Commons RNG" and compare with the RNG implementations in "Commons Math" (up 
> to v3.6.1).
> Since then, the RNG codes pass stringent tests ("Diehard", "TestU01"); hence 
> that rationale is moot.
> Is there another reason to keep this class?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)