Logical Operators: Short-circuit

From Jacket Wiki

Jump to: navigation, search
Back to Function List

Logical operations, with short-circuiting capability

Usage

Jacket for M Language
    Supported Syntax
    
expr1 && expr2
expr1 || expr2
    

GFOR Supported

No

GCOMPILE Supported

No

Types Supported

-  GDOUBLE   GSINGLE   GLOGICAL   GINT32   GINT8   GUINT32   GUINT8   COMPLEX 

Types Not Supported

-

CPU usageJacket only contains GPU computing functions. To run functions on the CPU, try one of the MathWorks products:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/logicaloperatorsshortcircuit.html
More Details

To implement short-circuit semantics, these operators pull data back to the host to check. This also breaks GFOR and you'll see a warning ("Warning: Only storing result from first GFOR iteration..."). To avoid this, it is best to change these to their non-short-circuit versions ("&" and "


See Also

ALL, ANY, FIND, LOGICAL, XOR, TRUE, FALSE, Logical Operators: Elementwise & | ~, Relational Operators < > <= >= == ~=

Views
Personal tools