Package tools
Class PolynomialTools
Object
PolynomialTools
public class PolynomialTools
extends Object
The
PolynomialTools
class contains miscellaneous methods for GeneralFunction
s 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 Summary
Constructors Constructor Description PolynomialTools()
-
Method Summary
Modifier and Type Method Description static double
getDegree(GeneralFunction monomial)
Returns the degree of a monomial.static boolean
isGeneralMonomial(GeneralFunction function)
Checks if a givenGeneralFunction
is a generalized monomial (any constant powers).static boolean
isMonomial(GeneralFunction function)
Checks if a givenGeneralFunction
is a monomial (positive integer powers).static boolean
isPolynomial(GeneralFunction function)
Checks if a givenGeneralFunction
is a polynomial.
-
Constructor Details
-
PolynomialTools
public PolynomialTools()
-
-
Method Details
-
isPolynomial
Checks if a givenGeneralFunction
is a polynomial.- Parameters:
function
- the function to be checked- Returns:
- true if the function is a polynomial
-
isMonomial
Checks if a givenGeneralFunction
is a monomial (positive integer powers).- Parameters:
function
- the function to be checked- Returns:
- true if the function is a monomial
-
isGeneralMonomial
Checks if a givenGeneralFunction
is a generalized monomial (any constant powers).- Parameters:
function
- the function to be checked- Returns:
- true if the function is a generalized monomial
-
getDegree
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
-