~ubuntu-branches/debian/sid/cpl-plugin-sinfo/sid

« back to all changes in this revision

Viewing changes to sinfoni/sinfo_boltzmann.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2015-09-23 11:21:27 UTC
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: package-import@ubuntu.com-20150923112127-7btl00mgr881g759
Tags: upstream-2.6.8+dfsg
ImportĀ upstreamĀ versionĀ 2.6.8+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
                        that is 
120
120
                        y = (parlist(0) - parlist(1)) / 
121
121
                            (1+exp((x-parlist(2))/parlist(3))) + parlist(1)
122
 
 
 
122
  or 0 is the input are invalid
123
123
 */
124
124
 
125
125
float sinfo_new_boltz ( float * xdat, float * parlist )
126
126
{
127
127
    float return_value ;
 
128
    cpl_ensure(xdat , CPL_ERROR_NULL_INPUT, 0.);
 
129
    cpl_ensure(parlist , CPL_ERROR_NULL_INPUT, 0.);
128
130
 
129
131
    /* now build the boltzman function out of the parameters */
130
132
    return_value = 
156
158
  @returns               nothing, void
157
159
 */
158
160
 
159
 
void sinfo_new_boltz_deriv( float * xdat, float * parlist, float * dervs )
 
161
cpl_error_code sinfo_new_boltz_deriv( float * xdat, float * parlist, float * dervs )
160
162
{
161
163
    float subst ;
 
164
    cpl_ensure_code(xdat , CPL_ERROR_NULL_INPUT);
 
165
    cpl_ensure_code(parlist , CPL_ERROR_NULL_INPUT);
 
166
    cpl_ensure_code(dervs , CPL_ERROR_NULL_INPUT);
 
167
 
162
168
 
163
169
    subst = (xdat[0] - parlist[2]) / parlist[3] ;
164
170
 
172
178
    dervs[3] = ( (parlist[0] - parlist[1]) * (xdat[0] - parlist[2]) /
173
179
                    (parlist[3]*parlist[3]) * exp(subst) ) /
174
180
                    ( (1. + exp(subst)) * (1. + exp(subst)) ) ;
 
181
 
 
182
    return cpl_error_get_code();
175
183
}
176
184
 
177
185
/**
1508
1516
          user given positions.
1509
1517
          The least squares fit is done by using a box smaller than
1510
1518
          the size of two slitlets
1511
 
 
 
1519
TODO: NOT USED
1512
1520
 */
1513
1521
 
1514
1522
int