ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f3arr5.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  dvar3_array tmp;
23  tmp.allocate(m);
24  for (int i=tmp.slicemin();i<=tmp.slicemax();i++)
25  {
26  tmp(i)=m(i)/d;
27  }
29  return tmp;
30  }
31 
36 dvar3_array operator/(const dvar3_array& m, const double d)
37  {
40  dvar3_array tmp;
41  tmp.allocate(m);
42  for (int i=tmp.slicemin();i<=tmp.slicemax();i++)
43  {
44  tmp(i)=m(i)/d;
45  }
47  return tmp;
48  }
49 
55  {
58  dvar3_array tmp;
59  tmp.allocate(m);
60  for (int i=tmp.slicemin();i<=tmp.slicemax();i++)
61  {
62  tmp(i)=m(i)/d;
63  }
65  return tmp;
66  }
67 
73  {
76  for (int i=slicemin();i<=slicemax();i++)
77  {
78  (*this)(i)/=d;
79  }
81  }
82 
87  void dvar3_array::operator/=(const double d)
88  {
91  for (int i=slicemin();i<=slicemax();i++)
92  {
93  (*this)(i)/=d;
94  }
96  }
Base class for dvariable.
Definition: fvar.hpp:1315
int slicemin() const
Definition: fvar.hpp:4274
void allocate(int sl, int sh, int nrl, int nrh, int ncl, int nch)
Allocate variable vector of matrices with dimensions [sl to sh] x ([nrl to nrh] x [ncl to nch]) where...
Definition: f3arr.cpp:91
int slicemax() const
Definition: fvar.hpp:4275
void operator/=(const prevariable &)
Description not yet available.
Definition: f3arr5.cpp:72
void RETURN_ARRAYS_INCREMENT()
Definition: gradstrc.cpp:478
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static _THREAD gradient_structure * _instance
Description not yet available.
Definition: fvar.hpp:4197
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.
Description not yet available.
Definition: fvar.hpp:3727