MonomialFunction

class MonomialFunction(*args)

Monomial function class.

Available constructors:

MonomialFunction(degree)

Parameters
degreint

Degree of the monomial function

Notes

The monomial function defines as :

P(x)  = X^n

Examples

Create a standard absolute exponential covariance function:

>>> import openturns as ot
>>> P = ot.MonomialFunction(3)

Methods

__call__(self, x)

Call self as a function.

draw(self, xMin, xMax, pointNumber)

Draw the function.

getClassName(self)

Accessor to the object’s name.

getId(self)

Accessor to the object’s id.

getName(self)

Accessor to the object’s name.

getShadowedId(self)

Accessor to the object’s shadowed id.

getVisibility(self)

Accessor to the object’s visibility state.

gradient(self, x)

Compute the gradient at point x.

hasName(self)

Test if the object is named.

hasVisibleName(self)

Test if the object has a distinguishable name.

hessian(self, x)

Compute the hessian at point x.

setName(self, name)

Accessor to the object’s name.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

setVisibility(self, visible)

Accessor to the object’s visibility state.

__init__(self, \*args)

Initialize self. See help(type(self)) for accurate signature.

draw(self, xMin, xMax, pointNumber)

Draw the function.

Parameters
x_minfloat, optional

The starting value that is used for meshing the x-axis.

x_maxfloat, optional, x_{\max} > x_{\min}

The ending value that is used for meshing the x-axis.

n_pointsint, optional

The number of points that is used for meshing the x-axis.

Examples

>>> import openturns as ot
>>> from openturns.viewer import View
>>> f = ot.UniVariatePolynomial([1.0, 2.0, -3.0, 5.0])
>>> View(f.draw(-10.0, 10.0, 100)).show()
getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

The object class name (object.__class__.__name__).

getId(self)

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getName(self)

Accessor to the object’s name.

Returns
namestr

The name of the object.

getShadowedId(self)

Accessor to the object’s shadowed id.

Returns
idint

Internal unique identifier.

getVisibility(self)

Accessor to the object’s visibility state.

Returns
visiblebool

Visibility flag.

gradient(self, x)

Compute the gradient at point x.

Returns
gradientfloat

The value of the monomial’s first-order derivative at point x.

Examples

>>> import openturns as ot
>>> P = ot.MonomialFunction(3)
>>> print(P.gradient(1.0))
3.0
hasName(self)

Test if the object is named.

Returns
hasNamebool

True if the name is not empty.

hasVisibleName(self)

Test if the object has a distinguishable name.

Returns
hasVisibleNamebool

True if the name is not empty and not the default one.

hessian(self, x)

Compute the hessian at point x.

Parameters
xfloat

Input value.

Returns
hessianfloat

The value of the monomial’s second-order derivative at point x.

Examples

>>> import openturns as ot
>>> P = ot.MonomialFunction(3)
>>> print(P.hessian(1.0))
6.0
setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

Parameters
idint

Internal unique identifier.

setVisibility(self, visible)

Accessor to the object’s visibility state.

Parameters
visiblebool

Visibility flag.