ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f1b2v11.cpp
Go to the documentation of this file.
1 /*
2 Author: David Fournier
3 Copyright (c) 2008-2012 Regents of the University of California
4 */
5 
6 #include <df1b2fun.h>
7 
14 {
16  int mmin=x.indexmin();
17  int mmax=x.indexmax();
18  df1b2vector tmp;
19  tmp.noallocate(mmin,mmax-1);
20  int i;
21  for (i=mmin;i<mmax;i++)
22  {
23  tmp(i)=x(i+1)-x(i);
24  }
25  return tmp;
26 }
27 
33 {
35  int mmin=x.indexmin();
36  int mmax=x.indexmax();
37  df1b2vector tmp;
38  tmp.noallocate(mmin,mmax);
39  int i;
40  for (i=mmin;i<=mmax;i++)
41  {
42  tmp(i)=square(x(i));
43  }
44  return tmp;
45 }
46 
52 {
54  int mmin=x.indexmin();
55  int mmax=x.indexmax();
56  df1b2vector tmp;
57  tmp.noallocate(mmin,mmax);
58  int i;
59  for (i=mmin;i<=mmax;i++)
60  {
61  tmp(i)=square(x(i));
62  }
63  return tmp;
64 }
#define x
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Definition: fvar.hpp:140
Description not yet available.
Definition: df1b2fun.h:953
d3_array cube(const d3_array &m)
Description not yet available.
Definition: d3arr5.cpp:17
void noallocate(int lib, int ub)
Description not yet available.
Definition: f1b2vc1.cpp:733
dvector first_difference(const dvector &values)
Returns dvector containing the differences of an values(i) and values(i + 1) for i = 1 to values...
Definition: dvec_dif.cpp:17
Description not yet available.
double square(const double value)
Return square of value; constant object.
Definition: d3arr4.cpp:16