ADMB Documentation  11.5.3349
 All Classes Files Functions Variables Typedefs Friends Defines
dmat27.cpp
Go to the documentation of this file.
00001 
00005 #include "fvar.hpp"
00006 
00010 double colsum(const dmatrix& m, int col)
00011 {
00012   int mmin = m.rowmin();
00013   int mmax = m.rowmax();
00014   if (col < mmin || col > mmax)
00015   {
00016     cerr << "Row out of bounds in function"
00017             " colsum(const imatrix& m,int col)" << endl;
00018     ad_exit(1);
00019   }
00020   double sum = 0;
00021   for (int i = mmin; i <= mmax; ++i)
00022   {
00023     sum += m(i, col);
00024   }
00025   return sum;
00026 }