return early if there are no non-zero elements
This commit is contained in:
@@ -1408,6 +1408,8 @@ accu(const SpOp<T1, spop_square>& expr)
|
||||
{
|
||||
const SpSubview_col<eT>& svcol = reinterpret_cast<const SpSubview_col<eT>&>(expr.m);
|
||||
|
||||
if(svcol.n_nonzero == 0) { return eT(0); }
|
||||
|
||||
if(svcol.n_rows == svcol.m.n_rows)
|
||||
{
|
||||
arma_debug_print("accu(): SpSubview_col spop_square optimisation");
|
||||
@@ -1460,6 +1462,8 @@ accu_spop_omit_helper(const T1& expr, functor is_omitted)
|
||||
{
|
||||
const SpSubview_col<eT>& svcol = reinterpret_cast<const SpSubview_col<eT>&>(expr);
|
||||
|
||||
if(svcol.n_nonzero == 0) { return eT(0); }
|
||||
|
||||
if(svcol.n_rows == svcol.m.n_rows)
|
||||
{
|
||||
arma_debug_print("accu_spop_omit_helper(): SpSubview_col optimisation");
|
||||
|
||||
Reference in New Issue
Block a user