Basis

class Basis(*args)

Basis.

Available constructors:

Basis(functionsColl)

Basis(size)

Parameters
functionsColllist of Function

Functions constituting the Basis.

sizeint

Size of the Basis.

Examples

>>> import openturns as ot
>>> dimension = 3
>>> input = ['x0', 'x1', 'x2']
>>> functions = []
>>> for i in range(dimension):
...     functions.append(ot.SymbolicFunction(input, [input[i]]))
>>> basis = ot.Basis(functions)

Methods

build(self, index)

Build the element of the given index.

getClassName(self)

Accessor to the object’s name.

getDimension(self)

Get the dimension of the Basis.

getId(self)

Accessor to the object’s id.

getImplementation(self)

Accessor to the underlying implementation.

getName(self)

Accessor to the object’s name.

getSize(self)

Get the size of the Basis.

getSubBasis(self, indices)

Get a sub-basis of the Basis.

isFinite(self)

Tell whether the basis is finite.

isOrthogonal(self)

Tell whether the basis is orthogonal.

setName(self, name)

Accessor to the object’s name.

add

__init__(self, \*args)

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

build(self, index)

Build the element of the given index.

Parameters
indexint, index \geq 0

Index of an element of the Basis.

Returns
functionFunction

The function at the index index of the Basis.

Examples

>>> import openturns as ot
>>> dimension = 3
>>> input = ['x0', 'x1', 'x2']
>>> functions = []
>>> for i in range(dimension):
...     functions.append(ot.SymbolicFunction(input, [input[i]]))
>>> basis = ot.Basis(functions)
>>> print(basis.build(0).getEvaluation())
[x0,x1,x2]->[x0]
getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

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

getDimension(self)

Get the dimension of the Basis.

Returns
dimensionint

Dimension of the Basis.

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.

getSize(self)

Get the size of the Basis.

Returns
sizeint

Size of the Basis.

getSubBasis(self, indices)

Get a sub-basis of the Basis.

Parameters
indiceslist of int

Indices of the terms of the Basis put in the sub-basis.

Returns
subBasislist of Function

Functions defining a sub-basis.

Examples

>>> import openturns as ot
>>> dimension = 3
>>> input = ['x0', 'x1', 'x2']
>>> functions = []
>>> for i in range(dimension):
...     functions.append(ot.SymbolicFunction(input, [input[i]]))
>>> basis = ot.Basis(functions)
>>> subbasis = basis.getSubBasis([1])
>>> print(subbasis[0].getEvaluation())
[x0,x1,x2]->[x1]
isFinite(self)

Tell whether the basis is finite.

Returns
isFinitebool

True if the basis is finite.

isOrthogonal(self)

Tell whether the basis is orthogonal.

Returns
isOrthogonalbool

True if the basis is orthogonal.

setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.