| tpython-numpy.py - numeric - C++ library with numerical algorithms | |
| git clone git://src.adamsgaard.dk/numeric | |
| Log | |
| Files | |
| Refs | |
| LICENSE | |
| --- | |
| tpython-numpy.py (274B) | |
| --- | |
| 1 #!/usr/bin/env python | |
| 2 import sys | |
| 3 import numpy | |
| 4 | |
| 5 if (len(sys.argv) == 2): | |
| 6 N = int(sys.argv[1]) | |
| 7 else : | |
| 8 print("Sorry, I need a matrix width as input argument!") | |
| 9 sys.exit(1) | |
| 10 | |
| 11 A = numpy.ones((N, N))*2.0 | |
| 12 B = numpy.arange(0.0, N*N).reshape(N, N, order='F') | |
| 13 C = numpy.dot(A,B) |