25 cerr <<
"Error -- variable '" << variable_name <<
"' must be set before\n"
26 "declaration of gradient_structure object.\n";
59 cerr <<
" This is not the way to set the ARRAY_MEMBLOCK_SIZE -- sorry\n"
60 " You set it by declaring the number of bytes you want in the\n";
61 cerr <<
" declaration gradient_structure gs(num_bytes)\n"
62 " in your program .. the default value is 100000L\n";
79 if ( (
unsigned long int) (LONG_MAX) < (
unsigned long int)i)
81 long int max_size=LONG_MAX;
83 cerr <<
"\n\n It appears that the size you are setting for "
84 "the\n CMPDIF_BUFFER is > " << LONG_MAX <<
85 "This appears\n to be an error. The maximum size argument ";
86 cerr <<
"for the function\n"
87 "--- gradient_structure::set_CMPDIF_BUFFER_SIZE(long long int i) ---\n"
88 "should probably be " << max_size <<
endl;
91 size_t max_size(LLONG_MAX);
94 cerr <<
"\n\n It appears that the size you are setting for "
95 "the\n CMPDIF_BUFFER is > " << max_size <<
96 "This appears\n to be an error. The maximum size argument ";
97 cerr <<
"for the function\n"
98 "--- gradient_structure::set_CMPDIF_BUFFER_SIZE(long long int i) ---\n"
99 "should probably be " << max_size <<
endl;
102 check_set_error(
"CMPDIF_BUFFER_SIZE");
103 CMPDIF_BUFFER_SIZE = i;
125 if ( (
unsigned long int) (LONG_MAX) < gs_size *i)
127 unsigned int max_size=LONG_MAX/gs_size;
129 cerr <<
"\n\n It appears that the size you are setting for "
130 "the\n GRADSTACK_BUFFER is > " << LONG_MAX <<
131 "This appears\n to be an error. The maximum size argument ";
132 cerr <<
"for the function\n"
133 "--- gradient_structure::set_GRADSTACK_BUFFER_SIZE(long long int i) ---\n"
134 "should probably be " << max_size <<
endl;
135 cerr <<
"Note: the Borland compiler limit is a long integer\n"
136 " other compilers allow long long integers" <<
endl;
137 cerr <<
"LONG_MAX = " << (
unsigned long int) (LONG_MAX) <<
endl;
138 cerr <<
" i = " << i <<
endl;
139 cerr <<
" gs_size = " << gs_size <<
endl;
140 cerr <<
" i*gs_size = " << i*gs_size <<
endl;
143 size_t max_size(LLONG_MAX);
146 cerr <<
"\n\n It appears that the size you are setting for "
147 "the\n GRADSTACK_BUFFER is > " << max_size <<
148 "This appears\n to be an error. The maximum size argument ";
151 cerr <<
"for the function\n"
152 "--- gradient_structure::set_GRADSTACK_BUFFER_SIZE(long long int i) ---\n"
153 "should probably be " << max_size <<
endl;
154 cerr <<
"LLONG_MAX = " << LLONG_MAX <<
endl;
155 cerr <<
" n = " << n <<
endl;
156 cerr <<
" i = " << i <<
endl;
157 cerr <<
" total = " << max_size * i <<
endl;
160 check_set_error(
"GRADSTACK_BUFFER_SIZE");
161 GRADSTACK_BUFFER_SIZE = i;
180 if ( (
unsigned long int) (LONG_MAX) < i)
182 unsigned int max_size=LONG_MAX;
184 cerr <<
"\n\n It appears that the size you are setting for "
185 "the\n GRADSTACK_BUFFER is > " << LONG_MAX <<
186 "This appears\n to be an error. The maximum size argument ";
187 cerr <<
"for the function\n"
188 "--- gradient_structure::set_GRADSTACK_BUFFER_BYTES(long int i) ---\n"
189 "should probably be " << max_size <<
endl;
190 cerr <<
"LONG_MAX = " << (
unsigned long int) (LONG_MAX) <<
endl;
191 cerr <<
" i = " << i <<
endl;
192 cerr <<
"Note: the Borland compiler limit is a long integer\n"
193 " other compilers allow long long integers" <<
endl;
196 size_t max_size(LLONG_MAX);
199 cerr <<
"\n\n It appears that the size you are setting for "
200 "the\n GRADSTACK_BUFFER is > " << max_size <<
201 "This appears\n to be an error. The maximum size argument ";
202 cerr <<
"for the function\n"
203 "--- gradient_structure::set_GRADSTACK_BUFFER_BYTES(long long int i) ---\n"
204 "should probably be " << max_size <<
endl;
205 cerr <<
"LLONG_MAX = " << LLONG_MAX <<
endl;
206 cerr <<
" i = " << i <<
endl;
210 check_set_error(
"GRADSTACK_BUFFER_SIZE");
211 GRADSTACK_BUFFER_SIZE = i/gs_size;
static void set_ARRAY_MEMBLOCK_SIZE(unsigned long i)
Set the the maximum amount of memory (in bytes) available for the autodif variable type container cla...
static void set_GRADSTACK_BUFFER_SIZE(const size_t i)
Set the number of entries contained in the buffer that, in turn, contains the information necessary f...
Holds derivative information for arithmetic operators and math library functions. ...
static unsigned int NUM_RETURN_ARRAYS
static void check_set_error(const char *variable_name)
Produce error if gradient structure hasn't been set.
static void set_NUM_RETURN_ARRAYS(unsigned int i)
Set the maximum allowable depth of nesting of functions that return autodif variable types...
static unsigned int MAX_NVAR_OFFSET
static unsigned int RETURN_ARRAYS_SIZE
static void set_MAX_NVAR_OFFSET(unsigned int i)
Set the the maximum number of independent variables that can be used.
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static void set_CMPDIF_BUFFER_SIZE(const size_t i)
Set the size in bytes of the buffer used to contain the information generated by the "precompiled" de...
static void set_GRADSTACK_BUFFER_BYTES(const size_t i)
Set (in bytes) the number of entries contained in the buffer used for calculating derivatives...
static void set_RETURN_ARRAYS_SIZE(unsigned int i)
Set the return arrays size controlling the amount of complexity that one line of arithmetic can have...
static unsigned int MAX_DLINKS
static void set_MAX_DLINKS(int i)
Set the maximum number of dvariable objects that can be in scope at one time.