- Timestamp:
- Mar 27, 2016 6:57:03 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 5c028e3
- Parents:
- c499331
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
example/polynomial.py
rc499331 rd19962c 1 1 from numpy import inf 2 2 parameters = [ 3 ["n", "", 0, [0,5], "", "polynomial degree"],3 ["n", "", 1, [1,5], "", "number of coefficients (or degree+1)"], 4 4 ["c[n]", "", 0, [-inf, inf], "", "coefficients to c_n x^n"], 5 5 ] 6 6 7 Iq = """7 Iq = r""" 8 8 int int_n = (int)n; 9 double result = c[int_n ];10 for (int k=int_n- 1; k >= 0; k--) { result = result*q + c[k]; }9 double result = c[int_n-1]; 10 for (int k=int_n-2; k >= 0; k--) { result = result*q + c[k]; } 11 11 return result; 12 12 """
Note: See TracChangeset
for help on using the changeset viewer.