Blaze  3.6
Logical AND


Vector/Vector Logical AND


Via the logical AND operator (i.e. operator&&()) it is possible to compute an elementwise logical AND with dense vectors:

// ... Initializing the vectors
v3 = v1 && v2; // Elementwise logical AND 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 AND a column vector and a row vector
v1 && trans( v2 ); // OK: Logical AND of two column vectors


Matrix/Matrix Logical AND


The logical AND operator (i.e. operator&&()) can also be used to compute an elementwise logical AND with dense matrices:

// ... Initializing the matrices
M3 = M1 && M2; // Elementwise logical AND 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 NOT     Next: Logical OR