ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_m29.cpp
Go to the documentation of this file.
1 
6 #include "fvar.hpp"
7 
12 {
13  dvariable tmp;
14  const unsigned int size = size_count(m);
15  if (size > 0)
16  {
17  tmp = sum(m) / size;
18  }
19  else
20  {
21  cerr << "Error: Unable to compute mean of dvar_matrix.\n";
22  ad_exit(1);
23  }
24  return tmp;
25 }
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr.cpp:21
exitptr ad_exit
Definition: gradstrc.cpp:53
double mean(const dvector &vec)
Returns computed mean of vec.
Definition: cranfill.cpp:43
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
unsigned int size_count(const dvector &x)
Returns total size of elements in vector x.
Definition: dsize.cpp:17
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518