Consider two empty matrices as equal.
This commit is contained in:
parent
54747817b2
commit
a68937990b
@ -894,10 +894,14 @@ where
|
||||
{
|
||||
#[inline]
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
if self.shape() != other.shape() || self.nrows() == 0 || self.ncols() == 0 {
|
||||
if self.shape() != other.shape() {
|
||||
return None;
|
||||
}
|
||||
|
||||
if self.nrows() == 0 || self.ncols() == 0 {
|
||||
return Some(Ordering::Equal);
|
||||
}
|
||||
|
||||
let mut first_ord = unsafe {
|
||||
self.data
|
||||
.get_unchecked_linear(0)
|
||||
|
Loading…
Reference in New Issue
Block a user