InternalType* or_M_M<SparseBool, SparseBool, SparseBool>(SparseBool* _pL, SparseBool* _pR) { SparseBool* pOut = NULL; if (_pL->isScalar()) { if (_pL->get(0, 0)) { pOut = new SparseBool(_pR->getRows(), _pR->getCols()); int iCols = pOut->getCols(); int iRows = pOut->getRows(); for (int i = 0 ; i < iRows ; i++) { for (int j = 0 ; j < iCols ; j++) { pOut->set(i, j, true, false); } } pOut->finalize(); } else { pOut = _pR; } return pOut; } if (_pR->isScalar()) { if (_pR->get(0, 0)) { pOut = new SparseBool(_pL->getRows(), _pL->getCols()); int iCols = pOut->getCols(); int iRows = pOut->getRows(); for (int i = 0 ; i < iRows ; i++) { for (int j = 0 ; j < iCols ; j++) { pOut->set(i, j, true, false); } } pOut->finalize(); } else { pOut = _pL; } return pOut; } if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols()) { throw ast::InternalError(_W("Inconsistent row/column dimensions.\n")); } return _pL->newLogicalOr(*_pR); }