ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
df1b2fnl.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  *
7  * ADModelbuilder and associated libraries and documentations are
8  * provided under the general terms of the "BSD" license.
9  *
10  * License:
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are
14  * met:
15  *
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in the
21  * documentation and/or other materials provided with the distribution.
22  *
23  * 3. Neither the name of the University of California, Otter Research,
24  * nor the ADMB Foundation nor the names of its contributors may be used
25  * to endorse or promote products derived from this software without
26  * specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *
40  */
46 #include <df1b2fun.h>
47 #if !defined(__DF1B2FNL__)
48 # define __DF1B2FNL__
49 #include <adrndeff.h>
50 
56 {
57 public:
58  funnel_init_var() { /*add_to_list();*/ }
60 
63  static void reset_counters(void) { num_vars=0; /*num_all_vars=0;*/}
64  static unsigned int num_vars;
65  //static int num_all_vars;
66  static int num_inactive_vars;
67  static unsigned int num_active_parameters;
68  static init_df1b2vector * py;
69  static imatrix * plist;
70  int index;
71  static funnel_init_var* list[2000];
72  //static funnel_init_var ** all_list;
74  void add_to_list(void);
75  void delete_from_list(void);
76  void add_to_inactive_list(void);
77  virtual void allocate(void);
78  //virtual void xinit(void);
79  virtual void xinit(init_df1b2vector&,int& ii)=0;
80  virtual void xinit(dvector&,int& ii)=0;
81  virtual void set_value(const init_df1b2vector&,const int& ii,
82  const df1b2variable&)=0;
83  virtual void set_value(const init_df1b2vector&,const int& ii)=0;
84  virtual void set_index(imatrix&,int& ii)=0;
85  virtual int nvar_calc(void)=0;
86 
87  static void reset(init_df1b2vector& x);
88 
89  static void allocate_all(void);
90  static void deallocate_all(void);
91  static unsigned int nvarcalc_all();
92 };
93 
99 {
100 public:
101  double * get_u(void){ return df1b2variable::get_u();}
103  {
104  cerr << "Cannot assign to funnel_dependent_df1b2variable" << endl;
105  ad_exit(1);
106  }
108  //virtual void allocate_all(init_df1b2vector&,int& ii);
109 };
110 
116 {
117 public:
118  int type;
119  void * pointer;
120  double xu;
122  int nvar_calc(void){return 1;}
128  virtual void allocate(void);
129  virtual void allocate(const df1b2variable&);
130  virtual void preallocate(const df1b2variable&);
131  virtual void xinit(init_df1b2vector&,int& ii);
132  virtual void xinit(dvector&,int& ii);
133  virtual void set_value(const init_df1b2vector&,const int& ii);
134  virtual void set_value(const init_df1b2vector&,const int& ii,
135  const df1b2variable&);
136  virtual void set_index(imatrix&,int& ii);
137 };
138 
144  public df1b2vector
145 {
147 public:
148  int nvar_calc(void);
150  virtual void xinit(init_df1b2vector&,int& ii);
151  virtual void xinit(dvector&, int&){ cout << "here"<< endl;}
152  virtual void set_value(const init_df1b2vector&,const int& ii,
153  const df1b2variable&);
154  virtual void set_value(const init_df1b2vector&, const int&)
155  { cout << "here"<< endl;}
156  virtual void set_index(imatrix&,int& ii);
157 };
158 
164 {
165  const df1b2vector * p;
166  //const df1b2_init_vector * p;
167 public:
169  { p = 0; }
171  int nvar_calc(void);
172  //funnel_init_df1b2vector(const df1b2_init_vector & x);
174  virtual void xinit(init_df1b2vector&,int& ii);
175  virtual void xinit(dvector&, int&){ cout << "here"<< endl;}
176  virtual void set_value(const init_df1b2vector&,const int& ii,
177  const df1b2variable&);
178  virtual void set_value(const init_df1b2vector&, const int&)
179  { cout << "here"<< endl;}
180  virtual void set_index(imatrix&,int& ii);
181  virtual void allocate(void);
182 };
183 
189 {
190  const df1b2matrix* p;
191  //const df1b2_init_vector * p;
192 public:
193  int nvar_calc(void);
194  //funnel_init_df1b2vector(const df1b2_init_vector & x);
196  virtual void xinit(init_df1b2vector&,int& ii);
197  virtual void xinit(dvector&, int&){ cout << "here"<< endl;}
198  virtual void set_value(const init_df1b2vector&,const int& ii,
199  const df1b2variable&);
200  virtual void set_value(const init_df1b2vector&, const int&)
201  { cout << "here"<< endl;}
202  virtual void set_index(imatrix&,int& ii);
203 };
204 #endif // #if !defined(__DF1B2FNL__)
static funnel_init_var * inactive_list[2000]
Definition: df1b2fnl.h:73
~funnel_init_df1b2vector()
Destructor.
Definition: df1b2fnl.cpp:794
static void allocate_all(void)
Description not yet available.
Definition: df1b2fnl.cpp:130
virtual void set_value(const init_df1b2vector &, const int &ii, const df1b2variable &)
Description not yet available.
Definition: df1b2fnl.cpp:853
Description not yet available.
Definition: adrndeff.h:182
Description not yet available.
Definition: df1b2fun.h:1608
virtual void set_value(const init_df1b2vector &, const int &ii, const df1b2variable &)
Description not yet available.
Definition: f1b2fnl6.cpp:144
Description not yet available.
Definition: imatrix.h:69
virtual void preallocate(const df1b2variable &)
Description not yet available.
Definition: df1b2fnl.cpp:393
Description not yet available.
virtual void set_index(imatrix &, int &ii)
Description not yet available.
Definition: df1b2fnl.cpp:707
virtual void xinit(dvector &, int &)
Definition: df1b2fnl.h:175
virtual void xinit(init_df1b2vector &, int &ii)
Description not yet available.
Definition: f1b2fnl6.cpp:99
double * get_u() const
Definition: df1b2fun.h:228
const df1b2vector * p
Definition: df1b2fnl.h:165
#define x
Vector of double precision numbers.
Definition: dvector.h:50
Description not yet available.
Definition: df1b2fnl.h:163
Description not yet available.
Definition: df1b2fnl.h:55
virtual void set_value(const init_df1b2vector &, const int &)
Definition: df1b2fnl.h:154
static int num_inactive_vars
Definition: df1b2fnl.h:66
Description not yet available.
Definition: df1b2fun.h:953
virtual void set_index(imatrix &, int &ii)
Description not yet available.
Definition: df1b2fnl.cpp:831
exitptr ad_exit
Definition: gradstrc.cpp:53
int nvar_calc(void)
Description not yet available.
Definition: f1b2fnl6.cpp:83
virtual void xinit(init_df1b2vector &, int &ii)
Description not yet available.
Definition: df1b2fnl.cpp:910
Description not yet available.
Definition: df1b2fun.h:1584
static funnel_init_var * list[2000]
Definition: df1b2fnl.h:71
Description not yet available.
Definition: df1b2fun.h:266
virtual void set_index(imatrix &, int &ii)
Description not yet available.
Definition: df1b2fnl.cpp:927
funnel_init_bounded_df1b2vector(const df1b2_init_bounded_vector &x)
Description not yet available.
Definition: df1b2fnl.cpp:874
static df1b2variable * funnel_constraints_penalty
Definition: df1b2fnl.h:62
static laplace_approximation_calculator * lapprox
Definition: df1b2fnl.h:61
virtual void set_value(const init_df1b2vector &, const int &ii, const df1b2variable &)
Description not yet available.
Definition: df1b2fnl.cpp:944
virtual void set_value(const init_df1b2vector &, const int &)
Definition: df1b2fnl.h:178
prnstream & endl(prnstream &)
virtual void xinit(dvector &, int &)
Definition: df1b2fnl.h:151
static unsigned int num_active_parameters
Definition: df1b2fnl.h:67
virtual void xinit(init_df1b2vector &, int &ii)=0
static imatrix * plist
Definition: df1b2fnl.h:69
funnel_init_df1b2matrix(const df1b2matrix &x)
Description not yet available.
Definition: f1b2fnl6.cpp:17
virtual void allocate(void)
Description not yet available.
Definition: df1b2fnl.cpp:84
Description not yet available.
Definition: df1b2fnl.h:98
Description not yet available.
Definition: df1b2fnl.h:188
int nvar_calc(void)
Description not yet available.
Definition: df1b2fnl.cpp:901
void operator=(const df1b2variable &)
Definition: df1b2fnl.h:102
virtual void xinit(init_df1b2vector &, int &ii)
Description not yet available.
Definition: df1b2fnl.cpp:811
funnel_init_df1b2variable(void)
Description not yet available.
Definition: df1b2fnl.cpp:373
static void deallocate_all(void)
Release memory.
Definition: df1b2fnl.cpp:106
static void reset_counters(void)
Definition: df1b2fnl.h:63
Description not yet available.
Definition: df1b2fnl.h:115
virtual void set_value(const init_df1b2vector &, const int &)
Definition: df1b2fnl.h:200
void add_to_list(void)
Description not yet available.
Definition: df1b2fnl.cpp:42
const df1b2matrix * p
Definition: df1b2fnl.h:190
virtual void allocate(void)
Description not yet available.
Definition: f1b2fnl4.cpp:45
virtual void set_index(imatrix &, int &ii)
Description not yet available.
Definition: f1b2fnl6.cpp:121
Description not yet available.
Definition: df1b2fun.h:373
Description not yet available.
Definition: df1b2fun.h:1042
virtual void set_value(const init_df1b2vector &, const int &ii)
Description not yet available.
Definition: df1b2fnl.cpp:488
Description not yet available.
Definition: df1b2fun.h:1469
Description not yet available.
Definition: df1b2fnl.h:143
void add_to_inactive_list(void)
Description not yet available.
Definition: df1b2fnl.cpp:74
Description not yet available.
virtual void xinit(init_df1b2vector &, int &ii)
Description not yet available.
Definition: df1b2fnl.cpp:631
virtual void allocate(void)
Description not yet available.
Definition: df1b2fnl.cpp:460
static unsigned int num_vars
Definition: df1b2fnl.h:64
static init_df1b2vector * py
Definition: df1b2fnl.h:68
virtual void xinit(dvector &, int &)
Definition: df1b2fnl.h:197
virtual void set_value(const init_df1b2vector &, const int &ii, const df1b2variable &)=0
int nvar_calc(void)
Description not yet available.
Definition: df1b2fnl.cpp:802
const df1b2_init_bounded_vector * p
Definition: df1b2fnl.h:146
void delete_from_list(void)
Description not yet available.
Definition: df1b2fnl.cpp:56
funnel_dependent_df1b2variable(const df1b2variable &)
Description not yet available.
Definition: df1b2fnl.cpp:473
virtual void set_index(imatrix &, int &ii)=0
static unsigned int nvarcalc_all()
Description not yet available.
Definition: df1b2fnl.cpp:614
virtual int nvar_calc(void)=0
static void reset(init_df1b2vector &x)
Description not yet available.
Definition: df1b2fnl.cpp:720