Search code examples
c++eigeneigen3

Does Eigen sparse boolean matrix stores nonzero values?


Does Eigen3 sparse boolean matrix store the value of the boolean? If that is the case, the nonzero entries are all 1.


Solution

  • Yes, and there is currently no special optimization for boolean scalar type. For instance, one can explicitly store an entry equals to false, just like one can insert explicit zeros within a SparseMatrix<double>.