ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f3arr6.cpp
Go to the documentation of this file.
1 
6 #include "fvar.hpp"
7 
14 {
15  dvar3_array result;
16  result.allocate(vararr3);
17 
18  int min = result.slicemin();
19  int max = result.slicemax();
20  dvar_matrix* presulti = &result(min);
21  const dvar_matrix* pvararr3i = &vararr3(min);
22  for (int i = min; i <= max; ++i)
23  {
24  *presulti = square(*pvararr3i);
25 
26  ++presulti;
27  ++pvararr3i;
28  }
29  return result;
30 }
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
#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
double square(const double value)
Return square of value; constant object.
Definition: d3arr4.cpp:16