'Scalar element-wise multiplication'

def scalar_multiply(self, scalar):

    M = self.zeros(*self.shape)
    if scalar:
        for i in self._smat:
            v = (scalar * self._smat[i])
            if v:
                M._smat[i] = v
            else:
                M._smat.pop(i, None)
    return M
