'Test scipy sparse matrices.'

def test_scipy_sparse(self):

    A = numpy.matrix(numpy.arange(8).reshape((4, 2)))
    A = sp.csc_matrix(A)
    A = sp.eye(2).tocsc()
    key = (slice(0, 1, None), slice(None, None, None))
    Aidx = intf.index(A, (slice(0, 2, None), slice(None, None, None)))
    Aidx = intf.index(Aidx, key)
    self.assertEqual(Aidx.shape, (1, 2))
    self.assertEqual(Aidx[(0, 0)], 1)
    self.assertEqual(Aidx[(0, 1)], 0)
    var = Variable(4, 2)
    A = numpy.matrix(numpy.arange(8).reshape((4, 2)))
    A = sp.csc_matrix(A)
    B = sp.hstack([A, A])
    self.assertExpression((var + A), (4, 2))
    self.assertExpression((A + var), (4, 2))
    self.assertExpression((B * var), (4, 2))
    self.assertExpression((var - A), (4, 2))
    self.assertExpression(((A - A) - var), (4, 2))
    if PY35:
        self.assertExpression(var.__rmatmul__(B), (4, 2))
