test_class.file: jtstoolkit/src/test/java/ec/tstoolkit/maths/polynomials/GrantHitchinsSolverTest.java
test_class.identifier: GrantHitchinsSolverTest
test_case.body: @Test
      public void testUnitRootd() {
          int N=12;
          double[] c=new double[N+1];
          c[0]=1;
          c[N]=-1;
          GrantHitchinsSolver solver=new GrantHitchinsSolver();
          assertTrue(solver.factorize(Polynomial.of(c)));
      }
test_case.class_method_signature: GrantHitchinsSolverTest.testUnitRootd()
test_case.full_signature: @Test public void testUnitRootd()
test_case.identifier: testUnitRootd
test_case.invocations: assertTrue factorize of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUnitRootd()
focal_class.declarator: ONE = 1.0
focal_class.modifier: private static final
focal_class.original_string: private static final double ONE = 1.0, TWO = 2.0, ZERO = 0.0, TEN = 10.0,
  	    P8 = 0.8, A8 = 8.0, A1P5 = 1.5, P4Z1 = 0.00001, P5 = 0.5,
  	    P2Z1 = 0.001, P1 = 0.1, P3Z2 = 0.0002, FOUR = 4.0;
focal_class.type: double
focal_class.var_name: ONE
focal_class.declarator: g_max = 100
focal_class.modifier: private static final
focal_class.original_string: private static final int g_max = 100;
focal_class.type: int
focal_class.var_name: g_max
focal_class.declarator: m_x
focal_class.modifier: private
focal_class.original_string: private double m_x, m_y, m_r, m_j, m_rx, m_jx;
focal_class.type: double
focal_class.var_name: m_x
focal_class.declarator: m_tol
focal_class.modifier: private
focal_class.original_string: private double m_tol;
focal_class.type: double
focal_class.var_name: m_tol
focal_class.declarator: m_b
focal_class.modifier: private
focal_class.original_string: private double[] m_b, m_c;
focal_class.type: double[]
focal_class.var_name: m_b
focal_class.declarator: m_fac
focal_class.modifier: private
focal_class.original_string: private double m_fac;
focal_class.type: double
focal_class.var_name: m_fac
focal_class.declarator: g_eps = Constants.getEpsilon()
focal_class.modifier: private static final
focal_class.original_string: private static final double g_eps = Constants.getEpsilon(), g_small = 1e-15,
  	    g_cmax = Math.sqrt(Double.MAX_VALUE);
focal_class.type: double
focal_class.var_name: g_eps
focal_class.declarator: g_eps2 = g_eps * 1e4
focal_class.modifier: private static final
focal_class.original_string: private static final double g_eps2 = g_eps * 1e4;
focal_class.type: double
focal_class.var_name: g_eps2
focal_class.declarator: m_remainder
focal_class.modifier: private
focal_class.original_string: private Polynomial m_remainder;
focal_class.type: Polynomial
focal_class.var_name: m_remainder
focal_class.declarator: m_roots
focal_class.modifier: private
focal_class.original_string: private ec.tstoolkit.maths.Complex[] m_roots;
focal_class.type: ec.tstoolkit.maths.Complex[]
focal_class.var_name: m_roots
focal_class.file: jtstoolkit/src/main/java/ec/tstoolkit/maths/polynomials/GrantHitchinsSolver.java
focal_class.identifier: GrantHitchinsSolver
focal_class.interfaces: implements IRootsSolver
focal_class.class_method_signature: GrantHitchinsSolver.GrantHitchinsSolver()
focal_class.full_signature: public  GrantHitchinsSolver()
focal_class.identifier: GrantHitchinsSolver
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  GrantHitchinsSolver()
focal_class.class_method_signature: GrantHitchinsSolver.evaluate(double[] a, int n, double tol)
focal_class.full_signature: private boolean evaluate(double[] a, int n, double tol)
focal_class.identifier: evaluate
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double tol)
focal_class.return: boolean
focal_class.signature: boolean evaluate(double[] a, int n, double tol)
focal_class.class_method_signature: GrantHitchinsSolver.clear()
focal_class.full_signature: @Override public void clear()
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: GrantHitchinsSolver.compositedeflation(double[] a, int n, double[] rez,
  	    double[] imz)
focal_class.full_signature: private void compositedeflation(double[] a, int n, double[] rez,
  	    double[] imz)
focal_class.identifier: compositedeflation
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double[] rez,
  	    double[] imz)
focal_class.return: void
focal_class.signature: void compositedeflation(double[] a, int n, double[] rez,
  	    double[] imz)
focal_class.class_method_signature: GrantHitchinsSolver.deflate(double[] a, int n, double[] rez, double[] imz,
  	    double eps)
focal_class.full_signature: private int deflate(double[] a, int n, double[] rez, double[] imz,
  	    double eps)
focal_class.identifier: deflate
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double[] rez, double[] imz,
  	    double eps)
focal_class.return: int
focal_class.signature: int deflate(double[] a, int n, double[] rez, double[] imz,
  	    double eps)
focal_class.class_method_signature: GrantHitchinsSolver.deflatecomplexroot(double[] a, int n, double[] rez, double[] imz)
focal_class.full_signature: private int deflatecomplexroot(double[] a, int n, double[] rez, double[] imz)
focal_class.identifier: deflatecomplexroot
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double[] rez, double[] imz)
focal_class.return: int
focal_class.signature: int deflatecomplexroot(double[] a, int n, double[] rez, double[] imz)
focal_class.class_method_signature: GrantHitchinsSolver.deflaterealroot(double[] a, int n, double[] rez, double[] imz)
focal_class.full_signature: private int deflaterealroot(double[] a, int n, double[] rez, double[] imz)
focal_class.identifier: deflaterealroot
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double[] rez, double[] imz)
focal_class.return: int
focal_class.signature: int deflaterealroot(double[] a, int n, double[] rez, double[] imz)
focal_class.class_method_signature: GrantHitchinsSolver.factorize(Polynomial p)
focal_class.full_signature: @Override public boolean factorize(Polynomial p)
focal_class.identifier: factorize
focal_class.modifiers: @Override public
focal_class.parameters: (Polynomial p)
focal_class.return: boolean
focal_class.signature: boolean factorize(Polynomial p)
focal_class.class_method_signature: GrantHitchinsSolver.getTol()
focal_class.full_signature: public double getTol()
focal_class.identifier: getTol
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double getTol()
focal_class.class_method_signature: GrantHitchinsSolver.isrealroot(double[] a, int n, double tol)
focal_class.full_signature: private boolean isrealroot(double[] a, int n, double tol)
focal_class.identifier: isrealroot
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double tol)
focal_class.return: boolean
focal_class.signature: boolean isrealroot(double[] a, int n, double tol)
focal_class.class_method_signature: GrantHitchinsSolver.remainder()
focal_class.full_signature: @Override public Polynomial remainder()
focal_class.identifier: remainder
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Polynomial
focal_class.signature: Polynomial remainder()
focal_class.class_method_signature: GrantHitchinsSolver.exemplar()
focal_class.full_signature: @Override public GrantHitchinsSolver exemplar()
focal_class.identifier: exemplar
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: GrantHitchinsSolver
focal_class.signature: GrantHitchinsSolver exemplar()
focal_class.class_method_signature: GrantHitchinsSolver.rescale_a(double[] a, int n)
focal_class.full_signature: private void rescale_a(double[] a, int n)
focal_class.identifier: rescale_a
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n)
focal_class.return: void
focal_class.signature: void rescale_a(double[] a, int n)
focal_class.class_method_signature: GrantHitchinsSolver.roots()
focal_class.full_signature: @Override public Complex[] roots()
focal_class.identifier: roots
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Complex[]
focal_class.signature: Complex[] roots()
focal_class.class_method_signature: GrantHitchinsSolver.scale_a(double[] a, int n)
focal_class.full_signature: private void scale_a(double[] a, int n)
focal_class.identifier: scale_a
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n)
focal_class.return: void
focal_class.signature: void scale_a(double[] a, int n)
focal_class.class_method_signature: GrantHitchinsSolver.search(double[] a, int n, double tol)
focal_class.full_signature: private boolean search(double[] a, int n, double tol)
focal_class.identifier: search
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double tol)
focal_class.return: boolean
focal_class.signature: boolean search(double[] a, int n, double tol)
focal_class.class_method_signature: GrantHitchinsSolver.setTol(double tol)
focal_class.full_signature: public void setTol(double tol)
focal_class.identifier: setTol
focal_class.modifiers: public
focal_class.parameters: (double tol)
focal_class.return: void
focal_class.signature: void setTol(double tol)
focal_class.class_method_signature: GrantHitchinsSolver.solve(double[] a, int n, double[] rez, double[] imz)
focal_class.full_signature: private boolean solve(double[] a, int n, double[] rez, double[] imz)
focal_class.identifier: solve
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double[] rez, double[] imz)
focal_class.return: boolean
focal_class.signature: boolean solve(double[] a, int n, double[] rez, double[] imz)
focal_class.class_method_signature: GrantHitchinsSolver.solve(double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.full_signature: private int solve(double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.identifier: solve
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.return: int
focal_class.signature: int solve(double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.class_method_signature: GrantHitchinsSolver.solve1(double[] a, double[] rez, double[] imz)
focal_class.full_signature: private void solve1(double[] a, double[] rez, double[] imz)
focal_class.identifier: solve1
focal_class.modifiers: private
focal_class.parameters: (double[] a, double[] rez, double[] imz)
focal_class.return: void
focal_class.signature: void solve1(double[] a, double[] rez, double[] imz)
focal_class.class_method_signature: GrantHitchinsSolver.solve2(double[] a, double[] rez, double[] imz)
focal_class.full_signature: private void solve2(double[] a, double[] rez, double[] imz)
focal_class.identifier: solve2
focal_class.modifiers: private
focal_class.parameters: (double[] a, double[] rez, double[] imz)
focal_class.return: void
focal_class.signature: void solve2(double[] a, double[] rez, double[] imz)
focal_class.class_method_signature: GrantHitchinsSolver.solven(double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.full_signature: private int solven(double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.identifier: solven
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.return: int
focal_class.signature: int solven(double[] a, int n, double[] rez, double[] imz,
  	    boolean reentry, double eps)
focal_class.class_method_signature: GrantHitchinsSolver.step1(double[] a, int n)
focal_class.full_signature: private void step1(double[] a, int n)
focal_class.identifier: step1
focal_class.modifiers: private
focal_class.parameters: (double[] a, int n)
focal_class.return: void
focal_class.signature: void step1(double[] a, int n)
focal_method.body: @Override
      public boolean factorize(Polynomial p) {
  	int degree = p.getDegree();
  	while ((degree > 0) && (p.get(degree) == 0))
  	    --degree;
  	if (degree == 0)
  	    return false;
  	double[] a = new double[degree + 1];
  	for (int i = 0; i <= degree; ++i)
  	    a[i] = p.get(degree - i);
  	double[] rez = new double[degree];
  	double[] imz = new double[degree];
  	try {
  	    if (this.solve(a, a.length, rez, imz)) {
  		// create roots...
  		m_roots = new ec.tstoolkit.maths.Complex[degree];
  		for (int i = 0; i < degree; ++i)
  		    m_roots[i] = ec.tstoolkit.maths.Complex
  			    .cart(rez[i], imz[i]);
  		m_remainder = Polynomial.valueOf(p.get(p.getDegree()));
  		return true;
  	    } else
  		return false;
  	} catch (PolynomialException ex) {
  	    return false;
  	}
      }
focal_method.class_method_signature: GrantHitchinsSolver.factorize(Polynomial p)
focal_method.full_signature: @Override public boolean factorize(Polynomial p)
focal_method.identifier: factorize
focal_method.invocations: getDegree get get solve cart valueOf get getDegree
focal_method.modifiers: @Override public
focal_method.parameters: (Polynomial p)
focal_method.return: boolean
focal_method.signature: boolean factorize(Polynomial p)