ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f3arr13.cpp
Go to the documentation of this file.
1 
8 #include <fvar.hpp>
9 
10 #ifdef DEBUG
11 #include <cassert>
12 #endif
13 
20 {
21 #ifdef DEBUG
22  assert(allocated(arr3));
23 #endif
24  int min = slicemin();
25  int max = slicemax();
26 #ifndef OPT_LIB
27  if (min != arr3.slicemin() || max != arr3.slicemax())
28  {
29  cerr << " Incompatible array bounds in "
30  << "dvar3_array& dvar3_array::operator=(const d3_array&)\n";
31  ad_exit(1);
32  }
33 #endif
34  for (int i = slicemin(); i <= slicemax(); ++i)
35  {
36  elem(i) = arr3.elem(i);
37  }
38  dvar_matrix* pti = t + min;
39  const dmatrix* parr3i = &arr3(min);
40  for (int i = min; i <= max; ++i)
41  {
42  *pti = *parr3i;
43  ++pti;
44  ++parr3i;
45  }
46  return *this;
47 }
54 {
55  int min = slicemin();
56  int max = slicemax();
57  dvar_matrix* pti = t + min;
58  for (int i = min; i <= max; ++i)
59  {
60  *pti = value;
61  ++pti;
62  }
63  return *this;
64 }
int slicemin() const
Definition: fvar.hpp:4274
int allocated(const ivector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: fvar_a59.cpp:13
int slicemax() const
Definition: fvar.hpp:4275
exitptr ad_exit
Definition: gradstrc.cpp:53
d3_array value(const dvar3_array &)
int slicemax() const
Definition: fvar.hpp:3830
dvar_matrix * t
Definition: fvar.hpp:4199
dvar_matrix & elem(int i)
? Retrieves an element of a dvar3_array.
Definition: fvar.hpp:4315
dvar3_array & operator=(const d3_array &m1)
Assign element values from scalar arr3 to dvar3_array.
Definition: f3arr13.cpp:19
#define min(a, b)
Definition: cbivnorm.cpp:188
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:2819
Description not yet available.
Definition: fvar.hpp:4197
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
dmatrix & elem(int k)
Definition: fvar.hpp:3870
dvector value(const df1_one_vector &v)
Definition: df11fun.cpp:69
#define max(a, b)
Definition: cbivnorm.cpp:189
Description not yet available.
Definition: fvar.hpp:3727