You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2008/01/10 14:39:08 UTC
svn commit: r610787 -
/commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/LaguerreSolver.java
Author: luc
Date: Thu Jan 10 05:39:08 2008
New Revision: 610787
URL: http://svn.apache.org/viewvc?rev=610787&view=rev
Log:
replaced deprecated ComplexUtils methods
JIRA: MATH-171
Modified:
commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/LaguerreSolver.java
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/LaguerreSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/LaguerreSolver.java?rev=610787&r1=610786&r2=610787&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/LaguerreSolver.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/LaguerreSolver.java Thu Jan 10 05:39:08 2008
@@ -20,7 +20,6 @@
import org.apache.commons.math.FunctionEvaluationException;
import org.apache.commons.math.MaxIterationsExceededException;
import org.apache.commons.math.complex.Complex;
-import org.apache.commons.math.complex.ComplexUtils;
/**
* Implements the <a href="http://mathworld.wolfram.com/LaguerresMethod.html">
@@ -307,8 +306,9 @@
H = G2.subtract(d2v.divide(pv));
delta = N1.multiply((N.multiply(H)).subtract(G2));
// choose a denominator larger in magnitude
- Complex dplus = G.add(ComplexUtils.sqrt(delta));
- Complex dminus = G.subtract(ComplexUtils.sqrt(delta));
+ Complex deltaSqrt = delta.sqrt();
+ Complex dplus = G.add(deltaSqrt);
+ Complex dminus = G.subtract(deltaSqrt);
denominator = dplus.abs() > dminus.abs() ? dplus : dminus;
// Perturb z if denominator is zero, for instance,
// p(x) = x^3 + 1, z = 0.