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 Summary
Constructors Constructor Description PolynomialTools() -
Method Summary
Modifier and Type Method Description static doublegetDegree(GeneralFunction monomial)Returns the degree of a monomial.static booleanisGeneralMonomial(GeneralFunction function)Checks if a givenGeneralFunctionis a generalized monomial (any constant powers).static booleanisMonomial(GeneralFunction function)Checks if a givenGeneralFunctionis a monomial (positive integer powers).static booleanisPolynomial(GeneralFunction function)Checks if a givenGeneralFunctionis a polynomial.
-
Constructor Details
-
PolynomialTools
public PolynomialTools()
-
-
Method Details
-
isPolynomial
Checks if a givenGeneralFunctionis a polynomial.- Parameters:
function- the function to be checked- Returns:
- true if the function is a polynomial
-
isMonomial
Checks if a givenGeneralFunctionis a monomial (positive integer powers).- Parameters:
function- the function to be checked- Returns:
- true if the function is a monomial
-
isGeneralMonomial
Checks if a givenGeneralFunctionis 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
-