ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_m35.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
11 #include "fvar.hpp"
12 #include "admb_messages.h"
13 
18 dvariable colsum(const dvar_matrix& m, int col)
19 {
20  if (col < m.rowmin() || col > m.rowmax())
21  {
22  ADMB_ARRAY_BOUNDS_ERROR("Row out of bounds",
23  "dvariable colsum(const dvar_matrix& m, int col)",
24  m.rowmin(), m.rowmax(), col);
25  }
26  dvariable isum=0.0;
27  int mmin=m.rowmin();
28  int mmax=m.rowmax();
29  for (int i=mmin;i<=mmax;i++)
30  {
31  isum+=m(i,col);
32  }
33  return isum;
34 }
int rowmax(void) const
Definition: fvar.hpp:2564
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
int rowmin(void) const
Definition: fvar.hpp:2560
#define ADMB_ARRAY_BOUNDS_ERROR(message, function, lower_bounds, upper_bounds, index)
Definition: admb_messages.h:47
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518