Changeset 7887


Ignore:
Timestamp:
Jul 2, 2010, 9:38:46 AM (14 years ago)
Author:
steve
Message:

Changed back to old version of sparse to get test_all.py working again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/sparse.py

    r7886 r7887  
    297297    def __mul__(self, other):
    298298        """Multiply this matrix onto 'other' which can either be
    299         a numeric vector.
     299        a numeric vector, a numeric matrix or another sparse matrix.
    300300        """
    301301
     
    303303            B = num.array(other)
    304304        except:
    305             raise ValueError, 'FIXME: Only numeric types implemented so far'
    306 
    307 
    308         # Assume numeric types from now on
    309 
    310         if len(B.shape) == 0:
    311             # Scalar - use __rmul__ method
    312             #R = B*self
    313             raise TypeError, 'Sparse matrix X scalar not implemented'
    314 
    315         elif len(B.shape) == 1:
    316             # Vector
    317             msg = 'Mismatching dimensions: You cannot multiply (%d x %d) matrix onto %d-vector'\
    318                   %(self.M, self.N, B.shape[0])
    319             assert B.shape[0] == self.N, msg
    320 
    321             R = csr_mv(self,B)
    322 
    323 
    324         elif len(B.shape) == 2:
    325             raise TypeError, 'Sparse matrix X matrix multiplication not implemented'
    326 
    327         else:
    328             raise ValueError, 'Dimension too high: d=%d' %len(B.shape)
    329 
    330         return R
    331 
     305            print 'FIXME: Only numeric types implemented so far'
     306
     307        return csr_mv(self,B)
    332308
    333309
Note: See TracChangeset for help on using the changeset viewer.