NormInfEnumerateFunction¶
- class NormInfEnumerateFunction(*args)¶
Infinite norm enumerate function.
- Parameters:
- diminteger, default=1
Dimension of the
EnumerateFunction
. dim must be equal to the dimension of theOrthogonalBasis
.
See also
Notes
One defines the infinity norm of a multi-index by:
This would lead to first select the basis polynomials depending on a specific subset of input variables.
Examples
>>> import openturns as ot >>> # 2-dimensional case >>> enumerateFunction = ot.NormInfEnumerateFunction(2) >>> for i in range(10): ... print(enumerateFunction(i)) [0,0] [1,0] [0,1] [1,1] [2,0] [2,1] [0,2] [1,2] [2,2] [3,0]
Methods
__call__
(index)Call self as a function.
getBasisSizeFromTotalDegree
(maximumDegree)Get the basis size corresponding to a total degree.
Accessor to the object's name.
Return the dimension of the EnumerateFunction.
getId
()Accessor to the object's id.
getMaximumDegreeCardinal
(maximumDegree)Get the number of terms of total degree below a threshold.
getMaximumDegreeStrataIndex
(maximumDegree)Get the largest index of the strata containing terms of maximum degree.
getName
()Accessor to the object's name.
Accessor to the object's shadowed id.
getStrataCardinal
(strataIndex)Get the number of terms in the basis inside a given strata.
getStrataCumulatedCardinal
(strataIndex)Get the number of terms in the basis inside a range of stratas.
Accessor to the upper bound.
Accessor to the object's visibility state.
hasName
()Test if the object is named.
Test if the object has a distinguishable name.
inverse
(indices)Get the antecedent of a indices list in the EnumerateFunction.
setDimension
(dimension)Set the dimension of the EnumerateFunction.
setName
(name)Accessor to the object's name.
setShadowedId
(id)Accessor to the object's shadowed id.
setUpperBound
(upperBound)Accessor to the upper bound.
setVisibility
(visible)Accessor to the object's visibility state.
- __init__(*args)¶
- getBasisSizeFromTotalDegree(maximumDegree)¶
Get the basis size corresponding to a total degree.
- Parameters:
- max_degint
Maximum total degree.
- Returns:
- sizeint
Number of terms in the basis of total degree .
Notes
In the specific context of a linear enumeration (
LinearEnumerateFunction
) this is also the cumulated cardinal of stratas up to max_deg.Examples
>>> import openturns as ot >>> dim = 2 >>> enum_func = ot.LinearEnumerateFunction(dim) >>> enum_func.getBasisSizeFromTotalDegree(3) 10 >>> enum_func.getStrataCumulatedCardinal(3) 10
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getDimension()¶
Return the dimension of the EnumerateFunction.
- Returns:
- dimint,
Dimension of the EnumerateFunction.
- getId()¶
Accessor to the object’s id.
- Returns:
- idint
Internal unique identifier.
- getMaximumDegreeCardinal(maximumDegree)¶
Get the number of terms of total degree below a threshold.
- Parameters:
- max_degint
Maximum total degree.
- Returns:
- cardinalint
Number of terms in the basis of total degree .
Notes
In the specific context of a linear enumeration (
LinearEnumerateFunction
) this is also the cumulated cardinal of stratas of index .Examples
>>> import openturns as ot >>> dim = 2 >>> enum_func = ot.LinearEnumerateFunction(dim) >>> enum_func.getMaximumDegreeCardinal(2) 6
- getMaximumDegreeStrataIndex(maximumDegree)¶
Get the largest index of the strata containing terms of maximum degree.
- Parameters:
- max_degint
Maximum total degree.
- Returns:
- indexint
Index of the last strata that contains terms of total degree .
Notes
In the specific context of a linear enumeration (
LinearEnumerateFunction
) this is the strata of index max_deg.Examples
>>> import openturns as ot >>> dim = 2 >>> enum_func = ot.LinearEnumerateFunction(dim) >>> enum_func.getMaximumDegreeStrataIndex(2) 2
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getShadowedId()¶
Accessor to the object’s shadowed id.
- Returns:
- idint
Internal unique identifier.
- getStrataCardinal(strataIndex)¶
Get the number of terms in the basis inside a given strata.
- Parameters:
- strataIndexint
Index of the strata of the tensorized basis.
- Returns:
- cardinalint
Number of terms in the basis inside the strata strataIndex.
Notes
In the specific context of a linear enumeration (
LinearEnumerateFunction
) the strata strataIndex consists of a hyperplane of all the terms of total degree strataIndex, and its cardinal is strataIndex + 1.Examples
>>> import openturns as ot >>> dim = 2 >>> enum_func = ot.LinearEnumerateFunction(dim) >>> enum_func.getStrataCardinal(2) 3
- getStrataCumulatedCardinal(strataIndex)¶
Get the number of terms in the basis inside a range of stratas.
- Parameters:
- strataIndexint
Index of the strata of the tensorized basis.
- Returns:
- cardinalint
Number of terms in the basis inside the stratas of index lower of equal to strataIndex.
Notes
The number of terms is the total of terms inside each consecutive stratas. In the specific context of a linear enumeration (
LinearEnumerateFunction
) this returns the number of terms of maximal total degree strataIndex.Examples
>>> import openturns as ot >>> dim = 2 >>> enum_func = ot.LinearEnumerateFunction(dim) >>> enum_func.getStrataCumulatedCardinal(2) 6 >>> sum([enum_func.getStrataCardinal(i) for i in range(3)]) 6
- getUpperBound()¶
Accessor to the upper bound.
- Returns:
- ubsequence of int
Upper bound of the indices (inclusive).
- getVisibility()¶
Accessor to the object’s visibility state.
- Returns:
- visiblebool
Visibility flag.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- hasVisibleName()¶
Test if the object has a distinguishable name.
- Returns:
- hasVisibleNamebool
True if the name is not empty and not the default one.
- inverse(indices)¶
Get the antecedent of a indices list in the EnumerateFunction.
- Parameters:
- multiIndexsequence of int
List of indices.
- Returns:
- antecedentint
Represents the antecedent of the multiIndex in the EnumerateFunction.
Examples
>>> import openturns as ot >>> dim = 2 >>> enum_func = ot.LinearEnumerateFunction(dim) >>> for i in range(6): ... print(str(i)+' '+str(enum_func(i))) 0 [0,0] 1 [1,0] 2 [0,1] 3 [2,0] 4 [1,1] 5 [0,2] >>> print(enum_func.inverse([1,1])) 4
- setDimension(dimension)¶
Set the dimension of the EnumerateFunction.
- Parameters:
- dimint,
Dimension of the EnumerateFunction.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setShadowedId(id)¶
Accessor to the object’s shadowed id.
- Parameters:
- idint
Internal unique identifier.
- setUpperBound(upperBound)¶
Accessor to the upper bound.
- Parameters:
- ubsequence of int
Upper bound of the indices (inclusive).
- setVisibility(visible)¶
Accessor to the object’s visibility state.
- Parameters:
- visiblebool
Visibility flag.