ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
d4arr1.cpp
Go to the documentation of this file.
1 
6 #include "fvar.hpp"
7 
14 d4_array sqrt(const d4_array& darray)
15 {
16  d4_array results;
17  results.allocate(darray);
18  for (int i = results.hslicemin(); i <= results.hslicemax(); ++i)
19  {
20  results(i) = sqrt(darray(i));
21  }
22  return results;
23 }
30 d4_array exp(const d4_array& darray)
31 {
32  d4_array results;
33  results.allocate(darray);
34  for (int i = results.hslicemin(); i <= results.hslicemax(); ++i)
35  {
36  results(i) = exp(darray(i));
37  }
38  return results;
39 }
46 d4_array mfexp(const d4_array& darray)
47 {
48  d4_array results;
49  results.allocate(darray);
50  for (int i = results.hslicemin(); i <= results.hslicemax(); ++i)
51  {
52  results(i) = mfexp(darray(i));
53  }
54  return results;
55 }
62 d4_array log(const d4_array& darray)
63 {
64  d4_array results;
65  results.allocate(darray);
66  for (int i = results.hslicemin(); i <= results.hslicemax(); ++i)
67  {
68  results(i) = log(darray(i));
69  }
70  return results;
71 }
void allocate(int hsl, int hsu, int sl, int sh, int nrl, int nrh, int ncl, int nch)
Allocate arrays with dimension [hsl to hsu] x [sl to sh] x [nrl to nrh] x [ncl to nch]...
Definition: d4arr.cpp:344
int hslicemax() const
Definition: fvar.hpp:5317
d3_array mfexp(const d3_array &m)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr7.cpp:10
Description not yet available.
Definition: fvar.hpp:5161
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2c.cpp:11
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
Definition: d3arr2a.cpp:28
int hslicemin() const
Definition: fvar.hpp:5313
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2a.cpp:13