Changeset d19962c in sasmodels for example


Ignore:
Timestamp:
Mar 27, 2016 6:57:03 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

working vector parameter example using dll engine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • example/polynomial.py

    rc499331 rd19962c  
    11from numpy import inf 
    22parameters = [ 
    3     ["n", "", 0, [0,5], "", "polynomial degree"], 
     3    ["n", "", 1, [1,5], "", "number of coefficients (or degree+1)"], 
    44    ["c[n]", "", 0, [-inf, inf], "", "coefficients to c_n x^n"], 
    55] 
    66 
    7 Iq = """ 
     7Iq = r""" 
    88    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]; } 
    1111    return result; 
    1212    """ 
Note: See TracChangeset for help on using the changeset viewer.