dimforge / dimforge/nalgebra

Possible incorrect constraint in Matrix::zip_zip_apply()

Open
#1,114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

The [zip_zip_apply()](https://github.com/dimforge/nalgebra/blob/b656faa233bccc7c201396dd1348d2bebd88b3b8/src/base/matrix.rs#L996) method of Matrix has a duplicated constraint in its where clause:
```
ShapeConstraint: SameNumberOfRows + SameNumberOfColumns,
ShapeConstraint: SameNumberOfRows + SameNumberOfColumns,
```
Given that the zip_apply() method has that same constraint, and the zip_zip_apply() method also has type parameters of `R3` and `C3` it seems likely that those constraints should instead be:
```
ShapeConstraint: SameNumberOfRows + SameNumberOfColumns,
ShapeConstraint: SameNumberOfRows + SameNumberOfColumns,
```
While I am not entirely sure how these constraints are being applied, it appears that this would mean that all of the matrices involved would need to have the same dimension, rather than just the first argument and method receiver. Such a requirement would match with the use of ShapeConstraint for the zip_apply() method (assuming I correctly understood how the constraints worked).

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.