ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
d3arr7.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
11 {
12  d3_array tmp;
13  tmp.allocate(m);
14  int min = tmp.slicemin();
15  int max = tmp.slicemax();
16  dmatrix* ptmpi = &tmp(min);
17  const dmatrix* pmi = &m(min);
18  for (int i = min; i <= max; ++i)
19  {
20  *ptmpi = mfexp(*pmi);
21  ++ptmpi;
22  ++pmi;
23  }
24  return tmp;
25 }
29 d3_array mfexp(const d3_array& m, const double d)
30 {
31  d3_array tmp;
32  tmp.allocate(m);
33  int min = tmp.slicemin();
34  int max = tmp.slicemax();
35  dmatrix* ptmpi = &tmp(min);
36  const dmatrix* pmi = &m(min);
37  for (int i = min; i <= max; ++i)
38  {
39  *ptmpi = mfexp(*pmi, d);
40  ++ptmpi;
41  ++pmi;
42  }
43  return tmp;
44 }
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
int slicemax() const
Definition: fvar.hpp:3830
d3_array mfexp(const d3_array &m)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr7.cpp:10
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
#define max(a, b)
Definition: cbivnorm.cpp:189
Description not yet available.
Definition: fvar.hpp:3727