File: mul2.py

package info (click to toggle)
libnarray-ruby 0.5.9-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 564 kB
  • ctags: 564
  • sloc: ansic: 4,620; ruby: 1,513; python: 70; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from mybench import *

a = reshape(arrayrange(1000),(1000,1)).astype(Float64)
b = reshape(arrayrange(1000),(1,1000)).astype(Float64)

print "a.typecode:",a.typecode(),",  a.shape:",a.shape
print "b.typecode:",b.typecode(),",  b.shape:",b.shape
print "calculating  c = a*b ..."

def bench_body(a=a,b=b): c=a*b

bench_time(bench_body)

c = a*b
print "c.shape:", c.shape,"\n"