ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_m29.cpp
Go to the documentation of this file.
00001 
00006 #include "fvar.hpp"
00007 
00011 dvariable mean(const dvar_matrix& m)
00012 {
00013   dvariable tmp;
00014   const int size = size_count(m);
00015   if (size > 0)
00016   {
00017     tmp = sum(m) / double(size);
00018   }
00019   else
00020   {
00021     cerr << "Error: Unable to compute mean of dvar_matrix.\n";
00022     ad_exit(1);
00023   }
00024   return tmp;
00025 }