ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nvarcall.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  */
11 #include <admodel.h>
12 
18  {
19  int nvar=0;
20  for (int i=0;i<num_initial_params;i++)
21  {
22  nvar+= (varsptr[i])->size_count();
23  }
24  return nvar;
25  }
26 
32  {
33  dvector& x=(dvector&) _x;
34  int ii=1;
35  for (int i=0;i<num_initial_params;i++)
36  {
37  (varsptr[i])->set_value_inv(x,ii);
38  }
39  }
40 
46  {
47  dvector& _pen=(dvector&) __pen;
48  int ii=1;
49  dvariable pen=0.0;
50  dvariable pen1;
51  for (int i=0;i<num_initial_params;i++)
52  {
53  (varsptr[i])->set_value(x,ii,pen1);
54  _pen(ii-1)=value(pen1);
55  pen+=pen1;
56  }
57  return pen;
58  }
virtual void set_value(const dvar_vector &, const int &, const dvariable &pen)=0
virtual unsigned int size_count() const =0
static dvariable reset_all(const dvar_vector &x, const dvector &pen)
Description not yet available.
Definition: nvarcall.cpp:45
#define x
Vector of double precision numbers.
Definition: dvector.h:50
static void xinit_all(const dvector &x)
Description not yet available.
Definition: nvarcall.cpp:31
ADMB variable vector.
Definition: fvar.hpp:2172
Description not yet available.
static int nvarcalc_all(void)
Description not yet available.
Definition: nvarcall.cpp:17
static int num_initial_params
Definition: admodel.h:836
virtual void set_value_inv(const dvector &, const int &)=0
dvector value(const df1_one_vector &v)
Definition: df11fun.cpp:69
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
static adlist_ptr varsptr
Definition: admodel.h:838