UniVariateFunction

class UniVariateFunction(*args)

Base class for univariate functions.

Methods

__call__(x)
draw(xMin, xMax, pointNumber) Draw the function.
getClassName() Accessor to the object’s name.
getId() Accessor to the object’s id.
getImplementation(*args) Accessor to the underlying implementation.
getName() Accessor to the object’s name.
gradient(x) Compute the gradient at point x.
hessian(x) Compute the hessian at point x.
setName(name) Accessor to the object’s name.
__init__(*args)
draw(xMin, xMax, pointNumber)

Draw the function.

Parameters:

x_min : float, optional

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

x_max : float, optional, x_{\max} > x_{\min}

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

n_points : int, 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_name : str

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

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getImplementation(*args)

Accessor to the underlying implementation.

Returns:

impl : Implementation

The implementation class.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

gradient(x)

Compute the gradient at point x.

Returns:

gradient : float

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

Examples

>>> import openturns as ot
>>> P = ot.UniVariatePolynomial([1.0, 2.0, 3.0])
>>> print(P.gradient(1.0))
8.0
hessian(x)

Compute the hessian at point x.

Parameters:

x : float

Input value.

Returns:

hessian : float

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

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.