ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
d7arr1.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
12 d7_array operator/(const d7_array& darray, const double divisor)
13 {
14  d7_array results;
15  results.allocate(darray);
16  for (int i = darray.indexmin(); i <= darray.indexmax(); ++i)
17  {
18  results(i) = darray(i) / divisor;
19  }
20  return results;
21 }
27 void d7_array::operator/=(const double divisor)
28 {
29  for (int i = indexmin(); i <= indexmax(); ++i)
30  {
31  elem(i) /= divisor;
32  }
33 }
39 double sum(const d7_array& darray)
40 {
41  double total = 0.0;
42  for (int i = darray.indexmin(); i <= darray.indexmax(); ++i)
43  {
44  total += sum(darray.elem(i));
45  }
46  return total;
47 }
Description not yet available.
Definition: fvar.hpp:7054
d6_array & elem(int i)
Definition: fvar.hpp:7231
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr.cpp:21
int indexmax() const
Definition: fvar.hpp:7218
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void allocate(int l7, int u7)
Allocate a vector of empty d6_arrays.
Definition: d7arr.cpp:161
void operator/=(double d)
Divide all elements of d7_array by divisor.
Definition: d7arr1.cpp:27
int indexmin() const
Definition: fvar.hpp:7214
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
Definition: d3arr2b.cpp:14