ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_m57.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 // file fvar.cpp
12 // constructors, destructors and misc functions involving class prevariable
13 
14 #include "fvar.hpp"
15 
21 {
22  int mmin = m.indexmin();
23  int mmax = m.indexmax();
24  dvar_matrix tmp(mmin, mmax);
25 
26  dvar_vector* ptmpi = &tmp(mmin);
27  const dvector* pmi = &m(mmin);
28  for (int i=mmin;i<=mmax;i++)
29  {
30  *ptmpi = x + *pmi;
31 
32  ++ptmpi;
33  ++pmi;
34  }
35  return tmp;
36 }
37 
43 {
44  int mmin=m.indexmin();
45  int mmax=m.indexmax();
46  dvar_matrix tmp(mmin, mmax);
47 
48  dvar_vector* ptmpi = &tmp(mmin);
49  const dvector* pmi = &m(mmin);
50  for (int i=mmin;i<=mmax;i++)
51  {
52  *ptmpi = x - *pmi;
53 
54  ++ptmpi;
55  ++pmi;
56  }
57  return tmp;
58 }
d3_array operator-(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
Definition: d3arr2a.cpp:152
#define x
Vector of double precision numbers.
Definition: dvector.h:50
int indexmin() const
Definition: fvar.hpp:2917
d3_array operator+(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
Definition: d3arr2a.cpp:132
ADMB variable vector.
Definition: fvar.hpp:2172
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
Definition: fvar.hpp:2819
int indexmax() const
Definition: fvar.hpp:2921
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518