PointWithDescription¶

class
PointWithDescription
(*args)¶ Collection of real values with a description for each component.
 Available constructors:
PointWithDescription(size=0, value=0.0)
PointWithDescription(sequence)
 Parameters
 sizeint,
Size of the vector.
 valuefloat
Value set to the size elements.
 sequencesequence of pair (string, float)
Components of the vector.
Examples
>>> import openturns as ot
Use the first constructor:
>>> print(ot.PointWithDescription(2)) [ : 0, : 0] >>> vector = ot.PointWithDescription(2, 3.0) >>> print(vector) [ : 3, : 3] >>> vector.setDescription(['c1', 'c2']) >>> print(vector) [c1 : 3, c2 : 3]
Use the second constructor:
>>> vector = ot.PointWithDescription([('C1', 2.0), ('C2', 3.0), ('C3', 4.5)]) >>> print(vector) [C1 : 2, C2 : 3, C3 : 4.5] >>> print(vector.getDescription()) [C1,C2,C3]
Use some functionalities:
>>> vector[1] = 7.1 >>> print(vector) [C1 : 2, C2 : 7.1, C3 : 4.5] >>> vector.add(6.2) >>> print(vector) [C1 : 2, C2 : 7.1, C3 : 4.5, : 6.2]
Methods
add
(self, \*args)Append a component (inplace).
at
(self, \*args)Access to an element of the collection.
clear
(self)Reset the collection to zero dimension.
dot
(self, rhs)Compute the scalar product.
getClassName
(self)Accessor to the object’s name.
getDescription
(self)Accessor to the componentwise description.
getDimension
(self)Accessor to the vector’s dimension.
getId
(self)Accessor to the object’s id.
getName
(self)Accessor to the object’s name.
getShadowedId
(self)Accessor to the object’s shadowed id.
getSize
(self)Accessor to the vector’s dimension (or size).
getVisibility
(self)Accessor to the object’s visibility state.
hasName
(self)Test if the object is named.
hasVisibleName
(self)Test if the object has a distinguishable name.
isDecreasing
(self)Check if the components are in decreasing order.
isEmpty
(self)Tell if the collection is empty.
isIncreasing
(self)Check if the components are in increasing order.
isMonotonic
(self)Check if the components are in nonincreasing or nondecreasing order.
isNonDecreasing
(self)Check if the components are in nondecreasing order.
isNonIncreasing
(self)Check if the components are in nonincreasing order.
norm
(self)Compute the Euclidean () norm.
norm1
(self)Compute the norm.
normInf
(self)Compute the norm.
normSquare
(self)Compute the squared Euclidean norm.
normalize
(self)Compute the normalized vector with respect to its Euclidean norm.
normalizeSquare
(self)Compute the normalized vector with respect to its squared Euclidean norm.
resize
(self, newSize)Change the size of the collection.
setDescription
(self, description)Accessor to the componentwise description.
setName
(self, name)Accessor to the object’s name.
setShadowedId
(self, id)Accessor to the object’s shadowed id.
setVisibility
(self, visible)Accessor to the object’s visibility state.
clean

__init__
(self, *args)¶ Initialize self. See help(type(self)) for accurate signature.

add
(self, *args)¶ Append a component (inplace).
 Parameters
 valuetype depends on the type of the collection.
The component to append.
Examples
>>> import openturns as ot >>> x = ot.Point(2) >>> x.add(1.) >>> print(x) [0,0,1]

at
(self, *args)¶ Access to an element of the collection.
 Parameters
 indexpositive int
Position of the element to access.
 Returns
 elementtype depends on the type of the collection
Element of the collection at the position index.

clear
(self)¶ Reset the collection to zero dimension.
Examples
>>> import openturns as ot >>> x = ot.Point(2) >>> x.clear() >>> x class=Point name=Unnamed dimension=0 values=[]

dot
(self, rhs)¶ Compute the scalar product.
 Parameters
 pointsequence of float
Scalar product second argument
 Returns
 dotfloat
Scalar product
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> prod = x.dot([4, 5, 6])

getClassName
(self)¶ Accessor to the object’s name.
 Returns
 class_namestr
The object class name (object.__class__.__name__).

getDescription
(self)¶ Accessor to the componentwise description.
 Returns
 description
Description
Description of the components.
 description
See also

getDimension
(self)¶ Accessor to the vector’s dimension.
 Returns
 nint
The number of components in the vector.

getId
(self)¶ Accessor to the object’s id.
 Returns
 idint
Internal unique identifier.

getName
(self)¶ Accessor to the object’s name.
 Returns
 namestr
The name of the object.

getShadowedId
(self)¶ Accessor to the object’s shadowed id.
 Returns
 idint
Internal unique identifier.

getSize
(self)¶ Accessor to the vector’s dimension (or size).
 Returns
 nint
The number of components in the vector.

getVisibility
(self)¶ Accessor to the object’s visibility state.
 Returns
 visiblebool
Visibility flag.

hasName
(self)¶ Test if the object is named.
 Returns
 hasNamebool
True if the name is not empty.

hasVisibleName
(self)¶ Test if the object has a distinguishable name.
 Returns
 hasVisibleNamebool
True if the name is not empty and not the default one.

isDecreasing
(self)¶ Check if the components are in decreasing order.
Examples
>>> import openturns as ot >>> x = ot.Point([3.0, 2.0, 1.0]) >>> x.isDecreasing() True >>> x = ot.Point([3.0, 3.0, 1.0]) >>> x.isDecreasing() False >>> x = ot.Point([1.0, 3.0, 2.0]) >>> x.isIncreasing() False

isEmpty
(self)¶ Tell if the collection is empty.
 Returns
 isEmptybool
True if there is no element in the collection.
Examples
>>> import openturns as ot >>> x = ot.Point(2) >>> x.isEmpty() False >>> x.clear() >>> x.isEmpty() True

isIncreasing
(self)¶ Check if the components are in increasing order.
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> x.isIncreasing() True >>> x = ot.Point([1.0, 1.0, 3.0]) >>> x.isIncreasing() False >>> x = ot.Point([1.0, 3.0, 2.0]) >>> x.isIncreasing() False

isMonotonic
(self)¶ Check if the components are in nonincreasing or nondecreasing order.
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> x.isMonotonic() True >>> x = ot.Point([2.0, 2.0, 1.0]) >>> x.isMonotonic() True >>> x = ot.Point([1.0, 3.0, 2.0]) >>> x.isMonotonic() False

isNonDecreasing
(self)¶ Check if the components are in nondecreasing order.
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> x.isNonDecreasing() True >>> x = ot.Point([1.0, 1.0, 3.0]) >>> x.isNonDecreasing() True >>> x = ot.Point([1.0, 3.0, 2.0]) >>> x.isNonDecreasing() False

isNonIncreasing
(self)¶ Check if the components are in nonincreasing order.
Examples
>>> import openturns as ot >>> x = ot.Point([3.0, 2.0, 1.0]) >>> x.isNonIncreasing() True >>> x = ot.Point([3.0, 3.0, 1.0]) >>> x.isNonIncreasing() True >>> x = ot.Point([1.0, 3.0, 2.0]) >>> x.isNonIncreasing() False

norm
(self)¶ Compute the Euclidean () norm.
The Euclidean () norm of a vector is defined as:
 Returns
 normfloat
The vector’s Euclidean norm.
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> x.norm() 3.741657...

norm1
(self)¶ Compute the norm.
The norm of a vector is defined as:
 Returns
 normfloat
The vector’s norm.
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> x.norm1() 6.0

normInf
(self)¶ Compute the norm.
The norm of a vector is defined as:
 Returns
 normfloat
The vector’s norm.
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> x.normInf() 3.0

normSquare
(self)¶ Compute the squared Euclidean norm.
 Returns
 normfloat
The vector’s squared Euclidean norm.
See also
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> x.normSquare() 14.0

normalize
(self)¶ Compute the normalized vector with respect to its Euclidean norm.
 Returns
 normalized_vector
Point
The normalized vector with respect to its Euclidean norm.
 normalized_vector
 Raises
 RuntimeErrorIf the Euclidean norm is zero.
See also
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> print(x.normalize()) [0.267261,0.534522,0.801784]

normalizeSquare
(self)¶ Compute the normalized vector with respect to its squared Euclidean norm.
 Returns
 normalized_vectornormalized_vector
The normalized vector with respect to its squared Euclidean norm.
 Raises
 RuntimeErrorIf the squared Euclidean norm is zero.
See also
Examples
>>> import openturns as ot >>> x = ot.Point([1.0, 2.0, 3.0]) >>> print(x.normalizeSquare()) [0.0714286,0.285714,0.642857]

resize
(self, newSize)¶ Change the size of the collection.
 Parameters
 newSizepositive int
New size of the collection.
Notes
If the new size is smaller than the older one, the last elements are thrown away, else the new elements are set to the default value of the element type.
Examples
>>> import openturns as ot >>> x = ot.Point(2, 4) >>> print(x) [4,4] >>> x.resize(1) >>> print(x) [4] >>> x.resize(4) >>> print(x) [4,0,0,0]

setDescription
(self, description)¶ Accessor to the componentwise description.
 Parameters
 descriptionsequence of str
Description of the components.

setName
(self, name)¶ Accessor to the object’s name.
 Parameters
 namestr
The name of the object.

setShadowedId
(self, id)¶ Accessor to the object’s shadowed id.
 Parameters
 idint
Internal unique identifier.

setVisibility
(self, visible)¶ Accessor to the object’s visibility state.
 Parameters
 visiblebool
Visibility flag.