valvector_condexp

View page source

The 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 ] )
            result [ i ] = if_true [ i ]
      else
            result [ i ] = if_false [ i ]

where the relational Rel and the operator op have the following correspondence:

Rel

Lt

Le

Eq

Ge

Gt

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.