ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dmat27.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
10 double colsum(const dmatrix& m, int col)
11 {
12  int mmin = m.rowmin();
13  int mmax = m.rowmax();
14 #ifndef OPT_LIB
15  if (col < mmin || col > mmax)
16  {
17  cerr << "Row out of bounds in function"
18  " colsum(const imatrix& m,int col)" << endl;
19  ad_exit(1);
20  }
21 #endif
22  double sum = 0;
23  const dvector* pmi = &m(mmin);
24  for (int i = mmin; i <= mmax; ++i)
25  {
26  sum += *(pmi->get_v() + col);
27  ++pmi;
28  }
29  return sum;
30 }
Vector of double precision numbers.
Definition: dvector.h:50
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
prnstream & endl(prnstream &)
int rowmax() const
Definition: fvar.hpp:2929
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double colsum(const dmatrix &m, int col)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: dmat27.cpp:10
Description not yet available.
Definition: fvar.hpp:2819
double *& get_v(void)
Definition: dvector.h:148
int rowmin() const
Definition: fvar.hpp:2925