MonomialFunction¶
- class MonomialFunction(*args)¶
Monomial function class.
- Parameters:
- degreint
Degree of the monomial function
Methods
draw
(xMin, xMax, pointNumber)Draw the function.
Accessor to the object's name.
getName
()Accessor to the object's name.
gradient
(x)Compute the gradient at point .
hasName
()Test if the object is named.
hessian
(x)Compute the hessian at point .
setName
(name)Accessor to the object's name.
Notes
The monomial function defines as :
Examples
Create a standard absolute exponential covariance function:
>>> import openturns as ot >>> P = ot.MonomialFunction(3)
- __init__(*args)¶
- draw(xMin, xMax, pointNumber)¶
Draw the function.
- Parameters:
- x_minfloat, optional
The starting value that is used for meshing the x-axis.
- x_maxfloat, optional,
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()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- gradient(x)¶
Compute the gradient at point .
- Returns:
- gradientfloat
The value of the monomial’s first-order derivative at point .
Examples
>>> import openturns as ot >>> P = ot.MonomialFunction(3) >>> print(P.gradient(1.0)) 3.0
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- hessian(x)¶
Compute the hessian at point .
- Parameters:
- xfloat
Input value.
- Returns:
- hessianfloat
The value of the monomial’s second-order derivative at point .
Examples
>>> import openturns as ot >>> P = ot.MonomialFunction(3) >>> print(P.hessian(1.0)) 6.0
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.