Class PolynomialEvaluator

java.lang.Object
com.irurueta.numerical.PolynomialEvaluator
Direct Known Subclasses:
ComplexPolynomialEvaluator, RealPolynomialEvaluator

public class PolynomialEvaluator extends Object
Utility class to evaluate polynomials having either real or complex coefficients.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Empty constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    evaluate(double[] polyParams, double x)
    Evaluates polynomial formed by provided polynomial parameters at provided point x.
    static com.irurueta.algebra.Complex
    evaluate(com.irurueta.algebra.Complex[] polyParams, com.irurueta.algebra.Complex x)
    Evaluates polynomial formed by provided polynomial parameters at provided point x.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PolynomialEvaluator

      protected PolynomialEvaluator()
      Empty constructor.
  • Method Details

    • evaluate

      public static double evaluate(double[] polyParams, double x)
      Evaluates polynomial formed by provided polynomial parameters at provided point x. The polynomial of degree n is defined as: p(x) = a0 * x^n + a1 * x^(n - 1) + ... a(n-1) * x + an hence, the array of parameters is [a0, a1, ... a(n-1), an].
      Parameters:
      polyParams - array of polynomial parameters.
      x - point where polynomial is evaluated.
      Returns:
      result of evaluation.
      Throws:
      IllegalArgumentException - if provided array is null or has length 0.
    • evaluate

      public static com.irurueta.algebra.Complex evaluate(com.irurueta.algebra.Complex[] polyParams, com.irurueta.algebra.Complex x)
      Evaluates polynomial formed by provided polynomial parameters at provided point x. The polynomial of degree n is defined as: p(x) = a0 * x^n + a1 * x^(n - 1) + ... a(n-1) * x + an hence, the array of parameters is [a0, a1, ... a(n-1), an].
      Parameters:
      polyParams - array of polynomial parameters.
      x - point where polynomial is evaluated.
      Returns:
      result of evaluation.
      Throws:
      IllegalArgumentException - if provided array is null or has length 0.