ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
model11.cpp
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 #include <admodel.h>
8 
10 
12 {
13  cifstream& s=(cifstream&) _s;
14  s >> value(x);
15  return s;
16 }
17 
19 {
21  cifstream& s=(cifstream&) _s;
22  int mmin=v.indexmin();
23  int mmax=v.indexmax();
24  for (int i=mmin;i<=mmax;i++)
25  {
26  s >> v(i);
27  if (!s)
28  {
29  cerr << "Error reading element " << i << " of the vector "
30  << v.label() << endl;
31  }
32  }
33  return s;
34 }
35 
37 {
38  cifstream& s=(cifstream&) _s;
39  s >> dvar_matrix(m);
40  return s;
41 }
42 
43 ostream& operator<<(const ostream& _s, const label_class& lc)
44 {
45  ostream& s=(ostream&) _s;
46  s << "# " << lc.name <<":" << endl;
47  return s;
48 }
49 
50 void named_dvar_matrix::allocate(int rmin,int rmax,int cmin,int cmax,
51  const char * s)
52 {
53  dvar_matrix::allocate(rmin,rmax,cmin,cmax);
55 }
56 
57 void named_dvar_matrix::allocate(int rmin,int rmax,
58  const char * s)
59 {
60  dvar_matrix::allocate(rmin,rmax);
62 }
63 
64 void named_dvar_matrix::allocate(const char * s)
65 {
68 }
69 
70 void named_dvar_matrix::allocate(int rmin,int rmax,const index_type& cmin,
71  const index_type& cmax, const char * s)
72 {
73  dvar_matrix::allocate(rmin,rmax,cmin,cmax);
75 }
82 {
83  this->dvar_matrix::operator=(values);
84  return *this;
85 }
92 {
93  this->dvar_matrix::operator=(dm);
94  return *this;
95 }
102 {
103  this->dvar_matrix::operator=(value);
104  return *this;
105 }
112 {
113  this->dvar_matrix::operator=(values);
114  return *this;
115 }
122 {
123  this->dvar_matrix::operator=(values);
124  return *this;
125 }
132 {
133  this->dvar_matrix::operator=(value);
134  return *this;
135 }
142 {
143  this->dvar_matrix::operator=(value);
144  return *this;
145 }
146 
148 {
149  this->dvar_vector::operator=(m);
150  return *this;
151 }
152 
154 {
155  this->dvar_vector::operator=(m);
156  return *this;
157 }
159 {
160  this->dvar_vector::operator=(m);
161  return *this;
162 }
164 {
165  this->dvar_vector::operator=(m);
166  return *this;
167 }
168 
170 {
171  this->dvar_vector::operator=(m);
172  return *this;
173 }
174 
176 {
177  this->dvector::operator=(m);
178  return *this;
179 }
181 {
182  this->dvector::operator=(m);
183  return *this;
184 }
185 
187 {
188  this->dvector::operator=(m);
189  return *this;
190 }
192 {
193  this->dvector::operator=(m);
194  return *this;
195 }
196 
197 
199 {
200  this->dvar_vector::operator=(m);
201  return *this;
202 }
204 {
205  this->dvar_vector::operator=(m);
206  return *this;
207 }
208 
210 {
211  this->dvariable::operator=(m);
212  return *this;
213 }
214 
216 {
217  this->dvariable::operator=(m);
218  return *this;
219 }
220 
222 {
223  this->dvariable::operator=(m);
224  return *this;
225 }
226 
228  const prevariable& m)
229 {
230  this->dvariable::operator=(m);
231  return *this;
232 }
233 
234  const char * param_init_matrix::label(void)
235  {
236  return model_name_tag::label().mychar();
237  }
238 
239 
241  {
242  return model_name_tag::label().mychar();
243  }
244 
245 
247  {
248  return model_name_tag::label().mychar();
249  }
250 
251 
252  const char * param_init_vector::label(void)
253  {
254  return model_name_tag::label().mychar();
255  }
256 
257 
258  const char * param_init_number::label(void)
259  {
260  return model_name_tag::label().mychar();
261  }
262 
263 
264 void named_dvar3_array::allocate(int hsl,int hsu,int rmin,int rmax,
265  int cmin,int cmax,const char * s)
266 {
267  dvar3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
269 }
270 
271 void named_dvar3_array::allocate(int hsl,int hsu,int rmin,int rmax,
272  const char * s)
273 {
274  dvar3_array::allocate(hsl,hsu,rmin,rmax);
276 }
277 
278 void named_dvar3_array::allocate(int hsl,int hsu,
279  const index_type& rmin,const index_type& rmax, const char * s)
280 {
281  dvar3_array::allocate(hsl,hsu,rmin,rmax);
283 }
284 
285 void named_dvar3_array::allocate(int hsl,int hsu,const char * s)
286 {
287  dvar3_array::allocate(hsl,hsu);
289 }
290 
291 void named_dvar3_array::allocate(const char * s)
292 {
295 }
296 
297 void named_dvar3_array::allocate(int hsl, int hsu, const ivector& rmin,
298  int rmax, int cmin, int cmax, const char *s)
299 {
300  dvar3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
302 }
303 
304 void named_dvar3_array::allocate(int hsl,int hsu,int rmin,
305  const ivector& rmax, int cmin, int cmax, const char *s)
306 {
307  dvar3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
309 }
310 
311 void named_dvar3_array::allocate(int hsl, int hsu, const ivector& rmin,
312  const ivector& rmax, int cmin, int cmax, const char *s)
313 {
314  dvar3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
316 }
317 
318 
319 void named_dvar3_array::allocate(int hsl, int hsu, int rmin, int rmax,
320  const ivector& cmin, int cmax, const char *s)
321 {
322  dvar3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
324 }
325 
326 void named_dvar3_array::allocate(int hsl, int hsu, int rmin, int rmax,
327  const ivector& cmin, const ivector& cmax, const char *s)
328 {
329  dvar3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
331 }
332 
333 void named_dvar3_array::allocate(int hsl, int hsu, int rmin, int rmax,
334  int cmin, const ivector& cmax, const char *s)
335 {
336  dvar3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
338 }
339 
341 {
342  this->dvar3_array::operator=(m);
343  return *this;
344 }
345 
346 
347 
349 {
350  this->dvar3_array::operator=(m);
351  return *this;
352 }
353 void named_dmatrix::allocate(int rmin,int rmax,int cmin,int cmax,
354  const char * s)
355 {
356  dmatrix::allocate(rmin,rmax,cmin,cmax);
358 }
359 
360 
361 void named_dmatrix::allocate(int rmin,int rmax,const ivector& cmin,int cmax,
362  const char * s)
363 {
364  dmatrix::allocate(rmin,rmax,cmin,cmax);
366 }
367 
368 
369 void named_dmatrix::allocate(int rmin,int rmax,const char * s)
370 {
371  dmatrix::allocate(rmin,rmax);
373 }
374 
375 
376 void named_dmatrix::allocate(const char * s)
377 {
380 }
381 
382 
383 void named_dmatrix::allocate(int rmin,int rmax,int cmin,const ivector& cmax,
384  const char * s)
385 {
386  dmatrix::allocate(rmin,rmax,cmin,cmax);
388 }
389 
390 void named_dmatrix::allocate(int rmin,int rmax,const ivector& cmin,
391  const ivector& cmax, const char * s)
392 {
393  dmatrix::allocate(rmin,rmax,cmin,cmax);
395 }
402 {
403  dmatrix::operator=(values);
404  return *this;
405 }
412 {
413  dmatrix::operator=(value);
414  return *this;
415 }
416 
418 {
420  return *this;
421 }
422 
424 {
426  return *this;
427 }
428 
430 {
432  return *this;
433 }
434 
436 {
438  return *this;
439 }
440 
441 void named_d3_array::allocate(int hsl,int hsu,int rmin,int rmax,
442  int cmin,int cmax,const char * s)
443 {
444  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
446 }
447 
448 void named_d3_array::allocate(int hsl,int hsu,int rmin,int rmax,
449  const char * s)
450 {
451  d3_array::allocate(hsl,hsu,rmin,rmax);
453 }
454 
455 void named_d3_array::allocate(int hsl,int hsu,
456  const index_type& rmin,const index_type& rmax,const char * s)
457 {
458  d3_array::allocate(hsl,hsu,rmin,rmax);
460 }
461 
462 void named_d3_array::allocate(int hsl,int hsu,const char * s)
463 {
464  d3_array::allocate(hsl,hsu);
466 }
467 
468 void named_d3_array::allocate(const char * s)
469 {
472 }
473 
474 void named_d3_array::allocate(int hsl, int hsu, const index_type& rmin,
475  const index_type& rmax, const index_type& cmin,
476  const index_type& cmax, const char *s)
477 {
478  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
480 }
481 
482 void named_d3_array::allocate(int hsl, int hsu, const ivector& rmin,
483  int rmax,int cmin,int cmax,const char * s)
484 {
485  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
487 }
488 
489 void named_d3_array::allocate(int hsl,int hsu,int rmin,
490  const ivector& rmax, int cmin, int cmax, const char *s)
491 {
492  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
494 }
495 
496 void named_d3_array::allocate(int hsl, int hsu, const ivector& rmin,
497  const ivector& rmax,int cmin,int cmax,const char * s)
498 {
499  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
501 }
502 
503 void named_d3_array::allocate(int hsl, int hsu, int rmin, int rmax,
504  const ivector& cmin, int cmax, const char *s)
505 {
506  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
508 }
509 
510 void named_d3_array::allocate(int hsl, int hsu, int rmin, int rmax,
511  int cmin, const ivector& cmax, const char *s)
512 {
513  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
515 }
516 
517 void named_d3_array::allocate(int hsl, int hsu, int rmin, int rmax,
518  const ivector& cmin, const ivector& cmax, const char * s)
519 {
520  d3_array::allocate(hsl,hsu,rmin,rmax,cmin,cmax);
522 }
523 
525 {
527  return *this;
528 }
535 {
536  named_dmatrix::operator=(values);
537  return *this;
538 }
545 {
547  return *this;
548 }
Base class for dvariable.
Definition: fvar.hpp:1315
void allocate(void)
Does NOT allocate, but initializes empty d3_array.
Definition: d3arr10.cpp:11
Uses polymorphism to get index information from various data types to be used in constructing and all...
Definition: fvar.hpp:7731
named_dvar_matrix & operator=(const double m)
Assign named_dvar_matrix with value.
Definition: model11.cpp:101
label_class label(void)
Definition: admodel.h:172
void allocate(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: dmat0.cpp:8
data_matrix & operator=(const dmatrix &m)
Assign data_matrix with values.
Definition: model11.cpp:534
Description not yet available.
Definition: admodel.h:2303
param_stddev_matrix & operator=(const double m)
Assign param_stddev_matrix with value.
Definition: model11.cpp:141
Description not yet available.
Definition: admodel.h:242
param_stddev_vector & operator=(const dvar_vector &m)
Definition: model11.cpp:147
#define x
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Definition: fvar.hpp:140
Vector of double precision numbers.
Definition: dvector.h:50
Description not yet available.
Definition: admodel.h:521
param_init_bounded_number & operator=(const double m)
Definition: model11.cpp:221
const char * mychar(void)
Definition: admodel.h:156
Description not yet available.
Definition: admodel.h:1151
param_init_number & operator=(const double m)
Definition: model11.cpp:209
dvector & operator=(const dvector &t)
Assignment operator for dvector argument.
Definition: dvector.cpp:244
named_dvar_vector & operator=(const dvar_vector &m)
Definition: model11.cpp:153
Description not yet available.
Definition: admodel.h:461
const char * name
Definition: admodel.h:152
ADMB variable vector.
Definition: fvar.hpp:2172
dmatrix & operator=(const dmatrix &t)
Assign values in other to dmatrix.
Definition: dmat4.cpp:27
Description not yet available.
Definition: admodel.h:968
Description not yet available.
Definition: admodel.h:271
Description not yet available.
Definition: admodel.h:1761
virtual const char * label(void)
Definition: model11.cpp:258
d3_array & operator=(const d3_array &m1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr8.cpp:82
void allocate(const char *s)
Definition: model.cpp:112
Description not yet available.
Definition: admodel.h:2280
dvar3_array & operator=(const d3_array &m1)
Assign element values from scalar arr3 to dvar3_array.
Definition: f3arr13.cpp:19
Description not yet available.
Definition: admodel.h:1228
virtual const char * label(void)
Definition: model11.cpp:240
prnstream & endl(prnstream &)
Array of integers(int) with indexes from index_min to indexmax.
Definition: ivector.h:50
Description not yet available.
Definition: admodel.h:2369
data_vector & operator=(const dvector &m)
Definition: model11.cpp:186
Description not yet available.
Definition: admodel.h:487
void allocate(void)
Does not allocate, but initializes members.
Definition: fvar_mat.cpp:479
Description not yet available.
Description not yet available.
Definition: admodel.h:180
Description not yet available.
Definition: fvar.hpp:2819
Description not yet available.
Definition: fvar.hpp:4197
named_dvar3_array & operator=(const dvar3_array &m)
Definition: model11.cpp:340
values
Definition: adjson.h:22
Description not yet available.
Definition: admodel.h:1316
virtual const char * label(void)
Definition: model11.cpp:252
dvariable & operator=(const double x)
Assigns a value to a dvariable object.
Definition: fvar.hpp:1595
named_d3_array & operator=(const d3_array &m)
Definition: model11.cpp:524
named_dvariable & operator=(const prevariable &m)
Definition: model11.cpp:435
prevariable & operator=(const prevariable &)
Assigns a value to a prevariable object.
Definition: fvar_o10.cpp:61
istream & operator>>(const istream &input, const d3_array &arr3)
Read values from input stream into arr3.
Definition: d3_io.cpp:60
Description not yet available.
Definition: admodel.h:312
ostream & operator<<(const ostream &_s, preshowpoint p)
Description not yet available.
Definition: admanip.cpp:48
void allocate(void)
Does not allocte, but initialize class members.
Definition: f3arr17.cpp:18
dvar_matrix & operator=(const dvar_matrix &)
Assigns other values to dvar_matrix.
Definition: fvar_mat.cpp:515
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
Description not yet available.
Definition: admodel.h:1589
virtual const char * label(void)
Definition: model11.cpp:234
named_dmatrix & operator=(const dmatrix &m)
Assign named_dmatrix with values.
Definition: model11.cpp:401
dvar_vector & operator=(const dvar_vector &t)
Assign values from other t to dvar_vector.
Definition: fvar_a20.cpp:31
dvector value(const df1_one_vector &v)
Definition: df11fun.cpp:69
Description not yet available.
Definition: fvar.hpp:3727
virtual const char * label(void)
Definition: model11.cpp:246
param_stddev_number & operator=(const prevariable &)
Definition: model11.cpp:417
named_dvector & operator=(const dvector &m)
Definition: model11.cpp:175
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
Description not yet available.
Definition: admodel.h:150