chaospy.isconstant

chaospy.isconstant(poly: Union[numpy.typing._array_like._SupportsArray[numpy.dtype], numpy.typing._nested_sequence._NestedSequence[numpy.typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy.typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]], numpoly.baseclass.ndpoly]) bool[source]

Check if a polynomial is constant or not.

Args:
poly:

polynomial to check if is constant or not.

Returns:

True if polynomial has no indeterminants.

Examples:
>>> q0 = numpoly.variable()
>>> numpoly.isconstant(numpoly.polynomial([q0]))
False
>>> numpoly.isconstant(numpoly.polynomial([1]))
True