I.6.3 Dyadic functions for new Result creation
In section I.4.4, one defines functions that allow the creation of new Result objects from existing
ones. Here, one present short-cuts to some of these functions (for the following functions, x, y and z
are Result objects):
- z=Post.pow(x,y) is generally equivalent to “z=x.deriveDyadic("pow",y)”. But the “pow”
method defined in “Post” module also allows to replace the first “x” operand by a Real
value. However, at least one of the two arguments must be a Result object.
- z=Post.atan2(x,y) is generally equivalent to “z=x.deriveDyadic("atan2",y)”. But the
“atan2” method defined in “Post” module also allows to replace the first “x” operand by
a Real value. However, at least one of the two arguments must be a Result object.
- z=Post.vectProduct(x,y) is generally equivalent to “z=x.deriveDyadic("vectProduct",y)”.
However the first argument can be replaced by a vector (Array of three real elements).
However, at least one of the two arguments must be a Result object.
- z=Post.sumVectProduct(x,y) is equivalent to “z=x.deriveDyadic("sumVectProduct",y)”.
Also other functions that have no correspondence in Result class methods can be used to define new
Results
- z=Post.min(x,y) returns a Result build by selecting the minimum values of x and y. The
method works with scalar, vectorial or tensorial results. Either x or y can be replaced by
a Real value.
- z=Post.max(x,y) returns a Result build by selecting the maximum values of x and y. The
method works with scalar, vectorial or tensorial results. Either x or y can be replaced by
a Real value.
- z=Post.cmp(x,y) returns a Result build by setting the corresponding values to -1 if x<y,
0 if x==y and 1 if x>y. Both results must be scalar. Either of the two Results can be
replaced by a real argument.
- z=Post.mergeKeepFirst(x,y) returns a Result build by merging the two arguments. When
a key is present in the two argument Results, the values extracted from the first Result
are kept.
- z=Post.merge(x,y) is identical to z=Post.mergeKeepFirst(x,y).
- z=Post.mergeKeepLast(x,y) returns a Result build by merging the two arguments. When
a key is present in the two argument Results, the values extracted from the second Result
are kept.
Most of the dyadic functions insert a pair “key-value” in the created Result only if the corresponding key
is found in the two Result arguments. “Post.min”, “Post.max” and the ‘Post.merge” methods are an
exception: if a given key is found in only one of the two argument it is inserted in the new
Result.