Mon Apr 21 22:35:13 EDT 1997 Extensive revisions to the entire ampl/solvers tree, corresponding to an updated "Hooking Your Solver to AMPL": ftp://netlib.bell-labs.com/ampl/REFS/hooking.ps.gz Tue Apr 22 07:56:07 EDT 1997 pfg_read.c pfghread.c: fix glitch that could cause a fault (during setup for Hessian computations). Thu Apr 24 12:46:31 EDT 1997 misc.c: fix a glitch in reading suffix tables (a forthcoming AMPL extension). Sun May 18 13:40:12 EDT 1997 Tweaks: use a replaceable "getenv"; augment r_opn.hd (for a forthcoming driver); add rule for stderr.obj to makefile.*. Thu May 29 23:20:52 EDT 1997 Fix bug with xknown() with problems involving defined variables: derivatives were sometimes miscomputed. Wed Jun 4 11:44:14 EDT 1997 Adjust struct psb_elem in psinfo.h (currently just for use in lancelot/lancelot.c). Recompile amplsolver.a (or amplsolv.lib) from scratch, even if you get just the updated files (asldate.c, pfg_read.c, psinfo.h, xsum0.out). Add file README.f77 with changes that permit using the native Fortran 77 compiler on some systems. Tue Jun 17 22:29:37 EDT 1997 Fix a fault that was possible in the .nl readers when the .nl file was written with presolve turned off. Thu Jun 26 23:52:36 EDT 1997 Adjust Malloc and M1alloc so Malloc(0) and M1alloc(0) return nonzero values even if malloc is buggy in that malloc(0) returns 0. Wed Jul 9 14:55:48 EDT 1997 Adjust Realloc so Realloc(0,n) works analogously to Malloc(0). New field n_eqn gives (in struct Edaginfo) gives the number of equality constraints (if known from versions of ampl >= 19970627), or -1. This change requires recompiling all of amplsolver.a and any solver objects that #include "asl.h". Tweak to reading numbers of complementarity constraints in .nl headers (to be further documented later). getstub.c: fix glitch that sometimes caused -? to say "...[options] [options]..." rather than "...[options]...". obj_prec.c: adjust to use getenv_ASL. Mon Jul 21 12:33:08 EDT 1997 funcaddk.c: add missing line (AmplExports *ae = al->AE;) to function mean. Tue Jul 22 16:53:59 EDT 1997 func_add.c: ignore argtype = 6. Thu Aug 14 00:34:10 EDT 1997 Adjust getstub.c and getstub.h to permit specifying that underscores should be retained (rather than turned into blanks) in names passed to a Solver_KW_func. An enum now names bits in the "flags" field, with ASL_OI_want_funcadd (== 1) meaning that funcadd should be called, and ASL_OI_keep_underscores (== 2) meaning that underscores should be kept. Tue Aug 19 15:39:22 EDT 1997 pfg_read.c (and pfghread.c): fix bugs with linear defined variables referenced by other linear defined variables. Example: set I := 1..4; var x{I} >= 0 := .25; convex: sum{i in I} x[i] = 1; var y = x[1]; var d = 1 + y; s.t. zot{j in 1..2}: x[j] + d >= .1; minimize foo: sin(x[1]); led to an infinite loop. A more complicated example led to an assertion failure. (Henceforth, compile pfghread.c and pfg_read.c with -DDEBUG if you want the assertions checked.) Wed Aug 20 16:11:24 EDT 1997 Once again, pfg_read.c (and pfghread.c): fix another bug with linear defined variables that involve other linear defined variables, this time when constant terms are involved. The constant terms sometimes got lost. Example: set I := 1..3; var x{i in I} >= 0 := i; var y = x[1]; var z = y + 1; s.t. bletch: sum{i in I} x[i] + y + z == 2; s.t. zap: sum{i in 1..2} x[i] + z == 2; Fri Sep 12 01:09:37 EDT 1997 funcadd.c: for hypot(0,0), set the Hessian to all zeros. mip_pri.c: change "AMPl" to "AMPL". pfg_read.c (and pfghread.c): 1. Fix glitch affecting Hessian computations when imported (user-defined) functions involve some constant arguments. 2. Fix more bugs in handling defined variables. Example: var x0 >= 0 := 1; var x1 >= 0 := 3; var v2 = x1 - 2; var v3 = v2 * x0 + 10.4; # the constant term 10.4 s.t. c: v3 = 0; # caused trouble 3. Fix bug in allocation of al->hes for imported functions: constant arguments were not counted. sphes.c: fix glitch in computing sparsity of Hessians when imported functions are involved. Fri Sep 12 18:51:41 EDT 1997 pfg_read.c (and pfghread.c): fix two glitches that caused faults with certain models. Fri Oct 10 17:13:14 EDT 1997 stdio1.h0: protect #define Char with #ifndef Char . asl.h, jac0dim.c: change neqn to n_eqn (new field giving the number of equations), to reduce the chance of name classes (such as occurred in fsqp/fsqp.c). The comments above for 19970709 have been adjusted. Sat Oct 11 16:32:51 EDT 1997 Add to README another pointer to makefile comments; update xsum0.out (missed yesterday). Thu Oct 16 13:47:06 EDT 1997 con1ival.c, con2ival.c: fix bug with congrd(n, i, x, g, nerror) (Fortran 77 notation): if called with nerror < 0 at an (i,x) pair at which conival was not called, no gradient was computed. Thu Oct 23 20:09:51 EDT 1997 pfg_read.c pfghread.c: fix bug that could cause a fault on some machines (e.g., HP). Mon Nov 3 23:45:32 EST 1997 f_read.c fg_read.c fgh_read.c pfg_read.c pfghread.c: fix bug in reading cvar array for complementarity constraints (to be further documented later). Fri Nov 7 03:41:23 EST 1997 Add variants of xknown() with apparent signatures void xknowne(real *X, fint *nerror); void xknowe_(real *X, fint *nerror); that treat errors in evaluating common expressions the same way as other routines (objval, conval, etc.) that have a final nerror argument. Fri Nov 7 09:20:15 EST 1997 mip_pri.c nqpcheck.c: for simplicitly, back off changes early this AM that made some arrays available to either free() or M1record(). Arrays returned by these routines are freed automatically by ASL_free(&asl). Tue Nov 11 16:25:21 EST 1997 misc.c: fix botch introduced 19971107: s/xknowe(/xknowne(/ asl.h misc.c: change M1record to a Char** function, permitting one to Realloc or free the recorded memory block if one updates or zeros *(the return value from M1record) accordingly. Tue Dec 2 23:50:40 EST 1997 README.f77: point out need to remove -lf2c (references to libf2c.a) when using native Fortran compilers. Tue Jan 13 22:45:01 EST 1998 nqpcheck.c: if called with NULL for any of rowqp, colqp, or delsqp, omit changes that require adding quadratic-term contributions to the return values of objval, conval, and conival (as is done by function qterm in examples/qtest.c). Wed Jan 14 08:49:00 EST 1998 jac0dim.c: tweak (to treatment of Arith_Kind_ASL) foreshadowing forthcoming changes. Wed Feb 4 13:25:05 EST 1998 jac0dim.c: adjust jacdim variants to assume stub is null-terminated if stub_len <= 0. (This slightly simplifies invocations of these routines, as it removes the need for a strlen call, and though choosing file names with blanks in them is a very bad idea, this change permits blanks in the "stub".) Wed Feb 11 15:10:54 EST 1998 .nl file readers: fix a fault that was possible with certain nonlinear .nl files generated with "option presolve 0". Wed Mar 25 23:26:13 EST 1998 con1ival.c, con2ival.c: fix bug in handling nerror when a gradient is requested at a point different from the one where the constraint was most recently evaluated. The bug caused wrong gradients to be returned (the input G was unchanged). misc.c: fix glitch in Realloc's checking for a null return. Many routines: minor updates; new facilities for receiving and transmitting user-defined suffixes (to be described later). On most systems, nonlinear solvers should no longer link with funcadd0.o, but rather should link automatically with funcadd1.o, which is now in amplsolver.a. Exceptions: under MSDOS and AIX earlier than AIX 4.2, nonlinear solvers should still link with funcadd0.o (or otherwise, as indicated in the funclink subdirectory). Thu Mar 26 18:03:37 EST 1998 New file funcaddr.c, for compiling funcadd1.c so as to release amplfunc.dll when ASL_free() is called, rather than at the end of execution. This is for use with shared libraries that may be loaded and unloaded repeatedly during a single program execution, such as MATLAB mex files. Use of funcaddr.c is now illustrated in the rules for amplfunc.mex and spamfunc.mex in examples/makefile. Fri Mar 27 14:40:16 EST 1998 getstub.c: minor tweak for what now should be an unusual case: statically linking a funcadd.o with the solver. Mon Mar 30 16:43:25 EST 1998 asl.h: make solve_result_num a synonym for asl->i.solve_code_, the value that appears in AMPL sessions as solve_result_num. Thu Apr 2 17:36:57 EST 1998 func_add.c: if -ix is not given, assume -i$AMPLFUNC . Mon Apr 6 16:09:37 EDT 1998 qp_read.c: fix bug in qp_opify()'s handling of min(...) and max(...) expressions. Fri Apr 10 23:16:08 EDT 1998 makefile: add funcaddr.c to xsum.out. Fri May 8 11:33:00 EDT 1998 funcadd1.c: permit compiling with (e.g.) -DFUNCADD="funcadd_ASL_" to change the name sought in amplfunc.dll from "funcadd_ASL" to "funcadd_ASL_". Unless compiled with -DNO_DLOPEN_ERROR_MESSAGE, print a warning (on Stderr) when -i or $AMPLFUNC is specified and the library does not exist or cannot be loaded. On systems that provide a dlerror() function that returns a string explaining what went wrong, print that string. (Compile with -DNO_DLERROR if dlerror() is buggy, as it is, e.g., in at least one older version of Linux). makefile.wat: compile funcadd1.c with -DFUNCADD="funcadd_ASL_" . If you use non-default calling conventions, you may have to adjust this detail. Tue May 12 19:00:35 EDT 1998 dtoa.c: fix a glitch introduced with the scaling of 19970212 that caused one-bit rounding errors in certain denormal numbers, such as 8.44291197326099e-309, which was read as 8.442911973260987e-309. funcadd1.c: tweak to prevent undesired complaint of missing amplfunc.dll with -DWIN32. arithchk.c and makefiles: determine whether long long is available. Fri May 15 16:46:18 EDT 1998 dtoa.c: tweak to round 2.2250738585072012e-308 correctly. f_read.c fg_read.c: tweak so f_read does not pull in r_ops_ASL. Tue May 26 13:16:50 EDT 1998 objconst.c: correct glitch in use with pfg_read and pfgh_read. Note that objconst(n) returns 0 if objective n is not affine. Wed May 27 16:48:25 EDT 1998 objconst.c: add a missing #undef f_OPNUM; asldate.c not changed. Thu Jun 18 01:13:10 EDT 1998 Fix possible fault in, e.g., sphes(), with certain uses of defined variables. The fix involves a data structure change, so it is best to recompile all of amplsolver.a and any objects that include the solver interface header files. Adjust xectim.c to use getrusage() on Unix systems (for CPU time resolution of 1 microsecond). Fri Jun 19 18:52:08 EDT 1998 Fix typo in comments in funcadd.h (about where to store partials). arithchk.c: add logic for detecting IEEE-like arithmetic that flushes underflows to 0 (a bad thing). Wed Jun 24 16:33:55 EDT 1998 funcadd.h: type of Errmsg changed from Char to char. rops.c, rops2.c: explicitly check for sqrt(negative number) rather than relying on errno being set to indicate this. There exists at least one systems where this matters. Fri Jun 26 08:55:38 EDT 1998 funcadd1.c: minor tweak for compilation under SunOS 4.1x; asldate.c not changed. Tue Jul 14 14:43:13 EDT 1998 pfg_read.c pfghread.c: discard linear terms that end up with a coefficient of 0. This is mostly invisible, but can avoid a division by 0 (in pfg_read or pfgh_read) in certain complicated examples. Thu Aug 27 07:51:38 EDT 1998 conpval.c pfg_read.c pfghread.c: fix bug in handling two or more constraints (or objectives) involving a sum of monadic functions of the same linear combinations of variables. This only affected problems read with pfg_read() and pfgh_read(). Example: var x; s.t. zap{i in 1..2}: sqrt((x - i)^2 + 1) >= 0; (In this example, zap[2] was miscomputed.) Also, fix faults in some contexts in handling "constant" arguments of the form (e.g.) x-x for some variable x. Mon Aug 31 17:52:08 EDT 1998 pfg_read.c pfghread.c: "invisible" tweak to eliminate complaints of "cast to pointer from integer of different size" on some machines. Thu Sep 3 09:27:57 EDT 1998 Add comments about -DNANCHECK and -DNO_ERRNO to README. Wed Oct 14 00:30:21 EDT 1998 getstub.[ch]: new bit ASL_OI_never_echo for Option_Info.option_echo suppresses echoing of options (should it be desirable to scan them twice). New bits ASL_find_c_class, ASL_find_o_class, and their union ASL_find_co_class in the flags argument to pfg_read() and pfgh_read() instructs them to compute four new fields of ((ASL_pfg*)asl)->I and ((ASL_pfgh*)asl)->I classifying objectives and constraints as constant (0), linear (1), quadratic (2), or general nonlinear 3 (fields c_class and o_class) and giving the maximum values of these arrays (max_c_class and max_o_class). New field nlvog of struct Edaginfo; objgrd(np,x,g,ne) sets g[i] = 0 if the objective does not depend on x[i] and i < nlvog (or i < max(c_vars, o_vars) if nlvog is left at 0); nlvog must be set before the .nl reader is called. This matters to minos and snopt, whose drivers have been updated to specify asl->i.nlvog = nlvo. Fri Oct 30 01:50:47 EST 1998 Fix botch in handling first derivatives of user-defined functions having some numeric constant arguments and some arguments involving variables: if the total number of numerical arguments was more than 8, unpredictable behavior was possible. Fix bug in dtoa.c's handling of non-IEEE arithmetic machines, such as SGI machines executing -n32 and -64 (but not -o32) binaries, that flush underflows to zero instead of underflowing gradually. Fri Nov 6 14:49:37 EST 1998 dtoa.c: tweak to remove LL suffixes from numeric constants (for compilers that offer a 64-bit long long type but do not recognize the LL constants prescribed by C9x, the proposed update to the ANSI/ISO C standard). Thanks to Earl Chew for pointing out the existence of such compilers. This change should be invisible on most systems. Thu Nov 19 10:41:10 EST 1998 xectim.c: adjust so compilation with -DNO_RUSAGE will use CLK_TCK if available (on Unix systems, in limits.h). Tue Nov 24 23:32:33 EST 1998 names.c: fix glitch in obj_name(): when no .row file was present, obj_name(n) overwrote con_name(n). Wed Dec 9 10:11:12 EST 1998 README.SGI added describing how to restore IEEE arithmetic under SGI's -n32 and -64 compilation modes. Tue Dec 15 19:29:17 EST 1998 conpval.c: with readers pfg_read and pfgh_read, objgrd(nprob,x,g,ne) was treated as objgrd(0,x,g,ne). conpval.c, obj2val.c, objval.c: calls on objgrd(nprob,x,g,ne) for several nprob values and the same x might have given wrong gradients after the first call for that x. pshvprod.c: fix rarely seen bug in Hessian computations involving defined variables; a couple of operators that should have been += were simply = in defined variables whose value was the product of two or more variables, at most one of which was fixed by presolve. Example: var w := 3; var x = 1; var y = w*x; var z = w*y; minimize zot: z; # w^2 sphes.c: fix possible fault when sphsetup() is called a second time. Wed Jan 13 11:32:45 EST 1999 README: add new final paragraph about make invocations. Update xsum0.out (missed copying this file on 19981215). Tue Jan 19 01:08:35 EST 1999 New source file suf_sos.c helps use SOS suffixes (to be documented). Changes to asl.h (and several other source files) require all of amplsolver.a (or amplsolv.lib) to be recompiled. Tue Jan 19 11:28:11 EST 1999 suf_sos.c: add missing #ifdef KR_header stuff; asldate.c not changed. Mon Feb 1 17:50:46 EST 1999 suf_sos.c: fix botch in adjusting incoming integer-valued suffixes. amplsolv.lbc, amplsolv.sy: add suf_sos.obj. Sat Feb 6 17:55:09 EST 1999 asl.h: SufDesc: union u changed to struct u to facilitate debugging; amplsolver.a must be recompiled. suf_sos.c: enhanced to process suffixes .sosno and .ref (which can be set explicitly with let commands) as well as the .sos and .sosref suffixes supplied implicitly by AMPL (e.g., when it linearizes piecewise-linear terms). Each distinct nonzero .sosno value designates an SOS set, of type 1 for positive .sosno values and of type 2 for negative values. The .ref suffix contains corresponding reference values. Solvers calling suf_sos() must now declare all of the above mentioned suffixes. See, e.g., suftab and the suf_sos() invocation in solvers/cplex/cplex.c. Fri Feb 12 16:53:49 EST 1999 misc.c: zero SufDesc field u.i in suf_declare (required by changes of 19990206). writesol.c: under "g" (ASCII) format, cope with empty lines in the solution message. (Sensible solver drivers do not have such lines.) Fri Mar 19 08:42:14 EST 1999 asl.h: comments about ASL_reader_flag_bits added. suf_sos.c: trivial change; asldate.c not updated. Fri Apr 9 00:44:19 EDT 1999 pfg_read.c pfghread.c: fix a bug (fault or worse) that bit under complicated conditions. readsol.c: fix a bug in handling some incomplete .sol files. funcadd.h: new entry Qsortv in AmplExports, plus declarations for handling AMPL tables (a forthcoming extension). func_add.c: add dummy Add_table_handler and Crypto routines (for funcadd() routines that do not check that ae->asl is nonzero before calling these routines, which are meaningful only to AMPL). New routine fpinit(), called by jac0dim, to initialize the floating- point arithmetic if necessary (e.g., on Intel and SGI systems). asl.h, dtoa1.c: rather than redefining strtod (which causes some systems to complain), #define strtod strtod_ASL. Readers: call qsortv rather than qsort (so just one efficient qsort need be loaded). qp_read.c: "invisible" tweak to banish a compiler warning. Mon Apr 12 15:38:16 EDT 1999 writesol.c: fix a bug introduced in the changes of 19990206 that could erroneously cause a "sos" suffix to be written to the .sol file (when, e.g., nonconvex piecewise-linear terms are present) and might have caused some other suffixes not to be returned. Thu Apr 15 15:56:04 EDT 1999 qp_read.c: the change on 19990409 was not invisible on machines with 64-bit pointers. Today's change should correct this mistake. Mon Apr 19 16:49:19 EDT 1999 asl.h, jac0dim.c, sjac0dim.c, makefile*, amplsolv.*, studchk0.c: new routine student_check_ASL(ASL *asl) (whose default version, in studchk0.c, does nothing and whose "standard" alternative, in sjac0dim.c, is equivalent to the old sjac0dim.c and limits problems to 300 variables and 300 constraints), is a routine one can modify to impose restrictions on "student" binaries. Tue Apr 20 17:48:40 EDT 1999 mip_pri.c: account for adjustments by suf_sos(). Note that we now recommend use of the .priority suffix rather than mip_pri(). printf.c: "invisible" tweak (introduction of stdout_fileno_ASL). Wed Apr 28 10:44:10 EDT 1999 pfg_read.c, pfghread.c: fix bug reading problems with defined variables that can be split into sums of terms. Incorrect gradients or a fault during reading were possible. Example: var x{i in 1..4} := i; var y{i in 1..2} = sum{j in 2*i-1..2*i} j*x[j]; var z = y[1] / y[2]; var w = sum{i in 1..3} x[i]*x[i+1]; # splits s.t. zot: z^2 <= 3; # gradient was miscomputed s.t. zap: w >= x[3] + 1; suf_sos.c: honor Fortran: take asl->i.Fortran_ into account when adjusting A_colstarts and A_rownos, and add Fortran = asl->i.Fortran_ to each number in sosbeg and sosind (in analogy with A_colstarts and A_rownos). names.c, writesol.c: take variables and constraints eliminated by suf_sos() into account (in the case of writesol, when wantsol bits 2 and/or 4 are one: the eliminated entities were already accounted for in the .sol file). Thu Apr 29 11:52:14 EDT 1999 makefile.wat: add a backslash (missed in the changes of 19990415). Fri Apr 30 13:59:40 EDT 1999 nqpcheck.c: fix possible fault. (Absent a fault, the bug was harmless). New sigcatch_ASL() will catch various Unix signals and call mainexit_ASL() and permit routines registered with atexit() to be called when the solver is terminated by SIGABRT, SIGQUIT, SIGTERM, or SIGHUP (unless SIGHUP is being ignored when sigcatch_ASL() is called). Fri May 21 17:20:01 EDT 1999 qp_read.c: fix bug in qp_opify's handling of imported functions. readsol.c, rops.c, rops2.c: add some fflush(Stderr) calls. makefile: renamed makefile.u, so one can copy the appropriate makefile.* to makefile, then edit makefile. printf.c, mainexit.c: for use by GUIs, compilation with -DPF_BUF of amplsolver.a (or amplsolv.lib) and of solver interfaces causes fprintf(stderr_ASL,...) to be accumulated in pfbuf_ASL (which is allocated at the first relevant fprintf call and extended if necessary) and, if pfbuf_print_ASL is not null, fflush(stderr_ASL) causes pfbuf_print_ASL(pfbuf_ASL) to be called and pfbuf_ASL then to be freed. Tue Jun 1 23:46:49 EDT 1999 Tweaks for -DKR_headers; have equ_adjust() operate independently of the presolve setting. Thu Jun 3 14:19:03 EDT 1999 makefile.u: correct comment about AIX to "for AIX versions < 4.3". Sat Jun 5 16:24:52 EDT 1999 pfg_read.c, pfghread.c: fix possible fault or worse during gradient computations of an objective or constraint that makes nonlinear use of a linear defined variable that depends on other (necessarily linear) defined variables that do not otherwise appear in the objective or constraint. Example: var x{i in 1..2} := i + 1; var y = 1 - x[1]; # linear defined variable var z = y + 5; # linear def. var., depending on y s.t. c: z*x[2]*(3 + 4*x[2]) = 0; # nonlin. use of z conpval.c: fix bug in Jacobian computations after pfgh_read(): if a common expression appeared in two terms, one involving more variables than the other, then the common expression's contribution to first derivatives was counted twice. Example: (x[1] + x[2] + 1) in var x{i in 1..4} := i + 1; s.t. c: (x[1] + x[2] + 1)*x[2] == (x[1] + x[2] + 1)*x[3]*x[4]; Thu Jun 17 11:42:59 EDT 1999 func_add.c: minor cosmetic changes that only matter to pure C++ compilers; asldate.c not changed. Thu Jun 17 18:41:38 EDT 1999 rops.c, rops2.c: fix botch in "and" and "or" expressions (appearing in the condition expression of nonlinear "if" expressions): the first argument was passed as argument to the second operator. Fri Jun 25 17:50:51 EDT 1999 funcadd1.c: fix a (previously harmless) type error. names.c: fix a bug in obj_name(). printf.c: add #ifdef USE_ULDIV logic for use on DEC Alpha machines running some versions of OSF1. readsol.c: capture solve_result_num. Wed Jun 30 16:12:12 EDT 1999 pfghread.c: fix more bugs with linear defined variables. Very simple ones were sometimes mishandled. Example: # Jacobian matrix was miscomputed after pfgh_read() var x := 1; var a = x; var b = 1 - a; s.t. c: b*(x/x) - 3*b = 1; Another example (different bug) with simple defined variables in which the Jacobian matrix was miscomputed after pfgh_read(): var x := 1; var y := 2; var z := 1; # variant: fix z; var v2 = z*y; var v3 = 1 - y; var v4 = v3; var v5 = x + v2; var v6 = (x + v2) / v5; var v7 = v4 / (v3+5); s.t. c: v6 + v7 = 1; readsol.c: "invisible" tweak (banish harmless warnings). Fri Jul 9 08:34:57 EDT 1999 xp2known.c: Fix a bug in computing constraint and objective values after pfgh_read() with certain uses of very simple defined variables. The bug is related to the one illustrated in the second example of 19990630, but not revealed by that example (but by a more complex one). Wed Aug 4 09:02:13 EDT 1999 xp1known.c: make changes analogous to those to xp2known.c on 19990709. (This is for completeness; we know of no solver using this routine.) obj2val.c: omit an unnecessary "extern int errno;"; errno.h should provide this (or the equivalent). func_add.c, funcadd1.c: unless there is a command-line -i option, look first in $ampl_funclibs for imported functions; if $ampl_funclibs is not available, look (as before) in $AMPLFUNC. Starting with version 19990804, AMPL sets $ampl_funclibs to the full pathnames of the libraries from which functions in the current problem instance were imported. Now -i, $ampl_funclibs, or $AMPLFUNC may contain a newline- separated list of directories and file names, and the names may contain internal spaces. funcadd.h: new fields in struct TableInfo have no affect on the solver interface library. Thu Aug 5 17:42:21 EDT 1999 funcadd1.c, func_add.c: modify -i? output to tell about $ampl_funclibs (and change some calling sequences). Thu Aug 12 21:12:29 EDT 1999 Minor tweaks... funcadd1.c: remove an unused variable. asl.h, jac0dim.c, stderr.c: provide for ill-advised systems (e.g., Red Hat Linux 6.0 for the DEC Alpha) in which static initializations for the form "FILE *foo = stderr;" do not work: compiling the solver interface library with -DNON_STDIO omits this sort of initialization, which is replaced by a call on Stderr_init_ASL() in jac0dim(). Of course, solvers that wish to do something with Stderr before jac0dim has been called will have to first manually invoke (or do the equivalent of) Stderr_init_ASL() when used on such inconvenient systems. fpinit.c: tweak to compile under Red Hat Linux 6.0 for the DEC Alpha. For older DEC Alpha versions of Linux, it may be necessary now to compile fpinit.c with -DUSE_setfpucw . Mon Sep 27 17:13:14 EDT 1999 func_add.c, funcadd1.c: remember imported libraries and recall them at any .nl-reader calls after the first (unless compiled with -DCLOSE_AT_RESET). This became necessary after the changes of 19990804. getstub.c, misc.c: add more calls on Stderr_init_ASL (cf the previous changes). Fri Oct 1 11:00:21 EDT 1999 con[12]ival.c, objval.c: remove redundant #include "errno.h". rops.c, rops2.c, errchk.h: when errno is nonzero, add its interpretation to error messages for library functions whose evaluations fail. (This may help detect spurious setting of errno.) Thu Oct 7 18:01:56 EDT 1999 rops.c, rops2.c: clear errno after calling an imported function. fg_read.c: "invisible" tweak to use op_type.o rather than op_type.hd. makefile.*: try to get dependencies right and omit obsolete names. Thu Oct 14 00:26:12 EDT 1999 Tweaks to many files: 1. Move errno = 0 assignments before x...check() calls, as these calls may evaluate common expressions. 2. Setting want_xpi0 |= 4 causes havex0 and havepi0 to be allocated when primal and dual initial guesses are present. 3. New, experimental routine fg_write can write a binary or ASCII .nl file, possibly adding new linear variables, constraints, objectives; normally used with new reader fg_wread(), a variant of fg_read() which, like qp_read(), leaves operation numbers rather than function pointers in the "op" fields. (A subsequent call on qpopify() can make it possible to evaluate nonlinear expressions, but fg_write requires the operation numbers.) New examples/nlcopy.c illustrates use of fg_wread and fg_write. 4. New bits in the flag argument to the .nl readers: ASL_keep_all_suffixes ASL_omit_all_suffixes ASL_keep_derivs ASL_allow_missing_funcs ASL_forbid_missing_funcs The first can be used by any reader (but is mostly for fg_wread); the latter are only for fg_wread. Fri Nov 19 16:55:10 EST 1999 xectim.c: where possible, return the sum of user and system time, rather than just user time. On systems with slow software for gradual underflow, it is possible to contruct examples where this makes a significant difference in the reported times. Mon Dec 13 17:00:00 EST 1999 fpinit.c: tweak for Linux (e.g., S.u.S.E. 6.3, Red Hat 6.0); asldate.c not changed. Wed Dec 15 13:30:46 EST 1999 dtoa.c, dtoa1.c: tweak to bypass a bug with HUGE_VAL on HP systems. Thu Feb 3 23:18:24 EST 2000 funcadd.h: new fields in AmplExports. asl.h and several *.c files: struct Edaginfo now has a pointer to an AmplExports, rather than the complete structure, so that future additions to AmplExports will not require recompiling everything. This change does require make recompiling the whole library necessary, as well as any solver objects that depend on asl.h or funcadd.h. New variant fpinitmt.c of fpinit.c for Win32 binaries; makefile.* adjusted. Thu Feb 10 17:31:13 EST 2000 pfg_read.c, pfghread.c: fix a bug (division by zero resulting in NaNs) that arose in a complicated use of defined variables. sphes.c: fix a probably harmless reference to an uninitialized variable. Wed Feb 16 19:13:18 EST 2000 nqpcheck.c: adjust to cope with <<0;0,0>>x*x with AMPL versions < 20000216, which gave 0*x*x rather than 0. Thu Feb 17 18:21:17 EST 2000 pfg_read.c, pfghread.c: fix a bug in handling sums of three or more terms each involving a nonlinear expression with a sum of three or more terms. The bug caused a surprising error message in the example that led to finding the bug, but could cause unpredictable behavior in general. Sun Mar 5 22:07:29 EST 2000 objval.c: fix bug in evaluating defined variables: defined variables appearing only in single constraints were evaluated during objective function evaluations; under unusual conditions, this could lead to an error being reported in the evaluation of the objective. pfg_read.c, pfghread.c: fix some bugs in Jacobian and Hessian evaluations involving a defined variable that is an affine function (linear function plus constant) of a single problem variable. makefile.u: comment on -DNON_STDOUT. func_add.c: add #ifdef NO_tempnam lines for systems without a tempnam function. Mon Mar 6 12:35:27 EST 2000 pfg_read.c, pfghread.c: minor "invisible" tweak to recycle a bit more memory. Wed Mar 8 13:49:57 EST 2000 Fix minor printf glitch: printf "%.0f\n", .1; printed "0." rather than "0" -- under "%.0f", numbers less than 1 in absolute value that do not round to 1 or -1 should print as "0" with no trailing decimal point. Wed Mar 15 12:42:05 EST 2000 pfg_read.c, pfghread.c: fix another botch with linear (affine) defined variables: scaling was lost in linear references. For example, in var x; var y = 3*x; s.t. zot: sin(x) - 4*y == 1; the factor (-4) in zot was lost. asl.h, con1ival.c, con2ival.c, con2val.c, conpval.c, conval.c, obj2val.c, objval.c: tweaks to avoid redundant work with some combinations of calls. fg_write.c, readsol.c: "invisible" cleanups. Fri Mar 17 22:46:32 EST 2000 arithchk.c, makefile.*: On Unix/Linux systems, account for the effects of fpinit_ASL when deriving arith.h. On SGI systems using the n32 or 64 ABI, this causes Sudden_Underflow not to be #defined. Sat Mar 18 23:22:24 EST 2000 func_add.c: fix bug introduced 19990804 in handling imported functions when two or more .nl readers are called. (This affects loqo, which may call both qp_read and pfgh_read.) Mon Mar 20 16:55:45 EST 2000 Minor tweaks for compilation with -DKR_headers (files asl.h, fg_read.c, fg_write.c, func_add.c, funcadd1.c). Mon Mar 27 01:33:59 EST 2000 pfg_read.c, pfghread.c: fix bugs in handling defined variables in certain complicated situations (e.g., on Vanderbei's hs090.mod). One bug arose under AMPL's "option linelim 1". Tue Mar 28 11:20:09 EST 2000 pfg_read.c, pfghread.c: fix glitch with nonlinear "if" expressions with constant "then" or "else" expressions and with "min" or "max" expressions having a constant operand: a fault was possible during expression evaluations (after reading). Tue Apr 4 11:52:52 EDT 2000 pfg_read.c, pfghread.c: fix yet another bug with defined variables: if a nonlinear defined variable appeared linearly in an objective and could be split into several terms, each depending on a different set of variables, and if linear combinations of variables appeared nonlinearly, incorrect derivative computations could result. Thu Apr 27 19:17:20 EDT 2000 New field AI of type AuxInfo* in AmplExports. It can be assigned by auxinfo_ASL() to provide general kinds of auxiliary information. The (new) default auxinfo_ASL in amplsolver.a (amplsolv.lib) simply assigns AI = 0, but solvers can provide their own auxinfo_ASL to provide more interesting values. opcode.hd moved from directory ampl/solvers/nlc to ampl/solvers for more convenient use by other solver drivers. Wed May 3 07:53:14 EDT 2000 New subdirectory lbfgsb with an interface to L-BFGS-B, which minimizes or maximizes a differentiable objective subject only to simple-bound constraints. See Algorithm 778, ACM Trans. Math. Software 23 #4 (1997), by Ciyou Zhu, Richard Byrd, Peihuang Lu, and Jorge Nocedal. Fri Jun 2 08:57:49 EDT 2000 fpinit.c: new section for Solaris on i386 machines. New fpsetprec.s for use with fpinit.c on Solaris i386 systems. getstub.c: "invisible" tweak for readability. pfg_read.c pfghread.c: fix some bugs with defined variables: definitions of the form var x = if something then 1 else 2; where both the "then" and "else" clauses were constant almost everywhere were mishandled, and definitions that could be split apart (while identifying partially separable structure) were sometimes mishandled. Here is an example that caused a fault in pfgh_read(): var a := 0; var b := 2; var c := 3; var x = if 2 <= a then 2 else b + c; var y = if 2 <= a then 0 else -2; var z = 2*x + y^2; minimize zot: z; Thu Jun 8 19:13:13 EDT 2000 func_add.c, funcadd.h: new ae->Getenv and #define for char* getenv(const char*) mainly for use in AMPL sessions to let imported functions and table handlers access the current environment (as modified by option, environ, and problem commands). Only use getenv in imported functions (in the form (*al->Getenv)) if ae->ASLdate >= 20000608. func_add.c: fix glitch that could result in "_fileno" reported as missing on some systems. Mon Jul 3 11:44:29 EDT 2000 Tweak to fpsetprec.s for use with fpinit.c on Solaris i386 systems. (Adjust stack to allow interrupts to intervene in fpsetprec().) asl.h, basename.c, getstub.c: change "basename" to "basename_ASL", to avoid (rare) trouble on hostile systems. rops.c, rops2.c: "invisible" tweak (change "round" to "Round") to avoid trouble on other hostile systems. Fri Jul 7 08:40:36 EDT 2000 funcadd1.c: when loading a library to import functions, arrange for subsequent unloading of the library to happen after any at_exit() or at_reset() processing requested directly or indirectly by addfunc(). (This matters to an experimental facility for importing Java functions.) der0prop.c withdrawn (unused). Various files: adjustments to permit compilation by C++ compilers. Thu Jul 20 11:03:28 EDT 2000 basename.c: omit an 0x01 visible under -DKR_headers, introduced on 20000707. pfg_read.c, pfghread.c: fix bug in handling nonlinear defined variables that appeared linearly in an objective or constraint and involved the sum of two or more terms involving different sets of variables (so they could be split into a sum of defined variables to make Hessian computations more efficient). If introducing a linear change of variables also helped and was discovered at the "right" time, incorrect derivative computations resulted. Example: var x{i in 0..2} := .1; var v3 = 1 / x[0]; var v4 = x[1] + 5*x[2]; var v5 = v3 - x[1]*v4; minimize foo: v5 + x[2]*v4; Correcting this bug involved changing one line from ce->z.i = ka; to ce->z.i = k < Ncom ? ka : ((expr_vx*)varp[k-Ncom])->a0; but today's changes also include an "invisible" adjustment to the a1 field of struct expr_vx. Thu Jul 27 21:41:42 EDT 2000 Extend comments in makefile.u about Solaris on the i386 architecture. Thu Aug 3 13:44:35 EDT 2000 funcadd1.c: mostly invisible addition of "#undef mymalloc". jac0dim.c, misc.c: move Stderr_init call to ASL_alloc() (a change invisible on most systems, but relevant to some solvers, such as cplex, on some Linux systems, if the solver issues an error message too soon). getstub.c: usage_ASL(): call Stderr_init if necessary. Tue Aug 22 23:36:17 EDT 2000 New genrowno.c defining gen_rownows_ASL (#defined as usual to apparent prototype void gen_rownos(void)): solvers that handle sparse nonlinear constraints and wish to have Jacobian nonzeros stored sparsely by columns in A_rownos may simply call gen_rownos() after calling the .nl reader (with A_vals left at its default value = NULL). Mon Aug 28 14:32:32 EDT 2000 pfg_read.c, pfghread.c: fix bug on systems with 64-bit addresses that caused, e.g., miscomputation of gradients with problem "hs105" (/netlib/ampl/models/nlmodels/hs105.mod). Wed Aug 30 01:11:01 EDT 2000 pfg_read.c, pfghread.c: fix a bug with pfgh_read(nl, flags) when one or both of the ASL_find_co_class bits of flags is on: wrong c_class or o_class values (or a fault due to an out-of-bounds subscript) could result if the bug bit. All readers: fix bug (out-of-bounds array reference) in some cases when asl->i.nlvog has been assigned a positive value. (Of the sample drivers in /netlib/ampl/solvers subdirectories, only minos/m55.c and snopt/snopt.c do this.) jac0dim.c jacinc.c: adjust x0len to only consider nonlinear variables when deciding whether nonlinear information must be updated. Tue Sep 5 13:17:01 EDT 2000 pfg_read.c, pfghread.c: fix a bug in computing derivatives that arose under complicated conditions: a defined variable could be split into the sum of two or more defined variables and appeared in an expression complicated enough that "funneling" the expression led to more efficient derivative computations. Example: var x{1..2} >= .6 <= 1 := 1; var y{i in 1..2} = .5*x[i] + 1; var z{i in 1..2} = .25*y[i] + 3; var w = (1 + (y[1] - y[2])^2) / z[2] # split + (y[1] - 7) / z[1]; s.t. zot: w + x[1] + x[2] == 0; # first term of w funneled Tue Sep 12 15:38:38 EDT 2000 nqpcheck.c: for constraints, when a quadratic form involves a constant term, update the constraint upper and lower bounds rather than adjusting the value of the constraint body. Mon Oct 2 15:45:39 EDT 2000 pfg_read.c, pfghread.c: fix bug only possible with inappropriate use of "option presolve 0" resulting in constant "defined variables". All nonlinear .nl readers: fix botch in computing bounds (LUrhs, Urhsx) on constraints involved in complementarity conditions. The bounds were supposed to be redundant with those implied by the cvar array. Solvers, such as PATH, that just used the variable bounds are unaffected by this bug fix. Fri Oct 6 10:21:04 EDT 2000 pfg_read.c, pfghread.c: cope with 0*variable, which prior to AMPL version 20001006 could arise from expressions of the form v1*sum{i in A} p[i]*v[i], where v and v1 are variables and p[i] == 0 for all i. Mon Oct 9 17:03:24 EDT 2000 funcadd1.c: fix a possible fault with use of imported functions. The fault, if it occurred, happened at the end of execution (except under -DCLOSE_AT_RESET, when it happened when ASF_free was called). Wed Nov 1 17:27:49 EST 2000 mach.c: tweak to prevent trouble with optimization by a very recent version of gcc. dtoa.c: "invisible" tweaks (to be detailed in a forthcoming update to /netlib/fp/changes). Fri Nov 3 09:28:10 EST 2000 funcadd.h: correct comment describing FUNCADD_012ARGS, which is for *random* real valued functions; asldate.c not changed. dtoa.c: sync with /netlib/fp/dtoa.c Fri Nov 10 17:43:07 EST 2000 pfg_read.c, pfghread.c: fix glitch with constant-valued defined variables (which can arise with "option presolve 0" -- a bad idea in general): they were evaluated at twice their correct value. All nonlinear .nl readers: in calls on imported functions with expressions involving variables in the argument list (so al->derivs and, if relevant, al->hes will be nonzero), initialize all components of al->derivs and al->hes to zero. Previously, only the al->hes components were so initialized. Mon Nov 13 22:54:19 EST 2000 pfg_read.c, pfghread.c: fix a performance bug with defined variables that sometimes resulted in explicit constant zeros in sparse Hessians. The bug bit when, say, the objective made linear reference to a defined variable that itself was the (possibly weighted) sum of defined variables. Example: param N default 3; set I := 1..N; set T default 1..2; set P := {i in I, j in i+1..N}; var d{P,T} >= 0.01 := 1; var p{(i,j) in P, k in T} = (i+j)/d[i,j,k]; var r{k in T} = 12*sum{(i,j) in P} p[i,j,k]; var t = sum{k in T} 2*r[k]; minimize zap: .05*t; The computed Hessian had explicit zeros in the (i,j) positions for all i < j. Wed Nov 15 17:40:13 EST 2000 nqpcheck.c: fix bug in handling defined variables that are the sum of two or more quadratic terms. Example where the bug bit: set I := 1..2; var x{i in I} := i; var y = 7*sum{i in I} (x[i]/(i+1))^2; minimize zot: 10*y; On this example, ampl/solvers/examples/qtest reported objective value 17.5 rather than 48.6111111111111. misc.c: correct names in some error messages for incorrect usage (calls out of sequence). Fri Nov 17 16:57:18 EST 2000 fg_read.c: fix a bug that could only manifest itself under unusual circumstances: calling fg_read() after assigning want_derivs = 0, with top-level "if" or "min" or "max" expressions, as in "nlc -1 foo", where foo.nl comes from var x {1..3}; s.t. c: min (x[1],x[2],x[3]) = 5; misc.c: banish register declarations ("invisible" tweak). Thu Dec 28 18:44:14 EST 2000 pfg_read.c, pfghread.c: fix a bug in handling chains of defined variables of the form v[i+1] = v[i]. The smallest known example where the bug bit is the rather baroque var v0 >= 0 := .02; var v1 >= 0 := 13.23; var v2 := -1.288; var v3 := -1.288; var v4 >= 0 := 13.23; var v5 = .5*v0*(v2 - 1.288); var v6 = v5 + .5*v0*(v2 + v3); var v7 = v6 + .5*v0*(v3 - 1.288); var v8 = v7; var v9 = v8; var v10 = v9; minimize zot: v4; s.t. c0: 60.536*v0 - v10 = 100; s.t. c1: -.5*v0*(v1 + 13.23) = -.2646; When it bit, the bug caused incorrect Jacobian evaluations. Tue Jan 2 18:51:43 EST 2001 asl.h: tweak to permit making Win32 DLLs that access stdio by starting with #define NO_STDIO1 #define Permit_AE_redefs #include "asl.h" and arranging separately to make "ae" visible; asldate.c not changed. Mon Jan 15 17:09:34 EST 2001 conpval.c, pfg_read.c, pfghread.c: fix Hessian bug in handling unary(unary(terms(x)) where terms(x) is the sum of two or more terms involving different subsets of the variables x. Example: var x{1..2} := .5; minimize zot: sin(-(x[1] + x[2])); Note the -(), i.e., negation, is a unary function. Tue Jan 16 13:30:39 EST 2001 rops.c, rops2.c: reorder partial derivative computations for x^y and x^c (constant power) to avoid trouble when x^y or x^c underflows to zero. Wed Feb 7 13:15:13 EST 2001 dtoa.c, dtoa1.c, atof.c: obscure bug fixes (see /netlib/fp/changes). Thu Mar 22 14:07:07 EST 2001 funcadd.h: fix a typo in a comment (s/funcadd/addfunc/). misc.c: tweak to permit reading ASCII .nl files massaged to have either Microsoft (\r\n) or Macintosh (\r) end-of-line notation. Fri Apr 27 18:01:04 EDT 2001 suf_sos.c: fix a glitch that will matter to MIP solvers that handle SOS2 sets once AMPL's forthcoming "variable in union of intervals" extension is available. A fault was possible. Wed May 9 23:36:02 EDT 2001 printf.c: Have printf("%s",0) print "" rather than fault. This affects both solvers and imported (user-defined) functions. funcadd.h: add some #ifdef _WIN32 goo for added flexibility. Thu May 10 17:34:16 EDT 2001 qp_read.c: fix a bug in qp_opify that would cause a fault when it bit. con1ival.c, con2ival.c, conpval.c, conpvaldb.c, obj2val.c, objval.c: trivial adjustment: use M1zapalloc() instead of M1alloc and memset. Wed May 23 13:16:03 EDT 2001 suf_sos.c: fix bug (mis-ordered statements) that could bite on problems with both nonconvex piecewise-linear terms (linearized by AMPL) and explicit .sosno and .ref suffixes. When processing .sosno and .ref, sort SOS1 members on increasing .ref values. Adjust for possible use with nonlinear solvers: if A_vals is null, adjust Cgrad and con_de to reflect removed constraints. asl.h, suf_sos.c: add recognition of bit ASL_suf_sos_just_SOS1 in the flags argument to suf_sos(). If this bit is set, SOS2 constraints added by AMPL while transforming nonconvex piecewise- linear terms are retained and just the associated SOS1 constraint is removed. getstub.h, value.c: add FI_val for a fint value in a known place. sphes.c: in the call sphes(h, no, ow, y), if 0 <= no < n_obj and ow is nonzero, use weight ow[no] rather than 1. for the objective. fpinit.c, makefile.u: for more flexibility on Linux systems, add "#ifndef NO_fpu_control" logic to fpinit.c and a comment on it to makefile.u. Thu May 24 08:45:36 EDT 2001 suf_sos.c: change to ASL_suf_sos_just_SOS1 bit: if on, retain all constraints added when linearizing nonconvex piecewise-linear terms. Thu May 31 17:10:29 EDT 2001 conpval.c objval.c xp[12]known.c: add some missing "err_jmp = 0" assignments (to prevent trouble under unusual conditions -- most solvers are unaffected). Sundry files: adjust all Hessian computations to treat arguments (nobj, ow) the same as in last week's change to sphes.c: if ow is nonzero and 0 <= nobj < n_obj, use weight ow[nobj] rather than 1. Also add interlocks to make it true for sphes() that the Hessian is computed at the most recent primal variables x passed to any of the function or gradient routines (congrd, conival, conval, jacval, objgrd, or objval) or to xknown() or xknowne(). Hitherto explicit previous gradient computations were required on problems with "group" partially separable structure. Fri Jun 1 11:38:31 EDT 2001 Fix glitches in compilation with -DKR_headers. Correct yesterday's changes to make Hessian computations right when nonlinear gradients of relevant functions lacking "group" partially separable structure have not been computed at the current x. For hvcomp(), assigning asl->i.x_known = 2 before a series of calls on hvcomp turns off the tests that would bring gradient information up to date. This saves overhead and is appropriate if the program logic ensures that all relevant gradients have been computed at the current x. If you do this, be sure to invoke "xunknown();" after the series of hvcomp calls. Header file changes yesterday and today make it necessary to recompile solver source files that include asl_pfgh.h or jacpdim.h. Sat Jun 2 01:01:42 EDT 2001 Shortly after the previous update, Bob Vanderbei reported a new bug: after pfgh_read(), first derivatives were miscomputed when a unitary function was applied to a sum of three or more nonlinear terms, two or more of which involved the same "internal variables", such as x+y and x-y in the following simple example: var x := -1; var y := 1; minimize f: sqrt((sin(x+y) + (y-x))^2 + (y-x+1)^2); Sat Jun 2 17:07:48 EDT 2001 conpval.c: fix a new fault with calls on duthes, fullhes, sphes, or hvcomp with y = 0. asl.h: add #define for hvinit() with apparent prototype void hvinit(int nobj, real *ow, real *y) which should be called before hvcomp when calling hvcomp at the same x (primal variable values) but different (nobj, ow, y). objval_.c: add corresponding Fortran (f77) callable subroutine hvinit(nobj, ow, y) integer nobj double precision ow(*), y(*) duthes.c, fullhes.c, sphes.c and xp2known.c: change default hesset() calls to make all nonlinear objectives and constraints available for Hessian computations. Though not yet described in "Hooking Your Solver to AMPL", hesset() with apparent prototype void hesset(int flags, int obj, int nnobj, int con, int nncon) has long been #defined in asl.h. It must be called once after pfgh_read() to indicate which objectives and constraints will participate in Hessian computations: objectives obj <= i < obj + nnobj and constraints con <= i < con + nncon will subsequently be considered (with obj = 0 for the first constraint and con = 0 for the first objective). Currently, the flags argument should be 1. Since problems may be declared to have more than one objective, when treating objective nobj (0 <= nobj < n_obj), it is best to invoke hesset(1,nobj,1,0,nlc) after pfgh_read() so only the desired objective will affect the sparsity pattern presented to the solver (when using sphes()). When there is no objective, use obj = nnobj = 0, as in hesset(1,0,0,0,nlc). Thu Jun 7 17:37:42 EDT 2001 asl.h, pfg_read.c, pfghread.c: change to interpretation of flags argument to pfg_read and pfgh_read: unless ASL_find_default_no_groups appears in flags, assume ASL_findgroups. When ASL_find_default_no_groups appears, only explicit specifications of ASL_findOgroups, ASL_findCgroups or ASL_findgroups are now honored. Thus pfgh_read(nl,0) would now be "normal" usage, as it's generally desirable to have the increased efficiency that finding group structure can bring. One exception is lancelot, which only wants to see group structure for objectives. The sample driver for lancelot is updated accordingly. Fri Jun 15 13:44:38 EDT 2001 conpval.c: fix a glitch in the changes of 20010531: objgrd rather than congrd was called to compute partials needed for Hessian computations (under apparently unusual conditions). In the example behind this correction, the bug caused the surprising error message objpgrd: got NOBJ = 1; expected 0 <= NOBJ < 1 Tue Jun 19 00:41:37 EDT 2001 makefile.u: change "a.out" to "./a.out" (in case $PATH excludes "."). Wed Jun 20 16:36:55 EDT 2001 fpinit.c: use IEEE default exception mask with FreeBSD. Mon Jun 25 15:11:43 EDT 2001 arithchk.c, makefile.u: add (undesirable) #ifdefs to simplify makefile modifications needed for Intel Solaris. Mon Aug 13 23:47:27 EDT 2001 fpinit.c, funcadd1.c, makefile.*: omit WIN32 in favor of _WIN32 (which is predefined by the WIN32 compilers in WIN32 mode). fpinit.c: provide "#ifdef ASL_NO_FP_INIT" for examples/amplfunc.c. examples/amplfunc.c and spamfunc.c: under _WIN32, include fpinit.c with ASL_NO_FP_INIT #defined (to prevent possible surprises). No change to asldate.c. Thu Aug 23 09:42:07 EDT 2001 suf_sos.c: When processing .sosno and .ref, if .priority is available, give each SOS1 and SOS2 set specified by .sosno the maximum priority of any of its variables (rather than the minimum). Wed Feb 6 16:57:53 EST 2002 New function int_catch(void(*f)(int,void*), void *v) lets a solver interface provide a function f such that f(SIGINT,v) should be invoked the first time a SIGINT signal is received. This could instruct the solver to terminate gracefully. Argument v is passed without change to f. Imported functions can also call f as follows: AmplExports *ae = al->AE; if (ae->ASLdate >= 20011004 && ae->Breakfunc) (*ae->Breakfunc)(2, ae->Breakarg); Fix glitches with printf: printf "%3.0f\n", .1; # gave " 0" rather than " 0" printf "%3.-2f\n", 1; # gave " 00" rather than " 0" Fix a memory leak that occurred when sphes_setup() was called with several times with different arguments. Fix a fault in pfg_read() and pfgh_read() in handling a nonlinear defined variable involving (variable expression)*(sum of nonlinear terms), where the linear terms cancel or there are two or more explicit zeros in certain positions. Example (that results in two explicit zeros with AMPL versions prior to 20011218): set I := 1..5; var w{I} := 2 >= 0 <= 5; var x{I} := 1 >= 0 <= 4; var y <= 4 := 1; var z = y * sum{i in I} i*w[i]*x[i]; maximize zot: y*z; s.t. zap: z <= 10; s.t. fix25{i in {2,5}}: x[i] = 0; Here is a uuencoded, gzipped foo.nl resulting from the above with option nl_comments 1; write gfoo; (with an AMPL version prior to 20011218): begin 644 foo.nl.gz M'XL("`"U'SP``V9O;RYN;`"-4CV3FS`0K=E?H1F*G#,4PH!M[LH4F;DF79I, M"H%EK!Q(CB0XGW]]GO@XA^(R&PVFCGK5#:X\-4OV3MU2!QMT(WX92_M:-``T4;W2HMA?V(1G-L+?VK ML2]_PQ[O[(1-9]"#M0H<5#&E/]95&7\>TV`%33-OR0B^$BC8/;%3KT%"G">& MG_Z0)Z5'Y6HKO;P3'UFEM+!O"61XV4C(O I[FA/!WKFK`QQ$(6C$HY*."KAJ(2C$HY*."KA]/5_@7\`*&=WP+@#```` ` end Adjust arithchk.c so it will emit #define NANCHECK in at least some cases when the math library fails to set errno. README is correspondingly modified. asl.h, suf_sos.c: the ASL_suf_sos_just_SOS1 flags bit is withdrawn. In its place is a new routine, sos_add() (source file sos_add.c) for use by solvers that handle integer variables and perhaps know about SOS1 constraints, but do not fully support SOS sets -- e.g., do not supply the convexity constraint that implies the SOS1 condition. For such solvers, one now invokes void *SI = sos_add(nl,flags); before calling the .nl reader. This routine scans the incoming suffixes and arranges for the .nl reader to leave room for adding constraints and variables needed to properly treat .sosno and .ref. After calling the .nl reader, one then invokes either nsos = sos_finish(&SI, flags, &nsosnz, &sospri, copri, &sosbeg, &sosind, &sosref); if the solver wants to know about SOS1 constraints, or sos_finish(&SI, flags, 0,0,0,0,0,0); if not. Both sos_finish invocations are no-ops, returning 0, if SI is null. When SI is not null, both may adjust n_con, nzc, etc. func_add.c: on Linux systems, supply private tempnam and tmpnam (which are only there in case imported functions want to use them on Microsoft systems) to banish warnings about use of dangerous functions. Tue Feb 12 08:29:04 EST 2002 fgh_read.c: omit a check that printed Cgrad[nnn] = 0 on trivial constraints (that are eliminated unless one inappropriately specifies "option presolve 0"). pfg_read.c, pfghread.c: fix a bug in pfgh_read() whereby partially separable constant terms other than numerical constants were treated as zero. Such terms can arise when one (inappropriately) specifies "option presolve 0" in examples with defined variables and fixed variables, such as var x{i in 0..2} := i; var y = x[1] - x[2]; var z = y^2; minimize f: x[0]^2 + z; fix {i in 1..2} x[i]; and in examples with imported functions that are unavailable to the AMPL processor (but available to the solver), as in function ginv; var x; minimize zot: (x-1)^2 + ginv(2); makefile.u: add sos_add.c to the rule for xsum.out. Thu Feb 21 14:07:02 EST 2002 pfg_read.c, pfghread.c: fix longstanding bug in handling unary minus in some contexts: too much got negated (by pfg_read() and pfgh_read()). An example where the bug bit: var x := 1; var y := sin(-1.5); s.t. c1: sin(-.5 + -x) == y; Tue Apr 9 18:44:03 EDT 2002 writesol.c: when invoked by AMPL versions >= 20020401, omit the backspaces that hitherto appeared when properly behaving solvers did not report any option settings. fgh_read.c: omit an unused variable. Mon Apr 22 11:13:39 EDT 2002 sos_add.c: fix bugs in handling fewer new variables than might have been required (because some turned out already to be binary) and in working with pfg_read() and pfgh_read(). Tue Apr 30 18:22:33 EDT 2002 getstub.c: extend Ver_val (for "version") to accept an optional value (as in "version=1"). value.c: use *(unsigned char*) in some comparisons (an invisible change with ASCII characters). Tue May 7 15:58:54 EDT 2002 funcadd.h, func_add.c, printf.c, stdio1.h: make C99 snprintf and vsnprintf available to imported functions when ae->ASLdate >= 20020501. New source file details.c0 meant for conversion to details.c either automatically (under Linux and Unix, where the makefile can use sed and "uname -sr"), or by hand editing (on Microsoft systems). Ver_val now uses char sysdetails_ASL[] (unless it is ""), which can be supplied by details.c or by individual drivers. getstub.[ch]: new field driver_date in Option_Info: if positive, its decimal value should be a date string YYYYMMDD, which will appear with command-line option -v or keyword "version" (if associated with Ver_val -- the recommended arrangement). In the sample drivers in the ampl/solvers subdirectories, YYYYMMDD has now been derived automatically by the mkfile rule sed "s/YYYYMMDD/`Dt -8 $prereq`/" $prereq >$target and explicitly loading $S/sjac0dim.o (or $S/sjac0dim.obj) to make a student version causes "-v" and "version" output to mention "Student ". sos_add.c and the .nl readers: correct dmg misunderstanding of SOS1 sets: at most one variable in an SOS1 set should be nonzero, rather than exactly one. Fix a glitch (leading to an error message about a bad .nl file) using sos_add on problems with defined variables. Wed May 8 16:53:58 EDT 2002 sos_add.c, suf_sos.c: adjust to avoid a fault when used with a forthcoming AMPL extension for "var in union_of_intervals". Mon Jun 17 14:07:07 EDT 2002 getstub.c: if $solver_msg is an odd positive integer (such as 1), suppress the initial "($solver): " and the echoing of solver options. Sat Jul 13 12:27:02 EDT 2002 printf.c: "invisible" internal tweak (reflected in asldate = 20020627). funcadd1.c: add "#ifdef __APPLE__" stuff for Macintosh OS X. Mon Aug 19 12:17:51 EDT 2002 funcadd.h: add const qualifier to char **sa; asldate.c not changed. Wed Aug 28 23:13:50 EDT 2002 fg_read.c, fgh_read.c, pfg_read.c, pfghread.c: tweak in response to const qualifier added to funcadd.h on 20020819. Obscure bug fix to printf.c, affecting printf, fprintf, sprintf: on systems with IEEE arithmetic, get an explicitly requested sign of zero right under format %+e, e.g., in printf("%+e\n", -0). Thu Sep 5 16:12:38 EDT 2002 Fix a glitch in rarely used routines (xknown and xknowne used with fgh_read()): in x2check.c, supply a missing reset of asl->i.err_jmp_. Fix bugs with calling evaluation routines with nerror nonnull and nonnegative, receiving an evaluation error, then calling another evaluation routine with nerror null or negative and receiving another error. (Such sequences seem unlikely and do not occur in the sample solver drivers in subdirectories of ampl/solvers.) Mon Sep 16 12:57:14 EDT 2002 Trivial change to a format in getstub.c (having no effect with ordinary use of the solver interface library, which uses fprintf = Fprintf supplied by the library); asldate.c not changed. Mon Sep 23 16:30:33 EDT 2002 conpval.c: fix bug in objgrd(np,x,g,nerror) when np > 1 and pfgh_read() is the .nl reader. The linear terms from the first objective, rather than objective np, were used. Wed Nov 13 16:45:28 EST 2002 Fix a bug with use of at_exit() or at_reset() in imported functions: the library was freed before the functions registered with at_exit or at_reset were called, sometimes leading to a fault. Tue Feb 4 23:05:51 EST 2003 makefile.u: add comments for cygwin and MinCW. makefile.vc: add comments for lcc. fpinit.c and fpinitmt.c: minor portability tweaks. sos_add.c: omit an unused static function. Sundry files: updated for CLP extensions (to be documented elsewhere). Recompile everything that depends on header files in the solvers directory. Thu Mar 20 22:50:38 EST 2003 value.c: fix a glitch in FI_val's handling of "?" values (which are supposed to request printing of the current value of the option in question): bogus values were reported. FI_val is for Fortran integer values; only a few solvers (such as filter and minlp) use it. Thu May 29 17:44:56 EDT 2003 conpval.c: fix a bug that could lead to a surprising error message of the form "objpgrd: got NOBJ = 12; expected 0 <= NOBJ < 1" if a Hessian computation was requested after a function evaluation at a point different from the one where the most recent gradient evaluation took place. Also with .nl reader pfgh_read(), fix a bug with objgrd(np,x,g,ne) with non-null ne (and *ne >= 0) and np != 0 (i.e., when treating an objective other than the first): wrong results may have been computed. Sat Oct 18 22:06:09 EDT 2003 conpval.c, pfg_read.c, pfghread.c: fix a bug in handling partially separable functions where an unset variable could cause unnecessary re-evaluations (or under just the right conditions, missed evaluations) of parts of the derivatives. Fri Dec 5 07:28:06 MST 2003 Tweaks to asl.h and sphes.c so when uptri (final arg to sphsetup) is 2, sphes computes the sparse lower triangle of the Hessian (stored column-wise). Thu Jan 22 00:58:11 MST 2004 jac0dim.c: make bswap visible as bswap_ASL (for use in a forthcoming addition to solvers/examples). writesol.c: similary make new write_solx_ASL visible (able to byte-swap while writing). comptry.bat: adjust to permit lots of stuff in CFLAGS (thanks to Erling Andersen for this suggestion). Sun Feb 8 23:07:16 MST 2004 sphes.c: fix a botch in sphes_setup's handling of problems with multiple objectives and arguments (nobj and y) indicating that just one of the objectives is to be used or that constraints are to be ignored in the Hessian: the sparsity pattern was overestimated (encompassing the undesired objectives and constraints). Wed Mar 24 00:42:30 MST 2004 sphes.c: omit declaration of unused variables hr1, hr2; asldate.c not changed. Sun Apr 11 23:39:41 MDT 2004 dtoa.c: update contact info. for dmg and correct page numbers in comment on Steele & White (1990); asldate.c not changed. Sat Aug 21 22:04:17 MDT 2004 makefile.u: minor tweak to permit "make ARFLAGS='-X64 ruv'" (after one has copied makefile.u to makefile and made other necessary changes). getstub.c: add Lic_info_ASL, a char* value that can be set to have show_version_ASL() print license information. pfg_read.c pfghread.c, pshvprod.c: fix bugs (e.g., faults on some problems) with hvcomp. Wed May 11 23:12:43 MDT 2005 sprintf.c: omit an unused variable. pfg_read.c, pfghread.c: use size_expr_n (for benefit of a possible forthcoming nlc extension). misc.c: fix a glitch that only matters with -DNO_STDIO1. Sat Jun 25 23:59:06 MDT 2005 funcadd.c: add a const qualifier to a local variable in function mean(). *read.c: when linear complementarity constraints are present, fold any nonzero right-hand side values into the bounds (LUrhs, Urhsx) on the constraint. Some solvers expect the constant term in linear constraints to be zero, which was always true except for linear complementarity constraints. New bit ASL_no_linear_cc_rhs_adjust in the flags argument to the .nl readers suppresses this adjustment.