ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f5arr2.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  {
21 
22  dvar5_array tmp;
23  tmp.allocate(m);
24  for (int i=tmp.indexmin();i<=tmp.indexmax();i++)
25  {
26  tmp(i)=m(i)/d;
27  }
29  return tmp;
30  }
31 
36 dvar5_array operator/(const dvar5_array& m, const double d)
37  {
40  dvar5_array tmp;
41  tmp.allocate(m);
42  for (int i=tmp.indexmin();i<=tmp.indexmax();i++)
43  {
44  tmp(i)=m(i)/d;
45  }
47  return tmp;
48  }
49 
55  {
58  dvar5_array tmp;
59  tmp.allocate(m);
60  for (int i=tmp.indexmin();i<=tmp.indexmax();i++)
61  {
62  tmp(i)=m(i)/d;
63  }
65  return tmp;
66  }
67 
73  {
76  for (int i=indexmin();i<=indexmax();i++)
77  {
78  (*this)(i)/=d;
79  }
81  }
82 
87 void dvar5_array::operator/=(const double& d)
88  {
91  for (int i=indexmin();i<=indexmax();i++)
92  {
93  (*this)(i)/=d;
94  }
96  }
Base class for dvariable.
Definition: fvar.hpp:1315
int indexmax() const
Definition: fvar.hpp:6650
void allocate(int hhsl, int hhsu, int hsl, int hsu, int sl, int sh, int nrl, int nrh, int ncl, int nch)
Allocate dvar5_array with dimensions [hsl to hsu] x [sl to sh] x [nrl to nrh] x [ncl to nch] x [l5 to...
Definition: f5arr.cpp:435
void RETURN_ARRAYS_INCREMENT()
Definition: gradstrc.cpp:478
Description not yet available.
Definition: fvar.hpp:6498
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int indexmin() const
Definition: fvar.hpp:6646
static _THREAD gradient_structure * _instance
void operator/=(const prevariable &d)
Description not yet available.
Definition: f5arr2.cpp:72
Description not yet available.
Definition: fvar.hpp:6331
void RETURN_ARRAYS_DECREMENT()
Definition: gradstrc.cpp:511
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
Definition: d3arr2b.cpp:14
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.