IterativeExtrema¶
- class IterativeExtrema(dimension=1)¶
Iterative minimum and maximum.
- Parameters:
- dimensionint
Dimension of the input data
See also
Notes
This class iteratively computes the minimum and maximum over an iteratively increasing dataset without storing any data in memory.
Examples
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> dim = 5 >>> myExtrema = ot.IterativeExtrema(dim) >>> n = ot.Normal(dim) >>> size = 50
Increment the data one point at a time:
>>> for i in range(size): ... point = n.getRealization() ... myExtrema.increment(point) >>> print(myExtrema.getIterationNumber()) 50 >>> print(myExtrema.getMin()) [-2.4067,-2.53986,-2.29006,-3.09737,-2.18139] >>> print(myExtrema.getMax()) [3.01263,3.02799,1.85579,2.11968,1.36783]
Increment with 50 additional points simultaneously and recompute the extrema:
>>> sample = n.getSample(size) >>> myExtrema.increment(sample) >>> print(myExtrema.getIterationNumber()) 100 >>> print(myExtrema.getMin()) [-2.4067,-2.53986,-2.72106,-3.09737,-2.18139] >>> print(myExtrema.getMax()) [3.01263,3.02799,2.24097,2.11968,2.55533]
Methods
Accessor to the object's name.
Get the dimension of the algorithm
Get the current iteration of the algorithm
getMax
()Returns the values of the maximum over the inputs component per component
getMin
()Returns the values of the minimum over the inputs component per component
getName
()Accessor to the object's name.
hasName
()Test if the object is named.
increment
(*args)Increment the internal data.
setName
(name)Accessor to the object's name.
- __init__(dimension=1)¶
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getDimension()¶
Get the dimension of the algorithm
- Returns:
- dimensionint
Dimension of the algorithm
- getIterationNumber()¶
Get the current iteration of the algorithm
- Returns:
- iterationint
Current iteration of the algorithm
- getMax()¶
Returns the values of the maximum over the inputs component per component
- Returns:
- max
Point
current values of the iterative maximum.
- max
- getMin()¶
Returns the values of the minimum over the inputs component per component
- Returns:
- min
Point
current values of the iterative minimum.
- min
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- increment(*args)¶
Increment the internal data.
- Parameters:
- datasequence of float or 2-d sequence of float
New input point or sample.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.