ADMB Documentation  11.1.2500
 All Classes Files Functions Variables Typedefs Friends Defines
dmat27.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: dmat27.cpp 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 
00017 double colsum(const dmatrix& m, int col)
00018 {
00019   if (col<m.rowmin() || col>m.rowmax())
00020   {
00021     cerr << "Row out of bounds in function"
00022             " colsum(const imatrix& m,int col)" << endl;
00023     ad_exit(1);
00024   }
00025   double isum=0;
00026   int mmin=m.rowmin();
00027   int mmax=m.rowmax();
00028   for (int i=mmin;i<=mmax;i++)
00029   {
00030     isum+=m(i,col);
00031   }
00032   return isum;
00033 }