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 }
Generated on Tue Mar 8 2016 19:51:33 for ADMB Documentation by 1.8.0 |