00001 /* 00002 * $Id$ 00003 * 00004 * Author: David Fournier 00005 * Copyright (c) 2008-2012 Regents of the University of California 00006 */ 00011 #include "df1b2fun.h" 00012 00020 df1b2variable bounder(const df1b2variable& x,double min,double max, 00021 double scale) 00022 { 00023 df1b2variable y=x/scale; 00024 df1b2variable z; 00025 if (value(y)<20.0) 00026 { 00027 z=exp(y)/(1.0+exp(y)); 00028 } 00029 else 00030 { 00031 z=1.0/(1+exp(-y)); 00032 } 00033 return min+(max-min)*z; 00034 }
Generated on Tue Mar 8 2016 19:51:30 for ADMB Documentation by 1.8.0 |