Fix bug - PartialEq for Matrix no longer panics when shapes do not match
This commit is contained in:
parent
39a433c0e7
commit
2b8410e08b
|
@ -1350,12 +1350,11 @@ where
|
||||||
S: Storage<N, R, C>,
|
S: Storage<N, R, C>,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, right: &Matrix<N, R, C, S>) -> bool {
|
fn eq(&self, right: &Matrix<N, R2, C2, S2>) -> bool {
|
||||||
assert!(
|
if self.shape() == right.shape() {
|
||||||
self.shape() == right.shape(),
|
return self.iter().zip(right.iter()).all(|(l, r)| l == r)
|
||||||
"Matrix equality test dimension mismatch."
|
}
|
||||||
);
|
false
|
||||||
self.iter().zip(right.iter()).all(|(l, r)| l == r)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue