/[escript]/trunk/cusplibrary/testing/data/random_10x10/generator.py
ViewVC logotype

Annotation of /trunk/cusplibrary/testing/data/random_10x10/generator.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4955 - (hide annotations)
Tue May 20 04:33:15 2014 UTC (6 years, 1 month ago) by caltinay
Original Path: branches/diaplayground/cusplibrary/testing/data/random_10x10/generator.py
File MIME type: text/x-python
File size: 377 byte(s)
added pristine copy of cusplibrary (apache license) to be used by ripley.

1 caltinay 4955 from scipy.sparse import coo_matrix
2     from scipy.io import mmwrite
3     from numpy.random import permutation
4     M = N = 10
5    
6     for nnz in [0, 1, 2, 5, 8, 10, 15, 20, 30, 50, 80, 100]:
7     P = permutation(M * N)[:nnz]
8     I = P / N
9     J = P % N
10     V = permutation(nnz) + 1
11    
12     A = coo_matrix( (V,(I,J)) , shape=(M,N))
13     filename = '%03d_nonzeros.mtx' % (nnz,)
14     mmwrite(filename, A)
15    

  ViewVC Help
Powered by ViewVC 1.1.26