UniVariateFunction¶
-
class
UniVariateFunction
(*args)¶ Base class for univariate functions.
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.
getImplementation
(self)Accessor to the underlying implementation.
getName
(self)Accessor to the object’s name.
gradient
(self, x)Compute the gradient at point .
hessian
(self, x)Compute the hessian at point .
setName
(self, name)Accessor to the object’s name.
-
__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,
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.
-
getImplementation
(self)¶ Accessor to the underlying implementation.
- Returns
- implImplementation
The implementation class.
-
getName
(self)¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
gradient
(self, x)¶ Compute the gradient at point .
- Returns
- gradientfloat
The value of the function’s first-order derivative at point .
Examples
>>> import openturns as ot >>> P = ot.UniVariatePolynomial([1.0, 2.0, 3.0]) >>> print(P.gradient(1.0)) 8.0
-
hessian
(self, x)¶ Compute the hessian at point .
- Parameters
- xfloat
Input value.
- Returns
- hessianfloat
The value of the function’s second-order derivative at point .
-
setName
(self, name)¶ Accessor to the object’s name.
- Parameters
- namestr
The name of the object.
-