test_class.file: jtstoolkit/src/test/java/ec/tstoolkit/maths/polynomials/RationalFunctionTest.java
test_class.identifier: RationalFunctionTest
test_case.body: @Test
      public void testDrop() {
          Polynomial n=Polynomial.valueOf(1,-.2,-.3), d=Polynomial.valueOf(1,-1.8,1);
          RationalFunction fn=new RationalFunction(n, d);
          RationalFunction fn2=fn.drop(10);
          for (int i=0; i<50; ++i){
              assertTrue(Math.abs(fn.get(i+10)-fn2.get(i))<1e-9);
          }
          
      }
test_case.class_method_signature: RationalFunctionTest.testDrop()
test_case.full_signature: @Test public void testDrop()
test_case.identifier: testDrop
test_case.invocations: valueOf valueOf drop assertTrue abs get get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDrop()
focal_class.declarator: m_c
focal_class.modifier: private
focal_class.original_string: private double[] m_c;
focal_class.type: double[]
focal_class.var_name: m_c
focal_class.declarator: m_pn
focal_class.modifier: private final
focal_class.original_string: private final Polynomial m_pn;
focal_class.type: Polynomial
focal_class.var_name: m_pn
focal_class.declarator: m_pd
focal_class.modifier: private final
focal_class.original_string: private final Polynomial m_pd;
focal_class.type: Polynomial
focal_class.var_name: m_pd
focal_class.declarator: EPSILON = 1.0e-12
focal_class.modifier: public static final
focal_class.original_string: public static final double EPSILON = 1.0e-12;
focal_class.type: double
focal_class.var_name: EPSILON
focal_class.declarator: g_atom = 32
focal_class.modifier: private final static
focal_class.original_string: private final static int g_atom = 32;
focal_class.type: int
focal_class.var_name: g_atom
focal_class.file: jtstoolkit/src/main/java/ec/tstoolkit/maths/polynomials/RationalFunction.java
focal_class.identifier: RationalFunction
focal_class.class_method_signature: RationalFunction.RationalFunction()
focal_class.full_signature: public  RationalFunction()
focal_class.identifier: RationalFunction
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  RationalFunction()
focal_class.class_method_signature: RationalFunction.RationalFunction(final Polynomial pn, final Polynomial pd)
focal_class.full_signature: public  RationalFunction(final Polynomial pn, final Polynomial pd)
focal_class.identifier: RationalFunction
focal_class.modifiers: public
focal_class.parameters: (final Polynomial pn, final Polynomial pd)
focal_class.signature:  RationalFunction(final Polynomial pn, final Polynomial pd)
focal_class.class_method_signature: RationalFunction.coefficients(final int n)
focal_class.full_signature: public double[] coefficients(final int n)
focal_class.identifier: coefficients
focal_class.modifiers: public
focal_class.parameters: (final int n)
focal_class.return: double[]
focal_class.signature: double[] coefficients(final int n)
focal_class.class_method_signature: RationalFunction.divide(final RationalFunction r2)
focal_class.full_signature: public RationalFunction divide(final RationalFunction r2)
focal_class.identifier: divide
focal_class.modifiers: public
focal_class.parameters: (final RationalFunction r2)
focal_class.return: RationalFunction
focal_class.signature: RationalFunction divide(final RationalFunction r2)
focal_class.class_method_signature: RationalFunction.drop(final int n)
focal_class.full_signature: public RationalFunction drop(final int n)
focal_class.identifier: drop
focal_class.modifiers: public
focal_class.parameters: (final int n)
focal_class.return: RationalFunction
focal_class.signature: RationalFunction drop(final int n)
focal_class.class_method_signature: RationalFunction.evaluateAt(final Complex c)
focal_class.full_signature: public Complex evaluateAt(final Complex c)
focal_class.identifier: evaluateAt
focal_class.modifiers: public
focal_class.parameters: (final Complex c)
focal_class.return: Complex
focal_class.signature: Complex evaluateAt(final Complex c)
focal_class.class_method_signature: RationalFunction.evaluateAt(final double x)
focal_class.full_signature: public double evaluateAt(final double x)
focal_class.identifier: evaluateAt
focal_class.modifiers: public
focal_class.parameters: (final double x)
focal_class.return: double
focal_class.signature: double evaluateAt(final double x)
focal_class.class_method_signature: RationalFunction.get(final int k)
focal_class.full_signature: public double get(final int k)
focal_class.identifier: get
focal_class.modifiers: public
focal_class.parameters: (final int k)
focal_class.return: double
focal_class.signature: double get(final int k)
focal_class.class_method_signature: RationalFunction.getDenominator()
focal_class.full_signature: public Polynomial getDenominator()
focal_class.identifier: getDenominator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Polynomial
focal_class.signature: Polynomial getDenominator()
focal_class.class_method_signature: RationalFunction.getNumerator()
focal_class.full_signature: public Polynomial getNumerator()
focal_class.identifier: getNumerator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Polynomial
focal_class.signature: Polynomial getNumerator()
focal_class.class_method_signature: RationalFunction.isFinite()
focal_class.full_signature: public boolean isFinite()
focal_class.identifier: isFinite
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isFinite()
focal_class.class_method_signature: RationalFunction.minus(final RationalFunction r2)
focal_class.full_signature: public RationalFunction minus(final RationalFunction r2)
focal_class.identifier: minus
focal_class.modifiers: public
focal_class.parameters: (final RationalFunction r2)
focal_class.return: RationalFunction
focal_class.signature: RationalFunction minus(final RationalFunction r2)
focal_class.class_method_signature: RationalFunction.plus(final RationalFunction r2)
focal_class.full_signature: public RationalFunction plus(final RationalFunction r2)
focal_class.identifier: plus
focal_class.modifiers: public
focal_class.parameters: (final RationalFunction r2)
focal_class.return: RationalFunction
focal_class.signature: RationalFunction plus(final RationalFunction r2)
focal_class.class_method_signature: RationalFunction.poles()
focal_class.full_signature: public Complex[] poles()
focal_class.identifier: poles
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Complex[]
focal_class.signature: Complex[] poles()
focal_class.class_method_signature: RationalFunction.poles(final IRootsSolver searcher)
focal_class.full_signature: public Complex[] poles(final IRootsSolver searcher)
focal_class.identifier: poles
focal_class.modifiers: public
focal_class.parameters: (final IRootsSolver searcher)
focal_class.return: Complex[]
focal_class.signature: Complex[] poles(final IRootsSolver searcher)
focal_class.class_method_signature: RationalFunction.prepare(int degree)
focal_class.full_signature: public void prepare(int degree)
focal_class.identifier: prepare
focal_class.modifiers: public
focal_class.parameters: (int degree)
focal_class.return: void
focal_class.signature: void prepare(int degree)
focal_class.class_method_signature: RationalFunction.roots()
focal_class.full_signature: public Complex[] roots()
focal_class.identifier: roots
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Complex[]
focal_class.signature: Complex[] roots()
focal_class.class_method_signature: RationalFunction.roots(final IRootsSolver searcher)
focal_class.full_signature: public Complex[] roots(final IRootsSolver searcher)
focal_class.identifier: roots
focal_class.modifiers: public
focal_class.parameters: (final IRootsSolver searcher)
focal_class.return: Complex[]
focal_class.signature: Complex[] roots(final IRootsSolver searcher)
focal_class.class_method_signature: RationalFunction.times(final RationalFunction r2)
focal_class.full_signature: public RationalFunction times(final RationalFunction r2)
focal_class.identifier: times
focal_class.modifiers: public
focal_class.parameters: (final RationalFunction r2)
focal_class.return: RationalFunction
focal_class.signature: RationalFunction times(final RationalFunction r2)
focal_class.class_method_signature: RationalFunction.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public RationalFunction drop(final int n) {
          Polynomial cn = m_pn, cd = m_pd;
  
          // size of the numerator:
          int p = cd.getDegree() + 1;
          int q = p;// -1;
          if (cn.getDegree() + 1 - n > q) {
              q = cn.getDegree() + 1 - n;
          }
          if (q == 0) {
              return new RationalFunction();
          }
          double[] phi = new double[q];
          double[] ntmp = new double[q];
          for (int i = 0; i < q; ++i) {
              phi[i] = get(i + n);
          }
  
          ntmp[0] = phi[0] * cd.get(0);
          for (int i = 1; i < q; ++i) {
              double s = 0;
              int imax = i < q ? i : q - 1;
              for (int j = 0; j <= imax; ++j) {
                  int k = i - j;
                  if (k < p) {
                      s += cd.get(k) * phi[j];
                  }
              }
              if (Math.abs(s) < EPSILON) {
                  s = 0;
              }
              ntmp[i] = s;
          }
          // simplifiy ntmp
          int qc = q;
          while ((qc > 0) && (ntmp[qc - 1] == 0)) {
              --qc;
          }
          if (qc == 0)
              return new RationalFunction();
          if (qc != q) {
              double[] ntmp2 = new double[qc];
              for (int i = 0; i < qc; ++i) {
                  ntmp2[i] = ntmp[i];
              }
              ntmp = ntmp2;
          }
          return new RationalFunction(Polynomial.of(ntmp), cd);
  
      }
focal_method.class_method_signature: RationalFunction.drop(final int n)
focal_method.full_signature: public RationalFunction drop(final int n)
focal_method.identifier: drop
focal_method.invocations: getDegree getDegree getDegree get get get abs of
focal_method.modifiers: public
focal_method.parameters: (final int n)
focal_method.return: RationalFunction
focal_method.signature: RationalFunction drop(final int n)