From 27796c82d05441114ce373c0f5c971f9cde7c756 Mon Sep 17 00:00:00 2001 From: Kazem Date: Sat, 6 Jun 2020 13:25:02 -0400 Subject: [PATCH] WIP: fixing bounded to smp --- def.h | 8 ++++++++ sparse_utilities.h | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/def.h b/def.h index 4ddbc61..90b0a1b 100644 --- a/def.h +++ b/def.h @@ -184,6 +184,10 @@ } bool equality_check(const CSC* in_c){ + if(!in_c && (n == 0 || m == 0)) + return true; + if(!in_c && !(n == 0 || m == 0)) + return false; if(n != in_c->n || m != in_c->m || nnz != in_c->nnz) return false; for (int j = 0; j < n+1; ++j) { @@ -338,6 +342,10 @@ } bool equality_check(const Dense *in_d){ + if(!in_d && (row == 0 || col == 0)) + return true; + if(!in_d && !(row == 0 || col == 0)) + return false; if(row != in_d->row || col != in_d->col || lda != in_d->lda) return false; for (int i = 0; i < row * col; ++i) { diff --git a/sparse_utilities.h b/sparse_utilities.h index d7b7d1a..be7e060 100644 --- a/sparse_utilities.h +++ b/sparse_utilities.h @@ -657,12 +657,8 @@ namespace sym_lib { template bool are_equal(T *m1, T *m2){ if( m1 == NULLPNTR && m2 == NULLPNTR) return true; - if( m1 == NULLPNTR || m2 == NULLPNTR) - return false; - return m1->equality_check(m2); + return m1 ? m1->equality_check(m2) : m2->equality_check(m1); } - - }