ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
d3arr2c.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
11 d3_array sqrt(const d3_array& arr3)
12 {
13  d3_array results;
14  results.allocate(arr3);
15  for (int i = results.slicemin(); i <= results.slicemax(); ++i)
16  {
17  results(i) = sqrt(arr3(i));
18  }
19  return results;
20 }
25 d3_array sqr(const d3_array& arr3)
26 {
27  d3_array results;
28  results.allocate(arr3);
29  for (int i = results.slicemin(); i <= results.slicemax(); ++i)
30  {
31  results(i) = sqr(arr3(i));
32  }
33  return results;
34 }
d3_array sqr(const d3_array &arr3)
Returns d3_array with square values from arr3.
Definition: d3arr2c.cpp:25
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 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.
int slicemin() const
Definition: fvar.hpp:3826
Description not yet available.
Definition: fvar.hpp:3727