~ubuntu-branches/ubuntu/oneiric/commons-math/oneiric

« back to all changes in this revision

Viewing changes to src/main/java/org/apache/commons/math/linear/TriDiagonalTransformer.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan, Torsten Werner, Damien Raude-Morvan
  • Date: 2011-03-07 21:14:46 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110307211446-4zea7og4eeyzhpai
Tags: 2.2-1
[ Torsten Werner ]
* Change maintainers into Maintainers.

[ Damien Raude-Morvan ]
* New upstream release (Closes: #617209).
* d/control: Bump Standards-Version to 3.9.1 (no changes needed).
* d/copyright: Refresh years, upgrade to DEP5 r166 and relicence my work
  under Apache-2.0.
* d/ant.properties: Set junit.jar to /usr/share/java/junit4.jar
  to ensure unit tests are launched.
* d/docs: Install upstream RELEASE-NOTES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import java.util.Arrays;
21
21
 
 
22
import org.apache.commons.math.util.FastMath;
 
23
 
22
24
 
23
25
/**
24
26
 * Class transforming a symmetrical matrix to tridiagonal shape.
32
34
 * EigenDecomposition eigen decomposition}. This class is therefore intended for internal
33
35
 * use by the library and is not public. As a consequence of this explicitly limited scope,
34
36
 * many methods directly returns references to internal arrays, not copies.</p>
35
 
 * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
 
37
 * @version $Revision: 990655 $ $Date: 2010-08-29 23:49:40 +0200 (dim. 29 août 2010) $
36
38
 * @since 2.0
37
39
 */
38
40
class TriDiagonalTransformer {
213
215
                final double c = hK[j];
214
216
                xNormSqr += c * c;
215
217
            }
216
 
            final double a = (hK[k + 1] > 0) ? -Math.sqrt(xNormSqr) : Math.sqrt(xNormSqr);
 
218
            final double a = (hK[k + 1] > 0) ? -FastMath.sqrt(xNormSqr) : FastMath.sqrt(xNormSqr);
217
219
            secondary[k] = a;
218
220
            if (a != 0.0) {
219
221
                // apply Householder transform from left and right simultaneously