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
00046 #include <df1b2fun.h>
00047 #if !defined(__DF1B2FNL__)
00048 # define __DF1B2FNL__
00049 #include <adrndeff.h>
00050
00055 class funnel_init_var
00056 {
00057 public:
00058 funnel_init_var() { }
00059 ~funnel_init_var() {}
00060
00061 static laplace_approximation_calculator * lapprox;
00062 static df1b2variable * funnel_constraints_penalty;
00063 static void reset_counters(void) { num_vars=0; }
00064 static unsigned int num_vars;
00065
00066 static int num_inactive_vars;
00067 static unsigned int num_active_parameters;
00068 static init_df1b2vector * py;
00069 static imatrix * plist;
00070 int index;
00071 static funnel_init_var ** list;
00072
00073 static funnel_init_var ** inactive_list;
00074 void add_to_list(void);
00075 void delete_from_list(void);
00076 void add_to_inactive_list(void);
00077 virtual void allocate(void);
00078
00079 virtual void xinit(init_df1b2vector&,int& ii)=0;
00080 virtual void xinit(dvector&,int& ii)=0;
00081 virtual void set_value(const init_df1b2vector&,const int& ii,
00082 const df1b2variable&)=0;
00083 virtual void set_value(const init_df1b2vector&,const int& ii)=0;
00084 virtual void set_index(imatrix&,int& ii)=0;
00085 virtual int nvar_calc(void)=0;
00086
00087 static void reset(init_df1b2vector& x);
00088
00089 static void allocate_all(void);
00090 static void deallocate_all(void);
00091 static unsigned int nvarcalc_all();
00092 };
00093
00098 class funnel_dependent_df1b2variable : public df1b2variable
00099 {
00100 public:
00101 double * get_u(void){ return df1b2variable::get_u();}
00102 void operator = (const df1b2variable&)
00103 {
00104 cerr << "Cannot assign to funnel_dependent_df1b2variable" << endl;
00105 ad_exit(1);
00106 }
00107 funnel_dependent_df1b2variable(const df1b2variable&);
00108
00109 };
00110
00115 class funnel_init_df1b2variable : public funnel_init_var, public df1b2variable
00116 {
00117 public:
00118 int type;
00119 void * pointer;
00120 double xu;
00121 int ind_index;
00122 int nvar_calc(void){return 1;}
00123 funnel_init_df1b2variable(const df1b2_init_number & x);
00124 funnel_init_df1b2variable(const funnel_init_df1b2variable& x);
00125 funnel_init_df1b2variable(const df1b2variable & x);
00126 funnel_init_df1b2variable(void);
00127 funnel_init_df1b2variable(const random_effects_bounded_vector_info&);
00128 virtual void allocate(void);
00129 virtual void allocate(const df1b2variable&);
00130 virtual void preallocate(const df1b2variable&);
00131 virtual void xinit(init_df1b2vector&,int& ii);
00132 virtual void xinit(dvector&,int& ii);
00133 virtual void set_value(const init_df1b2vector&,const int& ii);
00134 virtual void set_value(const init_df1b2vector&,const int& ii,
00135 const df1b2variable&);
00136 virtual void set_index(imatrix&,int& ii);
00137 };
00138
00143 class funnel_init_bounded_df1b2vector : public funnel_init_var,
00144 public df1b2vector
00145 {
00146 const df1b2_init_bounded_vector * p;
00147 public:
00148 int nvar_calc(void);
00149 funnel_init_bounded_df1b2vector(const df1b2_init_bounded_vector & x);
00150 virtual void xinit(init_df1b2vector&,int& ii);
00151 virtual void xinit(dvector&, int&){ cout << "here"<< endl;}
00152 virtual void set_value(const init_df1b2vector&,const int& ii,
00153 const df1b2variable&);
00154 virtual void set_value(const init_df1b2vector&, const int&)
00155 { cout << "here"<< endl;}
00156 virtual void set_index(imatrix&,int& ii);
00157 };
00158
00163 class funnel_init_df1b2vector : public funnel_init_var, public df1b2vector
00164 {
00165 const df1b2vector * p;
00166
00167 public:
00168 funnel_init_df1b2vector()
00169 { p = 0; }
00170 ~funnel_init_df1b2vector();
00171 int nvar_calc(void);
00172
00173 funnel_init_df1b2vector(const df1b2vector & x);
00174 virtual void xinit(init_df1b2vector&,int& ii);
00175 virtual void xinit(dvector&, int&){ cout << "here"<< endl;}
00176 virtual void set_value(const init_df1b2vector&,const int& ii,
00177 const df1b2variable&);
00178 virtual void set_value(const init_df1b2vector&, const int&)
00179 { cout << "here"<< endl;}
00180 virtual void set_index(imatrix&,int& ii);
00181 virtual void allocate(void);
00182 };
00183
00188 class funnel_init_df1b2matrix : public funnel_init_var, public df1b2matrix
00189 {
00190 const df1b2matrix* p;
00191
00192 public:
00193 int nvar_calc(void);
00194
00195 funnel_init_df1b2matrix(const df1b2matrix & x);
00196 virtual void xinit(init_df1b2vector&,int& ii);
00197 virtual void xinit(dvector&, int&){ cout << "here"<< endl;}
00198 virtual void set_value(const init_df1b2vector&,const int& ii,
00199 const df1b2variable&);
00200 virtual void set_value(const init_df1b2vector&, const int&)
00201 { cout << "here"<< endl;}
00202 virtual void set_index(imatrix&,int& ii);
00203 };
00204 #endif // #if !defined(__DF1B2FNL__)