Changeset 447


Ignore:
Timestamp:
Oct 26, 2004, 11:55:30 AM (20 years ago)
Author:
ole
Message:

sparse test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/sparse.py

    r446 r447  
    8181
    8282        else:
    83             print 'Numeric matrix not yet implemented'
     83            raise 'Numeric matrix not yet implemented'
    8484
    8585        return R
     
    8888if __name__ == '__main__':
    8989
    90     from Numeric import allclose
     90    from Numeric import allclose, array, Float
    9191   
    9292    A = Sparse(3,3)
     
    111111    A[2,2] = 1
    112112
     113    print A
    113114    print A.todense()
    114115
     
    121122    assert allclose(u, [6,14,4])
    122123
     124    #Right hand side column
     125    v = array([[2,4],[3,4],[4,4]])
     126
     127    u = A*v[:,0]
     128    assert allclose(u, [6,14,4])
     129
     130    #u = A*v[:,1]
     131    #print u
Note: See TracChangeset for help on using the changeset viewer.