ADMB Documentation  11.1x.2716
 All Classes Files Functions Variables Typedefs Friends Defines
nonrectangular_hyperbola.cpp
Go to the documentation of this file.
00001 #include <admodel.h>
00002 #include <df1b2fun.h>
00003 #include <adrndeff.h> 
00004 
00005 /*---------------------------------------------------------3rd variable is a scalar*/
00006 /*---------------------------------------------2nd variable is a scalar*/
00015 dvariable nonrectangular_hyperbola(const double& x,  const prevariable& theta,  const prevariable& alpha,  const prevariable& pmax)
00016 {
00017     RETURN_ARRAYS_INCREMENT();  
00018   dvariable y;
00019   y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
00020 
00021   RETURN_ARRAYS_DECREMENT();
00022   return (y);
00023 }
00032 dvar_vector nonrectangular_hyperbola(const dvector& x,  const prevariable& theta,  const prevariable& alpha,  const prevariable& pmax)
00033 {
00034     RETURN_ARRAYS_INCREMENT();  
00035   dvar_vector y;
00036   y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
00037 
00038   RETURN_ARRAYS_DECREMENT();  
00039     return (y);
00040 }
00049 dvar_vector nonrectangular_hyperbola(const dvector& x,  const dvar_vector& theta,  const prevariable& alpha,  const prevariable& pmax)
00050 {
00051     RETURN_ARRAYS_INCREMENT();  
00052   dvar_vector y;
00053   y=elem_prod(pow(2.0*theta, -1.0), (alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*elem_prod(theta, x)*alpha*pmax, 0)));
00054 
00055   RETURN_ARRAYS_DECREMENT();  
00056     return (y);
00057 }
00058 /*---------------------------------------------2nd variable is a vector*/
00067 dvar_vector nonrectangular_hyperbola(const dvector& x,  const prevariable& theta,  const dvar_vector& alpha,  const prevariable& pmax)
00068 {
00069     RETURN_ARRAYS_INCREMENT();  
00070   dvar_vector y;
00071   y=pow(2.0*theta, -1.0)*(elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*theta*elem_prod(alpha, x)*pmax, 0));
00072 
00073   RETURN_ARRAYS_DECREMENT();  
00074     return (y);
00075 }
00084 dvar_vector nonrectangular_hyperbola(const dvector& x,  const dvar_vector& theta,  const dvar_vector& alpha,  const prevariable& pmax)
00085 {
00086     RETURN_ARRAYS_INCREMENT();  
00087   dvar_vector y;
00088   y=elem_prod(pow(2.0*theta, -1.0), (elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*elem_prod(theta, elem_prod(alpha, x))*pmax, 0)));
00089 
00090   RETURN_ARRAYS_DECREMENT();  
00091     return (y);
00092 }
00093 /*---------------------------------------------------------3rd variable is a vector*/
00094 /*---------------------------------------------2nd variable is a scalar*/
00103 dvar_vector nonrectangular_hyperbola(const dvector& x,  const prevariable& theta,  const prevariable& alpha,  const dvar_vector& pmax)
00104 {
00105     RETURN_ARRAYS_INCREMENT();  
00106   dvar_vector y;
00107   y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*elem_prod(x, pmax), 0));
00108 
00109   RETURN_ARRAYS_DECREMENT();  
00110     return (y);
00111 }
00120 dvar_vector nonrectangular_hyperbola(const dvector& x,  const dvar_vector& theta,  const prevariable& alpha,  const dvar_vector& pmax)
00121 {
00122     RETURN_ARRAYS_INCREMENT();  
00123   dvar_vector y;
00124   y=elem_prod(pow(2.0*theta, -1.0), (alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*elem_prod(elem_prod(theta, x), pmax)*alpha, 0)));
00125 
00126   RETURN_ARRAYS_DECREMENT();  
00127     return (y);
00128 }
00129 /*---------------------------------------------2nd variable is a vector*/
00138 dvar_vector nonrectangular_hyperbola(const dvector& x,  const prevariable& theta,  const dvar_vector& alpha,  const dvar_vector& pmax)
00139 {
00140     RETURN_ARRAYS_INCREMENT();  
00141   dvar_vector y;
00142   y=pow(2.0*theta, -1.0)*(elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*theta*elem_prod(elem_prod(alpha, x), pmax), 0));
00143 
00144   RETURN_ARRAYS_DECREMENT();  
00145     return (y);
00146 }
00155 dvar_vector nonrectangular_hyperbola(const dvector& x,  const dvar_vector& theta,  const dvar_vector& alpha,  const dvar_vector& pmax)
00156 {
00157     RETURN_ARRAYS_INCREMENT();  
00158   dvar_vector y;
00159   y=elem_prod(pow(2.0*theta, -1.0), (elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*elem_prod(elem_prod(theta, elem_prod(alpha, x)), pmax), 0)));
00160 
00161   RETURN_ARRAYS_DECREMENT();  
00162     return (y);
00163 }
00164 /*---------------------------------------------------------3rd variable is a scalar in a random effects model*/
00165 /*---------------------------------------------2nd variable is a scalar in a random effects model*/
00166 /*----------------------1st varible contains random effects*/
00175 df1b2variable nonrectangular_hyperbola(const double& x,  const df1b2variable& theta,  const df1b2variable& alpha,  const df1b2variable& pmax)
00176 {
00177   df1b2variable y;
00178   y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
00179 
00180     return (y);
00181 }
00190 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2variable& theta,  const df1b2variable& alpha,  const df1b2variable& pmax)
00191 {
00192   df1b2vector y;
00193   y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
00194 
00195     return(y);
00196 }
00205 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2vector& theta,  const df1b2variable& alpha,  const df1b2variable& pmax)
00206 {
00207   df1b2vector y;
00208   y=elem_prod(pow(2.0*theta, -1.0), (alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*elem_prod(theta, x)*alpha*pmax, 0)));
00209 
00210     return(y);
00211 }
00212 
00213 /*---------------------------------------------2nd variable is a vector in a random effects model*/
00214 /*----------------------1st varible contains random effects*/
00223 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2variable& theta,  const df1b2vector& alpha,  const df1b2variable& pmax)
00224 {
00225   df1b2vector y;
00226   y=pow(2.0*theta, -1.0)*(elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*theta*elem_prod(alpha, x)*pmax, 0));
00227 
00228     return(y);
00229 }
00238 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2vector& theta,  const df1b2vector& alpha,  const df1b2variable& pmax)
00239 {
00240   df1b2vector y;
00241   y=elem_prod(pow(2.0*theta, -1.0), (elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*elem_prod(theta, elem_prod(alpha, x))*pmax, 0)));
00242 
00243     return(y);
00244 }
00245 
00246 
00247 /*---------------------------------------------------------3rd variable is a vector in a random effects model*/
00248 /*---------------------------------------------2nd variable is a scalar in a random effects model*/
00249 /*----------------------1st varible contains random effects*/
00258 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2variable& theta,  const df1b2variable& alpha,  const df1b2vector& pmax)
00259 {
00260   df1b2vector y;
00261   y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*elem_prod(x, pmax), 0));
00262 
00263     return(y);
00264 }
00273 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2vector& theta,  const df1b2variable& alpha,  const df1b2vector& pmax)
00274 {
00275   df1b2vector y;
00276   y=elem_prod(pow(2.0*theta, -1.0), (alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*elem_prod(elem_prod(theta, x), pmax)*alpha, 0)));
00277 
00278     return(y);
00279 }
00280 
00281 /*---------------------------------------------2nd variable is a vector in a random effects model*/
00282 /*----------------------1st varible contains random effects*/
00291 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2variable& theta,  const df1b2vector& alpha,  const df1b2vector& pmax)
00292 {
00293   df1b2vector y;
00294   y=pow(2.0*theta, -1.0)*(elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*theta*elem_prod(elem_prod(alpha, x), pmax), 0));
00295 
00296     return(y);
00297 }
00306 df1b2vector nonrectangular_hyperbola(const dvector& x,  const df1b2vector& theta,  const df1b2vector& alpha,  const df1b2vector& pmax)
00307 {
00308   df1b2vector y;
00309   y=elem_prod(pow(2.0*theta, -1.0), (elem_prod(alpha, x)+pmax-pow(pow(elem_prod(alpha, x)+pmax, 2.0) - 4.0*elem_prod(elem_prod(theta, elem_prod(alpha, x)), pmax), 0)));
00310 
00311     return(y);
00312 }