ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_a31.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 
18 {
19  int cmin=v.colmin();
20  int cmax=v.colmax();
21  int rmin=v.rowmin();
22  int rmax=v.rowmax();
23 
24  dvar_vector tmp(cmin, cmax);
25  tmp.initialize();
26  for (int j = cmin; j <= cmax; ++j)
27  {
28  for (int i = rmin; i <= rmax; ++i)
29  {
30  tmp(j) += v(i, j);
31  }
32  }
33  return tmp;
34 }
35 
41 {
42  //int cmin=v.colmin();
43  //int cmax=v.colmax();
44  int rmin=v.rowmin();
45  int rmax=v.rowmax();
46 
47  dvar_vector tmp(rmin, rmax);
48  const dvar_vector* pvi = &v(rmin);
49  for (int i = rmin; i <= rmax; ++i)
50  {
51  tmp(i) = sum(*pvi);
52  ++pvi;
53  }
54  return tmp;
55 }
int rowmax(void) const
Definition: fvar.hpp:2564
int colmin(void) const
Definition: fvar.hpp:2552
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr.cpp:21
ADMB variable vector.
Definition: fvar.hpp:2172
dvector rowsum(const dmatrix &matrix)
Returns dvector where each element contains the sum total of each row in matrix.
Definition: dvect12.cpp:61
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
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
void initialize(const dvector &ww)
Description not yet available.
Definition: fvar_a24.cpp:63
int colmax(void) const
Definition: fvar.hpp:2556