ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nonrectangular_hyperbola.cpp
Go to the documentation of this file.
1 #include <admodel.h>
2 #include <df1b2fun.h>
3 #include <adrndeff.h>
4 
5 /*---------------------------------------------------------3rd variable is a scalar*/
6 /*---------------------------------------------2nd variable is a scalar*/
15 dvariable nonrectangular_hyperbola(const double& x, const prevariable& theta, const prevariable& alpha, const prevariable& pmax)
16 {
18  dvariable y;
19  y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
20 
22  return (y);
23 }
32 dvar_vector nonrectangular_hyperbola(const dvector& x, const prevariable& theta, const prevariable& alpha, const prevariable& pmax)
33 {
35  dvar_vector y;
36  y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
37 
39  return (y);
40 }
49 dvar_vector nonrectangular_hyperbola(const dvector& x, const dvar_vector& theta, const prevariable& alpha, const prevariable& pmax)
50 {
52  dvar_vector y;
53  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)));
54 
56  return (y);
57 }
58 /*---------------------------------------------2nd variable is a vector*/
67 dvar_vector nonrectangular_hyperbola(const dvector& x, const prevariable& theta, const dvar_vector& alpha, const prevariable& pmax)
68 {
70  dvar_vector y;
71  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));
72 
74  return (y);
75 }
84 dvar_vector nonrectangular_hyperbola(const dvector& x, const dvar_vector& theta, const dvar_vector& alpha, const prevariable& pmax)
85 {
87  dvar_vector y;
88  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)));
89 
91  return (y);
92 }
93 /*---------------------------------------------------------3rd variable is a vector*/
94 /*---------------------------------------------2nd variable is a scalar*/
103 dvar_vector nonrectangular_hyperbola(const dvector& x, const prevariable& theta, const prevariable& alpha, const dvar_vector& pmax)
104 {
106  dvar_vector y;
107  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));
108 
110  return (y);
111 }
120 dvar_vector nonrectangular_hyperbola(const dvector& x, const dvar_vector& theta, const prevariable& alpha, const dvar_vector& pmax)
121 {
123  dvar_vector y;
124  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)));
125 
127  return (y);
128 }
129 /*---------------------------------------------2nd variable is a vector*/
138 dvar_vector nonrectangular_hyperbola(const dvector& x, const prevariable& theta, const dvar_vector& alpha, const dvar_vector& pmax)
139 {
141  dvar_vector y;
142  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));
143 
145  return (y);
146 }
155 dvar_vector nonrectangular_hyperbola(const dvector& x, const dvar_vector& theta, const dvar_vector& alpha, const dvar_vector& pmax)
156 {
158  dvar_vector y;
159  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)));
160 
162  return (y);
163 }
164 /*---------------------------------------------------------3rd variable is a scalar in a random effects model*/
165 /*---------------------------------------------2nd variable is a scalar in a random effects model*/
166 /*----------------------1st varible contains random effects*/
175 df1b2variable nonrectangular_hyperbola(const double& x, const df1b2variable& theta, const df1b2variable& alpha, const df1b2variable& pmax)
176 {
177  df1b2variable y;
178  y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
179 
180  return (y);
181 }
191 {
192  df1b2vector y;
193  y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0));
194 
195  return(y);
196 }
205 df1b2vector nonrectangular_hyperbola(const dvector& x, const df1b2vector& theta, const df1b2variable& alpha, const df1b2variable& pmax)
206 {
207  df1b2vector y;
208  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)));
209 
210  return(y);
211 }
212 
213 /*---------------------------------------------2nd variable is a vector in a random effects model*/
214 /*----------------------1st varible contains random effects*/
223 df1b2vector nonrectangular_hyperbola(const dvector& x, const df1b2variable& theta, const df1b2vector& alpha, const df1b2variable& pmax)
224 {
225  df1b2vector y;
226  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));
227 
228  return(y);
229 }
238 df1b2vector nonrectangular_hyperbola(const dvector& x, const df1b2vector& theta, const df1b2vector& alpha, const df1b2variable& pmax)
239 {
240  df1b2vector y;
241  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)));
242 
243  return(y);
244 }
245 
246 
247 /*---------------------------------------------------------3rd variable is a vector in a random effects model*/
248 /*---------------------------------------------2nd variable is a scalar in a random effects model*/
249 /*----------------------1st varible contains random effects*/
258 df1b2vector nonrectangular_hyperbola(const dvector& x, const df1b2variable& theta, const df1b2variable& alpha, const df1b2vector& pmax)
259 {
260  df1b2vector y;
261  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));
262 
263  return(y);
264 }
273 df1b2vector nonrectangular_hyperbola(const dvector& x, const df1b2vector& theta, const df1b2variable& alpha, const df1b2vector& pmax)
274 {
275  df1b2vector y;
276  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)));
277 
278  return(y);
279 }
280 
281 /*---------------------------------------------2nd variable is a vector in a random effects model*/
282 /*----------------------1st varible contains random effects*/
291 df1b2vector nonrectangular_hyperbola(const dvector& x, const df1b2variable& theta, const df1b2vector& alpha, const df1b2vector& pmax)
292 {
293  df1b2vector y;
294  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));
295 
296  return(y);
297 }
306 df1b2vector nonrectangular_hyperbola(const dvector& x, const df1b2vector& theta, const df1b2vector& alpha, const df1b2vector& pmax)
307 {
308  df1b2vector y;
309  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)));
310 
311  return(y);
312 }
Base class for dvariable.
Definition: fvar.hpp:1315
d3_array elem_prod(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements product of a(i, j, k) * b(i, j, k).
Definition: d3arr2a.cpp:92
Description not yet available.
void RETURN_ARRAYS_DECREMENT(void)
Decrements gradient_structure::RETURN_ARRAYS_PTR.
Definition: gradstrc.cpp:507
#define x
Vector of double precision numbers.
Definition: dvector.h:50
dvariable nonrectangular_hyperbola(const double &x, const prevariable &theta, const prevariable &alpha, const prevariable &pmax)
nonrectangular hyperbolic function; scalar
Description not yet available.
Definition: df1b2fun.h:953
ADMB variable vector.
Definition: fvar.hpp:2172
Description not yet available.
Definition: df1b2fun.h:266
Description not yet available.
Description not yet available.
void RETURN_ARRAYS_INCREMENT(void)
Increments gradient_structure::RETURN_ARRAYS_PTR.
Definition: gradstrc.cpp:474
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
d3_array pow(const d3_array &m, int e)
Description not yet available.
Definition: d3arr6.cpp:17