source: sasmodels/Testers/test.py @ ff7119b

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since ff7119b was a42fec0, checked in by HMP1 <helen.park@…>, 10 years ago

Speed-up of 3X, compare.py working

  • Property mode set to 100644
File size: 168 bytes
Line 
1impor
2
3
4
5
6import numpy as np
7
8
9x = np.array([0, 1, 2, 3])
10y = 2*x + 1
11
12print y
13sum = 0
14
15for i in xrange(x.size-1):
16    sum += (x[i+1]-x[i])*(y[i]+y[i+1])/2
17
18print sum
19
Note: See TracBrowser for help on using the repository browser.