src/ModelSelectivities.cpp
dvar_vector SelFcns::ascnormal(dvector& z, dvar_vector& params, double fsZ){
    RETURN_ARRAYS_INCREMENT();
    if (debug) cout<<"Starting SelFcns::ascnormal(...)"<<endl;
    dvariable n; n.initialize();
    dvar_vector s(z.indexmin(),z.indexmax()); s.initialize();
    dvar_vector ascN(z.indexmin(),z.indexmax()); ascN.initialize();
    dvar_vector ascJ(z.indexmin(),z.indexmax()); ascJ.initialize();
    double slp = 5.0;
    dvariable ascMnZ = params(1);//size at which ascending limb hits 1
    dvariable ascWdZ = params(2);//width of ascending limb
    ascN = mfexp(-0.5*square((z-ascMnZ)/ascWdZ));
    ascJ = 1.0/(1.0+mfexp(slp*(z-(ascMnZ))));
    s = elem_prod(ascJ,ascN)+(1.0-ascJ);
    if (debug) cout<<"Finished SelFcns::ascnormal(...)"<<endl;
    RETURN_ARRAYS_DECREMENT();
    return s;
}
/**
 * Calculates ascending normal function parameterized by 
 *      params[1]: size at which ascending limb reaches 1
 *      params[2]: width of ascending limb
 * Inputs:
 * @param z      - dvector of sizes at which to compute function values
 * @param params - dvar_vector of function parameters
 * @param fsZ    - size at which function = 1 (i.e., fully-selected size) [double] NOTE: ignored!
 * 
 * @return - selectivity function values as dvar_vector
 */
Calculates ascending normal function parameterized by
params[1]: size at which ascending limb reaches 1
params[2]: width of ascending limb
Inputs:
@param z      - dvector of sizes at which to compute function values
@param params - dvar_vector of function parameters
@param fsZ    - size at which function = 1  [double] NOTE: ignored!

@return - selectivity function values as dvar_vector
Calculates ascending normal function parameterized by params [ 1 ] : size at which ascending limb reaches 1 params [ 2 ] : width of ascending limb Inputs : @param z - dvector of sizes at which to compute function values @param params - dvar_vector of function parameters @param fsZ - size at which function = 1 [ double ] NOTE : ignored! @return - selectivity function values as dvar_vector
dvar_vector SelFcns::ascnormal(dvector& z, dvar_vector& params, double fsZ){
    RETURN_ARRAYS_INCREMENT();
    if (debug) cout<<"Starting SelFcns::ascnormal(...)"<<endl;
    dvariable n; n.initialize();
    dvar_vector s(z.indexmin(),z.indexmax()); s.initialize();
    dvar_vector ascN(z.indexmin(),z.indexmax()); ascN.initialize();
    dvar_vector ascJ(z.indexmin(),z.indexmax()); ascJ.initialize();
    double slp = 5.0;
    dvariable ascMnZ = params(1);
    dvariable ascWdZ = params(2);
    ascN = mfexp(-0.5*square((z-ascMnZ)/ascWdZ));
    ascJ = 1.0/(1.0+mfexp(slp*(z-(ascMnZ))));
    s = elem_prod(ascJ,ascN)+(1.0-ascJ);
    if (debug) cout<<"Finished SelFcns::ascnormal(...)"<<endl;
    RETURN_ARRAYS_DECREMENT();
    return s;
}
dvar_vector SelFcns :: ascnormal ( dvector & z , dvar_vector & params , double fsZ ) { RETURN_ARRAYS_INCREMENT ( ) ; if ( debug ) cout << " " << endl ; dvariable n ; n . initialize ( ) ; dvar_vector s ( z . indexmin ( ) , z . indexmax ( ) ) ; s . initialize ( ) ; dvar_vector ascN ( z . indexmin ( ) , z . indexmax ( ) ) ; ascN . initialize ( ) ; dvar_vector ascJ ( z . indexmin ( ) , z . indexmax ( ) ) ; ascJ . initialize ( ) ; double slp = 5.0 ; dvariable ascMnZ = params ( 1 ) ; dvariable ascWdZ = params ( 2 ) ; ascN = mfexp ( -0.5 * square ( ( z - ascMnZ ) / ascWdZ ) ) ; ascJ = 1.0 / ( 1.0 + mfexp ( slp * ( z - ( ascMnZ ) ) ) ) ; s = elem_prod ( ascJ , ascN ) + ( 1.0 - ascJ ) ; if ( debug ) cout << " " << endl ; RETURN_ARRAYS_DECREMENT ( ) ; return s ; }
Calculates ascending normal function parameterized by
      params[1]: size at which ascending limb reaches 1
      params[2]: width of ascending limb
 Inputs:
 @param z      - dvector of sizes at which to compute function values
 @param params - dvar_vector of function parameters
 @param fsZ    - size at which function = 1 (i.e., fully-selected size) [double] NOTE: ignored!
Calculates ascending normal function parameterized by params [ 1 ] : size at which ascending limb reaches 1 params [ 2 ] : width of ascending limb Inputs : @param z - dvector of sizes at which to compute function values @param params - dvar_vector of function parameters @param fsZ - size at which function = 1 ( i . e . fully - selected size ) [ double ] NOTE : ignored!
//size at which ascending limb hits 1 //width of ascending limb