Blaze 3.9
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
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223

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
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
constexpr bool columnVector
Transpose flag for column vectors.
Definition: TransposeFlag.h:58
constexpr bool rowVector
Transpose flag for row vectors.
Definition: TransposeFlag.h:73


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
Efficient implementation of a dynamic matrix.
Definition: DynamicMatrix.h:242
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99

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