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.
- Return:
True if polynomial has no indeterminants.
- Example:
>>> q0 = numpoly.variable() >>> numpoly.isconstant(numpoly.polynomial([q0])) False >>> numpoly.isconstant(numpoly.polynomial([1])) True