Consider two empty matrices as equal.

This commit is contained in:
sebcrozet 2018-10-13 11:32:49 +02:00 committed by Sébastien Crozet
parent 54747817b2
commit a68937990b
1 changed files with 5 additions and 1 deletions

View File

@ -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)