Changeset 1c6286d in sasmodels


Ignore:
Timestamp:
Mar 3, 2017 4:26:08 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3f853beb
Parents:
5a0b3d7
Message:

lamellar stack/hg-stack caille: code tidying, changing loop terminator from 'i⇐N-1' to the more usual 'i<N'

Location:
sasmodels/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/lamellar_hg_stack_caille.c

    rabb6e4f r1c6286d  
    2828 
    2929  Sq = 0.0; 
    30   for(int ii=1; ii<=Nlayers-1; ii++) { 
     30  for(int ii=1; ii < Nlayers; ii++) { 
    3131    temp = 0.0; 
    3232    alpha = Cp/4.0/M_PI/M_PI*(log(M_PI*ii) + Euler); 
     
    4040    //if (temp < 0) printf("q=%g: ii=%d, cos(dd*q*ii)=cos(%g) < 0\n",qval,ii,dd*qval*ii); 
    4141    //temp *= exp(-1.0*(t2 + t3)/(2.0*(1.0+t1)) ); 
    42     temp *= exp(-t2/2.0 ); 
     42    temp *= exp(-t2/2.0); 
    4343    //temp /= sqrt(1.0+t1); 
    4444 
  • sasmodels/models/lamellar_stack_caille.c

    r56b0435 r1c6286d  
    2626 
    2727  Sq = 0.0; 
    28   // the vital "=" in ii<=  added March 2015 
    29   for (int ii=1; ii<=Nlayers-1; ii++) { 
    30  
    31     //fii = (double)ii;   //do I really need to do this? - unused variable, removed 18Feb2015 
    32  
     28  for (int ii=1; ii < Nlayers; ii++) { 
    3329    temp = 0.0; 
    3430    alpha = Cp/4.0/M_PI/M_PI*(log(M_PI*ii) + Euler); 
     
    4137    temp *= cos(dd*qval*ii); 
    4238    //temp *= exp(-1.0*(t2 + t3)/(2.0*(1.0+t1)) ); 
    43     temp *= exp(-t2/2.0 ); 
     39    temp *= exp(-t2/2.0); 
    4440    //temp /= sqrt(1.0+t1); 
    4541 
Note: See TracChangeset for help on using the changeset viewer.