Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00045 #if !defined(__DF12FUN__)
00046 # define __DF12FUN__
00047 #ifndef FVAR_HPP
00048 # include <fvar.hpp>
00049 #endif
00050
00051
00056 class df1_three_variable
00057 {
00058 double v[4];
00059 public:
00060 static prevariable * ind_var[];
00061 static int num_ind_var;
00062 double * get_u(void) const {return (double*) (&(v[0]));}
00063 double * get_u_x(void)const {return (double*) (&(v[1]));}
00064 double * get_u_y(void)const {return (double*) (&(v[2]));}
00065 double * get_u_z(void)const {return (double*) (&(v[3]));}
00066 df1_three_variable& operator = (const df1_three_variable& v);
00067 df1_three_variable& operator = (double v);
00068 df1_three_variable& operator += (const df1_three_variable& v);
00069 df1_three_variable& operator *= (const df1_three_variable& v);
00070 df1_three_variable& operator *= (double v);
00071 df1_three_variable& operator += (double v);
00072 df1_three_variable& operator -= (const df1_three_variable& v);
00073 df1_three_variable& operator -= (double v);
00074 df1_three_variable& operator /= (const df1_three_variable& v);
00075 df1_three_variable& my_diveq (const df1_three_variable& v);
00076 df1_three_variable& operator /= (double v);
00077 df1_three_variable(void);
00078 df1_three_variable(const df1_three_variable& );
00079 void initialize(void);
00080 };
00081
00082 inline double value(const df1_three_variable& x)
00083 { return double(*x.get_u()); }
00084
00089 class init_df1_three_variable : public df1_three_variable
00090 {
00091 public:
00092 ~init_df1_three_variable();
00093 void deallocate(void);
00094 init_df1_three_variable(const prevariable& );
00095 init_df1_three_variable(double );
00096 };
00097
00102 class df1_three_vector
00103 {
00104 int index_min;
00105 int index_max;
00106 vector_shapex * shape;
00107 df1_three_variable * v;
00108 public:
00109 int indexmin(void) const { return int(index_min); }
00110 int indexmax(void) const { return int(index_max); }
00111 df1_three_vector(int min,int max);
00112 df1_three_vector(void);
00113 void allocate(void);
00114 void allocate(int min,int max);
00115 df1_three_variable& operator () (int i) const
00116 {
00117 return (df1_three_variable&) (*(v+i));
00118 }
00119 df1_three_variable& operator [] (int i) const
00120 {
00121 return (df1_three_variable&) (*(v+i));
00122 }
00123 void initialize(void);
00124 void deallocate(void);
00125 ~df1_three_vector();
00126 df1_three_vector(const df1_three_vector& m2);
00127 };
00128
00129
00130
00131 dvector value(const df1_three_vector& v);
00132 dvector first_derivatives(const df1_three_vector& v);
00133
00138 class df1_three_matrix
00139 {
00140 int index_min;
00141 int index_max;
00142 mat_shapex * shape;
00143 df1_three_vector * v;
00144 public:
00145 int indexmin(void) const { return int(index_min); }
00146 int indexmax(void) const { return int(index_max); }
00147 df1_three_matrix(int rmin,int rmax,int cmin,int cmax);
00148 df1_three_vector& operator () (int i) const
00149 {
00150 return (df1_three_vector&) *(v+i);
00151 }
00152 df1_three_vector& operator [] (int i) const
00153 {
00154 return (df1_three_vector&) *(v+i);
00155 }
00156 df1_three_variable& operator () (int i,int j) const
00157 {
00158 return (df1_three_variable&) (*(v+i))(j);
00159 }
00160 void initialize(void);
00161
00162 void deallocate(void);
00163 ~df1_three_matrix();
00164 df1_three_matrix(const df1_three_matrix& m2);
00165 };
00166
00167 dmatrix value(const df1_three_matrix& v);
00168
00169 dmatrix first_derivatives(const df1_three_matrix& v);
00170 dmatrix second_derivatives(const df1_three_matrix& v);
00171 dmatrix third_derivatives(const df1_three_matrix& v);
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 df1_three_variable sin(const df1_three_variable& x);
00194 df1_three_variable fabs(const df1_three_variable& x);
00195 df1_three_variable sqrt(const df1_three_variable& x);
00196 df1_three_variable atan(const df1_three_variable& x);
00197 df1_three_variable cos(const df1_three_variable& x);
00198 df1_three_variable tan(const df1_three_variable& x);
00199 df1_three_variable log(const df1_three_variable& x);
00200 df1_three_variable square(const df1_three_variable& x);
00201 df1_three_variable cube(const df1_three_variable& x);
00202 df1_three_variable pow(const df1_three_variable& x,
00203 const df1_three_variable& y);
00204
00205 df1_three_variable sqrt(const df1_three_variable& x);
00206 df1_three_variable exp(const df1_three_variable& x);
00207 df1_three_variable inv(const df1_three_variable& x);
00208 df1_three_variable operator * (const df1_three_variable& x,
00209 const df1_three_variable& y);
00210 df1_three_variable operator * (double x,
00211 const df1_three_variable& y);
00212 df1_three_variable operator * (const df1_three_variable& x,
00213 double y);
00214 df1_three_variable operator / (const df1_three_variable& x,
00215 const df1_three_variable& y);
00216
00217 df1_three_variable operator / (const double x,const df1_three_variable& y);
00218
00219 df1_three_variable operator / (const df1_three_variable& x,
00220 const double y);
00221
00222 df1_three_variable operator + (const double x,
00223 const df1_three_variable& y);
00224
00225 df1_three_variable operator + (const df1_three_variable& x,
00226 const double y);
00227
00228 df1_three_variable operator + (const df1_three_variable& x,
00229 const df1_three_variable& y);
00230 df1_three_variable operator - (double x,const df1_three_variable& y);
00231 df1_three_variable operator - (const df1_three_variable& x,double y);
00232
00233 df1_three_variable operator - (const df1_three_variable& x,
00234 const df1_three_variable& y);
00235 df1_three_variable operator - (const df1_three_variable& x,
00236 const df1_three_variable& y);
00237 df1_three_variable operator / (const df1_three_variable& x,
00238 const df1_three_variable& y);
00239 df1_three_variable operator * (const df1_three_variable& x,
00240 const df1_three_variable& y);
00241
00242
00243 df1_three_variable operator - (const df1_three_variable& v);
00244 df1_three_matrix choleski_decomp(const df1_three_matrix& MM);
00245
00246 df1_three_variable cumd_gamma(const df1_three_variable& x,
00247 const df1_three_variable& a);
00248
00249
00250 df1_three_variable gammln(const df1_three_variable& xx);
00251 #endif // __DF12FUN__
00252