SHOW:
|
|
- or go back to the newest paste.
1 | - | |
1 | + | |
2 | ||
3 | ''' | |
4 | I am going to just test the algo listing with assumption | |
5 | - | Original objective: |
5 | + | |
6 | - | To calculate m_p(n) given |
6 | + | |
7 | - | 1. Degree n of entries in the result vector |
7 | + | |
8 | - | 2. Vector m_p(n-1) of the previous degree |
8 | + | |
9 | - | (p denotes order of the moment) |
9 | + | |
10 | ''' | |
11 | - | For the below example, i am going to just test the algo listing |
11 | + | |
12 | count = 0 | |
13 | - | with assumption |
13 | + | |
14 | for j2 in range(n -j1, -1, -1): | |
15 | j3 = (n-(j1+j2)) | |
16 | count = count + 1 | |
17 | print 'To calculate m_p(%d)[%d], j1,j2,j3 = ' %(n,count), j1, j2, j3 | |
18 | ||
19 | assert(count==6) # just a checkpoint. See P.169 for a proof | |
20 | print 'No. of entries =', count |