dimforge / dimforge/nalgebra

Implement some operators for boolean matrices

Open
#832 2 comments 0 reactions 0 assignees View on GitHub
enhancement need community feedback
Dominant language
Rust
Stars
4.8k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

Today I wanted to do some logical operations on matrices of booleans. Ideally, it would be as simple as calling `m1 | m2 & m3` for example. My concrete use case is building the union of masks and I'm currently doing the following (with some additional asserts on sizes):
```rust
/// Merge multiple sparse matrices into one combining all sparsely selected pixels.
pub fn merge(matrices: &[DMatrix]) -> DMatrix {
let mut merged = matrices[0].clone();
for mat in matrices.iter().skip(1) {
for (b_merged, b) in merged.iter_mut().zip(mat) {
*b_merged |= b;
}
}
merged
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.