Blaze  3.6
Logical OR


Vector/Vector Logical OR


Via the logical OR operator (i.e. operator||()) it is possible to perform an elementwise logical OR with dense vectors:

// ... Initializing the vectors
v3 = v1 || v2; // Elementwise logical OR of two dense column vectors

Note that it is necessary that both operands have exactly the same dimensions. Violating this precondition results in an exception. Also note that it is only possible to use vectors with the same transpose flag:

v1 || v2; // Compilation error: Cannot OR a column vector and a row vector
v1 || trans( v2 ); // OK: Logical OR of two column vectors


Matrix/Matrix Logical OR


The logical OR operator (i.e. operator||()) can also be used to perform an elementwise logical OR with dense matrices:

// ... Initializing the matrices
M3 = M1 || M2; // Elementwise logical OR of two dense matrices

Note that it is necessary that both operands have exactly the same dimensions. Violating this precondition results in an exception. It is possible to use any combination of row-major and column-major matrices. Note however that in favor of performance using two matrices with the same storage order is favorable.


Previous: Logical AND     Next: Shared Memory Parallelization