ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
df1b2ptr.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 #include <df1b2fun.h>
12 
14 typedef double* ad_double_ptr;
15 
24 {
25  index_min = mmin;
26  index_max = mmax;
27  v = new ad_df1b2_header_ptr[
28  static_cast<unsigned int>(mmax < mmin ? 0 : mmax - mmin + 1)];
29  if (v == 0)
30  {
31  cerr << "error allocating memory for df1b2_header_ptr_vector\n";
32  ad_exit(1);
33  }
34  v -= indexmin();
35 }
40 {
41  if (v !=0)
42  {
43  v += indexmin();
44  delete [] v;
45  v = 0;
46  index_min = 0;
47  index_max = -1;
48  }
49 }
58 {
59  index_min = mmin;
60  index_max = mmax;
61  v = new ad_double_ptr[
62  static_cast<unsigned int>(mmax < mmin ? 0 : mmax - mmin + 1)];
63  if (v == 0)
64  {
65  cerr << "error allocating memory for double_ptr_vector\n.";
66  ad_exit(1);
67  }
68  v-=indexmin();
69 }
74 {
75  if (v !=0)
76  {
77  v += indexmin();
78  delete [] v;
79  v = 0;
80  index_min = 0;
81  index_max = -1;
82  }
83 }
int indexmin(void)
Definition: df1b2fun.h:1784
double_ptr_vector(int mmin, int mmax)
Constructor vector of ad_double_ptr with dimension [mmin to mmax].
Definition: df1b2ptr.cpp:57
~df1b2_header_ptr_vector()
Destructor.
Definition: df1b2ptr.cpp:39
exitptr ad_exit
Definition: gradstrc.cpp:53
df1b2_header ** v
Definition: df1b2fun.h:1760
df1b2_header_ptr_vector(int mmin, int mmax)
Constructor vector of ad_df1b2_header_ptr with dimension [mmin to mmax].
Definition: df1b2ptr.cpp:23
Base class for df1b2variable.
Definition: df1b2fun.h:191
Description not yet available.
~double_ptr_vector()
Destructor.
Definition: df1b2ptr.cpp:73
df1b2_header * ad_df1b2_header_ptr
Definition: df1b2ptr.cpp:13
double * ad_double_ptr
Definition: df1b2ptr.cpp:14