ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fmm_cont.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 "fvar.hpp"
12 
13 #ifdef __TURBOC__
14  #pragma hdrstop
15  #include <iostream.h>
16 #endif
17 
18 #ifdef __ZTC__
19  #include <iostream.hpp>
20  #define endl "\n"
21 #endif
22 #include <math.h>
23 
24 #ifndef OPT_LIB
25  #include <cassert>
26  #include <climits>
27 #endif
28 
34 {
35  noprintx=0;
36  fringe = 0.0;
37  maxfn = 500;
38  iprint = 1;
39  crit = 0.0001;
40  imax = 30;
41  dfn = 0;
42  ifn = 0;
43  iexit = 0;
44  ialph = 0;
45  ihflag = 0;
46  ihang = 0;
47  scroll_flag = 1;
48  maxfn_flag=0;
49  quit_flag=0;
50  min_improve=.0000001;
51  ireturn = 0;
52  dcheck_flag = -1;
53  use_control_c=1;
54 }
55 
61 {
62  fringe = t.fringe;
63  maxfn = t.maxfn;
64  iprint = t.iprint;
65  crit = t.crit;
66  imax = t.imax;
67  dfn = t.dfn;
68  ifn = t.ifn;
69  iexit = t.iexit;
71  ialph = t.ialph;
72  ihflag = t.ihflag;
73  ihang = t.ihang;
76 
77  ireturn = t.ireturn;
78 }
79 
84 {
85  set_defaults();
86 }
94 {
95  set_defaults();
96 
97 #if defined(__MINGW64__)
98  #ifndef OPT_LIB
99  assert(ipar[1] <= LONG_MAX);
100  assert(ipar[2] <= LONG_MAX);
101  #endif
102  maxfn = static_cast<long>(ipar[1]);
103  iprint = static_cast<long>(ipar[2]);
104 #else
105  maxfn = ipar[1];
106  iprint = ipar[2];
107 #endif
108 
109 #ifdef __HP__
110  crit = .0001;
111 #else
112  #ifndef OPT_LIB
113  assert(ipar[3] <= INT_MAX);
114  #endif
115  crit = pow(double(10), static_cast<int>(-ipar[3]));
116 #endif
117 
118 #if defined(__MINGW64__)
119  #ifndef OPT_LIB
120  assert(ipar[4] <= LONG_MAX);
121  #endif
122  imax = static_cast<long>(ipar[4]);
123 #else
124  imax = ipar[4];
125 #endif
126 
127 #ifndef OPT_LIB
128  assert(ipar[5] <= INT_MAX);
129 #endif
130  scroll_flag = static_cast<int>(ipar[5]);
131 }
132 
139 ostream& operator<<(const ostream& s, const fmm_control& fmc)
140 {
141  fmc.writeon(s);
142  return (ostream&)s;
143 }
144 
149 void fmm_control::writeon(const ostream& _s) const
150 {
151  ostream& s = (ostream&) _s;
152  s << "values of fmm_control structure:\n";
153  s << " maxfn = " << maxfn << endl;
154  s << " iprint = " << iprint << endl;
155  s << " crit = " << crit << endl;
156  s << " imax = " << imax << endl;
157  s << " dfn = " << dfn << endl;
158  s << " ifn = " << ifn << endl;
159  s << " iexit = " << iexit << endl;
160  s << " ialph = " << ialph << endl;
161  s << " ihflag = " << ihflag << endl;
162  s << " ihang = " << ihang << endl;
163  s << " scroll_flag = " << scroll_flag << endl;
164  s << " ireturn = " << ireturn << endl;
165 }
long ialph
Definition: fvar.hpp:3190
double dfn
Definition: fvar.hpp:3187
double crit
Definition: fvar.hpp:3184
void writeon(const ostream &s) const
writeon Writes function minimizing status
Definition: fmm_cont.cpp:149
int maxfn_flag
Definition: fvar.hpp:3194
long maxfn
Definition: fvar.hpp:3182
int noprintx
Definition: fvar.hpp:3181
void set_defaults()
Description not yet available.
Definition: fmm_cont.cpp:33
double fringe
Definition: fvar.hpp:3185
Description not yet available.
Definition: fvar.hpp:656
Function minimizer control.
Definition: fvar.hpp:3178
long imax
Definition: fvar.hpp:3186
prnstream & endl(prnstream &)
long ihang
Definition: fvar.hpp:3192
int scroll_flag
Definition: fvar.hpp:3193
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
long ifn
Definition: fvar.hpp:3188
int use_control_c
Definition: fvar.hpp:3199
int quit_flag
Definition: fvar.hpp:3195
int dcheck_flag
Definition: fvar.hpp:3198
ostream & operator<<(const ostream &_s, preshowpoint p)
Description not yet available.
Definition: admanip.cpp:48
long ihflag
Definition: fvar.hpp:3191
fmm_control()
Default constructor.
Definition: fmm_cont.cpp:83
double min_improve
Definition: fvar.hpp:3196
long iprint
Definition: fvar.hpp:3183
int ireturn
Definition: fvar.hpp:3197
long iexit
Definition: fvar.hpp:3189
d3_array pow(const d3_array &m, int e)
Description not yet available.
Definition: d3arr6.cpp:17