\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)
valvector_condexp¶
View page sourceThe valvector Conditional Expressions¶
Computes element-by-element CondExp values where the arguments are valvectors.
Syntax¶
result = CondExp
Rel ( left , right , if_true , if_false )
Discussion¶
For each valid index i , this computes the result
if
( left [ i ] op right [ i ] )else
where the relational Rel and the operator op have the following correspondence:
Rel |
|
|
|
|
|
op |
< |
<= |
== |
>= |
> |
Arguments¶
All of the argument are const
valvectors.
result¶
The result has size equal to the maximum of the size of left , right , if_true and if_false . The size of each argument must be one, or the same as the size of result.
Example¶
The file valvector_condexp.cpp is an example and test of the valvector conditional expressions.