Show
Ignore:
Timestamp:
08/10/10 17:18:06 (22 months ago)
Author:
thesamovar
Message:

** Brian 1.2.2dev-2010-08-10 **

Fixed problems with STDP separating equations for triplet rule
Fixed sparse matrix problem with scipy 0.8.0

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/brian/tests/testutils/test_sparse.py

    r2020 r2116  
    11from brian.connection import SparseMatrix 
     2from numpy import zeros, array 
    23from nose.tools import * 
    34 
    45def test_sparse_matrix(): 
    56    x = SparseMatrix((10, 10)) 
     7    z = zeros((10, 10), dtype=int) 
    68    x[0, 4] = 3 
    79    x[1, :] = 5 
     
    1113    x[5, 2:4] = [1, 2] 
    1214    x[6:8, 4:7] = 1 
     15    # same thing with z to compare 
     16    z[0, 4] = 3 
     17    z[1, :] = 5 
     18    z[2, []] = [] 
     19    z[3, [0]] = [6] 
     20    z[4, [0, 1]] = [7, 8] 
     21    z[5, 2:4] = [1, 2] 
     22    z[6:8, 4:7] = 1 
     23    # check the values are correct 
     24    y = array(x.todense(), dtype=int) 
     25    assert (y==z).all() 
    1326 
    1427if __name__ == '__main__':