ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_m31.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 dvariable
13 
14 #include "fvar.hpp"
15 
16 #ifdef __TURBOC__
17  #pragma hdrstop
18  #include <iostream.h>
19 #endif
20 
21 #ifdef __ZTC__
22  #include <iostream.hpp>
23 #endif
24 
25 
26 #include <stdio.h>
27 #ifndef __SUN__
28 #endif
29 #include <math.h>
30 
35 dvar_matrix operator/(const double e, const dvar_matrix& m)
36 {
37  dvar_matrix tmp;
38  int min = m.indexmin();
39  int max = m.indexmax();
40  tmp.allocate(min, max);
41 
42  dvar_vector* ptmpi = &tmp(min);
43  const dvar_vector* pmi = &m(min);
44  for (int i = min; i <= max; ++i)
45  {
46  *ptmpi = e / *pmi;
47 
48  ++ptmpi;
49  ++pmi;
50  }
51  return tmp;
52 }
53 
59 {
60  dvar_matrix tmp;
61 
62  int min = m.indexmin();
63  int max = m.indexmax();
64  tmp.allocate(min, max);
65 
66  dvar_vector* ptmpi = &tmp(min);
67  const dvar_vector* pmi = &m(min);
68  for (int i = min; i <= max; ++i)
69  {
70  *ptmpi = e / *pmi;
71 
72  ++ptmpi;
73  ++pmi;
74  }
75  return tmp;
76 }
77 
83 {
84  dvar_matrix tmp;
85 
86  int min = m.indexmin();
87  int max = m.indexmax();
88  tmp.allocate(min, max);
89 
90  dvar_vector* ptmpi = &tmp(min);
91  const dvector* pmi = &m(min);
92  for (int i = min; i <= max; ++i)
93  {
94  *ptmpi = e / *pmi;
95 
96  ++ptmpi;
97  ++pmi;
98  }
99  return tmp;
100 }
Base class for dvariable.
Definition: fvar.hpp:1315
Vector of double precision numbers.
Definition: dvector.h:50
int indexmin() const
Definition: fvar.hpp:2917
ADMB variable vector.
Definition: fvar.hpp:2172
#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:2819
int indexmax() const
Definition: fvar.hpp:2921
int indexmax(void) const
Definition: fvar.hpp:2572
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
void allocate(int nrl, int nrh, int ncl, int nch)
Allocates AD variable matrix with dimensions nrl to nrh by ncl to nch.
Definition: fvar_mat.cpp:216
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
Definition: d3arr2b.cpp:14
#define max(a, b)
Definition: cbivnorm.cpp:189
int indexmin(void) const
Definition: fvar.hpp:2568