Revision 594 trunk/contrib/ecolib/nonrectangular_hyperbola.cpp

nonrectangular_hyperbola.cpp (revision 594)
10 10
\param alpha ; differentiable scalar
11 11
\param pmax ; differentiable scalar
12 12
\return  \f$ \frac{1}{2\theta} (\alpha x +p_{max} - \sqrt{(\alpha x +p_{max})^2-4\theta \alpha x p_{max}}) \f$
13
\ingroup ECOL
13 14
**/
14 15
dvariable nonrectangular_hyperbola(const double& x,  const prevariable& theta,  const prevariable& alpha,  const prevariable& pmax)
15 16
{
16 17
    RETURN_ARRAYS_INCREMENT();	
17 18
	dvariable y;
18
	y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0.5));
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));
19 20

  
20 21
	RETURN_ARRAYS_DECREMENT();
21 22
	return (y);
......
26 27
\param alpha ; differentiable scalar
27 28
\param pmax ; differentiable scalar
28 29
\return  \f$ \frac{1}{2\theta} (\alpha x +p_{max} - \sqrt{(\alpha x +p_{max})^2-4\theta \alpha x p_{max}}) \f$
30
\ingroup ECOL
29 31
**/
30 32
dvar_vector nonrectangular_hyperbola(const dvector& x,  const prevariable& theta,  const prevariable& alpha,  const prevariable& pmax)
31 33
{
32 34
    RETURN_ARRAYS_INCREMENT();	
33 35
	dvar_vector y;
34
	y=pow(2.0*theta, -1.0)*(alpha*x+pmax-pow(pow(alpha*x+pmax, 2.0) - 4.0*theta*alpha*x*pmax, 0.5));
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));
35 37

  
36 38
	RETURN_ARRAYS_DECREMENT();	
37 39
    return (y);
......
42 44
\param alpha ; differentiable scalar
43 45
\param pmax ; differentiable scalar
44 46
\return  \f$ \frac{1}{2\theta} (\alpha x +p_{max} - \sqrt{(\alpha x +p_{max})^2-4\theta \alpha x p_{max}}) \f$
47
\ingroup ECOL
45 48
**/
46 49
dvar_vector nonrectangular_hyperbola(const dvector& x,  const dvar_vector& theta,  const prevariable& alpha,  const prevariable& pmax)
47 50
{
48 51
    RETURN_ARRAYS_INCREMENT();	
49 52
	dvar_vector y;
50
	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.5)));
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)));
51 54

  
52 55
	RETURN_ARRAYS_DECREMENT();	
53 56
    return (y);
......
59 62
\param alpha ; differentiable vector
60 63
\param pmax ; differentiable scalar
61 64
\return  \f$ \frac{1}{2\theta} (\alpha x +p_{max} - \sqrt{(\alpha x +p_{max})^2-4\theta \alpha x p_{max}}) \f$
65
\ingroup ECOL
62 66
**/
63 67
dvar_vector nonrectangular_hyperbola(const dvector& x,  const prevariable& theta,  const dvar_vector& alpha,  const prevariable& pmax)
64 68
{
65 69
    RETURN_ARRAYS_INCREMENT();	
66 70
	dvar_vector y;
67
	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.5));
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));
68 72

  
69 73
	RETURN_ARRAYS_DECREMENT();	
70 74
    return (y);
......
75 79
\param alpha ; differentiable vector
76 80
\param pmax ; differentiable scalar
77 81
\return  \f$ \frac{1}{2\theta} (\alpha x +p_{max} - \sqrt{(\alpha x +p_{max})^2-4\theta \alpha x p_{max}}) \f$
82
\ingroup ECOL
78 83
**/
79 84
dvar_vector nonrectangular_hyperbola(const dvector& x,  const dvar_vector& theta,  const dvar_vector& alpha,  const prevariable& pmax)
80 85
{
81 86
    RETURN_ARRAYS_INCREMENT();	
82 87
	dvar_vector y;
83
	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.5)));
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)));
84 89

  
85 90
	RETURN_ARRAYS_DECREMENT();	
86 91
    return (y);
......
93 98
\param alpha ; differentiable scalar
94 99
\param pmax ; differentiable vector
95 100
\return  \f$ \frac{1}{2\theta} (\alpha x +p_{max} - \sqrt{(\alpha x +p_{max})^2-4\theta \alpha x p_{max}}) \f$
101
\ingroup ECOL
96 102
**/
97 103
dvar_vector nonrectangular_hyperbola(const dvector& x,  const prevariable& theta,  const prevariable& alpha,  const dvar_vector& pmax)
98 104
{
99 105
    RETURN_ARRAYS_INCREMENT();	
100 106
	dvar_vector y;
101
	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.5));
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));
102 108

  
103 109
	RETURN_ARRAYS_DECREMENT();	
104 110
    return (y);
......
109 115
\param alpha ; differentiable scalar
110 116
\param pmax ; differentiable vector
111 117
\return  \f$ \frac{1}{2\theta} (\alpha x +p_{max} - \sqrt{(\alpha x +p_{max})^2-4\theta \alpha x p_{max}}) \f$
118
\ingroup ECOL
112 119
**/
113 120
dvar_vector nonrectangular_hyperbola(const dvector& x,  const dvar_vector& theta,  const prevariable& alpha,  const dvar_vector& pmax)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff