annotate liboctave/NPSOL.h @ 1941:c3ae47c97e53

[project @ 1996-02-13 19:35:44 by jwe]
author jwe
date Tue, 13 Feb 1996 19:35:51 +0000
parents 7fc99ae70891
children bb9df7be8227
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
1 // NPSOL.h -*- C++ -*-
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
2 /*
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
3
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
4 Copyright (C) 1996 John W. Eaton
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
5
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
7
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
11 later version.
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
12
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
16 for more details.
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
17
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
19 along with Octave; see the file COPYING. If not, write to the Free
1315
611d403c7f3d [project @ 1995-06-25 19:56:32 by jwe]
jwe
parents: 1296
diff changeset
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
21
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
22 */
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
23
382
e02d6b664394 [project @ 1994-03-09 21:08:03 by jwe]
jwe
parents: 296
diff changeset
24 #if !defined (octave_NPSOL_h)
e02d6b664394 [project @ 1994-03-09 21:08:03 by jwe]
jwe
parents: 296
diff changeset
25 #define octave_NPSOL_h 1
e02d6b664394 [project @ 1994-03-09 21:08:03 by jwe]
jwe
parents: 296
diff changeset
26
1296
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1011
diff changeset
27 #if defined (__GNUG__)
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1011
diff changeset
28 #pragma interface
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1011
diff changeset
29 #endif
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1011
diff changeset
30
645
21cb3c7dc9e3 [project @ 1994-08-24 06:19:54 by jwe]
jwe
parents: 461
diff changeset
31 #ifndef NPSOL_MISSING
21cb3c7dc9e3 [project @ 1994-08-24 06:19:54 by jwe]
jwe
parents: 461
diff changeset
32
1874
7fc99ae70891 [project @ 1996-02-04 13:16:56 by jwe]
jwe
parents: 1873
diff changeset
33 #include <cfloat>
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
34 #include <cmath>
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
35
461
00f8b2242a18 [project @ 1994-06-06 00:45:57 by jwe]
jwe
parents: 384
diff changeset
36 #include "dColVector.h"
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
37 #include "NLP.h"
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
38
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
39 class
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
40 NPSOL_options
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
41 {
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
42 public:
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
43
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
44 NPSOL_options (void) { init (); }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
45
1873
dc859604b19b [project @ 1996-02-04 13:07:46 by jwe]
jwe
parents: 1866
diff changeset
46 NPSOL_options (const NPSOL_options& opt) { set_options (opt); }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
47
1866
b6c48195b552 [project @ 1996-02-04 11:07:17 by jwe]
jwe
parents: 1862
diff changeset
48 NPSOL_options& operator = (const NPSOL_options& opt)
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
49 {
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
50 if (this != &opt)
1873
dc859604b19b [project @ 1996-02-04 13:07:46 by jwe]
jwe
parents: 1866
diff changeset
51 set_options (opt);
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
52
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
53 return *this;
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
54 }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
55
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
56 ~NPSOL_options (void) { }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
57
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
58 void init (void);
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
59
1873
dc859604b19b [project @ 1996-02-04 13:07:46 by jwe]
jwe
parents: 1866
diff changeset
60 void set_default_options (void) { init (); }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
61
1873
dc859604b19b [project @ 1996-02-04 13:07:46 by jwe]
jwe
parents: 1866
diff changeset
62 void set_options (const NPSOL_options& opt);
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
63
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
64 // XXX FIXME XXX -- is this a good idea?
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
65
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
66 // Passing invalid values to the set_* functions will result in
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
67 // setting the default option.
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
68
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
69 void set_central_difference_interval (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
70 { x_central_difference_interval = (val > 0.0) ? val : -1.0; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
71
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
72 void set_crash_tolerance (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
73 { x_crash_tolerance = (val >= 0.0) ? val : 0.1; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
74
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
75 void set_difference_interval (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
76 { x_difference_interval = (val > 0.0) ? val : -1.0; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
77
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
78 void set_function_precision (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
79 { x_function_precision = (val > 0.0) ? val : ::pow (DBL_EPSILON, 0.9); }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
80
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
81 void set_infinite_bound (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
82 { x_infinite_bound = (val > 0.0) ? val : 1.0e+30; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
83
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
84 void set_infinite_step (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
85 { x_infinite_step = (val > 0.0) ? val : 1.0e+30; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
86
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
87 void set_linear_feasibility_tolerance (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
88 {
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
89 x_linear_feasibility_tolerance
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
90 = (val > 0.0) ? val : ::sqrt (DBL_EPSILON);
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
91 }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
92
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
93 void set_linesearch_tolerance (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
94 { x_linesearch_tolerance = (val >= 0.0 && val < 1.0) ? val : 0.9; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
95
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
96 void set_nonlinear_feasibility_tolerance (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
97 {
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
98 x_nonlinear_feasibility_tolerance
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
99 = (val > 0.0) ? val : ::sqrt (DBL_EPSILON);
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
100 }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
101
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
102 void set_optimality_tolerance (double val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
103 { x_optimality_tolerance = (val > 0.0) ? val : ::pow (DBL_EPSILON, 0.8); }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
104
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
105 void set_derivative_level (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
106 { x_derivative_level = (val >= 0 && val < 4) ? val : 0; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
107
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
108 void set_major_iteration_limit (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
109 { x_major_iteration_limit = (val > 0) ? val : -1; }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
110
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
111 void set_minor_iteration_limit (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
112 { x_minor_iteration_limit = (val > 0) ? val : -1; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
113
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
114 void set_major_print_level (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
115 { x_major_print_level = (val >= 0) ? val : -1; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
116
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
117 void set_minor_print_level (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
118 { x_minor_print_level = (val >= 0) ? val : -1; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
119
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
120 void set_start_objective_check (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
121 { x_start_objective_check = (val >= 0) ? val : -1; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
122
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
123 void set_start_constraint_check (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
124 { x_start_constraint_check = (val >= 0) ? val : -1; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
125
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
126 void set_stop_objective_check (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
127 { x_stop_objective_check = (val >= 0) ? val : -1; }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
128
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
129 void set_stop_constraint_check (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
130 { x_stop_constraint_check = (val >= 0) ? val : -1; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
131
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
132 void set_verify_level (int val)
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
133 {
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
134 x_verify_level
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
135 = ((val > -1 && val < 4) || (val > 9 && val < 14)) ? val : 0;
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
136 }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
137
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
138 double central_difference_interval (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
139 { return x_central_difference_interval; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
140
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
141 double crash_tolerance (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
142 { return x_crash_tolerance; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
143
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
144 double difference_interval (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
145 { return x_difference_interval; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
146
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
147 double function_precision (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
148 { return x_function_precision; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
149
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
150 double infinite_bound (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
151 { return x_infinite_bound; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
152
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
153 double infinite_step (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
154 { return x_infinite_step; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
155
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
156 double linear_feasibility_tolerance (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
157 { return x_linear_feasibility_tolerance; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
158
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
159 double linesearch_tolerance (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
160 { return x_linesearch_tolerance; }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
161
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
162 double nonlinear_feasibility_tolerance (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
163 { return x_nonlinear_feasibility_tolerance; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
164
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
165 double optimality_tolerance (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
166 { return x_optimality_tolerance; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
167
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
168 int derivative_level (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
169 { return x_derivative_level; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
170
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
171 int major_iteration_limit (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
172 { return x_major_iteration_limit; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
173
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
174 int minor_iteration_limit (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
175 { return x_minor_iteration_limit; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
176
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
177 int major_print_level (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
178 { return x_major_print_level; }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
179
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
180 int minor_print_level (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
181 { return x_minor_print_level; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
182
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
183 int start_objective_check (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
184 { return x_start_objective_check; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
185
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
186 int start_constraint_check (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
187 { return x_start_constraint_check; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
188
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
189 int stop_objective_check (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
190 { return x_stop_objective_check; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
191
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
192 int stop_constraint_check (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
193 { return x_stop_constraint_check; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
194
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
195 int verify_level (void) const
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
196 { return x_verify_level; }
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
197
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
198 protected:
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
199
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
200 void pass_options_to_npsol (void);
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
201
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
202 void set_option (const char *key, int opt);
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
203 void set_option (const char *key, double opt);
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
204
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
205 private:
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
206
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
207 double x_central_difference_interval;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
208 double x_crash_tolerance;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
209 double x_difference_interval;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
210 double x_function_precision;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
211 double x_infinite_bound;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
212 double x_infinite_step;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
213 double x_linear_feasibility_tolerance;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
214 double x_linesearch_tolerance;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
215 double x_nonlinear_feasibility_tolerance;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
216 double x_optimality_tolerance;
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
217
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
218 int x_derivative_level;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
219 int x_major_iteration_limit;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
220 int x_minor_iteration_limit;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
221 int x_major_print_level;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
222 int x_minor_print_level;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
223 int x_start_objective_check;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
224 int x_start_constraint_check;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
225 int x_stop_objective_check;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
226 int x_stop_constraint_check;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
227 int x_verify_level;
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
228 };
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
229
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
230 class
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
231 NPSOL : public NLP, public NPSOL_options
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
232 {
1862
58b42823284f [project @ 1996-02-04 10:35:54 by jwe]
jwe
parents: 1835
diff changeset
233 public:
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
234
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
235 NPSOL (void)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
236 : NLP (), NPSOL_options () { }
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 255
diff changeset
237
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
238 NPSOL (const ColumnVector& x, const Objective& phi)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
239 : NLP (x, phi), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
240
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
241 NPSOL (const ColumnVector& x, const Objective& phi, const Bounds& b)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
242 : NLP (x, phi, b), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
243
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
244 NPSOL (const ColumnVector& x, const Objective& phi, const Bounds& b,
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
245 const LinConst& lc)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
246 : NLP (x, phi, b, lc), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
247
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
248 NPSOL (const ColumnVector& x, const Objective& phi, const Bounds& b,
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
249 const LinConst& lc, const NLConst& nlc)
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
250 : NLP (x, phi, b, lc, nlc), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
251
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
252 NPSOL (const ColumnVector& x, const Objective& phi, const LinConst& lc)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
253 : NLP (x, phi, lc), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
254
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
255 NPSOL (const ColumnVector& x, const Objective& phi, const LinConst& lc,
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
256 const NLConst& nlc)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
257 : NLP (x, phi, lc, nlc), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
258
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
259 NPSOL (const ColumnVector& x, const Objective& phi,
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
260 const NLConst& nlc)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
261 : NLP (x, phi, nlc), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
262
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
263 NPSOL (const ColumnVector& x, const Objective& phi, const Bounds& b,
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
264 const NLConst& nlc)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
265 : NLP (x, phi, b, nlc), NPSOL_options () { }
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
266
1833
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
267 NPSOL (const NPSOL& a)
5cc18ea5c048 [project @ 1996-02-03 07:03:28 by jwe]
jwe
parents: 1528
diff changeset
268 : NLP (a), NPSOL_options () { }
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
269
1834
46ab6238fa79 [project @ 1996-02-03 07:12:52 by jwe]
jwe
parents: 1833
diff changeset
270 NPSOL& operator = (const NPSOL& a)
46ab6238fa79 [project @ 1996-02-03 07:12:52 by jwe]
jwe
parents: 1833
diff changeset
271 {
1835
12a94a17509d [project @ 1996-02-03 07:16:15 by jwe]
jwe
parents: 1834
diff changeset
272 if (this != &a)
12a94a17509d [project @ 1996-02-03 07:16:15 by jwe]
jwe
parents: 1834
diff changeset
273 {
12a94a17509d [project @ 1996-02-03 07:16:15 by jwe]
jwe
parents: 1834
diff changeset
274 NLP::operator = (a);
12a94a17509d [project @ 1996-02-03 07:16:15 by jwe]
jwe
parents: 1834
diff changeset
275 NPSOL_options::operator = (a);
12a94a17509d [project @ 1996-02-03 07:16:15 by jwe]
jwe
parents: 1834
diff changeset
276 }
1834
46ab6238fa79 [project @ 1996-02-03 07:12:52 by jwe]
jwe
parents: 1833
diff changeset
277 return *this;
46ab6238fa79 [project @ 1996-02-03 07:12:52 by jwe]
jwe
parents: 1833
diff changeset
278 }
46ab6238fa79 [project @ 1996-02-03 07:12:52 by jwe]
jwe
parents: 1833
diff changeset
279
46ab6238fa79 [project @ 1996-02-03 07:12:52 by jwe]
jwe
parents: 1833
diff changeset
280 ~NPSOL (void) { }
46ab6238fa79 [project @ 1996-02-03 07:12:52 by jwe]
jwe
parents: 1833
diff changeset
281
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1359
diff changeset
282 ColumnVector do_minimize (double& objf, int& inform, ColumnVector& lambda);
1941
c3ae47c97e53 [project @ 1996-02-13 19:35:44 by jwe]
jwe
parents: 1874
diff changeset
283
c3ae47c97e53 [project @ 1996-02-13 19:35:44 by jwe]
jwe
parents: 1874
diff changeset
284 private:
c3ae47c97e53 [project @ 1996-02-13 19:35:44 by jwe]
jwe
parents: 1874
diff changeset
285
c3ae47c97e53 [project @ 1996-02-13 19:35:44 by jwe]
jwe
parents: 1874
diff changeset
286 int attempt;
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
287 };
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
288
255
98246fedc941 [project @ 1993-12-08 22:55:41 by jwe]
jwe
parents: 238
diff changeset
289 // XXX FIXME XXX -- would be nice to not have to have this global
98246fedc941 [project @ 1993-12-08 22:55:41 by jwe]
jwe
parents: 238
diff changeset
290 // variable.
98246fedc941 [project @ 1993-12-08 22:55:41 by jwe]
jwe
parents: 238
diff changeset
291 // Nonzero means an error occurred in the calculation of the objective
98246fedc941 [project @ 1993-12-08 22:55:41 by jwe]
jwe
parents: 238
diff changeset
292 // function, and the user wants us to quit.
98246fedc941 [project @ 1993-12-08 22:55:41 by jwe]
jwe
parents: 238
diff changeset
293 extern int npsol_objective_error;
98246fedc941 [project @ 1993-12-08 22:55:41 by jwe]
jwe
parents: 238
diff changeset
294
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
295 #endif
238
780cbbc57b7c [project @ 1993-11-30 20:23:04 by jwe]
jwe
parents: 3
diff changeset
296 #endif
3
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
297
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
298 /*
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
299 ;;; Local Variables: ***
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
300 ;;; mode: C++ ***
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
301 ;;; page-delimiter: "^/\\*" ***
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
302 ;;; End: ***
9a4c07481e61 [project @ 1993-08-08 01:20:23 by jwe]
jwe
parents:
diff changeset
303 */