Package tools

Class PolynomialTools

Object
PolynomialTools

public class PolynomialTools
extends Object
The PolynomialTools class contains miscellaneous methods for GeneralFunctions which are polynomials. Simplifiable.simplify() MUST be called on the inputs to ALL methods in this class before execution for accurate results to be returned.
  • Constructor Details

  • Method Details

    • isPolynomial

      public static boolean isPolynomial​(GeneralFunction function)
      Checks if a given GeneralFunction is a polynomial.
      Parameters:
      function - the function to be checked
      Returns:
      true if the function is a polynomial
    • isMonomial

      public static boolean isMonomial​(GeneralFunction function)
      Checks if a given GeneralFunction is a monomial (positive integer powers).
      Parameters:
      function - the function to be checked
      Returns:
      true if the function is a monomial
    • isGeneralMonomial

      public static boolean isGeneralMonomial​(GeneralFunction function)
      Checks if a given GeneralFunction is a generalized monomial (any constant powers).
      Parameters:
      function - the function to be checked
      Returns:
      true if the function is a generalized monomial
    • getDegree

      public static double getDegree​(GeneralFunction monomial) throws IllegalArgumentException
      Returns the degree of a monomial.
      Parameters:
      monomial - The monomial whose degree is being found
      Returns:
      the degree of the monomial
      Throws:
      IllegalArgumentException - when the input is not a monomial