annotate src/fsqp.cc @ 2447:e46137c06781

[project @ 1996-10-30 19:39:03 by jwe]
author jwe
date Wed, 30 Oct 1996 19:39:06 +0000
parents bfb775fb6fe8
children 7ee42ff6536a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
1884
e62277bf5fe0 [project @ 1996-02-05 18:17:59 by jwe]
jwe
parents: 1740
diff changeset
3 Copyright (C) 1996 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
10 later version.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
18 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: 1192
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
240
a99f28f5e351 [project @ 1993-11-30 20:24:36 by jwe]
jwe
parents: 216
diff changeset
23 #ifdef HAVE_CONFIG_H
1192
b6360f2d4fa6 [project @ 1995-03-30 21:38:35 by jwe]
jwe
parents: 1009
diff changeset
24 #include <config.h>
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
27 #include "FSQP.h"
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
28
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1315
diff changeset
29 #include "defun-dld.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
30 #include "error.h"
544
20fbad23ae51 [project @ 1994-07-22 05:04:44 by jwe]
jwe
parents: 519
diff changeset
31 #include "help.h"
1740
fe9d3b2ded26 [project @ 1996-01-12 11:03:26 by jwe]
jwe
parents: 1684
diff changeset
32 #include "oct-obj.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
33
646
209eafc06817 [project @ 1994-08-24 06:41:56 by jwe]
jwe
parents: 644
diff changeset
34 #ifndef FSQP_MISSING
209eafc06817 [project @ 1994-08-24 06:41:56 by jwe]
jwe
parents: 644
diff changeset
35
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
36 // Global pointers for user defined functions required by fsqp.
453
393e95f46b51 [project @ 1994-06-06 00:05:20 by jwe]
jwe
parents: 272
diff changeset
37 // static tree *fsqp_objective;
393e95f46b51 [project @ 1994-06-06 00:05:20 by jwe]
jwe
parents: 272
diff changeset
38 // static tree *fsqp_constraints;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
39
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
40 double
1538
525d7798248a [project @ 1995-10-05 06:37:58 by jwe]
jwe
parents: 1488
diff changeset
41 fsqp_objective_function (const ColumnVector&)
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
42 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
43 return 0.0;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
44 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
45
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
46 ColumnVector
1538
525d7798248a [project @ 1995-10-05 06:37:58 by jwe]
jwe
parents: 1488
diff changeset
47 fsqp_constraint_function (const ColumnVector&)
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
48 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
49 ColumnVector retval;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
50 return retval;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
51 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
52
646
209eafc06817 [project @ 1994-08-24 06:41:56 by jwe]
jwe
parents: 644
diff changeset
53 #endif
209eafc06817 [project @ 1994-08-24 06:41:56 by jwe]
jwe
parents: 644
diff changeset
54
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
55 #if defined (FSQP_MISSING)
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
56 DEFUN_DLD_BUILTIN (fsqp, , ,
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
57 "This function requires FSQP, which is not freely\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
58 redistributable. For more information, read the file\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
59 libcruft/fsqp/README.MISSING in the source distribution.")
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
60 #else
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
61 DEFUN_DLD_BUILTIN (fsqp, , ,
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
62 "[X, PHI] = fsqp (X, PHI [, LB, UB] [, LB, A, UB] [, LB, G, UB])\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
63 \n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
64 Groups of arguments surrounded in `[]' are optional, but\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
65 must appear in the same relative order shown above.")
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
66 #endif
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
67 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
68 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
69
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
70 Handle all of the following:
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
71
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
72 1. fsqp (x, phi)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
73 2. fsqp (x, phi, lb, ub)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
74 3. fsqp (x, phi, lb, ub, llb, c, lub)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
75 4. fsqp (x, phi, lb, ub, llb, c, lub, nllb, g, nlub)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
76 5. fsqp (x, phi, lb, ub, nllb, g, nlub)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
77 6. fsqp (x, phi, llb, c, lub, nllb, g, nlub)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
78 7. fsqp (x, phi, llb, c, lub)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
79 8. fsqp (x, phi, nllb, g, nlub)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
80
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
81 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
82
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 1996
diff changeset
83 octave_value_list retval;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
84
216
e83d64b26659 [project @ 1993-11-13 09:04:18 by jwe]
jwe
parents: 162
diff changeset
85 error ("fsqp: not implemented yet");
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
86
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
87 return retval;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
88 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
89
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
90 #if defined (FSQP_MISSING)
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
91 DEFUN_DLD_BUILTIN (fsqp_options, , ,
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
92 "This function requires FSQP, which is not freely\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
93 redistributable. For more information, read the file\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
94 libcruft/fsqp/README.MISSING in the source distribution.")
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
95 #else
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
96 DEFUN_DLD_BUILTIN (fsqp_options, , ,
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
97 "fsqp_options (KEYWORD, VALUE)\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
98 \n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
99 Set or show options for fsqp. Keywords may be abbreviated\n\
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
100 to the shortest match.")
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
101 #endif
272
7ec58832918f [project @ 1994-01-06 18:54:08 by jwe]
jwe
parents: 240
diff changeset
102 {
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 1996
diff changeset
103 octave_value_list retval;
272
7ec58832918f [project @ 1994-01-06 18:54:08 by jwe]
jwe
parents: 240
diff changeset
104
7ec58832918f [project @ 1994-01-06 18:54:08 by jwe]
jwe
parents: 240
diff changeset
105 error ("fsqp_options: not implemented yet");
519
b9284136189a [project @ 1994-07-19 14:40:20 by jwe]
jwe
parents: 506
diff changeset
106
272
7ec58832918f [project @ 1994-01-06 18:54:08 by jwe]
jwe
parents: 240
diff changeset
107 return retval;
7ec58832918f [project @ 1994-01-06 18:54:08 by jwe]
jwe
parents: 240
diff changeset
108 }
7ec58832918f [project @ 1994-01-06 18:54:08 by jwe]
jwe
parents: 240
diff changeset
109
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
110 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
111 ;;; Local Variables: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
112 ;;; mode: C++ ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
113 ;;; End: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
114 */