eigen 3.3 SparseMatrix<bool> operations -
i perform operations using eigen::sparsematrix<bool> without having loop matrices myself. used possible in eigen 3.2 code no longer compiles in version 3.3. instance, following code worked fine in 3.2:
eigen::sparsematrix<bool> a(3,3), b(3,3), c(3,3); = b + c; is there easy/short way of doing "and" , "or" operations in eigen 3.3 without writing loops?
to consistent c++ standard behavior, adding boolean matrices returns integer expressions, @ same time, because of ambiguity adding boolean matrices deprecated. dense matrices, have access operators || , && purpose, , these have added sparse matrices (for 3.3.1).
meanwhile, can still workaround casting result bool (and ignore deprecated warning):
a = (b+c).cast<bool>();
Comments
Post a Comment