numericalMethods.algebra.polynomial
Class ComplexPolynomial

java.lang.Object
  |
  +--numericalMethods.algebra.polynomial.ComplexPolynomial

public final class ComplexPolynomial
extends java.lang.Object

This is provides routines for complex polynomials.


Constructor Summary
ComplexPolynomial()
           
 
Method Summary
static int calcDeg(double[] aRe, double[] aIm, int degOfA)
           
static void derivative(double[] aRe, double[] aIm, int degOfA, int n, double[] bRe, double[] bIm)
          computes the nth derivative of given polynomial.
static void divide(double[] aRe, double[] aIm, int degOfA, double[] bRe, double[] bIm, int degOfB, double[] cRe, double[] cIm, double[] dRe, double[] dIm)
           
static void eval(double[] aRe, double[] aIm, int degOfA, double x, double y, double[] aAtZ)
          evaluates the polynomial a with the coefficients a_k = aRe[k] + i aIm[k] and degree degOfA at z = x + i y and returns the result in aAtZ.
static void eval(double[] aRe, double[] aIm, int offsetOfA, int degOfA, double x, double y, double[] aAtZ)
          evaluates the polynomial a with the coefficients a_k = aRe[k + offsetOfA ] + i aIm[k + offsetOfA] and degree degOfA at z = x + i y and returns the result in aAtZ.
static void evalDerivative(double[] aRe, double[] aIm, int degOfA, int n, double x, double y, double[] dAAtZ)
          evaluates the n-the derivative of the polynomial a with the coefficients a_k = aRe[k + offsetOfA ] + i aIm[k + offsetOfA] and degree degOfA at z = x + i y and returns the result in dAAtZ.
static void evalDerivative(double[] aRe, double[] aIm, int offsetOfA, int degOfA, int n, double x, double y, double[] dAAtZ)
          evaluates the n-the derivative of the polynomial a with the coefficients a_k = aRe[k + offsetOfA ] + i aIm[k + offsetOfA] and degree degOfA at z = x + i y and returns the result in dAAtZ.
static void laguerAllRoots(double[] Ar, double[] Ai, int degOfA, double calcError, double[] rootsRe, double[] rootsIm)
           
static void laguerOneRoot(double[] Ar, double[] Ai, int degOfA, double calcError, double[] root)
           
static void linComb(double lr, double li, double[] aRe, double[] aIm, int degOfA, double mr, double mi, double[] bRe, double[] bIm, int degOfB, double[] cRe, double[] cIm)
           
static void multiplyToConst(double lr, double li, double[] aRe, double[] aIm, int degOfA, double[] cRe, double[] cIm)
          This methods multiplies a complex polynomial with constant complex number.
static void plus(double[] aRe, double[] aIm, int degOfA, double[] bRe, double[] bIm, int degOfB, double[] cRe, double[] cIm)
           
static void setZero(int deg, double[] a)
           
static void times(double[] aRe, double[] aIm, int degOfA, double[] bRe, double[] bIm, int degOfB, double[] cRe, double[] cIm)
           
static void times(double[] aRe, double[] aIm, int degOfA, double[] bRe, double[] bIm, int degOfB, double[] cRe, double[] cIm, int degOfC)
           
static java.lang.String toString(double[] re, double[] im, int degree)
           
static java.lang.String toString(double[] re, double[] im, int degree, double eps)
           
static java.lang.String toString(double[] re, double[] im, int lowerDegree, int degree, double eps)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexPolynomial

public ComplexPolynomial()
Method Detail

eval

public static void eval(double[] aRe,
                        double[] aIm,
                        int degOfA,
                        double x,
                        double y,
                        double[] aAtZ)
evaluates the polynomial a with the coefficients a_k = aRe[k] + i aIm[k] and degree degOfA at z = x + i y and returns the result in aAtZ. The polynomial is evaluated using Horner?s method.

eval

public static void eval(double[] aRe,
                        double[] aIm,
                        int offsetOfA,
                        int degOfA,
                        double x,
                        double y,
                        double[] aAtZ)
evaluates the polynomial a with the coefficients a_k = aRe[k + offsetOfA ] + i aIm[k + offsetOfA] and degree degOfA at z = x + i y and returns the result in aAtZ. The polynomial is evaluated using Horner?s method. If the offsetOfA is negative the occuring negative array entries are assumed as zeros.

evalDerivative

public static void evalDerivative(double[] aRe,
                                  double[] aIm,
                                  int degOfA,
                                  int n,
                                  double x,
                                  double y,
                                  double[] dAAtZ)
evaluates the n-the derivative of the polynomial a with the coefficients a_k = aRe[k + offsetOfA ] + i aIm[k + offsetOfA] and degree degOfA at z = x + i y and returns the result in dAAtZ. The polynomial is evaluated using Horner?s method.

evalDerivative

public static void evalDerivative(double[] aRe,
                                  double[] aIm,
                                  int offsetOfA,
                                  int degOfA,
                                  int n,
                                  double x,
                                  double y,
                                  double[] dAAtZ)
evaluates the n-the derivative of the polynomial a with the coefficients a_k = aRe[k + offsetOfA ] + i aIm[k + offsetOfA] and degree degOfA at z = x + i y and returns the result in dAAtZ. The polynomial is evaluated using Horner?s method. If the offsetOfA is negative the occuring negative array entries are assumed as zeros.

calcDeg

public static int calcDeg(double[] aRe,
                          double[] aIm,
                          int degOfA)

multiplyToConst

public static void multiplyToConst(double lr,
                                   double li,
                                   double[] aRe,
                                   double[] aIm,
                                   int degOfA,
                                   double[] cRe,
                                   double[] cIm)
This methods multiplies a complex polynomial with constant complex number.

plus

public static void plus(double[] aRe,
                        double[] aIm,
                        int degOfA,
                        double[] bRe,
                        double[] bIm,
                        int degOfB,
                        double[] cRe,
                        double[] cIm)

linComb

public static void linComb(double lr,
                           double li,
                           double[] aRe,
                           double[] aIm,
                           int degOfA,
                           double mr,
                           double mi,
                           double[] bRe,
                           double[] bIm,
                           int degOfB,
                           double[] cRe,
                           double[] cIm)

derivative

public static void derivative(double[] aRe,
                              double[] aIm,
                              int degOfA,
                              int n,
                              double[] bRe,
                              double[] bIm)
computes the nth derivative of given polynomial. aRe(aIm) and aIm(bIm) may coinside.
Parameters:
aRe - real part of coefficients of polynomial that is to differentiate
aIm - imaginary part of coefficients of polynomial that is to differentiate
degOfA - degree of polynomial which is to differentiate
n - number of differentiations
bRe - real part of the derivative
bIm - imaginary part of the derivative

times

public static void times(double[] aRe,
                         double[] aIm,
                         int degOfA,
                         double[] bRe,
                         double[] bIm,
                         int degOfB,
                         double[] cRe,
                         double[] cIm)

times

public static void times(double[] aRe,
                         double[] aIm,
                         int degOfA,
                         double[] bRe,
                         double[] bIm,
                         int degOfB,
                         double[] cRe,
                         double[] cIm,
                         int degOfC)

divide

public static void divide(double[] aRe,
                          double[] aIm,
                          int degOfA,
                          double[] bRe,
                          double[] bIm,
                          int degOfB,
                          double[] cRe,
                          double[] cIm,
                          double[] dRe,
                          double[] dIm)

laguerOneRoot

public static void laguerOneRoot(double[] Ar,
                                 double[] Ai,
                                 int degOfA,
                                 double calcError,
                                 double[] root)

laguerAllRoots

public static void laguerAllRoots(double[] Ar,
                                  double[] Ai,
                                  int degOfA,
                                  double calcError,
                                  double[] rootsRe,
                                  double[] rootsIm)

setZero

public static void setZero(int deg,
                           double[] a)

toString

public static java.lang.String toString(double[] re,
                                        double[] im,
                                        int degree)

toString

public static java.lang.String toString(double[] re,
                                        double[] im,
                                        int degree,
                                        double eps)

toString

public static java.lang.String toString(double[] re,
                                        double[] im,
                                        int lowerDegree,
                                        int degree,
                                        double eps)