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

Alex Herbert commented on NUMBERS-156:
--------------------------------------

We should consider pros and cons of removing {{SafeNorm}}. The method only does 
a single pass over the array. Also we can update the constants. The source code 
states as much in [enorm.f|http://www.netlib.org/minpack/enorm.f]:

{noformat}
the definitions of small, intermediate and large components
depend on two constants, rdwarf and rgiant. the main
restrictions on these constants are that rdwarf**2 not
underflow and rgiant**2 not overflow. the constants
given here are suitable for every known computer.
{noformat}

A different implementation with power of 2 scaling has the advantage of 
minimising precision loss due to divisions. But if the implementation is to 
scale all numbers using the same scale factor then it requires 2 passes over 
the array. So ideally we should have a test showing the precision on random 
vectors and a speed test to make an informed choice.

Q. Should it be a requirement that permutations of a vector have the same 
length?



> SafeNorm 3D overload
> --------------------
>
>                 Key: NUMBERS-156
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-156
>             Project: Commons Numbers
>          Issue Type: Improvement
>            Reporter: Matt Juntunen
>            Priority: Major
>
> We should create an overload of {{SafeNorm.value}} that accepts 3 arguments 
> to potentially improve performance for 3D vectors.



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

Reply via email to