ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
d3arr2b.cpp
Go to the documentation of this file.
1 
7 #include "fvar.hpp"
8 
14 d3_array operator/(const d3_array& m, const double d)
15 {
16  d3_array tmp;
17  tmp.allocate(m);
18  int min = tmp.slicemin();
19  int max = tmp.slicemax();
20  dmatrix* ptmpi = &tmp(min);
21  const dmatrix* pmi = &m(min);
22  for (int i = min; i <= max; ++i)
23  {
24  *ptmpi = *pmi / d;
25  ++ptmpi;
26  ++pmi;
27  }
28  return tmp;
29 }
33 void d3_array::operator/=(const double d)
34 {
35  int min = slicemin();
36  int max = slicemax();
37  dmatrix* pti = t + min;
38  for (int i = min; i <= max; ++i)
39  {
40  *pti /= d;
41  ++pti;
42  }
43 }
void operator/=(double d)
Divide each element of d3_array by d.
Definition: d3arr2b.cpp:33
void allocate(const ad_integer &sl, const ad_integer &sh, const index_type &nrl, const index_type &nrh, const index_type &ncl, const index_type &nch)
Allocate array of matrices with dimensions [sl to sh] x [nrl to nrh] x [ncl to nch].
Definition: indextyp.cpp:327
dmatrix * t
Definition: fvar.hpp:3729
int slicemax() const
Definition: fvar.hpp:3830
dvector * d
Definition: fvar.hpp:3649
#define min(a, b)
Definition: cbivnorm.cpp:188
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int slicemin() const
Definition: fvar.hpp:3826
Description not yet available.
Definition: fvar.hpp:2819
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
Definition: d3arr2b.cpp:14
#define max(a, b)
Definition: cbivnorm.cpp:189
Description not yet available.
Definition: fvar.hpp:3727