├── xmlOF ├── testCondor │ ├── clean │ ├── simulator.out │ ├── condor │ ├── OF │ │ ├── testOF │ │ ├── testOFF │ │ └── makefile │ ├── matconvert │ ├── testQ2 │ ├── testQ4 │ ├── testRosen │ ├── testRosen3 │ ├── testFletcher │ ├── testScaledRosen │ ├── testSuperSimple │ ├── testQ4N │ ├── testQ4NF │ ├── optimScaledRosen.xml │ ├── optimQ2.xml │ ├── optimSuperSimple.xml │ └── optimFletcher.xml ├── testCondorwin32 │ ├── clean.bat │ ├── OF │ │ ├── OF.pdb │ │ ├── testOF.exe │ │ ├── testOFF.exe │ │ └── makefile │ ├── xmlCONDOR.exe │ ├── matConvert.exe │ ├── test_Q2.bat │ ├── test_Q4.bat │ ├── test_Rosen.bat │ ├── test_Rosen3.bat │ ├── test_Fletcher.bat │ ├── test_ScaledRosen.bat │ ├── test_SuperSimple.bat │ ├── test_Q4T.bat │ ├── test_Q4N.bat │ ├── test_Q4NF.bat │ ├── optimScaledRosen.xml │ ├── optimQ2.xml │ ├── optimSuperSimple.xml │ └── optimFletcher.xml └── dbtool │ └── DBToolMain.cpp ├── amplOF ├── opnos.hd ├── amplsolv.lib ├── amplsolver.a ├── arith.h ├── examples │ ├── ampl.exe │ ├── hs022.mod │ ├── hs026.mod │ ├── hs023.mod │ ├── hs034.mod │ ├── hs038.mod │ ├── hs065.mod │ ├── cliff.nl │ ├── hs044.mod │ ├── hs076.mod │ ├── rosenbr.nl │ ├── sisser.nl │ ├── hs034.nl │ ├── hs022.nl │ ├── hs026.nl │ ├── hairy.mod │ ├── pfit1ls.mod │ ├── hairy.nl │ ├── power.mod │ ├── dqdrtic.mod │ ├── rosenbr.mod │ ├── sisser.mod │ ├── hs065.nl │ ├── hs100.mod │ ├── brownal.mod │ ├── cliff.mod │ ├── vardim.mod │ ├── hs023.nl │ ├── hs076.nl │ ├── watson.mod │ ├── hs044.nl │ ├── brybnd.mod │ ├── brownden.mod │ ├── cragglvy.mod │ ├── gulf.mod │ ├── biggs6.mod │ ├── morebv.mod │ ├── hs108.mod │ ├── hs038.nl │ ├── mancino.mod │ ├── power.nl │ ├── hs106.nl │ ├── dixmaank.mod │ ├── hart6.mod │ ├── fminsurf.mod │ ├── pfit1ls.nl │ ├── hatflde.mod │ ├── growthls.mod │ ├── hs268.mod │ ├── hs106.mod │ ├── dqdrtic.nl │ ├── hs100.nl │ ├── cragglvy.nl │ ├── vardim.nl │ ├── hatflde.nl │ ├── hs116.mod │ ├── hs268.nl │ ├── brownal.nl │ ├── hart6.nl │ ├── heart6ls.mod │ └── morebv.nl ├── r_qp.hd ├── r_opn0.hd ├── r_opn.hd ├── AMPLof.h ├── r_op.hd ├── asl_pfg.h ├── asl_pfgh.h ├── dvalue.hd ├── opcode.hd ├── op_type.hd ├── errchk.h ├── jac2dim.h └── jacpdim.h ├── condor106.suo ├── MathEval ├── lib │ ├── error.o │ ├── node.o │ ├── xmath.o │ ├── libfl.lib │ ├── parser.o │ ├── scanner.o │ ├── xmalloc.o │ ├── matheval.o │ ├── symbol_table.o │ ├── error.lo │ ├── node.lo │ ├── xmath.lo │ ├── parser.lo │ ├── scanner.lo │ ├── xmalloc.lo │ ├── matheval.lo │ ├── symbol_table.lo │ ├── parser.h │ ├── libmatheval.la │ ├── error.h │ ├── common.h │ ├── Makefile.am │ ├── xmalloc.h │ ├── xmalloc.c │ └── error.c ├── MathEvalClass.h ├── test.cpp └── MathEvalClass.cpp ├── CONDOR_XML_Manual_1.0.pdf ├── sifOF └── examples │ ├── parkch.cpp │ ├── parkch.sif │ ├── stratec.cpp │ ├── stratec.sif │ ├── akiva.d │ ├── snail.d │ ├── rosenbrock.d │ ├── hairy.d │ ├── schmvett.d │ ├── cliff.d │ ├── sisser.d │ ├── helix.d │ ├── pfit1ls.d │ ├── stratec.d │ ├── cliff.sif │ ├── parkch.d │ ├── power.d │ ├── ROSENBROCK.SIF │ ├── dqdrtic.sif │ ├── sisser.sif │ ├── 3pk.cpp │ ├── dqdrtic.cpp │ ├── eigenals.d │ └── power.sif ├── matConvert └── matConvert.cpp ├── common ├── parallel.h ├── parallel.cpp ├── Solver.h ├── KeepBests.h ├── VectorChar.h ├── VectorInt.h ├── MatrixTriangle.h └── MultInd.h └── win32clean.bat /xmlOF/testCondor/clean: -------------------------------------------------------------------------------- 1 | rm *.dat 2 | rm *.txt 3 | rm *~ 4 | -------------------------------------------------------------------------------- /xmlOF/testCondor/simulator.out: -------------------------------------------------------------------------------- 1 | A 2 | 1 3 | 6.088781e-06 0 0 0 0 4 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/clean.bat: -------------------------------------------------------------------------------- 1 | del *.dat 2 | del *.txt 3 | 4 | -------------------------------------------------------------------------------- /amplOF/opnos.hd: -------------------------------------------------------------------------------- 1 | #define PLUS 0 2 | #define MINUS 1 3 | #define MULT 2 4 | #define UMINUS 16 5 | -------------------------------------------------------------------------------- /condor106.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/condor106.suo -------------------------------------------------------------------------------- /MathEval/lib/error.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/error.o -------------------------------------------------------------------------------- /MathEval/lib/node.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/node.o -------------------------------------------------------------------------------- /MathEval/lib/xmath.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/xmath.o -------------------------------------------------------------------------------- /amplOF/amplsolv.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/amplOF/amplsolv.lib -------------------------------------------------------------------------------- /amplOF/amplsolver.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/amplOF/amplsolver.a -------------------------------------------------------------------------------- /MathEval/lib/libfl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/libfl.lib -------------------------------------------------------------------------------- /MathEval/lib/parser.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/parser.o -------------------------------------------------------------------------------- /MathEval/lib/scanner.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/scanner.o -------------------------------------------------------------------------------- /MathEval/lib/xmalloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/xmalloc.o -------------------------------------------------------------------------------- /CONDOR_XML_Manual_1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/CONDOR_XML_Manual_1.0.pdf -------------------------------------------------------------------------------- /MathEval/lib/matheval.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/matheval.o -------------------------------------------------------------------------------- /amplOF/arith.h: -------------------------------------------------------------------------------- 1 | #define IEEE_8087 2 | #define Arith_Kind_ASL 1 3 | #define Double_Align 4 | #define NO_LONG_LONG 5 | -------------------------------------------------------------------------------- /amplOF/examples/ampl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/amplOF/examples/ampl.exe -------------------------------------------------------------------------------- /sifOF/examples/parkch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/sifOF/examples/parkch.cpp -------------------------------------------------------------------------------- /sifOF/examples/parkch.sif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/sifOF/examples/parkch.sif -------------------------------------------------------------------------------- /xmlOF/testCondor/condor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondor/condor -------------------------------------------------------------------------------- /MathEval/lib/symbol_table.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/MathEval/lib/symbol_table.o -------------------------------------------------------------------------------- /sifOF/examples/stratec.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/sifOF/examples/stratec.cpp -------------------------------------------------------------------------------- /sifOF/examples/stratec.sif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/sifOF/examples/stratec.sif -------------------------------------------------------------------------------- /xmlOF/testCondor/OF/testOF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondor/OF/testOF -------------------------------------------------------------------------------- /xmlOF/testCondor/OF/testOFF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondor/OF/testOFF -------------------------------------------------------------------------------- /xmlOF/testCondor/matconvert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondor/matconvert -------------------------------------------------------------------------------- /xmlOF/testCondor/testQ2: -------------------------------------------------------------------------------- 1 | condor optimQ2.xml 2 | matconvert traceQ2.dat 3 | emacs traceQ2.dat.txt & 4 | emacs resultsQ2.txt & 5 | -------------------------------------------------------------------------------- /xmlOF/testCondor/testQ4: -------------------------------------------------------------------------------- 1 | condor optimQ4.xml 2 | matconvert traceQ4.dat 3 | emacs traceQ4.dat.txt & 4 | emacs resultsQ4.txt & 5 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/OF/OF.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondorwin32/OF/OF.pdb -------------------------------------------------------------------------------- /xmlOF/testCondor/testRosen: -------------------------------------------------------------------------------- 1 | condor optimRosen.xml 2 | matconvert traceRosen.dat 3 | emacs traceRosen.dat.txt & 4 | emacs resultsRosen.txt & 5 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/OF/testOF.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondorwin32/OF/testOF.exe -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/xmlCONDOR.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondorwin32/xmlCONDOR.exe -------------------------------------------------------------------------------- /xmlOF/testCondor/testRosen3: -------------------------------------------------------------------------------- 1 | condor optimRosen3.xml 2 | matconvert traceRosen3.dat 3 | emacs traceRosen3.dat.txt & 4 | emacs resultsRosen3.txt & 5 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/OF/testOFF.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondorwin32/OF/testOFF.exe -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/matConvert.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohannesBuchner/condor_optimization/master/xmlOF/testCondorwin32/matConvert.exe -------------------------------------------------------------------------------- /xmlOF/testCondor/testFletcher: -------------------------------------------------------------------------------- 1 | condor optimFletcher.xml 2 | matconvert traceFletcher.dat 3 | emacs traceFletcher.dat.txt & 4 | emacs resultsFletcher.txt & 5 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Q2.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimQ2.xml 2 | pause 3 | matConvert traceQ2.dat 4 | start notepad traceQ2.dat.txt 5 | start notepad resultsQ2.txt 6 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Q4.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimQ4.xml 2 | pause 3 | matConvert traceQ4.dat 4 | start notepad traceQ4.dat.txt 5 | start notepad resultsQ4.txt 6 | -------------------------------------------------------------------------------- /xmlOF/testCondor/testScaledRosen: -------------------------------------------------------------------------------- 1 | condor optimScaledRosen.xml 2 | matconvert traceScaledRosen.dat 3 | emacs traceScaledRosen.dat.txt & 4 | emacs resultsScaledRosen.txt & 5 | -------------------------------------------------------------------------------- /xmlOF/testCondor/testSuperSimple: -------------------------------------------------------------------------------- 1 | condor optimSuperSimple.xml 2 | matconvert traceSuperSimple.dat 3 | emacs traceSuperSimple.dat.txt & 4 | emacs resultsSuperSimple.txt & 5 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Rosen.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimRosen.xml 2 | pause 3 | matConvert traceRosen.dat 4 | start notepad traceRosen.dat.txt 5 | start notepad resultsRosen.txt 6 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Rosen3.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimRosen3.xml 2 | pause 3 | matConvert traceRosen3.dat 4 | start notepad traceRosen3.dat.txt 5 | start notepad resultsRosen3.txt 6 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Fletcher.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimFletcher.xml 2 | pause 3 | matConvert traceFletcher.dat 4 | start notepad traceFletcher.dat.txt 5 | start notepad resultsFletcher.txt 6 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_ScaledRosen.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimScaledRosen.xml 2 | pause 3 | matConvert traceScaledRosen.dat 4 | start notepad traceScaledRosen.dat.txt 5 | start notepad resultsScaledRosen.txt 6 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_SuperSimple.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimSuperSimple.xml 2 | pause 3 | matConvert traceSuperSimple.dat 4 | start notepad traceSuperSimple.dat.txt 5 | start notepad resultsSuperSimple.txt 6 | -------------------------------------------------------------------------------- /amplOF/r_qp.hd: -------------------------------------------------------------------------------- 1 | #define OPPLUS 0 2 | #define OPMINUS 1 3 | #define OPMULT 2 4 | #define OPDIV 3 5 | #define OPUMINUS 16 6 | #define OPSUMLIST 54 7 | #define OP2POW 76 8 | #define OPNUM 79 9 | #define OPVARVAL 81 10 | -------------------------------------------------------------------------------- /xmlOF/testCondor/testQ4N: -------------------------------------------------------------------------------- 1 | condor optimQ4_with_noise.xml 2 | matconvert traceQ4N.dat 3 | matconvert dbEvalsQ4N.dat 4 | emacs dbEvalsQ4N.dat.txt & 5 | emacs traceQ4N.dat.txt & 6 | emacs resultsQ4N.txt & 7 | rm condor.out 8 | rm simulator.out 9 | -------------------------------------------------------------------------------- /xmlOF/testCondor/testQ4NF: -------------------------------------------------------------------------------- 1 | condor optimQ4_with_noise_and_failure.xml 2 | matconvert traceQ4NF.dat 3 | matconvert dbEvalsQ4NF.dat 4 | emacs dbEvalsQ4NF.dat.txt & 5 | emacs traceQ4NF.dat.txt & 6 | emacs resultsQ4NF.txt & 7 | rm condorF.out 8 | rm simulatorF.out 9 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Q4T.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimQ4T.xml 2 | pause 3 | matConvert traceQ4NF.dat 4 | matConvert dbEvalsQ4NF.dat 5 | start notepad dbevalsQ4NF.dat.txt 6 | start notepad traceQ4NF.dat.txt 7 | start notepad resultsQ4NF.txt 8 | del C:\condorF.out 9 | del C:\simulatorF.out 10 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Q4N.bat: -------------------------------------------------------------------------------- 1 | xmlCONDOR optimQ4_with_noise.xml 2 | pause 3 | matConvert traceQ4N.dat 4 | matConvert dbEvalsQ4N.dat 5 | start notepad dbevalsQ4N.dat.txt 6 | start notepad traceQ4N.dat.txt 7 | start notepad resultsQ4N.txt 8 | del C:\condor.out 9 | del C:\simulator.out 10 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/test_Q4NF.bat: -------------------------------------------------------------------------------- 1 | xmlxmlCONDOR optimQ4_with_noise_and_failure.xml 2 | pause 3 | matConvert traceQ4NF.dat 4 | matConvert dbEvalsQ4NF.dat 5 | start notepad dbevalsQ4NF.dat.txt 6 | start notepad traceQ4NF.dat.txt 7 | start notepad resultsQ4NF.txt 8 | del C:\condorF.out 9 | del C:\simulatorF.out 10 | -------------------------------------------------------------------------------- /MathEval/lib/error.lo: -------------------------------------------------------------------------------- 1 | # error.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/error.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='error.o' 12 | 13 | -------------------------------------------------------------------------------- /MathEval/lib/node.lo: -------------------------------------------------------------------------------- 1 | # node.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/node.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='node.o' 12 | 13 | -------------------------------------------------------------------------------- /MathEval/lib/xmath.lo: -------------------------------------------------------------------------------- 1 | # xmath.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/xmath.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='xmath.o' 12 | 13 | -------------------------------------------------------------------------------- /MathEval/lib/parser.lo: -------------------------------------------------------------------------------- 1 | # parser.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/parser.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='parser.o' 12 | 13 | -------------------------------------------------------------------------------- /xmlOF/testCondor/OF/makefile: -------------------------------------------------------------------------------- 1 | #makefile for the test Objective Functions. 2 | 3 | all: testOF testOFF 4 | 5 | OPTIONS= -g -Wall -static 6 | #OPTIONS= -O3 7 | 8 | testOF: testOF.cpp 9 | g++ $(OPTIONS) -o testOF testOF.cpp 10 | 11 | testOFF: testOF.cpp 12 | g++ $(OPTIONS) -o testOFF -DFAILURE testOF.cpp 13 | 14 | clean: 15 | rm testOF 16 | rm testOFF 17 | rm *~ 18 | -------------------------------------------------------------------------------- /MathEval/lib/scanner.lo: -------------------------------------------------------------------------------- 1 | # scanner.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/scanner.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='scanner.o' 12 | 13 | -------------------------------------------------------------------------------- /MathEval/lib/xmalloc.lo: -------------------------------------------------------------------------------- 1 | # xmalloc.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/xmalloc.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='xmalloc.o' 12 | 13 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/OF/makefile: -------------------------------------------------------------------------------- 1 | #makefile for the test Objective Functions. 2 | 3 | all: testOF testOFF 4 | 5 | OPTIONS= -g -Wall -static 6 | #OPTIONS= -O3 7 | 8 | testOF: testOF.cpp 9 | g++ $(OPTIONS) -o testOF testOF.cpp 10 | 11 | testOFF: testOF.cpp 12 | g++ $(OPTIONS) -o testOFF -DFAILURE testOF.cpp 13 | 14 | clean: 15 | rm testOF 16 | rm testOFF 17 | rm *~ 18 | -------------------------------------------------------------------------------- /MathEval/lib/matheval.lo: -------------------------------------------------------------------------------- 1 | # matheval.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/matheval.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='matheval.o' 12 | 13 | -------------------------------------------------------------------------------- /MathEval/lib/symbol_table.lo: -------------------------------------------------------------------------------- 1 | # symbol_table.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/symbol_table.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object='symbol_table.o' 12 | 13 | -------------------------------------------------------------------------------- /amplOF/r_opn0.hd: -------------------------------------------------------------------------------- 1 | #define f_OPPLUS 0 2 | #define f_OPMINUS 1 3 | #define f_OPMULT 2 4 | #define f_OPDIV 3 5 | #define f_OPPOW 5 6 | #define f_OPUMINUS 16 7 | #define f_OPSUMLIST 54 8 | #define f_OPPLTERM 64 9 | #define f_OPIFSYM 65 10 | #define f_OP1POW 75 11 | #define f_OP2POW 76 12 | #define f_OPCPOW 77 13 | #define f_OPFUNCALL 78 14 | #define f_OPNUM 79 15 | #define f_OPHOL 80 16 | #define f_OPVARVAL 81 17 | #define N_OPS 82 18 | -------------------------------------------------------------------------------- /amplOF/examples/hs022.mod: -------------------------------------------------------------------------------- 1 | var x {1..2}; 2 | 3 | minimize obj: 4 | (x[1] - 2)^2 + (x[2] - 1)^2 5 | ; 6 | 7 | subject to constr1: -x[1]^2 + x[2] >= 0; 8 | subject to constr2: x[1] + x[2] <= 2; 9 | 10 | let x[1] := 2; 11 | let x[2] := 2; 12 | 13 | #printf "optimal solution as starting point \n"; 14 | #let x[1] := 1; 15 | #let x[2] := 1; 16 | 17 | #solve; 18 | #display x; 19 | #display obj; 20 | #display obj - 1; 21 | 22 | write ghs022; 23 | -------------------------------------------------------------------------------- /MathEval/lib/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef BISON_PARSER_H 2 | # define BISON_PARSER_H 3 | 4 | #ifndef YYSTYPE 5 | typedef union { 6 | Node *node; 7 | Record *record; 8 | } yystype; 9 | # define YYSTYPE yystype 10 | # define YYSTYPE_IS_TRIVIAL 1 11 | #endif 12 | # define NUMBER 257 13 | # define VARIABLE 258 14 | # define FUNCTION 259 15 | # define NEG 260 16 | # define END 261 17 | 18 | 19 | extern YYSTYPE yylval; 20 | 21 | #endif /* not BISON_PARSER_H */ 22 | -------------------------------------------------------------------------------- /amplOF/examples/hs026.mod: -------------------------------------------------------------------------------- 1 | var x {1..3}; 2 | 3 | minimize obj: 4 | (x[1] - x[2])^2 + (x[2] - x[3])^4 5 | ; 6 | 7 | subject to constr1: (1 + x[2]^2)*x[1] + x[3]^4 >= 3; 8 | 9 | let x[1] := -2.6; 10 | let x[2] := 2; 11 | let x[3] := 2; 12 | 13 | #printf "optimal solution as starting point \n"; 14 | #let x[1] := 1; 15 | #let x[2] := 1; 16 | #let x[3] := 1; 17 | 18 | #display obj; 19 | #solve; 20 | #display x; 21 | #display obj; 22 | #display obj - 0; 23 | 24 | write ghs026; 25 | -------------------------------------------------------------------------------- /amplOF/r_opn.hd: -------------------------------------------------------------------------------- 1 | #undef f_OPNUM 2 | #define f_OPMULT r_ops[2] 3 | #define f_OPPOW r_ops[5] 4 | #define f_MINLIST r_ops[11] 5 | #define f_MAXLIST r_ops[12] 6 | #define f_ABS r_ops[15] 7 | #define f_OPPLTERM r_ops[64] 8 | #define f_OPIFSYM r_ops[65] 9 | #define f_OP1POW r_ops[75] 10 | #define f_OP2POW r_ops[76] 11 | #define f_OPCPOW r_ops[77] 12 | #define f_OPFUNCALL r_ops[78] 13 | #define f_OPNUM r_ops[79] 14 | #define f_OPHOL r_ops[80] 15 | #define f_OPVARVAL r_ops[81] 16 | #define N_OPS 82 17 | -------------------------------------------------------------------------------- /matConvert/matConvert.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../common/Matrix.h" 4 | 5 | int main(int argc, char **argv) 6 | { 7 | char buffer[300]; 8 | if (argc<2) 9 | { 10 | printf("You must give a matrix file data to convert as parameter.\n"); 11 | return 1; 12 | } 13 | printf("converting %s.\n",argv[1]); 14 | Matrix m(argv[1],0); 15 | printf("Loaded %i lines and %i columns\n",m.nLine(),m.nColumn()); 16 | strcpy(buffer,argv[1]); 17 | strcat(buffer,".txt"); 18 | m.save(buffer,1); 19 | } 20 | -------------------------------------------------------------------------------- /amplOF/examples/hs023.mod: -------------------------------------------------------------------------------- 1 | var x {1..2} <= 50, >= -50; 2 | 3 | minimize obj: 4 | x[1]^2 + x[2]^2 5 | ; 6 | 7 | subject to constr1: x[1] + x[2] >= 1; 8 | subject to constr2: x[1]^2 + x[2]^2 >= 1; 9 | subject to constr3: 9*x[1]^2 + x[2]^2 >= 9; 10 | subject to constr4: x[1]^2 - x[2] >= 0; 11 | subject to constr5: x[2]^2 - x[1] >= 0; 12 | 13 | let x[1] := 3; 14 | let x[2] := 1; 15 | 16 | #printf "optimal solution as starting point \n"; 17 | #let x[1] := 1; 18 | #let x[2] := 1; 19 | 20 | #solve; 21 | #display x; 22 | #display obj; 23 | #display obj - 2; 24 | 25 | write ghs023; 26 | -------------------------------------------------------------------------------- /amplOF/examples/hs034.mod: -------------------------------------------------------------------------------- 1 | var x {1..3} >= 0; 2 | 3 | minimize obj: 4 | -x[1] 5 | ; 6 | 7 | subject to constr1: x[2] >= exp(x[1]); 8 | subject to constr2: x[3] >= exp(x[2]); 9 | subject to constr3: x[1] <= 100; 10 | subject to constr4: x[2] <= 100; 11 | subject to constr5: x[3] <= 10; 12 | 13 | let x[1] := 0; 14 | let x[2] := 1.05; 15 | let x[3] := 2.9; 16 | 17 | #printf "optimal solution as starting point \n"; 18 | #let x[1] := 0.83403; 19 | #let x[2] := 2.30258; 20 | #let x[3] := 10; 21 | 22 | #display obj; 23 | #solve; 24 | #display x; 25 | #display obj; 26 | #display obj + log(log(10)); 27 | 28 | write ghs034; 29 | -------------------------------------------------------------------------------- /amplOF/examples/hs038.mod: -------------------------------------------------------------------------------- 1 | var x {1..4} >= -10, <= 10; 2 | 3 | minimize obj: 4 | 100*(x[2]-x[1]^2)^2 + (1-x[1])^2 + 90*(x[4]-x[3]^2)^2 + (1-x[3])^2 5 | + 10.1*( (x[2]-1)^2 + (x[4]-1)^2 ) + 19.8*(x[2]-1)*(x[4]-1) 6 | ; 7 | 8 | subject to constr1: x[1] + 2*x[2] + 2*x[3] <= 72; 9 | subject to constr2: x[1] + 2*x[2] + 2*x[3] >= 0; 10 | 11 | let x[1] := -3; 12 | let x[2] := -1; 13 | let x[3] := -3; 14 | let x[4] := -1; 15 | 16 | #printf "optimal solution as starting point \n"; 17 | #let x[1] := 1; 18 | #let x[2] := 1; 19 | #let x[3] := 1; 20 | #let x[4] := 1; 21 | 22 | #display obj; 23 | #solve; 24 | #display x; 25 | #display obj; 26 | #display obj - 0; 27 | 28 | write ghs038; 29 | -------------------------------------------------------------------------------- /MathEval/MathEvalClass.h: -------------------------------------------------------------------------------- 1 | #ifndef AMPL_OBJECT_INCLUDE 2 | #define AMPL_OBJECT_INCLUDE 3 | 4 | #include "../common/Vector.h" 5 | 6 | class MathEvalClass 7 | { 8 | public: 9 | MathEvalClass::MathEvalClass(char *filename, char **dbcolnames, int _dim, char isGradientNeeded); 10 | ~MathEvalClass(); 11 | double eval(Vector v, int *ner); 12 | double eval(double *d, int *ner); 13 | void evalGrad(Vector sv, Vector result, int *ner); 14 | void evalGrad(double *v, double *res, int *ner); 15 | int maxIndexVarUsed() { return maxIndexVar; } 16 | 17 | private: 18 | char **varnames; 19 | int dim, maxIndexVar; 20 | void *aggrFunct; 21 | void **gradFunct; 22 | }; 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /amplOF/examples/hs065.mod: -------------------------------------------------------------------------------- 1 | var x {1..3}; 2 | 3 | minimize obj: 4 | (x[1] - x[2])^2 + (x[1] + x[2] - 10)^2/9 + (x[3] - 5)^2 5 | ; 6 | 7 | subject to constr1: x[1]^2 + x[2]^2 + x[3]^2 <= 48; 8 | subject to constr2: -4.5 <= x[1] <= 4.5; 9 | subject to constr3: -4.5 <= x[2] <= 4.5; 10 | subject to constr4: -5 <= x[3] <= 5; 11 | 12 | let x[1] := -5; 13 | let x[2] := 5; 14 | let x[3] := 0; 15 | 16 | #printf "optimal solution as starting point \n"; 17 | #let x[1] := 3.650461821; 18 | #let x[2] := 3.65046168; 19 | #let x[3] := 4.6204170507; 20 | 21 | #display obj; 22 | #display constr1.body, constr2.body, constr3.body; 23 | #solve; 24 | #display x; 25 | #display obj; 26 | #display obj - 0.9535288567; 27 | 28 | write ghs065; 29 | -------------------------------------------------------------------------------- /amplOF/examples/cliff.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem cliff 2 | 2 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 2 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 2 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o0 13 | o5 14 | o0 15 | n-0.03 16 | o2 17 | n0.01 18 | v0 19 | n2 20 | o44 21 | o2 22 | n20 23 | o1 24 | v0 25 | v1 26 | x2 27 | 0 0 28 | 1 -1 29 | b 30 | 3 31 | 3 32 | k1 33 | 0 34 | G0 2 35 | 0 -1 36 | 1 1 37 | -------------------------------------------------------------------------------- /amplOF/examples/hs044.mod: -------------------------------------------------------------------------------- 1 | var x {1..4} >= 0; 2 | 3 | minimize obj: 4 | x[1] - x[2] - x[3] - x[1]*x[3] + x[1]*x[4] + x[2]*x[3] - x[2]*x[4] 5 | ; 6 | 7 | subject to constr1: x[1] + 2*x[2] <= 8; 8 | subject to constr2: 4*x[1] + x[2] <= 12; 9 | subject to constr3: 3*x[1] + 4*x[2] <= 12; 10 | subject to constr4: 2*x[3] + x[4] <= 8; 11 | subject to constr5: x[3] + 2*x[4] <= 8; 12 | subject to constr6: x[3] + x[4] <= 5; 13 | 14 | let x[1] := 0; 15 | let x[2] := 0; 16 | let x[3] := 0; 17 | let x[4] := 0; 18 | 19 | #printf "optimal solution as starting point \n"; 20 | #let x[1] := 0; 21 | #let x[2] := 3; 22 | #let x[3] := 0; 23 | #let x[4] := 4; 24 | 25 | #display obj; 26 | #solve; 27 | #display x; 28 | #display obj; 29 | #display obj + 15; 30 | 31 | write ghs044; 32 | -------------------------------------------------------------------------------- /amplOF/examples/hs076.mod: -------------------------------------------------------------------------------- 1 | var x {j in 1..4} >= 0; 2 | 3 | minimize obj: 4 | x[1]^2 + 0.5*x[2]^2 + x[3]^2 + 0.5*x[4]^2 - x[1]*x[3] + x[3]*x[4] 5 | - x[1] - 3*x[2] + x[3] - x[4] 6 | ; 7 | 8 | subject to constr1: x[1] + 2*x[2] + x[3] + x[4] <= 5; 9 | subject to constr2: 3*x[1] + x[2] + 2*x[3] - x[4] <= 4; 10 | subject to constr3: x[2] + 4*x[3] >= 1.5; 11 | 12 | data; 13 | 14 | let x[1] := 0.5; 15 | let x[2] := 0.5; 16 | let x[3] := 0.5; 17 | let x[4] := 0.5; 18 | 19 | #printf "optimal solution as starting point \n"; 20 | #let x[1] := 0.2727273; 21 | #let x[2] := 2.090909; 22 | #let x[3] := -0.26e-10; 23 | #let x[4] := 0.5454545; 24 | 25 | data; 26 | 27 | #solve; 28 | #display x; 29 | #display obj; 30 | #display obj + 4.681818181; 31 | 32 | write ghs076; 33 | -------------------------------------------------------------------------------- /amplOF/examples/rosenbr.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem rosenbr2 2 | 2 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 2 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 2 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o0 13 | o2 14 | n100 15 | o5 16 | o1 17 | v1 18 | o5 19 | v0 20 | n2 21 | n2 22 | o5 23 | o0 24 | n-1 25 | v0 26 | n2 27 | x2 28 | 0 -1.2 29 | 1 1 30 | b 31 | 3 32 | 3 33 | k1 34 | 0 35 | G0 2 36 | 0 0 37 | 1 0 38 | -------------------------------------------------------------------------------- /amplOF/examples/sisser.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem sisser 2 | 2 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 2 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 2 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 3 14 | o2 15 | n3 16 | o5 17 | v0 18 | n4 19 | o2 20 | n-2 21 | o5 22 | o2 23 | v0 24 | v1 25 | n2 26 | o2 27 | n3 28 | o5 29 | v1 30 | n4 31 | x2 32 | 0 1 33 | 1 0.1 34 | b 35 | 3 36 | 3 37 | k1 38 | 0 39 | G0 2 40 | 0 0 41 | 1 0 42 | -------------------------------------------------------------------------------- /amplOF/examples/hs034.nl: -------------------------------------------------------------------------------- 1 | g3 1 1 0 # problem hs034 2 | 3 2 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 2 0 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 2 0 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 4 1 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | o16 13 | o44 14 | v0 15 | C1 16 | o16 17 | o44 18 | v1 19 | O0 0 20 | n0 21 | x3 22 | 0 0 23 | 1 1.05 24 | 2 2.9 25 | r 26 | 2 0 27 | 2 0 28 | b 29 | 0 0 100 30 | 0 0 100 31 | 0 0 10 32 | k2 33 | 1 34 | 3 35 | J0 2 36 | 0 0 37 | 1 1 38 | J1 2 39 | 1 0 40 | 2 1 41 | G0 1 42 | 0 -1 43 | -------------------------------------------------------------------------------- /sifOF/examples/akiva.d: -------------------------------------------------------------------------------- 1 | 2 1 1 1 2 0 0 0 1 0 2 | 3AKIVA 0 3 | 1 2 4 | 1 1 5 | 1 1 6 | 1 3 7 | 1 1 8 | 0 9 | 1 10 | 1 11 | 2 12 | 1 13 | 1 2 14 | 15 | 16 | 0.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 18 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 19 | 0.00000000E+00 0.00000000E+00 20 | 0.00000000E+00 21 | 22 | 23 | -1.00000000E+00 24 | 1.00000000E+00 25 | 1.00000000E+00 1.00000000E+00 26 | -1.00000000E+20 1.00000000E+20 27 | F 28 | T 29 | LIKE 30 | BET1 BET2 31 | LIKE 32 | 33 | 0 0 34 | AKIVA 2 0 0 0 0 0 0 1 0 0 0 0 35 | -------------------------------------------------------------------------------- /amplOF/examples/hs022.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem hs022 2 | 2 2 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 1 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 1 2 1 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 4 2 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | o16 13 | o5 14 | v0 15 | n2 16 | C1 17 | n0 18 | O0 0 19 | o0 20 | o5 21 | o0 22 | n-2 23 | v0 24 | n2 25 | o5 26 | o0 27 | n-1 28 | v1 29 | n2 30 | x2 31 | 0 2 32 | 1 2 33 | r 34 | 2 0 35 | 1 2 36 | b 37 | 3 38 | 3 39 | k1 40 | 2 41 | J0 2 42 | 0 0 43 | 1 1 44 | J1 2 45 | 0 1 46 | 1 1 47 | G0 2 48 | 0 0 49 | 1 0 50 | -------------------------------------------------------------------------------- /sifOF/examples/snail.d: -------------------------------------------------------------------------------- 1 | 2 1 1 1 2 0 0 2 1 0 2 | 3SNAIL 0 3 | 1 2 4 | 1 1 5 | 1 1 6 | 1 3 7 | 1 3 8 | 0 9 | 1 10 | 1 11 | 2 12 | 1 13 | 1 2 14 | 15 | 16 | 0.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 18 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 19 | 1.00000000E+01 1.00000000E+01 20 | 0.00000000E+00 21 | 22 | 1.00000000E+00 2.00000000E+00 23 | 1.00000000E+00 24 | 1.00000000E+00 25 | 1.00000000E+00 1.00000000E+00 26 | -1.00000000E+20 1.00000000E+20 27 | F 28 | T 29 | OBJ 30 | X1 X2 31 | SPIRAL 32 | 33 | 0 0 34 | SNAIL 2 0 0 0 0 0 0 1 0 0 0 0 35 | -------------------------------------------------------------------------------- /amplOF/examples/hs026.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem hs026 2 | 3 1 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 1 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 3 3 3 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 3 3 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | o0 13 | o2 14 | o0 15 | n1 16 | o5 17 | v1 18 | n2 19 | v0 20 | o5 21 | v2 22 | n4 23 | O0 0 24 | o0 25 | o5 26 | o1 27 | v0 28 | v1 29 | n2 30 | o5 31 | o1 32 | v1 33 | v2 34 | n4 35 | x3 36 | 0 -2.6 37 | 1 2 38 | 2 2 39 | r 40 | 2 3 41 | b 42 | 3 43 | 3 44 | 3 45 | k2 46 | 1 47 | 2 48 | J0 3 49 | 0 0 50 | 1 0 51 | 2 0 52 | G0 3 53 | 0 0 54 | 1 0 55 | 2 0 56 | -------------------------------------------------------------------------------- /amplOF/examples/hairy.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: 13 | # Ph. Toint, private communication, 14 | 15 | # SIF input: Ph. Toint, Dec 1989. 16 | 17 | # classification OUR2-AY-2-0 18 | 19 | param hlength:=30; 20 | param cslope:=100; 21 | 22 | var x1 := -5; 23 | var x2 := -7; 24 | 25 | minimize f: 26 | sin(7*x1)^2*cos(7*x2)^2*hlength + 27 | cslope*sqrt(0.01+(x1-x2)^2) + cslope*sqrt(0.01+x1^2) 28 | ; 29 | 30 | #solve; 31 | #display f; 32 | #display x1, x2; 33 | write ghairy; 34 | -------------------------------------------------------------------------------- /amplOF/examples/pfit1ls.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # classification SUR2-AN-3-0 13 | 14 | param cf := -8.0; 15 | param cg := -18-(2/3); 16 | param ch := -23-(1/9); 17 | 18 | var a:=1.0; 19 | var r:=0.0; 20 | var h:=1.0; 21 | 22 | minimize f: 23 | (-0.5*(a*(a+1)*r*h^2)+a*r*h-r*(1-(1+h)^-a)-cf)^2 + 24 | (-a*(a+1)*r*h^2+a*r*h*(1-(1+h)^-(a+1))-cg)^2 + 25 | (-a*(a+1)*r*h^2*(1-(1+h)^-(a+2))-ch)^2; 26 | 27 | #display f; 28 | #solve; 29 | #display f; 30 | #display a, r, h; 31 | write gpfit1ls; 32 | -------------------------------------------------------------------------------- /amplOF/examples/hairy.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem hairy 2 | 2 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 2 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 2 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 3 14 | o2 15 | n30 16 | o2 17 | o5 18 | o41 19 | o2 20 | n7 21 | v0 22 | n2 23 | o5 24 | o46 25 | o2 26 | n7 27 | v1 28 | n2 29 | o2 30 | n100 31 | o39 32 | o0 33 | n0.01 34 | o5 35 | o1 36 | v0 37 | v1 38 | n2 39 | o2 40 | n100 41 | o39 42 | o0 43 | n0.01 44 | o5 45 | v0 46 | n2 47 | x2 48 | 0 -5 49 | 1 -7 50 | b 51 | 3 52 | 3 53 | k1 54 | 0 55 | G0 2 56 | 0 0 57 | 1 0 58 | -------------------------------------------------------------------------------- /amplOF/examples/power.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: 13 | # S.S. Oren, 14 | # Self-scaling variable metric algorithms, 15 | # Part II: implementation and experiments" 16 | # Management Science 20(5):863-874, 1974. 17 | 18 | # See also Buckley#179 (p. 83) 19 | 20 | # SIF input: Ph. Toint, Dec 1989. 21 | 22 | # classification OUR2-AN-V-0 23 | 24 | param N:=10; 25 | var x{1..N} := 1.0; 26 | 27 | minimize f: 28 | sum {i in 1..N} (i*x[i])^2; 29 | 30 | #solve; display f; display x; 31 | write gpower; 32 | -------------------------------------------------------------------------------- /amplOF/examples/dqdrtic.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 22 in 13 | # Ph. L. Toint, 14 | # "Test problems for partially separable optimization and results 15 | # for the routine PSPMIN", 16 | # Report 83/4, Department of Mathematics, FUNDP (Namur, B), 1983. 17 | 18 | # SIF input: Ph. Toint, Dec 1989. 19 | 20 | # classification QUR2-AN-V-0 21 | 22 | param N:=10; 23 | var x{1..N} := 3.0; 24 | 25 | minimize f: 26 | sum {i in 1..N-2} (100*x[i+1]^2+100*x[i+2]^2+x[i]^2); 27 | 28 | #solve; display f; display x; 29 | write gdqdrtic; 30 | -------------------------------------------------------------------------------- /MathEval/lib/libmatheval.la: -------------------------------------------------------------------------------- 1 | # libmatheval.la - a libtool library file 2 | # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.94 2004/04/10 16:27:27) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libmatheval.so.1' 9 | 10 | # Names of this library. 11 | library_names='libmatheval.so.1.0.0 libmatheval.so.1 libmatheval.so' 12 | 13 | # The name of the static archive. 14 | old_library='libmatheval.a' 15 | 16 | # Libraries that this one depends upon. 17 | dependency_libs=' -lfl -lm' 18 | 19 | # Version information for libmatheval. 20 | current=1 21 | age=0 22 | revision=0 23 | 24 | # Is this an already installed library? 25 | installed=no 26 | 27 | # Should we warn about portability when linking against -modules? 28 | shouldnotlink=no 29 | 30 | # Files to dlopen/dlpreopen 31 | dlopen='' 32 | dlpreopen='' 33 | 34 | # Directory that this library needs to be installed in: 35 | libdir='/usr/local/lib' 36 | -------------------------------------------------------------------------------- /amplOF/examples/rosenbr.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 1 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # SIF input: Ph. Toint, Dec 1989, Corrected July 1993. 18 | 19 | # classification SUR2-AN-2-0 20 | 21 | param xinit{1..2}; 22 | var x{i in 1..2} := xinit[i]; 23 | 24 | minimize f: 25 | (x[2]-x[1]^2)^2/0.01+(x[1]-1)^2; 26 | 27 | data; 28 | param xinit:= 1 -1.2 2 1.0; 29 | 30 | write grosenbr; 31 | -------------------------------------------------------------------------------- /sifOF/examples/rosenbrock.d: -------------------------------------------------------------------------------- 1 | 2 2 1 1 1 2 0 0 1 1 2 | 3ROSENBR 0 3 | 1 2 2 4 | 1 1 1 5 | 1 2 3 6 | 1 2 7 | 1 1 8 | 1 1 9 | 1 1 10 | 1 11 | 1 12 | 1 13 | 1 14 | 2 1 15 | 1.00000000E+00 1.00000000E+00 16 | 0.00000000E+00 1.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 0.00000000E+00 18 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 0.00000000E+00 19 | -1.20000000E+00 1.00000000E+00 20 | 0.00000000E+00 0.00000000E+00 21 | 22 | 23 | -1.00000000E+00 24 | 1.00000000E+02 1.00000000E+00 25 | 1.00000000E+00 1.00000000E+00 26 | 0.00000000E+00 1.61792382+308 27 | F 28 | FF 29 | G1 G2 30 | X1 X2 31 | SQ 32 | L2 33 | 0 0 34 | ROSENBR 2 0 0 0 0 0 1 1 0 0 0 0 35 | -------------------------------------------------------------------------------- /amplOF/examples/sisser.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: 13 | # F.S. Sisser, 14 | # "Elimination of bounds in optimization problems by transforming 15 | # variables", 16 | # Mathematical Programming 20:110-121, 1981. 17 | 18 | # See also Buckley#216 (p. 91) 19 | 20 | # SIF input: Ph. Toint, Dec 1989. 21 | 22 | # classification OUR2-AN-2-0 23 | 24 | param xinit{1..2}; 25 | var x{i in 1..2} := xinit[i]; 26 | 27 | minimize f: 28 | 3*x[1]^4 - 2*(x[1]*x[2])^2 + 3*x[2]^4; 29 | 30 | data; 31 | param xinit := 1 1.0 2 0.1; 32 | 33 | #solve; display f; display x; 34 | write gsisser; 35 | -------------------------------------------------------------------------------- /sifOF/examples/hairy.d: -------------------------------------------------------------------------------- 1 | 2 1 3 3 5 0 0 3 3 0 2 | 3HAIRY 0 3 | 1 4 4 | 1 1 5 | 1 1 6 | 1 3 5 6 7 | 1 2 3 4 8 | 0 9 | 1 10 | 1 2 3 11 | 2 1 1 12 | 1 2 3 13 | 1 2 1 2 1 14 | 15 | 16 | 0.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 18 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 19 | -5.00000000E+00 -7.00000000E+00 20 | 0.00000000E+00 21 | 22 | 7.00000000E+00 1.00000000E-02 1.00000000E-02 23 | 3.00000000E+01 1.00000000E+02 1.00000000E+02 24 | 1.00000000E+00 25 | 1.00000000E+00 1.00000000E+00 26 | -1.00000000E+20 1.00000000E+20 27 | FTF 28 | T 29 | FURCUP 30 | X1 X2 31 | FUR DCUP 1CUP 32 | 33 | 0 0 34 | HAIRY 2 0 0 0 0 0 0 1 0 0 0 0 35 | -------------------------------------------------------------------------------- /amplOF/examples/hs065.nl: -------------------------------------------------------------------------------- 1 | g3 1 1 0 # problem hs065 2 | 3 1 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 1 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 3 3 3 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 3 3 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | o54 13 | 3 14 | o5 15 | v0 16 | n2 17 | o5 18 | v1 19 | n2 20 | o5 21 | v2 22 | n2 23 | O0 0 24 | o54 25 | 3 26 | o5 27 | o1 28 | v0 29 | v1 30 | n2 31 | o2 32 | n0.1111111111111111 33 | o5 34 | o0 35 | n-10 36 | o0 37 | v0 38 | v1 39 | n2 40 | o5 41 | o0 42 | n-5 43 | v2 44 | n2 45 | x3 46 | 0 -5 47 | 1 5 48 | 2 0 49 | r 50 | 1 48 51 | b 52 | 0 -4.5 4.5 53 | 0 -4.5 4.5 54 | 0 -5 5 55 | k2 56 | 1 57 | 2 58 | J0 3 59 | 0 0 60 | 1 0 61 | 2 0 62 | G0 3 63 | 0 0 64 | 1 0 65 | 2 0 66 | -------------------------------------------------------------------------------- /amplOF/examples/hs100.mod: -------------------------------------------------------------------------------- 1 | var x {1..7}; 2 | 3 | minimize obj: 4 | (x[1]-10)^2 + 5*(x[2]-12)^2 + x[3]^4 + 3*(x[4]-11)^2 + 10*x[5]^6 5 | + 7*x[6]^2 + x[7]^4 - 4*x[6]*x[7] - 10*x[6] - 8*x[7] 6 | ; 7 | 8 | subject to constr1: 2*x[1]^2 + 3*x[2]^4 + x[3] + 4*x[4]^2 + 5*x[5] <= 127; 9 | subject to constr2: 7*x[1] + 3*x[2] + 10*x[3]^2 + x[4] - x[5] <= 282; 10 | subject to constr3: 23*x[1] + x[2]^2 + 6*x[6]^2 - 8*x[7] <= 196; 11 | subject to constr4: -4*x[1]^2 - x[2]^2 + 3*x[1]*x[2] -2*x[3]^2 - 5*x[6] 12 | +11*x[7] >= 0; 13 | 14 | data; 15 | 16 | let x[1] := 1; 17 | let x[2] := 2; 18 | let x[3] := 0; 19 | let x[4] := 4; 20 | let x[5] := 0; 21 | let x[6] := 1; 22 | let x[7] := 1; 23 | 24 | #printf "optimal solution as starting point \n"; 25 | #let x[1] := 2.330499; 26 | #let x[2] := 1.951372; 27 | #let x[3] := -0.4775414; 28 | #let x[4] := 4.365726; 29 | #let x[5] := 1.038131; 30 | #let x[6] := -0.6244870; 31 | #let x[7] := 1.594227; 32 | 33 | #solve; 34 | #display x; 35 | #display obj; 36 | #display obj - 680.6300573; 37 | 38 | write ghs100; 39 | -------------------------------------------------------------------------------- /amplOF/examples/brownal.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: Problem 27 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # See also Buckley#79 18 | # SIF input: Ph. Toint, Dec 1989. 19 | 20 | # classification SUR2-AN-V-0 21 | 22 | param N := 10; 23 | 24 | var x{1..N} := 1/2; 25 | 26 | minimize f: 27 | sum {i in 1..N-1} (x[i]+sum {j in 1..N} x[j] - (N+1) )^2 + (prod {j in 1..N} x[j] - 1)^2; 28 | 29 | #solve; 30 | #display f; 31 | #display x; 32 | 33 | write gbrownal; 34 | -------------------------------------------------------------------------------- /amplOF/examples/cliff.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 206 (p. 46) in 13 | # A.R. Buckley, 14 | # "Test functions for unconstrained minimization", 15 | # TR 1989CS-3, Mathematics, statistics and computing centre, 16 | # Dalhousie University, Halifax (CDN), 1989. 17 | 18 | # SIF input: Ph. Toint, Dec 1989. 19 | 20 | # classification OUR2-AN-2-0 21 | 22 | param xinit{1..2}; 23 | var x{i in 1..2}:=xinit[i]; 24 | 25 | minimize f: 26 | (0.01*x[1]-0.03)^2 -x[1]+x[2]+exp(20*(x[1]-x[2])); 27 | 28 | data; 29 | param xinit:= 1 0.0 2 -1.0; 30 | 31 | #solve; 32 | #display f; 33 | #display x; 34 | 35 | write gcliff; 36 | -------------------------------------------------------------------------------- /amplOF/examples/vardim.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 25 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # See also Buckley#72 (p.98). 18 | 19 | # SIF input: Ph. Toint, Dec 1989. 20 | 21 | # classification OUR2-AN-V-0 22 | 23 | param N := 10; 24 | var x{i in 1..N} := 1-i/N; 25 | 26 | minimize f: 27 | sum {i in 1..N} (x[i]-1)^2 + (sum {i in 1..N} i*x[i] - N*(N+1)/2)^2 + (sum {i in 1..N} i*x[i] - N*(N+1)/2)^4; 28 | 29 | #solve; display f; display x; 30 | write gvardim; 31 | -------------------------------------------------------------------------------- /sifOF/examples/schmvett.d: -------------------------------------------------------------------------------- 1 | 3 1 3 3 7 0 0 0 3 0 2 | 3SCHMVETT 0 3 | 1 4 4 | 1 1 5 | 1 1 6 | 1 3 5 8 7 | 1 1 1 1 8 | 0 9 | 1 10 | 1 2 3 11 | 1 1 2 12 | 1 2 3 13 | 1 2 2 3 1 2 3 14 | 15 | 16 | 0.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 0.00000000E+00 18 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 0.00000000E+00 19 | 5.00000000E-01 5.00000000E-01 5.00000000E-01 20 | 0.00000000E+00 21 | 22 | 23 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 24 | 1.00000000E+00 25 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 26 | -1.00000000E+20 1.00000000E+20 27 | TTT 28 | T 29 | G1 30 | X1 X2 X3 31 | SCH1 SCH2 SCH3 32 | 33 | 0 0 0 34 | SCHMVETT 3 0 0 0 0 0 0 1 0 0 0 0 35 | -------------------------------------------------------------------------------- /amplOF/examples/hs023.nl: -------------------------------------------------------------------------------- 1 | g3 2 1 0 # problem hs023 2 | 2 5 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 4 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 2 2 2 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 10 2 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | o0 13 | o5 14 | v0 15 | n2 16 | o5 17 | v1 18 | n2 19 | C1 20 | o0 21 | o2 22 | n9 23 | o5 24 | v0 25 | n2 26 | o5 27 | v1 28 | n2 29 | C2 30 | o5 31 | v0 32 | n2 33 | C3 34 | o5 35 | v1 36 | n2 37 | C4 38 | n0 39 | O0 0 40 | o0 41 | o5 42 | v0 43 | n2 44 | o5 45 | v1 46 | n2 47 | x2 48 | 0 3 49 | 1 1 50 | r 51 | 2 1 52 | 2 9 53 | 2 0 54 | 2 0 55 | 2 1 56 | b 57 | 0 -50 50 58 | 0 -50 50 59 | k1 60 | 5 61 | J0 2 62 | 0 0 63 | 1 0 64 | J1 2 65 | 0 0 66 | 1 0 67 | J2 2 68 | 0 0 69 | 1 -1 70 | J3 2 71 | 0 -1 72 | 1 0 73 | J4 2 74 | 0 1 75 | 1 1 76 | G0 2 77 | 0 0 78 | 1 0 79 | -------------------------------------------------------------------------------- /amplOF/examples/hs076.nl: -------------------------------------------------------------------------------- 1 | g3 3 1 0 # problem hs076 2 | 4 3 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 4 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 10 4 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | n0 13 | C1 14 | n0 15 | C2 16 | n0 17 | O0 0 18 | o54 19 | 6 20 | o5 21 | v0 22 | n2 23 | o2 24 | n0.5 25 | o5 26 | v1 27 | n2 28 | o5 29 | v2 30 | n2 31 | o2 32 | n0.5 33 | o5 34 | v3 35 | n2 36 | o16 37 | o2 38 | v0 39 | v2 40 | o2 41 | v2 42 | v3 43 | x4 44 | 0 0.5 45 | 1 0.5 46 | 2 0.5 47 | 3 0.5 48 | r 49 | 1 5 50 | 1 4 51 | 2 1.5 52 | b 53 | 2 0 54 | 2 0 55 | 2 0 56 | 2 0 57 | k3 58 | 2 59 | 5 60 | 8 61 | J0 4 62 | 0 1 63 | 1 2 64 | 2 1 65 | 3 1 66 | J1 4 67 | 0 3 68 | 1 1 69 | 2 2 70 | 3 -1 71 | J2 2 72 | 1 1 73 | 2 4 74 | G0 4 75 | 0 -1 76 | 1 -3 77 | 2 1 78 | 3 -1 79 | -------------------------------------------------------------------------------- /amplOF/AMPLof.h: -------------------------------------------------------------------------------- 1 | #ifndef AMPL_OBJECTIVEFUNCTION_INCLUDE 2 | #define AMPL_OBJECTIVEFUNCTION_INCLUDE 3 | 4 | 5 | #include "../common/ObjectiveFunction.h" 6 | #include "../common/VectorInt.h" 7 | #include "asl.h" 8 | 9 | class AMPLObjectiveFunction : public ObjectiveFunction 10 | { 11 | public: 12 | long nerror; 13 | ASL * asl; 14 | AMPLObjectiveFunction(int _t,char **argv, double _objectiveConst=0.0, Vector _xOptimal=Vector::emptyVector); 15 | AMPLObjectiveFunction(int _t,char *argv, double _objectiveConst=0.0, Vector _xOptimal=Vector::emptyVector); 16 | ~AMPLObjectiveFunction(); 17 | 18 | double eval(Vector v, int *ner=NULL); 19 | double evalNLConstraint(int j, Vector v, int *ner=NULL); 20 | void evalGradNLConstraint(int j, Vector v, Vector result, int *ner=NULL); 21 | // void printStats() {ConstrainedObjectiveFunction::printStats();} 22 | virtual void finalize(); 23 | private: 24 | char *stub; 25 | double objsign; 26 | static Option_Info Oinfo; 27 | VectorInt indexNLConstraint; 28 | Vector RHSNLConstraint; 29 | void init(int _t, double _objectiveConst, Vector _xOptimal); 30 | 31 | }; 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /amplOF/examples/watson.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 20 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # See also Buckley#128 (p. 100). 18 | 19 | # SIF input: Ph. Toint, Dec 1989. 20 | 21 | # classification SUR2-AN-V-0 22 | 23 | param N:=10; 24 | var x{1..N} := 0; 25 | 26 | param t{i in 1..(N-2)} := i/(N-2); 27 | 28 | minimize f: 29 | sum {i in 1..(N-2)} (sum {j in 2..N} (j-1)*x[j]*t[i]^(j-2) - (sum {j in 1..N} x[j]*t[i]^(j-1))^2 - 1)^2 + 30 | x[1]^2 + (x[2]-x[1]^2-1)^2; 31 | 32 | #solve; 33 | #display f; 34 | #display x; 35 | write gwatson; 36 | -------------------------------------------------------------------------------- /sifOF/examples/cliff.d: -------------------------------------------------------------------------------- 1 | 2 3 0 0 0 5 0 0 0 2 2 | 3CLIFF 0 3 | 1 1 1 1 4 | 1 1 1 1 5 | 1 2 4 6 6 | 1 7 | 1 8 | 1 0 2 9 | 1 1 1 10 | 11 | 12 | 13 | 14 | 1 1 2 1 2 15 | 1.00000000E-02 -1.00000000E+00 1.00000000E+00 1.00000000E+00 16 | -1.00000000E+00 17 | 3.00000000E-02 0.00000000E+00 0.00000000E+00 18 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 0.00000000E+00 19 | 0.00000000E+00 20 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 0.00000000E+00 21 | 0.00000000E+00 22 | 0.00000000E+00 -1.00000000E+00 23 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 24 | 25 | 26 | 27 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 28 | 1.00000000E+00 1.00000000E+00 29 | 0.00000000E+00 1.61792382+308 30 | 31 | FTF 32 | G1 G2 G3 33 | X1 X2 34 | 35 | L2 20EXP 36 | 0 0 37 | CLIFF 2 0 0 0 0 0 1 2 0 0 0 0 38 | -------------------------------------------------------------------------------- /amplOF/examples/hs044.nl: -------------------------------------------------------------------------------- 1 | g3 2 1 0 # problem hs044 2 | 4 6 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 4 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 12 4 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | n0 13 | C1 14 | n0 15 | C2 16 | n0 17 | C3 18 | n0 19 | C4 20 | n0 21 | C5 22 | n0 23 | O0 0 24 | o54 25 | 4 26 | o16 27 | o2 28 | v0 29 | v2 30 | o2 31 | v0 32 | v3 33 | o2 34 | v1 35 | v2 36 | o16 37 | o2 38 | v1 39 | v3 40 | x4 41 | 0 0 42 | 1 0 43 | 2 0 44 | 3 0 45 | r 46 | 1 8 47 | 1 12 48 | 1 12 49 | 1 8 50 | 1 8 51 | 1 5 52 | b 53 | 2 0 54 | 2 0 55 | 2 0 56 | 2 0 57 | k3 58 | 3 59 | 6 60 | 9 61 | J0 2 62 | 0 1 63 | 1 2 64 | J1 2 65 | 0 4 66 | 1 1 67 | J2 2 68 | 0 3 69 | 1 4 70 | J3 2 71 | 2 2 72 | 3 1 73 | J4 2 74 | 2 1 75 | 3 2 76 | J5 2 77 | 2 1 78 | 3 1 79 | G0 4 80 | 0 1 81 | 1 -1 82 | 2 -1 83 | 3 0 84 | -------------------------------------------------------------------------------- /amplOF/examples/brybnd.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 31 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # See also Buckley#73 (p. 41) and Toint#18 18 | 19 | # SIF input: Ph. Toint, Dec 1989. 20 | 21 | # classification SUR2-AN-V-0 22 | 23 | param N:=10; 24 | 25 | param ml := 5; 26 | param mu := 1; 27 | 28 | set J{i in 1..N} := {j in 1..N : j != i && max(1,i-ml) <= j <= min(N,i+mu) }; 29 | 30 | var x{1..N} := -1; 31 | 32 | minimize f: 33 | sum {i in 1..N} ( x[i]*(2+5*x[i]^2) + 1 - sum {j in J[i]} x[j]*(1+x[j]) )^2; 34 | 35 | #solve; 36 | #display f; 37 | #display x; 38 | write gbrybnd; 39 | -------------------------------------------------------------------------------- /amplOF/examples/brownden.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: Problem 16 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # See also Buckley#30 18 | # SIF input: Ph. Toint, Dec 1989. 19 | 20 | # classification SUR2-AN-4-0 21 | 22 | param M:=20; 23 | param N:=4; 24 | 25 | param x_init{1..4}; 26 | var x{i in 1..4} := x_init[i]; 27 | 28 | param t{i in 1..M} := i/5; 29 | 30 | minimize f: 31 | sum {i in 1..M} ( (x[1]+t[i]*x[2]-exp(t[i]))^2 + (x[3]+x[4]*sin(t[i])-cos(t[i]))^2 )^2; 32 | 33 | data; 34 | param x_init:= 1 25 2 5 3 -5 4 -1; 35 | 36 | #solve; 37 | #display f; 38 | #display x; 39 | 40 | write gbrownden; 41 | -------------------------------------------------------------------------------- /amplOF/examples/cragglvy.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 32 in 13 | # Ph. L. Toint, 14 | # "Test problems for partially separable optimization and results 15 | # for the routine PSPMIN", 16 | # Report 83/4, Department of Mathematics, FUNDP (Namur, B), 1983. 17 | 18 | # See also Buckley#18 19 | # SIF input: Ph. Toint, Dec 1989. 20 | 21 | # classification OUR2-AY-V-0 22 | 23 | param m := 4; 24 | param n := 2*m+2; 25 | 26 | var x{i in 1..n} := if (i==1) then 1.0 else 2.0; 27 | 28 | minimize f: 29 | sum {i in 1..m} ( 30 | (exp(x[2*i-1])-x[2*i])^4 + 31 | 100*(x[2*i]-x[2*i+1])^6 + 32 | (tan(x[2*i+1]-x[2*i+2])+x[2*i+1]-x[2*i+2])^4 + 33 | (x[2*i-1])^8 + 34 | (x[2*i+2]-1.0)^2 35 | ); 36 | 37 | #solve; 38 | #display f; 39 | #display x; 40 | write gcragglvy; -------------------------------------------------------------------------------- /amplOF/examples/gulf.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 11 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # See also Buckley#27 18 | # SIF input: Ph. Toint, Dec 1989. 19 | 20 | # classification SUR2-MN-3-0 21 | 22 | param N:=3; 23 | param M:=99; 24 | 25 | param t{i in 1..M} := i/100; 26 | param y{i in 1..M} := 25+ (-50*log(t[i]))^(2/3); 27 | 28 | param x_init{1..N}; 29 | var x{i in 1..N} := x_init[i]; 30 | 31 | minimize f: 32 | sum {i in 1..M} (exp(abs(y[i]-x[2])^x[3]/(-x[1]))-t[i])^2; 33 | 34 | data; 35 | param x_init := 1 5 2 2.5 3 0.15; 36 | 37 | #solve; 38 | #display f; 39 | #display x; 40 | write ggulf; -------------------------------------------------------------------------------- /amplOF/examples/biggs6.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: Problem 21 in 13 | # A.R. Buckley, 14 | # "Test functions for unconstrained minimization", 15 | # TR 1989CS-3, Mathematics, statistics and computing centre, 16 | # Dalhousie University, Halifax (CDN), 1989. 17 | 18 | # SIF input: Ph. Toint, Dec 1989. 19 | 20 | # classification SUR2-AN-6-0 21 | 22 | param N:=6; 23 | param M:=13; 24 | param xinit{1..N}; 25 | var x{i in 1..N}:=xinit[i]; 26 | 27 | minimize f: 28 | sum {i in 1..M} (-exp(-0.1*i)+5*exp(-i)-3*exp(-0.4*i) 29 | + x[3]*exp(-0.1*i*x[1]) - x[4]*exp(-0.1*i*x[2]) + 30 | x[6]*exp(-0.1*i*x[5]))^2; 31 | 32 | data; 33 | param xinit:= 34 | 1 1 35 | 2 2 36 | 3 1 37 | 4 1 38 | 5 4 39 | 6 3; 40 | 41 | #solve; 42 | #display f; 43 | #display x; 44 | write gbiggs6; 45 | 46 | -------------------------------------------------------------------------------- /amplOF/examples/morebv.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: problem 28 in 13 | # J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | # "Testing Unconstrained Optimization Software", 15 | # ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | # See also Buckley#17 (p. 75). 18 | 19 | # SIF input: Ph. Toint, Dec 1989 and Nick Gould, Oct 1992. 20 | 21 | # classification SUR2-MN-V-0 22 | 23 | param N:=10; 24 | 25 | param h:=1/(N+1); 26 | param t{i in 1..N} := i*h; 27 | 28 | var x{i in 0..N+1} := if (1 <= i <= N) then t[i]*(t[i]-1); 29 | 30 | minimize f: 31 | sum {i in 1..N} (2*x[i]-x[i-1]-x[i+1]+h^2*(x[i]+t[i]+1)^3/2)^2; 32 | 33 | subject to cons1: x[0] = 0; 34 | subject to cons2: x[N+1] = 0; 35 | 36 | #solve; 37 | #display f; 38 | #display x; 39 | write gmorebv; 40 | -------------------------------------------------------------------------------- /amplOF/examples/hs108.mod: -------------------------------------------------------------------------------- 1 | var x {1..9}; 2 | 3 | minimize obj: 4 | -.5*(x[1]*x[4]-x[2]*x[3]+x[3]*x[9]-x[5]*x[9]+x[5]*x[8]-x[6]*x[7]); 5 | 6 | s.t. c1: 1-x[3]^2-x[4]^2>=0; 7 | s.t. c2: 1-x[5]^2-x[6]^2>=0; 8 | s.t. c3: 1-x[9]^2>=0; 9 | s.t. c4: 1-x[1]^2-(x[2]-x[9])^2>=0; 10 | s.t. c5: 1-(x[1]-x[5])^2-(x[2]-x[6])^2>=0; 11 | s.t. c6: 1-(x[1]-x[7])^2-(x[2]-x[8])^2>=0; 12 | s.t. c7: 1-(x[3]-x[7])^2-(x[4]-x[8])^2>=0; 13 | s.t. c8: 1-(x[3]-x[5])^2-(x[4]-x[6])^2>=0; 14 | s.t. c9: 1-x[7]^2-(x[8]-x[9])^2>=0; 15 | s.t. c10: x[1]*x[4]-x[2]*x[3]>=0; 16 | s.t. c11: x[3]*x[9]>=0; 17 | s.t. c12: -x[5]*x[9]>=0; 18 | s.t. c13: x[5]*x[8]-x[6]*x[7]>=0; 19 | s.t. c14: x[9]>=0; 20 | 21 | data; 22 | 23 | let x[1] := 1; 24 | let x[2] := 1; 25 | let x[3] := 1; 26 | let x[4] := 1; 27 | let x[5] := 1; 28 | let x[6] := 1; 29 | let x[7] := 1; 30 | let x[8] := 1; 31 | let x[9] := 1; 32 | 33 | #let x[1] := 0.8841292; 34 | #let x[2] := 0.4672425; 35 | #let x[3] := 0.03742076; 36 | #let x[4] := 0.9992996; 37 | #let x[5] := 0.8841292; 38 | #let x[6] := 0.4672425; 39 | #let x[7] := 0.03742076; 40 | #let x[8] := 0.9992996; 41 | #let x[9] := 0; 42 | 43 | #display obj; 44 | #solve; 45 | #display x; 46 | #display obj; 47 | #display obj+.8660254038; 48 | 49 | write ghs108; 50 | -------------------------------------------------------------------------------- /sifOF/examples/sisser.d: -------------------------------------------------------------------------------- 1 | 2 3 3 3 4 0 0 0 2 1 2 | 3SISSER 0 3 | 1 2 3 4 4 | 1 1 1 1 5 | 1 1 1 1 6 | 1 2 4 5 7 | 1 1 1 1 8 | 1 1 1 9 | 1 1 1 10 | 1 2 1 11 | 1 2 1 12 | 1 2 3 13 | 1 1 2 2 14 | 15 | 16 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 0.00000000E+00 18 | 0.00000000E+00 19 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 0.00000000E+00 20 | 0.00000000E+00 21 | 1.00000000E+00 1.00000000E-01 22 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 23 | 24 | 25 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 26 | 3.00000030E+00 2.00000000E+00 3.00000030E+00 27 | 1.00000000E+00 1.00000000E+00 28 | 0.00000000E+00 1.61792382+308 29 | FFF 30 | FFF 31 | G1 G2 G3 32 | X1 X2 33 | SQ 2PR 34 | L2 35 | 0 0 36 | SISSER 2 0 0 0 0 0 0 3 0 0 0 0 37 | -------------------------------------------------------------------------------- /amplOF/examples/hs038.nl: -------------------------------------------------------------------------------- 1 | g3 2 1 0 # problem hs038 2 | 4 1 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 4 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 3 4 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | n0 13 | O0 0 14 | o54 15 | 7 16 | o2 17 | n100 18 | o5 19 | o1 20 | v1 21 | o5 22 | v0 23 | n2 24 | n2 25 | o5 26 | o1 27 | n1 28 | v0 29 | n2 30 | o2 31 | n90 32 | o5 33 | o1 34 | v3 35 | o5 36 | v2 37 | n2 38 | n2 39 | o5 40 | o1 41 | n1 42 | v2 43 | n2 44 | o2 45 | n10.1 46 | o5 47 | o0 48 | n-1 49 | v1 50 | n2 51 | o2 52 | n10.1 53 | o5 54 | o0 55 | n-1 56 | v3 57 | n2 58 | o2 59 | o2 60 | n19.8 61 | o0 62 | n-1 63 | v1 64 | o0 65 | n-1 66 | v3 67 | x4 68 | 0 -3 69 | 1 -1 70 | 2 -3 71 | 3 -1 72 | r 73 | 2 0 74 | b 75 | 0 -10 10 76 | 0 -10 10 77 | 0 -10 10 78 | 0 -10 10 79 | k3 80 | 1 81 | 2 82 | 3 83 | J0 3 84 | 0 1 85 | 1 2 86 | 2 2 87 | G0 4 88 | 0 0 89 | 1 0 90 | 2 0 91 | 3 0 92 | -------------------------------------------------------------------------------- /MathEval/lib/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU libmatheval 5 | * 6 | * GNU libmatheval is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 2, or (at your option) any later 9 | * version. 10 | * 11 | * GNU libmatheval is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * program; see the file COPYING. If not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef ERROR_H 22 | #define ERROR_H 1 23 | 24 | #if HAVE_CONFIG_H 25 | #include "config.h" 26 | #endif 27 | 28 | /* Print library warning message. */ 29 | void error_warning(const char *message); 30 | 31 | /* Print library error message and terminate program using library. */ 32 | void error_fatal(const char *message); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /amplOF/r_op.hd: -------------------------------------------------------------------------------- 1 | f_OPPLUS, 2 | f_OPMINUS, 3 | f_OPMULT, 4 | f_OPDIV, 5 | f_OPREM, 6 | f_OPPOW, 7 | f_OPLESS, 8 | 0, 9 | 0, 10 | 0, 11 | 0, 12 | f_MINLIST, 13 | f_MAXLIST, 14 | f_FLOOR, 15 | f_CEIL, 16 | f_ABS, 17 | f_OPUMINUS, 18 | 0, 19 | 0, 20 | 0, 21 | f_OPOR, 22 | f_OPAND, 23 | f_LT, 24 | f_LE, 25 | f_EQ, 26 | 0, 27 | 0, 28 | 0, 29 | f_GE, 30 | f_GT, 31 | f_NE, 32 | 0, 33 | 0, 34 | 0, 35 | f_OPNOT, 36 | f_OPIFnl, 37 | 0, 38 | f_OP_tanh, 39 | f_OP_tan, 40 | f_OP_sqrt, 41 | f_OP_sinh, 42 | f_OP_sin, 43 | f_OP_log10, 44 | f_OP_log, 45 | f_OP_exp, 46 | f_OP_cosh, 47 | f_OP_cos, 48 | f_OP_atanh, 49 | f_OP_atan2, 50 | f_OP_atan, 51 | f_OP_asinh, 52 | f_OP_asin, 53 | f_OP_acosh, 54 | f_OP_acos, 55 | f_OPSUMLIST, 56 | f_OPintDIV, 57 | f_OPprecision, 58 | f_OPround, 59 | f_OPtrunc, 60 | f_OPCOUNT, 61 | f_OPNUMBEROF, 62 | f_OPNUMBEROFs, 63 | f_OPATLEAST, 64 | f_OPATMOST, 65 | f_OPPLTERM, 66 | (efunc*) f_OPIFSYM, 67 | f_OPEXACTLY, 68 | f_OPNOTATLEAST, 69 | f_OPNOTATMOST, 70 | f_OPNOTEXACTLY, 71 | f_ANDLIST, 72 | f_ORLIST, 73 | f_OPIMPELSE, 74 | f_OP_IFF, 75 | f_OPALLDIFF, 76 | f_OP1POW, 77 | f_OP2POW, 78 | f_OPCPOW, 79 | f_OPFUNCALL, 80 | (efunc*) f_OPNUM, 81 | (efunc*) f_OPHOL, 82 | f_OPVARVAL 83 | -------------------------------------------------------------------------------- /sifOF/examples/helix.d: -------------------------------------------------------------------------------- 1 | 3 3 2 2 4 2 0 0 2 1 2 | 3HELIX 0 3 | 1 2 3 3 4 | 1 1 1 1 5 | 1 2 2 3 6 | 1 3 5 7 | 1 1 1 8 | 1 1 1 9 | 1 1 1 10 | 1 2 11 | 2 2 12 | 1 2 13 | 1 2 1 2 14 | 3 3 15 | 1.00000000E+00 1.00000000E+00 16 | 0.00000000E+00 1.00000000E+00 0.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 0.00000000E+00 18 | 0.00000000E+00 0.00000000E+00 19 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 0.00000000E+00 20 | 0.00000000E+00 0.00000000E+00 21 | -1.00000000E+00 0.00000000E+00 0.00000000E+00 22 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 23 | 24 | 25 | -1.00000000E+01 1.00000000E+00 26 | 1.00000000E+02 1.00000000E+02 1.00000000E+00 27 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 28 | 0.00000000E+00 1.61792382+308 29 | FF 30 | FFF 31 | A B C 32 | X1 X2 X3 33 | THETA TWONRM 34 | L2 35 | 0 0 0 36 | HELIX 3 0 0 0 0 0 1 2 0 0 0 0 37 | -------------------------------------------------------------------------------- /amplOF/asl_pfg.h: -------------------------------------------------------------------------------- 1 | /**************************************************************** 2 | Copyright (C) 1997 Lucent Technologies 3 | All Rights Reserved 4 | 5 | Permission to use, copy, modify, and distribute this software and 6 | its documentation for any purpose and without fee is hereby 7 | granted, provided that the above copyright notice appear in all 8 | copies and that both that the copyright notice and this 9 | permission notice and warranty disclaimer appear in supporting 10 | documentation, and that the name of Lucent or any of its entities 11 | not be used in advertising or publicity pertaining to 12 | distribution of the software without specific, written prior 13 | permission. 14 | 15 | LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 16 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 17 | IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 18 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 20 | IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 21 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 22 | THIS SOFTWARE. 23 | ****************************************************************/ 24 | 25 | #undef PSHVREAD 26 | #ifndef ASL_PFG_included 27 | #define ASL_PFG_included 28 | #include "psinfo.h" 29 | #endif /* ASL_PFG_included */ 30 | -------------------------------------------------------------------------------- /common/parallel.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | 27 | #ifndef _PARALLEL_H_ 28 | #define _PARALLEL_H_ 29 | 30 | void parallelImprove(InterPolynomial *p, int *_k, double _rho, double *_valueFk, Vector _Base); 31 | void parallelInit(int _nnode, int _dim, ObjectiveFunction *_of); 32 | void parallelFinish(); 33 | void startParallelThread(); 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /amplOF/asl_pfgh.h: -------------------------------------------------------------------------------- 1 | /**************************************************************** 2 | Copyright (C) 1997 Lucent Technologies 3 | All Rights Reserved 4 | 5 | Permission to use, copy, modify, and distribute this software and 6 | its documentation for any purpose and without fee is hereby 7 | granted, provided that the above copyright notice appear in all 8 | copies and that both that the copyright notice and this 9 | permission notice and warranty disclaimer appear in supporting 10 | documentation, and that the name of Lucent or any of its entities 11 | not be used in advertising or publicity pertaining to 12 | distribution of the software without specific, written prior 13 | permission. 14 | 15 | LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 16 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 17 | IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 18 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 20 | IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 21 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 22 | THIS SOFTWARE. 23 | ****************************************************************/ 24 | 25 | #undef PSHVREAD 26 | #define PSHVREAD 27 | #ifndef ASL_PFGH_included 28 | #define ASL_PFGH_included 29 | #include "psinfo.h" 30 | #endif /* ASL_PFGH_included */ 31 | -------------------------------------------------------------------------------- /amplOF/examples/mancino.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: 13 | # E. Spedicato, 14 | # "Computational experience with quasi-Newton algorithms for 15 | # minimization problems of moderate size", 16 | # Report N-175, CISE, Milano, 1975. 17 | 18 | # See also Buckley #51 (p. 72), Schittkowski #391 (for N = 30) 19 | 20 | # SIF input: Ph. Toint, Dec 1989. 21 | # correction by Ph. Shott, January, 1995. 22 | 23 | # classification SUR2-AN-V-0 24 | 25 | param N := 10; 26 | 27 | var x{i in 1..N} := -8.710996D-4*((i-50)^3 + 28 | sum {j in 1..N} sqrt(i/j)*((sin(log(sqrt(i/j))))^5+ 29 | (cos(log(sqrt(i/j))))^5)); 30 | var v{i in 1..N, j in 1..N} = sqrt (x[i]^2 +i/j); 31 | var alpha{i in 1..N} = 1400*x[i] + (i-50)^3 + 32 | sum {j in 1..N} v[i,j]*((sin(log(v[i,j])))^5 + 33 | (cos(log(v[i,j])))^5); 34 | 35 | minimize f: 36 | sum {i in 1..N} alpha[i]^2; 37 | 38 | #solve; 39 | #display f; 40 | #display x; 41 | write gmancino; 42 | -------------------------------------------------------------------------------- /amplOF/examples/power.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem power 2 | 10 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 10 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 10 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 10 14 | o5 15 | v0 16 | n2 17 | o5 18 | o2 19 | n2 20 | v1 21 | n2 22 | o5 23 | o2 24 | n3 25 | v2 26 | n2 27 | o5 28 | o2 29 | n4 30 | v3 31 | n2 32 | o5 33 | o2 34 | n5 35 | v4 36 | n2 37 | o5 38 | o2 39 | n6 40 | v5 41 | n2 42 | o5 43 | o2 44 | n7 45 | v6 46 | n2 47 | o5 48 | o2 49 | n8 50 | v7 51 | n2 52 | o5 53 | o2 54 | n9 55 | v8 56 | n2 57 | o5 58 | o2 59 | n10 60 | v9 61 | n2 62 | x10 63 | 0 1 64 | 1 1 65 | 2 1 66 | 3 1 67 | 4 1 68 | 5 1 69 | 6 1 70 | 7 1 71 | 8 1 72 | 9 1 73 | b 74 | 3 75 | 3 76 | 3 77 | 3 78 | 3 79 | 3 80 | 3 81 | 3 82 | 3 83 | 3 84 | k9 85 | 0 86 | 0 87 | 0 88 | 0 89 | 0 90 | 0 91 | 0 92 | 0 93 | 0 94 | G0 10 95 | 0 0 96 | 1 0 97 | 2 0 98 | 3 0 99 | 4 0 100 | 5 0 101 | 6 0 102 | 7 0 103 | 8 0 104 | 9 0 105 | -------------------------------------------------------------------------------- /amplOF/examples/hs106.nl: -------------------------------------------------------------------------------- 1 | g3 4 1 0 # problem hs106 2 | 8 6 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 3 0 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 8 0 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 17 3 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | o2 13 | v0 14 | v5 15 | C1 16 | o1 17 | o2 18 | v1 19 | v6 20 | o2 21 | v1 22 | v3 23 | C2 24 | o1 25 | o2 26 | v2 27 | v7 28 | o2 29 | v2 30 | v4 31 | C3 32 | n0 33 | C4 34 | n0 35 | C5 36 | n0 37 | O0 0 38 | n0 39 | x8 40 | 0 5000 41 | 1 5000 42 | 2 5000 43 | 3 200 44 | 4 350 45 | 5 150 46 | 6 225 47 | 7 425 48 | r 49 | 2 -83333.33 50 | 2 0 51 | 2 1250000 52 | 2 -1 53 | 2 -1 54 | 2 -1 55 | b 56 | 0 100 10000 57 | 0 1000 10000 58 | 0 1000 10000 59 | 0 10 1000 60 | 0 10 1000 61 | 0 10 1000 62 | 0 10 1000 63 | 0 10 1000 64 | k7 65 | 1 66 | 2 67 | 3 68 | 7 69 | 11 70 | 13 71 | 15 72 | J0 3 73 | 0 -100 74 | 3 -833.3325 75 | 5 0 76 | J1 4 77 | 1 0 78 | 3 1250 79 | 4 -1250 80 | 6 0 81 | J2 3 82 | 2 0 83 | 4 2500 84 | 7 0 85 | J3 2 86 | 3 -0.0025 87 | 5 -0.0025 88 | J4 3 89 | 3 0.0025 90 | 4 -0.0025 91 | 6 -0.0025 92 | J5 2 93 | 4 0.01 94 | 7 -0.01 95 | G0 3 96 | 0 1 97 | 1 1 98 | 2 1 99 | -------------------------------------------------------------------------------- /amplOF/examples/dixmaank.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: 13 | # L.C.W. Dixon and Z. Maany, 14 | # "A family of test problems with sparse Hessians for unconstrained 15 | # optimization", 16 | # TR 206, Numerical Optimization Centre, Hatfield Polytechnic, 1988. 17 | 18 | # See also Buckley#221 (p. 49) 19 | # SIF input: Ph. Toint, Dec 1989. 20 | # correction by Ph. Shott, January 1995. 21 | 22 | # classification OUR2-AN-V-0 23 | 24 | param M:=5; 25 | param N:=3*M; 26 | 27 | param alpha:=1.0; 28 | param beta:=0.125; 29 | param gamma:=0.125; 30 | param delta := 0.125; 31 | 32 | param K{1..4}; 33 | var x{1..N}:=2.0; 34 | 35 | minimize f: 36 | 1.0 + sum {i in 1..N} alpha*x[i]^2*(i/N)^K[1] + 37 | sum {i in 1..N-1} beta*x[i]^2*(x[i+1]+x[i+1]^2)^2*(i/N)^K[2] + 38 | sum {i in 1..2*M} gamma*x[i]^2*x[i+M]^4*(i/N)^K[3] + 39 | sum {i in 1..M} delta*x[i]*x[i+2*M]*(i/N)^K[4]; 40 | data; 41 | param K:= 42 | 1 2 43 | 2 0 44 | 3 0 45 | 4 2; 46 | 47 | #solve; 48 | #display f; 49 | #display x; 50 | write gdixmaank; 51 | -------------------------------------------------------------------------------- /MathEval/lib/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU libmatheval 5 | * 6 | * GNU libmatheval is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 2, or (at your option) any later 9 | * version. 10 | * 11 | * GNU libmatheval is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * program; see the file COPYING. If not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef COMMON_H 22 | #define COMMON_H 1 23 | 24 | #if HAVE_CONFIG_H 25 | #include "config.h" 26 | #endif 27 | 28 | #include 29 | 30 | #if STDC_HEADERS 31 | #include 32 | #include 33 | #elif HAVE_STRINGS_H 34 | #include 35 | #endif 36 | 37 | #ifndef EXIT_SUCCESS 38 | #define EXIT_SUCCESS 0 39 | #define EXIT_FAILURE 1 40 | #endif 41 | 42 | #ifndef FALSE 43 | #define FALSE 0 44 | #endif 45 | 46 | #ifndef TRUE 47 | #define TRUE 1 48 | #endif 49 | 50 | #include "xmalloc.h" 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /amplOF/dvalue.hd: -------------------------------------------------------------------------------- 1 | 1 /* OPPLUS */, 2 | -1 /* OPMINUS */, 3 | 0 /* OPMULT */, 4 | 0 /* OPDIV */, 5 | 0 /* OPREM */, 6 | 0 /* OPPOW */, 7 | 0 /* OPLESS */, 8 | 0, 9 | 0, 10 | 0, 11 | 0, 12 | 0 /* MINLIST */, 13 | 0 /* MAXLIST */, 14 | 0 /* FLOOR */, 15 | 0 /* CEIL */, 16 | 0 /* ABS */, 17 | -1 /* OPUMINUS */, 18 | 0, 19 | 0, 20 | 0, 21 | 0 /* OPOR */, 22 | 0 /* OPAND */, 23 | 0 /* LT */, 24 | 0 /* LE */, 25 | 0 /* EQ */, 26 | 0, 27 | 0, 28 | 0, 29 | 0 /* GE */, 30 | 0 /* GT */, 31 | 0 /* NE */, 32 | 0, 33 | 0, 34 | 0, 35 | 0 /* OPNOT */, 36 | 0 /* OPIFnl */, 37 | 0, 38 | 0 /* OP_tanh */, 39 | 0 /* OP_tan */, 40 | 0 /* OP_sqrt */, 41 | 0 /* OP_sinh */, 42 | 0 /* OP_sin */, 43 | 0 /* OP_log10 */, 44 | 0 /* OP_log */, 45 | 0 /* OP_exp */, 46 | 0 /* OP_cosh */, 47 | 0 /* OP_cos */, 48 | 0 /* OP_atanh */, 49 | 0 /* OP_atan2 */, 50 | 0 /* OP_atan */, 51 | 0 /* OP_asinh */, 52 | 0 /* OP_asin */, 53 | 0 /* OP_acosh */, 54 | 0 /* OP_acos */, 55 | 0 /* OPSUMLIST */, 56 | 11 /* OPintDIV */, 57 | 11 /* OPprecision */, 58 | 11 /* OPround */, 59 | 11 /* OPtrunc */, 60 | 0 /* OPCOUNT */, 61 | 0 /* OPNUMBEROF */, 62 | 0 /* OPNUMBEROFs */, 63 | 0 /* OPATLEAST */, 64 | 0 /* OPATMOST */, 65 | 0 /* OPPLTERM */, 66 | 0, 67 | 0 /* OPEXACTLY */, 68 | 0 /* OPNOTATLEAST */, 69 | 0 /* OPNOTATMOST */, 70 | 0 /* OPNOTEXACTLY */, 71 | 0 /* ANDLIST */, 72 | 0 /* ORLIST */, 73 | 0 /* OPIMPELSE */, 74 | 0 /* OP_IFF */, 75 | 11 /* OPALLDIFF */, 76 | 1 /* OP1POW */, 77 | 1 /* f_OP2POW */, 78 | 1 /* f_OPCPOW */ 79 | -------------------------------------------------------------------------------- /amplOF/examples/hart6.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: Hartman problem 6 in 13 | # L. C. W. Dixon and G. P. Szego (Eds.) 14 | # Towards Global Optimization 15 | # North Holland, 1975. 16 | # Paper 9, page 163. 17 | 18 | # SIF input: A.R. Conn May 1995 19 | 20 | # classification OBR2-AN-6-0 21 | 22 | param c {1..4}; 23 | param a {1..4, 1..6}; 24 | param p {1..4, 1..6}; 25 | 26 | var x{1..6} >= 0.0, <= 1.0, := 0.2; 27 | 28 | minimize obj: 29 | - sum{i in 1..4} c[i]*exp(-sum{j in 1..6} a[i,j]*(x[j]-p[i,j])^2); 30 | 31 | data; 32 | param c := 1 1.0 2 1.2 3 3.0 4 3.2; 33 | param a[tr]: 1 2 3 4 := 34 | 1 10.0 0.05 3.0 17.0 35 | 2 0.05 10.0 3.5 8.0 36 | 3 17.0 17.0 1.7 0.05 37 | 4 3.5 0.1 10.0 10.0 38 | 5 1.7 8.0 17.0 0.1 39 | 6 8.0 14.0 8.0 14.0 40 | ; 41 | param p[tr]: 1 2 3 4 := 42 | 1 0.1312 0.2329 0.2348 0.4047 43 | 2 0.1696 0.4135 0.1451 0.8828 44 | 3 0.5569 0.8307 0.3522 0.8732 45 | 4 0.0124 0.3736 0.2883 0.5743 46 | 5 0.8283 0.1004 0.3047 0.1091 47 | 6 0.5886 0.9991 0.665 0.0381 48 | ; 49 | 50 | #solve; 51 | #display x; 52 | #display obj; 53 | write ghart6; 54 | -------------------------------------------------------------------------------- /sifOF/examples/pfit1ls.d: -------------------------------------------------------------------------------- 1 | 3 3 5 6 15 0 0 0 5 1 2 | 3PFIT1LS 0 3 | 1 4 6 7 4 | 1 1 1 1 5 | 1 1 1 1 6 | 1 4 7 10 13 16 7 | 1 1 1 1 1 1 8 | 1 1 1 9 | 1 1 1 10 | 3 2 1 4 5 11 | 3 3 3 3 3 12 | 1 3 4 1 2 5 13 | 1 2 3 1 2 3 1 2 3 1 14 | 2 3 1 2 3 15 | 16 | 17 | -8.00000000E+00 -1.86666667E+01 -2.31111111E+01 18 | -1.00000000E+20 -1.00000000E+20 -5.00000000E-01 0.00000000E+00 19 | 0.00000000E+00 0.00000000E+00 20 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 0.00000000E+00 21 | 0.00000000E+00 0.00000000E+00 22 | 1.00000000E+00 0.00000000E+00 1.00000000E+00 23 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 24 | 25 | 26 | -5.00000000E-01 1.00000000E+00 -1.00000000E+00 -1.00000000E+00 27 | 1.00000000E+00 -1.00000000E+00 28 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 29 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 30 | 0.00000000E+00 1.61792382+308 31 | FFFFF 32 | FFF 33 | EF EG EH 34 | A R H 35 | T1 T2 T3 T4 T5 36 | L2 37 | 0 0 0 38 | PFIT1LS 2 0 1 0 0 0 0 3 0 0 0 0 39 | -------------------------------------------------------------------------------- /sifOF/examples/stratec.d: -------------------------------------------------------------------------------- 1 | 10 1 1 1 10 0 0 0 1 0 2 | 3STRATEC 0 3 | 1 2 4 | 1 1 5 | 1 1 6 | 1 11 7 | 1 1 8 | 0 9 | 1 10 | 1 11 | 10 12 | 1 13 | 1 2 3 4 5 6 7 8 9 10 14 | 15 | 16 | 0.00000000E+00 17 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 18 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 19 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 20 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 21 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 22 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 23 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 24 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 25 | 0.00000000E+00 1.00000000E+00 26 | 0.00000000E+00 27 | 28 | 29 | -1.00000000E+00 30 | 1.00000000E+00 31 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 32 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 33 | 1.00000000E+00 1.00000000E+00 34 | -1.00000000E+20 1.00000000E+20 35 | F 36 | T 37 | LIKE 38 | BET1 BET2 BET3 BET4 BET5 BET6 BET7 BET8 39 | BET9 THE1 40 | LIKE 41 | 42 | 0 0 0 0 0 0 0 0 0 0 43 | STRATEC 10 0 0 0 0 0 0 1 0 0 0 0 44 | -------------------------------------------------------------------------------- /MathEval/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU libmatheval 4 | # 5 | # GNU libmatheval is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License as 7 | # published by the Free Software Foundation; either version 2, or (at 8 | # your option) any later version. 9 | # 10 | # GNU libmatheval is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with program; see the file COPYING. If not, write to the Free 17 | # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 18 | # 02111-1307, USA. 19 | 20 | MAINTAINERCLEANFILES = Makefile.in parser.c parser.h scanner.c 21 | 22 | EXTRA_DIST = parser.h 23 | 24 | INCLUDES = -I$(top_builddir) -I$(top_srcdir) 25 | 26 | lib_LTLIBRARIES = libmatheval.la 27 | 28 | libmatheval_la_SOURCES = parser.y scanner.l error.c matheval.c \ 29 | g77_interface.c node.c symbol_table.c xmalloc.c xmath.c 30 | 31 | libmatheval_la_LDFLAGS = -version-info 1:0:0 32 | libmatheval_la_LIBADD = -lfl -lm 33 | 34 | include_HEADERS = matheval.h 35 | noinst_HEADERS = common.h error.h node.h symbol_table.h xmalloc.h \ 36 | xmath.h 37 | 38 | AM_YFLAGS = -d 39 | 40 | .PHONY: beauty 41 | 42 | beauty: 43 | -for file in $$(ls *.c *.h); do indent $$file; done 44 | -rm -f *~ *.BAK 45 | -------------------------------------------------------------------------------- /amplOF/examples/fminsurf.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: setting the boundary free in 13 | # A Griewank and Ph. Toint, 14 | # "Partitioned variable metric updates for large structured 15 | # optimization problems", 16 | # Numerische Mathematik 39:429-448, 1982. 17 | 18 | # SIF input: Ph. Toint, November 1991. 19 | 20 | # classification OUR2-MY-V-0 21 | 22 | param p := 4; 23 | 24 | param h00 := 1.0; 25 | param slopej := 4.0; 26 | param slopei := 8.0; 27 | 28 | param scale := (p-1)^2; 29 | 30 | param ston := slopei/(p-1); 31 | param wtoe := slopej/(p-1); 32 | param h01 := h00+slopej; 33 | param h10 := h00+slopei; 34 | 35 | var x{1..p,1..p}; 36 | 37 | minimize f: 38 | sum {i in 1..p-1, j in 1..p-1} sqrt(0.5*(p-1)^2*((x[i,j]-x[i+1,j+1])^2+(x[i+1,j]-x[i,j+1])^2)+1.0)/scale + 39 | (sum {j in 1..p, i in 1..p} x[i,j])^2/p^4; 40 | 41 | let {j in 1..p} x[1,j] := (j-1)*wtoe+h00; 42 | let {j in 1..p} x[p,j] := (j-1)*wtoe+h10; 43 | let {i in 2..p-1} x[i,p] := (i-1)*ston+h00; 44 | let {i in 2..p-1} x[i,1] := (i-1)*ston+h01; 45 | let {i in 2..p-1,j in 2..p-1} x[i,j] := 0.0; 46 | 47 | #solve; 48 | #display f; 49 | #display x; 50 | write gfminsurf; 51 | -------------------------------------------------------------------------------- /xmlOF/testCondor/optimScaledRosen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | x0 x1 6 | 7 | 8 | 9 | 10 | 11 | 100*(x1/1000-x0^2)^2+(1-x0)^2 12 | 13 | 14 | 15 | 16 | 17 | 18 | -1.2 -1000 19 | 20 | 21 | 22 | 23 | 24 | -10 -10000 25 | 26 | 27 | 28 | 29 | 10 10000 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 46 | 47 | 48 | 49 | resultsScaledRosen.txt 50 | 51 | 52 | 54 | 55 | 1 1 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /amplOF/examples/pfit1ls.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem pfit1ls 2 | 3 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 3 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 3 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 3 14 | o5 15 | o0 16 | n8 17 | o1 18 | o0 19 | o2 20 | n-0.5 21 | o2 22 | o2 23 | o2 24 | v0 25 | o0 26 | n1 27 | v0 28 | v1 29 | o5 30 | v2 31 | n2 32 | o2 33 | o2 34 | v0 35 | v1 36 | v2 37 | o2 38 | v1 39 | o1 40 | n1 41 | o5 42 | o0 43 | n1 44 | v2 45 | o16 46 | v0 47 | n2 48 | o5 49 | o0 50 | n18.666666666666668 51 | o0 52 | o16 53 | o2 54 | o2 55 | o2 56 | v0 57 | o0 58 | n1 59 | v0 60 | v1 61 | o5 62 | v2 63 | n2 64 | o2 65 | o2 66 | o2 67 | v0 68 | v1 69 | v2 70 | o1 71 | n1 72 | o5 73 | o0 74 | n1 75 | v2 76 | o16 77 | o0 78 | n1 79 | v0 80 | n2 81 | o5 82 | o0 83 | n23.11111111111111 84 | o16 85 | o2 86 | o2 87 | o2 88 | o2 89 | v0 90 | o0 91 | n1 92 | v0 93 | v1 94 | o5 95 | v2 96 | n2 97 | o1 98 | n1 99 | o5 100 | o0 101 | n1 102 | v2 103 | o16 104 | o0 105 | n2 106 | v0 107 | n2 108 | x3 109 | 0 1 110 | 1 0 111 | 2 1 112 | b 113 | 3 114 | 3 115 | 3 116 | k2 117 | 0 118 | 0 119 | G0 3 120 | 0 0 121 | 1 0 122 | 2 0 123 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/optimScaledRosen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | x0 x1 6 | 7 | 8 | 9 | 10 | 11 | 100*(x1/1000-x0^2)^2+(1-x0)^2 12 | 13 | 14 | 15 | 16 | 17 | 18 | -1.2 -1000 19 | 20 | 21 | 22 | 23 | 24 | -10 -10000 25 | 26 | 27 | 28 | 29 | 10 10000 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 46 | 47 | 48 | 49 | resultsScaledRosen.txt 50 | 51 | 52 | 54 | 55 | 1 1 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /MathEval/lib/xmalloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU libmatheval 5 | * 6 | * GNU libmatheval is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 2, or (at your option) any later 9 | * version. 10 | * 11 | * GNU libmatheval is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * program; see the file COPYING. If not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef XMALLOC_H 22 | #define XMALLOC_H 1 23 | 24 | /* Macro definitions to simplify corresponding function calls. */ 25 | #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 26 | #define XREALLOC(type, ptr, num) ((type *) xrealloc ((ptr), (num) * sizeof(type))) 27 | #define XCALLOC(type, num) ((type *) xcalloc ((num), sizeof(type))) 28 | #define XFREE(stale) free (stale); 29 | 30 | /* Replacement for malloc() function with error checking. */ 31 | void *xmalloc(size_t size); 32 | 33 | /* Same as above from realloc(). */ 34 | void *xrealloc(void *ptr, size_t size); 35 | 36 | /* Same as above for calloc(). */ 37 | void *xcalloc(size_t num, size_t size); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /amplOF/opcode.hd: -------------------------------------------------------------------------------- 1 | #define OPPLUS 0 2 | #define OPMINUS 1 3 | #define OPMULT 2 4 | #define OPDIV 3 5 | #define OPREM 4 6 | #define OPPOW 5 7 | #define OPLESS 6 8 | #define MINLIST 11 9 | #define MAXLIST 12 10 | #define FLOOR 13 11 | #define CEIL 14 12 | #define ABS 15 13 | #define OPUMINUS 16 14 | #define OPOR 20 15 | #define OPAND 21 16 | #define LT 22 17 | #define LE 23 18 | #define EQ 24 19 | #define GE 28 20 | #define GT 29 21 | #define NE 30 22 | #define OPNOT 34 23 | #define OPIFnl 35 24 | #define OP_tanh 37 25 | #define OP_tan 38 26 | #define OP_sqrt 39 27 | #define OP_sinh 40 28 | #define OP_sin 41 29 | #define OP_log10 42 30 | #define OP_log 43 31 | #define OP_exp 44 32 | #define OP_cosh 45 33 | #define OP_cos 46 34 | #define OP_atanh 47 35 | #define OP_atan2 48 36 | #define OP_atan 49 37 | #define OP_asinh 50 38 | #define OP_asin 51 39 | #define OP_acosh 52 40 | #define OP_acos 53 41 | #define OPSUMLIST 54 42 | #define OPintDIV 55 43 | #define OPprecision 56 44 | #define OPround 57 45 | #define OPtrunc 58 46 | #define OPCOUNT 59 47 | #define OPNUMBEROF 60 48 | #define OPNUMBEROFs 61 49 | #define OPATLEAST 62 50 | #define OPATMOST 63 51 | #define OPPLTERM 64 52 | #define OPIFSYM 65 53 | #define OPEXACTLY 66 54 | #define OPNOTATLEAST 67 55 | #define OPNOTATMOST 68 56 | #define OPNOTEXACTLY 69 57 | #define ANDLIST 70 58 | #define ORLIST 71 59 | #define OPIMPELSE 72 60 | #define OP_IFF 73 61 | #define OPALLDIFF 74 62 | #define OP1POW 75 63 | #define OP2POW 76 64 | #define OPCPOW 77 65 | #define OPFUNCALL 78 66 | #define OPNUM 79 67 | #define OPHOL 80 68 | #define OPVARVAL 81 69 | #define N_OPS 82 70 | -------------------------------------------------------------------------------- /amplOF/examples/hatflde.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: 13 | # "The OPTIMA user manual (issue No.8, p. 37)", 14 | # Numerical Optimization Centre, Hatfield Polytechnic (UK), 1989. 15 | 16 | # SIF input: Ph. Toint, May 1990. 17 | 18 | # classification SUR2-AN-3-0 19 | 20 | param t {1..10}; 21 | param z {1..10}; 22 | 23 | var x {1..3}; 24 | 25 | minimize obj: sum {j in 1..10} (exp(t[j]*x[3]) - x[1]*exp(t[j]*x[2]) + z[j])^2; 26 | 27 | let x[1] := 1.0; 28 | let x[2] := -1.0; 29 | let x[3] := 0.0; 30 | 31 | data; 32 | 33 | param t := 34 | 1 0.3 35 | 2 0.35 36 | 3 0.4 37 | 4 0.45 38 | 5 0.5 39 | 6 0.55 40 | 7 0.6 41 | 8 0.65 42 | 9 0.7 43 | 10 0.75 44 | 11 0.8 45 | 12 0.85 46 | 13 0.9 47 | 14 0.95 48 | 15 1.0 49 | 16 1.05 50 | 17 1.1 51 | 18 1.15 52 | 19 1.2 53 | 20 1.25 54 | 21 1.3 55 | ; 56 | 57 | param z := 58 | 1 1.561 59 | 2 1.473 60 | 3 1.391 61 | 4 1.313 62 | 5 1.239 63 | 6 1.169 64 | 7 1.103 65 | 8 1.04 66 | 9 0.981 67 | 10 0.925 68 | 11 0.8721 69 | 12 0.8221 70 | 13 0.7748 71 | 14 0.73 72 | 15 0.6877 73 | 16 0.6477 74 | 17 0.6099 75 | 18 0.5741 76 | 19 0.5403 77 | 20 0.5084 78 | 21 0.4782 79 | ; 80 | 81 | #solve; 82 | #display x; 83 | #display obj; 84 | 85 | write ghatflde; 86 | -------------------------------------------------------------------------------- /amplOF/op_type.hd: -------------------------------------------------------------------------------- 1 | 2 /* OPPLUS */, 2 | 2 /* OPMINUS */, 3 | 2 /* OPMULT */, 4 | 2 /* OPDIV */, 5 | 2 /* OPREM */, 6 | 2 /* OPPOW */, 7 | 2 /* OPLESS */, 8 | 0, 9 | 0, 10 | 0, 11 | 0, 12 | 3 /* MINLIST */, 13 | 3 /* MAXLIST */, 14 | 1 /* FLOOR */, 15 | 1 /* CEIL */, 16 | 1 /* ABS */, 17 | 1 /* OPUMINUS */, 18 | 0, 19 | 0, 20 | 0, 21 | 2 /* OPOR */, 22 | 2 /* OPAND */, 23 | 2 /* LT */, 24 | 2 /* LE */, 25 | 2 /* EQ */, 26 | 0, 27 | 0, 28 | 0, 29 | 2 /* GE */, 30 | 2 /* GT */, 31 | 2 /* NE */, 32 | 0, 33 | 0, 34 | 0, 35 | 1 /* OPNOT */, 36 | 5 /* OPIFnl */, 37 | 0, 38 | 1 /* OP_tanh */, 39 | 1 /* OP_tan */, 40 | 1 /* OP_sqrt */, 41 | 1 /* OP_sinh */, 42 | 1 /* OP_sin */, 43 | 1 /* OP_log10 */, 44 | 1 /* OP_log */, 45 | 1 /* OP_exp */, 46 | 1 /* OP_cosh */, 47 | 1 /* OP_cos */, 48 | 1 /* OP_atanh */, 49 | 2 /* OP_atan2 */, 50 | 1 /* OP_atan */, 51 | 1 /* OP_asinh */, 52 | 1 /* OP_asin */, 53 | 1 /* OP_acosh */, 54 | 1 /* OP_acos */, 55 | 6 /* OPSUMLIST */, 56 | 2 /* OPintDIV */, 57 | 2 /* OPprecision */, 58 | 2 /* OPround */, 59 | 2 /* OPtrunc */, 60 | 11 /* OPCOUNT */, 61 | 11 /* OPNUMBEROF */, 62 | 11 /* OPNUMBEROFs */, 63 | 2 /* OPATLEAST */, 64 | 2 /* OPATMOST */, 65 | 4 /* OPPLTERM */, 66 | 5 /* OPIFSYM */, 67 | 2 /* OPEXACTLY */, 68 | 2 /* OPNOTATLEAST */, 69 | 2 /* OPNOTATMOST */, 70 | 2 /* OPNOTEXACTLY */, 71 | 6 /* ANDLIST */, 72 | 6 /* ORLIST */, 73 | 5 /* OPIMPELSE */, 74 | 2 /* OP_IFF */, 75 | 11 /* OPALLDIFF */, 76 | 1 /* OP1POW */, 77 | 1 /* f_OP2POW */, 78 | 1 /* f_OPCPOW */, 79 | 7 /* OPFUNCALL */, 80 | 9 /* OPNUM */, 81 | 8 /* OPHOL */, 82 | 10 /* OPVARVAL */ 83 | -------------------------------------------------------------------------------- /xmlOF/testCondor/optimQ2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | x_0 x_1 6 | 7 | 8 | 9 | 10 | 11 | (x_1-2)^2+(x_0-2)^2 12 | 13 | 14 | 15 | 16 | 17 | 18 | 0 0 19 | 20 | 21 | 22 | 23 | 24 | -10 -10 25 | 26 | 27 | 28 | 29 | 10 10 30 | 31 | 32 | 33 | 34 | 35 | 36 | 41 | 42 | 44 | 47 | 48 | 49 | 50 | resultsQ2.txt 51 | 52 | 53 | 54 | 55 | 1 1 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/optimQ2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | x_0 x_1 6 | 7 | 8 | 9 | 10 | 11 | (x_1-2)^2+(x_0-2)^2 12 | 13 | 14 | 15 | 16 | 17 | 18 | 0 0 19 | 20 | 21 | 22 | 23 | 24 | -10 -10 25 | 26 | 27 | 28 | 29 | 10 10 30 | 31 | 32 | 33 | 34 | 35 | 36 | 41 | 42 | 44 | 47 | 48 | 49 | 50 | resultsQ2.txt 51 | 52 | 53 | 54 | 55 | 1 1 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /amplOF/examples/growthls.mod: -------------------------------------------------------------------------------- 1 | # 2 | #************************** 3 | # SET UP THE INITIAL DATA * 4 | #************************** 5 | # Problem : 6 | # ********* 7 | # GROWTH problem in 3 variables 8 | # Fit the observed growth g(n) from Gaussian Elimination 9 | # with complete pivoting to a function of the form 10 | # 11 | # U1 * n ** ( U2 + LOG(n) * U3 ) 12 | # SIF input: Nick Gould, Nov, 1991, modified by Ph. Toint, March 1994. 13 | # classification SUR2-AN-3-0 14 | # Solution 15 | param n := 3; 16 | 17 | var u1 := 100.0; 18 | var u2; 19 | var u3; 20 | 21 | minimize obj: 22 | (u1 * (8.0^(u2+(log(8.0))*u3)) - 8.0)*(u1 * (8.0^(u2+(log(8.0))*u3)) - 8.0) + 23 | (u1 * (9.0^(u2+(log(9.0))*u3)) - 8.4305)*(u1 * (9.0^(u2+(log(9.0))*u3)) - 24 | 8.4305) + (u1 * (10.0^(u2+(log(10.0))*u3)) - 9.5294)*(u1 * 25 | (10.0^(u2+(log(10.0))*u3)) - 9.5294) + (u1 * (11.0^(u2+(log(11.0))*u3)) - 26 | 10.4627)*(u1 * (11.0^(u2+(log(11.0))*u3)) - 10.4627) + (u1 * 27 | (12.0^(u2+(log(12.0))*u3)) - 12.0)*(u1 * (12.0^(u2+(log(12.0))*u3)) - 12.0) + 28 | (u1 * (13.0^(u2+(log(13.0))*u3)) - 13.0205)*(u1 * (13.0^(u2+(log(13.0))*u3)) - 29 | 13.0205) + (u1 * (14.0^(u2+(log(14.0))*u3)) - 14.5949)*(u1 * 30 | (14.0^(u2+(log(14.0))*u3)) - 14.5949) + (u1 * (15.0^(u2+(log(15.0))*u3)) - 31 | 16.1078)*(u1 * (15.0^(u2+(log(15.0))*u3)) - 16.1078) + (u1 * 32 | (16.0^(u2+(log(16.0))*u3)) - 18.0596)*(u1 * (16.0^(u2+(log(16.0))*u3)) - 33 | 18.0596) + (u1 * (18.0^(u2+(log(18.0))*u3)) - 20.4569)*(u1 * 34 | (18.0^(u2+(log(18.0))*u3)) - 20.4569) + (u1 * (20.0^(u2+(log(20.0))*u3)) - 35 | 24.25)*(u1 * (20.0^(u2+(log(20.0))*u3)) - 24.25) + (u1 * 36 | (25.0^(u2+(log(25.0))*u3)) - 32.9863)*(u1 * (25.0^(u2+(log(25.0))*u3)) - 37 | 32.9863); 38 | 39 | 40 | #solve; 41 | #display u1; 42 | #display u2; 43 | #display u3; 44 | #display obj; 45 | 46 | write ggrowthls; 47 | -------------------------------------------------------------------------------- /common/parallel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "Vector.h" 31 | #include "IntPoly.h" 32 | #include "tools.h" 33 | #include "ObjectiveFunction.h" 34 | 35 | 36 | void parallelImprove(InterPolynomial *p, int *_k, double _rho, double *_valueFk, Vector _Base) 37 | {} 38 | 39 | void startParallelThread(){} 40 | void parallelInit(int _nnode, int _dim, ObjectiveFunction *_of){} 41 | void parallelFinish(){} 42 | 43 | int calculateNParallelJob(int n,double *vf,Vector *cp, ObjectiveFunction *of, int *notsuccess) 44 | { 45 | int i,r,nsuccess=0; 46 | for (i=0; ieval(cp[i],&r); 50 | notsuccess[i]=r; 51 | if (!r) nsuccess++; 52 | } 53 | return nsuccess; 54 | 55 | } 56 | 57 | -------------------------------------------------------------------------------- /sifOF/examples/cliff.sif: -------------------------------------------------------------------------------- 1 | *************************** 2 | * SET UP THE INITIAL DATA * 3 | *************************** 4 | 5 | NAME CLIFF 6 | 7 | * Problem : 8 | * ********* 9 | 10 | * The "cliff problem" in 2 variables 11 | 12 | * Source: problem 206 (p. 46) in 13 | * A.R. Buckley, 14 | * "Test functions for unconstrained minimization", 15 | * TR 1989CS-3, Mathematics, statistics and computing centre, 16 | * Dalhousie University, Halifax (CDN), 1989. 17 | 18 | * SIF input: Ph. Toint, Dec 1989. 19 | 20 | * classification OUR2-AN-2-0 21 | 22 | VARIABLES 23 | 24 | X1 25 | X2 26 | 27 | GROUPS 28 | 29 | N G1 X1 0.01 30 | N G2 X1 -1.0 X2 1.0 31 | N G3 X1 1.0 X2 -1.0 32 | 33 | CONSTANTS 34 | 35 | CLIFF G1 0.03 36 | 37 | BOUNDS 38 | 39 | FR CLIFF 'DEFAULT' 40 | 41 | START POINT 42 | 43 | CLIFF X1 0.0 44 | CLIFF X2 -1.0 45 | 46 | GROUP TYPE 47 | 48 | GV L2 GVAR 49 | GV 20EXP GVAR 50 | 51 | GROUP USES 52 | 53 | T G1 L2 54 | T G3 20EXP 55 | 56 | OBJECT BOUND 57 | 58 | LO CLIFF 0.0 59 | 60 | * Solution 61 | 62 | LO SOLTN 0.199786613 63 | 64 | ENDATA 65 | 66 | ********************* 67 | * SET UP THE GROUPS * 68 | * ROUTINE * 69 | ********************* 70 | 71 | GROUPS CLIFF 72 | 73 | TEMPORARIES 74 | 75 | R EXPA 76 | M EXP 77 | 78 | INDIVIDUALS 79 | 80 | T L2 81 | F GVAR * GVAR 82 | G GVAR + GVAR 83 | H 2.0 84 | 85 | T 20EXP 86 | A EXPA EXP( 20.0 * GVAR ) 87 | F EXPA 88 | G 20.0 * EXPA 89 | H 400.0 * EXPA 90 | 91 | ENDATA 92 | -------------------------------------------------------------------------------- /amplOF/examples/hs268.mod: -------------------------------------------------------------------------------- 1 | # AMPL Model by Hande Y. Benson 2 | # 3 | # Copyright (C) 2001 Princeton University 4 | # All Rights Reserved 5 | # 6 | # Permission to use, copy, modify, and distribute this software and 7 | # its documentation for any purpose and without fee is hereby 8 | # granted, provided that the above copyright notice appear in all 9 | # copies and that the copyright notice and this 10 | # permission notice appear in all supporting documentation. 11 | 12 | # Source: 13 | # K. Schittkowski 14 | # "More Test Examples for Nonlinear Programming Codes" 15 | # Springer Verlag, Berlin, Lecture notes in economics and 16 | # mathematical systems, volume 282, 1987 17 | 18 | # SIF input: Michel Bierlaire and Annick Sartenaer, October 1992. 19 | # minor correction by Ph. Shott, Jan 1995. 20 | 21 | # classification QLR2-AN-5-5 22 | 23 | param D{1..5, 1..5}; 24 | param B{1..5}; 25 | var x{1..5} := 1.0; 26 | 27 | minimize f: 28 | 14463.0 + sum {i in 1..5, j in 1..5} D[i,j]*x[i]*x[j] 29 | + -2*sum {i in 1..5} (B[i]*x[i]); 30 | subject to cons1: 31 | -sum {i in 1..5} x[i] + 5>= 0; 32 | subject to cons2: 33 | 10*x[1]+10*x[2]-3*x[3]+5*x[4]+4*x[5] -20 >= 0; 34 | subject to cons3: 35 | -8*x[1]+x[2]-2*x[3]-5*x[4]+3*x[5] + 40 >= 0; 36 | subject to cons4: 37 | 8*x[1]-x[2]+2*x[3]+5*x[4]-3*x[5] -11>= 0; 38 | subject to cons5: 39 | -4*x[1]-2*x[2]+3*x[3]-5*x[4]+x[5] +30>= 0; 40 | 41 | data; 42 | param B:= 43 | 1 -9170 44 | 2 17099 45 | 3 -2271 46 | 4 -4336 47 | 5 -43; 48 | param D: 49 | 1 2 3 4 5:= 50 | 1 10197 -12454 -1013 1948 329 51 | 2 -12454 20909 -1733 -4914 -186 52 | 3 -1013 -1733 1755 1089 -174 53 | 4 1948 -4914 1089 1515 -22 54 | 5 329 -186 -174 -22 27; 55 | 56 | # 57 | # optimal solution: 58 | # x1= 1 59 | # x2= 2 60 | # x3= -1 61 | # x4= 3 62 | # x5= -4 63 | # 64 | 65 | #solve; display f; display x; 66 | 67 | write ghs268; 68 | -------------------------------------------------------------------------------- /xmlOF/dbtool/DBToolMain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | // for sleep: 27 | #ifdef WIN32 28 | #include 29 | #else 30 | #include 31 | #endif 32 | 33 | #include 34 | #include 35 | #include "../../common/tools.h" 36 | #include "../XMLof.h" 37 | 38 | #ifdef WIN32 39 | #ifdef _DEBUG 40 | #include 41 | #endif 42 | #endif 43 | 44 | int main(int argc, char **argv) 45 | { 46 | XMLof *of; 47 | CorrectScaleOF *ofc; 48 | 49 | double fake; 50 | if (argc>1) of=new XMLof(30,argv[1],&fake); 51 | else of=new XMLof(30,"optim.cfg",&fake); 52 | 53 | if (of->scalingFactorIsGiven) ofc=new CorrectScaleOF(31,of, of->vScale); 54 | else ofc=new CorrectScaleOF(31,of); 55 | 56 | ofc->rescaling.set(1.0); 57 | 58 | of->DBTool(ofc->rescaling); 59 | 60 | delete of; 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /amplOF/examples/hs106.mod: -------------------------------------------------------------------------------- 1 | # hs106.mod LQR2-MN-8-22 2 | # Original AMPL coding by Elena Bobrovnikova (summer 1996 at Bell Labs). 3 | 4 | # Heat exchanger design 5 | 6 | # Ref.: W. Hock and K. Schittkowski, Test Examples for Nonlinear Programming 7 | # Codes. Lecture Notes in Economics and Mathematical Systems, v. 187, 8 | # Springer-Verlag, New York, 1981, p. 115. 9 | 10 | # Number of variables: 8 11 | # Number of constraints: 22 12 | # Objective linear 13 | # Nonlinear constraints 14 | 15 | param N integer, := 8; 16 | set I := 1..N; 17 | 18 | param a >= 0; 19 | param b >= 0; 20 | param c >= 0; 21 | param d >= 0; 22 | param e >= 0; 23 | param f >= 0; 24 | param g >= 0; 25 | param h >= 0; 26 | 27 | var x{I}; 28 | 29 | minimize obj: 30 | x[1] + x[2] + x[3]; 31 | 32 | s.t. c1: 1 - a * (x[4] + x[6]) >= 0; 33 | s.t. c2: 1 - a * (x[5] + x[7] - x[4]) >= 0; 34 | s.t. c3: 1 - b * (x[8] - x[5]) >= 0; 35 | s.t. c4: x[1] * x[6] - c * x[4] - d * x[1] + e >= 0; 36 | s.t. c5: x[2] * x[7] - f * x[5] - x[2] * x[4] + f * x[4] >= 0; 37 | s.t. c6: x[3] * x[8] - g - x[3] * x[5] + h * x[5] >= 0; 38 | s.t. c7: 100 <= x[1] <= 10000; 39 | s.t. c8 {i in {2,3}}: 1000 <= x[i] <= 10000; 40 | s.t. c9 {i in 4..8}: 10 <= x[i] <= 1000; 41 | 42 | 43 | data; 44 | param a := 0.0025; 45 | param b := 0.01; 46 | param c := 833.3325; 47 | param d := 100; 48 | param e := 83333.33; 49 | param f := 1250; 50 | param g := 1250000; 51 | param h := 2500; 52 | 53 | var x := 54 | 1 5000 2 5000 3 5000 4 200 5 350 6 150 7 225 8 425; 55 | 56 | #printf "optimal solution as starting point \n"; 57 | #var x := 58 | # 1 579.3167 59 | # 2 1359.943 60 | # 3 5110.071 61 | # 4 182.0174 62 | # 5 295.5985 63 | # 6 217.9799 64 | # 7 286.4162 65 | # 8 395.5979 66 | # ; 67 | 68 | #display obj; 69 | #solve; 70 | #display x; 71 | #display obj; 72 | #display obj - 7049.330923; 73 | 74 | write ghs106; 75 | -------------------------------------------------------------------------------- /amplOF/errchk.h: -------------------------------------------------------------------------------- 1 | /**************************************************************** 2 | Copyright (C) 1998 Lucent Technologies 3 | All Rights Reserved 4 | 5 | Permission to use, copy, modify, and distribute this software and 6 | its documentation for any purpose and without fee is hereby 7 | granted, provided that the above copyright notice appear in all 8 | copies and that both that the copyright notice and this 9 | permission notice and warranty disclaimer appear in supporting 10 | documentation, and that the name of Lucent or any of its entities 11 | not be used in advertising or publicity pertaining to 12 | distribution of the software without specific, written prior 13 | permission. 14 | 15 | LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 16 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 17 | IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 18 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 20 | IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 21 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 22 | THIS SOFTWARE. 23 | ****************************************************************/ 24 | 25 | #ifdef NO_ERRNO 26 | #define errno_set(x) /*nothing*/ 27 | #define ErrnoChk /* nothing */ 28 | #else 29 | #define errno_set(x) errno = x 30 | #define ErrnoChk errno || 31 | #endif 32 | 33 | #ifdef NANCHECK 34 | #ifdef IEEE_MC68k 35 | #define errchk(x) ErrnoChk ((((Long *)&(x))[0] & 0x7ff00000L) == 0x7ff00000L)\ 36 | && (((Long *)&(x))[1] || ((Long *)&(x))[0] & 0xfffffL) 37 | #else 38 | #ifdef IEEE_8087 39 | #define errchk(x) ErrnoChk ((((Long *)&(x))[1] & 0x7ff00000L) == 0x7ff00000L)\ 40 | && (((Long *)&(x))[0] || ((Long *)&(x))[1] & 0xfffffL) 41 | #else 42 | !!!! Cannot use -DNANCHECK on non-IEEE machines 43 | #endif 44 | #endif 45 | #else 46 | #define errchk(x) errno 47 | #endif 48 | 49 | #ifdef KR_headers 50 | extern char *strerror(); 51 | #endif 52 | -------------------------------------------------------------------------------- /amplOF/examples/dqdrtic.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem dqdrtic 2 | 10 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 10 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 10 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 24 14 | o2 15 | n100 16 | o5 17 | v1 18 | n2 19 | o2 20 | n100 21 | o5 22 | v2 23 | n2 24 | o5 25 | v0 26 | n2 27 | o2 28 | n100 29 | o5 30 | v2 31 | n2 32 | o2 33 | n100 34 | o5 35 | v3 36 | n2 37 | o5 38 | v1 39 | n2 40 | o2 41 | n100 42 | o5 43 | v3 44 | n2 45 | o2 46 | n100 47 | o5 48 | v4 49 | n2 50 | o5 51 | v2 52 | n2 53 | o2 54 | n100 55 | o5 56 | v4 57 | n2 58 | o2 59 | n100 60 | o5 61 | v5 62 | n2 63 | o5 64 | v3 65 | n2 66 | o2 67 | n100 68 | o5 69 | v5 70 | n2 71 | o2 72 | n100 73 | o5 74 | v6 75 | n2 76 | o5 77 | v4 78 | n2 79 | o2 80 | n100 81 | o5 82 | v6 83 | n2 84 | o2 85 | n100 86 | o5 87 | v7 88 | n2 89 | o5 90 | v5 91 | n2 92 | o2 93 | n100 94 | o5 95 | v7 96 | n2 97 | o2 98 | n100 99 | o5 100 | v8 101 | n2 102 | o5 103 | v6 104 | n2 105 | o2 106 | n100 107 | o5 108 | v8 109 | n2 110 | o2 111 | n100 112 | o5 113 | v9 114 | n2 115 | o5 116 | v7 117 | n2 118 | x10 119 | 0 3 120 | 1 3 121 | 2 3 122 | 3 3 123 | 4 3 124 | 5 3 125 | 6 3 126 | 7 3 127 | 8 3 128 | 9 3 129 | b 130 | 3 131 | 3 132 | 3 133 | 3 134 | 3 135 | 3 136 | 3 137 | 3 138 | 3 139 | 3 140 | k9 141 | 0 142 | 0 143 | 0 144 | 0 145 | 0 146 | 0 147 | 0 148 | 0 149 | 0 150 | G0 10 151 | 0 0 152 | 1 0 153 | 2 0 154 | 3 0 155 | 4 0 156 | 5 0 157 | 6 0 158 | 7 0 159 | 8 0 160 | 9 0 161 | -------------------------------------------------------------------------------- /common/Solver.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | 27 | #ifndef _INCLUDE_SOLVER_H 28 | #define _INCLUDE_SOLVER_H 29 | 30 | #include "IntPoly.h" 31 | #include "Vector.h" 32 | 33 | Vector L2NormMinimizer(Polynomial q, double delta, 34 | int *infoOut=NULL, int maxIter=1000, double *lambda1=NULL); 35 | Vector L2NormMinimizer(Polynomial q, Vector pointXk, double delta, 36 | int *infoOut=NULL, int maxIter=1000, double *lambda1=NULL); 37 | Vector L2NormMinimizer(Polynomial q, Vector pointXk, double delta, 38 | int *infoOut, int maxIter, double *lambda1, Vector minusG, Matrix H); 39 | 40 | Vector LAGMAXModified(Polynomial q, double rho,double &VMAX); 41 | Vector LAGMAXModified(Polynomial q, Vector pointXk, double rho,double &VMAX); 42 | Vector LAGMAXModified(Vector G, Matrix H, double rho,double &VMAX); 43 | 44 | void CONDOR(double rhoStart, double rhoEnd, int niter, 45 | ObjectiveFunction *of, int nnode=0); 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /sifOF/examples/parkch.d: -------------------------------------------------------------------------------- 1 | 15 1 1 1 15 0 0 0 1 0 2 | 3PARKCH 0 3 | 1 2 4 | 1 1 5 | 1 1 6 | 1 16 7 | 1 1 8 | 0 9 | 1 10 | 1 11 | 15 12 | 1 13 | 1 2 3 4 5 6 7 8 9 10 14 | 11 12 13 14 15 15 | 16 | 17 | 0.00000000E+00 18 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 19 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 20 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 21 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 0.00000000E+00 22 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 23 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 24 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 25 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 0.00000000E+00 26 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 27 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 28 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 29 | 0.00000000E+00 0.00000000E+00 1.00000000E+00 30 | 0.00000000E+00 31 | 32 | 33 | -1.00000000E+00 34 | 1.00000000E+00 35 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 36 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 37 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 38 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 39 | -1.00000000E+20 1.00000000E+20 40 | F 41 | T 42 | LIKE 43 | BET1 BET2 BET3 BET4 BET5 BET6 BET7 BET8 44 | BET9 BET10 BET11 BET12 BET13 BET14 THE1 45 | LIKE 46 | 47 | 0 0 0 0 0 0 0 0 0 0 48 | 0 0 0 0 0 49 | PARKCH 15 0 0 0 0 0 0 1 0 0 0 0 50 | -------------------------------------------------------------------------------- /MathEval/test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "matheval.h" 6 | /* Size of input buffer. */ 7 | #define BUFFER_SIZE 256 8 | /* Program is demonstrating use of GNU libmatheval library of procedures 9 | for evaluating mathematical functions. */ 10 | int main (int argc, char **argv) 11 | { 12 | char buffer[BUFFER_SIZE]; /* Input buffer. */ 13 | int length; /* Length of above buffer. */ 14 | void *f, *f_prim; /* Evaluators for function and function derivative. */ 15 | char *string; /* Textual representation of function derivative. */ 16 | double x; /* Variable x value. */ 17 | /* Read function. Function has to be over variable x, or result may 18 | be undetermined. Size of textual represenatation of function is 19 | bounded here to 256 characters, in real conditions one should 20 | probably use GNU readline() instead of fgets() to overcome this 21 | limit. */ 22 | printf ("f(x) = "); 23 | fgets (buffer, BUFFER_SIZE, stdin); 24 | length = (int)strlen (buffer); 25 | if (length > 0 && buffer[length - 1] == '\n') 26 | buffer[length - 1] = '\0'; 27 | /* Create evaluator for function. */ 28 | f = evaluator_create (buffer); 29 | assert (f); 30 | /* Create evaluator for function derivative and print textual 31 | representation of derivative. */ 32 | f_prim = evaluator_derivative_x (f); 33 | string = 34 | (char *) malloc ((evaluator_calculate_length (f_prim) + 1) * 35 | sizeof (char)); 36 | evaluator_write (f_prim, string); 37 | printf (" f'(x) = %s\n", string); 38 | free (string); 39 | /* Read variable x value. */ 40 | printf ("x = "); 41 | //Chapter 1: Introduction 5 42 | scanf ("%lf", &x); 43 | /* Calculate and print values of function and its derivative for given 44 | value of x. */ 45 | 46 | char *names[] = { "x_1" }; 47 | 48 | 49 | printf (" f(%g) = %g\n", x, evaluator_evaluate (f, 1,names, &x)); //evaluator_evaluate_x (f, x)); 50 | printf (" f'(%g) = %g\n", x, evaluator_evaluate_x (f_prim, x)); 51 | /* Destroy evaluators. */ 52 | evaluator_destroy (f); 53 | evaluator_destroy (f_prim); 54 | exit (EXIT_SUCCESS); 55 | } -------------------------------------------------------------------------------- /amplOF/examples/hs100.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem hs100 2 | 7 4 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 4 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 5 7 5 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 19 7 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | o54 13 | 3 14 | o2 15 | n2 16 | o5 17 | v0 18 | n2 19 | o2 20 | n3 21 | o5 22 | v1 23 | n4 24 | o2 25 | n4 26 | o5 27 | v3 28 | n2 29 | C1 30 | o2 31 | n10 32 | o5 33 | v2 34 | n2 35 | C2 36 | o0 37 | o5 38 | v1 39 | n2 40 | o2 41 | n6 42 | o5 43 | v4 44 | n2 45 | C3 46 | o54 47 | 4 48 | o2 49 | n-4 50 | o5 51 | v0 52 | n2 53 | o16 54 | o5 55 | v1 56 | n2 57 | o2 58 | o2 59 | n3 60 | v0 61 | v1 62 | o2 63 | n-2 64 | o5 65 | v2 66 | n2 67 | O0 0 68 | o54 69 | 8 70 | o5 71 | o0 72 | n-10 73 | v0 74 | n2 75 | o2 76 | n5 77 | o5 78 | o0 79 | n-12 80 | v1 81 | n2 82 | o5 83 | v2 84 | n4 85 | o2 86 | n3 87 | o5 88 | o0 89 | n-11 90 | v3 91 | n2 92 | o2 93 | n10 94 | o5 95 | v5 96 | n6 97 | o2 98 | n7 99 | o5 100 | v4 101 | n2 102 | o5 103 | v6 104 | n4 105 | o16 106 | o2 107 | o2 108 | n4 109 | v4 110 | v6 111 | x7 112 | 0 1 113 | 1 2 114 | 2 0 115 | 3 4 116 | 4 1 117 | 5 0 118 | 6 1 119 | r 120 | 1 127 121 | 1 282 122 | 1 196 123 | 2 0 124 | b 125 | 3 126 | 3 127 | 3 128 | 3 129 | 3 130 | 3 131 | 3 132 | k6 133 | 4 134 | 8 135 | 11 136 | 13 137 | 15 138 | 17 139 | J0 5 140 | 0 0 141 | 1 0 142 | 2 1 143 | 3 0 144 | 5 5 145 | J1 5 146 | 0 7 147 | 1 3 148 | 2 0 149 | 3 1 150 | 5 -1 151 | J2 4 152 | 0 23 153 | 1 0 154 | 4 0 155 | 6 -8 156 | J3 5 157 | 0 0 158 | 1 0 159 | 2 0 160 | 4 -5 161 | 6 11 162 | G0 7 163 | 0 0 164 | 1 0 165 | 2 0 166 | 3 0 167 | 4 -10 168 | 5 0 169 | 6 -8 170 | -------------------------------------------------------------------------------- /sifOF/examples/power.d: -------------------------------------------------------------------------------- 1 | 10 1 10 10 10 0 0 0 1 1 2 | 3POWER 0 3 | 1 11 4 | 1 1 5 | 1 1 6 | 1 2 3 4 5 6 7 8 9 10 7 | 11 8 | 1 1 1 1 1 1 1 1 1 1 9 | 1 10 | 1 11 | 1 12 | 1 1 1 1 1 1 1 1 1 1 13 | 1 1 1 1 1 1 1 1 1 1 14 | 1 2 3 4 5 6 7 8 9 10 15 | 1 2 3 4 5 6 7 8 9 10 16 | 17 | 18 | 0.00000000E+00 19 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 20 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 21 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 22 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 23 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 24 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 25 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 26 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 27 | 1.00000000E+00 1.00000000E+00 28 | 0.00000000E+00 29 | 30 | 31 | 1.00000000E+00 2.00000000E+00 3.00000000E+00 4.00000000E+00 32 | 5.00000000E+00 6.00000000E+00 7.00000000E+00 8.00000000E+00 33 | 9.00000000E+00 1.00000000E+01 34 | 1.00000000E+00 35 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 36 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 37 | 1.00000000E+00 1.00000000E+00 38 | 0.00000000E+00 1.61792382+308 39 | FFFFFFFFFF 40 | F 41 | G 42 | X1 X2 X3 X4 X5 X6 X7 X8 43 | X9 X10 44 | SQ 45 | L2 46 | 0 0 0 0 0 0 0 0 0 0 47 | POWER 10 0 0 0 0 0 0 1 0 0 0 0 48 | -------------------------------------------------------------------------------- /common/KeepBests.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | 27 | #ifndef __INCLUDE_KEEPBEST__ 28 | #define __INCLUDE_KEEPBEST__ 29 | 30 | #define INF 1.7E+308 31 | 32 | typedef struct cell_tag 33 | { 34 | double K; 35 | double value; 36 | double *optValue; 37 | struct cell_tag *prev; 38 | } cell; 39 | 40 | class KeepBests 41 | { 42 | public: 43 | KeepBests(int n); 44 | KeepBests(int n, int optionalN); 45 | void setOptionalN(int optinalN); 46 | ~KeepBests(); 47 | void reset(); 48 | void add(double key, double value); 49 | void add(double key, double value, double optionalValue); 50 | void add(double key, double value, double *optionalValue); 51 | void add(double key, double value, double *optionalValue, int nn); 52 | double getKey(int i); 53 | double getValue(int i); 54 | double getOptValue(int i, int n); 55 | double* getOptValue(int i); 56 | int sz() {return n;}; 57 | private: 58 | void init(); 59 | cell *ctable,*end,*_local_getOptValueC; 60 | int n,optionalN,_local_getOptValueI; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /sifOF/examples/ROSENBROCK.SIF: -------------------------------------------------------------------------------- 1 | *************************** 2 | * SET UP THE INITIAL DATA * 3 | *************************** 4 | 5 | NAME ROSENBR 6 | 7 | * Problem : 8 | * ********* 9 | 10 | * The ever famous 2 variables Rosenbrock "banana valley" problem 11 | 12 | * Source: problem 1 in 13 | * J.J. More', B.S. Garbow and K.E. Hillstrom, 14 | * "Testing Unconstrained Optimization Software", 15 | * ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981. 16 | 17 | * SIF input: Ph. Toint, Dec 1989, Corrected July 1993. 18 | 19 | * classification SUR2-AN-2-0 20 | 21 | VARIABLES 22 | 23 | X1 24 | X2 25 | 26 | GROUPS 27 | 28 | N G1 X2 1.0 29 | N G1 'SCALE' 0.01 30 | N G2 X1 1.0 31 | 32 | CONSTANTS 33 | 34 | ROSENBR G2 1.0 35 | 36 | BOUNDS 37 | 38 | FR ROSENBR 'DEFAULT' 39 | 40 | START POINT 41 | 42 | ROSENBR X1 -1.2 43 | ROSENBR X2 1.0 44 | 45 | ELEMENT TYPE 46 | 47 | EV SQ V1 48 | 49 | ELEMENT USES 50 | 51 | T E1 SQ 52 | V E1 V1 X1 53 | 54 | GROUP TYPE 55 | 56 | GV L2 GVAR 57 | 58 | GROUP USES 59 | 60 | T 'DEFAULT' L2 61 | XE G1 E1 -1.0 62 | 63 | OBJECT BOUND 64 | 65 | LO ROSENBR 0.0 66 | 67 | * Solution 68 | 69 | *LO SOLTN 0.0 70 | 71 | ENDATA 72 | 73 | *********************** 74 | * SET UP THE FUNCTION * 75 | * AND RANGE ROUTINES * 76 | *********************** 77 | 78 | ELEMENTS ROSENBR 79 | 80 | INDIVIDUALS 81 | 82 | T SQ 83 | F V1 * V1 84 | G V1 V1 + V1 85 | H V1 V1 2.0 86 | 87 | ENDATA 88 | 89 | ********************* 90 | * SET UP THE GROUPS * 91 | * ROUTINE * 92 | ********************* 93 | 94 | GROUPS ROSENBR 95 | 96 | INDIVIDUALS 97 | 98 | T L2 99 | F GVAR * GVAR 100 | G GVAR + GVAR 101 | H 2.0 102 | 103 | ENDATA 104 | -------------------------------------------------------------------------------- /amplOF/examples/cragglvy.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem cragglvy 2 | 10 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 10 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 10 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 20 14 | o5 15 | o1 16 | o44 17 | v0 18 | v1 19 | n4 20 | o2 21 | n100 22 | o5 23 | o1 24 | v1 25 | v2 26 | n6 27 | o5 28 | o1 29 | o0 30 | o38 31 | o1 32 | v2 33 | v3 34 | v2 35 | v3 36 | n4 37 | o5 38 | v0 39 | n8 40 | o5 41 | o0 42 | n-1 43 | v3 44 | n2 45 | o5 46 | o1 47 | o44 48 | v2 49 | v3 50 | n4 51 | o2 52 | n100 53 | o5 54 | o1 55 | v3 56 | v4 57 | n6 58 | o5 59 | o1 60 | o0 61 | o38 62 | o1 63 | v4 64 | v5 65 | v4 66 | v5 67 | n4 68 | o5 69 | v2 70 | n8 71 | o5 72 | o0 73 | n-1 74 | v5 75 | n2 76 | o5 77 | o1 78 | o44 79 | v4 80 | v5 81 | n4 82 | o2 83 | n100 84 | o5 85 | o1 86 | v5 87 | v6 88 | n6 89 | o5 90 | o1 91 | o0 92 | o38 93 | o1 94 | v6 95 | v7 96 | v6 97 | v7 98 | n4 99 | o5 100 | v4 101 | n8 102 | o5 103 | o0 104 | n-1 105 | v7 106 | n2 107 | o5 108 | o1 109 | o44 110 | v6 111 | v7 112 | n4 113 | o2 114 | n100 115 | o5 116 | o1 117 | v7 118 | v8 119 | n6 120 | o5 121 | o1 122 | o0 123 | o38 124 | o1 125 | v8 126 | v9 127 | v8 128 | v9 129 | n4 130 | o5 131 | v6 132 | n8 133 | o5 134 | o0 135 | n-1 136 | v9 137 | n2 138 | x10 139 | 0 1 140 | 1 2 141 | 2 2 142 | 3 2 143 | 4 2 144 | 5 2 145 | 6 2 146 | 7 2 147 | 8 2 148 | 9 2 149 | b 150 | 3 151 | 3 152 | 3 153 | 3 154 | 3 155 | 3 156 | 3 157 | 3 158 | 3 159 | 3 160 | k9 161 | 0 162 | 0 163 | 0 164 | 0 165 | 0 166 | 0 167 | 0 168 | 0 169 | 0 170 | G0 10 171 | 0 0 172 | 1 0 173 | 2 0 174 | 3 0 175 | 4 0 176 | 5 0 177 | 6 0 178 | 7 0 179 | 8 0 180 | 9 0 181 | -------------------------------------------------------------------------------- /amplOF/examples/vardim.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem vardim 2 | 10 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 10 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 10 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 12 14 | o5 15 | o0 16 | n-1 17 | v0 18 | n2 19 | o5 20 | o0 21 | n-1 22 | v1 23 | n2 24 | o5 25 | o0 26 | n-1 27 | v2 28 | n2 29 | o5 30 | o0 31 | n-1 32 | v3 33 | n2 34 | o5 35 | o0 36 | n-1 37 | v4 38 | n2 39 | o5 40 | o0 41 | n-1 42 | v5 43 | n2 44 | o5 45 | o0 46 | n-1 47 | v6 48 | n2 49 | o5 50 | o0 51 | n-1 52 | v7 53 | n2 54 | o5 55 | o0 56 | n-1 57 | v8 58 | n2 59 | o5 60 | o0 61 | n-1 62 | v9 63 | n2 64 | o5 65 | o0 66 | n-55 67 | o54 68 | 10 69 | v0 70 | o2 71 | n2 72 | v1 73 | o2 74 | n3 75 | v2 76 | o2 77 | n4 78 | v3 79 | o2 80 | n5 81 | v4 82 | o2 83 | n6 84 | v5 85 | o2 86 | n7 87 | v6 88 | o2 89 | n8 90 | v7 91 | o2 92 | n9 93 | v8 94 | o2 95 | n10 96 | v9 97 | n2 98 | o5 99 | o0 100 | n-55 101 | o54 102 | 10 103 | v0 104 | o2 105 | n2 106 | v1 107 | o2 108 | n3 109 | v2 110 | o2 111 | n4 112 | v3 113 | o2 114 | n5 115 | v4 116 | o2 117 | n6 118 | v5 119 | o2 120 | n7 121 | v6 122 | o2 123 | n8 124 | v7 125 | o2 126 | n9 127 | v8 128 | o2 129 | n10 130 | v9 131 | n4 132 | x10 133 | 0 0.9 134 | 1 0.8 135 | 2 0.7 136 | 3 0.6 137 | 4 0.5 138 | 5 0.4 139 | 6 0.30000000000000004 140 | 7 0.19999999999999996 141 | 8 0.09999999999999998 142 | 9 0 143 | b 144 | 3 145 | 3 146 | 3 147 | 3 148 | 3 149 | 3 150 | 3 151 | 3 152 | 3 153 | 3 154 | k9 155 | 0 156 | 0 157 | 0 158 | 0 159 | 0 160 | 0 161 | 0 162 | 0 163 | 0 164 | G0 10 165 | 0 0 166 | 1 0 167 | 2 0 168 | 3 0 169 | 4 0 170 | 5 0 171 | 6 0 172 | 7 0 173 | 8 0 174 | 9 0 175 | -------------------------------------------------------------------------------- /MathEval/MathEvalClass.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "MathEvalClass.h" 6 | #include "lib/matheval.h" 7 | #include "../common/tools.h" 8 | 9 | #ifdef WIN32 10 | #include // for isnan and isfinite 11 | #else 12 | #include // for isnan and isfinite 13 | static int _isnan (double d) { return isnan(d); } 14 | static int _finite(double d) { return isfinite(d); } 15 | #endif 16 | 17 | // #include 18 | MathEvalClass::~MathEvalClass() 19 | { 20 | evaluator_destroy(aggrFunct); 21 | if (gradFunct) 22 | { 23 | int i; 24 | for (i=0; i 21 | #include 22 | 23 | #if HAVE_CONFIG_H 24 | #include "config.h" 25 | #endif 26 | 27 | #include "common.h" 28 | #include "error.h" 29 | 30 | #if !HAVE_BZERO && HAVE_MEMSET 31 | #define bzero(buf, bytes) ((void) memset (buf, 0, bytes)) 32 | #endif 33 | 34 | void * 35 | xmalloc(size_t num) 36 | { 37 | /* 38 | * Call malloc() and check return value. 39 | */ 40 | void *ptr_new = malloc(num); 41 | 42 | if (!ptr_new) 43 | error_fatal("unable to allocate memory"); 44 | return ptr_new; 45 | } 46 | 47 | void * 48 | xrealloc(void *ptr, size_t num) 49 | { 50 | void *ptr_new; 51 | 52 | /* 53 | * If memory not already allocated, fall back to xmalloc(). 54 | */ 55 | if (!ptr) 56 | return xmalloc(num); 57 | 58 | /* 59 | * Otherwise, call realloc() and check return value. 60 | */ 61 | ptr_new = realloc(ptr, num); 62 | if (!ptr_new) 63 | error_fatal("unable to allocate memory"); 64 | 65 | return ptr_new; 66 | } 67 | 68 | void * 69 | xcalloc(size_t num, size_t size) 70 | { 71 | /* 72 | * Allocate memory and fill with zeroes. 73 | */ 74 | void *ptr_new = xmalloc(num * size); 75 | 76 | bzero(ptr_new, num * size); 77 | return ptr_new; 78 | } 79 | -------------------------------------------------------------------------------- /MathEval/lib/error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU libmatheval 5 | * 6 | * GNU libmatheval is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 2, or (at your option) any later 9 | * version. 10 | * 11 | * GNU libmatheval is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * program; see the file COPYING. If not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | #include 21 | 22 | #if HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #include "common.h" 27 | #include "error.h" 28 | 29 | const char lib_name[] = "libmatheval"; /* Library name to be printed 30 | * to standard error stream 31 | * in order to locate problem 32 | * source. */ 33 | 34 | /* 35 | * Issue error message to standard error stream and, if status value not less 36 | * than zero, terminate calling program. Argument mode is intended to 37 | * describe error severity. 38 | */ 39 | static void error_issue(int status, const char *mode, const char *message); 40 | 41 | void 42 | error_warning(const char *message) 43 | { 44 | /* 45 | * Issue warning. 46 | */ 47 | error_issue(-1, "warning", message); 48 | } 49 | 50 | void 51 | error_fatal(const char *message) 52 | { 53 | /* 54 | * Issue error. 55 | */ 56 | error_issue(EXIT_FAILURE, "FATAL", message); 57 | } 58 | 59 | static void 60 | error_issue(int status, const char *mode, const char *message) 61 | { 62 | /* 63 | * Print error message. 64 | */ 65 | fprintf(stderr, "%s: %s: %s\n", lib_name, mode, message); 66 | 67 | /* 68 | * Check status and eventually terminate calling program. 69 | */ 70 | if (status >= 0) 71 | exit(status); 72 | } 73 | -------------------------------------------------------------------------------- /amplOF/jac2dim.h: -------------------------------------------------------------------------------- 1 | /**************************************************************** 2 | Copyright (C) 1997, 2000-2001 Lucent Technologies 3 | All Rights Reserved 4 | 5 | Permission to use, copy, modify, and distribute this software and 6 | its documentation for any purpose and without fee is hereby 7 | granted, provided that the above copyright notice appear in all 8 | copies and that both that the copyright notice and this 9 | permission notice and warranty disclaimer appear in supporting 10 | documentation, and that the name of Lucent or any of its entities 11 | not be used in advertising or publicity pertaining to 12 | distribution of the software without specific, written prior 13 | permission. 14 | 15 | LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 16 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 17 | IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 18 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 20 | IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 21 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 22 | THIS SOFTWARE. 23 | ****************************************************************/ 24 | 25 | #ifndef JAC2DIM_H_included 26 | #define JAC2DIM_H_included 27 | #ifndef NLP_H2_included 28 | #include "nlp2.h" 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | extern void hv2comp_ASL ANSI((ASL*,real*hv,real*p,int nobj,real*ow,real*y)); 35 | extern real con2ival_ASL ANSI((ASL*, int i, real *X, fint *ne)); 36 | extern void con2grd_ASL ANSI((ASL*, int i, real *X, real *G, fint *nerror)); 37 | extern void con2val_ASL ANSI((ASL*, real *X, real *F, fint *nerror)); 38 | extern void jac2val_ASL ANSI((ASL*, real *X, real *J, fint *nerror)); 39 | extern int lcon2val_ASL ANSI((ASL*, int i, real *X, fint *ne)); 40 | extern real obj2val_ASL ANSI((ASL*, int nobj, real *X, fint *nerror)); 41 | extern void obj2grd_ASL ANSI((ASL*, int nobj, real *X, real *G, fint *ne)); 42 | extern int x2_check_ASL ANSI((ASL_fgh*, real*)); 43 | extern void x2known_ASL ANSI((ASL*, real*, fint*)); 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* JAC2DIM_H_included */ 49 | -------------------------------------------------------------------------------- /xmlOF/testCondor/optimSuperSimple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | x_0 x_1 6 | 7 | 8 | 9 | 10 | 11 | (x_0-2)^2+(x_1-5)^2 12 | 13 | 14 | 15 | 16 | 17 | 18 | 0 0 19 | 20 | 21 | 22 | 23 | 24 | -2 -3 25 | 26 | 27 | 28 | 29 | 3 3 30 | 31 | 32 | 34 | 35 | 36 | 37 | -1 -1 -4 38 | 39 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | 59 | 62 | 63 | 64 | 65 | resultsSuperSimple.txt 66 | 67 | 68 | 70 | 71 | 1 1 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/optimSuperSimple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | x_0 x_1 6 | 7 | 8 | 9 | 10 | 11 | (x_0-2)^2+(x_1-5)^2 12 | 13 | 14 | 15 | 16 | 17 | 18 | 0 0 19 | 20 | 21 | 22 | 23 | 24 | -2 -3 25 | 26 | 27 | 28 | 29 | 3 3 30 | 31 | 32 | 34 | 35 | 36 | 37 | -1 -1 -4 38 | 39 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | 59 | 62 | 63 | 64 | 65 | resultsSuperSimple.txt 66 | 67 | 68 | 70 | 71 | 1 1 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /amplOF/examples/hatflde.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem hatflde 2 | 3 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 3 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 3 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 10 14 | o5 15 | o0 16 | n1.561 17 | o1 18 | o44 19 | o2 20 | n0.3 21 | v2 22 | o2 23 | v0 24 | o44 25 | o2 26 | n0.3 27 | v1 28 | n2 29 | o5 30 | o0 31 | n1.473 32 | o1 33 | o44 34 | o2 35 | n0.35 36 | v2 37 | o2 38 | v0 39 | o44 40 | o2 41 | n0.35 42 | v1 43 | n2 44 | o5 45 | o0 46 | n1.391 47 | o1 48 | o44 49 | o2 50 | n0.4 51 | v2 52 | o2 53 | v0 54 | o44 55 | o2 56 | n0.4 57 | v1 58 | n2 59 | o5 60 | o0 61 | n1.313 62 | o1 63 | o44 64 | o2 65 | n0.45 66 | v2 67 | o2 68 | v0 69 | o44 70 | o2 71 | n0.45 72 | v1 73 | n2 74 | o5 75 | o0 76 | n1.239 77 | o1 78 | o44 79 | o2 80 | n0.5 81 | v2 82 | o2 83 | v0 84 | o44 85 | o2 86 | n0.5 87 | v1 88 | n2 89 | o5 90 | o0 91 | n1.169 92 | o1 93 | o44 94 | o2 95 | n0.55 96 | v2 97 | o2 98 | v0 99 | o44 100 | o2 101 | n0.55 102 | v1 103 | n2 104 | o5 105 | o0 106 | n1.103 107 | o1 108 | o44 109 | o2 110 | n0.6 111 | v2 112 | o2 113 | v0 114 | o44 115 | o2 116 | n0.6 117 | v1 118 | n2 119 | o5 120 | o0 121 | n1.04 122 | o1 123 | o44 124 | o2 125 | n0.65 126 | v2 127 | o2 128 | v0 129 | o44 130 | o2 131 | n0.65 132 | v1 133 | n2 134 | o5 135 | o0 136 | n0.981 137 | o1 138 | o44 139 | o2 140 | n0.7 141 | v2 142 | o2 143 | v0 144 | o44 145 | o2 146 | n0.7 147 | v1 148 | n2 149 | o5 150 | o0 151 | n0.925 152 | o1 153 | o44 154 | o2 155 | n0.75 156 | v2 157 | o2 158 | v0 159 | o44 160 | o2 161 | n0.75 162 | v1 163 | n2 164 | x3 165 | 0 1 166 | 1 -1 167 | 2 0 168 | b 169 | 3 170 | 3 171 | 3 172 | k2 173 | 0 174 | 0 175 | G0 3 176 | 0 0 177 | 1 0 178 | 2 0 179 | -------------------------------------------------------------------------------- /common/VectorChar.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | 27 | #ifndef _INCLUDE_VectorCHAR_H 28 | #define _INCLUDE_VectorCHAR_H 29 | 30 | #include 31 | 32 | class VectorChar 33 | { 34 | protected: 35 | int np,extention; 36 | public: 37 | char *p; 38 | const int &n; 39 | 40 | VectorChar(): np(0), extention(0), p(NULL), n(np) {}; 41 | VectorChar(int _n); 42 | VectorChar(int _n, int _ext); 43 | VectorChar(int _n, char *d); 44 | VectorChar( const VectorChar& P ); 45 | VectorChar(VectorChar *v); 46 | ~VectorChar(); 47 | 48 | void extend(); 49 | void setSize(int _n); 50 | void exactshape(); 51 | void print(); 52 | 53 | // only use the following method at your own risks! 54 | void prepareExtend(int new_extention); 55 | 56 | // int &operator [](int i) { return p[i]; }; 57 | inline int sz() {return np;}; 58 | char operator==( const VectorChar& ); 59 | VectorChar& operator=( const VectorChar& P ); 60 | operator char*() const { return p; }; 61 | // operator unsigned*() const { return (unsigned*)p; }; 62 | // int &operator[]( unsigned i) {return p[i];}; 63 | 64 | void set(char c); 65 | 66 | private: 67 | void alloc(); 68 | 69 | }; 70 | 71 | #endif 72 | 73 | -------------------------------------------------------------------------------- /sifOF/examples/dqdrtic.sif: -------------------------------------------------------------------------------- 1 | *************************** 2 | * SET UP THE INITIAL DATA * 3 | *************************** 4 | 5 | NAME DQDRTIC 6 | 7 | * Problem : 8 | * ********* 9 | 10 | * A simple diagonal quadratic. 11 | 12 | * Source: problem 22 in 13 | * Ph. L. Toint, 14 | * "Test problems for partially separable optimization and results 15 | * for the routine PSPMIN", 16 | * Report 83/4, Department of Mathematics, FUNDP (Namur, B), 1983. 17 | 18 | * SIF input: Ph. Toint, Dec 1989. 19 | 20 | * classification QUR2-AN-V-0 21 | 22 | * N is the number of variables (variable) 23 | 24 | IE N 10 $-PARAMETER original value 25 | *IE N 50 $-PARAMETER 26 | *IE N 100 $-PARAMETER 27 | *IE N 500 $-PARAMETER 28 | *IE N 1000 $-PARAMETER 29 | *IE N 5000 $-PARAMETER 30 | 31 | * Number of groups sets 32 | 33 | IA NGS N -2 34 | 35 | * Define useful parameters 36 | 37 | IE 1 1 38 | 39 | VARIABLES 40 | 41 | DO I 1 N 42 | X X(I) 43 | ND 44 | 45 | GROUPS 46 | 47 | DO I 1 NGS 48 | 49 | IA I+1 I 1 50 | IA I+2 I 2 51 | 52 | XN A(I) 'SCALE' 0.01 53 | XN A(I) X(I+1) 1.0 54 | 55 | XN B(I) 'SCALE' 0.01 56 | XN B(I) X(I+2) 1.0 57 | 58 | XN C(I) X(I) 1.0 59 | 60 | ND 61 | 62 | BOUNDS 63 | 64 | FR DQDRTIC 'DEFAULT' 65 | 66 | START POINT 67 | 68 | XV DQDRTIC 'DEFAULT' 3.0 69 | 70 | GROUP TYPE 71 | 72 | GV L2 GVAR 73 | 74 | GROUP USES 75 | 76 | XT 'DEFAULT' L2 77 | 78 | OBJECT BOUND 79 | 80 | LO DQDRTIC 0.0 81 | 82 | * Solution 83 | 84 | *LO SOLTN 0.0 85 | 86 | ENDATA 87 | 88 | ********************* 89 | * SET UP THE GROUPS * 90 | * ROUTINE * 91 | ********************* 92 | 93 | GROUPS DQDRTIC 94 | 95 | INDIVIDUALS 96 | 97 | * Least-square groups 98 | 99 | T L2 100 | 101 | F GVAR * GVAR 102 | G GVAR + GVAR 103 | H 2.0 104 | 105 | ENDATA 106 | -------------------------------------------------------------------------------- /amplOF/jacpdim.h: -------------------------------------------------------------------------------- 1 | /**************************************************************** 2 | Copyright (C) 1997, 2000-2001 Lucent Technologies 3 | All Rights Reserved 4 | 5 | Permission to use, copy, modify, and distribute this software and 6 | its documentation for any purpose and without fee is hereby 7 | granted, provided that the above copyright notice appear in all 8 | copies and that both that the copyright notice and this 9 | permission notice and warranty disclaimer appear in supporting 10 | documentation, and that the name of Lucent or any of its entities 11 | not be used in advertising or publicity pertaining to 12 | distribution of the software without specific, written prior 13 | permission. 14 | 15 | LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 16 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 17 | IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 18 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 20 | IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 21 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 22 | THIS SOFTWARE. 23 | ****************************************************************/ 24 | 25 | #ifndef JACPDIM_H_included 26 | #define JACPDIM_H_included 27 | #include "asl_pfgh.h" 28 | 29 | #define conpival conpival_ASL 30 | #define conpgrd conpgrd_ASL 31 | #define conpval conpval_ASL 32 | #define jacpval jacpval_ASL 33 | #define lconpval lconpval_ASL 34 | #define objpgrd objpgrd_ASL 35 | #define objpval objpval_ASL 36 | #define hvpcomp hvpcomp_ASL 37 | #define xp2known xp2known_ASL 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | extern real conpival ANSI((ASL*, int nc, real *X, fint *ne)); 43 | extern void conpgrd ANSI((ASL*, int nc, real *X, real *G, fint *nerror)); 44 | extern void conpval ANSI((ASL*, real *X, real *F, fint *nerror)); 45 | extern void jacpval ANSI((ASL*, real *X, real *JAC, fint *nerror)); 46 | extern int lconpval ANSI((ASL*, int nc, real *X, fint *ne)); 47 | extern void objpgrd ANSI((ASL*, int nobj, real *X, real *G, fint *nerror)); 48 | extern real objpval ANSI((ASL*, int nobj, real *X, fint *nerror)); 49 | extern void hvpcomp ANSI((ASL*,real *hv,real *p,int nobj,real *ow,real *y)); 50 | extern int xp_check_ASL ANSI((ASL_pfgh*,real*)); 51 | extern void xp2known ANSI((ASL*, real*, fint*)); 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif /* JACPDIM_H_included */ 56 | -------------------------------------------------------------------------------- /common/VectorInt.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | #ifndef _INCLUDE_VectorIntINT_H 27 | #define _INCLUDE_VectorIntINT_H 28 | 29 | #include 30 | 31 | class VectorInt 32 | { 33 | public: 34 | typedef struct VectorIntDataTag 35 | { 36 | int n,extention; 37 | int ref_count; 38 | int *p; 39 | } VectorIntData; 40 | VectorIntData *d; 41 | 42 | VectorInt(int _n=0); 43 | VectorInt(int _n, int _ext); 44 | VectorInt(int _n, int *d); 45 | 46 | // allow shallow copy: 47 | VectorInt clone(); 48 | void copyFrom(VectorInt r); 49 | VectorInt( const VectorInt& P ); 50 | VectorInt& operator=( const VectorInt& P ); 51 | void destroyCurrentBuffer(); 52 | ~VectorInt(); 53 | 54 | void extend(); 55 | void setSize(int _n); 56 | void exactshape(); 57 | void print(); 58 | 59 | // only use the following method at your own risks! 60 | void prepareExtend(int new_extention); 61 | 62 | // int &operator [](int i) { return p[i]; }; 63 | inline int sz() {return d->n;}; 64 | int operator==( const VectorInt& P) {return (d==P.d);} 65 | operator int*() const { return d->p; }; 66 | // operator unsigned*() const { return (unsigned*)p; }; 67 | // int &operator[]( unsigned i) {return p[i];}; 68 | int equals( const VectorInt& Q ); 69 | 70 | static VectorInt emptyVectorInt; 71 | 72 | private: 73 | void alloc(int, int); 74 | 75 | }; 76 | 77 | #endif 78 | 79 | -------------------------------------------------------------------------------- /common/MatrixTriangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | 27 | #ifndef _MATRIXTRIANGLE_H 28 | #define _MATRIXTRIANGLE_H 29 | 30 | #include "Vector.h" 31 | 32 | class Matrix; 33 | 34 | class MatrixTriangle // lower triangular 35 | { 36 | friend class Matrix; 37 | protected: 38 | void destroyCurrentBuffer(); 39 | typedef struct MatrixTriangleDataTag 40 | { 41 | int n; 42 | int ext; 43 | int ref_count; 44 | double **p; 45 | } MatrixTriangleData; 46 | MatrixTriangleData *d; 47 | 48 | public: 49 | 50 | // creation & management of Matrix: 51 | MatrixTriangle(int _n=0); 52 | void setSize(int _n); 53 | 54 | // allow shallow copy: 55 | ~MatrixTriangle(); 56 | MatrixTriangle(const MatrixTriangle &A); 57 | MatrixTriangle& operator=( const MatrixTriangle& A ); 58 | MatrixTriangle clone(); 59 | void copyFrom(MatrixTriangle r); 60 | 61 | // accessor method 62 | inline bool operator==( const MatrixTriangle& A ) { return (A.d==d);} 63 | inline int nLine() { return d->n; }; 64 | inline double *operator [](int i) { return d->p[i]; }; 65 | inline operator double**() const { return d->p; }; 66 | 67 | // simple math tools: 68 | void solveInPlace(Vector b); 69 | void solveTransposInPlace(Vector y); 70 | //void invert(); 71 | void LINPACK(Vector &u); 72 | 73 | // default return matrix in case of problem in a function 74 | static MatrixTriangle emptyMatrixTriangle; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /amplOF/examples/hs116.mod: -------------------------------------------------------------------------------- 1 | # hs116.mod LQR2-MN-13-41 2 | # Original AMPL coding by Elena Bobrovnikova (summer 1996 at Bell Labs). 3 | 4 | # 3-stage membrane separation 5 | 6 | # Ref.: W. Hock and K. Schittkowski, Test Examples for Nonlinear Programming 7 | # Codes. Lecture Notes in Economics and Mathematical Systems, v. 187, 8 | # Springer-Verlag, New York, 1981, p. 124. 9 | 10 | # Number of variables: 13 11 | # Number of constraints: 41 12 | # Objective linear 13 | # Nonlinear constraints 14 | 15 | 16 | param N > 0 integer, := 13; 17 | set I := 1 .. N; 18 | 19 | var x {i in I} >= 0; 20 | 21 | param a > 0; 22 | param b > 0; 23 | param c > 0; 24 | param d > 0; 25 | param e > 0; 26 | param f > 0; 27 | 28 | 29 | minimize obj: 30 | x[11] + x[12] + x[13]; 31 | 32 | s.t. c1: x[3] - x[2] >= 0; 33 | s.t. c2: x[2] - x[1] >= 0; 34 | s.t. c3: 1 - a * x[7] + a * x[8] >= 0; 35 | s.t. c4: x[11] + x[12] + x[13] >= 50; 36 | s.t. c5: x[13] - b * x[10] + c * x[3] * x[10] >= 0; 37 | s.t. c6: x[5] - d * x[2] - e * x[2] * x[5] + f * x[2]^2 >= 0; 38 | s.t. c7: x[6] - d * x[3] - e * x[3] * x[6] + f * x[3]^2 >= 0; 39 | s.t. c8: x[4] - d * x[1] - e * x[1] * x[4] + f * x[1]^2 >= 0; 40 | s.t. c9: x[12] - b * x[9] + c * x[2] * x[9] >= 0; 41 | s.t. c10: x[11] - b * x[8] + c * x[1] * x[8] >= 0; 42 | s.t. c11: x[5] * x[7] - x[1] * x[8] - x[4] * x[7] + x[4] * x[8] >= 0; 43 | s.t. c12: 1 - a * (x[2] * x[9] + x[5] * x[8] - x[1] * x[8] - x[6] * x[9]) - 44 | x[5] - x[6] >= 0; 45 | s.t. c13: x[2] * x[9] - x[3] * x[10] - x[6] * x[9] - 500 * x[2] + 46 | 500 * x[6] + x[2] * x[10] >= 0; 47 | s.t. c14: x[2] - 0.9 - a * (x[2] * x[10] - x[3] * x[10]) >= 0; 48 | s.t. c15: x[11] + x[12] + x[13] <= 250; 49 | 50 | s.t. b1: 0.1 <= x[1] <= 1; 51 | s.t. b2: 0.1 <= x[2] <= 1; 52 | s.t. b3: 0.1 <= x[3] <= 1; 53 | s.t. b4: 0.0001 <= x[4] <= 0.1; 54 | s.t. b5: 0.1 <= x[5] <= 0.9; 55 | s.t. b6: 0.1 <= x[6] <= 0.9; 56 | s.t. b7: 0.1 <= x[7] <= 1000; 57 | s.t. b8: 0.1 <= x[8] <= 1000; 58 | s.t. b9: 500 <= x[9] <= 1000; 59 | s.t. b10: 0.1 <= x[10] <= 500; 60 | s.t. b11: 1 <= x[11] <= 150; 61 | s.t. b12: 0.0001 <= x[12] <= 150; 62 | s.t. b13: 0.0001 <= x[13] <= 150; 63 | 64 | 65 | data; 66 | param a := 0.002; 67 | param b := 1.262626; 68 | param c := 1.231059; 69 | param d := 0.03475; 70 | param e := 0.975; 71 | param f := 0.00975; 72 | var x := 73 | 1 0.5 2 0.8 3 0.9 4 0.1 5 0.14 6 0.5 7 489 8 80 9 650 74 | 10 450 11 150 12 150 13 150; 75 | 76 | #display obj; 77 | #solve; 78 | #display x; 79 | #display obj; 80 | #display obj - 97.588409; 81 | 82 | write ghs116; 83 | -------------------------------------------------------------------------------- /amplOF/examples/hs268.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem hs268 2 | 5 5 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 5 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 25 5 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | C0 12 | n0 13 | C1 14 | n0 15 | C2 16 | n0 17 | C3 18 | n0 19 | C4 20 | n0 21 | O0 0 22 | o54 23 | 26 24 | o2 25 | o2 26 | n10197 27 | v0 28 | v0 29 | o2 30 | o2 31 | n-12454 32 | v0 33 | v1 34 | o2 35 | o2 36 | n-1013 37 | v0 38 | v2 39 | o2 40 | o2 41 | n1948 42 | v0 43 | v3 44 | o2 45 | o2 46 | n329 47 | v0 48 | v4 49 | o2 50 | o2 51 | n-12454 52 | v1 53 | v0 54 | o2 55 | o2 56 | n20909 57 | v1 58 | v1 59 | o2 60 | o2 61 | n-1733 62 | v1 63 | v2 64 | o2 65 | o2 66 | n-4914 67 | v1 68 | v3 69 | o2 70 | o2 71 | n-186 72 | v1 73 | v4 74 | o2 75 | o2 76 | n-1013 77 | v2 78 | v0 79 | o2 80 | o2 81 | n-1733 82 | v2 83 | v1 84 | o2 85 | o2 86 | n1755 87 | v2 88 | v2 89 | o2 90 | o2 91 | n1089 92 | v2 93 | v3 94 | o2 95 | o2 96 | n-174 97 | v2 98 | v4 99 | o2 100 | o2 101 | n1948 102 | v3 103 | v0 104 | o2 105 | o2 106 | n-4914 107 | v3 108 | v1 109 | o2 110 | o2 111 | n1089 112 | v3 113 | v2 114 | o2 115 | o2 116 | n1515 117 | v3 118 | v3 119 | o2 120 | o2 121 | n-22 122 | v3 123 | v4 124 | o2 125 | o2 126 | n329 127 | v4 128 | v0 129 | o2 130 | o2 131 | n-186 132 | v4 133 | v1 134 | o2 135 | o2 136 | n-174 137 | v4 138 | v2 139 | o2 140 | o2 141 | n-22 142 | v4 143 | v3 144 | o2 145 | o2 146 | n27 147 | v4 148 | v4 149 | n14463 150 | x5 151 | 0 1 152 | 1 1 153 | 2 1 154 | 3 1 155 | 4 1 156 | r 157 | 2 -5 158 | 2 20 159 | 2 -40 160 | 2 11 161 | 2 -30 162 | b 163 | 3 164 | 3 165 | 3 166 | 3 167 | 3 168 | k4 169 | 5 170 | 10 171 | 15 172 | 20 173 | J0 5 174 | 0 -1 175 | 1 -1 176 | 2 -1 177 | 3 -1 178 | 4 -1 179 | J1 5 180 | 0 10 181 | 1 10 182 | 2 -3 183 | 3 5 184 | 4 4 185 | J2 5 186 | 0 -8 187 | 1 1 188 | 2 -2 189 | 3 -5 190 | 4 3 191 | J3 5 192 | 0 8 193 | 1 -1 194 | 2 2 195 | 3 5 196 | 4 -3 197 | J4 5 198 | 0 -4 199 | 1 -2 200 | 2 3 201 | 3 -5 202 | 4 1 203 | G0 5 204 | 0 18340 205 | 1 -34198 206 | 2 4542 207 | 3 8672 208 | 4 86 209 | -------------------------------------------------------------------------------- /sifOF/examples/sisser.sif: -------------------------------------------------------------------------------- 1 | *************************** 2 | * SET UP THE INITIAL DATA * 3 | *************************** 4 | 5 | NAME SISSER 6 | 7 | * Problem : 8 | * ********* 9 | 10 | * A simple constrained problem in 2 variables 11 | 12 | * Source: 13 | * F.S. Sisser, 14 | * "Elimination of bounds in optimization problems by transforming 15 | * variables", 16 | * Mathematical Programming 20:110-121, 1981. 17 | 18 | * See also Buckley#216 (p. 91) 19 | 20 | * SIF input: Ph. Toint, Dec 1989. 21 | 22 | * classification OUR2-AN-2-0 23 | 24 | VARIABLES 25 | 26 | X1 27 | X2 28 | 29 | GROUPS 30 | 31 | N G1 'SCALE' 0.3333333 32 | N G2 'SCALE' -0.5 33 | N G3 'SCALE' 0.3333333 34 | 35 | BOUNDS 36 | 37 | FR SISSER 'DEFAULT' 38 | 39 | START POINT 40 | 41 | SISSER X1 1.0 42 | SISSER X2 0.1 43 | 44 | ELEMENT TYPE 45 | 46 | EV SQ X 47 | EV 2PR X Y 48 | 49 | ELEMENT USES 50 | 51 | T E1 SQ 52 | V E1 X X1 53 | 54 | T E2 2PR 55 | V E2 X X1 56 | V E2 Y X2 57 | 58 | T E3 SQ 59 | V E3 X X2 60 | 61 | GROUP TYPE 62 | 63 | GV L2 GVAR 64 | 65 | GROUP USES 66 | 67 | T 'DEFAULT' L2 68 | 69 | E G1 E1 70 | E G2 E2 71 | E G3 E3 72 | 73 | OBJECT BOUND 74 | 75 | * Least square problems are bounded below by zero 76 | 77 | LO SISSER 0.0 78 | 79 | * Solution 80 | 81 | *LO SOLTN 0.0 82 | 83 | ENDATA 84 | 85 | *********************** 86 | * SET UP THE FUNCTION * 87 | * AND RANGE ROUTINES * 88 | *********************** 89 | 90 | ELEMENTS SISSER 91 | 92 | INDIVIDUALS 93 | 94 | T SQ 95 | F X * X 96 | G X X + X 97 | H X X 2.0 98 | 99 | 100 | T 2PR 101 | F X * Y 102 | G X Y 103 | G Y X 104 | H X Y 1.0 105 | 106 | ENDATA 107 | 108 | ********************* 109 | * SET UP THE GROUPS * 110 | * ROUTINE * 111 | ********************* 112 | 113 | GROUPS SISSER 114 | 115 | INDIVIDUALS 116 | 117 | T L2 118 | F GVAR * GVAR 119 | G GVAR + GVAR 120 | H 2.0 121 | 122 | ENDATA 123 | -------------------------------------------------------------------------------- /win32clean.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | del *.pdb 4 | del *.ilk 5 | del *.exp 6 | del *.lib 7 | del *.ncb 8 | del xmlOF\testCondor\OF\*.pdb 9 | del xmlOF\testCondor\OF\*.ilk 10 | 11 | del sifOF\debug\*.obj 12 | del sifOF\debug\*.pdb 13 | del sifOF\debug\*.idb 14 | del sifOF\debug\buildLog.htm 15 | rmdir sifOF\debug 16 | del amplOF\debug\*.obj 17 | del amplOF\debug\*.pdb 18 | del amplOF\debug\*.idb 19 | del amplOF\debug\buildLog.htm 20 | rmdir amplOF\debug 21 | del simpleOF\debug\*.obj 22 | del simpleOF\debug\*.pdb 23 | del simpleOF\debug\*.idb 24 | del simpleOF\debug\buildLog.htm 25 | rmdir simpleOF\debug 26 | del xmlOF\dbtool\debug\*.obj 27 | del xmlOF\dbtool\debug\*.pdb 28 | del xmlOF\dbtool\debug\*.idb 29 | del xmlOF\dbtool\debug\buildLog.htm 30 | rmdir xmlOF\dbtool\debug 31 | del xmlOF\debug\*.obj 32 | del xmlOF\debug\*.pdb 33 | del xmlOF\debug\*.idb 34 | del xmlOF\debug\buildLog.htm 35 | rmdir xmlOF\debug 36 | del xmlOF\testCondor\OF\debug\*.obj 37 | del xmlOF\testCondor\OF\debug\*.pdb 38 | del xmlOF\testCondor\OF\debug\*.idb 39 | del xmlOF\testCondor\OF\debug\buildLog.htm 40 | rmdir xmlOF\testCondor\OF\debug 41 | del matConvert\debug\*.obj 42 | del matConvert\debug\*.pdb 43 | del matConvert\debug\*.idb 44 | del matConvert\debug\buildLog.htm 45 | rmdir matConvert\debug 46 | del sifOF\Release\*.obj 47 | del sifOF\Release\*.pdb 48 | del sifOF\Release\*.idb 49 | del sifOF\Release\buildLog.htm 50 | rmdir sifOF\Release 51 | del amplOF\Release\*.obj 52 | del amplOF\Release\*.pdb 53 | del amplOF\Release\*.idb 54 | del amplOF\Release\buildLog.htm 55 | rmdir amplOF\Release 56 | del simpleOF\Release\*.obj 57 | del simpleOF\Release\*.pdb 58 | del simpleOF\Release\*.idb 59 | del simpleOF\Release\buildLog.htm 60 | rmdir simpleOF\Release 61 | del xmlOF\dbtool\Release\*.obj 62 | del xmlOF\dbtool\Release\*.pdb 63 | del xmlOF\dbtool\Release\*.idb 64 | del xmlOF\dbtool\Release\buildLog.htm 65 | rmdir xmlOF\dbtool\Release 66 | del xmlOF\Release\*.obj 67 | del xmlOF\Release\*.pdb 68 | del xmlOF\Release\*.idb 69 | del xmlOF\Release\buildLog.htm 70 | rmdir xmlOF\Release 71 | del xmlOF\testCondor\OF\Release\*.obj 72 | del xmlOF\testCondor\OF\Release\*.pdb 73 | del xmlOF\testCondor\OF\Release\*.idb 74 | del xmlOF\testCondor\OF\Release\buildLog.htm 75 | rmdir xmlOF\testCondor\OF\Release 76 | del matConvert\Release\*.obj 77 | del matConvert\Release\*.pdb 78 | del matConvert\Release\*.idb 79 | del matConvert\Release\buildLog.htm 80 | rmdir matConvert\Release 81 | 82 | echo press ctrl-c now if you want to keep the executables 83 | pause 84 | del *.exe 85 | del xmlOF\testCondor\OF\*.exe 86 | del xmlOF\testCondorwin32\*.exe 87 | -------------------------------------------------------------------------------- /sifOF/examples/3pk.cpp: -------------------------------------------------------------------------------- 1 | /* D:\my projects\L2parallel\SIF\ELFUN.f -- translated by f2c (version 20030306). 2 | You must link the resulting object file with the libraries: 3 | -lf2c -lm (in that order) 4 | */ 5 | #include "../SIFFunction.h" 6 | #include "../f2c.h" 7 | 8 | /* Subroutine */ int _elfun3PK_(doublereal *fuvals, doublereal *xvalue, 9 | doublereal *epvalu, integer *ncalcf, integer *itypee, integer *istaev, 10 | integer *ielvar, integer *intvar, integer *istadh, integer *istepa, 11 | integer *icalcf, integer *ltypee, integer *lstaev, integer *lelvar, 12 | integer *lntvar, integer *lstadh, integer *lstepa, integer *lcalcf, 13 | integer *lfvalu, integer *lxvalu, integer *lepvlu, integer *ifflag, 14 | integer *ifstat) 15 | {/* PROBLEM NAME : 3PK */ 16 | 17 | /* Parameter adjustments */ 18 | --itypee; 19 | --istaev; 20 | --ielvar; 21 | --intvar; 22 | --istadh; 23 | --istepa; 24 | --icalcf; 25 | --fuvals; 26 | --xvalue; 27 | --epvalu; 28 | 29 | /* Function Body */ 30 | *ifstat = 0; 31 | return 0; 32 | } /* elfun_ */ 33 | 34 | elfunType elfun3PK_=_elfun3PK_; 35 | 36 | /* Subroutine */ int _group3PK_(doublereal *gvalue, integer *lgvalu, doublereal * 37 | fvalue, doublereal *gpvalu, integer *ncalcg, integer *itypeg, integer 38 | *istgpa, integer *icalcg, integer *ltypeg, integer *lstgpa, integer * 39 | lcalcg, integer *lfvalu, integer *lgpvlu, logical *derivs, integer * 40 | igstat) 41 | { /* System generated locals */ 42 | integer gvalue_dim1, gvalue_offset, i__1; 43 | 44 | /* Local variables */ 45 | static doublereal x; 46 | static integer jcalcg, igroup, igrtyp, ipstrt; 47 | 48 | 49 | /* PROBLEM NAME : 3PK */ 50 | 51 | /* Parameter adjustments */ 52 | gvalue_dim1 = *lgvalu; 53 | gvalue_offset = 1 + gvalue_dim1; 54 | gvalue -= gvalue_offset; 55 | --itypeg; 56 | --istgpa; 57 | --icalcg; 58 | --fvalue; 59 | --gpvalu; 60 | 61 | /* Function Body */ 62 | *igstat = 0; 63 | i__1 = *ncalcg; 64 | for (jcalcg = 1; jcalcg <= i__1; ++jcalcg) { 65 | igroup = icalcg[jcalcg]; 66 | igrtyp = itypeg[igroup]; 67 | if (igrtyp == 0) { 68 | goto L2; 69 | } 70 | ipstrt = istgpa[igroup] - 1; 71 | 72 | /* GROUP TYPE : SQUARE */ 73 | 74 | x = fvalue[igroup]; 75 | if (! (*derivs)) { 76 | gvalue[igroup + gvalue_dim1] = x * x; 77 | } else { 78 | gvalue[igroup + (gvalue_dim1 << 1)] = x + x; 79 | gvalue[igroup + gvalue_dim1 * 3] = 2.f; 80 | } 81 | L2: 82 | ; 83 | } 84 | return 0; 85 | } /* group_ */ 86 | 87 | groupType group3PK_=_group3PK_; 88 | -------------------------------------------------------------------------------- /common/MultInd.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization 4 | using trust Region method for high-computing load, 5 | noisy functions 6 | Copyright (C) 2004 Frank Vanden Berghen 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License 10 | as published by the Free Software Foundation version 2 11 | of the License. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | If you want to include this tools in any commercial product, 23 | you can contact the author at fvandenb@iridia.ulb.ac.be 24 | 25 | */ 26 | 27 | // 28 | // class Multiindex 29 | // 30 | #ifndef _INCLUDE_MULTIND_H_ 31 | #define _INCLUDE_MULTIND_H_ 32 | 33 | #include "VectorInt.h" 34 | 35 | class MultInd; 36 | 37 | class MultIndCache { 38 | public: 39 | MultIndCache(); 40 | ~MultIndCache(); 41 | MultInd *get(unsigned _dim, unsigned _deg); 42 | private: 43 | MultInd *head; 44 | }; 45 | 46 | #ifndef __INSIDE_MULTIND_CPP__ 47 | extern MultIndCache cacheMultInd; 48 | #endif 49 | 50 | class MultInd { 51 | friend class MultIndCache; 52 | public: 53 | unsigned dim, deg; 54 | 55 | unsigned *lastChanges(); 56 | unsigned *indexesOfCoefInLexOrder(); 57 | 58 | MultInd(unsigned d=0); 59 | ~MultInd(); 60 | 61 | void resetCounter(); 62 | MultInd& operator++(); // prefix 63 | MultInd& operator++( int ) { return this->operator++(); } // postfix 64 | // unsigned &operator[]( unsigned i) {return coeffDeg[i];}; 65 | inline operator unsigned*() const { return coeffDeg; }; 66 | MultInd& operator=( const MultInd &P ); 67 | bool operator==( const MultInd& m ); 68 | unsigned index() {return indexV;}; 69 | unsigned len(); 70 | 71 | // Print it 72 | void print(); 73 | 74 | private: 75 | MultInd( unsigned _dim, unsigned _deg ); 76 | void fullInit(); 77 | void standardInit(); 78 | 79 | VectorInt lastChangesV, indexesOfCoefInLexOrderV; 80 | unsigned *coeffDeg, *coeffLex, indexV; 81 | 82 | static unsigned *buffer, maxDim; 83 | // to do the cache: 84 | MultInd *next; 85 | }; 86 | 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /sifOF/examples/dqdrtic.cpp: -------------------------------------------------------------------------------- 1 | /* D:\my projects\L2parallel\SIF\ELFUN.f -- translated by f2c (version 20030306). 2 | You must link the resulting object file with the libraries: 3 | -lf2c -lm (in that order) 4 | */ 5 | 6 | #include "../SIFFunction.h" 7 | 8 | /* Subroutine */ int _elfunDQDRTIC_(doublereal *fuvals, doublereal *xvalue, 9 | doublereal *epvalu, integer *ncalcf, integer *itypee, integer *istaev, 10 | integer *ielvar, integer *intvar, integer *istadh, integer *istepa, 11 | integer *icalcf, integer *ltypee, integer *lstaev, integer *lelvar, 12 | integer *lntvar, integer *lstadh, integer *lstepa, integer *lcalcf, 13 | integer *lfvalu, integer *lxvalu, integer *lepvlu, integer *ifflag, 14 | integer *ifstat) 15 | { 16 | 17 | /* PROBLEM NAME : DQDRTIC */ 18 | 19 | /* Parameter adjustments */ 20 | --itypee; 21 | --istaev; 22 | --ielvar; 23 | --intvar; 24 | --istadh; 25 | --istepa; 26 | --icalcf; 27 | --fuvals; 28 | --xvalue; 29 | --epvalu; 30 | 31 | /* Function Body */ 32 | *ifstat = 0; 33 | return 0; 34 | } /* elfun_ */ 35 | 36 | elfunType elfunDQDRTIC_=_elfunDQDRTIC_; 37 | 38 | /* Subroutine */ int _groupDQDRTIC_(doublereal *gvalue, integer *lgvalu, doublereal * 39 | fvalue, doublereal *gpvalu, integer *ncalcg, integer *itypeg, integer 40 | *istgpa, integer *icalcg, integer *ltypeg, integer *lstgpa, integer * 41 | lcalcg, integer *lfvalu, integer *lgpvlu, logical *derivs, integer * 42 | igstat) 43 | { 44 | /* System generated locals */ 45 | integer gvalue_dim1, gvalue_offset, i__1; 46 | 47 | /* Local variables */ 48 | static doublereal gvar; 49 | static integer jcalcg, igroup, igrtyp, ipstrt; 50 | 51 | 52 | /* PROBLEM NAME : DQDRTIC */ 53 | 54 | /* Parameter adjustments */ 55 | gvalue_dim1 = *lgvalu; 56 | gvalue_offset = 1 + gvalue_dim1; 57 | gvalue -= gvalue_offset; 58 | --itypeg; 59 | --istgpa; 60 | --icalcg; 61 | --fvalue; 62 | --gpvalu; 63 | 64 | /* Function Body */ 65 | *igstat = 0; 66 | i__1 = *ncalcg; 67 | for (jcalcg = 1; jcalcg <= i__1; ++jcalcg) { 68 | igroup = icalcg[jcalcg]; 69 | igrtyp = itypeg[igroup]; 70 | if (igrtyp == 0) { 71 | goto L2; 72 | } 73 | ipstrt = istgpa[igroup] - 1; 74 | 75 | /* GROUP TYPE : L2 */ 76 | 77 | gvar = fvalue[igroup]; 78 | if (! (*derivs)) { 79 | gvalue[igroup + gvalue_dim1] = gvar * gvar; 80 | } else { 81 | gvalue[igroup + (gvalue_dim1 << 1)] = gvar + gvar; 82 | gvalue[igroup + gvalue_dim1 * 3] = 2.f; 83 | } 84 | L2: 85 | ; 86 | } 87 | return 0; 88 | } /* group_ */ 89 | 90 | groupType groupDQDRTIC_=_groupDQDRTIC_; 91 | -------------------------------------------------------------------------------- /amplOF/examples/brownal.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem brownal 2 | 10 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 10 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 10 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 10 14 | o5 15 | o0 16 | n-11 17 | o54 18 | 11 19 | v0 20 | v1 21 | v2 22 | v3 23 | v4 24 | v5 25 | v6 26 | v7 27 | v8 28 | v9 29 | v0 30 | n2 31 | o5 32 | o0 33 | n-11 34 | o54 35 | 11 36 | v0 37 | v1 38 | v2 39 | v3 40 | v4 41 | v5 42 | v6 43 | v7 44 | v8 45 | v9 46 | v1 47 | n2 48 | o5 49 | o0 50 | n-11 51 | o54 52 | 11 53 | v0 54 | v1 55 | v2 56 | v3 57 | v4 58 | v5 59 | v6 60 | v7 61 | v8 62 | v9 63 | v2 64 | n2 65 | o5 66 | o0 67 | n-11 68 | o54 69 | 11 70 | v0 71 | v1 72 | v2 73 | v3 74 | v4 75 | v5 76 | v6 77 | v7 78 | v8 79 | v9 80 | v3 81 | n2 82 | o5 83 | o0 84 | n-11 85 | o54 86 | 11 87 | v0 88 | v1 89 | v2 90 | v3 91 | v4 92 | v5 93 | v6 94 | v7 95 | v8 96 | v9 97 | v4 98 | n2 99 | o5 100 | o0 101 | n-11 102 | o54 103 | 11 104 | v0 105 | v1 106 | v2 107 | v3 108 | v4 109 | v5 110 | v6 111 | v7 112 | v8 113 | v9 114 | v5 115 | n2 116 | o5 117 | o0 118 | n-11 119 | o54 120 | 11 121 | v0 122 | v1 123 | v2 124 | v3 125 | v4 126 | v5 127 | v6 128 | v7 129 | v8 130 | v9 131 | v6 132 | n2 133 | o5 134 | o0 135 | n-11 136 | o54 137 | 11 138 | v0 139 | v1 140 | v2 141 | v3 142 | v4 143 | v5 144 | v6 145 | v7 146 | v8 147 | v9 148 | v7 149 | n2 150 | o5 151 | o0 152 | n-11 153 | o54 154 | 11 155 | v0 156 | v1 157 | v2 158 | v3 159 | v4 160 | v5 161 | v6 162 | v7 163 | v8 164 | v9 165 | v8 166 | n2 167 | o5 168 | o0 169 | n-1 170 | o2 171 | o2 172 | o2 173 | o2 174 | o2 175 | o2 176 | o2 177 | o2 178 | o2 179 | v0 180 | v1 181 | v2 182 | v3 183 | v4 184 | v5 185 | v6 186 | v7 187 | v8 188 | v9 189 | n2 190 | x10 191 | 0 0.5 192 | 1 0.5 193 | 2 0.5 194 | 3 0.5 195 | 4 0.5 196 | 5 0.5 197 | 6 0.5 198 | 7 0.5 199 | 8 0.5 200 | 9 0.5 201 | b 202 | 3 203 | 3 204 | 3 205 | 3 206 | 3 207 | 3 208 | 3 209 | 3 210 | 3 211 | 3 212 | k9 213 | 0 214 | 0 215 | 0 216 | 0 217 | 0 218 | 0 219 | 0 220 | 0 221 | 0 222 | G0 10 223 | 0 0 224 | 1 0 225 | 2 0 226 | 3 0 227 | 4 0 228 | 5 0 229 | 6 0 230 | 7 0 231 | 8 0 232 | 9 0 233 | -------------------------------------------------------------------------------- /sifOF/examples/eigenals.d: -------------------------------------------------------------------------------- 1 | 6 6 12 12 30 0 0 0 2 1 2 | 3EIGENALS 0 3 | 1 3 5 7 9 11 13 4 | 1 1 1 1 1 1 1 5 | 1 1 1 1 1 1 1 6 | 1 4 6 9 11 14 16 19 21 24 7 | 26 29 31 8 | 1 1 1 1 1 1 1 1 1 1 9 | 1 1 1 10 | 1 1 1 1 1 1 11 | 1 1 1 1 1 1 12 | 2 1 2 1 2 1 2 1 2 1 13 | 2 1 14 | 3 2 3 2 3 2 3 2 3 2 15 | 3 2 16 | 1 3 2 4 5 7 6 8 9 11 17 | 10 12 18 | 2 2 1 2 2 3 3 4 3 3 19 | 2 5 1 2 5 3 6 4 3 6 20 | 5 5 1 5 5 6 6 4 6 6 21 | 22 | 23 | 1.00000000E+00 1.00000000E+00 0.00000000E+00 0.00000000E+00 24 | 2.00000000E+00 1.00000000E+00 25 | -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 -1.00000000E+20 26 | -1.00000000E+20 -1.00000000E+20 0.00000000E+00 0.00000000E+00 27 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 28 | 1.00000000E+20 1.00000000E+20 1.00000000E+20 1.00000000E+20 29 | 1.00000000E+20 1.00000000E+20 0.00000000E+00 0.00000000E+00 30 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 31 | 1.00000000E+00 1.00000000E+00 0.00000000E+00 1.00000000E+00 32 | 0.00000000E+00 1.00000000E+00 33 | 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 34 | 0.00000000E+00 0.00000000E+00 35 | 36 | 37 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 38 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 39 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 40 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 41 | 1.00000000E+00 1.00000000E+00 42 | 1.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 43 | 1.00000000E+00 1.00000000E+00 44 | -1.00000000E+20 1.00000000E+20 45 | FFFFFFFFFFFF 46 | FFFFFF 47 | E1,1 O1,1 E1,2 O1,2 E2,2 O2,2 48 | D1 Q1,1 Q2,1 D2 Q1,2 Q2,2 49 | 2PROD 3PROD 50 | L2 51 | 0 0 0 0 0 0 52 | EIGENALS 6 0 0 0 0 0 0 6 0 0 0 0 53 | -------------------------------------------------------------------------------- /amplOF/examples/hart6.nl: -------------------------------------------------------------------------------- 1 | g3 0 1 0 # problem hart6 2 | 6 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 6 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 6 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 4 14 | o16 15 | o44 16 | o16 17 | o54 18 | 6 19 | o2 20 | n10 21 | o5 22 | o0 23 | n-0.1312 24 | v0 25 | n2 26 | o2 27 | n0.05 28 | o5 29 | o0 30 | n-0.1696 31 | v1 32 | n2 33 | o2 34 | n17 35 | o5 36 | o0 37 | n-0.5569 38 | v2 39 | n2 40 | o2 41 | n3.5 42 | o5 43 | o0 44 | n-0.0124 45 | v3 46 | n2 47 | o2 48 | n1.7 49 | o5 50 | o0 51 | n-0.8283 52 | v4 53 | n2 54 | o2 55 | n8 56 | o5 57 | o0 58 | n-0.5886 59 | v5 60 | n2 61 | o2 62 | n-1.2 63 | o44 64 | o16 65 | o54 66 | 6 67 | o2 68 | n0.05 69 | o5 70 | o0 71 | n-0.2329 72 | v0 73 | n2 74 | o2 75 | n10 76 | o5 77 | o0 78 | n-0.4135 79 | v1 80 | n2 81 | o2 82 | n17 83 | o5 84 | o0 85 | n-0.8307 86 | v2 87 | n2 88 | o2 89 | n0.1 90 | o5 91 | o0 92 | n-0.3736 93 | v3 94 | n2 95 | o2 96 | n8 97 | o5 98 | o0 99 | n-0.1004 100 | v4 101 | n2 102 | o2 103 | n14 104 | o5 105 | o0 106 | n-0.9991 107 | v5 108 | n2 109 | o2 110 | n-3 111 | o44 112 | o16 113 | o54 114 | 6 115 | o2 116 | n3 117 | o5 118 | o0 119 | n-0.2348 120 | v0 121 | n2 122 | o2 123 | n3.5 124 | o5 125 | o0 126 | n-0.1451 127 | v1 128 | n2 129 | o2 130 | n1.7 131 | o5 132 | o0 133 | n-0.3522 134 | v2 135 | n2 136 | o2 137 | n10 138 | o5 139 | o0 140 | n-0.2883 141 | v3 142 | n2 143 | o2 144 | n17 145 | o5 146 | o0 147 | n-0.3047 148 | v4 149 | n2 150 | o2 151 | n8 152 | o5 153 | o0 154 | n-0.665 155 | v5 156 | n2 157 | o2 158 | n-3.2 159 | o44 160 | o16 161 | o54 162 | 6 163 | o2 164 | n17 165 | o5 166 | o0 167 | n-0.4047 168 | v0 169 | n2 170 | o2 171 | n8 172 | o5 173 | o0 174 | n-0.8828 175 | v1 176 | n2 177 | o2 178 | n0.05 179 | o5 180 | o0 181 | n-0.8732 182 | v2 183 | n2 184 | o2 185 | n10 186 | o5 187 | o0 188 | n-0.5743 189 | v3 190 | n2 191 | o2 192 | n0.1 193 | o5 194 | o0 195 | n-0.1091 196 | v4 197 | n2 198 | o2 199 | n14 200 | o5 201 | o0 202 | n-0.0381 203 | v5 204 | n2 205 | x6 206 | 0 0.2 207 | 1 0.2 208 | 2 0.2 209 | 3 0.2 210 | 4 0.2 211 | 5 0.2 212 | b 213 | 0 0 1 214 | 0 0 1 215 | 0 0 1 216 | 0 0 1 217 | 0 0 1 218 | 0 0 1 219 | k5 220 | 0 221 | 0 222 | 0 223 | 0 224 | 0 225 | G0 6 226 | 0 0 227 | 1 0 228 | 2 0 229 | 3 0 230 | 4 0 231 | 5 0 232 | -------------------------------------------------------------------------------- /sifOF/examples/power.sif: -------------------------------------------------------------------------------- 1 | *************************** 2 | * SET UP THE INITIAL DATA * 3 | *************************** 4 | 5 | NAME POWER 6 | 7 | * Problem : 8 | * ********* 9 | 10 | * The Power problem by Oren. 11 | 12 | * Source: 13 | * S.S. Oren, 14 | * Self-scaling variable metric algorithms, 15 | * Part II: implementation and experiments" 16 | * Management Science 20(5):863-874, 1974. 17 | 18 | * See also Buckley#179 (p. 83) 19 | 20 | * SIF input: Ph. Toint, Dec 1989. 21 | 22 | * classification OUR2-AN-V-0 23 | 24 | * Number of variables 25 | 26 | IE N 10 $-PARAMETER original value 27 | *IE N 20 $-PARAMETER 28 | *IE N 30 $-PARAMETER 29 | *IE N 50 $-PARAMETER 30 | *IE N 75 $-PARAMETER 31 | *IE N 100 $-PARAMETER 32 | *IE N 500 $-PARAMETER 33 | *IE N 1000 $-PARAMETER 34 | *IE N 5000 $-PARAMETER 35 | *IE N 10000 $-PARAMETER 36 | 37 | * Other parameters 38 | 39 | IE 1 1 40 | 41 | VARIABLES 42 | 43 | DO I 1 N 44 | X X(I) 45 | ND 46 | 47 | GROUPS 48 | 49 | N G 50 | 51 | BOUNDS 52 | 53 | FR POWER 'DEFAULT' 54 | 55 | START POINT 56 | 57 | XV POWER 'DEFAULT' 1.0 58 | 59 | ELEMENT TYPE 60 | 61 | EV SQ X 62 | 63 | ELEMENT USES 64 | 65 | DO I 1 N 66 | XT E(I) SQ 67 | ZV E(I) X X(I) 68 | ND 69 | 70 | GROUP TYPE 71 | 72 | GV L2 GVAR 73 | 74 | GROUP USES 75 | 76 | T G L2 77 | 78 | DO I 1 N 79 | RI RI I 80 | ZE G E(I) RI 81 | ND 82 | 83 | OBJECT BOUND 84 | 85 | * Least square problems are bounded below by zero 86 | 87 | LO POWER 0.0 88 | 89 | * Solution 90 | 91 | *LO SOLTN 0.0 92 | 93 | ENDATA 94 | 95 | *********************** 96 | * SET UP THE FUNCTION * 97 | * AND RANGE ROUTINES * 98 | *********************** 99 | 100 | ELEMENTS POWER 101 | 102 | INDIVIDUALS 103 | 104 | T SQ 105 | F X * X 106 | G X X + X 107 | H X X 2.0 108 | 109 | ENDATA 110 | 111 | ********************* 112 | * SET UP THE GROUPS * 113 | * ROUTINE * 114 | ********************* 115 | 116 | GROUPS POWER 117 | 118 | INDIVIDUALS 119 | 120 | T L2 121 | F GVAR * GVAR 122 | G GVAR + GVAR 123 | H 2.0 124 | 125 | ENDATA 126 | -------------------------------------------------------------------------------- /xmlOF/testCondor/optimFletcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | v0 v1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -v0-v1 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 0 0 23 | 24 | 25 | 26 | 27 | 32 | 33 | 35 | 36 | 37 | 1-v0*v0-v1*v1 38 | 39 | 40 | v1-v0*v0 41 | 42 | 43 | 44 | 49 | 50 | 51 | 55 | 56 | 62 | 68 | 69 | 73 | 76 | 77 | 78 | 79 | resultsFletcher.txt 80 | 81 | 82 | 83 | 84 | 1 1 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /xmlOF/testCondorwin32/optimFletcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | v0 v1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -v0-v1 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 0 0 23 | 24 | 25 | 26 | 27 | 32 | 33 | 35 | 36 | 37 | 1-v0*v0-v1*v1 38 | 39 | 40 | v1-v0*v0 41 | 42 | 43 | 44 | 49 | 50 | 51 | 55 | 56 | 62 | 68 | 69 | 73 | 76 | 77 | 78 | 79 | resultsFletcher.txt 80 | 81 | 82 | 83 | 84 | 1 1 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /amplOF/examples/heart6ls.mod: -------------------------------------------------------------------------------- 1 | # 2 | #************************** 3 | # SET UP THE INITIAL DATA * 4 | #************************** 5 | # Problem : 6 | # ********* 7 | # Dipole model of the heart (6 x 6 version). 8 | # Source: 9 | # J. E. Dennis, Jr., D. M. Gay, P. A. Vu, 10 | # "A New Nonlinear Equations Test Problem". 11 | # Tech. Rep. 83-16, Dept. of Math. Sci., Rice Univ., Houston, TX 12 | # June 1983, revised May 1985. 13 | # SIF input: A.R. Conn, May 1993. 14 | # classification NOR2-MN-6-6 15 | # some useful parameters. 16 | #RE sum_Mx 0.485 17 | #RE sum_My -0.0019 18 | #RE sum_A -0.0581 19 | #RE sum_B 0.015 20 | #RE sum_C 0.105 21 | #RE sum_D 0.0406 22 | #RE sum_E 0.167 23 | #RE sum_F -0.399 24 | #RE sum_Mx -0.69 25 | #RE sum_My -0.044 26 | #RE sum_A -1.57 27 | #RE sum_B -1.31 28 | #RE sum_C -2.65 29 | #RE sum_D 2.0 30 | #RE sum_E -12.6 31 | #RE sum_F 9.48 32 | #RE sum_Mx -0.809 33 | #RE sum_My -0.021 34 | #RE sum_A -2.04 35 | #RE sum_B -0.614 36 | #RE sum_C -6.903 37 | #RE sum_D -2.934 38 | #RE sum_E -26.328 39 | #RE sum_F 18.639 40 | #RE sum_Mx -0.807 41 | #RE sum_My -0.021 42 | #RE sum_A -2.379 43 | #RE sum_B -0.364 44 | #RE sum_C -10.541 45 | #RE sum_D -1.961 46 | #RE sum_E -51.551 47 | #RE sum_F 21.053 48 | #E G2 E7 -1.0 E8 -1.0 49 | #E G4 E13 E14 -2.0 50 | #E G4 E15 E16 -2.0 51 | # Solution 52 | param sum_mx := -0.816; 53 | param sum_my := -0.017; 54 | param sum_a := -1.826; 55 | param sum_b := -0.754; 56 | param sum_c := -4.839; 57 | param sum_d := -3.259; 58 | param sum_e := -14.023; 59 | param sum_f := 15.467; 60 | 61 | var a := 0.0; 62 | var c := 0.0; 63 | var t := 1.0; 64 | var u := 1.0; 65 | var v := 1.0; 66 | var w := 1.0; 67 | 68 | minimize obj: 69 | (t * a + u * (-0.816-a) - v * c - w * (-0.017-c) + 1.826)^2 + (v * a + w * 70 | (-0.816-a) + t * c + u * (-0.017-c) + 0.754)^2 + (a * (t^2-v^2) - 2.0*c * t * v 71 | + (-0.816-a) * (u^2-w^2) - 2.0*(-0.017-c) * u * w + 4.839)^2 + (c * (t^2-v^2) + 72 | 2.0*a * t * v + (-0.017-c) * (u^2-w^2) + 2.0*(-0.816-a) * u * w + 3.259)^2 + (a 73 | * t * (t^2-(3.0)*v^2) + c * v * (v^2-(3.0)*t^2) + (-0.816-a) * u * 74 | (u^2-(3.0)*w^2) + (-0.017-c) * w * (w^2-(3.0)*u^2) + 14.023)^2 + (c * t * 75 | (t^2-(3.0)*v^2) - a * v * (v^2-(3.0)*t^2) + (-0.017-c) * u * (u^2-(3.0)*w^2) - 76 | (-0.816-a) * w * (w^2-(3.0)*u^2) - 15.467)^2; 77 | 78 | 79 | #solve;display a;display c;display t;display u;display v;display w;display obj; 80 | 81 | write gheart6ls; -------------------------------------------------------------------------------- /amplOF/examples/morebv.nl: -------------------------------------------------------------------------------- 1 | g9 1 1 0 0 20030724 0 4 0 496 # problem morebv 2 | 10 0 1 0 0 # vars, constraints, objectives, ranges, eqns 3 | 0 1 # nonlinear constraints, objectives 4 | 0 0 # network constraints: nonlinear, linear 5 | 0 10 0 # nonlinear vars in constraints, objectives, both 6 | 0 0 0 1 # linear network variables; functions; arith, flags 7 | 0 0 0 0 0 # discrete variables: binary, integer, nonlinear (b,c,o) 8 | 0 10 # nonzeros in Jacobian, gradients 9 | 0 0 # max name lengths: constraints, variables 10 | 0 0 0 0 0 # common exprs: b,c,o,c1,o1 11 | O0 0 12 | o54 13 | 10 14 | o5 15 | o0 16 | o1 17 | o2 18 | n2 19 | v0 20 | v1 21 | o2 22 | n0.004132231404958678 23 | o5 24 | o0 25 | n1.0909090909090908 26 | v0 27 | n3 28 | n2 29 | o5 30 | o0 31 | o1 32 | o1 33 | o2 34 | n2 35 | v1 36 | v0 37 | v2 38 | o2 39 | n0.004132231404958678 40 | o5 41 | o0 42 | n1.1818181818181819 43 | v1 44 | n3 45 | n2 46 | o5 47 | o0 48 | o1 49 | o1 50 | o2 51 | n2 52 | v2 53 | v1 54 | v3 55 | o2 56 | n0.004132231404958678 57 | o5 58 | o0 59 | n1.2727272727272727 60 | v2 61 | n3 62 | n2 63 | o5 64 | o0 65 | o1 66 | o1 67 | o2 68 | n2 69 | v3 70 | v2 71 | v4 72 | o2 73 | n0.004132231404958678 74 | o5 75 | o0 76 | n1.3636363636363638 77 | v3 78 | n3 79 | n2 80 | o5 81 | o0 82 | o1 83 | o1 84 | o2 85 | n2 86 | v4 87 | v3 88 | v5 89 | o2 90 | n0.004132231404958678 91 | o5 92 | o0 93 | n1.4545454545454546 94 | v4 95 | n3 96 | n2 97 | o5 98 | o0 99 | o1 100 | o1 101 | o2 102 | n2 103 | v5 104 | v4 105 | v6 106 | o2 107 | n0.004132231404958678 108 | o5 109 | o0 110 | n1.5454545454545454 111 | v5 112 | n3 113 | n2 114 | o5 115 | o0 116 | o1 117 | o1 118 | o2 119 | n2 120 | v6 121 | v5 122 | v7 123 | o2 124 | n0.004132231404958678 125 | o5 126 | o0 127 | n1.6363636363636362 128 | v6 129 | n3 130 | n2 131 | o5 132 | o0 133 | o1 134 | o1 135 | o2 136 | n2 137 | v7 138 | v6 139 | v8 140 | o2 141 | n0.004132231404958678 142 | o5 143 | o0 144 | n1.7272727272727273 145 | v7 146 | n3 147 | n2 148 | o5 149 | o0 150 | o1 151 | o1 152 | o2 153 | n2 154 | v8 155 | v7 156 | v9 157 | o2 158 | n0.004132231404958678 159 | o5 160 | o0 161 | n1.8181818181818183 162 | v8 163 | n3 164 | n2 165 | o5 166 | o0 167 | o1 168 | o2 169 | n2 170 | v9 171 | v8 172 | o2 173 | n0.004132231404958678 174 | o5 175 | o0 176 | n1.9090909090909092 177 | v9 178 | n3 179 | n2 180 | x10 181 | 0 -0.08264462809917356 182 | 1 -0.1487603305785124 183 | 2 -0.1983471074380165 184 | 3 -0.23140495867768596 185 | 4 -0.24793388429752067 186 | 5 -0.24793388429752067 187 | 6 -0.23140495867768596 188 | 7 -0.1983471074380165 189 | 8 -0.14876033057851237 190 | 9 -0.08264462809917349 191 | b 192 | 3 193 | 3 194 | 3 195 | 3 196 | 3 197 | 3 198 | 3 199 | 3 200 | 3 201 | 3 202 | k9 203 | 0 204 | 0 205 | 0 206 | 0 207 | 0 208 | 0 209 | 0 210 | 0 211 | 0 212 | G0 10 213 | 0 0 214 | 1 0 215 | 2 0 216 | 3 0 217 | 4 0 218 | 5 0 219 | 6 0 220 | 7 0 221 | 8 0 222 | 9 0 223 | --------------------------------------------------------------------------------