ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f3arr11.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 {
19  dvar3_array tmp;
20  tmp.allocate(m);
21  int min = tmp.slicemin();
22  int max = tmp.slicemax();
23  dvar_matrix* ptmpi = &tmp(min);
24  const dvar_matrix* pmi = &m(min);
25  for (int i = min;i <= max; ++i)
26  {
27  *ptmpi = mfexp(*pmi);
28  ++ptmpi;
29  ++pmi;
30  }
31  return tmp;
32 }
33 
38 dvar3_array mfexp(const dvar3_array& m, const double d)
39 {
40  dvar3_array tmp;
41  tmp.allocate(m);
42  int min = tmp.slicemin();
43  int max = tmp.slicemax();
44  dvar_matrix* ptmpi = &tmp(min);
45  const dvar_matrix* pmi = &m(min);
46  for (int i = min;i <= max; ++i)
47  {
48  *ptmpi = mfexp(*pmi, d);
49  ++ptmpi;
50  ++pmi;
51  }
52  return tmp;
53 }
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
d3_array mfexp(const d3_array &m)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr7.cpp:10
#define min(a, b)
Definition: cbivnorm.cpp:188
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
Definition: fvar.hpp:4197
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
#define max(a, b)
Definition: cbivnorm.cpp:189