safeNorm

Returns the Cartesian norm (2-norm), handling both overflow and underflow.
Translation of the minpack enorm subroutine.
The redistribution policy for MINPACK is available
here, for
convenience, it is reproduced below.

Minpack Copyright Notice (1999) University of Chicago.
All rights reserved

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

The end-user documentation included with the redistribution, if any,
must include the following acknowledgment:
This product includes software developed by the University of
Chicago, as Operator of Argonne National Laboratory.
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.

WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"
WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE
UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND
THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE
OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY
OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF
THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)
DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION
UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL
BE CORRECTED.

LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT
HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,
INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF
ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF
PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER
SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT
(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,
EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE
POSSIBILITY OF SUCH LOSS OR DAMAGES.

Parameters:

v - Vector of doubles.

Returns:

the 2-norm of the vector.

Since:

2.2

sortInPlace

Sort an array in ascending order in place and perform the same reordering
of entries on other arrays. For example, if
x = [3, 1, 2], y = [1, 2, 3] and z = [0, 5, 7], then
sortInPlace(x, y, z) will update x to [1, 2, 3],
y to [2, 3, 1] and z to [5, 7, 0].

Parameters:

x - Array to be sorted and used as a pattern for permutation
of the other arrays.

yList - Set of arrays whose permutations of entries will follow
those performed on x.

sortInPlace

Sort an array in place and perform the same reordering of entries on
other arrays. This method works the same as the other
sortInPlace method, but
allows the order of the sort to be provided in the dir
parameter.

Parameters:

x - Array to be sorted and used as a pattern for permutation
of the other arrays.

dir - Order direction.

yList - Set of arrays whose permutations of entries will follow
those performed on x.

linearCombination

Compute a linear combination accurately.
This method computes the sum of the products
ai bi to high accuracy.
It does so by using specific multiplication and addition algorithms to
preserve accuracy and reduce cancellation effects.
It is based on the 2005 paper
Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump,
and Shin'ichi Oishi published in SIAM J. Sci. Comput.

linearCombination

This method computes a1×b1 +
a2×b2 to high accuracy. It does
so by using specific multiplication and addition algorithms to
preserve accuracy and reduce cancellation effects. It is based
on the 2005 paper
Accurate Sum and Dot Product by Takeshi Ogita,
Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput.

linearCombination

This method computes a1×b1 +
a2×b2 + a3×b3
to high accuracy. It does so by using specific multiplication and
addition algorithms to preserve accuracy and reduce cancellation effects.
It is based on the 2005 paper
Accurate Sum and Dot Product by Takeshi Ogita,
Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput.

linearCombination

This method computes a1×b1 +
a2×b2 + a3×b3 +
a4×b4
to high accuracy. It does so by using specific multiplication and
addition algorithms to preserve accuracy and reduce cancellation effects.
It is based on the 2005 paper
Accurate Sum and Dot Product by Takeshi Ogita,
Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput.