Osi-0.106.4/0000755000076600007660000000000012244064313011071 5ustar coincoinOsi-0.106.4/config.sub0000755000076600007660000007772611405216166013102 0ustar coincoin#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-04-29' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: Osi-0.106.4/AUTHORS0000644000076600007660000000027710625200560012144 0ustar coincoinFasano, J.P. Forrest, John J. Hafer, Lou Ladanyi, Laszlo Lannez, Sebastien (OsiCuts insert method) Margot, Francois Saltzman, Matt Ralphs, Ted Walton, Philip (trait specification of OsiCuts) Osi-0.106.4/doxydoc/0000755000076600007660000000000012244064313012542 5ustar coincoinOsi-0.106.4/doxydoc/doxygen.conf.in0000644000076600007660000017400012244006221015467 0ustar coincoin# Doxyfile 1.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = @PACKAGE_NAME@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @PACKAGE_VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doxydoc # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = "@abs_top_srcdir@/" # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = @coin_doxy_logname@ #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @abs_top_srcdir@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.hpp \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = */.svn* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 3 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = YES # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) # there is already a search function so this one should typically # be disabled. SEARCHENGINE = YES #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = YES # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = letter # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = @coin_doxy_tagfiles@ # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = @coin_doxy_tagname@ # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = YES # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = @coin_doxy_usedot@ # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES Osi-0.106.4/osi-unittests.pc.in0000644000076600007660000000046211510106235014651 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: OsiUnitTests Description: COIN-OR Open Solver Interface Common Unit Tests URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsiCommonTests Cflags: -I${includedir} Requires: osi Osi-0.106.4/osi-unittests-uninstalled.pc.in0000644000076600007660000000045111507670402017177 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src/OsiCommonTest Name: OsiUnitTests Description: COIN-OR Open Solver Interface Common Unit Tests URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: ${libdir}/libOsiCommonTests.la Cflags: -I@abs_source_dir@/src/OsiCommonTest Requires: osi Osi-0.106.4/osi.pc.in0000644000076600007660000000045411510106235012612 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: Osi Description: COIN-OR Open Solver Interface URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsi @OSILIB_PCLIBS@ Cflags: -I${includedir} Requires: @OSILIB_PCREQUIRES@ Osi-0.106.4/install-sh0000755000076600007660000002202111405216166013075 0ustar coincoin#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: Osi-0.106.4/examples/0000755000076600007660000000000012244064313012707 5ustar coincoinOsi-0.106.4/examples/query.cpp0000644000076600007660000000416212101340333014552 0ustar coincoin// Example of using COIN-OR OSI // Demonstrates some problem and solution query methods #include #include OSIXXXhpp int main(void) { // Create a problem pointer. We use the base class here. OsiSolverInterface *si; // When we instantiate the object, we need a specific derived class. si = new OSIXXX; // Read in an mps file. This one's from the MIPLIB library. #if defined(SAMPLEDIR) si->readMps(SAMPLEDIR "/p0033"); #else fprintf(stderr, "Do not know where to find sample MPS files.\n"); exit(1); #endif // Display some information about the instance int nrows = si->getNumRows(); int ncols = si->getNumCols(); int nelem = si->getNumElements(); std::cout << "This problem has " << nrows << " rows, " << ncols << " columns, and " << nelem << " nonzeros." << std::endl; double const *upper_bounds = si->getColUpper(); std::cout << "The upper bound on the first column is " << upper_bounds[0] << std::endl; // All information about the instance is available with similar methods // Solve the (relaxation of the) problem si->initialSolve(); // Check the solution if ( si->isProvenOptimal() ) { std::cout << "Found optimal solution!" << std::endl; std::cout << "Objective value is " << si->getObjValue() << std::endl; // Examine solution int n = si->getNumCols(); const double *solution; solution = si->getColSolution(); std::cout << "Solution: "; for (int i = 0; i < n; i++) std::cout << solution[i] << " "; std::cout << std::endl; std::cout << "It took " << si->getIterationCount() << " iterations" << " to solve." << std::endl; } else { std::cout << "Didn't find optimal solution." << std::endl; // Check other status functions. What happened? if (si->isProvenPrimalInfeasible()) std::cout << "Problem is proven to be infeasible." << std::endl; if (si->isProvenDualInfeasible()) std::cout << "Problem is proven dual infeasible." << std::endl; if (si->isIterationLimitReached()) std::cout << "Reached iteration limit." << std::endl; } return 0; } Osi-0.106.4/examples/opbdp_solve.cpp0000644000076600007660000003467512131314077015746 0ustar coincoin// Copyright (C) 2006, International Business Machines // Corporation and others. All Rights Reserved. #include "OsiConfig.h" #include #include #include #include #include #include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinTime.hpp" #include "opbdp_solve.hpp" #include "PBCS.h" // Not threadsafe static unsigned int ** opbdp_solution=NULL; static int opbdp_number_solutions=0; static int opbdp_maximum_solutions=0; static int size_solution=0; static PBCS *save_pbcs=NULL; void opbdp_save_solution(OrdInt & sol) { if (opbdp_number_solutions==opbdp_maximum_solutions) { opbdp_maximum_solutions = opbdp_maximum_solutions*2+100; unsigned int ** temp = new unsigned int * [opbdp_maximum_solutions]; CoinMemcpyN(opbdp_solution,opbdp_number_solutions,temp); CoinZeroN(temp+opbdp_number_solutions,opbdp_maximum_solutions-opbdp_number_solutions); delete [] opbdp_solution; opbdp_solution=temp; } unsigned int * array = new unsigned int [size_solution]; CoinZeroN(array,size_solution); opbdp_solution[opbdp_number_solutions++]=array; sol.first(); while(!sol.last()) { int var = sol.next(); if (var > 0) setAtOne(var-1,array,true); } OrdInt Fixed = save_pbcs->get_fixed(); Fixed.first(); while(!Fixed.last()) { int flit = Fixed.next(); if (flit > 0) setAtOne(flit-1,array,true); } // add hidden ones due to equations save_pbcs->Eq.first(); while(!save_pbcs->Eq.last()) { int l = save_pbcs->Eq.next(); int r = save_pbcs->Eq(l); if (sol.member(r) || Fixed.member(r)) setAtOne(l-1,array,true); else if (sol.member(-r) || Fixed.member(-r)) setAtOne(l-1,array,true); // just positives are added } } //------------------------------------------------------------------- // Returns the greatest common denominator of two // positive integers, a and b, found using Euclid's algorithm //------------------------------------------------------------------- static int gcd(int a, int b) { int remainder = -1; // make sure a<=b (will always remain so) if(a > b) { // Swap a and b int temp = a; a = b; b = temp; } // if zero then gcd is nonzero (zero may occur in rhs of packed) if (!a) { if (b) { return b; } else { printf("**** gcd given two zeros!!\n"); abort(); } } while (remainder) { remainder = b % a; b = a; a = remainder; } return b; } static int solve(const OsiSolverInterface * model,PBCS & pbcs, OrdInt & sol) { int numberColumns = model->getNumCols(); size_solution = (numberColumns+31)/32; int numberRows = model->getNumRows(); bool all01=true; int i; const double * objective = model->getObjCoefficients(); double infinity = model->getInfinity(); const CoinPackedMatrix * matrix = model->getMatrixByRow(); const double * columnLower = model->getColLower(); const double * columnUpper = model->getColUpper(); const double * rowLower = model->getRowLower(); const double * rowUpper = model->getRowUpper(); for (i = 0; i < numberColumns; i++) { if (!model->isInteger(i)||columnLower[i]<0.0||columnUpper[i]>1.0) { all01=false; break; } } if (!all01) return -1; // Get scale factors to make integral const int * column = matrix->getIndices(); const int * rowLength = matrix->getVectorLengths(); const CoinBigIndex * rowStart = matrix->getVectorStarts(); const double * elementByRow = matrix->getElements(); // objective not too important double maximumObjElement = 0.0 ; for (i = 0 ; i < numberColumns ; i++) maximumObjElement = CoinMax(maximumObjElement,fabs(objective[i])) ; int objGood = 0 ; double objMultiplier = 2520.0 ; bool good=true; if (maximumObjElement) { while (10.0*objMultiplier*maximumObjElement < 1.0e9) objMultiplier *= 10.0 ; if (maximumObjElement*2520>=1.0e9) objMultiplier=1.0; double tolerance = 1.0e-9*objMultiplier; for (i = 0 ; i < numberColumns ; i++) { double value=fabs(objective[i])*objMultiplier ; if (!value) continue; int nearest = (int) floor(value+0.5) ; if (fabs(value-floor(value+0.5)) > tolerance) { // just take for now objGood = 1 ; good=false; break ; } else if (!objGood) { objGood = nearest ; } else { objGood = gcd(objGood,nearest) ; } } objMultiplier /= objGood; if (!good) { printf("Unable to scale objective correctly - maximum %g\n", maximumObjElement); objMultiplier = 1.0e7/maximumObjElement; } } else { objMultiplier=0.0; // no objective } double maximumElement=0.0; // now real stuff for (i=0;i=1.0e8) elMultiplier=1.0; double tolerance = 1.0e-8*elMultiplier; good=true; for (i=0;i tolerance) { elGood = 0 ; good=false; break ; } else if (!elGood) { elGood = nearest ; } else { elGood = gcd(elGood,nearest) ; } } } if (rowUpper[i]!=infinity) { double value=fabs(rowUpper[i])*elMultiplier ; if (value) { int nearest = (int) floor(value+0.5) ; if (fabs(value-floor(value+0.5)) > tolerance) { elGood = 0 ; good=false; break ; } else if (!elGood) { elGood = nearest ; } else { elGood = gcd(elGood,nearest) ; } } } for (CoinBigIndex j=rowStart[i];j tolerance) { elGood = 0 ; good=false; break ; } else if (!elGood) { elGood = nearest ; } else { elGood = gcd(elGood,nearest) ; } } } if (!good) return -1; // no good // multiplier elMultiplier /= elGood; double objOffset=0.0; model->getDblParam(OsiObjOffset,objOffset); int doMax= (model->getObjSense()<0.0) ? 1 : 0; printf("Objective multiplier is %g, element mutiplier %g, offset %g\n", objMultiplier,elMultiplier,objOffset); Products objf; Atoms atoms; save_pbcs = & pbcs; pbcs.set_atoms(&atoms); pbcs.set_enum_heuristic(0); for (i=0;i 1) std::cout << "Big M coefficient reduction changed " << changed << " coefficients"<0) { const double * objective = model->getObjCoefficients(); double objOffset=0.0; model->getDblParam(OsiObjOffset,objOffset); int numberColumns = model->getNumCols(); double * solution = new double [numberColumns]; CoinZeroN(solution,numberColumns); sol.first(); while(!sol.last()) { int var = sol.next(); if (var > 0) solution[var-1]=1.0; } OrdInt Fixed = pbcs.get_fixed(); Fixed.first(); while(!Fixed.last()) { int flit = Fixed.next(); if (flit > 0) solution[flit-1]=1.0; } // add hidden ones due to equations pbcs.Eq.first(); while(!pbcs.Eq.last()) { int l = pbcs.Eq.next(); int r = pbcs.Eq(l); if (sol.member(r) || Fixed.member(r)) solution[l-1]=1.0; else if (sol.member(-r) || Fixed.member(-r)) solution[l-1]=1.0; // just positives are added } numberFound=1; double objValue = - objOffset; for (int i=0;igetObjSense()>0 ? "minimum" : "maximum")<<" of "<setObjValue(objValue); model->setColSolution(solution); delete [] solution; } else if (!numberFound) { std::cout << "Constraint Set is unsatisfiable"<0||opbdp_number_solutions) { // all solutions numberFound = opbdp_number_solutions; return opbdp_solution; } else { // no solution return NULL; } } Osi-0.106.4/examples/build.cpp0000644000076600007660000000567512131314077014527 0ustar coincoin// Example of using COIN-OR OSI, building the instance internally // with sparse matrix object #include #include OSIXXXhpp #include "CoinPackedMatrix.hpp" #include "CoinPackedVector.hpp" int main(void) { // Create a problem pointer. We use the base class here. OsiSolverInterface *si; // When we instantiate the object, we need a specific derived class. si = new OSIXXX; // Build our own instance from scratch /* * This section adapted from Matt Galati's example * on the COIN-OR Tutorial website. * * Problem from Bertsimas, Tsitsiklis page 21 * * optimal solution: x* = (1,1) * * minimize -1 x0 - 1 x1 * s.t 1 x0 + 2 x1 <= 3 * 2 x0 + 1 x1 <= 3 * x0 >= 0 * x1 >= 0 */ int n_cols = 2; double *objective = new double[n_cols];//the objective coefficients double *col_lb = new double[n_cols];//the column lower bounds double *col_ub = new double[n_cols];//the column upper bounds //Define the objective coefficients. //minimize -1 x0 - 1 x1 objective[0] = -1.0; objective[1] = -1.0; //Define the variable lower/upper bounds. // x0 >= 0 => 0 <= x0 <= infinity // x1 >= 0 => 0 <= x1 <= infinity col_lb[0] = 0.0; col_lb[1] = 0.0; col_ub[0] = si->getInfinity(); col_ub[1] = si->getInfinity(); int n_rows = 2; double *row_lb = new double[n_rows]; //the row lower bounds double *row_ub = new double[n_rows]; //the row upper bounds //Define the constraint matrix. CoinPackedMatrix *matrix = new CoinPackedMatrix(false,0,0); matrix->setDimensions(0, n_cols); //1 x0 + 2 x1 <= 3 => -infinity <= 1 x0 + 2 x2 <= 3 CoinPackedVector row1; row1.insert(0, 1.0); row1.insert(1, 2.0); row_lb[0] = -1.0 * si->getInfinity(); row_ub[0] = 3.0; matrix->appendRow(row1); //2 x0 + 1 x1 <= 3 => -infinity <= 2 x0 + 1 x1 <= 3 CoinPackedVector row2; row2.insert(0, 2.0); row2.insert(1, 1.0); row_lb[1] = -1.0 * si->getInfinity(); row_ub[1] = 3.0; matrix->appendRow(row2); //load the problem to OSI si->loadProblem(*matrix, col_lb, col_ub, objective, row_lb, row_ub); //write the MPS file to a file called example.mps si->writeMps("example"); // Solve the (relaxation of the) problem si->initialSolve(); // Check the solution if ( si->isProvenOptimal() ) { std::cout << "Found optimal solution!" << std::endl; std::cout << "Objective value is " << si->getObjValue() << std::endl; int n = si->getNumCols(); const double* solution = si->getColSolution(); // We can then print the solution or could examine it. for( int i = 0; i < n; ++i ) std::cout << si->getColName(i) << " = " << solution[i] << std::endl; } else { std::cout << "Didn't find optimal solution." << std::endl; // Could then check other status functions. } return 0; } Osi-0.106.4/examples/basic.cpp0000644000076600007660000000233312131314077014475 0ustar coincoin// Bare bones example of using COIN-OR OSI #include #include OSIXXXhpp int main(void) { // Create a problem pointer. We use the base class here. OsiSolverInterface *si; // When we instantiate the object, we need a specific derived class. si = new OSIXXX; // Read in an mps file. This one's from the MIPLIB library. #if defined(SAMPLEDIR) si->readMps(SAMPLEDIR "/p0033"); #else fprintf(stderr, "Do not know where to find sample MPS files.\n"); exit(1); #endif // Solve the (relaxation of the) problem si->initialSolve(); // Check the solution if ( si->isProvenOptimal() ) { std::cout << "Found optimal solution!" << std::endl; std::cout << "Objective value is " << si->getObjValue() << std::endl; int n = si->getNumCols(); const double* solution = si->getColSolution(); // We can then print the solution or could examine it. for( int i = 0; i < n && i < 5; ++i ) std::cout << si->getColName(i) << " = " << solution[i] << std::endl; if( 5 < n ) std::cout << "..." << std::endl; } else { std::cout << "Didn't find optimal solution." << std::endl; // Could then check other status functions. } return 0; } Osi-0.106.4/examples/parameters.cpp0000644000076600007660000000465212101340333015554 0ustar coincoin// Example of using COIN-OR OSI // Demonstrates some problem and solution query methods // Also demonstrates some parameter setting #include #include OSIXXXhpp int main(void) { // Create a problem pointer. We use the base class here. OsiSolverInterface *si; // When we instantiate the object, we need a specific derived class. si = new OSIXXX; // Read in an mps file. This one's from the MIPLIB library. #if defined(SAMPLEDIR) si->readMps(SAMPLEDIR "/p0033"); #else fprintf(stderr, "Do not know where to find sample MPS files.\n"); exit(1); #endif // Display some information about the instance int nrows = si->getNumRows(); int ncols = si->getNumCols(); int nelem = si->getNumElements(); std::cout << "This problem has " << nrows << " rows, " << ncols << " columns, and " << nelem << " nonzeros." << std::endl; double const * upper_bounds = si->getColUpper(); std::cout << "The upper bound on the first column is " << upper_bounds[0] << std::endl; // All information about the instance is available with similar methods // Before solving, indicate some parameters si->setIntParam( OsiMaxNumIteration, 10); si->setDblParam( OsiPrimalTolerance, 0.001 ); // Can also read parameters std::string solver; si->getStrParam( OsiSolverName, solver ); std::cout << "About to solve with: " << solver << std::endl; // Solve the (relaxation of the) problem si->initialSolve(); // Check the solution if ( si->isProvenOptimal() ) { std::cout << "Found optimal solution!" << std::endl; std::cout << "Objective value is " << si->getObjValue() << std::endl; // Examine solution int n = si->getNumCols(); const double *solution; solution = si->getColSolution(); std::cout << "Solution: "; for (int i = 0; i < n; i++) std::cout << solution[i] << " "; std::cout << std::endl; std::cout << "It took " << si->getIterationCount() << " iterations" << " to solve." << std::endl; } else { std::cout << "Didn't find optimal solution." << std::endl; // Check other status functions. What happened? if (si->isProvenPrimalInfeasible()) std::cout << "Problem is proven to be infeasible." << std::endl; if (si->isProvenDualInfeasible()) std::cout << "Problem is proven dual infeasible." << std::endl; if (si->isIterationLimitReached()) std::cout << "Reached iteration limit." << std::endl; } return 0; } Osi-0.106.4/examples/Makefile.in0000644000076600007660000001072212101340333014745 0ustar coincoin# Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # $Id: Makefile.in 1881 2013-01-28 00:05:47Z stefan $ ########################################################################## # You can modify this example makefile to fit for your own program. # # Usually, you only need to change CHANGEME entries below. # ########################################################################## # CHANGEME # To compile other examples, either change the following line, or add the # argument DRIVER=filename_without_extension to make, e.g., # `make DRIVER=parameters' DRIVER = basic # CHANGME # This should be the name of your executable; change if you want a name # that's different from the file name. EXE = $(DRIVER)@EXEEXT@ # CHANGEME # OBJS should include all object files necessary to build your program. For # the examples, only one file is needed for each example. You will probably # have more as your code grows. OBJS = $(DRIVER).@OBJEXT@ # CHANGEME # Additional libraries. The examples require only the COIN libraries specified # as LIBS below. You may need more. ADDLIBS = # CHANGEME # Additional flags for compilation (e.g., include flags). As for libraries, # the examples require only COIN include files, specified as part of CXXFLAGS # below. ADDINCFLAGS = # CHANGEME # Directory to the sources for the (example) problem definition files. VPATH # is used if you are building in a different directory than the source. This # can be handy for various reasons; if none occur to you, don't worry about # it. SRCDIR = @srcdir@ VPATH = @srcdir@ ########################################################################## # Usually, you don't have to change anything below. Note that if you # # change certain compiler options, you might have to recompile the # # package. # ########################################################################## COIN_HAS_PKGCONFIG = @COIN_HAS_PKGCONFIG_TRUE@TRUE COIN_CXX_IS_CL = @COIN_CXX_IS_CL_TRUE@TRUE COIN_HAS_SAMPLE = @COIN_HAS_SAMPLE_TRUE@TRUE COIN_HAS_NETLIB = @COIN_HAS_NETLIB_TRUE@TRUE # C++ Compiler command CXX = @CXX@ # C++ Compiler options CXXFLAGS = @CXXFLAGS@ @OSI_EXAMPLES_SOLVER_CFLAGS@ \ -DOSIXXXhpp=\"@OSI_EXAMPLES_SOLVER_NAME@.hpp\" -DOSIXXX=@OSI_EXAMPLES_SOLVER_NAME@ # Sample data directory ifeq ($(COIN_HAS_SAMPLE), TRUE) ifeq ($(COIN_HAS_PKGCONFIG), TRUE) CXXFLAGS += -DSAMPLEDIR=\"`PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --variable=datadir coindatasample`\" else CXXFLAGS += -DSAMPLEDIR=\"@SAMPLE_DATA_INSTALLED@\" endif endif # Netlib data directory ifeq ($(COIN_HAS_NETLIB), TRUE) ifeq ($(COIN_HAS_PKGCONFIG), TRUE) CXXFLAGS += -DNETLIBDIR=\"`PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --variable=datadir coindatanetlib`\" else CXXFLAGS += -DNETLIBDIR=\"@NETLIB_DATA_INSTALLED@\" endif endif # additional C++ Compiler options for linking CXXLINKFLAGS = @RPATH_FLAGS@ # Include directories (we use the CYGPATH_W variables to allow compilation with Windows compilers) ifeq ($(COIN_HAS_PKGCONFIG), TRUE) INCL = `PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --cflags @OSI_EXAMPLES_SOLVER_PCNAME@ osi` else INCL = @OSILIB_CFLAGS_INSTALLED@ endif INCL += $(ADDINCFLAGS) # Linker flags ifeq ($(COIN_HAS_PKGCONFIG), TRUE) LIBS = `PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --libs @OSI_EXAMPLES_SOLVER_PCNAME@ osi` else ifeq ($(COIN_CXX_IS_CL), TRUE) LIBS = -link -libpath:`$(CYGPATH_W) @abs_lib_dir@` libOsi.lib @OSI_EXAMPLES_SOLVER_LIBS@ @OSILIB_LIBS_INSTALLED@ else LIBS = -L@abs_lib_dir@ -lOsi @OSI_EXAMPLES_SOLVER_LIBS@ @OSILIB_LIBS_INSTALLED@ endif endif # The following is necessary under cygwin, if native compilers are used CYGPATH_W = @CYGPATH_W@ all: $(EXE) .SUFFIXES: .cpp .c .o .obj $(EXE): $(OBJS) bla=;\ for file in $(OBJS); do bla="$$bla `$(CYGPATH_W) $$file`"; done; \ $(CXX) $(CXXLINKFLAGS) $(CXXFLAGS) -o $@ $$bla $(LIBS) $(ADDLIBS) clean: rm -rf $(EXE) $(OBJS) .cpp.o: $(CXX) $(CXXFLAGS) $(INCL) -c -o $@ `test -f '$<' || echo '$(SRCDIR)/'`$< .cpp.obj: $(CXX) $(CXXFLAGS) $(INCL) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(SRCDIR)/$<'; fi` .c.o: $(CC) $(CFLAGS) $(INCL) -c -o $@ `test -f '$<' || echo '$(SRCDIR)/'`$< .c.obj: $(CC) $(CFLAGS) $(INCL) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(SRCDIR)/$<'; fi` Osi-0.106.4/examples/README0000644000076600007660000000044711603614254013577 0ustar coincoinThese examples are from the OSI tutorial at INFORMS Atlanta 2003 by Brady Hunsaker and the workshop section on OSI given by Matthew Saltzman at CORS/INFORMS Banff 2004. The accompanying slides and handouts can be found at http://www.coin-or.org/Presentations/CORSINFORMSWorkshop04/index.html Osi-0.106.4/examples/opbdp_solve.hpp0000644000076600007660000000273111403136004015730 0ustar coincoin// Copyright (C) 2006, International Business Machines // Corporation and others. All Rights Reserved. #ifndef OsiOpbdpSolve_H #define OsiOpbdpSolve_H #include #include "OsiSolverInterface.hpp" /** Solve pure 0-1 with integral coefficients etc (or can be made by scaling) using opdbp The solution will be set in model If no solution then returns 0, if not suitable returns -1 */ int solveOpbdp(OsiSolverInterface * model); /** Find all solutions of a pure 0-1 with integral coefficients etc (or can be made by scaling) using opdbp Returns an array of bit solution vectors. i is 1 if bit set (see below) If no solution then numberFound will be 0, if not suitable -1 This needs the line at about 206 of EnumerateOpt.cpp local_maximum = value + 1; // try to reach that one! replaced by if (verbosity!=-1) { local_maximum = value + 1; // try to reach that one! } else { local_maximum = 0; void opbdp_save_solution(OrdInt & sol); OrdInt sol = last_solution.to_OrdInt(); opbdp_save_solution(sol); // save solution } */ unsigned int ** solveOpbdp(const OsiSolverInterface * model,int & numberFound); inline bool atOne(int i,unsigned int * array) { return ((array[i>>5]>>(i&31))&1)!=0; } inline void setAtOne(int i,unsigned int * array,bool trueFalse) { unsigned int & value = array[i>>5]; int bit = i&31; if (trueFalse) value |= (1< $(addlibsdir)/osi_addlibs.txt else if COIN_CXX_IS_CL echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libOsi.lib @OSILIB_LIBS_INSTALLED@" > $(addlibsdir)/osi_addlibs.txt else echo -L@abs_lib_dir@ -lOsi @OSILIB_LIBS_INSTALLED@ > $(addlibsdir)/osi_addlibs.txt endif endif uninstall-hook: rm -f $(addlibsdir)/osi_addlibs.txt ######################################################################## # Maintainer Stuff # ######################################################################## CLEANFILES = # Files that are generated and should be cleaned with make distclean DISTCLEANFILES = include BuildTools/Makemain.inc Osi-0.106.4/configure.ac0000644000076600007660000002055012244016312013355 0ustar coincoin# Copyright (C) 2006 International Business Machines. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: configure.ac 1945 2013-11-23 03:11:06Z tkr $ # Author: Andreas Waechter IBM 2006-04-13 ############################################################################# # Names and other basic things # ############################################################################# AC_PREREQ(2.59) AC_INIT([Osi],[0.106.4],[osi@list.coin-or.org]) AC_COPYRIGHT([ Copyright 2006 International Business Machines and others. All Rights Reserved. This file is part of the open source package Coin which is distributed under the Eclipse Public License.]) # List one file in the package so that the configure script can test # whether the package is actually there AC_CONFIG_SRCDIR(src/Osi/OsiAuxInfo.cpp) # Where should everything be installed by default? Here, we want it # to be installed directly in 'bin', 'lib', 'include' subdirectories # of the directory where configure is run. The default would be # /usr/local. AC_PREFIX_DEFAULT([`pwd`]) ############################################################################# # Standard build tool stuff # ############################################################################# # Get the system type AC_CANONICAL_BUILD # A bit of initial setup AC_COIN_PROJECTDIR_INIT(Osi,12:4:11) # Check if user wants to produce debugging code AC_COIN_DEBUG_COMPILE(Osi) # Get the name of the C++ compiler and appropriate compiler options AC_COIN_PROG_CXX # Initialize automake and libtool AC_COIN_INIT_AUTO_TOOLS ############################################################################# # COIN-OR components # ############################################################################# AC_COIN_CHECK_PACKAGE(CoinUtils, [coinutils], [OsiLib]) if test $coin_has_coinutils != yes ; then AC_MSG_ERROR([Required package CoinUtils not available.]) fi AC_COIN_CHECK_PACKAGE(Glpk, [coinglpk], [OsiGlpkLib]) AC_COIN_CHECK_PACKAGE(SoPlex, [coinsoplex],[OsiSpxLib]) AC_COIN_CHECK_PACKAGE(Sample, [coindatasample]) AC_COIN_CHECK_PACKAGE(Netlib, [coindatanetlib]) ############################################################################# # Third party solvers # ############################################################################# # Check which third party solvers are available. Cplex detection has been # tested on a semi-regular basis, and Mosek detection most likely works. For # the rest, it's anyone's guess. -- lh, 080529 -- # fixed detection of Mosek and Xpress -- stefan, 091003 (linux32, gcc) -- AC_COIN_CHECK_USER_LIBRARY([Cplex], [CPX],[cplex.h], [CPXgetstat]) AC_COIN_CHECK_USER_LIBRARY([Mosek], [MSK],[mosek.h], [MSK_makeenv]) AC_COIN_CHECK_USER_LIBRARY([Xpress],[XPR],[xprs.h], [XPRSinit]) AC_COIN_CHECK_USER_LIBRARY([Gurobi],[GRB],[gurobi_c.h],[GRBloadenv]) ############################################################################# # Examples solver # ############################################################################# # choose a solver interface that can be used in the examples if test $coin_has_glpk = yes ; then OSI_EXAMPLES_SOLVER_NAME=OsiGlpkSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="$GLPK_CFLAGS" OSI_EXAMPLES_SOLVER_LIBS="-lOsiGlpk $GLPK_LIBS_INSTALLED" OSI_EXAMPLES_SOLVER_PCNAME=osi-glpk elif test $coin_has_cpx = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiCpxSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$CPXINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiCpx $CPXLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-cplex elif test $coin_has_grb = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiGrbSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$GRBINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiGrb $GRBLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-gurobi elif test $coin_has_msk = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiMskSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$MSKINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiMsk $MSKLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-mosek elif test $coin_has_xpr = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiXprSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$XPRINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiXpr $XPRLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-xpress elif test $coin_has_soplex = yes ; then OSI_EXAMPLES_SOLVER_NAME=OsiSpxSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="$SOPLEX_CFLAGS" OSI_EXAMPLES_SOLVER_LIBS="-lOsiSpx $SOPLEX_LIBS_INSTALLED" OSI_EXAMPLES_SOLVER_PCNAME=osi-soplex else AC_MSG_WARN([No solver available, examples will not work.]) fi # adjust linker flags for (i)cl compiler if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then [OSI_EXAMPLES_SOLVER_LIBS=`echo " $OSI_EXAMPLES_SOLVER_LIBS" | sed -e 's/ -l\([^ ]*\)/ lib\1.lib/g' -e 's/ -L\([^ ]*\)/ -libpath:\`$(CYGPATH_W) \1\`/g'`] fi AC_SUBST(OSI_EXAMPLES_SOLVER_NAME) AC_SUBST(OSI_EXAMPLES_SOLVER_CFLAGS) AC_SUBST(OSI_EXAMPLES_SOLVER_LIBS) AC_SUBST(OSI_EXAMPLES_SOLVER_PCNAME) ############################################################################# # Configuration options for individual OSIs # ############################################################################# # If any of the tests performed in this section actually require the presence # of the solver (file presence, link checks, etc.) be sure to guard the call. # We assume that GLPK is not too old AC_DEFINE(GLPK_HAS_INTOPT, [1], [Define to 1 if GLPK has the advanced B&B solver lpx_intopt]) ############################################################################# # Check for doxygen # ############################################################################# AC_COIN_DOXYGEN(CoinUtils) ############################################################################# # System header # ############################################################################# AC_COIN_CHECK_CXX_CHEADER(math) AC_COIN_CHECK_CXX_CHEADER(float) AC_COIN_CHECK_CXX_CHEADER(ieeefp) ############################################################################## # Finishing up by writing all the output # ############################################################################## # Here list all the files that configure should create (except for the # configuration header file) AC_CONFIG_FILES([Makefile examples/Makefile src/Osi/Makefile src/OsiCpx/Makefile src/OsiGlpk/Makefile src/OsiMsk/Makefile src/OsiXpr/Makefile src/OsiGrb/Makefile src/OsiSpx/Makefile src/OsiCommonTest/Makefile test/Makefile osi.pc osi-uninstalled.pc osi-unittests.pc osi-unittests-uninstalled.pc]) if test $coin_has_cpx = true ; then AC_CONFIG_FILES([osi-cplex.pc:src/OsiCpx/osi-cplex.pc.in osi-cplex-uninstalled.pc:src/OsiCpx/osi-cplex-uninstalled.pc.in]) fi if test $coin_has_glpk = yes ; then AC_CONFIG_FILES([osi-glpk.pc:src/OsiGlpk/osi-glpk.pc.in osi-glpk-uninstalled.pc:src/OsiGlpk/osi-glpk-uninstalled.pc.in]) fi if test $coin_has_grb = true ; then AC_CONFIG_FILES([osi-gurobi.pc:src/OsiGrb/osi-gurobi.pc.in osi-gurobi-uninstalled.pc:src/OsiGrb/osi-gurobi-uninstalled.pc.in]) fi if test $coin_has_msk = true ; then AC_CONFIG_FILES([osi-mosek.pc:src/OsiMsk/osi-mosek.pc.in osi-mosek-uninstalled.pc:src/OsiMsk/osi-mosek-uninstalled.pc.in]) fi if test $coin_has_xpr = true ; then AC_CONFIG_FILES([osi-xpress.pc:src/OsiXpr/osi-xpress.pc.in osi-xpress-uninstalled.pc:src/OsiXpr/osi-xpress-uninstalled.pc.in]) fi if test $coin_has_soplex = yes ; then AC_CONFIG_FILES([osi-soplex.pc:src/OsiSpx/osi-soplex.pc.in osi-soplex-uninstalled.pc:src/OsiSpx/osi-soplex-uninstalled.pc.in]) fi AC_CONFIG_FILES([doxydoc/doxygen.conf]) # Here put the location and name of the configuration header file AC_CONFIG_HEADER([src/Osi/config.h src/Osi/config_osi.h]) # Finally, we let configure write all the output... AC_COIN_FINALIZE Osi-0.106.4/src/0000755000076600007660000000000012244064313011660 5ustar coincoinOsi-0.106.4/src/OsiCommonTest/0000755000076600007660000000000012244064313014423 5ustar coincoinOsi-0.106.4/src/OsiCommonTest/OsiColCutTest.cpp0000644000076600007660000002555011541753202017643 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). //#include //#include //#include #include "CoinPragma.hpp" #include "OsiUnitTests.hpp" #include "OsiColCut.hpp" //-------------------------------------------------------------------------- void OsiColCutUnitTest(const OsiSolverInterface * baseSiP, const std::string & mpsDir) { // Test default constructor { OsiColCut r; OSIUNITTEST_ASSERT_ERROR(r.lbs_.getIndices() == NULL, {}, "osicolcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.lbs_.getElements() == NULL, {}, "osicolcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.lbs_.getNumElements() == 0, {}, "osicolcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.lbs().getNumElements() == 0, {}, "osicolcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.ubs_.getIndices() == NULL, {}, "osicolcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.ubs_.getElements() == NULL, {}, "osicolcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.ubs_.getNumElements() == 0, {}, "osicolcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.ubs().getNumElements() == 0, {}, "osicolcut", "default constructor"); } // Test set and get methods const int ne = 4; int inx[ne] = { 1, 3, 4, 7 }; double el[ne] = { 1.2, 3.4, 5.6, 7.8 }; const int ne3 = 0; int * inx3=NULL; double * el3= NULL; { OsiColCut r; // Test setting/getting bounds r.setLbs( ne, inx, el ); r.setEffectiveness(222.); OSIUNITTEST_ASSERT_ERROR(r.lbs().getNumElements() == ne, return, "osicolcut", "setting bounds"); bool bounds_ok = true; for ( int i=0; iclone(); std::string fn = mpsDir+"exmip1"; imP->readMps(fn.c_str(),"mps"); OSIUNITTEST_ASSERT_ERROR(!r.consistent(*imP), {}, "osicolcut", "consistent"); delete imP; } { const int ne = 1; int inx[ne] = { 100 }; double el[ne] = { 1.2 }; const int ne1 = 2; int inx1[ne1] = { 50, 100 }; double el1[ne1] = { 100., 1. }; OsiColCut r; r.setUbs( ne, inx, el ); r.setLbs( ne1, inx1, el1 ); OSIUNITTEST_ASSERT_ERROR(r.consistent(), {}, "osicolcut", "consistent"); } { // Test consistent(IntegerModel) method. OsiSolverInterface * imP = baseSiP->clone(); std::string fn = mpsDir+"exmip1"; imP->readMps(fn.c_str(),"mps"); OsiColCut cut; const int ne=1; int inx[ne]={20}; double el[ne]={0.25}; cut.setLbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!cut.consistent(*imP), {}, "osicolcut", "consistent(IntegerModel)"); cut.setLbs(0,NULL,NULL); cut.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!cut.consistent(*imP), {}, "osicolcut", "consistent(IntegerModel)"); inx[0]=4; cut.setLbs(ne,inx,el); cut.setUbs(0,NULL,NULL); OSIUNITTEST_ASSERT_ERROR( cut.consistent(*imP), {}, "osicolcut", "consistent(IntegerModel)"); el[0]=4.5; cut.setLbs(0,NULL,NULL); cut.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cut.consistent(*imP), {}, "osicolcut", "consistent(IntegerModel)"); cut.setLbs(ne,inx,el); cut.setUbs(0,NULL,NULL); OSIUNITTEST_ASSERT_ERROR( cut.consistent(*imP), {}, "osicolcut", "consistent(IntegerModel)"); OSIUNITTEST_ASSERT_ERROR( cut.infeasible(*imP), {}, "osicolcut", "infeasible(IntegerModel)"); el[0]=3.0; cut.setLbs(ne,inx,el); cut.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cut.consistent(*imP), {}, "osicolcut", "consistent(IntegerModel)"); delete imP; } { //Test infeasible(im) method // Test consistent(IntegerModel) method. OsiSolverInterface * imP = baseSiP->clone(); std::string fn = mpsDir+"exmip1"; imP->readMps(fn.c_str(),"mps"); OsiColCut cut; const int ne=1; int inx[ne]={4}; double el[ne]={4.5}; cut.setLbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cut.infeasible(*imP), {}, "osicolcut", "infeasible(IntegerModel)"); el[0]=0.25; cut.setLbs(0,NULL,NULL); cut.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cut.infeasible(*imP), {}, "osicolcut", "infeasible(IntegerModel)"); el[0]=3.0; cut.setLbs(ne,inx,el); cut.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!cut.infeasible(*imP), {}, "osicolcut", "infeasible(IntegerModel)"); delete imP; } { //Test violation double solution[]={1.0}; OsiColCut cut; const int ne=1; int inx[ne]={0}; double el[ne]={4.5}; cut.setLbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cut.violated(solution), {}, "osicolcut", "violated"); el[0]=0.25; cut.setLbs(0,NULL,NULL); cut.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cut.violated(solution), {}, "osicolcut", "violated"); el[0]=1.0; cut.setLbs(ne,inx,el); cut.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!cut.violated(solution), {}, "osicolcut", "violated"); } } Osi-0.106.4/src/OsiCommonTest/OsiCutsTest.cpp0000644000076600007660000002645411541753202017374 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include "CoinPragma.hpp" #include "OsiUnitTests.hpp" #include "OsiCuts.hpp" //-------------------------------------------------------------------------- void OsiCutsUnitTest() { CoinRelFltEq eq; // Test default constructor { OsiCuts r; OSIUNITTEST_ASSERT_ERROR(r.colCutPtrs_.empty(), {}, "osicuts", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.rowCutPtrs_.empty(), {}, "osicuts", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.sizeColCuts() == 0, {}, "osicuts", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.sizeRowCuts() == 0, {}, "osicuts", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.sizeCuts() == 0, {}, "osicuts", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.mostEffectiveCutPtr() == NULL, {}, "osicuts", "default constructor"); } // Create some cuts OsiRowCut rcv[5]; OsiColCut ccv[5]; OsiCuts cuts; int i; for ( i=0; i<5; i++ ) { rcv[i].setEffectiveness(100.+i); ccv[i].setEffectiveness(200.+i); cuts.insert(rcv[i]); cuts.insert(ccv[i]); } OsiCuts rhs; { OsiCuts cs; // test inserting & accessing cut for ( i = 0; i < 5; i++ ) { OSIUNITTEST_ASSERT_ERROR(cs.sizeRowCuts() == i, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(cs.sizeCuts() == 2*i, {}, "osicuts", "inserting and accessing cuts"); cs.insert(rcv[i]); OSIUNITTEST_ASSERT_ERROR(cs.sizeRowCuts() == i+1, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(cs.sizeCuts() == 2*i+1, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(cs.rowCut(i) == rcv[i], {}, "osicuts", "inserting and accessing cuts"); #if 0 const OsiCut * cp = cs.cutPtr(2*i); OSIUNITTEST_ASSERT_ERROR(cs.rowCut(i).effectiveness() == cp->effectiveness(), {}, "osicuts", "inserting and accessing cuts"); const OsiRowCut * rcP = dynamic_cast( cp ); OSIUNITTEST_ASSERT_ERROR(rcP != NULL, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(*rcP == rcv[i], {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(dynamic_cast(cs.cutPtr(2*i)) == NULL, {}, "osicuts", "inserting and accessing cuts"); #endif OSIUNITTEST_ASSERT_ERROR(cs.sizeColCuts() == i, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(cs.sizeCuts() == 2*i+1, {}, "osicuts", "inserting and accessing cuts"); cs.insert(ccv[i]); OSIUNITTEST_ASSERT_ERROR(cs.sizeColCuts() == i+1, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(cs.sizeCuts() == 2*i+2, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(cs.colCut(i) == ccv[i], {}, "osicuts", "inserting and accessing cuts"); #if 0 OSIUNITTEST_ASSERT_ERROR(dynamic_cast(cs.cutPtr(2*i+1)) == NULL, {}, "osicuts", "inserting and accessing cuts"); ccP = dynamic_cast( cs.cutPtr(2*i+1) ); OSIUNITTEST_ASSERT_ERROR(ccP != NULL, {}, "osicuts", "inserting and accessing cuts"); OSIUNITTEST_ASSERT_ERROR(*ccP == ccv[i], {}, "osicuts", "inserting and accessing cuts"); #endif OSIUNITTEST_ASSERT_ERROR(eq(cs.mostEffectiveCutPtr()->effectiveness(),200.0+i), {}, "osicuts", "inserting and accessing cuts"); } // Test inserting collection of OsiCuts { OsiCuts cs; cs.insert(cuts); OSIUNITTEST_ASSERT_ERROR(cs.sizeColCuts() == 5, {}, "osicuts", "inserting collection of cuts"); OSIUNITTEST_ASSERT_ERROR(cs.sizeRowCuts() == 5, {}, "osicuts", "inserting collection of cuts"); OSIUNITTEST_ASSERT_ERROR(cs.sizeCuts() == 10, {}, "osicuts", "inserting collection of cuts"); } /* Test handling of cut pointers. Create a vector of cut pointers, then add them to the collection. Dump the row cuts, then add again. The cut objects should be deleted when the OsiCuts object is deleted at the end of the block. This test should be monitored with some flavour of runtime access checking to be sure that cuts are not freed twice or not freed at all. */ { OsiCuts cs; OsiRowCut *rcPVec[5] ; OsiColCut *ccPVec[5] ; for (i = 0 ; i < 5 ; i++) { rcPVec[i] = rcv[i].clone() ; ccPVec[i] = ccv[i].clone() ; } // test inserting cut ptr & accessing cut for ( i=0; i<5; i++ ) { OSIUNITTEST_ASSERT_ERROR(cs.sizeRowCuts() == i, {}, "osicuts", "handling of cut pointers"); OsiRowCut * rcP = rcPVec[i] ; OSIUNITTEST_ASSERT_ERROR(rcP != NULL, {}, "osicuts", "handling of cut pointers"); cs.insert(rcP); OSIUNITTEST_ASSERT_ERROR(rcP == NULL, {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.sizeRowCuts() == i+1, {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.rowCut(i) == rcv[i], {}, "osicuts", "handling of cut pointers"); OsiColCut * ccP = ccPVec[i] ; OSIUNITTEST_ASSERT_ERROR(ccP != NULL, {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.sizeColCuts() == i, {}, "osicuts", "handling of cut pointers"); cs.insert(ccP); OSIUNITTEST_ASSERT_ERROR(ccP == NULL, {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.sizeColCuts() == i+1, {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.colCut(i) == ccv[i], {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(eq(cs.mostEffectiveCutPtr()->effectiveness(),200.0+i), {}, "osicuts", "handling of cut pointers"); } cs.dumpCuts() ; // row cuts only for ( i=0; i<5; i++ ) { OSIUNITTEST_ASSERT_ERROR(cs.sizeRowCuts() == i, {}, "osicuts", "handling of cut pointers"); OsiRowCut * rcP = rcPVec[i] ; OSIUNITTEST_ASSERT_ERROR(rcP != NULL, {}, "osicuts", "handling of cut pointers"); cs.insert(rcP); OSIUNITTEST_ASSERT_ERROR(rcP == NULL, {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.sizeRowCuts() == i+1, {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.rowCut(i) == rcv[i], {}, "osicuts", "handling of cut pointers"); OSIUNITTEST_ASSERT_ERROR(cs.sizeColCuts() == 5, {}, "osicuts", "handling of cut pointers"); } } // Test copy constructor OsiCuts csC(cs); OSIUNITTEST_ASSERT_ERROR(csC.sizeRowCuts() == 5, {}, "osicuts", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(csC.sizeColCuts() == 5, {}, "osicuts", "copy constructor"); bool copy_ok = true; for ( i=0; i<5; i++ ) { copy_ok &= csC.rowCut(i) == rcv[i]; copy_ok &= csC.colCut(i) == ccv[i]; copy_ok &= csC.rowCut(i) == cs.rowCut(i); copy_ok &= csC.colCut(i) == cs.colCut(i);; } OSIUNITTEST_ASSERT_ERROR(copy_ok, {}, "osicuts", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(eq(csC.mostEffectiveCutPtr()->effectiveness(),204.0), {}, "osicuts", "copy constructor"); rhs = cs; } // Test results of assignment operation bool ok = true; for ( i=0; i<5; i++ ) { ok &= rhs.rowCut(i) == rcv[i]; ok &= rhs.colCut(i) == ccv[i]; } OSIUNITTEST_ASSERT_ERROR(ok, {}, "osicuts", "assignment operator"); OSIUNITTEST_ASSERT_ERROR(eq(rhs.mostEffectiveCutPtr()->effectiveness(),204.0), {}, "osicuts", "assignment operator"); // Test removing cuts { OsiCuts t(rhs); OSIUNITTEST_ASSERT_ERROR(t.sizeRowCuts() == 5, {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.sizeColCuts() == 5, {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(eq(rhs.mostEffectiveCutPtr()->effectiveness(),204.0), {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(eq( t.mostEffectiveCutPtr()->effectiveness(),204.0), {}, "osicuts", "removing cuts"); t.eraseRowCut(3); OSIUNITTEST_ASSERT_ERROR(t.sizeRowCuts() == 4, {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.sizeColCuts() == 5, {}, "osicuts", "removing cuts"); bool ok = true; for ( i=0; i<5; i++ ) ok &= t.colCut(i) == ccv[i]; OSIUNITTEST_ASSERT_ERROR(ok, {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(0) == rcv[0], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(1) == rcv[1], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(2) == rcv[2], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(3) == rcv[4], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(eq(t.mostEffectiveCutPtr()->effectiveness(),204.0), {}, "osicuts", "removing cuts"); t.eraseColCut(4); OSIUNITTEST_ASSERT_ERROR(t.sizeRowCuts() == 4, {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.sizeColCuts() == 4, {}, "osicuts", "removing cuts"); ok = true; for ( i=0; i<4; i++ ) ok &= t.colCut(i) == ccv[i]; OSIUNITTEST_ASSERT_ERROR(ok, {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(0) == rcv[0], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(1) == rcv[1], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(2) == rcv[2], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(t.rowCut(3) == rcv[4], {}, "osicuts", "removing cuts"); OSIUNITTEST_ASSERT_ERROR(eq(t.mostEffectiveCutPtr()->effectiveness(),203.0), {}, "osicuts", "removing cuts"); } // sorting cuts { OsiCuts t(rhs); OSIUNITTEST_ASSERT_ERROR(t.sizeRowCuts() == 5, {}, "osicuts", "sorting cuts"); OSIUNITTEST_ASSERT_ERROR(t.sizeColCuts() == 5, {}, "osicuts", "sorting cuts"); t.rowCut(0).setEffectiveness(9.); t.rowCut(1).setEffectiveness(1.); t.rowCut(2).setEffectiveness(7.); t.rowCut(3).setEffectiveness(3.); t.rowCut(4).setEffectiveness(5.); t.colCut(0).setEffectiveness(2.); t.colCut(1).setEffectiveness(8.); t.colCut(2).setEffectiveness(4.); t.colCut(3).setEffectiveness(6.); t.colCut(4).setEffectiveness(.5); double totEff=1.+2.+3.+4.+5.+6.+7.+8.+9.+0.5; { // Test iterator over all cuts double sumEff=0.; for ( OsiCuts::iterator it=t.begin(); it!=t.end(); ++it ) { double eff=(*it)->effectiveness(); sumEff+= eff; } OSIUNITTEST_ASSERT_ERROR(sumEff == totEff, {}, "osicuts", "sorting cuts"); } t.sort(); bool colcutsort_ok = true; for ( i=1; i<5; i++ ) colcutsort_ok &= t.colCut(i-1)>t.colCut(i); OSIUNITTEST_ASSERT_ERROR(colcutsort_ok, {}, "osicuts", "sorting cuts"); bool rowcutsort_ok = true; for ( i=1; i<5; i++ ) rowcutsort_ok &= t.rowCut(i-1)>t.rowCut(i); OSIUNITTEST_ASSERT_ERROR(rowcutsort_ok, {}, "osicuts", "sorting cuts"); { // Test iterator over all cuts double sumEff=0.; for ( OsiCuts::iterator it=t.begin(); it!=t.end(); ++it ) { sumEff+= (*it)->effectiveness(); } OSIUNITTEST_ASSERT_ERROR(sumEff == totEff, {}, "osicuts", "sorting cuts"); } { OsiCuts::iterator it=t.begin(); OsiCut * cm1 = *it; ++it; bool sort_ok = true; for( ; it!=t.end(); it++ ) { OsiCut * c = *it; sort_ok &= (*cm1)>(*c); cm1 = c; } OSIUNITTEST_ASSERT_ERROR(sort_ok, {}, "osicuts", "sorting cuts"); } } } Osi-0.106.4/src/OsiCommonTest/OsiSimplexAPITest.cpp0000644000076600007660000005647712101340333020427 0ustar coincoin/* Copyright (C) 2000 -- 2010, Lou Hafer, International Business Machines, and others. All Rights Reserved. This code is licensed under the terms of the Eclipse Public License (EPL). */ #include "CoinPragma.hpp" #include "OsiUnitTests.hpp" #include "OsiConfig.h" /* #include "CoinTime.hpp" #include #include #include #include #include #include #include */ #include "CoinHelperFunctions.hpp" #include "CoinFinite.hpp" #include "CoinFloatEqual.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "OsiSolverInterface.hpp" using namespace OsiUnitTest ; /* Helper methods for the OSI simplex API test. */ namespace { /* Test that the given vector is a unit vector with a 1 in the specified index position */ bool isUnitVector (int /* ndx */, int len, double *vec) { bool retval = false ; CoinAbsFltEq fltEq ; int nzCount = 0 ; int oneCount = 0 ; int onePosn = -1 ; for (int j = 0 ; j < len ; j++) { if (!fltEq(vec[j],0.0)) { nzCount++ ; if (fltEq(vec[j],1.0)) { oneCount++ ; onePosn = j ; } } } if (nzCount == 1 && oneCount == 1 && onePosn >= 0) { retval = true ; } if (OsiUnitTest::verbosity >= 2 && !retval) { if (nzCount > oneCount) { std::cout << " Vector contains " << nzCount-oneCount << " elements that are neither 1.0 or 0.0." << std::endl ; } if (oneCount > 1) { std::cout << " Vector contains " << oneCount << " elements that are 1.0." << std::endl ; } if (oneCount < 1) { std::cout << " Vector contains no elements that are 1.0." << std::endl ; } } return (retval) ; } /* Build a constraint system in basis order. Assumes that enableFactorization has been called. Indirect test of getBasics, because if the basis columns are loaded incorrectly, checks that B inv(B) = I will surely fail. */ CoinPackedMatrix *buildBasisMatrix (const OsiSolverInterface *si) { std::string solverName ; si->getStrParam(OsiSolverName,solverName) ; CoinPackedMatrix *basisMtx = new CoinPackedMatrix() ; const CoinPackedMatrix *mtx = si->getMatrixByCol() ; int m = si->getNumRows() ; int n = si->getNumCols() ; int *basicIndices = new int[m] ; si->getBasics(basicIndices) ; for (int i = 0 ; i < m ; i++) { int j = basicIndices[i] ; if (j < n) { if (OsiUnitTest::verbosity >= 2) { std::cout << " Retrieving column " << j << " for basis pos'n " << i << "." << std::endl ; } CoinShallowPackedVector col = mtx->getVector(j) ; basisMtx->appendCol(col) ; } else { j -= n ; if (OsiUnitTest::verbosity >= 2) { std::cout << " Fabricating e<" << j << "> for basis pos'n " << i << "." << std::endl ; } CoinPackedVector ei = CoinPackedVector(1,&j,1.0) ; basisMtx->appendCol(ei) ; } } return (basisMtx) ; } /* Test columns beta = inv(B)e of the basis inverse by calculating B beta and checking that the result is the appropriate unit vector. Also tests getBasics, because we use it to build the basis matrix. It's assumed that the si passed as a parameter is ready for tableau queries: a problem has been loaded and solved to optimality and enableFactorization has been called. */ void testBInvCol (const OsiSolverInterface *si) { std::string solverName ; si->getStrParam(OsiSolverName,solverName) ; int m = si->getNumRows() ; std::cout << " Testing getBInvCol ... " << std::endl; CoinPackedMatrix *basisMtx = buildBasisMatrix(si) ; /* Fetch beta, calculate B beta, k = 0, ..., m-1, and check that we have the appropriate unit vector. */ double *betak = new double[m] ; double *ek = new double[m] ; for (int k = 0 ; k < m ; k++) { CoinFillN(betak,m,COIN_DBL_MAX) ; CoinFillN(ek,m,COIN_DBL_MAX) ; OSIUNITTEST_CATCH_ERROR(si->getBInvCol(k,betak), {}, solverName, "testBInvCol"); basisMtx->times(betak,ek) ; OSIUNITTEST_ASSERT_ERROR(isUnitVector(k,m,ek), if (OsiUnitTest::verbosity >= 1) { std::cout << " " << "B beta<" << k << "> != e<" << k << ">." << std::endl ; }, solverName, "testBInvCol"); } delete[] betak ; delete[] ek ; delete basisMtx ; } /* Test rows beta = einv(B) of the basis inverse by calculating betaB and checking that the result is the appropriate unit vector. Also tests getBasics, because we need it to build the basis matrix. It's assumed that the si passed as a parameter is ready for tableau queries: a problem has been loaded and solved to optimality and enableFactorization has been called. */ void testBInvRow (const OsiSolverInterface *si) { std::string solverName ; si->getStrParam(OsiSolverName,solverName) ; int m = si->getNumRows() ; std::cout << " Testing getBInvRow ... " << std::endl; /* Should construct in row-major form for transposeTimes, but efficiency is not all that big an issue here. */ CoinPackedMatrix *basisMtx = buildBasisMatrix(si) ; /* Fetch beta, calculate beta B, i = 0, ..., m-1, and check that we have the appropriate unit vector. */ double *betai = new double[m] ; double *ei = new double[m] ; for (int i = 0 ; i < m ; i++) { CoinFillN(betai,m,COIN_DBL_MAX) ; CoinFillN(ei,m,COIN_DBL_MAX) ; OSIUNITTEST_CATCH_ERROR(si->getBInvRow(i,betai), {}, solverName, "testBInvRow"); basisMtx->transposeTimes(betai,ei) ; OSIUNITTEST_ASSERT_ERROR(isUnitVector(i,m,ei), if (OsiUnitTest::verbosity >= 1) { std::cout << " " << "beta<" << i << ">B != e<" << i << ">." << std::endl ; }, solverName, "testBInvRow"); } delete[] betai ; delete[] ei ; delete basisMtx ; } /* Test columns abar = inv(B) a by checking that B abar = a. It's assumed that the si passed as a parameter is ready for tableau queries: a problem has been loaded and solved to optimality and enableFactorization has been called. */ void testBInvACol (const OsiSolverInterface *si) { std::string solverName ; si->getStrParam(OsiSolverName,solverName) ; int n = si->getNumCols() ; int m = si->getNumRows() ; std::cout << " Testing getBInvACol ... " << std::endl; CoinPackedMatrix *basisMtx = buildBasisMatrix(si) ; const CoinPackedMatrix *mtx = si->getMatrixByCol() ; /* Fetch abar, calculate B abar, k = 0, ..., n-1, and check that the result is a. */ double *abarj = new double[m] ; double *aj = new double[m] ; for (int j = 0 ; j < n ; j++) { CoinFillN(abarj,m,COIN_DBL_MAX) ; CoinFillN(aj,m,COIN_DBL_MAX) ; OSIUNITTEST_CATCH_ERROR(si->getBInvACol(j,abarj), {}, solverName, "testBInvACol"); basisMtx->times(abarj,aj) ; const CoinShallowPackedVector pv = mtx->getVector(j) ; OSIUNITTEST_ASSERT_ERROR(isEquivalent(pv,m,aj), if (OsiUnitTest::verbosity >= 1) { std::cout << " " << "B abar<" << j << "> != a<" << j << ">." << std::endl ; }, solverName, "testBInvACol"); } delete[] abarj ; delete[] aj ; delete basisMtx ; } /* Test rows abar = e(inv(B)(A I)). This is an awkward thing to check, because there's no analog to the column identity B abar = a. Go with brute force: Build inv(B)A row by row with getBInvARow and check it against inv(B)A built column by column with getBInvACol. (Clearly, testBInvACol should run first.) e(inv(B)I) is of course beta = einv(B), so we can just check that betaB = e. It's assumed that the si passed as a parameter is ready for tableau queries: a problem has been loaded and solved to optimality and enableFactorization has been called. */ void testBInvARow (const OsiSolverInterface *si) { std::string solverName ; si->getStrParam(OsiSolverName,solverName) ; int n = si->getNumCols() ; int m = si->getNumRows() ; std::cout << " Testing getBInvARow ... " << std::endl; CoinPackedMatrix *basisMtx = buildBasisMatrix(si) ; /* Construct inv(B)A by column, then change over to row-major ordering so we can compare with the version build from tableau rows. Interesting quirk here: Turns out p0033's tableau has no nonzeros in rows with index 6 or 15. Because of that, when abarj is converted to row-major, it has only 15 rows, and that causes isEquivalent2 to fail. So force the full size. */ CoinPackedMatrix abarjMtx ; double *abarj = new double[m] ; for (int j = 0 ; j < n ; j++) { si->getBInvACol(j,abarj) ; CoinPackedVector pkv ; pkv.setFullNonZero(m,abarj) ; abarjMtx.appendCol(pkv) ; } delete[] abarj ; abarjMtx.reverseOrdering() ; abarjMtx.setDimensions(m,n) ; if (OsiUnitTest::verbosity >= 1) { std::cout << " Col-major tableau is " << abarjMtx.getNumRows() << " x " << abarjMtx.getNumCols() << " with " << abarjMtx.getNumElements() << " elements." << std::endl ; } /* Construct inv(B)A by row. Check the vectors returned for inv(B)I = beta as we go. */ CoinPackedMatrix abariMtx ; abariMtx.reverseOrdering() ; double *abari = new double[n] ; double *betai = new double[m] ; double *ei = new double[m] ; for (int i = 0 ; i < m ; i++) { CoinFillN(abari,n,COIN_DBL_MAX) ; CoinFillN(betai,m,COIN_DBL_MAX) ; OSIUNITTEST_CATCH_ERROR(si->getBInvARow(i,abari,betai), {}, solverName, "testBInvARow"); CoinPackedVector pkv ; pkv.setFullNonZero(n,abari) ; if (OsiUnitTest::verbosity >= 2) { std::cout << " Adding" ; const int *indices = pkv.getIndices() ; for (int v = 0 ; v < pkv.getNumElements() ; v++) { std::cout << " (" << i << "," << indices[v] << ")" ; } std::cout << std::endl ; if (!isEquivalent(pkv,n,abari)) std::cout << " !! packed abari != full abari !!" << std::endl ; } abariMtx.appendRow(pkv) ; basisMtx->transposeTimes(betai,ei) ; OSIUNITTEST_ASSERT_ERROR(isUnitVector(i,m,ei), if (OsiUnitTest::verbosity >= 1) { std::cout << " " << "beta<" << i << ">B != e<" << i << ">." << std::endl ; }, solverName, "testBInvARow"); } abariMtx.setDimensions(m,n) ; if (OsiUnitTest::verbosity >= 2) { std::cout << " Row-major tableau is " << abariMtx.getNumRows() << " x " << abariMtx.getNumCols() << " with " << abariMtx.getNumElements() << " elements." << std::endl ; } delete[] abari ; delete[] betai ; delete[] ei ; delete basisMtx ; /* Check that the two matrices are equivalent. isEquivalent2 will report differences, but we won't get a good count. But then, one error is all we need to report. */ OSIUNITTEST_ASSERT_ERROR(abariMtx.isEquivalent2(abarjMtx), {}, solverName, "testBInvARow: tableaus built by rows and columns match"); } /* Test the row and column duals returned by getReducedGradient. ** This method requires that the solver have an optimal solution in hand. ** The method checks the values returned by getReducedGradient against the values held in the solver (getRowPrice, getReducedCost) and tests that the sign of the reduced costs matches the status of the architectural variables. None of these are guaranteed unless the problem has been solved to optimality. The validity of the test hinges on the assumption that an implementor will just do the calculations for the given c rather than try to determine if the answer held in the solver is valid for the given c. * For row duals, test that y = cinv(B), using getBInvCol (already tested) to obtain the columns of the basis inverse. Also check that we agree with getRowPrice. * For column duals (aka reduced costs), test that cbar = c - yN, using the duals we've just checked. Also check that we agree with getReducedCost. Cross-check the sign of the reduced costs against the status vector returned by getBasisStatus. It's assumed that the si passed as a parameter is ready for tableau queries: a problem has been loaded and solved to optimality and enableFactorization has been called. */ void testReducedGradient (const OsiSolverInterface *si) { std::string solverName ; si->getStrParam(OsiSolverName,solverName) ; int n = si->getNumCols() ; int m = si->getNumRows() ; double objSense = si->getObjSense() ; std::cout << " Testing getReducedGradient ... " ; /* Acquire the solver's notion of current duals and reduced costs before we do anything else. */ const double *yGold = si->getRowPrice() ; const double *cbarGold = si->getReducedCost() ; /* Acquire the basis and build c, the vector of basic cost coefficients. For logicals (basicIndices[k] >= n) assume a zero coefficient. */ int *basicIndices = new int[m] ; si->getBasics(basicIndices) ; const double *c = si->getObjCoefficients() ; double *cB = new double[m] ; for (int k = 0 ; k < m ; k++) { int j = basicIndices[k] ; if (j < n) { if (OsiUnitTest::verbosity >= 2) { std::cout << " Retrieving c<" << j << "> = " << c[j] << " for basis pos'n " << k << "." << std::endl ; } cB[k] = c[j] ; } else { if (OsiUnitTest::verbosity >= 2) { std::cout << " Assuming c = " << 0.0 << " for basis pos'n " << k << "." << std::endl ; } cB[k] = 0.0 ; } } delete[] basicIndices ; /* Call getReducedGradient to get duals and reduced costs. */ double *cbar = new double[n] ; double *y = new double[m] ; OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si->getReducedGradient(cbar,y,c), delete[] cbar; delete[] y; return, solverName, "testReducedGradient", TestOutcome::ERROR, solverName == "cplex"); /* Run through the columns of the basis. Retrieve beta, calculate dot(c,beta) and check that all three sources of y agree. */ double *betaj = new double[m] ; CoinRelFltEq eq ; for (int k = 0 ; k < m ; k++) { double yk = 0.0 ; si->getBInvCol(k,betaj) ; for (int i = 0 ; i < m ; i++) { yk += cB[i]*betaj[i] ; } OSIUNITTEST_ASSERT_ERROR(eq(y[k],yGold[k]), if (OsiUnitTest::verbosity >= 1) std::cout << " " << y[k] << " = y<" << k << "> != yGold<" << k << "> = " << yGold[k] << ", diff = " << y[k]-yGold[k] << "." << std::endl, solverName, "testReducedGradient"); OSIUNITTEST_ASSERT_ERROR(eq(y[k],yk), if (OsiUnitTest::verbosity >= 1) std::cout << " " << y[k] << " = y<" << k << "> != cbeta<" << k << "> = " << yk << ", diff = " << y[k]-yk << "." << std::endl, solverName, "testReducedGradient"); } delete[] cB ; delete[] betaj ; /* Now that we're confident the duals are correct, use them to calculate cbar as c-yN and check that all sources for cbar agree. Also check that the sign is correct given the status of the variable. There's no need to differentiate basic and nonbasic columns here. */ int *archStatus = new int[n] ; int *logStatus = new int[m] ; si->getBasisStatus(archStatus,logStatus) ; double dualTol ; si->getDblParam(OsiDualTolerance,dualTol) ; const int OsiSimplex_isFree = 0 ; const int OsiSimplex_basic = 1 ; const int OsiSimplex_nbub = 2 ; const int OsiSimplex_nblb = 3 ; std::string statNames[] = { "NBFR", "B", "NBUB", "NBLB" } ; const CoinPackedMatrix *mtx = si->getMatrixByCol() ; double *cbarCalc = new double[n] ; mtx->transposeTimes(y,cbarCalc) ; std::transform(c,c+n,cbarCalc,cbarCalc,std::minus()) ; for (int j = 1 ; j < n ; j++) { double cbarj = cbar[j] ; int statj = archStatus[j] ; if (OsiUnitTest::verbosity >= 2) std::cout << " x<" << j << "> " << statNames[statj] << ", cbar<" << j << "> = " << cbarj << "." << std::endl ; OSIUNITTEST_ASSERT_ERROR(eq(cbarj,cbarGold[j]), if (OsiUnitTest::verbosity >= 1) std::cout << " " << cbarj << " = cbar<" << j << "> != cbarGold<" << j << "> = " << cbarGold[j] << ", diff = " << cbarj-cbarGold[j] << "." << std::endl, solverName, "testReducedGradient"); OSIUNITTEST_ASSERT_ERROR(eq(cbarj,cbarCalc[j]), if (OsiUnitTest::verbosity >= 1) std::cout << " " << cbarj << " = cbar<" << j << "> != c<" << j << "> - ya<" << j << "> = " << cbarCalc[j] << ", diff = " << cbarj-cbarCalc[j] << "." << std::endl, solverName, "testReducedGradient"); double testcbarj = objSense*cbarj ; switch (statj) { case OsiSimplex_nbub: { OSIUNITTEST_ASSERT_ERROR(testcbarj <= dualTol, if (OsiUnitTest::verbosity >= 1) std::cout << " cbar<" << j << "> = " << cbarj << " has the wrong sign for a NBUB variable." << std::endl, solverName, "testReducedGradient"); break ; } case OsiSimplex_nblb: { OSIUNITTEST_ASSERT_ERROR(testcbarj >= -dualTol, if (OsiUnitTest::verbosity >= 1) std::cout << " cbar<" << j << "> = " << cbarj << " has the wrong sign for a NBLB variable." << std::endl, solverName, "testReducedGradient"); break ; } case OsiSimplex_isFree: { OSIUNITTEST_ASSERT_ERROR(CoinAbs(testcbarj) <= dualTol, if (OsiUnitTest::verbosity >= 1) std::cout << " cbar<" << j << "> = " << cbarj << " should be zero for a NBFR variable." << std::endl, solverName, "testReducedGradient"); break ; } case OsiSimplex_basic: { OSIUNITTEST_ASSERT_ERROR(CoinAbs(testcbarj) <= dualTol, if (OsiUnitTest::verbosity >= 1) std::cout << " cbar<" << j << "> = " << cbarj << " should be zero for a basic variable." << std::endl, solverName, "testReducedGradient"); break ; } default: { break ; } } } delete[] y ; delete[] cbar ; delete[] cbarCalc ; delete[] archStatus ; delete[] logStatus ; } /* Test the mode 2 portion of the simplex API. Solve an lp by hand */ void testSimplexMode2 (const OsiSolverInterface *emptySi, std::string sampleDir) { OsiSolverInterface * si = emptySi->clone(); std::string solverName; si->getStrParam(OsiSolverName,solverName); std::string fn = sampleDir+"p0033"; si->readMps(fn.c_str(),"mps"); si->setObjSense(-1.0); si->initialSolve(); si->setObjSense(1.0); // enable special mode si->enableSimplexInterface(true); // we happen to know that variables are 0-1 and rows are L int numberIterations=0; int numberColumns = si->getNumCols(); int numberRows = si->getNumRows(); double * fakeCost = new double[numberColumns]; double * duals = new double [numberRows]; double * djs = new double [numberColumns]; const double * solution = si->getColSolution(); memcpy(fakeCost,si->getObjCoefficients(),numberColumns*sizeof(double)); while (1) { const double * dj; const double * dual; if ((numberIterations&1)==0) { // use given ones dj = si->getReducedCost(); dual = si->getRowPrice(); } else { // create dj = djs; dual = duals; si->getReducedGradient(djs,duals,fakeCost); } int i; int colIn=9999; int direction=1; double best=1.0e-6; // find most negative reduced cost // Should check basic - but should be okay on this problem for (i=0;ibest) { direction=-1; best=value; colIn=-i-1; } } for (i=0;ibest&&solution[i]>1.0-1.0e-6) { direction=-1; best=value; colIn=i; } } if (colIn==9999) break; // should be optimal int colOut; int outStatus; double theta; OSIUNITTEST_ASSERT_ERROR(!si->primalPivotResult(colIn,direction,colOut,outStatus,theta,NULL), break, solverName, "testSimplexMode2"); printf("out %d, direction %d theta %g\n", colOut,outStatus,theta); numberIterations++; } delete [] fakeCost; delete [] duals; delete [] djs; // exit special mode si->disableSimplexInterface(); si->resolve(); OSIUNITTEST_ASSERT_ERROR(!si->getIterationCount(), {}, solverName, "testSimplexMode2: resolve after disable simplex interface"); si->setObjSense(-1.0); si->initialSolve(); std::cout<clone(); std::string solverName; si->getStrParam(OsiSolverName,solverName); si->setHintParam(OsiDoReducePrint,true,OsiHintDo) ; /* Read p0033 and check that there's no optimal basis prior to solving. */ std::string fn = sampleDir+"p0033"; si->readMps(fn.c_str(),"mps"); OSIUNITTEST_ASSERT_ERROR(!si->basisIsAvailable(), if (OsiUnitTest::verbosity >= 1) std::cout << " " << solverName << " shows no optimal basis before initial solve." << std::endl, *si, "testSimplexMode1: basis before solve"); /* Solve as minimisation problem. */ si->setObjSense(1.0) ; si->initialSolve(); OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return, *si, "testSimplexMode1: solve p0033"); if (OsiUnitTest::verbosity >= 1) { std::cout << " " << solverName << " solved p0033 z = " << si->getObjValue() << "." << std::endl ; } /* Now get tough. Resolve, first as maximisation, then minimisation. Enable the tableau interface and check the methods. */ double minmax[] = { -1.0, 1.0 } ; for (int ndx = 0 ; ndx < 2 ; ndx++) { si->setObjSense(minmax[ndx]) ; std::cout << " " << ((minmax[ndx] < 0)?"maximisation ...":"minimisation") << " ..." << std::endl ; si->resolve() ; OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return, *si, "testSimplexMode1: resolve p0033"); if (OsiUnitTest::verbosity >= 1) { std::cout << " " << solverName << ((si->getObjSense() < 0)?" maximised":" minimised") << " p0033 z = " << si->getObjValue() << "." << std::endl ; } OSIUNITTEST_ASSERT_ERROR(si->basisIsAvailable(), {}, *si, "testSimplexMode1: basis available after resolve"); if (OsiUnitTest::verbosity >= 1 && si->basisIsAvailable()) { std::cout << " " << solverName << " shows optimal basis after resolve." << std::endl ; } /* Enable simplex mode 1. */ si->enableFactorization() ; /* Test the various methods. */ testBInvCol(si) ; testBInvRow(si) ; testBInvACol(si) ; testBInvARow(si) ; testReducedGradient(si) ; /* Disable simplex mode 1. */ si->disableFactorization() ; } /* Trash this solver and we're finished. */ delete si ; } } // end file-local namespace namespace OsiUnitTest { /* Test a solver's implementation of the OSI simplex API. */ void testSimplexAPI (const OsiSolverInterface *emptySi, const std::string &sampleDir) { OsiSolverInterface *si = emptySi->clone() ; std::string solverName; si->getStrParam(OsiSolverName,solverName); /* Do the tests only if the solver implements the simplex API. */ if (si->canDoSimplexInterface() == 0) { OSIUNITTEST_ADD_OUTCOME(solverName, "testSimplexAPI", "skipped test", OsiUnitTest::TestOutcome::NOTE, true); std::cout << solverName << " has no OsiSimplex API." << std::endl ; return; } /* Test the mode 1 (tableau access) portion of the API. */ if (si->canDoSimplexInterface() >= 1) { std::cout << "Testing Simplex API mode 1 for " << solverName << " ... " << std::endl ; testSimplexMode1(emptySi,sampleDir) ; } /* Test the mode 2 (pivot-by-pivot control) portion of the API. */ if (si->canDoSimplexInterface() >= 2) { std::cout << "Testing Simplex API mode 2 for " << solverName << " ... " << std::endl ; testSimplexMode2(emptySi,sampleDir) ; } else { OSIUNITTEST_ADD_OUTCOME(solverName, "testSimplexAPI mode 2", "skipped test", OsiUnitTest::TestOutcome::NOTE, true); std::cout << solverName << " does not implement Simplex API mode 2." << std::endl ; } } } /* namespace OsiUnitTest */ Osi-0.106.4/src/OsiCommonTest/OsiRowCutDebuggerTest.cpp0000644000076600007660000001101611541753202021332 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include "CoinPragma.hpp" #include "OsiUnitTests.hpp" #include "OsiRowCutDebugger.hpp" //-------------------------------------------------------------------------- // test cut debugger methods. void OsiRowCutDebuggerUnitTest(const OsiSolverInterface * baseSiP, const std::string & mpsDir) { CoinRelFltEq eq; // Test default constructor { OsiRowCutDebugger r; OSIUNITTEST_ASSERT_ERROR(r.integerVariable_ == NULL, {}, "osirowcutdebugger", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.knownSolution_ == NULL, {}, "osirowcutdebugger", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.numberColumns_ == 0, {}, "osirowcutdebugger", "default constructor"); } { // Get non trivial instance OsiSolverInterface * imP = baseSiP->clone(); std::string fn = mpsDir+"exmip1"; imP->readMps(fn.c_str(),"mps"); OSIUNITTEST_ASSERT_ERROR(imP->getNumRows() == 5, {}, "osirowcutdebugger", "read exmip1"); /* Activate the debugger. The garbled name here is deliberate; the debugger should isolate the portion of the string between '/' and '.' (in normal use, this would be the base file name, stripped of the prefix and extension). */ imP->activateRowCutDebugger("ab cd /x/ /exmip1.asc"); int i; // return debugger const OsiRowCutDebugger * debugger = imP->getRowCutDebugger(); OSIUNITTEST_ASSERT_ERROR(debugger != NULL, {}, "osirowcutdebugger", "return debugger"); OSIUNITTEST_ASSERT_ERROR(debugger->numberColumns_ == 8, {}, "osirowcutdebugger", "return debugger"); const bool type[]={0,0,1,1,0,0,0,0}; const double values[]= {2.5, 0, 1, 1, 0.5, 3, 0, 0.26315789473684253}; CoinPackedVector objCoefs(8,imP->getObjCoefficients()); bool type_ok = true; #if 0 for (i=0;i<8;i++) type_ok &= type[i] == debugger->integerVariable_[i]; OSIUNITTEST_ASSERT_ERROR(type_ok, {}, "osirowcutdebugger", "???"); #endif double objValue = objCoefs.dotProduct(values); double debuggerObjValue = objCoefs.dotProduct(debugger->knownSolution_); OSIUNITTEST_ASSERT_ERROR(eq(objValue, debuggerObjValue), {}, "osirowcutdebugger", "objective value"); OsiRowCutDebugger rhs; { OsiRowCutDebugger rC1(*debugger); OSIUNITTEST_ASSERT_ERROR(rC1.numberColumns_ == 8, {}, "osirowcutdebugger", "copy constructor"); type_ok = true; for (i=0;i<8;i++) type_ok &= type[i] == rC1.integerVariable_[i]; OSIUNITTEST_ASSERT_ERROR(type_ok, {}, "osirowcutdebugger", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(eq(objValue,objCoefs.dotProduct(rC1.knownSolution_)), {}, "osirowcutdebugger", "copy constructor"); rhs = rC1; OSIUNITTEST_ASSERT_ERROR(rhs.numberColumns_ == 8, {}, "osirowcutdebugger", "assignment operator"); type_ok = true; for (i=0;i<8;i++) type_ok &= type[i] == rhs.integerVariable_[i]; OSIUNITTEST_ASSERT_ERROR(type_ok, {}, "osirowcutdebugger", "assignment operator"); OSIUNITTEST_ASSERT_ERROR(eq(objValue,objCoefs.dotProduct(rhs.knownSolution_)), {}, "osirowcutdebugger", "assignment operator"); } // Test that rhs has correct values even though lhs has gone out of scope OSIUNITTEST_ASSERT_ERROR(rhs.numberColumns_ == 8, {}, "osirowcutdebugger", "assignment operator"); type_ok = true; for (i=0;i<8;i++) type_ok &= type[i] == rhs.integerVariable_[i]; OSIUNITTEST_ASSERT_ERROR(type_ok, {}, "osirowcutdebugger", "assignment operator"); OSIUNITTEST_ASSERT_ERROR(eq(objValue,objCoefs.dotProduct(rhs.knownSolution_)), {}, "osirowcutdebugger", "assignment operator"); OsiRowCut cut[2]; const int ne = 3; int inx[ne] = { 0, 2, 3 }; double el[ne] = { 1., 1., 1. }; cut[0].setRow(ne,inx,el); cut[0].setUb(5.); el[1]=5; cut[1].setRow(ne,inx,el); cut[1].setUb(5); OsiCuts cs; cs.insert(cut[0]); cs.insert(cut[1]); OSIUNITTEST_ASSERT_ERROR(!debugger->invalidCut(cut[0]), {}, "osirowcutdebugger", "recognize (in)valid cut"); OSIUNITTEST_ASSERT_ERROR( debugger->invalidCut(cut[1]), {}, "osirowcutdebugger", "recognize (in)valid cut"); OSIUNITTEST_ASSERT_ERROR(debugger->validateCuts(cs,0,2) == 1, {}, "osirowcutdebugger", "recognize (in)valid cut"); OSIUNITTEST_ASSERT_ERROR(debugger->validateCuts(cs,0,1) == 0, {}, "osirowcutdebugger", "recognize (in)valid cut"); delete imP; } } Osi-0.106.4/src/OsiCommonTest/Makefile.am0000644000076600007660000000326012101340333016447 0ustar coincoin# Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1881 2013-01-28 00:05:47Z stefan $ # Author: Lou Hafer SFU 2010-11-20 AUTOMAKE_OPTIONS = foreign ######################################################################## # Common Test library for Osi # ######################################################################## # Name of the library compiled in this directory. We want it to be installed # in $libdir lib_LTLIBRARIES = libOsiCommonTests.la # List all source files for this library, including headers libOsiCommonTests_la_SOURCES = \ OsiCommonTests.hpp \ OsiColCutTest.cpp \ OsiCutsTest.cpp \ OsiRowCutDebuggerTest.cpp \ OsiRowCutTest.cpp \ OsiSimplexAPITest.cpp \ OsiNetlibTest.cpp \ OsiUnitTestUtils.cpp \ OsiSolverInterfaceTest.cpp # Libtool flags libOsiCommonTests_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../Osi` $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, includecoindir = $(includedir)/coin includecoin_HEADERS = OsiUnitTests.hpp Osi-0.106.4/src/OsiCommonTest/Makefile.in0000644000076600007660000005612012240315110016462 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Lou Hafer SFU 2010-11-20 srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/OsiCommonTest DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsiCommonTests_la_LIBADD = am_libOsiCommonTests_la_OBJECTS = OsiColCutTest.lo OsiCutsTest.lo \ OsiRowCutDebuggerTest.lo OsiRowCutTest.lo OsiSimplexAPITest.lo \ OsiNetlibTest.lo OsiUnitTestUtils.lo OsiSolverInterfaceTest.lo libOsiCommonTests_la_OBJECTS = $(am_libOsiCommonTests_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsiCommonTests_la_SOURCES) DIST_SOURCES = $(libOsiCommonTests_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # Common Test library for Osi # ######################################################################## # Name of the library compiled in this directory. We want it to be installed # in $libdir lib_LTLIBRARIES = libOsiCommonTests.la # List all source files for this library, including headers libOsiCommonTests_la_SOURCES = \ OsiCommonTests.hpp \ OsiColCutTest.cpp \ OsiCutsTest.cpp \ OsiRowCutDebuggerTest.cpp \ OsiRowCutTest.cpp \ OsiSimplexAPITest.cpp \ OsiNetlibTest.cpp \ OsiUnitTestUtils.cpp \ OsiSolverInterfaceTest.cpp # Libtool flags libOsiCommonTests_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../Osi` $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, includecoindir = $(includedir)/coin includecoin_HEADERS = OsiUnitTests.hpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OsiCommonTest/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/OsiCommonTest/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsiCommonTests.la: $(libOsiCommonTests_la_OBJECTS) $(libOsiCommonTests_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsiCommonTests_la_LDFLAGS) $(libOsiCommonTests_la_OBJECTS) $(libOsiCommonTests_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiColCutTest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiCutsTest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiNetlibTest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiRowCutDebuggerTest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiRowCutTest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiSimplexAPITest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiSolverInterfaceTest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiUnitTestUtils.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/OsiCommonTest/OsiRowCutTest.cpp0000644000076600007660000003314411556575357017716 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include "CoinPragma.hpp" #include "OsiUnitTests.hpp" #include "OsiRowCut.hpp" #include "CoinFloatEqual.hpp" //-------------------------------------------------------------------------- void OsiRowCutUnitTest(const OsiSolverInterface * baseSiP, const std::string & mpsDir) { CoinRelFltEq eq; // Test default constructor { OsiRowCut r; OSIUNITTEST_ASSERT_ERROR(r.row_.getIndices() == NULL, {}, "osirowcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.row_.getElements() == NULL, {}, "osirowcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.row_.getNumElements() == 0, {}, "osirowcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.lb_ == -COIN_DBL_MAX, {}, "osirowcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.ub_ == COIN_DBL_MAX, {}, "osirowcut", "default constructor"); OSIUNITTEST_ASSERT_ERROR(r.effectiveness() == 0.0, {}, "osirowcut", "default constructor"); } // Test set and get methods const int ne = 4; int inx[ne] = { 1, 3, 4, 7 }; double el[ne] = { 1.2, 3.4, 5.6, 7.8 }; { OsiRowCut r; // Test setting getting bounds r.setLb(65.432); r.setUb(123.45); OSIUNITTEST_ASSERT_ERROR(r.lb() == 65.432, {}, "osirowcut", "set bounds"); OSIUNITTEST_ASSERT_ERROR(r.ub() == 123.45, {}, "osirowcut", "set bounds"); // Test setting/getting of effectiveness,timesUsed,timesTested r.setEffectiveness(45.); OSIUNITTEST_ASSERT_ERROR(r.effectiveness() == 45.0, {}, "osirowcut", "set effectivenesss"); // Test setting/getting elements with int* & float* vectors r.setRow( ne, inx, el ); OSIUNITTEST_ASSERT_ERROR(r.row().getNumElements() == ne, return, "osirowcut", "set row"); bool row_ok = true; for ( int i=0; i rc), {}, "osirowcut", "operator >"); OSIUNITTEST_ASSERT_ERROR(!(rc > c), {}, "osirowcut", "operator >"); } { OsiRowCut c(rc); const int ne1 = 4; int inx1[ne] = { 1, 3, 4, 7 }; double el1[ne] = { 1.2, 3.4, 5.6, 7.9 }; c.setRow(ne1,inx1,el1); OSIUNITTEST_ASSERT_ERROR(!(c == rc), {}, "osirowcut", "operator =="); OSIUNITTEST_ASSERT_ERROR( c != rc , {}, "osirowcut", "operator !="); OSIUNITTEST_ASSERT_ERROR(!(rc < c), {}, "osirowcut", "operator <"); } { OsiRowCut c(rc); c.setEffectiveness(3.); OSIUNITTEST_ASSERT_ERROR(!(c == rc), {}, "osirowcut", "operator =="); OSIUNITTEST_ASSERT_ERROR( c != rc , {}, "osirowcut", "operator !="); OSIUNITTEST_ASSERT_ERROR(!(c < rc), {}, "osirowcut", "operator <"); OSIUNITTEST_ASSERT_ERROR( (rc < c), {}, "osirowcut", "operator <"); OSIUNITTEST_ASSERT_ERROR( (c > rc), {}, "osirowcut", "operator >"); OSIUNITTEST_ASSERT_ERROR(!(rc > c), {}, "osirowcut", "operator >"); } { OsiRowCut c(rc); c.setLb(4.0); OSIUNITTEST_ASSERT_ERROR(!(c == rc), {}, "osirowcut", "operator =="); OSIUNITTEST_ASSERT_ERROR( c != rc , {}, "osirowcut", "operator !="); } { OsiRowCut c(rc); c.setUb(5.0); OSIUNITTEST_ASSERT_ERROR(!(c == rc), {}, "osirowcut", "operator =="); OSIUNITTEST_ASSERT_ERROR( c != rc , {}, "osirowcut", "operator !="); } } #ifndef COIN_NOTEST_DUPLICATE { // Test consistent OsiSolverInterface * imP = baseSiP->clone(); std::string fn = mpsDir+"exmip1"; OSIUNITTEST_ASSERT_ERROR(imP->readMps(fn.c_str(),"mps") == 0, {}, "osirowcut", "read MPS"); OsiRowCut c; const int ne = 3; int inx[ne] = { -1, 5, 4 }; double el[ne] = { 1., 1., 1. }; c.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!c.consistent(), {}, "osirowcut", "consistent"); inx[0]=5; #if 0 c.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!c.consistent(), {}, "osirowcut", "consistent"); #else bool errorThrown = false; try { c.setRow(ne,inx,el); } catch (CoinError e) { errorThrown = true; } OSIUNITTEST_ASSERT_ERROR(errorThrown == true, {}, "osirowcut", "duplicate entries"); #endif inx[0]=3; c.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(c.consistent(), {}, "osirowcut", "consistent"); c.setLb(5.); c.setUb(5.); OSIUNITTEST_ASSERT_ERROR(c.consistent(), {}, "osirowcut", "consistent"); c.setLb(5.5); OSIUNITTEST_ASSERT_ERROR(c.consistent(), {}, "osirowcut", "consistent"); OSIUNITTEST_ASSERT_ERROR(c.infeasible(*imP), {}, "osirowcut", "infeasible"); delete imP; } #endif { // Test consistent(IntegerModel) method. OsiSolverInterface * imP = baseSiP->clone(); std::string fn = mpsDir+"exmip1"; OSIUNITTEST_ASSERT_ERROR(imP->readMps(fn.c_str(),"mps") == 0, {}, "osirowcut", "read MPS"); OsiRowCut cut; const int ne = 3; int inx[ne] = { 3, 5, 4 }; double el[ne] = { 1., 1., 1. }; cut.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(cut.consistent(), {}, "osirowcut", "consistent"); inx[0]=7; cut.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(cut.consistent(*imP), {}, "osirowcut", "consistent(IntegerModel)"); inx[0]=8; cut.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cut.consistent(), {}, "osirowcut", "consistent(IntegerModel)"); OSIUNITTEST_ASSERT_ERROR(!cut.consistent(*imP), {}, "osirowcut", "consistent(IntegerModel)"); delete imP; } { //Test infeasible(im) method OsiSolverInterface * imP = baseSiP->clone(); std::string fn = mpsDir+"exmip1"; OSIUNITTEST_ASSERT_ERROR(imP->readMps(fn.c_str(),"mps") == 0, {}, "osirowcut", "read MPS"); OsiRowCut cut; const int ne = 3; int inx[ne] = { 3, 5, 4 }; double el[ne] = { 1., 1., 1. }; cut.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!cut.infeasible(*imP), {}, "osirowcut", "infeasible(IntegerModel)"); OsiRowCut c1; OSIUNITTEST_ASSERT_ERROR(!c1.infeasible(*imP), {}, "osirowcut", "infeasible(IntegerModel)"); OSIUNITTEST_ASSERT_ERROR( c1.consistent(), {}, "osirowcut", "consistent"); OSIUNITTEST_ASSERT_ERROR( c1.consistent(*imP), {}, "osirowcut", "consistent(IntegerModel)"); delete imP; } { //Test violation double solution[]={1.0,1.0,1.0,2.0,2.0,2.0}; OsiRowCut cut; const int ne = 3; int inx[ne] = { 3, 5, 4 }; double el[ne] = { 1., 1., 1. }; cut.setRow(ne,inx,el); cut.setUb(5.); OSIUNITTEST_ASSERT_ERROR(cut.violated(solution), {}, "osirowcut", "violation"); cut.setLb(5.); cut.setUb(10.); OSIUNITTEST_ASSERT_ERROR(!cut.violated(solution), {}, "osirowcut", "violation"); cut.setLb(6.1); OSIUNITTEST_ASSERT_ERROR( cut.violated(solution), {}, "osirowcut", "violation"); } } Osi-0.106.4/src/OsiCommonTest/OsiSolverInterfaceTest.cpp0000644000076600007660000055156412130104324021544 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). /* !! MAINTAINERS PLEASE READ !! The OSI unit test is gradually undergoing a conversion. Over time, the goal is to factor the original monolith into separate files and routines. Individual routines should collect test outcomes in the global OsiUnitTest::outcomes object using the OSIUNITTEST_* macros defined in OsiUnitTests.hpp. Ideally, the implementor of an OsiXXX could indicated expected failures, to avoid the current practice of modifying the unit test to avoid attempting the test for a particular OsiXXX. The original approach was to use asserts in tests; the net effect is that the unit test chokes and dies as soon as something goes wrong. The current approach is to soldier on until something has gone wrong which makes further testing pointless if OsiUnitTest::haltonerror is set to 0, to hold and ask the user for pressing a key if OsiUnitTest::haltonerror is set to 1, and to stop immediately if OsiUnitTest::haltonerror is set to 2 (but only in case of an error, not for warnings). The general idea is to return the maximum amount of useful information with each run. The OsiUnitTest::verbosity variable should be used to decide on the amount of information to be printed. At level 0, only minimal output should be printed, at level 1, more information about failed tests should be printed, while at level 2, also information on passed tests and other details should be printed. If you work on this code, please keep these conventions in mind: * Tests should be encapsulated in subroutines. If you have a moment, factor something out of the main routine --- it'd be nice to get it down under 500 lines. * All local helper routines should be defined in the file-local namespace. * This unit test is meant as a certification that OsiXXX correctly implements the OSI API specification. Don't step around it! If OsiXXX is not capable of meeting a particular requirement and you edit the unit test code to avoid the test, don't just sweep it under the rug! Print a failure message saying the test has been skipped, or something else informative. OsiVol is the worst offender for this (the underlying algorithm is not simplex and imposes serious limitations on the type of lp that vol can handle). Any simplex-oriented solver should *NOT* be exempted from any test. If it's pointless to even try, print a failure message. -- lh, 08.01.07, 10.08.26 -- */ #include "CoinPragma.hpp" #include "OsiConfig.h" #include #include #include #include #include #include /* A utility definition which allows for easy suppression of unused variable warnings from GCC. Handy in this environment, where we're constantly def'ing things in and out. */ #ifndef UNUSED # if defined(__GNUC__) # define UNUSED __attribute__((unused)) # else # define UNUSED # endif #endif #include "OsiUnitTests.hpp" #include "OsiSolverInterface.hpp" #include "CoinTime.hpp" #include "CoinFloatEqual.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" #include "OsiRowCut.hpp" #include "OsiCuts.hpp" #include "OsiPresolve.hpp" /* Define helper routines in the file-local namespace. */ namespace OsiUnitTest { extern void testSimplexAPI(const OsiSolverInterface* emptySi, const std::string& mpsDir); } using namespace OsiUnitTest ; namespace { //############################################################################# // A routine to build a CoinPackedMatrix matching the exmip1 example. //############################################################################# const CoinPackedMatrix *BuildExmip1Mtx () /* Simple function to build a packed matrix for the exmip1 example used in tests. The function exists solely to hide the intermediate variables. Probably could be written as an initialised declaration. See COIN/Mps/Sample/exmip1.mps for a human-readable presentation. Don't forget to dispose of the matrix when you're done with it. Ordered triples seem easiest. They're listed in row-major order. */ { int rowndxs[] = { 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4 } ; int colndxs[] = { 0, 1, 3, 4, 7, 1, 2, 2, 5, 3, 6, 0, 4, 7 } ; double coeffs[] = { 3.0, 1.0, -2.0, -1.0, -1.0, 2.0, 1.1, 1.0, 1.0, 2.8, -1.2, 5.6, 1.0, 1.9 } ; CoinPackedMatrix *mtx = new CoinPackedMatrix(true,&rowndxs[0],&colndxs[0],&coeffs[0],14) ; return (mtx) ; } //############################################################################# // Short tests contributed by Vivian DeSmedt. Thanks! //############################################################################# /* DeSmedt Problem #1 Initially, max 3*x1 + x2 x* = [ 5 0 ] 2*x1 + x2 <= 10 row_act = [ 10 5 ] x1 + 3*x2 <= 15 Test for solver status, expected solution, row activity. Then change objective to [1 1], resolve, check again for solver status, expected solution [3 4] and expected row activity [10 15]. */ bool test1VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedMatrix m; m.transpose(); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); m.appendRow(r0); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); m.appendRow(r1); int numcol = 2; double *obj = new double[numcol]; obj[0] = 3; obj[1] = 1; double *collb = new double[numcol]; collb[0] = 0; collb[1] = 0; double *colub = new double[numcol]; colub[0] = inf; colub[1] = inf; int numrow = 2; double *rowlb = new double[numrow]; rowlb[0] = -inf; rowlb[1] = -inf; double *rowub = new double[numrow]; rowub[0] = 10; rowub[1] = 15; s->loadProblem(m, collb, colub, obj, rowlb, rowub); delete [] obj; delete [] collb; delete [] colub; delete [] rowlb; delete [] rowub; s->setObjSense(-1); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001, s->getColSolution(), solution1, 2); const double activity1[] = {10, 5}; ret = ret && equivalentVectors(s,s,0.0001, s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001, s->getColSolution(), solution2, 2); const double activity2[] = {10, 15}; ret = ret && equivalentVectors(s,s,0.0001, s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test2VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedMatrix m; m.transpose(); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); m.appendRow(r0); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); m.appendRow(r1); CoinPackedVector r2; r2.insert(0, 1); r2.insert(1, 1); m.appendRow(r2); int numcol = 2; double *obj = new double[numcol]; obj[0] = 3; obj[1] = 1; double *collb = new double[numcol]; collb[0] = 0; collb[1] = 0; double *colub = new double[numcol]; colub[0] = inf; colub[1] = inf; int numrow = 3; double *rowlb = new double[numrow]; rowlb[0] = -inf; rowlb[1] = -inf; rowlb[2] = 1; double *rowub = new double[numrow]; rowub[0] = 10; rowub[1] = 15; rowub[2] = inf; s->loadProblem(m, collb, colub, obj, rowlb, rowub); delete [] obj; delete [] collb; delete [] colub; delete [] rowlb; delete [] rowub; s->setObjSense(-1); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001, s->getColSolution(), solution1, 2); const double activity1[] = {10, 5, 5}; ret = ret && equivalentVectors(s,s,0.0001, s->getRowActivity(), activity1, 3); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001, s->getColSolution(), solution2, 2); const double activity2[] = {10, 15, 7}; ret = ret && equivalentVectors(s,s,0.0001, s->getRowActivity(), activity2, 3); return ret; } //-------------------------------------------------------------------------- bool test3VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; //double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, 0, 10, 3); s->addCol(empty, 0, 10, 1); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); s->addRow(r0, 0, 10); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, 0, 15); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {10, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {10, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test4VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, 0, inf, 3); s->addCol(empty, 0, inf, 1); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); s->addRow(r0, -inf, 10); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, -inf, 15); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {10, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {10, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- /* Constructs the system max 3x1 + x2 -inf <= 2x1 + x2 <= 10 -inf <= x1 + 3x2 <= 15 The optimal solution is unbounded. Objective is then changed to max x1 + x2 which has a bounded optimum at x1 = 3, x2 = 4. */ bool test5VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, -inf, inf, 3); s->addCol(empty, -inf, inf, 1); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); s->addRow(r0, -inf, 10); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, -inf, 15); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && !s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && s->isProvenDualInfeasible(); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {10, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test6VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, 0, inf, 3); s->addCol(empty, 0, inf, 1); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); s->addRow(r0, 0, 10); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, 0, 15); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {10, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {10, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test7VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, 4, inf, 3); s->addCol(empty, 3, inf, 1); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); s->addRow(r0, 0, 10); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, 0, 15); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && !s->isProvenOptimal(); ret = ret && s->isProvenPrimalInfeasible(); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && !s->isProvenOptimal(); ret = ret && s->isProvenPrimalInfeasible(); return ret; } //-------------------------------------------------------------------------- bool test8VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, -inf, inf, 3); s->addCol(empty, -inf, inf, 1); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); s->addRow(r0, 0, 10); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, 0, 15); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {6, -2}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {10, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {10, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test9VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, -inf, inf, 3); s->addCol(empty, -inf, inf, 1); CoinPackedVector r0; r0.insert(0, 2); r0.insert(1, 1); s->addRow(r0, 0, 10); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, 0, 15); CoinPackedVector r2; r2.insert(0, 1); r2.insert(1, 4); s->addRow(r2, 12, inf); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {4, 2}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {10, 10, 12}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 3); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {10, 15, 19}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 3); return ret; } //-------------------------------------------------------------------------- bool test10VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); int numcols = 2; int numrows = 2; const CoinBigIndex start[] = {0, 2, 4}; const int index[] = {0, 1, 0, 1}; const double value[] = {4, 1, 2, 3}; const double collb[] = {0, 0}; const double colub[] = {inf, inf}; double obj[] = {3, 1}; char rowsen[] = {'R', 'R'}; double rowrhs[] = {20, 15}; double rowrng[] = {20, 15}; s->loadProblem(numcols, numrows, start, index, value, collb, colub, obj, rowsen, rowrhs, rowrng); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {20, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {20, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test11VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); int numcols = 2; int numrows = 2; const CoinBigIndex start[] = {0, 2, 4}; const int index[] = {0, 1, 0, 1}; const double value[] = {4, 1, 2, 3}; const double collb[] = {0, 0}; const double colub[] = {inf, inf}; double obj[] = {3, 1}; double rowlb[] = {0, 0}; double rowub[] = {20, 15}; s->loadProblem(numcols, numrows, start, index, value, collb, colub, obj, rowlb, rowub); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {20, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {20, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test12VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedMatrix m; m.transpose(); CoinPackedVector r0; r0.insert(0, 4); r0.insert(1, 2); m.appendRow(r0); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); m.appendRow(r1); int numcol = 2; double *obj = new double[numcol]; obj[0] = 3; obj[1] = 1; double *collb = new double[numcol]; collb[0] = 0; collb[1] = 0; double *colub = new double[numcol]; colub[0] = inf; colub[1] = inf; int numrow = 2; double *rowlb = new double[numrow]; rowlb[0] = 0; rowlb[1] = 0; double *rowub = new double[numrow]; rowub[0] = 20; rowub[1] = 15; s->loadProblem(m, collb, colub, obj, rowlb, rowub); delete [] obj; delete [] collb; delete [] colub; delete [] rowlb; delete [] rowub; s->setObjSense(-1); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {20, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {20, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test13VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedMatrix m; CoinPackedVector c0; c0.insert(0, 4); c0.insert(1, 1); m.appendCol(c0); CoinPackedVector c1; c1.insert(0, 2); c1.insert(1, 3); m.appendCol(c1); int numcol = 2; double *obj = new double[numcol]; obj[0] = 3; obj[1] = 1; double *collb = new double[numcol]; collb[0] = 0; collb[1] = 0; double *colub = new double[numcol]; colub[0] = inf; colub[1] = inf; int numrow = 2; double *rowlb = new double[numrow]; rowlb[0] = 0; rowlb[1] = 0; double *rowub = new double[numrow]; rowub[0] = 20; rowub[1] = 15; s->loadProblem(m, collb, colub, obj, rowlb, rowub); delete [] obj; delete [] collb; delete [] colub; delete [] rowlb; delete [] rowub; s->setObjSense(-1); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {20, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {20, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test14VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addCol(empty, 0, inf, 3); s->addCol(empty, 0, inf, 1); CoinPackedVector r0; r0.insert(0, 4); r0.insert(1, 2); s->addRow(r0, 0, 20); CoinPackedVector r1; r1.insert(0, 1); r1.insert(1, 3); s->addRow(r1, 0, 15); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {20, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {20, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } //-------------------------------------------------------------------------- bool test15VivianDeSmedt(OsiSolverInterface *s) { bool ret = true; double inf = s->getInfinity(); CoinPackedVector empty; s->addRow(empty, 0, 20); s->addRow(empty, 0, 15); CoinPackedVector c0; c0.insert(0, 4); c0.insert(1, 1); s->addCol(c0, 0, inf, 3); CoinPackedVector c1; c1.insert(0, 2); c1.insert(1, 3); s->addCol(c1, 0, inf, 1); s->setObjSense(-1); s->writeMps("test"); s->initialSolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution1[] = {5, 0}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution1, 2); const double activity1[] = {20, 5}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity1, 2); s->setObjCoeff(0, 1); s->setObjCoeff(1, 1); s->resolve(); ret = ret && s->isProvenOptimal(); ret = ret && !s->isProvenPrimalInfeasible(); ret = ret && !s->isProvenDualInfeasible(); const double solution2[] = {3, 4}; ret = ret && equivalentVectors(s,s,0.0001,s->getColSolution(), solution2, 2); const double activity2[] = {20, 15}; ret = ret && equivalentVectors(s,s,0.0001,s->getRowActivity(), activity2, 2); return ret; } /* Another test case submitted by Vivian De Smedt. The test is to modify the objective function and check that the solver's optimum point tracks correctly. The initial problem is max 3*x1 + x2 s.t. 2*x1 + x2 <= 10 x1 + 3*x2 <= 15 with optimum z* = 15 at (x1,x2) = (5,0). Then the objective is changed to x1 + x2, with new optimum z* = 7 at (3,4). The volume algorithm doesn't return exact solution values, so relax the test for correctness when we're checking the solution. */ void changeObjAndResolve (const OsiSolverInterface *emptySi) { OsiSolverInterface *s = emptySi->clone() ; double dEmpty = 0 ; int iEmpty = 0 ; CoinBigIndex iEmpty2 = 0 ; /* Establish an empty problem. Establish empty columns with bounds and objective coefficient only. Finally, insert constraint coefficients and set for maximisation. */ s->loadProblem(0,0,&iEmpty2,&iEmpty,&dEmpty, &dEmpty,&dEmpty,&dEmpty,&dEmpty,&dEmpty) ; CoinPackedVector c ; s->addCol(c,0,10,3) ; s->addCol(c,0,10,1) ; double inf = s->getInfinity() ; CoinPackedVector r1 ; r1.insert(0,2) ; r1.insert(1,1) ; s->addRow(r1,-inf,10) ; r1.clear() ; r1.insert(0,1) ; r1.insert(1,3) ; s->addRow(r1,-inf,15) ; s->setObjSense(-1) ; /* Optimise for 3*x1 + x2 and check for correctness. */ s->initialSolve() ; const double *colSol = s->getColSolution() ; OSIUNITTEST_ASSERT_ERROR(colSol[0] >= 4.5, {}, *s, "changeObjAndResolve"); OSIUNITTEST_ASSERT_ERROR(colSol[1] <= 0.5, {}, *s, "changeObjAndResolve"); /* Set objective to x1 + x2 and reoptimise. */ s->setObjCoeff(0,1) ; s->setObjCoeff(1,1) ; s->resolve() ; colSol = s->getColSolution() ; OSIUNITTEST_ASSERT_ERROR(colSol[0] >= 2.3 && colSol[0] <= 3.7, {}, *s, "changeObjAndResolve"); OSIUNITTEST_ASSERT_ERROR(colSol[1] >= 3.5 && colSol[1] <= 4.5, {}, *s, "changeObjAndResolve"); delete s ; } /* This code is taken from some bug reports of Sebastian Nowozin. It demonstrates some issues he had with OsiClp. https://projects.coin-or.org/Osi/ticket/54 https://projects.coin-or.org/Osi/ticket/55 https://projects.coin-or.org/Osi/ticket/56 https://projects.coin-or.org/Osi/ticket/58 The short summary is that enabling/disabling the level 2 simplex interface (controllable pivoting) with an empty constraint matrix caused problems. For solvers that don't support simplex level 2, all we're testing is constraint system mods and resolve. Query (lh): The original comments with this code referred to use of Binv to generate cuts Binv et al. are level 1 simplex interface routines. Perhaps the test should use level 1. */ bool test16SebastianNowozin(OsiSolverInterface *si) { CoinAbsFltEq fltEq ; CoinPackedMatrix* matrix = new CoinPackedMatrix(false,0,0) ; matrix->setDimensions(0,4) ; double objective[] = { 0.1, 0.2, -0.1, -0.2 } ; double varLB[] = { 0.0, 0.0, 0.0, 0.0 } ; double varUB[] = { 1.0, 1.0, 1.0, 1.0 } ; si->loadProblem(*matrix, varLB, varUB, objective, NULL, NULL) ; delete matrix ; /* Set objective sense prior to objective, just to catch the unwary. */ si->setObjSense(1) ; si->setObjective(objective) ; /* The code provided with ticket 54 is illegal --- this first call cannot be resolve(). The first solve must be an initialSolve, for the benefit of solvers which use it for initialisation. -- lh, 080903 -- */ si->initialSolve() ; OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return false, *si, "test16SebastianNowozin initial solve"); OSIUNITTEST_ASSERT_ERROR(fltEq(si->getObjValue(),-0.3), return false, *si, "test16SebastianNowozin initial solve"); /* Expected: primal = [ 0 0 1 1 ] */ OSIUNITTEST_ASSERT_ERROR(si->getColSolution() != NULL, return false, *si, "test16SebastianNowozin initial solve"); /* Simulate a constraint generation interval that will require the simplex interface. Enable, then disable level 2 simplex interface (controllable pivoting), if the solver has it. */ if (si->canDoSimplexInterface() >= 2) { OSIUNITTEST_CATCH_ERROR(si->enableFactorization(), return false, *si, "test16SebastianNowozin initial solve"); OSIUNITTEST_CATCH_ERROR(si->enableSimplexInterface(true), return false, *si, "test16SebastianNowozin initial solve"); // try // { si->enableFactorization() ; // si->enableSimplexInterface(true) ; } // catch (CoinError e) // { std::string errmsg ; // errmsg = "first enableFactorization or enableSimplexInterface" ; // errmsg = errmsg + " threw CoinError: " + e.message() ; // OSIUNITTEST_ADD_OUTCOME(*si, "test16SebastianNowozin first enableFactorization or enableSimplexInterface", errmsg.c_str(), TestOutcome::ERROR, false); // failureMessage(*si,errmsg) ; // return (false) ; } // OSIUNITTEST_ADD_OUTCOME(*si, "test16SebastianNowozin first enableFactorization or enableSimplexInterface", "no exception", TestOutcome::PASSED, false); // (...) constraint generation here si->disableFactorization() ; } /* Add two constraints and resolve */ CoinPackedVector row1 ; // x_2 + x_3 - x_0 <= 0 row1.insert(0,-1.0) ; row1.insert(2,1.0) ; row1.insert(3,1.0) ; si->addRow(row1,-si->getInfinity(),0.0) ; CoinPackedVector row2 ; // x_0 + x_1 - x_3 <= 0 row2.insert(0,1.0) ; row2.insert(1,1.0) ; row2.insert(3,-1.0) ; si->addRow(row2,-si->getInfinity(),0.0) ; si->resolve() ; OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return false, *si, "test16SebastianNowozin first resolve"); OSIUNITTEST_ASSERT_ERROR(fltEq(si->getObjValue(),-0.1), return false, *si, "test16SebastianNowozin first resolve"); /* Expected: primal = [ 1 0 0 1 ] */ OSIUNITTEST_ASSERT_ERROR(si->getColSolution() != NULL, return false, *si, "test16SebastianNowozin first resolve"); /* Simulate another constraint generation run. */ if (si->canDoSimplexInterface() >= 2) { OSIUNITTEST_CATCH_ERROR(si->enableFactorization(), return false, *si, "test16SebastianNowozin first resolve"); OSIUNITTEST_CATCH_ERROR(si->enableSimplexInterface(true), return false, *si, "test16SebastianNowozin first resolve"); // try // { si->enableFactorization() ; // si->enableSimplexInterface(true) ; } // catch (CoinError e) // { std::string errmsg ; // errmsg = "second enableFactorization or enableSimplexInterface" ; // errmsg = errmsg + " threw CoinError: " + e.message() ; // failureMessage(*si,errmsg) ; // OSIUNITTEST_ADD_OUTCOME(*si, "test16SebastianNowozin second enableFactorization or enableSimplexInterface", errmsg.c_str(), TestOutcome::ERROR, false); // return (false) ; } // OSIUNITTEST_ADD_OUTCOME(*si, "test16SebastianNowozin second enableFactorization or enableSimplexInterface", "no exception", TestOutcome::PASSED, false); // (...) constraint generation here si->disableFactorization() ; } /* Remove a constraint, add .15 to the objective coefficients, and resolve. */ int rows_to_delete_arr[] = { 0 } ; si->deleteRows(1,rows_to_delete_arr) ; std::transform(objective,objective+4,objective, std::bind2nd(std::plus(),0.15)) ; si->setObjective(objective) ; si->resolve() ; OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return false, *si, "test16SebastianNowozin second resolve"); OSIUNITTEST_ASSERT_ERROR(fltEq(si->getObjValue(),-0.05), return false, *si, "test16SebastianNowozin second resolve"); /* Expected: obj = [ .25 .35 .05 -.05], primal = [ 0 0 0 1 ] */ OSIUNITTEST_ASSERT_ERROR(si->getColSolution() != NULL, return false, *si, "test16SebastianNowozin second resolve"); return true; } /* This code checks an issue reported by Sebastian Nowozin in OsiClp ticket 57. He said that OsiClpSolverInterface::getReducedGradient() requires a prior call to both enableSimplexInterface(true) and enableFactorization(), but only checks/asserts the simplex interface. Same comment as test16 --- would simplex level 1 suffice? */ bool test17SebastianNowozin(OsiSolverInterface *si) { if (si->canDoSimplexInterface() < 2) { return (true) ; } CoinPackedMatrix *matrix = new CoinPackedMatrix(false,0,0) ; matrix->setDimensions(0,4) ; double objective[] = { 0.1, 0.2, -0.1, -0.2, } ; double varLB[] = { 0.0, 0.0, 0.0, 0.0, } ; double varUB[] = { 1.0, 1.0, 1.0, 1.0, } ; si->loadProblem(*matrix,varLB,varUB,objective,NULL,NULL) ; si->setObjSense(1) ; delete matrix ; CoinPackedVector row1 ; // x_2 + x_3 - x_0 <= 0 row1.insert(0,-1.0) ; row1.insert(2,1.0) ; row1.insert(3,1.0) ; si->addRow(row1,-si->getInfinity(),0.0) ; si->initialSolve() ; OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return false, *si, "test17SebastianNowozin"); if (!si->isProvenOptimal()) return false; /* Unlike test16, here we do not call si->enableFactorization() first. */ OSIUNITTEST_CATCH_ERROR(si->enableSimplexInterface(true), return false, *si, "test17SebastianNowozin"); /* Now check that getReducedGradient works. */ double dummy[4] = { 1., 1., 1., 1.} ; OSIUNITTEST_CATCH_ERROR(si->getReducedGradient(dummy,dummy,dummy), return false, *si, "test17SebastianNowozin"); return true; } //############################################################################# // Routines to test various feature groups //############################################################################# /*! \brief Test row and column name manipulation emptySi should be an empty solver interface, fn the path to the exmpi1 example. */ void testNames (const OsiSolverInterface *emptySi, std::string fn) { bool recognisesOsiNames = true ; bool ok ; OsiSolverInterface *si = emptySi->clone() ; std::string exmip1ObjName = "OBJ" ; OsiSolverInterface::OsiNameVec exmip1RowNames(0) ; exmip1RowNames.push_back("ROW01") ; exmip1RowNames.push_back("ROW02") ; exmip1RowNames.push_back("ROW03") ; exmip1RowNames.push_back("ROW04") ; exmip1RowNames.push_back("ROW05") ; OsiSolverInterface::OsiNameVec exmip1ColNames(0) ; exmip1ColNames.push_back("COL01") ; exmip1ColNames.push_back("COL02") ; exmip1ColNames.push_back("COL03") ; exmip1ColNames.push_back("COL04") ; exmip1ColNames.push_back("COL05") ; exmip1ColNames.push_back("COL06") ; exmip1ColNames.push_back("COL07") ; exmip1ColNames.push_back("COL08") ; testingMessage("Testing row/column name handling ...") ; /* Try to get the solver name, but don't immediately abort. */ std::string solverName = "Unknown solver" ; OSIUNITTEST_ASSERT_WARNING(si->getStrParam(OsiSolverName,solverName) == true, {}, solverName, "testNames: getStrParam(OsiSolverName)"); /* Checking default names. dfltRowColName is pretty liberal about indices, but they should never be negative. Since default row/column names are a letter plus n digits, asking for a length of 5 on the objective gets you a leading 'O' plus five more letters. */ std::string dfltName = si->dfltRowColName('o',0,5) ; std::string expName = "OBJECT" ; OSIUNITTEST_ASSERT_WARNING(dfltName == expName, {}, solverName, "testNames: default objective name"); dfltName = si->dfltRowColName('r',-1,5) ; expName = "!!invalid Row -1!!" ; OSIUNITTEST_ASSERT_WARNING(dfltName == expName, {}, solverName, "testNames: default name for invalid row"); dfltName = si->dfltRowColName('c',-1,5) ; expName = "!!invalid Col -1!!" ; OSIUNITTEST_ASSERT_WARNING(dfltName == expName, {}, solverName, "testNames: default name for invalid col"); /* Start by telling the SI to use lazy names and see if it comes up with the right names from the MPS file. There's no point in proceeding further if we can't read an MPS file. */ // std::cout << "Testing lazy names from MPS input file." << std::endl ; OSIUNITTEST_ASSERT_SEVERITY_EXPECTED(si->setIntParam(OsiNameDiscipline, 1) == true, recognisesOsiNames = false, solverName, "testNames: switch to lazy names", TestOutcome::NOTE, false); OSIUNITTEST_ASSERT_ERROR(si->readMps(fn.c_str(),"mps") == 0, delete si; return, solverName, "testNames: read MPS"); OsiSolverInterface::OsiNameVec rowNames ; int rowNameCnt ; OsiSolverInterface::OsiNameVec colNames ; int colNameCnt ; int m = si->getNumRows() ; if (recognisesOsiNames) { std::string objName = si->getObjName() ; OSIUNITTEST_ASSERT_WARNING(objName == exmip1ObjName, {}, solverName, "testNames lazy names: objective name"); OSIUNITTEST_ASSERT_WARNING(si->getRowName(m) == exmip1ObjName, {}, solverName, "testNames lazy names: name of one after last row is objective name"); rowNames = si->getRowNames() ; rowNameCnt = static_cast(rowNames.size()) ; OSIUNITTEST_ASSERT_WARNING(rowNameCnt == static_cast(exmip1RowNames.size()), {}, solverName, "testNames lazy names: row names count"); ok = true ; for (int i = 0 ; i < rowNameCnt ; i++) { if (rowNames[i] != exmip1RowNames[i]) { ok = false ; std::cout << "ERROR! " ; std::cout << "Row " << i << " is \"" << rowNames[i] << "\" expected \"" << exmip1RowNames[i] << "\"." << std::endl; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: row names"); colNames = si->getColNames() ; colNameCnt = static_cast(colNames.size()) ; OSIUNITTEST_ASSERT_WARNING(colNameCnt == static_cast(exmip1ColNames.size()), {}, solverName, "testNames lazy names: column names count"); ok = true ; for (int j = 0 ; j < colNameCnt ; j++) { if (colNames[j] != exmip1ColNames[j]) { ok = false ; std::cout << "ERROR! " ; std::cout << "Column " << j << " is " << colNames[j] << "\" expected \"" << exmip1ColNames[j] << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: column names"); /* Switch back to name discipline 0. We should revert to default names. Failure to switch back to discipline 0 after successfully switching to discipline 1 is some sort of internal confusion in the Osi; abort the test. */ // std::cout << "Switching to no names (aka default names)." << std::endl ; OSIUNITTEST_ASSERT_WARNING(si->setIntParam(OsiNameDiscipline, 0) == true, delete si; return, solverName, "testNames: switch to no names"); } /* This block of tests for default names should pass even if the underlying Osi doesn't recognise OsiNameDiscipline. When using default names, name vectors are not necessary, hence should have size zero. */ rowNames = si->getRowNames() ; OSIUNITTEST_ASSERT_WARNING(rowNames.size() == 0, {}, solverName, "testNames no names: row names count"); ok = true ; for (int i = 0 ; i < m ; i++) { if (si->getRowName(i) != si->dfltRowColName('r',i)) { ok = false ; std::cout << "ERROR! " ; std::cout << "Row " << i << " is \"" << si->getRowName(i) << "\" expected \"" << si->dfltRowColName('r',i) << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames no names: row names"); colNames = si->getColNames() ; OSIUNITTEST_ASSERT_WARNING(colNames.size() == 0, {}, solverName, "testNames no names: column names count"); int n = si->getNumCols() ; ok = true ; for (int j = 0 ; j < n ; j++) { if (si->getColName(j) != si->dfltRowColName('c',j)) { ok = false ; std::cout << "ERROR! " ; std::cout << "Column " << j << " is \"" << si->getColName(j) << "\" expected \"" << si->dfltRowColName('c',j) << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames no names: column names"); /* This is as much as we can ask if the underlying solver doesn't recognise OsiNameDiscipline. Return if that's the case. */ if (!recognisesOsiNames) { delete si ; return; } /* Switch back to lazy names. The previous names should again be available. */ // std::cout << "Switching back to lazy names." << std::endl ; OSIUNITTEST_ASSERT_WARNING(si->setIntParam(OsiNameDiscipline,1) == true, delete si; return, solverName, "testNames: switch to lazy names"); rowNames = si->getRowNames() ; rowNameCnt = static_cast(rowNames.size()) ; OSIUNITTEST_ASSERT_WARNING(rowNameCnt == static_cast(exmip1RowNames.size()), {}, solverName, "testNames lazy names: row names count"); ok = true ; for (int i = 0 ; i < rowNameCnt ; i++) { if (rowNames[i] != exmip1RowNames[i]) { ok = false ; std::cout << "ERROR! " ; std::cout << "Row " << i << " is \"" << rowNames[i] << "\" expected \"" << exmip1RowNames[i] << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: row names"); colNames = si->getColNames() ; colNameCnt = static_cast(colNames.size()) ; OSIUNITTEST_ASSERT_WARNING(colNameCnt == static_cast(exmip1ColNames.size()), {}, solverName, "testNames lazy names: column names count"); ok = true ; for (int j = 0 ; j < colNameCnt ; j++) { if (colNames[j] != exmip1ColNames[j]) { ok = false ; std::cout << "ERROR! " ; std::cout << "Column " << j << " is " << colNames[j] << "\" expected \"" << exmip1ColNames[j] << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: column names"); /* Add a row. We should see no increase in the size of the row name vector, and asking for the name of the new row should return a default name. */ int nels = 5 ; int indices[5] = { 0, 2, 3, 5, 7 } ; double els[5] = { 1.0, 3.0, 4.0, 5.0, 42.0 } ; CoinPackedVector newRow(nels,indices,els) ; si->addRow(newRow,-4.2, .42) ; OSIUNITTEST_ASSERT_WARNING(si->getNumRows() == m+1, delete si; return, solverName, "testNames lazy names: added a row"); rowNames = si->getRowNames() ; rowNameCnt = static_cast(rowNames.size()) ; OSIUNITTEST_ASSERT_WARNING(rowNameCnt == m, {}, solverName, "testNames lazy names: row names count after row addition"); OSIUNITTEST_ASSERT_WARNING(si->getRowName(m) == si->dfltRowColName('r',m), {}, solverName, "testNames lazy names: default name for added row"); /* Now set a name for the row. */ std::string newRowName = "NewRow" ; si->setRowName(m,newRowName) ; OSIUNITTEST_ASSERT_WARNING(si->getRowName(m) == newRowName, {}, solverName, "testNames lazy names: setting new row name"); /* Ok, who are we really talking with? Delete row 0 and see if the names change appropriately. Since deleteRows is pure virtual, the names will change only if the underlying OsiXXX supports names (i.e., it must make a call to deleteRowNames). */ // std::cout << "Testing row deletion." << std::endl ; si->deleteRows(1,indices) ; rowNames = si->getRowNames() ; rowNameCnt = static_cast(rowNames.size()) ; OSIUNITTEST_ASSERT_WARNING(rowNameCnt == m, {}, solverName, "testNames lazy names: row names count after deleting row"); ok = true ; for (int i = 0 ; i < rowNameCnt ; i++) { std::string expected ; if (i != m-1) { expected = exmip1RowNames[i+1] ; } else { expected = newRowName ; } if (rowNames[i] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Row " << i << " is \"" << rowNames[i] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: row names after deleting row"); /* Add/delete a column and do the same tests. Expected results as above. */ nels = 3 ; indices[0] = 0 ; indices[1] = 2 ; indices[2] = 4 ; els[0] = 1.0 ; els[1] = 4.0 ; els[2] = 24.0 ; CoinPackedVector newCol(nels,indices,els) ; si->addCol(newCol,-4.2, .42, 42.0) ; OSIUNITTEST_ASSERT_ERROR(si->getNumCols() == n+1, delete si; return, solverName, "testNames lazy names: columns count after adding column"); colNames = si->getColNames() ; colNameCnt = static_cast(colNames.size()) ; OSIUNITTEST_ASSERT_WARNING(colNameCnt == n, {}, solverName, "testNames lazy names: columns names count after adding column"); OSIUNITTEST_ASSERT_WARNING(si->getColName(n) == si->dfltRowColName('c',n), {}, solverName, "testNames lazy names default column name after adding column"); std::string newColName = "NewCol" ; si->setColName(n,newColName) ; OSIUNITTEST_ASSERT_WARNING(si->getColName(n) == newColName, {}, solverName, "testNames lazy names: setting column name"); // std::cout << "Testing column deletion." << std::endl ; si->deleteCols(1,indices) ; colNames = si->getColNames() ; colNameCnt = static_cast(colNames.size()) ; OSIUNITTEST_ASSERT_WARNING(colNameCnt == n, {}, solverName, "testNames lazy names: column names count after deleting column"); ok = true ; for (int j = 0 ; j < colNameCnt ; j++) { std::string expected ; if (j != n-1) { expected = exmip1ColNames[j+1] ; } else { expected = newColName ; } if (colNames[j] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Column " << j << " is \"" << colNames[j] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: column names after deleting column"); /* Interchange row and column names. */ // std::cout << "Testing bulk replacement of names." << std::endl ; si->setRowNames(exmip1ColNames,0,3,2) ; rowNames = si->getRowNames() ; rowNameCnt = static_cast(rowNames.size()) ; OSIUNITTEST_ASSERT_WARNING(rowNameCnt == m, {}, solverName, "testNames lazy names: row names count after bulk replace"); ok = true ; for (int i = 0 ; i < rowNameCnt ; i++) { std::string expected ; if (i < 2) { expected = exmip1RowNames[i+1] ; } else if (i >= 2 && i <= 4) { expected = exmip1ColNames[i-2] ; } else { expected = newRowName ; } if (rowNames[i] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Row " << i << " is \"" << rowNames[i] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: row names after bulk replace"); si->setColNames(exmip1RowNames,3,2,0) ; colNames = si->getColNames() ; colNameCnt = static_cast(colNames.size()) ; OSIUNITTEST_ASSERT_WARNING(colNameCnt == n, {}, solverName, "testNames lazy names: column names count after bulk replace"); ok = true ; for (int j = 0 ; j < colNameCnt ; j++) { std::string expected ; if (j < 2) { expected = exmip1RowNames[j+3] ; } else if (j >= 2 && j <= 6) { expected = exmip1ColNames[j+1] ; } else { expected = newColName ; } if (colNames[j] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Column " << j << " is \"" << colNames[j] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: column names after bulk replace"); /* Delete a few row and column names (directly, as opposed to deleting rows or columns). Names should shift downward. */ // std::cout << "Testing name deletion." << std::endl ; si->deleteRowNames(0,2) ; rowNames = si->getRowNames() ; rowNameCnt = static_cast(rowNames.size()) ; OSIUNITTEST_ASSERT_WARNING(rowNameCnt == m-2, {}, solverName, "testNames lazy names: row names count after deleting 2 rows"); ok = true ; for (int i = 0 ; i < rowNameCnt ; i++) { std::string expected ; if (i < rowNameCnt) { expected = exmip1ColNames[i] ; } if (rowNames[i] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Row " << i << " is \"" << rowNames[i] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: row names after deleting 2 rows"); si->deleteColNames(5,3) ; colNames = si->getColNames() ; colNameCnt = static_cast(colNames.size()) ; OSIUNITTEST_ASSERT_WARNING(colNameCnt == n-3, {}, solverName, "testNames lazy names: column names count after deleting 3 columns"); ok = true ; for (int j = 0 ; j < colNameCnt ; j++) { std::string expected ; if (j < 2) { expected = exmip1RowNames[j+3] ; } else if (j >= 2 && j < colNameCnt) { expected = exmip1ColNames[j+1] ; } if (colNames[j] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Column " << j << " is \"" << colNames[j] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames lazy names: column names after deleting 3 columns"); /* Finally, switch to full names, and make sure we retrieve full length vectors. */ // std::cout << "Switching to full names." << std::endl ; OSIUNITTEST_ASSERT_WARNING(si->setIntParam(OsiNameDiscipline,2), delete si; return, solverName, "testNames lazy names: change name discipline"); m = si->getNumRows() ; rowNames = si->getRowNames() ; rowNameCnt = static_cast(rowNames.size()) ; OSIUNITTEST_ASSERT_WARNING(rowNameCnt == m+1, {}, solverName, "testNames full names: row names count"); OSIUNITTEST_ASSERT_WARNING(rowNames[m] == exmip1ObjName, {}, solverName, "testNames full names: objective name"); ok = true ; for (int i = 0 ; i < rowNameCnt-1 ; i++) { std::string expected ; if (i < 3) { expected = exmip1ColNames[i] ; } else { expected = si->dfltRowColName('r',i) ; } if (rowNames[i] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Row " << i << " is \"" << rowNames[i] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames full names: row names"); n = si->getNumCols() ; colNames = si->getColNames() ; colNameCnt = static_cast(colNames.size()) ; OSIUNITTEST_ASSERT_WARNING(colNameCnt == n, {}, solverName, "testNames full names: column names count"); ok = true ; for (int j = 0 ; j < colNameCnt ; j++) { std::string expected ; if (j < 2) { expected = exmip1RowNames[j+3] ; } else if (j >= 2 && j <= 4) { expected = exmip1ColNames[j+1] ; } else { expected = si->dfltRowColName('c',j) ; } if (colNames[j] != expected) { ok = false ; std::cout << "ERROR! " ; std::cout << "Column " << j << " is " << colNames[j] << "\" expected \"" << expected << "\"." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, {}, solverName, "testNames full names: column names"); delete si ; } //-------------------------------------------------------------------------- /*! \brief Tests for a solution imposed by the user. Checks the routines setColSolution (primal variables) and setRowSolution (dual variables). Goes on to check that getReducedCost and getRowActivity use the imposed solution. The prototype OSI supplied as the parameter should be loaded with a smallish problem. */ void testSettingSolutions (OsiSolverInterface &proto) { OsiSolverInterface *si = proto.clone() ; bool allOK = true ; int i ; int m = si->getNumRows() ; int n = si->getNumCols() ; double mval,cval,rval ; const double *rowVec,*colVec,*objVec ; double *colShouldBe = new double [m] ; double *rowShouldBe = new double [n] ; CoinAbsFltEq fltEq ; testingMessage("Checking that solver can set row and column solutions ...") ; /* Create dummy solution vectors. */ double *dummyColSol = new double[n] ; for (i = 0 ; i < n ; i++) { dummyColSol[i] = i + .5 ; } double *dummyRowSol = new double[m] ; for (i = 0 ; i < m ; i++ ) { dummyRowSol[i] = i - .5 ; } /* First the values we can set directly: primal (column) and dual (row) solutions. The osi should copy the vector, hence the pointer we get back should not be the pointer we supply. But it's reasonable to expect exact equality, as no arithmetic should be performed. */ si->setColSolution(dummyColSol) ; OSIUNITTEST_ASSERT_ERROR(dummyColSol != si->getColSolution(), allOK = false, *si, "setting solutions: solver should not return original pointer"); rowVec = si->getColSolution() ; bool ok = true ; for (i = 0 ; i < n ; i++) { mval = rowVec[i] ; rval = dummyColSol[i] ; if (mval != rval) { ok = false ; std::cout << "x<" << i << "> = " << mval << ", expecting " << rval << ", |error| = " << (mval-rval) << "." << std::endl ; } } OSIUNITTEST_ASSERT_ERROR(ok == true, allOK = false, *si, "setting solutions: solver stored column solution correctly"); si->setRowPrice(dummyRowSol) ; OSIUNITTEST_ASSERT_ERROR(dummyRowSol != si->getRowPrice(), allOK = false, *si, "setting solutions: solver should not return original pointer"); colVec = si->getRowPrice() ; if( colVec != NULL ) { ok = true ; for (i = 0 ; i < m ; i++) { mval = colVec[i] ; cval = dummyRowSol[i] ; if (mval != cval) { ok = false ; std::cout << "y<" << i << "> = " << mval << ", expecting " << cval << ", |error| = " << (mval-cval) << "." << std::endl ; } } } else ok = false; OSIUNITTEST_ASSERT_ERROR(ok == true, allOK = false, *si, "setting solutions: solver stored row price correctly"); /* Now let's get serious. Check that reduced costs and row activities match the values we just specified for row and column solutions. Absolute equality cannot be assumed here. Reduced costs first: c - yA */ rowVec = si->getReducedCost() ; objVec = si->getObjCoefficients() ; const CoinPackedMatrix *mtx = si->getMatrixByCol() ; mtx->transposeTimes(dummyRowSol,rowShouldBe) ; if( rowVec != NULL ) { ok = true ; for (i = 0 ; i < n ; i++) { mval = rowVec[i] ; rval = objVec[i] - rowShouldBe[i] ; if (!fltEq(mval,rval)) { ok = false ; std::cout << "cbar<" << i << "> = " << mval << ", expecting " << rval << ", |error| = " << (mval-rval) << "." << std::endl ; } } } else ok = false; OSIUNITTEST_ASSERT_WARNING(ok == true, allOK = false, *si, "setting solutions: reduced costs from solution set with setRowPrice"); /* Row activity: Ax */ colVec = si->getRowActivity() ; mtx->times(dummyColSol,colShouldBe) ; ok = true ; for (i = 0 ; i < m ; i++) { mval = colVec[i] ; cval = colShouldBe[i] ; if (!fltEq(mval,cval)) { ok = false ; std::cout << "lhs<" << i << "> = " << mval << ", expecting " << cval << ", |error| = " << (mval-cval) << "." << std::endl ; } } OSIUNITTEST_ASSERT_WARNING(ok == true, allOK = false, *si, "setting solutions: row activity from solution set with setColSolution"); if (allOK) { testingMessage(" ok.\n") ; } else { failureMessage(*si,"Errors handling imposed column/row solutions.") ; } delete [] dummyColSol ; delete [] colShouldBe ; delete [] dummyRowSol ; delete [] rowShouldBe ; delete si ; return ; } //-------------------------------------------------------------------------- /*! \brief Helper routines to test OSI parameters. A set of helper routines to test integer, double, and hint parameter set/get routines. */ bool testIntParam(OsiSolverInterface * si, int k, int val) { int i = 123456789, orig = 123456789; bool ret; OsiIntParam key = static_cast(k); si->getIntParam(key, orig); if (si->setIntParam(key, val)) { ret = (si->getIntParam(key, i) == true) && (i == val); } else { ret = (si->getIntParam(key, i) == true) && (i == orig); } return ret; } bool testDblParam(OsiSolverInterface * si, int k, double val) { double d = 123456789.0, orig = 123456789.0; bool ret; OsiDblParam key = static_cast(k); si->getDblParam(key, orig); if (si->setDblParam(key, val)) { ret = (si->getDblParam(key, d) == true) && (d == val); } else { ret = (si->getDblParam(key, d) == true) && (d == orig); } return ret; } bool testHintParam(OsiSolverInterface * si, int k, bool sense, OsiHintStrength strength, int *throws) /* Tests for proper behaviour of [set,get]HintParam methods. The initial get tests the return value to see if the hint is implemented; the values returned for sense and strength are not checked. If the hint is implemented, a pair of set/get calls is performed at the strength specified by the parameter. The set can return true or, at strength OsiForceDo, throw an exception if the solver cannot comply. The rationale would be that only OsiForceDo must be obeyed, so anything else should return true regardless of whether the solver followed the hint. The test checks that the value and strength returned by getHintParam matches the previous call to setHintParam. This is arguably wrong --- one can argue that it should reflect the solver's ability to comply with the hint. But that's how the OSI interface standard has evolved up to now. If the hint is not implemented, attempting to set the hint should return false, or throw an exception at strength OsiForceDo. The testing code which calls testHintParam is set up so that a successful return is defined as true if the hint is implemented, false if it is not. Information printing is suppressed; uncomment and recompile if you want it. */ { bool post_sense ; OsiHintStrength post_strength ; bool ret ; OsiHintParam key = static_cast(k) ; if (si->getHintParam(key,post_sense,post_strength)) { ret = false ; std::ostringstream tstname; tstname << "testHintParam: hint " << static_cast(key) << " sense " << sense << " strength " << static_cast(strength); if( strength == OsiForceDo ) { try { if (si->setHintParam(key,sense,strength)) { ret = (si->getHintParam(key,post_sense,post_strength) == true) && (post_strength == strength) && (post_sense == sense); } } catch( CoinError& e ) { std::cout << tstname.str() << " catched CoinError exception " << e.message() << std::endl; ret = true; (*throws)++; } } else { OSIUNITTEST_CATCH_WARNING( if (si->setHintParam(key,sense,strength)) { ret = (si->getHintParam(key,post_sense,post_strength) == true) && (post_strength == strength) && (post_sense == sense); }, (*throws)++; ret = (strength == OsiForceDo), *si, tstname.str() ); } } else { ret = true ; std::ostringstream tstname; tstname << "testHintParam: hint " << static_cast(key) << " sense " << sense << " strength " << static_cast(strength); OSIUNITTEST_CATCH_WARNING(ret = si->setHintParam(key,sense,strength), (*throws)++; ret = !(strength == OsiForceDo), *si, tstname.str()); } return ret ; } /* Test functionality related to the objective function: * Does the solver properly handle a constant offset? * Does the solver properly handle primal and dual objective limits? This routine only checks for the correct answers. It does not check whether the solver stops early due to objective limits. * Does the solver properly handle minimisation / maximisation via setObjSense? The return value is the number of failures recorded by the routine. */ void testObjFunctions (const OsiSolverInterface *emptySi, const std::string &mpsDir) { OsiSolverInterface *si = emptySi->clone() ; CoinRelFltEq eq ; int i ; std::cout << "Testing functionality related to the objective." << std::endl ; std::string solverName = "Unknown solver" ; si->getStrParam(OsiSolverName,solverName) ; /* Check for default objective sense. This should be minimisation. */ OSIUNITTEST_ASSERT_ERROR(si->getObjSense() == 1.0 || si->getObjSense() == -1.0, {}, solverName, "testObjFunctions: default objective sense is determinant value"); OSIUNITTEST_ASSERT_WARNING(si->getObjSense() == 1.0, {}, solverName, "testObjFunctions: default objective sense is minimization"); /* Read in e226; chosen because it has an offset defined in the mps file. We can't continue if we can't read the test problem. */ std::string fn = mpsDir+"e226" ; OSIUNITTEST_ASSERT_ERROR(si->readMps(fn.c_str(),"mps") == 0, delete si; return, solverName, "testObjFunctions: read MPS"); /* Solve and test for the correct objective value. */ si->initialSolve() ; double objValue = si->getObjValue() ; double objNoOffset = -18.751929066 ; double objOffset = +7.113 ; OSIUNITTEST_ASSERT_ERROR(eq(objValue,(objNoOffset+objOffset)), {}, solverName, "testObjFunctions: getObjValue with constant in objective"); /* Test objective limit methods. If no limit has been specified, they should return false. */ OSIUNITTEST_ASSERT_ERROR(!si->isPrimalObjectiveLimitReached(), {}, solverName, "testObjFunctions: isPrimalObjectiveLimitReached without limit (min)"); OSIUNITTEST_ASSERT_ERROR(!si->isDualObjectiveLimitReached(), {}, solverName, "testObjFunctions: isDualObjectiveLimitReached without limit (min)"); /* One could think that also no limit should be reached in case of maximization. * However, by default primal and dual limits are not unset, but set to plus or minus infinity. * So, if we change the objective sense, we need to remember to set also the limits to a nonlimiting value. */ si->setObjSense(-1.0) ; si->setDblParam(OsiPrimalObjectiveLimit, COIN_DBL_MAX); si->setDblParam(OsiDualObjectiveLimit, -COIN_DBL_MAX); OSIUNITTEST_ASSERT_ERROR(!si->isPrimalObjectiveLimitReached(), {}, solverName, "testObjFunctions: isPrimalObjectiveLimitReached without limit (max)"); OSIUNITTEST_ASSERT_ERROR(!si->isDualObjectiveLimitReached(), {}, solverName, "testObjFunctions: isDualObjectiveLimitReached without limit (max)"); si->setObjSense(1.0) ; si->setDblParam(OsiPrimalObjectiveLimit, -COIN_DBL_MAX); si->setDblParam(OsiDualObjectiveLimit, COIN_DBL_MAX); /* Test objective limit methods. There's no attempt to see if the solver stops early when given a limit that's tighter than the optimal objective. All we're doing here is checking that the routines return the correct value when the limits are exceeded. For minimisation (maximisation) the primal limit represents an acceptable level of `goodness'; to be true, we should be below (above) it. The dual limit represents an unacceptable level of `badness'; to be true, we should be above (below) it. The loop performs two iterations, first for maximisation, then for minimisation. For maximisation, z* = 111.65096. The second iteration is sort of redundant, but it does test the ability to switch back to minimisation. */ double expectedObj[2] = { 111.650960689, objNoOffset+objOffset } ; double primalObjLim[2] = { 100.0, -5.0 } ; double dualObjLim[2] = { 120.0, -15.0 } ; double optSense[2] = { -1.0, 1.0 } ; for (i = 0 ; i <= 1 ; i++) { si->setObjSense(optSense[i]) ; // reset objective limits to infinity si->setDblParam(OsiPrimalObjectiveLimit, -optSense[i] * COIN_DBL_MAX); si->setDblParam(OsiDualObjectiveLimit, optSense[i] * COIN_DBL_MAX); si->initialSolve() ; objValue = si->getObjValue() ; OSIUNITTEST_ASSERT_ERROR(eq(objValue,expectedObj[i]), {}, solverName, "testObjFunctions: optimal value during max/min switch"); si->setDblParam(OsiPrimalObjectiveLimit,primalObjLim[i]) ; si->setDblParam(OsiDualObjectiveLimit,dualObjLim[i]) ; OSIUNITTEST_ASSERT_WARNING(si->isPrimalObjectiveLimitReached(), {}, solverName, "testObjFunctions: primal objective limit"); OSIUNITTEST_ASSERT_WARNING(si->isDualObjectiveLimitReached(), {}, solverName, "testObjFunctions: dual objective limit"); } delete si ; si = 0 ; /* Finally, check that the objective sense is treated as a parameter of the solver, not a property of the problem. The test clones emptySi, inverts the default objective sense, clones a second solver, then loads and optimises e226. */ si = emptySi->clone() ; double dfltSense = si->getObjSense() ; dfltSense = -dfltSense ; si->setObjSense(dfltSense) ; OsiSolverInterface *si2 = si->clone() ; delete si ; si = NULL ; OSIUNITTEST_ASSERT_ERROR(si2->getObjSense() == dfltSense, {}, solverName, "testObjFunctions: objective sense preserved by clone"); OSIUNITTEST_ASSERT_ERROR(si2->readMps(fn.c_str(),"mps") == 0, delete si; return, solverName, "testObjFunctions: 2nd read MPS"); OSIUNITTEST_ASSERT_ERROR(si2->getObjSense() == dfltSense, {}, solverName, "testObjFunctions: objective sense preserved by problem load"); si2->initialSolve() ; if (dfltSense < 0) { i = 0 ; } else { i = 1 ; } objValue = si2->getObjValue() ; OSIUNITTEST_ASSERT_ERROR(eq(objValue,expectedObj[i]), {}, solverName, "testObjFunctions: optimal value of load problem after set objective sense"); delete si2 ; } /* Check that solver returns the proper status for artificial variables. The OSI convention is that this status should be reported as if the artificial uses a positive coefficient. Specifically: ax <= b ==> ax + s = b, 0 <= s <= infty ax >= b ==> ax + s = b, -infty <= s <= 0 If the constraint is tight at optimum, then the status should be atLowerBound for a <= constraint, atUpperBound for a >= constraint. The test problem is x1 >= -5 (c0) x1 <= 2 (c1) x2 >= 44 (c2) x2 <= 51 (c3) This is evaluated for two objectives, so that we have all combinations of tight constraints under minimisation and maximisation. max x1-x2 min x1-x2 obj -42 -56 c0 basic upper c1 lower basic c2 upper basic c3 basic lower */ void testArtifStatus (const OsiSolverInterface *emptySi) { OsiSolverInterface *si = emptySi->clone() ; double infty = si->getInfinity() ; testingMessage("Testing status for artificial variables.\n") ; /* Set up the example problem in packed column-major vector format and load it into the solver. */ int colCnt = 2 ; int rowCnt = 4 ; int indices[] = {0, 1, 2, 3} ; double coeffs[] = {1.0, 1.0, 1.0, 1.0} ; CoinBigIndex starts[] = {0, 2, 4} ; double obj[] = {1.0, -1.0} ; double vubs[] = { infty, infty } ; double vlbs[] = { -infty, -infty } ; double rubs[] = { infty, 2.0, infty, 51.0 } ; double rlbs[] = { -5.0, -infty, 44.0, -infty } ; std::string contype[] = { ">=", "<=", ">=", "<=" } ; std::string statCode[] = { "isFree", "basic", "atUpperBound", "atLowerBound" } ; std::string sense[] = { "maximise", "minimise" } ; si->loadProblem(colCnt,rowCnt, starts,indices,coeffs,vlbs,vubs,obj,rlbs,rubs) ; /* Vectors for objective sense and correct answers. Maximise first. */ double objSense[] = { -1.0, 1.0 } ; double zopt[] = { -42.0, -56 } ; CoinWarmStartBasis::Status goodStatus[] = { CoinWarmStartBasis::basic, CoinWarmStartBasis::atLowerBound, CoinWarmStartBasis::atUpperBound, CoinWarmStartBasis::basic, CoinWarmStartBasis::atUpperBound, CoinWarmStartBasis::basic, CoinWarmStartBasis::basic, CoinWarmStartBasis::atLowerBound } ; /* Get to work. Open a loop, set the objective sense, solve the problem, and then check the results: We should have an optimal solution, with the correct objective. We should be able to ask for a warm start basis, and it should show the correct status. */ CoinRelFltEq eq ; for (int iter = 0 ; iter <= 1 ; iter++) { si->setObjSense(objSense[iter]) ; si->initialSolve() ; OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), {}; continue, *si, "testArtifStatus: initial solve"); OSIUNITTEST_ASSERT_ERROR(eq(si->getObjValue(),zopt[iter]), {}; continue, *si, "testArtifStatus: initial solve optimal value"); CoinWarmStart *ws = si->getWarmStart() ; CoinWarmStartBasis *wsb = dynamic_cast(ws) ; OSIUNITTEST_ASSERT_ERROR(wsb != NULL, {}; continue, *si, "testArtifStatus: initial solve warm start basis"); CoinWarmStartBasis::Status stati ; bool ok = true; for (int i = 0 ; i < rowCnt ; i++) { stati = wsb->getArtifStatus(i) ; if (stati != goodStatus[iter*rowCnt+i]) { ok = false; std::cout << "Incorrect status " << statCode[stati] << " for " << contype[i] << " constraint c" << i << " (" << sense[iter] << "), expected " << statCode[goodStatus[iter*rowCnt+i]] << "." << std::endl; } } OSIUNITTEST_ASSERT_ERROR(ok == true, {}, *si, "testArtifStatus: artifical variable status"); delete ws ; } /* Clean up. */ delete si ; } /* This method checks [cbar cbar] = [c-yB c-yN] = [0 (c - yN)] for the architectural variables. (But note there's no need to discriminate between basic and nonbasic columns in the tests below.) This provides a moderately strong check on the correctness of y (getRowPrice) and cbar (getReducedCosts). The method also checks that the sign of cbar is appropriate for the status of the variables. */ void testReducedCosts (const OsiSolverInterface *emptySi, const std::string &sampleDir) { OsiSolverInterface *si = emptySi->clone() ; std::string solverName; si->getStrParam(OsiSolverName,solverName); si->setHintParam(OsiDoReducePrint,true,OsiHintDo) ; std::cout << "Testing duals and reduced costs ... " ; /* Read p0033 and solve to optimality (minimisation). */ std::string fn = sampleDir+"p0033"; si->readMps(fn.c_str(),"mps"); si->setObjSense(1.0) ; si->initialSolve(); OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return, solverName, "testReducedCosts: solving p0033"); if (OsiUnitTest::verbosity >= 1) { std::cout << " " << solverName << " solved p0033 z = " << si->getObjValue() << "." << std::endl ; } /* Get the unchanging components: size, matrix, objective. */ int n = si->getNumCols() ; double *cbarCalc = new double[n] ; double dualTol ; si->getDblParam(OsiDualTolerance,dualTol) ; CoinRelFltEq eq ; std::string statNames[] = { "NBFR", "B", "NBUB", "NBLB" } ; /* Resolve, first as maximisation, then minimisation, and do the tests. */ double minmax[] = { -1.0, 1.0 } ; for (int ndx = 0 ; ndx < 2 ; ndx++) { si->setObjSense(minmax[ndx]) ; si->resolve() ; OSIUNITTEST_ASSERT_ERROR(si->isProvenOptimal(), return, solverName, "testReducedCosts: solving p0033 after changing objective sense"); if (OsiUnitTest::verbosity >= 1) { std::cout << " " << solverName << ((si->getObjSense() < 0)?" maximised":" minimised") << " p0033 z = " << si->getObjValue() << "." << std::endl ; } /* Retrieve status, duals, and reduced costs. Calculate c - yA. */ const CoinPackedMatrix *mtx = si->getMatrixByCol() ; const double *c = si->getObjCoefficients() ; const CoinWarmStartBasis *wsb = dynamic_cast(si->getWarmStart()) ; double dir = si->getObjSense() ; const double *y = si->getRowPrice() ; const double *cbar = si->getReducedCost() ; mtx->transposeTimes(y,cbarCalc) ; std::transform(c,c+n,cbarCalc,cbarCalc,std::minus()) ; /* Walk the architecturals and check that cbar = c - ya and has the correct sign given the status and objective sense (max/min). */ bool cbarCalcj_ok = true; bool testcbarj_ok = true; for (int j = 0 ; j < n ; j++) { CoinWarmStartBasis::Status statj = wsb->getStructStatus(j) ; double cbarj = cbar[j] ; double cbarCalcj = cbarCalc[j] ; if (OsiUnitTest::verbosity >= 1) { std::cout << " x<" << j << "> " << statNames[statj] << ", cbar<" << j << "> = " << cbarj << "." << std::endl ; } if (!eq(cbarj,cbarCalcj)) { cbarCalcj_ok = false; if (OsiUnitTest::verbosity >= 1) { std::cout << " " << cbarj << " = cbar<" << j << "> != c<" << j << "> - ya<" << j << "> = " << cbarCalcj << ", diff = " << cbarj-cbarCalcj << "." << std::endl ; } } double testcbarj = dir*cbarj ; switch (statj) { case CoinWarmStartBasis::atUpperBound: { if (testcbarj > dualTol) { testcbarj_ok = false; if (OsiUnitTest::verbosity >= 1) { std::cout << " cbar<" << j << "> = " << cbarj << " has the wrong sign for a NBUB variable." << std::endl ; } } break ; } case CoinWarmStartBasis::atLowerBound: { if (testcbarj < -dualTol) { testcbarj_ok = false; if (OsiUnitTest::verbosity >= 1) { std::cout << " cbar<" << j << "> = " << cbarj << " has the wrong sign for a NBLB variable." << std::endl ; } } break ; } case CoinWarmStartBasis::isFree: { if (CoinAbs(testcbarj) > dualTol) { testcbarj_ok = false; if (OsiUnitTest::verbosity >= 1) { std::cout << " cbar<" << j << "> = " << cbarj << " should be zero for a NBFR variable." << std::endl ; } } break ; } case CoinWarmStartBasis::basic: { if (CoinAbs(testcbarj) > dualTol) { testcbarj_ok = false; if (OsiUnitTest::verbosity >= 1) { std::cout << " cbar<" << j << "> = " << cbarj << " should be zero for a basic variable." << std::endl ; } } break ; } default: { break ; } } } OSIUNITTEST_ASSERT_ERROR(cbarCalcj_ok == true, {}, solverName, "testReducedCosts: reduced costs"); OSIUNITTEST_ASSERT_ERROR(testcbarj_ok == true, {}, solverName, "testReducedCosts: basis status of structural variable"); delete wsb ; } delete[] cbarCalc ; } /* Test the writeMps and writeMpsNative functions by loading a problem, writing it out to a file, reloading it, and solving. Implicitly assumes readMps has already been tested. fn should be the path to exmip1. */ void testWriteMps (const OsiSolverInterface *emptySi, std::string fn) { testingMessage("Testing writeMps and writeMpsNative.\n") ; CoinRelFltEq eq(1.0e-8) ; OsiSolverInterface *si1 = emptySi->clone(); OsiSolverInterface *si2 = emptySi->clone(); OsiSolverInterface *si3 = emptySi->clone(); /* Sanity test. Read in exmip1 and do an initialSolve. */ OSIUNITTEST_ASSERT_ERROR(si1->readMps(fn.c_str(),"mps") == 0, return, *si1, "testWriteMps: read MPS"); bool solved = true; OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si1->initialSolve(), solved = false, *si1, "testWriteMps: solving LP", TestOutcome::ERROR, e.className() == "OsiVolSolverInterface" || e.className() == "OsiTestSolverInterface"); double soln = si1->getObjValue(); /* Write a test output file with writeMpsNative, then read and solve. See if we get the right answer. FIXME: Really, this test should verify values --- Vol could participate in that (lh, 070726). */ si1->writeMpsNative("test.out",NULL,NULL); OSIUNITTEST_ASSERT_ERROR(si2->readMps("test.out","") == 0, return, *si1, "testWriteMps: read LP written by writeMpsNative"); if (solved) { OSIUNITTEST_CATCH_ERROR(si2->initialSolve(), return, *si1, "testWriteMps: solving LP written by writeMpsNative"); OSIUNITTEST_ASSERT_ERROR(eq(soln,si2->getObjValue()), return, *si1, "testWriteMps: solving LP written by writeMpsNative"); } /* Repeat with writeMps. */ si1->writeMps("test2","out"); OSIUNITTEST_ASSERT_ERROR(si3->readMps("test2.out","") == 0, return, *si1, "testWriteMps: read LP written by writeMps"); if (solved) { OSIUNITTEST_CATCH_ERROR(si3->initialSolve(), return, *si1, "testWriteMps: solving LP written by writeMps"); OSIUNITTEST_ASSERT_ERROR(eq(soln,si3->getObjValue()), return, *si1, "testWriteMps: solving LP written by writeMps"); } /* Clean up. */ delete si1; delete si2; delete si3; } /* Test writeLp and writeLpNative. Same sequence as for testWriteMps, above. Implicitly assumes readLp has been tested, but in fact that's not the case at present (lh, 070726). */ void testWriteLp (const OsiSolverInterface *emptySi, std::string fn) { testingMessage("Testing writeLp and writeLpNative.\n") ; CoinRelFltEq eq(1.0e-8) ; OsiSolverInterface * si1 = emptySi->clone(); OsiSolverInterface * si2 = emptySi->clone(); OsiSolverInterface * si3 = emptySi->clone(); OSIUNITTEST_ASSERT_ERROR(si1->readMps(fn.c_str(),"mps") == 0, return, *si1, "testWriteLp: read MPS"); bool solved = true; OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si1->initialSolve(), solved = false, *si1, "testWriteLp: solving LP", TestOutcome::ERROR, e.className() == "OsiVolSolverInterface" || e.className() == "OsiTestSolverInterface"); double soln = si1->getObjValue(); si1->writeLpNative("test.lp",NULL,NULL,1.0e-9,10,8); OSIUNITTEST_ASSERT_ERROR(si2->readLp("test.lp") == 0, return, *si1, "testWriteLp: read LP written by writeLpNative"); if (solved) { OSIUNITTEST_CATCH_ERROR(si2->initialSolve(), return, *si1, "testWriteLp: solving LP written by writeLpNative"); OSIUNITTEST_ASSERT_ERROR(eq(soln,si2->getObjValue()), return, *si1, "testWriteLp: solving LP written by writeLpNative"); } si1->writeLp("test2"); OSIUNITTEST_ASSERT_ERROR(si3->readLp("test2.lp") == 0, return, *si1, "testWriteLp: read LP written by writeLp"); if (solved) { OSIUNITTEST_CATCH_ERROR(si3->initialSolve(), return, *si1, "testWriteLp: solving LP written by writeLp"); OSIUNITTEST_ASSERT_ERROR(eq(soln,si3->getObjValue()), return, *si1, "testWriteLp: solving LP written by writeLp"); } delete si1; delete si2; delete si3; } /* Test load and assign problem. The first batch of tests loads up eight solvers, using each variant of loadProblem and assignProblem, runs initialSolve for all, then checks all values for all variants. */ void testLoadAndAssignProblem (const OsiSolverInterface *emptySi, const OsiSolverInterface *exmip1Si) { CoinRelFltEq eq(1.0e-8) ; std::string solverName; if( !emptySi->getStrParam(OsiSolverName, solverName) ) solverName == "unknown"; /* Test each variant of loadProblem and assignProblem. Clone a whack of solvers and use one for each variant. Then run initialSolve() on each solver. Then check that all values are as they should be. Note that we are not testing the variants that supply the matrix as a set of vectors (row/col starts, col/row indices, coefficients). To be really thorough, we should do another eight ... */ { testingMessage("Testing loadProblem and assignProblem methods.\n") ; OsiSolverInterface * base = exmip1Si->clone(); OsiSolverInterface * si1 = emptySi->clone(); OsiSolverInterface * si2 = emptySi->clone(); OsiSolverInterface * si3 = emptySi->clone(); OsiSolverInterface * si4 = emptySi->clone(); OsiSolverInterface * si5 = emptySi->clone(); OsiSolverInterface * si6 = emptySi->clone(); OsiSolverInterface * si7 = emptySi->clone(); OsiSolverInterface * si8 = emptySi->clone(); si1->loadProblem(*base->getMatrixByCol(), base->getColLower(),base->getColUpper(), base->getObjCoefficients(), base->getRowSense(),base->getRightHandSide(), base->getRowRange()); si2->loadProblem(*base->getMatrixByRow(), base->getColLower(),base->getColUpper(), base->getObjCoefficients(), base->getRowSense(),base->getRightHandSide(), base->getRowRange()); si3->loadProblem(*base->getMatrixByCol(), base->getColLower(),base->getColUpper(), base->getObjCoefficients(), base->getRowLower(),base->getRowUpper() ); si4->loadProblem(*base->getMatrixByCol(), base->getColLower(),base->getColUpper(), base->getObjCoefficients(), base->getRowLower(),base->getRowUpper() ); { double objOffset; base->getDblParam(OsiObjOffset,objOffset); si1->setDblParam(OsiObjOffset,objOffset); si2->setDblParam(OsiObjOffset,objOffset); si3->setDblParam(OsiObjOffset,objOffset); si4->setDblParam(OsiObjOffset,objOffset); si5->setDblParam(OsiObjOffset,objOffset); si6->setDblParam(OsiObjOffset,objOffset); si7->setDblParam(OsiObjOffset,objOffset); si8->setDblParam(OsiObjOffset,objOffset); } /* Assign methods should set their parameters to NULL, so check for that. */ CoinPackedMatrix * pm = new CoinPackedMatrix(*base->getMatrixByCol()); double * clb = new double[base->getNumCols()]; std::copy(base->getColLower(), base->getColLower()+base->getNumCols(),clb); double * cub = new double[base->getNumCols()]; std::copy(base->getColUpper(), base->getColUpper()+base->getNumCols(),cub); double * objc = new double[base->getNumCols()]; std::copy(base->getObjCoefficients(), base->getObjCoefficients()+base->getNumCols(),objc); double * rlb = new double[base->getNumRows()]; std::copy(base->getRowLower(), base->getRowLower()+base->getNumRows(),rlb); double * rub = new double[base->getNumRows()]; std::copy(base->getRowUpper(), base->getRowUpper()+base->getNumRows(),rub); si5->assignProblem(pm,clb,cub,objc,rlb,rub); OSIUNITTEST_ASSERT_ERROR(pm == NULL, return, solverName, "testLoadAndAssignProblem: si5 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(clb == NULL, return, solverName, "testLoadAndAssignProblem: si5 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(cub == NULL, return, solverName, "testLoadAndAssignProblem: si5 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(objc == NULL, return, solverName, "testLoadAndAssignProblem: si5 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rlb == NULL, return, solverName, "testLoadAndAssignProblem: si5 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rub == NULL, return, solverName, "testLoadAndAssignProblem: si5 assignProblem should set parameters to NULL"); pm = new CoinPackedMatrix(*base->getMatrixByRow()); clb = new double[base->getNumCols()]; std::copy(base->getColLower(), base->getColLower()+base->getNumCols(),clb); cub = new double[base->getNumCols()]; std::copy(base->getColUpper(), base->getColUpper()+base->getNumCols(),cub); objc = new double[base->getNumCols()]; std::copy(base->getObjCoefficients(), base->getObjCoefficients()+base->getNumCols(),objc); rlb = new double[base->getNumRows()]; std::copy(base->getRowLower(), base->getRowLower()+base->getNumRows(),rlb); rub = new double[base->getNumRows()]; std::copy(base->getRowUpper(), base->getRowUpper()+base->getNumRows(),rub); si6->assignProblem(pm,clb,cub,objc,rlb,rub); OSIUNITTEST_ASSERT_ERROR(pm == NULL, return, solverName, "testLoadAndAssignProblem: si6 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(clb == NULL, return, solverName, "testLoadAndAssignProblem: si6 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(cub == NULL, return, solverName, "testLoadAndAssignProblem: si6 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(objc == NULL, return, solverName, "testLoadAndAssignProblem: si6 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rlb == NULL, return, solverName, "testLoadAndAssignProblem: si6 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rub == NULL, return, solverName, "testLoadAndAssignProblem: si6 assignProblem should set parameters to NULL"); pm = new CoinPackedMatrix(*base->getMatrixByCol()); clb = new double[base->getNumCols()]; std::copy(base->getColLower(), base->getColLower()+base->getNumCols(),clb); cub = new double[base->getNumCols()]; std::copy(base->getColUpper(), base->getColUpper()+base->getNumCols(),cub); objc = new double[base->getNumCols()]; std::copy(base->getObjCoefficients(), base->getObjCoefficients()+base->getNumCols(),objc); char * rsen = new char[base->getNumRows()]; std::copy(base->getRowSense(), base->getRowSense()+base->getNumRows(),rsen); double * rhs = new double[base->getNumRows()]; std::copy(base->getRightHandSide(), base->getRightHandSide()+base->getNumRows(),rhs); double * rng = new double[base->getNumRows()]; std::copy(base->getRowRange(), base->getRowRange()+base->getNumRows(),rng); si7->assignProblem(pm,clb,cub,objc,rsen,rhs,rng); OSIUNITTEST_ASSERT_ERROR(pm == NULL, return, solverName, "testLoadAndAssignProblem: si7 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(clb == NULL, return, solverName, "testLoadAndAssignProblem: si7 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(cub == NULL, return, solverName, "testLoadAndAssignProblem: si7 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(objc == NULL, return, solverName, "testLoadAndAssignProblem: si7 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rsen == NULL, return, solverName, "testLoadAndAssignProblem: si7 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rhs == NULL, return, solverName, "testLoadAndAssignProblem: si7 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rng == NULL, return, solverName, "testLoadAndAssignProblem: si7 assignProblem should set parameters to NULL"); pm = new CoinPackedMatrix(*base->getMatrixByCol()); clb = new double[base->getNumCols()]; std::copy(base->getColLower(), base->getColLower()+base->getNumCols(),clb); cub = new double[base->getNumCols()]; std::copy(base->getColUpper(), base->getColUpper()+base->getNumCols(),cub); objc = new double[base->getNumCols()]; std::copy(base->getObjCoefficients(), base->getObjCoefficients()+base->getNumCols(),objc); rsen = new char[base->getNumRows()]; std::copy(base->getRowSense(), base->getRowSense()+base->getNumRows(),rsen); rhs = new double[base->getNumRows()]; std::copy(base->getRightHandSide(), base->getRightHandSide()+base->getNumRows(),rhs); rng = new double[base->getNumRows()]; std::copy(base->getRowRange(), base->getRowRange()+base->getNumRows(),rng); si8->assignProblem(pm,clb,cub,objc,rsen,rhs,rng); OSIUNITTEST_ASSERT_ERROR(pm == NULL, return, solverName, "testLoadAndAssignProblem: si8 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(clb == NULL, return, solverName, "testLoadAndAssignProblem: si8 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(cub == NULL, return, solverName, "testLoadAndAssignProblem: si8 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(objc == NULL, return, solverName, "testLoadAndAssignProblem: si8 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rsen == NULL, return, solverName, "testLoadAndAssignProblem: si8 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rhs == NULL, return, solverName, "testLoadAndAssignProblem: si8 assignProblem should set parameters to NULL"); OSIUNITTEST_ASSERT_ERROR(rng == NULL, return, solverName, "testLoadAndAssignProblem: si8 assignProblem should set parameters to NULL"); // Create an indices vector CoinPackedVector basePv,pv; OSIUNITTEST_ASSERT_ERROR(base->getNumCols()<10, return, solverName, "testLoadAndAssignProblem"); OSIUNITTEST_ASSERT_ERROR(base->getNumRows()<10, return, solverName, "testLoadAndAssignProblem"); int indices[10]; int i; for (i=0; i<10; i++) indices[i]=i; // Test solve methods. // Vol solver interface is expected to throw // an error if the data has a ranged row. // Prepare test that there is non-zero range basePv.setFull(base->getNumRows(),base->getRowRange()); pv.setConstant( base->getNumRows(), indices, 0.0 ); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(base->initialSolve(), return, *base, "testLoadAndAssignProblem: base initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si1->initialSolve(), return, *base, "testLoadAndAssignProblem: si1 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si2->initialSolve(), return, *base, "testLoadAndAssignProblem: si2 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si3->initialSolve(), return, *base, "testLoadAndAssignProblem: si3 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si4->initialSolve(), return, *base, "testLoadAndAssignProblem: si4 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si5->initialSolve(), return, *base, "testLoadAndAssignProblem: si5 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si6->initialSolve(), return, *base, "testLoadAndAssignProblem: si6 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si7->initialSolve(), return, *base, "testLoadAndAssignProblem: si7 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); OSIUNITTEST_CATCH_SEVERITY_EXPECTED(si8->initialSolve(), return, *base, "testLoadAndAssignProblem: si8 initialSolve", TestOutcome::ERROR, solverName == "vol" && !basePv.isEquivalent(pv)); // Test collower basePv.setVector(base->getNumCols(),indices,base->getColLower()); pv.setVector( si1->getNumCols(),indices, si1->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si1 column lower bounds"); pv.setVector( si2->getNumCols(),indices, si2->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si2 column lower bounds"); pv.setVector( si3->getNumCols(),indices, si3->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si3 column lower bounds"); pv.setVector( si4->getNumCols(),indices, si4->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si4 column lower bounds"); pv.setVector( si5->getNumCols(),indices, si5->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si5 column lower bounds"); pv.setVector( si6->getNumCols(),indices, si6->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si6 column lower bounds"); pv.setVector( si7->getNumCols(),indices, si7->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si7 column lower bounds"); pv.setVector( si8->getNumCols(),indices, si8->getColLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si8 column lower bounds"); // Test colupper basePv.setVector(base->getNumCols(),indices,base->getColUpper()); pv.setVector( si1->getNumCols(),indices, si1->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si1 column upper bounds"); pv.setVector( si2->getNumCols(),indices, si2->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si2 column upper bounds"); pv.setVector( si3->getNumCols(),indices, si3->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si3 column upper bounds"); pv.setVector( si4->getNumCols(),indices, si4->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si4 column upper bounds"); pv.setVector( si5->getNumCols(),indices, si5->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si5 column upper bounds"); pv.setVector( si6->getNumCols(),indices, si6->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si6 column upper bounds"); pv.setVector( si7->getNumCols(),indices, si7->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si7 column upper bounds"); pv.setVector( si8->getNumCols(),indices, si8->getColUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si8 column upper bounds"); // Test getObjCoefficients basePv.setVector(base->getNumCols(),indices,base->getObjCoefficients()); pv.setVector( si1->getNumCols(),indices, si1->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si1 objective coefficients"); pv.setVector( si2->getNumCols(),indices, si2->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si2 objective coefficients"); pv.setVector( si3->getNumCols(),indices, si3->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si3 objective coefficients"); pv.setVector( si4->getNumCols(),indices, si4->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si4 objective coefficients"); pv.setVector( si5->getNumCols(),indices, si5->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si5 objective coefficients"); pv.setVector( si6->getNumCols(),indices, si6->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si6 objective coefficients"); pv.setVector( si7->getNumCols(),indices, si7->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si7 objective coefficients"); pv.setVector( si8->getNumCols(),indices, si8->getObjCoefficients()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si8 objective coefficients"); // Test rowrhs basePv.setFull(base->getNumRows(),base->getRightHandSide()); pv.setFull( si1->getNumRows(), si1->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si1 right hand side"); pv.setFull( si2->getNumRows(), si2->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si2 right hand side"); pv.setFull( si3->getNumRows(), si3->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si3 right hand side"); pv.setFull( si4->getNumRows(), si4->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si4 right hand side"); pv.setFull( si5->getNumRows(), si5->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si5 right hand side"); pv.setFull( si6->getNumRows(), si6->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si6 right hand side"); pv.setFull( si7->getNumRows(), si7->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si7 right hand side"); pv.setFull( si8->getNumRows(), si8->getRightHandSide()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si8 right hand side"); // Test rowrange basePv.setFull(base->getNumRows(),base->getRowRange()); pv.setFull( si1->getNumRows(), si1->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si1 row range"); pv.setFull( si2->getNumRows(), si2->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si2 row range"); pv.setFull( si3->getNumRows(), si3->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si3 row range"); pv.setFull( si4->getNumRows(), si4->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si4 row range"); pv.setFull( si5->getNumRows(), si5->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si5 row range"); pv.setFull( si6->getNumRows(), si6->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si6 row range"); pv.setFull( si7->getNumRows(), si7->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si7 row range"); pv.setFull( si8->getNumRows(), si8->getRowRange()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si8 row range"); // Test row sense { const char * cb = base->getRowSense(); const char * c1 = si1->getRowSense(); const char * c2 = si2->getRowSense(); const char * c3 = si3->getRowSense(); const char * c4 = si4->getRowSense(); const char * c5 = si5->getRowSense(); const char * c6 = si6->getRowSense(); const char * c7 = si7->getRowSense(); const char * c8 = si8->getRowSense(); int nr = base->getNumRows(); bool rowsense_ok1 = true; bool rowsense_ok2 = true; bool rowsense_ok3 = true; bool rowsense_ok4 = true; bool rowsense_ok5 = true; bool rowsense_ok6 = true; bool rowsense_ok7 = true; bool rowsense_ok8 = true; for ( i=0; igetNumRows(),indices,base->getRowLower()); pv.setVector( si1->getNumRows(),indices, si1->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si1 row lower bounds"); pv.setVector( si2->getNumRows(),indices, si2->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si2 row lower bounds"); pv.setVector( si3->getNumRows(),indices, si3->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si3 row lower bounds"); pv.setVector( si4->getNumRows(),indices, si4->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si4 row lower bounds"); pv.setVector( si5->getNumRows(),indices, si5->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si5 row lower bounds"); pv.setVector( si6->getNumRows(),indices, si6->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si6 row lower bounds"); pv.setVector( si7->getNumRows(),indices, si7->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si7 row lower bounds"); pv.setVector( si8->getNumRows(),indices, si8->getRowLower()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si8 row lower bounds"); // Test rowupper basePv.setVector(base->getNumRows(),indices,base->getRowUpper()); pv.setVector( si1->getNumRows(),indices, si1->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si1 row upper bounds"); pv.setVector( si2->getNumRows(),indices, si2->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si2 row upper bounds"); pv.setVector( si3->getNumRows(),indices, si3->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si3 row upper bounds"); pv.setVector( si4->getNumRows(),indices, si4->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si4 row upper bounds"); pv.setVector( si5->getNumRows(),indices, si5->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si5 row upper bounds"); pv.setVector( si6->getNumRows(),indices, si6->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si6 row upper bounds"); pv.setVector( si7->getNumRows(),indices, si7->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si7 row upper bounds"); pv.setVector( si8->getNumRows(),indices, si8->getRowUpper()); OSIUNITTEST_ASSERT_ERROR(basePv.isEquivalent(pv), return, solverName, "testLoadAndAssignProblem: si8 row upper bounds"); // Test Constraint Matrix OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si1->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si1 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si1->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si1 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si2->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si2 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si2->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si2 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si3->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si3 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si3->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si3 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si4->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si4 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si4->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si4 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si5->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si5 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si5->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si5 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si6->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si6 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si6->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si6 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si7->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si7 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si7->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si7 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByCol()->isEquivalent(*si8->getMatrixByCol()), return, solverName, "testLoadAndAssignProblem: si8 constraint matrix"); OSIUNITTEST_ASSERT_ERROR(base->getMatrixByRow()->isEquivalent(*si8->getMatrixByRow()), return, solverName, "testLoadAndAssignProblem: si8 constraint matrix"); // Test Objective Value OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si1->getObjValue()), return, solverName, "testLoadAndAssignProblem: si1 objective value"); OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si2->getObjValue()), return, solverName, "testLoadAndAssignProblem: si2 objective value"); OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si3->getObjValue()), return, solverName, "testLoadAndAssignProblem: si3 objective value"); OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si4->getObjValue()), return, solverName, "testLoadAndAssignProblem: si4 objective value"); OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si5->getObjValue()), return, solverName, "testLoadAndAssignProblem: si5 objective value"); OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si6->getObjValue()), return, solverName, "testLoadAndAssignProblem: si6 objective value"); OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si7->getObjValue()), return, solverName, "testLoadAndAssignProblem: si7 objective value"); OSIUNITTEST_ASSERT_ERROR(eq(base->getObjValue(),si8->getObjValue()), return, solverName, "testLoadAndAssignProblem: si8 objective value"); // Clean-up delete si8; delete si7; delete si6; delete si5; delete si4; delete si3; delete si2; delete si1; delete base; } /* The OSI interface spec says any of the parameters to loadProblem can default to null. Let's see if that works. Test the rowub, rowlb and sense, rhs, range variants. Arguably we should check all variants again, but let's hope that OSI implementors carry things over from one variant to another. For Gurobi, this does not work. Since Gurobi does not know about free rows (rowtype 'N'), OsiGrb translates free rows into 'L' (lower-equal) rows with a -infty right-hand side. This makes some of the tests below fail. Ok, gurobi has quirks. As do other solvers. But those quirks should be hidden from users of OsiGrb -- i.e., the translation should be done within OsiGrb, and should not be visible to the user (or this test). That's the point of OSI. It's an implementation failure and should not be swept under the rug here. -- lh, 100826 -- OsiGrb does quite some attempts to hide this translation from the user, need to check further what could be done. -- sv, 110306 -- ps: it's just coincidence that I actually see your messages here... */ if (solverName != "gurobi") { int i ; OsiSolverInterface * si1 = emptySi->clone(); OsiSolverInterface * si2 = emptySi->clone(); si1->loadProblem(*exmip1Si->getMatrixByCol(),NULL,NULL,NULL,NULL,NULL); si2->loadProblem(*exmip1Si->getMatrixByCol(),NULL,NULL,NULL,NULL,NULL,NULL); // Test column settings OSIUNITTEST_ASSERT_ERROR(si1->getNumCols() == exmip1Si->getNumCols(), return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); bool collower_ok = true; bool colupper_ok = true; bool colobjcoef_ok = true; for ( i=0; igetNumCols(); i++ ) { collower_ok &= eq(si1->getColLower()[i],0.0); colupper_ok &= eq(si1->getColUpper()[i],si1->getInfinity()); colobjcoef_ok &= eq(si1->getObjCoefficients()[i],0.0); } OSIUNITTEST_ASSERT_ERROR(collower_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(colupper_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(colobjcoef_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); // Test row settings OSIUNITTEST_ASSERT_ERROR(si1->getNumRows() == exmip1Si->getNumRows(), return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); const double * rh = si1->getRightHandSide(); const double * rr = si1->getRowRange(); const char * rs = si1->getRowSense(); const double * rl = si1->getRowLower(); const double * ru = si1->getRowUpper(); bool rowrhs_ok = true; bool rowrange_ok = true; bool rowsense_ok = true; bool rowlower_ok = true; bool rowupper_ok = true; for ( i=0; igetNumRows(); i++ ) { rowrhs_ok &= eq(rh[i],0.0); rowrange_ok &= eq(rr[i],0.0); rowsense_ok &= 'N'==rs[i]; rowlower_ok &= eq(rl[i],-si1->getInfinity()); rowupper_ok &= eq(ru[i], si1->getInfinity()); } OSIUNITTEST_ASSERT_ERROR(rowrhs_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowrange_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowsense_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowlower_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowupper_ok == true, return, solverName, "testLoadAndAssignProblem: si1 loadProblem with matrix only"); // And repeat for si2 OSIUNITTEST_ASSERT_ERROR(si2->getNumCols() == exmip1Si->getNumCols(), return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); collower_ok = true; colupper_ok = true; colobjcoef_ok = true; for ( i=0; igetNumCols(); i++ ) { collower_ok &= eq(si2->getColLower()[i],0.0); colupper_ok &= eq(si2->getColUpper()[i],si2->getInfinity()); colobjcoef_ok &= eq(si2->getObjCoefficients()[i],0.0); } OSIUNITTEST_ASSERT_ERROR(collower_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(colupper_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(colobjcoef_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); // OSIUNITTEST_ASSERT_ERROR(si2->getNumRows() == exmip1Si->getNumRows(), return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); rh = si2->getRightHandSide(); rr = si2->getRowRange(); rs = si2->getRowSense(); rl = si2->getRowLower(); ru = si2->getRowUpper(); rowrhs_ok = true; rowrange_ok = true; rowsense_ok = true; rowlower_ok = true; rowupper_ok = true; for ( i=0; igetNumRows(); i++ ) { rowrhs_ok &= eq(rh[i],0.0); rowrange_ok &= eq(rr[i],0.0); rowsense_ok &= 'G'==rs[i]; rowlower_ok &= eq(rl[i],0.0); rowupper_ok &= eq(ru[i],si2->getInfinity()); } OSIUNITTEST_ASSERT_ERROR(rowrhs_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowrange_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowsense_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowlower_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); OSIUNITTEST_ASSERT_ERROR(rowupper_ok == true, return, solverName, "testLoadAndAssignProblem: si2 loadProblem with matrix only"); delete si1; delete si2; } else { failureMessage(solverName, "OsiGrb exposes inability to handle 'N' constraints (expected).") ; OSIUNITTEST_ADD_OUTCOME(solverName, "testLoadAndAssignProblem", "ability to handle 'N' constraints", TestOutcome::ERROR, true); } /* Load problem with row rhs, sense and range, but leave column bounds and objective at defaults. A belt-and-suspenders kind of test. Arguably we should have the symmetric case, with column bounds valid and row values at default. */ { int i ; OsiSolverInterface * si = emptySi->clone(); si->loadProblem(*exmip1Si->getMatrixByRow(), NULL,NULL,NULL, exmip1Si->getRowSense(), exmip1Si->getRightHandSide(), exmip1Si->getRowRange()); // Test column settings OSIUNITTEST_ASSERT_ERROR(si->getNumCols()==exmip1Si->getNumCols(), return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); bool collower_ok = true; bool colupper_ok = true; bool colobjcoef_ok = true; for ( i=0; igetNumCols(); i++ ) { collower_ok &= eq(si->getColLower()[i],0.0); colupper_ok &= eq(si->getColUpper()[i],si->getInfinity()); colobjcoef_ok &= eq(si->getObjCoefficients()[i],0.0); } OSIUNITTEST_ASSERT_ERROR(collower_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); OSIUNITTEST_ASSERT_ERROR(colupper_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); OSIUNITTEST_ASSERT_ERROR(colobjcoef_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); // Test row settings OSIUNITTEST_ASSERT_ERROR(si->getNumRows()==exmip1Si->getNumRows(), return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); bool rowrhs_ok = true; bool rowrange_ok = true; bool rowsense_ok = true; bool rowlower_ok = true; bool rowupper_ok = true; for ( i=0; igetNumRows(); i++ ) { rowrhs_ok &= eq(si->getRightHandSide()[i], exmip1Si->getRightHandSide()[i]); rowrange_ok &= eq(si->getRowRange()[i], exmip1Si->getRowRange()[i]); rowsense_ok &= si->getRowSense()[i]==exmip1Si->getRowSense()[i]; char s = si->getRowSense()[i]; if ( s=='G' ) { rowlower_ok &= eq(si->getRowLower()[i], exmip1Si->getRightHandSide()[i]); rowupper_ok &= eq(si->getRowUpper()[i], si->getInfinity()); } else if ( s=='L' ) { rowlower_ok &= eq(si->getRowLower()[i], -si->getInfinity()); rowupper_ok &= eq(si->getRowUpper()[i], exmip1Si->getRightHandSide()[i]); } else if ( s=='E' ) { rowlower_ok &= eq(si->getRowLower()[i], si->getRowUpper()[i]); rowupper_ok &= eq(si->getRowUpper()[i], exmip1Si->getRightHandSide()[i]); } else if ( s=='N' ) { rowlower_ok &= eq(si->getRowLower()[i], -si->getInfinity()); rowupper_ok &= eq(si->getRowUpper()[i], si->getInfinity()); } else if ( s=='R' ) { rowlower_ok &= eq(si->getRowLower()[i], exmip1Si->getRightHandSide()[i] - exmip1Si->getRowRange()[i]); rowupper_ok &= eq(si->getRowUpper()[i], exmip1Si->getRightHandSide()[i]); } } OSIUNITTEST_ASSERT_ERROR(rowrhs_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); OSIUNITTEST_ASSERT_ERROR(rowrange_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); OSIUNITTEST_ASSERT_ERROR(rowsense_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); OSIUNITTEST_ASSERT_ERROR(rowlower_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); OSIUNITTEST_ASSERT_ERROR(rowupper_ok == true, return, solverName, "testLoadAndAssignProblem: loadProblem with matrix and row bounds only"); delete si; } return ; } /* Test adding rows and columns to an empty constraint system. */ void testAddToEmptySystem (const OsiSolverInterface *emptySi, bool volSolverInterface) { CoinRelFltEq eq(1.0e-7) ; std::string solverName = "Unknown solver" ; emptySi->getStrParam(OsiSolverName,solverName) ; /* Add rows to an empty system. Begin by creating empty columns, then add some rows. */ { OsiSolverInterface * si = emptySi->clone(); int i; //Matrix int column[]={0,1,2}; double row1E[]={4.0,7.0,5.0}; double row2E[]={7.0,4.0,5.0}; CoinPackedVector row1(3,column,row1E); CoinPackedVector row2(3,column,row2E); double objective[]={5.0,6.0,5.5}; { // Add empty columns for (i=0;i<3;i++) { const CoinPackedVector reqdBySunCC ; si->addCol(reqdBySunCC,0.0,10.0,objective[i]) ; } // Add rows si->addRow(row1,2.0,100.0); si->addRow(row2,2.0,100.0); // Vol can not solve problem of this form if ( !volSolverInterface ) { // solve si->initialSolve(); OSIUNITTEST_ASSERT_ERROR(eq(si->getObjValue(),2.0), {}, solverName, "testAddToEmptySystem: getObjValue after adding empty columns"); } } delete si; } // Test adding rows to NULL - alternative row vector format { OsiSolverInterface * si = emptySi->clone(); int i; //Matrix int column[]={0,1,2,0,1,2}; double row1E[]={4.0,7.0,5.0}; double row2E[]={7.0,4.0,5.0}; double row12E[]={4.0,7.0,5.0,7.0,4.0,5.0}; int starts[]={0,3,6}; double ub[]={100.0,100.0}; double objective[]={5.0,6.0,5.5}; { // Add empty columns for (i=0;i<3;i++) { const CoinPackedVector reqdBySunCC ; si->addCol(reqdBySunCC,0.0,10.0,objective[i]) ; } // Add rows si->addRows(2,starts,column,row12E,NULL,ub); // and again si->addRow(3,column,row1E,2.0,100.0); si->addRow(3,column,row2E,2.0,100.0); // Vol can not solve problem of this form if ( !volSolverInterface ) { // solve si->initialSolve(); OSIUNITTEST_ASSERT_ERROR(eq(si->getObjValue(),2.0), {}, solverName, "testAddToEmptySystem: getObjValue after adding empty columns and then rows"); } } delete si; } /* Add columns to an empty system. Start by creating empty rows, then add some columns. */ { OsiSolverInterface * si = emptySi->clone(); int i; //Matrix int row[]={0,1}; double col1E[]={4.0,7.0}; double col2E[]={7.0,4.0}; double col3E[]={5.0,5.0}; CoinPackedVector col1(2,row,col1E); CoinPackedVector col2(2,row,col2E); CoinPackedVector col3(2,row,col3E); double objective[]={5.0,6.0,5.5}; { // Add empty rows for (i=0;i<2;i++) { const CoinPackedVector reqdBySunCC ; si->addRow(reqdBySunCC,2.0,100.0) ; } // Add columns if ( volSolverInterface ) { // FIXME: this test could be done w/ the volume, but the rows must not be ranged. OSIUNITTEST_ADD_OUTCOME(solverName, "testAddToEmptySystem", "addCol adds columns to NULL", TestOutcome::WARNING, true); failureMessage(solverName,"addCol add columns to null"); } else { si->addCol(col1,0.0,10.0,objective[0]); si->addCol(col2,0.0,10.0,objective[1]); si->addCol(col3,0.0,10.0,objective[2]); // solve si->initialSolve(); CoinRelFltEq eq(1.0e-7) ; OSIUNITTEST_ASSERT_ERROR(eq(si->getObjValue(),2.0), {}, solverName, "testAddToEmptySystem: getObjValue after adding empty rows and then columns"); } } delete si; } // Test adding columns to NULL - alternative column vector format { OsiSolverInterface * si = emptySi->clone(); int i; //Matrix int row[]={0,1}; double col1E[]={4.0,7.0}; double col23E[]={7.0,4.0,5.0,5.0}; int row23E[]={0,1,0,1}; int start23E[]={0,2,4}; double ub23E[]={10.0,10.0}; double objective[]={5.0,6.0,5.5}; { // Add empty rows for (i=0;i<2;i++) { const CoinPackedVector reqdBySunCC ; si->addRow(reqdBySunCC,2.0,100.0) ; } // Add columns if ( volSolverInterface ) { // FIXME: this test could be done w/ the volume, but the rows must not be ranged. OSIUNITTEST_ADD_OUTCOME(solverName, "testAddToEmptySystem", "addCol adds columns to NULL", TestOutcome::WARNING, true); } else { si->addCols(2,start23E,row23E,col23E,NULL,ub23E,objective+1); si->addCol(2,row,col1E,0.0,10.0,objective[0]); // solve si->initialSolve(); OSIUNITTEST_ASSERT_ERROR(eq(si->getObjValue(),2.0), {}, solverName, "testAddToEmptySystem: getObjValue after adding empty rows and then columns (alternative format)"); } } delete si; } } /* OsiPresolve has the property that it will report the correct (untransformed) objective for the presolved problem. Test OsiPresolve by checking the objective that we get by optimising the presolved problem. Then postsolve to get back to the original problem statement and check that we have the same objective without further iterations. This is much more a check on OsiPresolve than on the OsiXXX under test. OsiPresolve simply calls the underlying OsiXXX when it needs to solve a model. All the work involved with presolve and postsolve transforms is handled in OsiPresolve. The problems are a selection of problems from Data/Sample. In particular, e226 is in the list by virtue of having a constant offset (7.113) defined for the objective, and p0201 is in the list because presolve (as of 071015) finds no reductions. The objective for finnis (1.7279106559e+05) is not the same as the objective used by Netlib (1.7279096547e+05), but solvers clp, dylp, glpk, and cplex agree that it's correct. This test could be made stronger, but more brittle, by checking for the expected size of the constraint system after presolve. It would also be good to add a maximisation problem and check for signs of reduced costs and duals. Returns the number of errors encountered. */ int testOsiPresolve (const OsiSolverInterface *emptySi, const std::string &sampleDir) { typedef std::pair probPair ; std::vector sampleProbs ; sampleProbs.push_back(probPair("brandy",1.5185098965e+03)) ; sampleProbs.push_back(probPair("e226",(-18.751929066+7.113))) ; //#ifdef COIN_HAS_GRB // // for the demo license of Gurobi, model "finnis" is too large, so we skip it in this case // if( dynamic_cast(emptySi) && dynamic_cast(emptySi)->isDemoLicense() ) // std::cout << "Skip model finnis in test of OsiPresolve with Gurobi, since we seem to have only a demo license of Gurobi." << std::endl; // else //#endif sampleProbs.push_back(probPair("finnis",1.7279106559e+05)) ; sampleProbs.push_back(probPair("p0201",6875)) ; CoinRelFltEq eq(1.0e-8) ; int errs = 0 ; int warnings = 0; std::string solverName = "Unknown solver" ; OSIUNITTEST_ASSERT_ERROR(emptySi->getStrParam(OsiSolverName,solverName) == true, ++errs, solverName, "testOsiPresolve: getStrParam(OsiSolverName)"); std::cout << "Testing OsiPresolve ... " << std::endl ; for (unsigned i = 0 ; i < sampleProbs.size() ; i++) { OsiSolverInterface * si = emptySi->clone(); if (!si->setIntParam(OsiNameDiscipline,1)) std::cout << " attempt to switch to lazy names failed." ; std::string mpsName = sampleProbs[i].first ; double correctObj = sampleProbs[i].second ; std::cout << " testing presolve on " << mpsName << "." << std::endl ; std::string fn = sampleDir+mpsName ; OSIUNITTEST_ASSERT_ERROR(si->readMps(fn.c_str(),"mps") == 0, delete si; ++errs; continue, solverName, "testOsiPresolve: read MPS"); /* Set up for presolve. Allow very slight (1.0e-8) bound relaxation to retain feasibility. Discard integrality information (false) and limit the number of presolve passes to 5. */ OsiSolverInterface *presolvedModel ; OsiPresolve pinfo ; presolvedModel = pinfo.presolvedModel(*si,1.0e-8,false,5) ; OSIUNITTEST_ASSERT_ERROR(presolvedModel != NULL, delete si; ++errs; continue, solverName, "testOsiPresolve"); /* Optimise the presolved model and check the objective. We need to turn off any native presolve, which may or may not affect the objective. */ presolvedModel->setHintParam(OsiDoPresolveInInitial,false,OsiHintDo) ; presolvedModel->initialSolve() ; OSIUNITTEST_ASSERT_ERROR(eq(correctObj,presolvedModel->getObjValue()), delete si; ++errs; continue, solverName, "testOsiPresolve"); /* Postsolve to return to the original formulation. The presolvedModel should no longer be needed once we've executed postsolve. Check that we get the correct objective without iterations. As before, turn off any native presolve. */ pinfo.postsolve(true) ; delete presolvedModel ; si->setHintParam(OsiDoPresolveInResolve,false,OsiHintDo) ; si->resolve() ; OSIUNITTEST_ASSERT_ERROR(eq(correctObj,si->getObjValue()), ++errs, solverName, "testOsiPresolve: postsolve objective value"); OSIUNITTEST_ASSERT_WARNING(si->getIterationCount() == 0, ++warnings, solverName, "testOsiPresolve: postsolve number of iterations"); delete si ; } if (errs == 0) { std::cout << "OsiPresolve test ok with " << warnings << " warnings." << std::endl ; } else { failureMessage(solverName,"errors during OsiPresolve test.") ; } return (errs) ; } /* Test the values returned by an empty solver interface. */ void testEmptySi (const OsiSolverInterface *emptySi) { std::string solverName; const OsiSolverInterface *si = emptySi->clone() ; std::cout << "Testing empty solver interface ... " << std::endl ; si->getStrParam(OsiSolverName,solverName) ; OSIUNITTEST_ASSERT_ERROR(si->getNumRows() == 0, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getNumCols() == 0, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getNumElements() == 0, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getColLower() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getColUpper() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getColSolution() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getObjCoefficients() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getRowRange() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getRightHandSide() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getRowSense() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getRowLower() == NULL, {}, solverName, "testEmptySi"); OSIUNITTEST_ASSERT_ERROR(si->getRowUpper() == NULL, {}, solverName, "testEmptySi"); delete si ; } /* This routine uses the problem galenet (included in Data/Sample) to check getDualRays. Galenet is a primal infeasible flow problem: s1: t14 <= 20 s2: t24 + t25 <= 20 s3: t35 <= 20 n4: t14 + t24 - t46 - t47 = 0 n5: t25 + t35 - t57 - t58 = 0 d6: t46 >= 10 d7: t47 + t57 >= 20 d8: t58 >= 30 t14,t58 <= 30 tt24, t57 <= 20 t25, t35, t46 <= 10 t47 <= 2 Galenet is the original form, with mixed explicit constraints and implicit bound constraints. Galenetbnds is the same problem, but with implicit bounds converted to explicit constraints and all constraints converted to inequalities so that the algebraic test still works. The routine doesn't actually test for specific dual rays; rather, it tests for rA >= 0 and rb < 0, on the assumption that the dual constraint system matches the canonical form min yb yA >= c. (More accurately, on the assumption that the sign convention of the ray is correct for the canonical form.) The strategy is to check first for the ability to return a ray with row and column components, then a ray with row components only. If both of these result in a throw, conclude that the solver does not implement getDualRays. */ void testDualRays (const OsiSolverInterface *emptySi, const std::string &sampleDir) { unsigned int rayNdx,raysReturned ; bool hasGetDualRays = false ; std::string solverName ; OsiSolverInterface *si = 0 ; std::vector rays ; const int raysRequested = 5 ; const std::string mpsNames[] = { "galenet", "galenetbnds" } ; const bool rayTypes[] = { true, false } ; std::cout << "Testing getDualRays ..." << std::endl ; /* Figure out what we can test. getDualRays only makes sense after solving a problem, so the strategy is to solve galenet and try for full rays. If that fails, solve galenetbnds and try for row-component rays. If that fails, conclude that the solver doesn't implement getDualRays. */ for (int iter = 0 ; iter <= 1 ; iter++) { const bool fullRay = rayTypes[iter] ; const std::string mpsName = mpsNames[iter] ; const std::string fn = sampleDir+mpsName ; si = emptySi->clone() ; si->getStrParam(OsiSolverName,solverName) ; std::cout << " checking if " << solverName << " implements getDualRays(maxRays" << ((fullRay == true)?",true":"") << ") ... " ; si->setIntParam(OsiNameDiscipline,1) ; OSIUNITTEST_ASSERT_ERROR(si->readMps(fn.c_str(),"mps") == 0, delete si; return, solverName, "testDualRays: read MPS"); /* Solve and report the result. We should be primal infeasible, and not optimal. Specify maximisation just for kicks. */ si->setObjSense(-1.0) ; si->setHintParam(OsiDoPresolveInInitial,false,OsiHintDo) ; si->setHintParam(OsiDoReducePrint,true,OsiHintDo) ; si->initialSolve() ; OSIUNITTEST_ASSERT_ERROR(!si->isProvenOptimal(), {}, solverName, "testDualRays: infeasible instance not proven optimal"); OSIUNITTEST_ASSERT_ERROR( si->isProvenPrimalInfeasible(), {}, solverName, "testDualRays: recognize infeasiblity of instance"); /* Try a call to getDualRays. If the call throws, abort this iteration and try again. */ try { rays = si->getDualRays(raysRequested,fullRay) ; hasGetDualRays = true ; std::cout << "yes." << std::endl ; } catch (CoinError& err) { std::cout << "no." << std::endl ; delete si ; si = 0 ; continue ; } /* We have rays. Check to see how many. There should be at least one, and no more than the number requested. If there are none, bail out now. */ raysReturned = static_cast(rays.size()) ; OSIUNITTEST_ASSERT_ERROR(raysReturned >= 1, break, solverName, "testDualRays: number of returned rays"); OSIUNITTEST_ASSERT_WARNING(static_cast(raysReturned) <= raysRequested, {}, solverName, "testDualRays: number of returned rays"); /* Do a bit of setup before checking each ray. If we're dealing with a full ray, we'll need variable bounds, solution value, and status. Acquire the bounds arrays, and acquire a warm start object so we can ask for column status. Failure to retrieve a warm start aborts the test. */ unsigned int m,n,i,j ; m = si->getNumRows() ; n = si->getNumCols() ; unsigned int rayLen = m ; CoinWarmStartBasis *wsb = 0 ; const double *vlbs= 0 ; const double *vubs = 0 ; const double *xvals = 0 ; const double *rhs = si->getRightHandSide() ; const char* sense = si->getRowSense(); if (fullRay == true) { rayLen += n ; wsb = dynamic_cast(si->getWarmStart()) ; OSIUNITTEST_ASSERT_ERROR(wsb != NULL, break, solverName, "testDualRays: get warmstart basis"); vlbs = si->getColLower() ; vubs = si->getColUpper() ; xvals = si->getColSolution() ; } double tol ; si->getDblParam(OsiDualTolerance,tol) ; double *rA = new double[rayLen] ; /* Open a loop to check each ray for validity. */ for (rayNdx = 0 ; rayNdx < raysReturned ; rayNdx++) { double *ray = rays[rayNdx] ; if (OsiUnitTest::verbosity >= 2) { std::cout << " Ray[" << rayNdx << "]: " << std::endl ; for (i = 0 ; i < m ; i++) { if (fabs(ray[i]) > tol) { std::cout << " " << si->getRowName(i) << " [" << i << "]: " << ray[i] << "\t rhs: " << rhs[i] << "\t sense: " << sense[i] << std::endl ; } } if (fullRay == true) { for (j = 0 ; j < n ; j++) { if (fabs(ray[m+j]) > tol) { std::cout << " " << si->getColName(j) << " [" << j << "]: " << ray[m+j] << std::endl ; } } } } /* Check that the ray is not identically zero. */ for (i = 0 ; i < rayLen ; i++) { if (fabs(ray[i]) > tol) break ; } OSIUNITTEST_ASSERT_ERROR(i < rayLen, continue, solverName, "testDualRays: ray should not be zero"); /* Check that dot(r,b) < 0. For the first m components this is a straightforward dot product. If we're dealing with column components, we need to synthesize the coefficient on-the-fly. There can be at most one nonzero associated with an out-of-bound basic primal, which corresponds to the nonbasic dual that's driving the ray. */ double rdotb = 0.0 ; int nzoobCnt = 0 ; for (i = 0 ; i < m ; i++) { rdotb += rhs[i]*ray[i] ; } if (fullRay == true) { CoinWarmStartBasis::Status statj ; for (j = 0 ; j < n ; j++) { statj = wsb->getStructStatus(j) ; switch (statj) { case CoinWarmStartBasis::atUpperBound: { rdotb += vubs[j]*ray[m+j] ; break ; } case CoinWarmStartBasis::atLowerBound: { rdotb += (-vlbs[j])*ray[m+j] ; break ; } case CoinWarmStartBasis::basic: { if (ray[m+j] != 0) { nzoobCnt++ ; OSIUNITTEST_ASSERT_ERROR(xvals[j] > vubs[j] || xvals[j] < vlbs[j], break, solverName, "testDualRays: xval outside bounds for nonzero ray entry"); if (xvals[j] > vubs[j]) { rdotb += vubs[j]*ray[m+j] ; } else if (xvals[j] < vlbs[j]) { rdotb += (-vlbs[j])*ray[m+j] ; } } break ; } default: { OSIUNITTEST_ASSERT_ERROR(fabs(ray[i]) <= tol, {}, solverName, "testDualRays: zero ray entry for basic variables"); break ; } } } OSIUNITTEST_ASSERT_ERROR(nzoobCnt <= 1, {}, solverName, "testDualRays: at most one nonzero ray entry for basic variables"); } if (OsiUnitTest::verbosity >= 2) std::cout << "dot(r,b) = " << rdotb << std::endl; OSIUNITTEST_ASSERT_ERROR(rdotb < 0, {}, solverName, "testDualRays: ray points into right direction"); /* On to rA >= 0. As with dot(r,b), it's trivially easy to do the calculation for explicit constraints, but we have to synthesize the coefficients corresponding to bounded variables on-the-fly. Upper bounds look like x <= u, lower bounds -x <= -l. No need to repeat the ray coefficient tests. */ CoinFillN(rA,m,0.0) ; si->getMatrixByCol()->transposeTimes(ray,rA) ; if (fullRay == true) { CoinWarmStartBasis::Status statj ; for (j = 0 ; j < n ; j++) { statj = wsb->getStructStatus(j) ; switch (statj) { case CoinWarmStartBasis::atUpperBound: { rA[j] += ray[m+j] ; break ; } case CoinWarmStartBasis::atLowerBound: { rA[j] += -ray[m+j] ; break ; } case CoinWarmStartBasis::basic: { if (ray[m+j] != 0) { if (xvals[j] > vubs[j]) rA[j] += ray[m+j] ; else if (xvals[j] < vlbs[j]) rA[j] += -ray[m+j] ; } break ; } default: { break ; } } } } bool badVal = false ; for (j = 0 ; j < n ; j++) { if (rA[j] < -tol) { std::cout << " " << solverName << ": ray[" << rayNdx << "] fails rA >= 0 for column " << j << " with value " << rA[j] << "." << std::endl; badVal = true ; } } OSIUNITTEST_ASSERT_ERROR(badVal == false, {}, solverName, "testDualRays: rA >= 0"); if (badVal == true && OsiUnitTest::verbosity >= 2) { std::cout << " Ray[" << rayNdx << "]: " << std::endl ; for (i = 0 ; i < m ; i++) { if (fabs(ray[i]) > tol) { std::cout << " [" << i << "]: " << ray[i] << std::endl ; } } } } /* Clean up. */ delete [] rA ; for (rayNdx = 0 ; rayNdx < raysReturned ; rayNdx++) { delete [] rays[rayNdx] ; } delete si ; } /* Report the result and we're done. */ OSIUNITTEST_ASSERT_SEVERITY_EXPECTED(hasGetDualRays, {}, solverName, "testDualRays: getDualRays is implemented", TestOutcome::NOTE, false); if (hasGetDualRays == false) { testingMessage(" *** WARNING *** getDualRays is unimplemented.\n") ; } } } // end file-local namespace //############################################################################# // The main event //############################################################################# /* The order of tests should be examined. As it stands, we test immediately for the ability to read an mps file and bail if we can't do it. But quite a few tests could be performed without reading an mps file. -- lh, 080107 -- Gradually, oh so gradually, the Osi unit test is converting to produce some information about failed tests, and this routine now returns a count. Whenever you revise a test, please take the time to produce a count of errors. */ void OsiSolverInterfaceCommonUnitTest(const OsiSolverInterface* emptySi, const std::string & mpsDir, const std::string & /* netlibDir */) { CoinRelFltEq eq ; /* Test if the si knows its name. The name will be used for displaying messages when testing. */ std::string solverName ; { OsiSolverInterface *si = emptySi->clone() ; solverName = "Unknown Solver" ; OSIUNITTEST_ASSERT_ERROR(si->getStrParam(OsiSolverName,solverName), {}, solverName, "getStrParam(OsiSolverName) supported"); OSIUNITTEST_ASSERT_ERROR(solverName != "Unknown Solver", {}, solverName, "solver knows its name"); delete si ; } { std::string temp = ": running common unit tests.\n" ; temp = solverName + temp ; testingMessage(temp.c_str()) ; } /* Set a variable so we can easily determine which solver interface we're testing. This is so that we can easily decide to omit a test when it's beyond the capability of a solver. */ bool volSolverInterface UNUSED = (solverName == "vol"); bool dylpSolverInterface UNUSED = (solverName == "dylp"); bool glpkSolverInterface UNUSED = (solverName == "glpk"); bool xprSolverInterface UNUSED = (solverName == "xpress"); bool symSolverInterface UNUSED = (solverName == "sym"); bool grbSolverInterface UNUSED = (solverName == "gurobi"); bool cpxSolverInterface UNUSED = (solverName == "cplex"); bool spxSolverInterface UNUSED = (solverName == "soplex"); /* Test values returned by an empty solver interface. */ testEmptySi(emptySi) ; /* See if we can read an MPS file. We're dead in the water if we can't do this. */ std::string fn = mpsDir+"exmip1" ; OsiSolverInterface *exmip1Si = emptySi->clone() ; OSIUNITTEST_ASSERT_ERROR(exmip1Si->readMps(fn.c_str(),"mps") == 0, return, *exmip1Si, "read MPS file"); /* Test that the solver correctly handles row and column names. */ testNames(emptySi,fn) ; /* Test constants in objective function, dual and primal objective limit functions, objective sense (max/min). Do not perform test if Vol solver, because it requires problems of a special form and can not solve netlib e226. */ if ( !volSolverInterface ) { testObjFunctions(emptySi,mpsDir) ; } else { OSIUNITTEST_ADD_OUTCOME(solverName, "testObjFunctions", "skipped test for OsiVol", OsiUnitTest::TestOutcome::NOTE, true); } // Test that problem was loaded correctly { int nc = exmip1Si->getNumCols(); int nr = exmip1Si->getNumRows(); OSIUNITTEST_ASSERT_ERROR(nc == 8, return, *exmip1Si, "problem read correctly: number of columns"); OSIUNITTEST_ASSERT_ERROR(nr == 5, return, *exmip1Si, "problem read correctly: number of rows"); const char * exmip1Sirs = exmip1Si->getRowSense(); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[0]=='G', {}, *exmip1Si, "problem read correctly: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[1]=='L', {}, *exmip1Si, "problem read correctly: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[2]=='E', {}, *exmip1Si, "problem read correctly: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[3]=='R', {}, *exmip1Si, "problem read correctly: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[4]=='R', {}, *exmip1Si, "problem read correctly: row sense"); const double * exmip1Sirhs = exmip1Si->getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[0],2.5), {}, *exmip1Si, "problem read correctly: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[1],2.1), {}, *exmip1Si, "problem read correctly: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[2],4.0), {}, *exmip1Si, "problem read correctly: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[3],5.0), {}, *exmip1Si, "problem read correctly: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[4],15.), {}, *exmip1Si, "problem read correctly: row rhs"); const double * exmip1Sirr = exmip1Si->getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[0],0.0), {}, *exmip1Si, "problem read correctly: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[1],0.0), {}, *exmip1Si, "problem read correctly: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[2],0.0), {}, *exmip1Si, "problem read correctly: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[3],5.0-1.8), {}, *exmip1Si, "problem read correctly: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[4],15.0-3.0), {}, *exmip1Si, "problem read correctly: row range"); const CoinPackedMatrix *goldByCol = BuildExmip1Mtx() ; CoinPackedMatrix goldmtx ; goldmtx.reverseOrderedCopyOf(*goldByCol) ; delete goldByCol ; CoinPackedMatrix pm; pm.setExtraGap(0.0); pm.setExtraMajor(0.0); pm = *exmip1Si->getMatrixByRow(); pm.removeGaps(); OSIUNITTEST_ASSERT_ERROR(goldmtx.isEquivalent(pm), {}, *exmip1Si, "problem read correctly: matrix by row"); const double * cl = exmip1Si->getColLower(); OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, *exmip1Si, "problem read correctly: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, *exmip1Si, "problem read correctly: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[2],0.0), {}, *exmip1Si, "problem read correctly: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[3],0.0), {}, *exmip1Si, "problem read correctly: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[4],0.5), {}, *exmip1Si, "problem read correctly: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[5],0.0), {}, *exmip1Si, "problem read correctly: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[6],0.0), {}, *exmip1Si, "problem read correctly: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[7],0.0), {}, *exmip1Si, "problem read correctly: columns lower bounds"); const double * cu = exmip1Si->getColUpper(); OSIUNITTEST_ASSERT_ERROR(eq(cu[0],exmip1Si->getInfinity()), {}, *exmip1Si, "problem read correctly: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[1],4.1), {}, *exmip1Si, "problem read correctly: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[2],1.0), {}, *exmip1Si, "problem read correctly: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[3],1.0), {}, *exmip1Si, "problem read correctly: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[4],4.0), {}, *exmip1Si, "problem read correctly: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[5],exmip1Si->getInfinity()), {}, *exmip1Si, "problem read correctly: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[6],exmip1Si->getInfinity()), {}, *exmip1Si, "problem read correctly: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[7],4.3), {}, *exmip1Si, "problem read correctly: columns upper bounds"); const double * rl = exmip1Si->getRowLower(); OSIUNITTEST_ASSERT_ERROR(eq(rl[0],2.5), {}, *exmip1Si, "problem read correctly: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[1],-exmip1Si->getInfinity()), {}, *exmip1Si, "problem read correctly: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[2],4.0), {}, *exmip1Si, "problem read correctly: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[3],1.8), {}, *exmip1Si, "problem read correctly: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[4],3.0), {}, *exmip1Si, "problem read correctly: rows lower bounds"); const double * ru = exmip1Si->getRowUpper(); OSIUNITTEST_ASSERT_ERROR(eq(ru[0],exmip1Si->getInfinity()), {}, *exmip1Si, "problem read correctly: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[1],2.1), {}, *exmip1Si, "problem read correctly: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[2],4.0), {}, *exmip1Si, "problem read correctly: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[3],5.0), {}, *exmip1Si, "problem read correctly: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[4],15.), {}, *exmip1Si, "problem read correctly: rows upper bounds"); const double * objCoef = exmip1Si->getObjCoefficients(); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[0], 1.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[1], 0.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[2], 0.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[3], 0.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[4], 2.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[5], 0.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[6], 0.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[7],-1.0), {}, *exmip1Si, "problem read correctly: objective coefficients"); // make sure col solution is something reasonable, // that is between upper and lower bounds const double * cs = exmip1Si->getColSolution(); int c; bool okColSol=true; //double inf = exmip1Si->getInfinity(); for ( c=0; c=inf ) okColSol=false; } OSIUNITTEST_ASSERT_WARNING(okColSol, {}, *exmip1Si, "column solution before solve"); // Test that objective value is correct // FIXME: the test checks the primal value. vol fails this, because vol // considers the dual value to be the objective value /* gurobi fails this, because gurobi does not have a solution before a model is solved (which makes sense, I (SV) think) Eh, well, you can argue the point, but the current OSI spec requires that there be a valid solution from the point that the problem is loaded. Nothing says it needs to be a good solution. -- lh, 100826 -- */ double correctObjValue = CoinPackedVector(nc,objCoef).dotProduct(cs); double siObjValue = exmip1Si->getObjValue(); OSIUNITTEST_ASSERT_SEVERITY_EXPECTED(eq(correctObjValue,siObjValue), {}, *exmip1Si, "solution value before solve", TestOutcome::WARNING, solverName == "Vol"); } // Test matrixByCol method { const CoinPackedMatrix *goldmtx = BuildExmip1Mtx() ; OsiSolverInterface & si = *exmip1Si->clone(); CoinPackedMatrix sm = *si.getMatrixByCol(); sm.removeGaps(); OSIUNITTEST_ASSERT_ERROR(goldmtx->isEquivalent(sm), {}, solverName, "getMatrixByCol"); delete goldmtx ; // Test getting and setting of objective offset double objOffset; OSIUNITTEST_ASSERT_ERROR(si.getDblParam(OsiObjOffset,objOffset), {}, solverName, "getDblParam(OsiObjOffset)"); OSIUNITTEST_ASSERT_ERROR(eq(objOffset, 0.0), {}, solverName, "objective offset 0 for exmip1"); OSIUNITTEST_ASSERT_ERROR(si.setDblParam(OsiObjOffset,3.21), {}, solverName, "setDblParam(OsiObjOffset)"); si.getDblParam(OsiObjOffset,objOffset); OSIUNITTEST_ASSERT_ERROR(eq(objOffset, 3.21), {}, solverName, "storing objective offset"); delete &si; } // Test clone { OsiSolverInterface * si2; int ad = 13579; { OsiSolverInterface * si1 = exmip1Si->clone(); int ad = 13579; si1->setApplicationData(&ad); OSIUNITTEST_ASSERT_ERROR(*(static_cast(si1->getApplicationData())) == ad, {}, solverName, "storing application data"); si2 = si1->clone(); delete si1; } OSIUNITTEST_ASSERT_ERROR(*(static_cast(si2->getApplicationData())) == ad, {}, solverName, "cloning of application data"); int nc = si2->getNumCols(); int nr = si2->getNumRows(); OSIUNITTEST_ASSERT_ERROR(nc == 8, return, *exmip1Si, "problem cloned: number of columns"); OSIUNITTEST_ASSERT_ERROR(nr == 5, return, *exmip1Si, "problem cloned: number of rows"); const char * exmip1Sirs = si2->getRowSense(); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[0]=='G', {}, solverName, "problem cloned: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[1]=='L', {}, solverName, "problem cloned: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[2]=='E', {}, solverName, "problem cloned: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[3]=='R', {}, solverName, "problem cloned: row sense"); OSIUNITTEST_ASSERT_ERROR(exmip1Sirs[4]=='R', {}, solverName, "problem cloned: row sense"); const double * exmip1Sirhs = si2->getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[0],2.5), {}, solverName, "problem cloned: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[1],2.1), {}, solverName, "problem cloned: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[2],4.0), {}, solverName, "problem cloned: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[3],5.0), {}, solverName, "problem cloned: row rhs"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirhs[4],15.), {}, solverName, "problem cloned: row rhs"); const double * exmip1Sirr = si2->getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[0],0.0), {}, solverName, "problem cloned: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[1],0.0), {}, solverName, "problem cloned: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[2],0.0), {}, solverName, "problem cloned: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[3],5.0-1.8), {}, solverName, "problem cloned: row range"); OSIUNITTEST_ASSERT_ERROR(eq(exmip1Sirr[4],15.0-3.0), {}, solverName, "problem cloned: row range"); const CoinPackedMatrix *goldByCol = BuildExmip1Mtx() ; CoinPackedMatrix goldmtx ; goldmtx.reverseOrderedCopyOf(*goldByCol) ; CoinPackedMatrix pm; pm.setExtraGap(0.0); pm.setExtraMajor(0.0); pm = *si2->getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(goldmtx.isEquivalent(pm), {}, solverName, "problem cloned: matrix by row"); delete goldByCol ; const double * cl = si2->getColLower(); OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, solverName, "problem cloned: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, solverName, "problem cloned: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[2],0.0), {}, solverName, "problem cloned: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[3],0.0), {}, solverName, "problem cloned: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[4],0.5), {}, solverName, "problem cloned: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[5],0.0), {}, solverName, "problem cloned: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[6],0.0), {}, solverName, "problem cloned: columns lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cl[7],0.0), {}, solverName, "problem cloned: columns lower bounds"); const double * cu = si2->getColUpper(); OSIUNITTEST_ASSERT_ERROR(eq(cu[0],exmip1Si->getInfinity()), {}, solverName, "problem cloned: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[1],4.1), {}, solverName, "problem cloned: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[2],1.0), {}, solverName, "problem cloned: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[3],1.0), {}, solverName, "problem cloned: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[4],4.0), {}, solverName, "problem cloned: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[5],exmip1Si->getInfinity()), {}, solverName, "problem cloned: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[6],exmip1Si->getInfinity()), {}, solverName, "problem cloned: columns upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(cu[7],4.3), {}, solverName, "problem cloned: columns upper bounds"); const double * rl = si2->getRowLower(); OSIUNITTEST_ASSERT_ERROR(eq(rl[0],2.5), {}, solverName, "problem cloned: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[1],-exmip1Si->getInfinity()), {}, solverName, "problem cloned: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[2],4.0), {}, solverName, "problem cloned: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[3],1.8), {}, solverName, "problem cloned: rows lower bounds"); OSIUNITTEST_ASSERT_ERROR(eq(rl[4],3.0), {}, solverName, "problem cloned: rows lower bounds"); const double * ru = si2->getRowUpper(); OSIUNITTEST_ASSERT_ERROR(eq(ru[0],exmip1Si->getInfinity()), {}, solverName, "problem cloned: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[1],2.1), {}, solverName, "problem cloned: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[2],4.0), {}, solverName, "problem cloned: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[3],5.0), {}, solverName, "problem cloned: rows upper bounds"); OSIUNITTEST_ASSERT_ERROR(eq(ru[4],15.), {}, solverName, "problem cloned: rows upper bounds"); const double * objCoef = exmip1Si->getObjCoefficients(); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[0], 1.0), {}, solverName, "problem cloned: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[1], 0.0), {}, solverName, "problem cloned: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[2], 0.0), {}, solverName, "problem cloned: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[3], 0.0), {}, solverName, "problem cloned: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[4], 2.0), {}, solverName, "problem cloned: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[5], 0.0), {}, solverName, "problem cloned: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[6], 0.0), {}, solverName, "problem cloned: objective coefficients"); OSIUNITTEST_ASSERT_ERROR(eq(objCoef[7],-1.0), {}, solverName, "problem cloned: objective coefficients"); // make sure col solution is something reasonable, // that is between upper and lower bounds const double * cs = exmip1Si->getColSolution(); int c; bool okColSol=true; //double inf = exmip1Si->getInfinity(); for ( c=0; c=inf ) okColSol=false; } OSIUNITTEST_ASSERT_WARNING(okColSol, {}, solverName, "problem cloned: column solution before solve"); // Test getting of objective offset double objOffset; OSIUNITTEST_ASSERT_ERROR(si2->getDblParam(OsiObjOffset,objOffset), {}, solverName, "problem cloned: getDblParam(OsiObjOffset)"); OSIUNITTEST_ASSERT_ERROR(eq(objOffset, 0.0), {}, solverName, "problem cloned: objective offset 0.0"); delete si2; } // end of clone testing // Test apply cuts method { OsiSolverInterface & im = *(exmip1Si->clone()); OsiCuts cuts; // Generate some cuts { // Get number of rows and columns in model int nr = im.getNumRows(); int nc = im.getNumCols(); OSIUNITTEST_ASSERT_ERROR(nr == 5, return, solverName, "apply cuts: number of rows"); OSIUNITTEST_ASSERT_ERROR(nc == 8, return, solverName, "apply cuts: number of columns"); // Generate a valid row cut from thin air int c; { int *inx = new int[nc]; for (c=0;c(c))*(static_cast(c)); OsiRowCut rc; rc.setRow(nc,inx,el); rc.setLb(-100.); rc.setUb(100.); rc.setEffectiveness(22); cuts.insert(rc); delete[]el; delete[]inx; } // Generate valid col cut from thin air { const double * oslColLB = im.getColLower(); const double * oslColUB = im.getColUpper(); int *inx = new int[nc]; for (c=0;csetEffectiveness(-1.); cuts.insert(rcP); OSIUNITTEST_ASSERT_ERROR(rcP == NULL, {}, solverName, "apply cuts: insert row cut keeps pointer"); OsiColCut * ccP= new OsiColCut; ccP->setEffectiveness(-12.); cuts.insert(ccP); OSIUNITTEST_ASSERT_ERROR(ccP == NULL, {}, solverName, "apply cuts: insert column cut keeps pointer"); } { //Generate inconsistent Row cut OsiRowCut rc; const int ne=1; int inx[ne]={-10}; double el[ne]={2.5}; rc.setRow(ne,inx,el); rc.setLb(3.); rc.setUb(4.); OSIUNITTEST_ASSERT_ERROR(!rc.consistent(), {}, solverName, "apply cuts: inconsistent row cut"); cuts.insert(rc); } { //Generate inconsistent col cut OsiColCut cc; const int ne=1; int inx[ne]={-10}; double el[ne]={2.5}; cc.setUbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR(!cc.consistent(), {}, solverName, "apply cuts: inconsistent column cut"); cuts.insert(cc); } { // Generate row cut which is inconsistent for model m OsiRowCut rc; const int ne=1; int inx[ne]={10}; double el[ne]={2.5}; rc.setRow(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( rc.consistent(), {}, solverName, "apply cuts: row cut inconsistent for model only"); OSIUNITTEST_ASSERT_ERROR(!rc.consistent(im), {}, solverName, "apply cuts: row cut inconsistent for model only"); cuts.insert(rc); } { // Generate col cut which is inconsistent for model m OsiColCut cc; const int ne=1; int inx[ne]={30}; double el[ne]={2.0}; cc.setLbs(ne,inx,el); OSIUNITTEST_ASSERT_ERROR( cc.consistent(), {}, solverName, "apply cuts: column cut inconsistent for model only"); OSIUNITTEST_ASSERT_ERROR(!cc.consistent(im), {}, solverName, "apply cuts: column cut inconsistent for model only"); cuts.insert(cc); } { // Generate col cut which is infeasible OsiColCut cc; const int ne=1; int inx[ne]={0}; double el[ne]={2.0}; cc.setUbs(ne,inx,el); cc.setEffectiveness(1000.); OSIUNITTEST_ASSERT_ERROR(cc.consistent(), {}, solverName, "apply cuts: column cut infeasible for model"); OSIUNITTEST_ASSERT_ERROR(cc.consistent(im), {}, solverName, "apply cuts: column cut infeasible for model"); OSIUNITTEST_ASSERT_ERROR(cc.infeasible(im), {}, solverName, "apply cuts: column cut infeasible for model"); cuts.insert(cc); } } OSIUNITTEST_ASSERT_ERROR(cuts.sizeRowCuts() == 4, {}, solverName, "apply cuts: number of stored row cuts"); OSIUNITTEST_ASSERT_ERROR(cuts.sizeColCuts() == 5, {}, solverName, "apply cuts: number of stored column cuts"); { OsiSolverInterface::ApplyCutsReturnCode rc = im.applyCuts(cuts); OSIUNITTEST_ASSERT_ERROR(rc.getNumIneffective() == 2, {}, solverName, "apply cuts: number of row cuts found ineffective"); OSIUNITTEST_ASSERT_ERROR(rc.getNumApplied() == 2, {}, solverName, "apply cuts: number of row cuts applied"); OSIUNITTEST_ASSERT_ERROR(rc.getNumInfeasible() == 1, {}, solverName, "apply cuts: number of row cuts found infeasible"); OSIUNITTEST_ASSERT_ERROR(rc.getNumInconsistentWrtIntegerModel() == 2, {}, solverName, "apply cuts: number of row cuts found inconsistent wr.t. integer model"); OSIUNITTEST_ASSERT_ERROR(rc.getNumInconsistent() == 2, {}, solverName, "apply cuts: number of row cuts found inconsistent"); OSIUNITTEST_ASSERT_ERROR(cuts.sizeCuts() == rc.getNumIneffective() + rc.getNumApplied() + rc.getNumInfeasible() + rc.getNumInconsistentWrtIntegerModel() + rc.getNumInconsistent(), {}, solverName, "apply cuts: consistent count of row cuts"); } delete &im; } // end of apply cut method testing /* Test setting primal (column) and row (dual) solutions, and test that reduced cost and row activity match. GUROBI does not support setting solutions (only basis can be set), so we skip this test. This is a failure of the implementation of OsiGrb. Most solvers do not allow you to simply set a solution by giving primal values, it needs to be handled in the OsiXXX. That's what OsiGrb should do. See longer rant where OsiGrb exposes Gurobi's inability to handle 'N' constraints. Here, run the tests and see the error messages. Shouldn't cause failure because we're not yet properly counting errors. -- lh, 100826 -- */ testSettingSolutions(*exmip1Si) ; // Test column type methods // skip for vol since it does not support this function if ( volSolverInterface ) { OSIUNITTEST_ADD_OUTCOME(solverName, "testing column type methods", "skipped test for OsiVol", TestOutcome::NOTE, true); } else { OsiSolverInterface & fim = *(emptySi->clone()); std::string fn = mpsDir+"exmip1"; fim.readMps(fn.c_str(),"mps"); // exmip1.mps has 2 integer variables with index 2 & 3 OSIUNITTEST_ASSERT_ERROR( fim.getNumIntegers() == 2, {}, solverName, "column type methods: number of integers"); OSIUNITTEST_ASSERT_ERROR( fim.isContinuous(0), {}, solverName, "column type methods: isContinuous"); OSIUNITTEST_ASSERT_ERROR( fim.isContinuous(1), {}, solverName, "column type methods: isContinuous"); OSIUNITTEST_ASSERT_ERROR(!fim.isContinuous(2), {}, solverName, "column type methods: isContinuous"); OSIUNITTEST_ASSERT_ERROR(!fim.isContinuous(3), {}, solverName, "column type methods: isContinuous"); OSIUNITTEST_ASSERT_ERROR( fim.isContinuous(4), {}, solverName, "column type methods: isContinuous"); OSIUNITTEST_ASSERT_ERROR(!fim.isInteger(0), {}, solverName, "column type methods: isInteger"); OSIUNITTEST_ASSERT_ERROR(!fim.isInteger(1), {}, solverName, "column type methods: isInteger"); OSIUNITTEST_ASSERT_ERROR( fim.isInteger(2), {}, solverName, "column type methods: isInteger"); OSIUNITTEST_ASSERT_ERROR( fim.isInteger(3), {}, solverName, "column type methods: isInteger"); OSIUNITTEST_ASSERT_ERROR(!fim.isInteger(4), {}, solverName, "column type methods: isInteger"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(0), {}, solverName, "column type methods: isBinary"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(1), {}, solverName, "column type methods: isBinary"); OSIUNITTEST_ASSERT_ERROR( fim.isBinary(2), {}, solverName, "column type methods: isBinary"); OSIUNITTEST_ASSERT_ERROR( fim.isBinary(3), {}, solverName, "column type methods: isBinary"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(4), {}, solverName, "column type methods: isBinary"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(0), {}, solverName, "column type methods: isIntegerNonBinary"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(1), {}, solverName, "column type methods: isIntegerNonBinary"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(2), {}, solverName, "column type methods: isIntegerNonBinary"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(3), {}, solverName, "column type methods: isIntegerNonBinary"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(4), {}, solverName, "column type methods: isIntegerNonBinary"); // Test fractionalIndices do { double sol[]={1.0, 2.0, 2.9, 3.0, 4.0,0.0,0.0,0.0}; fim.setColSolution(sol); OsiVectorInt fi = fim.getFractionalIndices(1e-5); OSIUNITTEST_ASSERT_ERROR(fi.size() == 1, break, solverName, "column type methods: getFractionalIndices"); OSIUNITTEST_ASSERT_ERROR(fi[0] == 2, {}, solverName, "column type methods: getFractionalIndices"); // Set integer variables very close to integer values sol[2]=5 + .00001/2.; sol[3]=8 - .00001/2.; fim.setColSolution(sol); fi = fim.getFractionalIndices(1e-5); OSIUNITTEST_ASSERT_ERROR(fi.size() == 0, {}, solverName, "column type methods: getFractionalIndices"); // Set integer variables close, but beyond tolerances sol[2]=5 + .00001*2.; sol[3]=8 - .00001*2.; fim.setColSolution(sol); fi = fim.getFractionalIndices(1e-5); OSIUNITTEST_ASSERT_ERROR(fi.size() == 2, break, solverName, "column type methods: getFractionalIndices"); OSIUNITTEST_ASSERT_ERROR(fi[0] == 2, {}, solverName, "column type methods: getFractionalIndices"); OSIUNITTEST_ASSERT_ERROR(fi[1] == 3, {}, solverName, "column type methods: getFractionalIndices"); } while(false); // Change data so column 2 & 3 are integerNonBinary fim.setColUpper(2,5.0); fim.setColUpper(3,6.0); OSIUNITTEST_ASSERT_ERROR(eq(fim.getColUpper()[2],5.0), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(eq(fim.getColUpper()[3],6.0), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(0), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(1), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(2), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(3), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isBinary(4), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(fim.getNumIntegers() == 2, {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(0), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(1), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR( fim.isIntegerNonBinary(2), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR( fim.isIntegerNonBinary(3), {}, solverName, "column type methods: convert binary to integer variable"); OSIUNITTEST_ASSERT_ERROR(!fim.isIntegerNonBinary(4), {}, solverName, "column type methods: convert binary to integer variable"); delete &fim; } /* Test load and assign methods, and do an initialSolve while we have the problem loaded. This routine also puts some stress on cloning --- it creates nine simultaneous clones of the OSI under test. */ testLoadAndAssignProblem(emptySi,exmip1Si) ; testAddToEmptySystem(emptySi,volSolverInterface) ; /* Test write methods. */ testWriteMps(emptySi,fn) ; testWriteLp(emptySi,fn) ; /* Test the simplex portion of the OSI interface. */ testSimplexAPI(emptySi,mpsDir) ; // Add a Laci suggested test case // Load in a problem as column ordered matrix, // extract the row ordered copy, // add a row, // extract the row ordered copy again and test whether it's ok. // (the same can be done with reversing the role // of row and column ordered.) { OsiSolverInterface * si = emptySi->clone(); si->loadProblem( *(exmip1Si->getMatrixByCol()), exmip1Si->getColLower(), exmip1Si->getColUpper(), exmip1Si->getObjCoefficients(), exmip1Si->getRowSense(), exmip1Si->getRightHandSide(), exmip1Si->getRowRange() ); CoinPackedMatrix pm1 = *(si->getMatrixByRow()); // Get a row of the matrix to make a cut const CoinShallowPackedVector neededBySunCC = exmip1Si->getMatrixByRow()->getVector(1) ; CoinPackedVector pv = neededBySunCC ; pv.setElement(0,3.14*pv.getElements()[0]); OsiRowCut rc; rc.setRow( pv ); rc.setLb( exmip1Si->getRowLower()[1]-0.5 ); rc.setUb( exmip1Si->getRowUpper()[1]-0.5 ); OsiCuts cuts; cuts.insert(rc); si->applyCuts(cuts); CoinPackedMatrix pm2 = *(si->getMatrixByRow()); OSIUNITTEST_ASSERT_ERROR(pm1.getNumRows()==pm2.getNumRows()-1, {}, solverName, "switching from column to row ordering: added row"); int i; for( i=0; iclone(); si->loadProblem( *(exmip1Si->getMatrixByRow()), exmip1Si->getColLower(), exmip1Si->getColUpper(), exmip1Si->getObjCoefficients(), exmip1Si->getRowLower(), exmip1Si->getRowUpper() ); CoinPackedMatrix pm1 = *(si->getMatrixByCol()); // Get a row of the matrix to make a cut const CoinShallowPackedVector neededBySunCC = exmip1Si->getMatrixByRow()->getVector(1) ; CoinPackedVector pv = neededBySunCC ; pv.setElement(0,3.14*pv.getElements()[0]); OsiRowCut rc; rc.setRow( pv ); rc.setLb( exmip1Si->getRowLower()[1]-0.5 ); rc.setUb( exmip1Si->getRowUpper()[1]-0.5 ); OsiCuts cuts; cuts.insert(rc); si->applyCuts(cuts); CoinPackedMatrix pm2 = *(si->getMatrixByCol()); OSIUNITTEST_ASSERT_ERROR(pm1.isColOrdered(), {}, solverName, "switching from row to column ordering"); OSIUNITTEST_ASSERT_ERROR(pm2.isColOrdered(), {}, solverName, "switching from row to column ordering"); OSIUNITTEST_ASSERT_ERROR(pm1.getNumRows()==pm2.getNumRows()-1, {}, solverName, "switching from row to column ordering: added row"); CoinPackedMatrix pm1ByRow; pm1ByRow.reverseOrderedCopyOf(pm1); CoinPackedMatrix pm2ByRow; pm2ByRow.reverseOrderedCopyOf(pm2); OSIUNITTEST_ASSERT_ERROR(!pm1ByRow.isColOrdered(), {}, solverName, "switching from row to column ordering"); OSIUNITTEST_ASSERT_ERROR(!pm2ByRow.isColOrdered(), {}, solverName, "switching from row to column ordering"); OSIUNITTEST_ASSERT_ERROR(pm1ByRow.getNumRows() == pm2ByRow.getNumRows()-1, {}, solverName, "switching from row to column ordering"); OSIUNITTEST_ASSERT_ERROR(pm1.getNumRows() == pm1ByRow.getNumRows(), {}, solverName, "switching from row to column ordering"); OSIUNITTEST_ASSERT_ERROR(pm2.getNumRows() == pm2ByRow.getNumRows(), {}, solverName, "switching from row to column ordering"); int i; for( i=0; iclone(); int i; int ival; double dval; bool hint; OsiHintStrength hintStrength; OSIUNITTEST_ASSERT_ERROR(si->getIntParam (OsiLastIntParam, ival) == false, {}, solverName, "parameter methods: retrieve last int param"); OSIUNITTEST_ASSERT_ERROR(si->getDblParam (OsiLastDblParam, dval) == false, {}, solverName, "parameter methods: retrieve last double param"); OSIUNITTEST_ASSERT_ERROR(si->getHintParam(OsiLastHintParam, hint) == false, {}, solverName, "parameter methods: retrieve last hint param"); OSIUNITTEST_ASSERT_ERROR(si->setIntParam (OsiLastIntParam, 0) == false, {}, solverName, "parameter methods: set last int param"); OSIUNITTEST_ASSERT_ERROR(si->setDblParam (OsiLastDblParam, 0.0) == false, {}, solverName, "parameter methods: set last double param"); OSIUNITTEST_ASSERT_ERROR(si->setHintParam(OsiLastHintParam, false) == false, {}, solverName, "parameter methods: set last hint param"); bool param_ok = true; for (i = 0; i < OsiLastIntParam; ++i) { const bool exists = si->getIntParam(static_cast(i), ival); // existence and test should result in the same param_ok &= (!exists ^ testIntParam(si, i, -1)); param_ok &= (!exists ^ testIntParam(si, i, 0)); param_ok &= (!exists ^ testIntParam(si, i, 1)); param_ok &= (!exists ^ testIntParam(si, i, 9999999)); param_ok &= (!exists ^ testIntParam(si, i, COIN_INT_MAX)); if (exists) param_ok &= (si->getIntParam(static_cast(i), ival)); } OSIUNITTEST_ASSERT_ERROR(param_ok == true, {}, solverName, "parameter methods: test intparam"); param_ok = true; for (i = 0; i < OsiLastDblParam; ++i) { const bool exists = si->getDblParam(static_cast(i), dval); // existence and test should result in the same param_ok &= (!exists ^ testDblParam(si, i, -1e50)); param_ok &= (!exists ^ testDblParam(si, i, -1e10)); param_ok &= (!exists ^ testDblParam(si, i, -1)); param_ok &= (!exists ^ testDblParam(si, i, -1e-4)); param_ok &= (!exists ^ testDblParam(si, i, -1e-15)); param_ok &= (!exists ^ testDblParam(si, i, 1e50)); param_ok &= (!exists ^ testDblParam(si, i, 1e10)); param_ok &= (!exists ^ testDblParam(si, i, 1)); param_ok &= (!exists ^ testDblParam(si, i, 1e-4)); param_ok &= (!exists ^ testDblParam(si, i, 1e-15)); if (exists) param_ok &= (si->setDblParam(static_cast(i), dval)); } OSIUNITTEST_ASSERT_ERROR(param_ok == true, {}, solverName, "parameter methods: test dblparam"); // test hints --- see testHintParam for detailed explanation. { int throws = 0 ; param_ok = true; for (i = 0 ; i < OsiLastHintParam ; ++i) { const bool exists = si->getHintParam(static_cast(i),hint,hintStrength) ; param_ok &= (!exists ^ testHintParam(si,i,true,OsiHintIgnore,&throws)) ; param_ok &= (!exists ^ testHintParam(si,i,true,OsiHintTry,&throws)) ; param_ok &= (!exists ^ testHintParam(si,i,false,OsiHintTry,&throws)) ; param_ok &= (!exists ^ testHintParam(si,i,true,OsiHintDo,&throws)) ; param_ok &= (!exists ^ testHintParam(si,i,false,OsiHintDo,&throws)) ; param_ok &= (!exists ^ testHintParam(si,i,true,OsiForceDo,&throws)) ; param_ok &= (!exists ^ testHintParam(si,i,false,OsiForceDo,&throws)) ; } std::cout.flush() ; std::cerr << "Checked " << static_cast(OsiLastHintParam) << " hints x (true, false) at strength OsiForceDo; " << throws << " throws." << std::endl ; OSIUNITTEST_ASSERT_ERROR(param_ok == true, {}, solverName, "parameter methods: test hintparam"); } delete si; } /* A test to see if resolve gets the correct answer after changing the objective. Safe for Vol, as the result is checked by testing an interval on the primal solution. */ changeObjAndResolve(emptySi) ; /* Test OsiPresolve. This is a `bolt on' presolve, distinct from any presolve that might be innate to the solver. */ if ( !volSolverInterface && !symSolverInterface ) { testOsiPresolve(emptySi,mpsDir) ; } else { OSIUNITTEST_ADD_OUTCOME(solverName, "testOsiPresolved", "skipped test", OsiUnitTest::TestOutcome::NOTE, true); } /* Do a check to see if the solver returns the correct status for artificial variables. See the routine for detailed comments. Vol has no basis, hence no status. */ if (!volSolverInterface && !symSolverInterface) testArtifStatus(emptySi) ; else OSIUNITTEST_ADD_OUTCOME(solverName, "testArtifStatus", "skipped test", OsiUnitTest::TestOutcome::NOTE, true); // Perform tests that are embodied in functions if ( !volSolverInterface && !symSolverInterface) { typedef bool (*TestFunction)(OsiSolverInterface*); std::vector > test_functions; test_functions.push_back(std::pair(&test1VivianDeSmedt, "test1VivianDeSmedt")); test_functions.push_back(std::pair(&test2VivianDeSmedt, "test2VivianDeSmedt")); test_functions.push_back(std::pair(&test3VivianDeSmedt, "test3VivianDeSmedt")); test_functions.push_back(std::pair(&test4VivianDeSmedt, "test4VivianDeSmedt")); test_functions.push_back(std::pair(&test5VivianDeSmedt, "test5VivianDeSmedt")); test_functions.push_back(std::pair(&test6VivianDeSmedt, "test6VivianDeSmedt")); test_functions.push_back(std::pair(&test7VivianDeSmedt, "test7VivianDeSmedt")); test_functions.push_back(std::pair(&test8VivianDeSmedt, "test8VivianDeSmedt")); test_functions.push_back(std::pair(&test9VivianDeSmedt, "test9VivianDeSmedt")); test_functions.push_back(std::pair(&test10VivianDeSmedt,"test10VivianDeSmedt")); test_functions.push_back(std::pair(&test11VivianDeSmedt,"test11VivianDeSmedt")); test_functions.push_back(std::pair(&test12VivianDeSmedt,"test12VivianDeSmedt")); test_functions.push_back(std::pair(&test13VivianDeSmedt,"test13VivianDeSmedt")); test_functions.push_back(std::pair(&test14VivianDeSmedt,"test14VivianDeSmedt")); test_functions.push_back(std::pair(&test15VivianDeSmedt,"test15VivianDeSmedt")); test_functions.push_back(std::pair(&test16SebastianNowozin,"test16SebastianNowozin")); test_functions.push_back(std::pair(&test17SebastianNowozin,"test17SebastianNowozin")); unsigned int i; for (i = 0; i < test_functions.size(); ++i) { OsiSolverInterface *s = emptySi->clone(); const char * testName = test_functions[i].second; { bool test = test_functions[i].first(s); OSIUNITTEST_ASSERT_ERROR(test == true, {}, solverName, testName); } delete s; } } else OSIUNITTEST_ADD_OUTCOME(solverName, "test*VivianDeSmedt and test*SebastianNowozin", "skipped test", OsiUnitTest::TestOutcome::NOTE, true); /* Test duals and reduced costs, then dual rays. Vol doesn't react well to either test. */ if (!volSolverInterface && !symSolverInterface) { testReducedCosts(emptySi,mpsDir) ; testDualRays(emptySi,mpsDir) ; } else { OSIUNITTEST_ADD_OUTCOME(solverName, "testReducedCosts", "skipped test", OsiUnitTest::TestOutcome::NOTE, true); OSIUNITTEST_ADD_OUTCOME(solverName, "testDualRays", "skipped test", OsiUnitTest::TestOutcome::NOTE, true); } } /* Orphan comment? If anyone happens to poke at the code that this belongs to, move it. My (lh) guess is it should go somewhere in the deSmedt tests. I just haven't made time to check them all. And I really do want to find this. It'd be a great test case for the dual ray routine. With this matrix we have a primal/dual infeas problem. Leaving the first row makes it primal feas, leaving the first col makes it dual feas. All vars are >= 0 obj: -1 2 -3 4 -5 (min) 0 -1 0 0 -2 >= 1 1 0 -3 0 4 >= -2 0 3 0 -5 0 >= 3 0 0 5 0 -6 >= -4 2 -4 0 6 0 >= 5 */ Osi-0.106.4/src/OsiCommonTest/OsiUnitTestUtils.cpp0000644000076600007660000004656712101340333020413 0ustar coincoin/* Copyright (C) 2000 -- 2010, Lou Hafer, International Business Machines, and others. All Rights Reserved. This code is licensed under the terms of the Eclipse Public License (EPL). */ #include "CoinPragma.hpp" #include "OsiUnitTests.hpp" #include "OsiConfig.h" /* #include "CoinTime.hpp" #include #include #include #include #include #include #include */ #include "OsiSolverInterface.hpp" #include "CoinFloatEqual.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedMatrix.hpp" /* #include "CoinPackedVector.hpp" #include "CoinWarmStartBasis.hpp" #include "OsiRowCut.hpp" #include "OsiCuts.hpp" #include "OsiPresolve.hpp" */ namespace OsiUnitTest { unsigned int verbosity = 0; unsigned int haltonerror = 0; TestOutcomes outcomes; //############################################################################# // Helper routines for messages. //############################################################################# /* If anyone is feeling ambitious, it'd be a really good idea to handle i/o for the unittest by way of a standard CoinMessageHandler. Might require a bit of tweaking in CoinMessageHandler. */ // A helper function to write out a message about a test failure void failureMessage( const std::string & solverName, const std::string & message ) { std::string messageText; messageText = "*** "; messageText += solverName + "SolverInterface testing issue: "; messageText += message; // flush stdout so that error messages are properly interleaved. std::cout.flush() ; std::cerr << messageText.c_str() << std::endl; } void failureMessage( const OsiSolverInterface & si, const std::string & message ) { std::string solverName; si.getStrParam(OsiSolverName, solverName); failureMessage(solverName, message); } void failureMessage( const std::string & solverName, const std::string &testname, const std::string &testcond) { std::string messageText; messageText = "*** "; messageText += solverName + "SolverInterface testing issue: "; messageText += testname + " failed: " + testcond; // flush stdout so that error messages are properly interleaved. std::cout.flush() ; std::cerr << messageText.c_str() << std::endl; } void failureMessage( const OsiSolverInterface & si, const std::string &testname, const std::string &testcond) { std::string solverName; si.getStrParam(OsiSolverName, solverName); failureMessage(solverName, testname, testcond); } /* Display message on stderr. Flush cout buffer before printing the message, so that output comes out in order in spite of buffered cout. */ void testingMessage( const char * const msg ) { std::cout.flush() ; std::cerr << msg; } //############################################################################# // Vector comparison utility. //############################################################################# // A helper function to compare the equivalence of two vectors bool equivalentVectors (const OsiSolverInterface * si1, const OsiSolverInterface * si2, double tol, const double * v1, const double * v2, int size) { bool retVal = true; double infty1 = si1->getInfinity(); double infty2 = si2->getInfinity(); CoinRelFltEq eq(tol) ; int i; /* Both values must be the same infinity or equal within the specified tolerance. Otherwise we have failure. */ for (i = 0 ; i < size ; i++ ) { if (!(v1[i] <= -infty1 && v2[i] <= -infty2) && !(v1[i] >= infty1 && v2[i] >= infty2) && !eq(v1[i], v2[i]) ) { std::cout.flush() ; std::cerr << "eq " << i << " " << v1[i] << " " << v2[i] << std::endl; retVal = false; break; } } return retVal; } /* Check a packed vector for equality with a full vector. The algorithm is to first confirm that the elements of the packed vector are present in the full vector, then scan the full vector to make sure there are no additional nonzeros. */ bool isEquivalent (const CoinPackedVectorBase &pv, int n, const double *fv) { int pvCnt = pv.getNumElements() ; const int *indices = pv.getIndices() ; const double *elems = pv.getElements() ; bool retval = true ; CoinRelFltEq eq ; for (int v = 0 ; v < pvCnt ; v++) { int k = indices[v] ; if (!eq(elems[v], fv[k])) { retval = false ; break ; } } if (retval == true) { int fvCnt = 0 ; for (int k = 0 ; k < n ; k++) { if (!eq(fv[k], 0.0)) fvCnt++ ; } if (fvCnt != pvCnt) retval = false ; } return (retval) ; } /* Method to compare the problem representation held by a pair of solver interfaces. */ bool compareProblems (OsiSolverInterface *osi1, OsiSolverInterface *osi2) { bool areEquiv = true ; std::string si1Name, si2Name ; osi1->getStrParam(OsiSolverName, si1Name) ; osi2->getStrParam(OsiSolverName, si2Name) ; // Compare row and column counts int colCnt = 0 ; if (osi1->getNumCols() != osi2->getNumCols()) { std::cerr << " Unequal column count, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } else { colCnt = osi1->getNumCols() ; } int rowCnt = 0 ; if (osi1->getNumRows() != osi2->getNumRows()) { std::cerr << " Unequal row count, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } else { rowCnt = osi1->getNumRows() ; } // Compare column bounds areEquiv = equivalentVectors(osi1, osi2, 1.e-10, osi1->getColLower(), osi2->getColLower(), colCnt) ; if (areEquiv == false) { std::cerr << " Unequal column lower bounds, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } areEquiv = equivalentVectors(osi1, osi2, 1.e-10, osi1->getColUpper(), osi2->getColUpper(), colCnt) ; if (areEquiv == false) { std::cerr << " Unequal column upper bounds, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } // Compare row bounds areEquiv = equivalentVectors(osi1, osi2, 1.e-10, osi1->getRowLower(), osi2->getRowLower(), rowCnt) ; if (areEquiv == false) { std::cerr << " Unequal row lower bounds, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } areEquiv = equivalentVectors(osi1, osi2, 1.e-10, osi1->getRowUpper(), osi2->getRowUpper(), rowCnt) ; if (areEquiv == false) { std::cerr << " Unequal row lower bounds, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } // Compare row sense { const char *rowSense1 = osi1->getRowSense() ; const char *rowSense2 = osi2->getRowSense() ; areEquiv = true ; for (int r = 0 ; r < rowCnt && areEquiv == true ; r++) { if (rowSense1[r] != rowSense2[r]) { areEquiv = false ; } } if (areEquiv == false) { std::cerr << " Unequal row sense, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } } // Compare row rhs areEquiv = equivalentVectors(osi1, osi2, 1.e-10, osi1->getRightHandSide(), osi2->getRightHandSide(), rowCnt) ; if (areEquiv == false) { std::cerr << " Unequal right-hand-side, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } // Compare range areEquiv = equivalentVectors(osi1, osi2, 1.e-10, osi1->getRowRange(), osi2->getRowRange(), rowCnt) ; if (areEquiv == false) { std::cerr << " Unequal row range, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } // Compare objective sense if (osi1->getObjSense() != osi2->getObjSense()) { std::cerr << " Unequal objective sense, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } // Compare objective coefficients areEquiv = equivalentVectors(osi1, osi2, 1.e-10, osi1->getObjCoefficients(), osi2->getObjCoefficients(), colCnt) ; if (areEquiv == false) { std::cerr << " Unequal objective coefficients, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } // Compare number of elements if (osi1->getNumElements() != osi2->getNumElements()) { std::cerr << " Unequal number of constraint matrix coefficients, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } // Compare constraint matrix, for both row-major and column-major orderings { const CoinPackedMatrix *rmm1 = osi1->getMatrixByRow() ; const CoinPackedMatrix *rm = osi2->getMatrixByRow() ; if (!rmm1->isEquivalent(*rm)) { std::cerr << " Unequal constraint matrix, row-major ordering, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } const CoinPackedMatrix *cmm1 = osi1->getMatrixByCol() ; const CoinPackedMatrix *cm = osi2->getMatrixByCol() ; if (!cmm1->isEquivalent(*cm)) { std::cerr << " Unequal constraint matrix, column-major ordering, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } } // Check column types { areEquiv = true ; for (int j = 0 ; j < colCnt && areEquiv == true ; j++) { if (osi1->isContinuous(j) != osi2->isContinuous(j)) areEquiv = false ; if (osi1->isBinary(j) != osi2->isBinary(j)) areEquiv = false ; if (osi1->isIntegerNonBinary(j) != osi2->isIntegerNonBinary(j)) areEquiv = false ; if (osi1->isFreeBinary(j) != osi2->isFreeBinary(j)) areEquiv = false ; if (osi1->isInteger(j) != osi2->isInteger(j)) areEquiv = false ; } if (areEquiv == false) { std::cerr << " Unequal variable type, " << si1Name << " vs. " << si2Name << std::endl ; return (false) ; } } return (true) ; } bool processParameters (int argc, const char **argv, std::map& parms, const std::map& ignorekeywords) { /* Initialise the parameter keywords. */ std::set definedKeyWords; definedKeyWords.insert("-cerr2cout"); definedKeyWords.insert("-mpsDir"); definedKeyWords.insert("-netlibDir"); definedKeyWords.insert("-miplib3Dir"); definedKeyWords.insert("-testOsiSolverInterface"); definedKeyWords.insert("-nobuf"); definedKeyWords.insert("-cutsOnly"); definedKeyWords.insert("-verbosity"); definedKeyWords.insert("-onerror"); /* Set default values for data directories. */ const char dirsep = CoinFindDirSeparator() ; std::string pathTmp ; pathTmp = ".." ; pathTmp += dirsep ; pathTmp += ".." ; pathTmp += dirsep ; pathTmp += "Data" ; pathTmp += dirsep ; # ifdef COIN_MSVS // Visual Studio builds are deeper pathTmp = "..\\..\\" + pathTmp ; # endif parms["-mpsDir"] = pathTmp + "Sample" ; parms["-netlibDir"] = pathTmp + "Netlib" ; parms["-miplib3Dir"] = pathTmp + "miplib3" ; /* Read the command line parameters and fill a map of parameter keys and associated data. The parser allows for parameters which are only a keyword, or parameters of the form keyword=value (no spaces). */ for (int i = 1 ; i < argc ; i++) { std::string parm(argv[i]) ; std::string key, value ; std::string::size_type eqPos = parm.find('='); if (eqPos == std::string::npos) { key = parm ; } else { key = parm.substr(0, eqPos) ; value = parm.substr(eqPos + 1) ; } /* * Should the specified key be ignored? */ if (ignorekeywords.find(key) != ignorekeywords.end()) { assert(ignorekeywords.find(key)->second >= 0); i += ignorekeywords.find(key)->second; continue; } /* Is the specified key valid? */ if (definedKeyWords.find(key) == definedKeyWords.end()) { if( key != "-usage" && key != "-help" ) std::cerr << "Undefined parameter \"" << key << "\"." << std::endl ; std::cerr << "Usage: unitTest [-nobuf] [-mpsDir=V1] [-netlibDir=V2] [-miplibDir=V3] [-testOsiSolverInterface] [-cutsOnly] [-verbosity=num]" << std::endl ; std::cerr << " where:" << std::endl ; std::cerr << " -cerr2cout: redirect cerr to cout; sometimes useful to synchronise cout & cerr." << std::endl; std::cerr << " -mpsDir: directory containing mps test files." << std::endl << " Default value V1=\"../../Data/Sample\"" << std::endl; std::cerr << " -netlibDir: directory containing netlib files." << std::endl << " Default value V2=\"../../Data/Netlib\"" << std::endl; std::cerr << " -miplib3Dir: directory containing miplib3 files." << std::endl << " Default value V3=\"../../Data/miplib3\"" << std::endl; std::cerr << " -testOsiSolverInterface: run each OSI on the netlib problem set." << std::endl << " Default is to not run the netlib problem set." << std::endl; std::cerr << " -cutsOnly: If specified, only OsiCut tests are run." << std::endl; std::cerr << " -nobuf: use unbuffered output." << std::endl << " Default is buffered output." << std::endl; std::cerr << " -verbosity: verbosity level of tests output (0-2)." << std::endl << " Default is 0 (minimal output)." << std::endl; std::cerr << " -onerror: behaviour in case of failing test (continue, wait, stop)." << std::endl << " Default is continue." << std::endl; return false; } /* Valid keyword; stash the value for later reference. */ parms[key] = value; } /* Tack the directory separator onto the data directories so we don't have to worry about it later. */ if( parms["-mpsDir"].length() > 0 ) parms["-mpsDir"] += dirsep ; if( parms["-netlibDir"].length() > 0 ) parms["-netlibDir"] += dirsep ; if( parms["-miplib3"].length() > 0 ) parms["-miplib3Dir"] += dirsep ; /* Did the user request unbuffered i/o? It seems we need to go after this through stdio --- using pubsetbuf(0,0) on the C++ streams has no discernible affect. Nor, for that matter, did setting the unitbuf flag on the streams. Why? At a guess, sync_with_stdio connects the streams to the stdio buffers, and the C++ side isn't programmed to change them? */ if (parms.find("-nobuf") != parms.end()) { // std::streambuf *coutBuf, *cerrBuf ; // coutBuf = std::cout.rdbuf() ; // coutBuf->pubsetbuf(0,0) ; // cerrBuf = std::cerr.rdbuf() ; // cerrBuf->pubsetbuf(0,0) ; setbuf(stderr, 0); setbuf(stdout, 0); } /* Did the user request a redirect for cerr? This must occur before any i/o is performed. */ if (parms.find("-cerr2cout") != parms.end()) std::cerr.rdbuf(std::cout.rdbuf()); /* * Did the user set a verbosity level? */ if (parms.find("-verbosity") != parms.end()) { char* endptr; std::string verbstring = parms["-verbosity"]; unsigned long verblevel = strtoul(verbstring.c_str(), &endptr, 10); if( *endptr != '\0' || verblevel < 0) { std::cerr << "verbosity level must be a nonnegative number" << std::endl; return false; } OsiUnitTest::verbosity = static_cast(verblevel); } /* * Did the user specify what to do in case of a failure? */ if (parms.find("-onerror") != parms.end()) { std::string onerror = parms["-onerror"]; if( onerror == "continue" ) OsiUnitTest::haltonerror = 0; else if( onerror == "wait" ) OsiUnitTest::haltonerror = 1; else if( onerror == "stop" ) OsiUnitTest::haltonerror = 2; else { std::cerr << "-onerror must be specified with either 'continue', 'wait', or 'stop'" << std::endl; return false; } } return true; } std::string TestOutcome::SeverityLevelName[LAST] = { "NOTE", "PASSED", "WARNING", "ERROR" }; void TestOutcome::print() const { printf("%-10s", SeverityLevelName[severity].c_str()); printf("%-10s", component.c_str()); printf("%s", testname.c_str()); printf("\n"); if( expected ) printf(" (expected) "); else printf(" "); printf("%s\n", testcond.c_str()); printf(" "); printf("%s:%d\n", filename.c_str(), linenumber); // printf("\n"); } void TestOutcomes::add(const OsiSolverInterface& si, std::string tst, const char* cond, TestOutcome::SeverityLevel sev, const char* file, int line, bool exp) { std::string solverName; si.getStrParam(OsiSolverName, solverName); push_back(TestOutcome(solverName, tst, cond, sev, file, line, exp)); } void TestOutcomes::print() const { int count[TestOutcome::LAST]; int expected[TestOutcome::LAST]; for( int i = 0; i < TestOutcome::LAST; ++i ) { count[i] = 0; expected[i] = 0; } /* Walk the list, counting entries at each severity level. Print if verbosity level is high enough. */ for (const_iterator it(begin()); it != end(); ++it) { ++count[it->severity]; if (it->expected) ++expected[it->severity]; if ((it->severity != TestOutcome::PASSED || OsiUnitTest::verbosity >= 2) && (it->severity != TestOutcome::NOTE || OsiUnitTest::verbosity >= 1)) it->print(); } /// Print summary counts for (int i = 0; i < TestOutcome::LAST; ++i) printf("Severity %-10s: %4d thereof expected: %4d\n", TestOutcome::SeverityLevelName[i].c_str(), count[i], expected[i]); } void TestOutcomes::getCountBySeverity(TestOutcome::SeverityLevel sev, int& total, int& expected) const { assert(sev >= 0); assert(sev < TestOutcome::LAST); total = 0; expected = 0; for( const_iterator it(begin()); it != end(); ++it ) { if( it->severity != sev ) continue; ++total; if( it->expected ) ++expected; } } } // end OsiUnitTest namespace Osi-0.106.4/src/OsiCommonTest/OsiUnitTests.hpp0000644000076600007660000003313212106746674017571 0ustar coincoin// Copyright (C) 2010 // All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). /*! \file OsiUnitTests.hpp Utility methods for OSI unit tests. */ #ifndef OSISOLVERINTERFACETEST_HPP_ #define OSISOLVERINTERFACETEST_HPP_ #include #include #include #include #include #include #include #include class OsiSolverInterface; class CoinPackedVectorBase; /** A function that tests that a lot of problems given in MPS files (mostly the NETLIB problems) solve properly with all the specified solvers. * * The routine creates a vector of NetLib problems (problem name, objective, * various other characteristics), and a vector of solvers to be tested. * * Each solver is run on each problem. The run is deemed successful if the * solver reports the correct problem size after loading and returns the * correct objective value after optimization. * If multiple solvers are available, the results are compared pairwise against * the results reported by adjacent solvers in the solver vector. Due to * limitations of the volume solver, it must be the last solver in vecEmptySiP. */ void OsiSolverInterfaceMpsUnitTest (const std::vector & vecEmptySiP, const std::string& mpsDir); /** A function that tests the methods in the OsiSolverInterface class. * Some time ago, if this method is compiled with optimization, * the compilation took 10-15 minutes and the machine pages (has 256M core memory!)... */ void OsiSolverInterfaceCommonUnitTest (const OsiSolverInterface* emptySi, const std::string& mpsDir, const std::string& netlibDir); /** A function that tests the methods in the OsiColCut class. */ void OsiColCutUnitTest (const OsiSolverInterface * baseSiP, const std::string & mpsDir); /** A function that tests the methods in the OsiRowCut class. */ void OsiRowCutUnitTest (const OsiSolverInterface * baseSiP, const std::string & mpsDir); /** A function that tests the methods in the OsiRowCutDebugger class. */ void OsiRowCutDebuggerUnitTest (const OsiSolverInterface * siP, const std::string & mpsDir); /** A function that tests the methods in the OsiCuts class. */ void OsiCutsUnitTest(); /// A namespace so we can define a few `global' variables to use during tests. namespace OsiUnitTest { class TestOutcomes; /*! \brief Verbosity level of unit tests 0 (default) for minimal output; larger numbers produce more output */ extern unsigned int verbosity; /*! \brief Behaviour on failing a test - 0 (= default) continue - 1 press any key to continue - 2 stop with abort() */ extern unsigned int haltonerror; /*! \brief Test outcomes A global TestOutcomes object to store test outcomes during the run of the unit test for an OSI. */ extern TestOutcomes outcomes; /*! \brief Print an error message Formatted as "XxxSolverInterface testing issue: message" where Xxx is the string provided as \p solverName. Flushes std::cout before printing to std::cerr. */ void failureMessage(const std::string &solverName, const std::string &message) ; /// \overload void failureMessage(const OsiSolverInterface &si, const std::string &message) ; /*! \brief Print an error message, specifying the test name and condition Formatted as "XxxSolverInterface testing issue: testname failed: testcond" where Xxx is the OsiStrParam::OsiSolverName parameter of the \p si. Flushes std::cout before printing to std::cerr. */ void failureMessage(const std::string &solverName, const std::string &testname, const std::string &testcond) ; /// \overload void failureMessage(const OsiSolverInterface &si, const std::string &testname, const std::string &testcond) ; /*! \brief Print a message. Prints the message as given. Flushes std::cout before printing to std::cerr. */ void testingMessage(const char *const msg) ; /*! \brief Utility method to check equality Tests for equality using CoinRelFltEq with tolerance \p tol. Understands the notion of solver infinity and obtains the value for infinity from the solver interfaces supplied as parameters. */ bool equivalentVectors(const OsiSolverInterface * si1, const OsiSolverInterface * si2, double tol, const double * v1, const double * v2, int size) ; /*! \brief Compare two problems for equality Compares the problems held in the two solvers: constraint matrix, row and column bounds, column type, and objective. Rows are checked using upper and lower bounds and using sense, bound, and range. */ bool compareProblems(OsiSolverInterface *osi1, OsiSolverInterface *osi2) ; /*! \brief Compare a packed vector with an expanded vector Checks that all values present in the packed vector are present in the full vector and checks that there are no extra entries in the full vector. Uses CoinRelFltEq with the default tolerance. */ bool isEquivalent(const CoinPackedVectorBase &pv, int n, const double *fv) ; /*! \brief Process command line parameters. An unrecognised keyword which is not in the \p ignorekeywords map will trigger the help message and a return value of false. For each keyword in \p ignorekeywords, you can specify the number of following parameters that should be ignored. This should be replaced with the one of the standard CoinUtils parameter mechanisms. */ bool processParameters (int argc, const char **argv, std::map& parms, const std::map& ignorekeywords = std::map()); /// A single test outcome record. class TestOutcome { public: /// Test result typedef enum { NOTE = 0, PASSED = 1, WARNING = 2, ERROR = 3, LAST = 4 } SeverityLevel; /// Print strings for SeverityLevel static std::string SeverityLevelName[LAST]; /// Name of component under test std::string component; /// Name of test std::string testname; /// Condition being tested std::string testcond; /// Test result SeverityLevel severity; /// Set to true if problem is expected bool expected; /// Name of code file where test executed std::string filename; /// Line number in code file where test executed int linenumber; /// Standard constructor TestOutcome(const std::string& comp, const std::string& tst, const char* cond, SeverityLevel sev, const char* file, int line, bool exp = false) : component(comp),testname(tst),testcond(cond),severity(sev), expected(exp),filename(file),linenumber(line) { } /// Print the test outcome void print() const; }; /// Utility class to maintain a list of test outcomes. class TestOutcomes : public std::list { public: /// Add an outcome to the list void add(std::string comp, std::string tst, const char* cond, TestOutcome::SeverityLevel sev, const char* file, int line, bool exp = false) { push_back(TestOutcome(comp,tst,cond,sev,file,line,exp)); } /*! \brief Add an outcome to the list Get the component name from the solver interface. */ void add(const OsiSolverInterface& si, std::string tst, const char* cond, TestOutcome::SeverityLevel sev, const char* file, int line, bool exp = false); /// Print the list of outcomes void print() const; /*! \brief Count total and expected outcomes at given severity level Given a severity level, walk the list of outcomes and count the total number of outcomes at this severity level and the number expected. */ void getCountBySeverity(TestOutcome::SeverityLevel sev, int& total, int& expected) const; }; /// Convert parameter to a string (stringification) #define OSIUNITTEST_QUOTEME_(x) #x /// Convert to string with one level of expansion of the parameter #define OSIUNITTEST_QUOTEME(x) OSIUNITTEST_QUOTEME_(x) template bool OsiUnitTestAssertSeverityExpected( bool condition, const char * condition_str, const char *filename, int line, const Component& component, const std::string& testname, TestOutcome::SeverityLevel severity, bool expected) { if (condition) { OsiUnitTest::outcomes.add(component, testname, condition_str, OsiUnitTest::TestOutcome::PASSED, filename, line, false); if (OsiUnitTest::verbosity >= 2) { std::ostringstream successmsg; successmsg << __FILE__ << ":" << __LINE__ << ": " << testname << " (condition \'" << condition_str << "\') passed.\n"; OsiUnitTest::testingMessage(successmsg.str().c_str()); } return true; } OsiUnitTest::outcomes.add(component, testname, condition_str, severity, filename, line, expected); OsiUnitTest::failureMessage(component, testname, condition_str); switch (OsiUnitTest::haltonerror) { case 2: { if (severity >= OsiUnitTest::TestOutcome::ERROR ) std::abort(); break; } case 1: { std::cout << std::endl << "press any key to continue..." << std::endl; std::getchar(); break ; } default: ; } return false; } /// Add a test outcome to the list held in OsiUnitTest::outcomes #define OSIUNITTEST_ADD_OUTCOME(component,testname,testcondition,severity,expected) \ OsiUnitTest::outcomes.add(component,testname,testcondition,severity,\ __FILE__,__LINE__,expected) /*! \brief Test for a condition and record the result Test \p condition and record the result in OsiUnitTest::outcomes. If it succeeds, record the result as OsiUnitTest::TestOutcome::PASSED and print a message for OsiUnitTest::verbosity >= 2. If it fails, record the test as failed with \p severity and \p expected and react as specified by OsiUnitTest::haltonerror. \p failurecode is executed when failure is not fatal. */ #define OSIUNITTEST_ASSERT_SEVERITY_EXPECTED(condition,failurecode,component,\ testname, severity, expected) \ { \ if (!OsiUnitTestAssertSeverityExpected(condition, #condition, \ __FILE__, __LINE__, component, testname, severity, expected)) { \ failurecode; \ } \ } /*! \brief Perform a test with severity OsiUnitTest::TestOutcome::ERROR, failure not expected. */ #define OSIUNITTEST_ASSERT_ERROR(condition, failurecode, component, testname) \ OSIUNITTEST_ASSERT_SEVERITY_EXPECTED(condition,failurecode,component,testname,\ OsiUnitTest::TestOutcome::ERROR,false) /*! \brief Perform a test with severity OsiUnitTest::TestOutcome::WARNING, failure not expected. */ #define OSIUNITTEST_ASSERT_WARNING(condition, failurecode, component, testname) \ OSIUNITTEST_ASSERT_SEVERITY_EXPECTED(condition,failurecode,component,testname,\ OsiUnitTest::TestOutcome::WARNING,false) /*! \brief Perform a test surrounded by a try/catch block \p trycode is executed in a try/catch block; if there's no throw the test is deemed to have succeeded and is recorded in OsiUnitTest::outcomes with status OsiUnitTest::TestOutcome::PASSED. If the \p trycode throws a CoinError, the failure is recorded with status \p severity and \p expected and the value of OsiUnitTest::haltonerror is consulted. If the failure is not fatal, \p catchcode is executed. If any other error is thrown, the failure is recorded as for a CoinError and \p catchcode is executed (haltonerror is not consulted). */ #define OSIUNITTEST_CATCH_SEVERITY_EXPECTED(trycode, catchcode, component, testname,\ severity, expected) \ { \ try { \ trycode; \ OSIUNITTEST_ADD_OUTCOME(component,testname,#trycode " did not throw exception",\ OsiUnitTest::TestOutcome::PASSED,false); \ if (OsiUnitTest::verbosity >= 2) { \ std::string successmsg( __FILE__ ":" OSIUNITTEST_QUOTEME(__LINE__) ": "); \ successmsg = successmsg + testname; \ successmsg = successmsg + " (code \'" #trycode "\') did not throw exception"; \ successmsg = successmsg + ".\n" ; \ OsiUnitTest::testingMessage(successmsg.c_str()); \ } \ } catch (CoinError& e) { \ std::stringstream errmsg; \ errmsg << #trycode " threw CoinError: " << e.message(); \ if (e.className().length() > 0) \ errmsg << " in " << e.className(); \ if (e.methodName().length() > 0) \ errmsg << " in " << e.methodName(); \ if (e.lineNumber() >= 0) \ errmsg << " at " << e.fileName() << ":" << e.lineNumber(); \ OSIUNITTEST_ADD_OUTCOME(component,testname,errmsg.str().c_str(),\ severity,expected); \ OsiUnitTest::failureMessage(component,testname,errmsg.str().c_str()); \ switch(OsiUnitTest::haltonerror) { \ case 2: \ { if (severity >= OsiUnitTest::TestOutcome::ERROR) abort(); break; } \ case 1: \ { std::cout << std::endl << "press any key to continue..." << std::endl; \ getchar(); \ break ; } \ default: ; \ } \ catchcode; \ } catch (...) { \ std::string errmsg; \ errmsg = #trycode; \ errmsg = errmsg + " threw unknown exception"; \ OSIUNITTEST_ADD_OUTCOME(component,testname,errmsg.c_str(),severity,false); \ OsiUnitTest::failureMessage(component,testname,errmsg.c_str()); \ catchcode; \ } \ } /*! \brief Perform a try/catch test with severity OsiUnitTest::TestOutcome::ERROR, failure not expected. */ #define OSIUNITTEST_CATCH_ERROR(trycode, catchcode, component, testname) \ OSIUNITTEST_CATCH_SEVERITY_EXPECTED(trycode, catchcode, component, testname, OsiUnitTest::TestOutcome::ERROR, false) /*! \brief Perform a try/catch test with severity OsiUnitTest::TestOutcome::WARNING, failure not expected. */ #define OSIUNITTEST_CATCH_WARNING(trycode, catchcode, component, testname) \ OSIUNITTEST_CATCH_SEVERITY_EXPECTED(trycode, catchcode, component, testname, OsiUnitTest::TestOutcome::WARNING, false) } // end namespace OsiUnitTest #endif /*OSISOLVERINTERFACETEST_HPP_*/ Osi-0.106.4/src/OsiCommonTest/OsiNetlibTest.cpp0000644000076600007660000003052212101340333017650 0ustar coincoin/* Copyright (C) 2000 -- 2010, Lou Hafer, International Business Machines, and others. All Rights Reserved. This code is licensed under the terms of the Eclipse Public License (EPL). */ #include "CoinPragma.hpp" #include "OsiUnitTests.hpp" #include "OsiConfig.h" #include "CoinTime.hpp" #include "CoinFloatEqual.hpp" /* #include #include #include #include #include #include #include */ #include "OsiSolverInterface.hpp" /*! \brief Run solvers on NetLib problems. The routine creates a vector of NetLib problems (problem name, objective, various other characteristics), and a vector of solvers to be tested. Each solver is run on each problem. The run is deemed successful if the solver reports the correct problem size after loading and returns the correct objective value after optimization. If multiple solvers are available, the results are compared pairwise against the results reported by adjacent solvers in the solver vector. Due to limitations of the volume solver, it must be the last solver in vecEmptySiP. */ void OsiSolverInterfaceMpsUnitTest (const std::vector & vecEmptySiP, const std::string & mpsDir) { int i ; unsigned int m ; /* Vectors to hold test problem names and characteristics. The objective value after optimization (objValue) must agree to the specified tolerance (objValueTol). */ std::vector mpsName ; std::vector minObj ; std::vector nRows ; std::vector nCols ; std::vector objValue ; std::vector objValueTol ; /* And a macro to make the vector creation marginally readable. */ #define PUSH_MPS(zz_mpsName_zz,zz_minObj_zz,\ zz_nRows_zz,zz_nCols_zz,zz_objValue_zz,zz_objValueTol_zz) \ mpsName.push_back(zz_mpsName_zz) ; \ minObj.push_back(zz_minObj_zz) ; \ nRows.push_back(zz_nRows_zz) ; \ nCols.push_back(zz_nCols_zz) ; \ objValueTol.push_back(zz_objValueTol_zz) ; \ objValue.push_back(zz_objValue_zz) ; /* Load up the problem vector. Note that the row counts here include the objective function. */ PUSH_MPS("25fv47",true,822,1571,5.5018458883E+03,1.0e-10) PUSH_MPS("80bau3b",true,2263,9799,9.8722419241E+05,1.e-10) PUSH_MPS("adlittle",true,57,97,2.2549496316e+05,1.e-10) PUSH_MPS("afiro",true,28,32,-4.6475314286e+02,1.e-10) PUSH_MPS("agg",true,489,163,-3.5991767287e+07,1.e-10) PUSH_MPS("agg2",true,517,302,-2.0239252356e+07,1.e-10) PUSH_MPS("agg3",true,517,302,1.0312115935e+07,1.e-10) PUSH_MPS("bandm",true,306,472,-1.5862801845e+02,1.e-10) PUSH_MPS("beaconfd",true,174,262,3.3592485807e+04,1.e-10) PUSH_MPS("blend",true,75,83,-3.0812149846e+01,1.e-10) PUSH_MPS("bnl1",true,644,1175,1.9776295615E+03,1.e-10) PUSH_MPS("bnl2",true,2325,3489,1.8112365404e+03,1.e-10) PUSH_MPS("boeing1",true,/*351*/352,384,-3.3521356751e+02,1.e-10) PUSH_MPS("boeing2",true,167,143,-3.1501872802e+02,1.e-10) PUSH_MPS("bore3d",true,234,315,1.3730803942e+03,1.e-10) PUSH_MPS("brandy",true,221,249,1.5185098965e+03,1.e-10) PUSH_MPS("capri",true,272,353,2.6900129138e+03,1.e-10) PUSH_MPS("cycle",true,1904,2857,-5.2263930249e+00,1.e-9) PUSH_MPS("czprob",true,930,3523,2.1851966989e+06,1.e-10) PUSH_MPS("d2q06c",true,2172,5167,122784.21557456,1.e-7) PUSH_MPS("d6cube",true,416,6184,3.1549166667e+02,1.e-8) PUSH_MPS("degen2",true,445,534,-1.4351780000e+03,1.e-10) PUSH_MPS("degen3",true,1504,1818,-9.8729400000e+02,1.e-10) PUSH_MPS("dfl001",true,6072,12230,1.1266396047E+07,1.e-5) PUSH_MPS("e226",true,224,282,(-18.751929066+7.113),1.e-10) // NOTE: Objective function has constant of 7.113 PUSH_MPS("etamacro",true,401,688,-7.5571521774e+02 ,1.e-6) PUSH_MPS("fffff800",true,525,854,5.5567961165e+05,1.e-6) PUSH_MPS("finnis",true,498,614,1.7279096547e+05,1.e-6) PUSH_MPS("fit1d",true,25,1026,-9.1463780924e+03,1.e-10) PUSH_MPS("fit1p",true,628,1677,9.1463780924e+03,1.e-10) PUSH_MPS("fit2d",true,26,10500,-6.8464293294e+04,1.e-10) PUSH_MPS("fit2p",true,3001,13525,6.8464293232e+04,1.e-9) PUSH_MPS("forplan",true,162,421,-6.6421873953e+02,1.e-6) PUSH_MPS("ganges",true,1310,1681,-1.0958636356e+05,1.e-5) PUSH_MPS("gfrd-pnc",true,617,1092,6.9022359995e+06,1.e-10) PUSH_MPS("greenbea",true,2393,5405,/*-7.2462405908e+07*/-72555248.129846,1.e-10) PUSH_MPS("greenbeb",true,2393,5405,/*-4.3021476065e+06*/-4302260.2612066,1.e-10) PUSH_MPS("grow15",true,301,645,-1.0687094129e+08,1.e-10) PUSH_MPS("grow22",true,441,946,-1.6083433648e+08,1.e-10) PUSH_MPS("grow7",true,141,301,-4.7787811815e+07,1.e-10) PUSH_MPS("israel",true,175,142,-8.9664482186e+05,1.e-10) PUSH_MPS("kb2",true,44,41,-1.7499001299e+03,1.e-10) PUSH_MPS("lotfi",true,154,308,-2.5264706062e+01,1.e-10) PUSH_MPS("maros",true,847,1443,-5.8063743701e+04,1.e-10) PUSH_MPS("maros-r7",true,3137,9408,1.4971851665e+06,1.e-10) PUSH_MPS("modszk1",true,688,1620,3.2061972906e+02,1.e-10) PUSH_MPS("nesm",true,663,2923,1.4076073035e+07,1.e-5) PUSH_MPS("perold",true,626,1376,-9.3807580773e+03,1.e-6) PUSH_MPS("pilot",true,1442,3652,/*-5.5740430007e+02*/-557.48972927292,5.e-5) PUSH_MPS("pilot4",true,411,1000,-2.5811392641e+03,1.e-6) PUSH_MPS("pilot87",true,2031,4883,3.0171072827e+02,1.e-4) PUSH_MPS("pilotnov",true,976,2172,-4.4972761882e+03,1.e-10) // ?? PUSH_MPS("qap8",true,913,1632,2.0350000000e+02,1.e-10) // ?? PUSH_MPS("qap12",true,3193,8856,5.2289435056e+02,1.e-10) // ?? PUSH_MPS("qap15",true,6331,22275,1.0409940410e+03,1.e-10) PUSH_MPS("recipe",true,92,180,-2.6661600000e+02,1.e-10) PUSH_MPS("sc105",true,106,103,-5.2202061212e+01,1.e-10) PUSH_MPS("sc205",true,206,203,-5.2202061212e+01,1.e-10) PUSH_MPS("sc50a",true,51,48,-6.4575077059e+01,1.e-10) PUSH_MPS("sc50b",true,51,48,-7.0000000000e+01,1.e-10) PUSH_MPS("scagr25",true,472,500,-1.4753433061e+07,1.e-10) PUSH_MPS("scagr7",true,130,140,-2.3313892548e+06,1.e-6) PUSH_MPS("scfxm1",true,331,457,1.8416759028e+04,1.e-10) PUSH_MPS("scfxm2",true,661,914,3.6660261565e+04,1.e-10) PUSH_MPS("scfxm3",true,991,1371,5.4901254550e+04,1.e-10) PUSH_MPS("scorpion",true,389,358,1.8781248227e+03,1.e-10) PUSH_MPS("scrs8",true,491,1169,9.0429998619e+02,1.e-5) PUSH_MPS("scsd1",true,78,760,8.6666666743e+00,1.e-10) PUSH_MPS("scsd6",true,148,1350,5.0500000078e+01,1.e-10) PUSH_MPS("scsd8",true,398,2750,9.0499999993e+02,1.e-8) PUSH_MPS("sctap1",true,301,480,1.4122500000e+03,1.e-10) PUSH_MPS("sctap2",true,1091,1880,1.7248071429e+03,1.e-10) PUSH_MPS("sctap3",true,1481,2480,1.4240000000e+03,1.e-10) PUSH_MPS("seba",true,516,1028,1.5711600000e+04,1.e-10) PUSH_MPS("share1b",true,118,225,-7.6589318579e+04,1.e-10) PUSH_MPS("share2b",true,97,79,-4.1573224074e+02,1.e-10) PUSH_MPS("shell",true,537,1775,1.2088253460e+09,1.e-10) PUSH_MPS("ship04l",true,403,2118,1.7933245380e+06,1.e-10) PUSH_MPS("ship04s",true,403,1458,1.7987147004e+06,1.e-10) PUSH_MPS("ship08l",true,779,4283,1.9090552114e+06,1.e-10) PUSH_MPS("ship08s",true,779,2387,1.9200982105e+06,1.e-10) PUSH_MPS("ship12l",true,1152,5427,1.4701879193e+06,1.e-10) PUSH_MPS("ship12s",true,1152,2763,1.4892361344e+06,1.e-10) PUSH_MPS("sierra",true,1228,2036,1.5394362184e+07,1.e-10) PUSH_MPS("stair",true,357,467,-2.5126695119e+02,1.e-10) PUSH_MPS("standata",true,360,1075,1.2576995000e+03,1.e-10) // GUB PUSH_MPS("standgub",true,362,1184,1257.6995,1.e-10) PUSH_MPS("standmps",true,468,1075,1.4060175000E+03,1.e-10) PUSH_MPS("stocfor1",true,118,111,-4.1131976219E+04,1.e-10) PUSH_MPS("stocfor2",true,2158,2031,-3.9024408538e+04,1.e-10) // ?? PUSH_MPS("stocfor3",true,16676,15695,-3.9976661576e+04,1.e-10) // ?? PUSH_MPS("truss",true,1001,8806,4.5881584719e+05,1.e-10) PUSH_MPS("tuff",true,334,587,2.9214776509e-01,1.e-10) PUSH_MPS("vtpbase",true,199,203,1.2983146246e+05,1.e-10) PUSH_MPS("wood1p",true,245,2594,1.4429024116e+00,5.e-5) PUSH_MPS("woodw",true,1099,8405,1.3044763331E+00,1.e-10) #undef PUSH_MPS const unsigned int numProblems = static_cast(mpsName.size()) ; /* Create vectors to hold solver interfaces, the name of each solver interface, the current state of processing, and statistics about the number of problems solved and the time taken. */ const int numSolvers = static_cast(vecEmptySiP.size()) ; std::vector vecSiP(numSolvers) ; std::vector siName(numSolvers) ; std::vector siStage(numSolvers) ; std::vector numProbSolved(numSolvers) ; std::vector timeTaken(numSolvers) ; for (i = 0 ; i < numSolvers ; i++) { siName[i] = "unknown" ; numProbSolved[i] = 0 ; timeTaken[i] = 0.0 ; } /* For each problem, create a fresh clone of the `empty' solvers from vecEmptySiP, then proceed in stages: read the MPS file, solve the problem, check the solution. If there are multiple solvers in vecSiP, the results of each solver are compared with its neighbors in the vector. */ for (m = 0 ; m < numProblems ; m++) { std::cout << " processing mps file: " << mpsName[m] << " (" << m+1 << " out of " << numProblems << ")" << std::endl ; /* Stage 0: Create fresh solver clones. */ int solversReadMpsFile = 0 ; for (i = numSolvers-1 ; i >= 0 ; --i) { vecSiP[i] = vecEmptySiP[i]->clone() ; vecSiP[i]->getStrParam(OsiSolverName,siName[i]) ; siStage[i] = 0 ; } /* Stage 1: Read the MPS file into each solver interface. As a basic check, make sure the size of the constraint matrix is correct. */ for (i = 0 ; i < numSolvers ; i++) { std::string fn = mpsDir+mpsName[m] ; vecSiP[i]->readMps(fn.c_str(),"mps") ; if (minObj[m]) vecSiP[i]->setObjSense(1.0) ; else vecSiP[i]->setObjSense(-1.0) ; int nr = vecSiP[i]->getNumRows() ; int nc = vecSiP[i]->getNumCols() ; if (nr == nRows[m]-1 && nc == nCols[m]) { siStage[i] = 1 ; solversReadMpsFile++ ; } } /* If more than one solver succeeded, compare representations. */ if (solversReadMpsFile > 0) { // Find an initial pair to compare int s1 ; for (s1 = 0 ; s1 < numSolvers-1 && siStage[s1] < 1 ; s1++) ; int s2 ; for (s2 = s1+1 ; s2 < numSolvers && siStage[s2] < 1 ; s2++) ; while (s2 < numSolvers) { std::cout << " comparing problem representation for " << siName[s1] << " and " << siName[s2] << " ..." ; if (OsiUnitTest::compareProblems(vecSiP[s1],vecSiP[s2])) std::cout << " ok." << std::endl; s1 = s2 ; for (s2++ ; s2 < numSolvers && siStage[s2] < 1 ; s2++) ; } } /* Stage 2: Ask each solver that successfully read the problem to solve it, then check the return code and objective. */ for (i = 0 ; i < numSolvers ; ++i) { if (siStage[i] < 1) continue ; double startTime = CoinCpuTime() ; OSIUNITTEST_CATCH_ERROR(vecSiP[i]->initialSolve(), continue, *vecSiP[i], "netlib " + mpsName[m]); double timeOfSolution = CoinCpuTime()-startTime; OSIUNITTEST_ASSERT_ERROR(vecSiP[i]->isProvenOptimal(), {}, *vecSiP[i], "netlib " + mpsName[m]); if (vecSiP[i]->isProvenOptimal()) { double soln = vecSiP[i]->getObjValue(); CoinRelFltEq eq(objValueTol[m]) ; OSIUNITTEST_ASSERT_ERROR(eq(soln,objValue[m]), std::cerr << soln << " != " << objValue[m] << "; error = " << fabs(objValue[m]-soln), *vecSiP[i], "netlib " + mpsName[m]); if (eq(soln,objValue[m])) { std::cout << " " << siName[i] << " " << soln << " = " << objValue[m] << ", " << vecSiP[i]->getIterationCount() << " iters; okay" ; numProbSolved[i]++ ; } std::cout << " - took " << timeOfSolution << " seconds." << std::endl; timeTaken[i] += timeOfSolution; } else { std::cout.flush() ; std::cerr << " " << siName[i] << "; error " ; if (vecSiP[i]->isProvenPrimalInfeasible()) std::cerr << "primal infeasible" ; else if (vecSiP[i]->isIterationLimitReached()) std::cerr << "iteration limit" ; else if (vecSiP[i]->isAbandoned()) std::cerr << "abandoned" ; else std::cerr << "unknown" ; } } /* Delete the used solver interfaces so we can reload fresh clones for the next problem. */ for (i = 0 ; i < numSolvers ; i++) delete vecSiP[i] ; } /* Print a summary for each solver. */ for (i = 0 ; i < numSolvers ; i++) { std::cout << siName[i] << " solved " << numProbSolved[i] << " out of " << numProblems << " and took " << timeTaken[i] << " seconds." << std::endl ; } } Osi-0.106.4/src/OsiGlpk/0000755000076600007660000000000012244064313013230 5ustar coincoinOsi-0.106.4/src/OsiGlpk/osi-glpk-uninstalled.pc.in0000644000076600007660000000046611507670402020237 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src/OsiGlpk Name: OsiGlpk Description: COIN-OR Open Solver Interface for GLPK URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: ${libdir}/libOsiGlpk.la @OSIGLPKLIB_PCLIBS@ Cflags: -I@abs_source_dir@/src/OsiGlpk Requires: osi @OSIGLPKLIB_PCREQUIRES@ Osi-0.106.4/src/OsiGlpk/Makefile.am0000644000076600007660000000310711621722556015275 0ustar coincoin# Copyright (C) 2006, 2007 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1800 2011-08-14 10:37:34Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiGlpk # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiGlpk.la # List all source files for this library, including headers libOsiGlpk_la_SOURCES = \ OsiGlpkSolverInterface.cpp OsiGlpkSolverInterface.hpp # This is for libtool libOsiGlpk_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../Osi` $(COINUTILS_CFLAGS) $(GLPK_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiGlpkSolverInterface.hpp Osi-0.106.4/src/OsiGlpk/OsiGlpkSolverInterface.hpp0000644000076600007660000010121712130015013020312 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for GLPK //----------------------------------------------------------------------------- // Copyright (C) 2001, Vivian De Smedt, Braden Hunsaker // Copyright (C) 2003 University of Pittsburgh // University of Pittsburgh coding done by Brady Hunsaker // All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiGlpkSolverInterface_H #define OsiGlpkSolverInterface_H #include #include "OsiSolverInterface.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" /** GPLK Solver Interface Instantiation of OsiGlpkSolverInterface for GPLK */ #ifndef LPX #define LPX glp_prob #endif #ifndef GLP_PROB_DEFINED #define GLP_PROB_DEFINED // Glpk < 4.48: typedef struct { double _opaque_prob[100]; } glp_prob; // Glpk 4.48: typedef struct glp_prob glp_prob; #endif class OsiGlpkSolverInterface : virtual public OsiSolverInterface { friend void OsiGlpkSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); public: //--------------------------------------------------------------------------- /**@name Solve methods */ //@{ /// Solve initial LP relaxation virtual void initialSolve(); /// Resolve an LP relaxation after problem modification virtual void resolve(); /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound(); //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. */ //@{ // Set an integer parameter bool setIntParam(OsiIntParam key, int value); // Set an double parameter bool setDblParam(OsiDblParam key, double value); // Set a string parameter bool setStrParam(OsiStrParam key, const std::string & value); // Set a hint parameter bool setHintParam(OsiHintParam key, bool sense = true, OsiHintStrength strength = OsiHintTry, void *info = 0) ; // Get an integer parameter bool getIntParam(OsiIntParam key, int& value) const; // Get an double parameter bool getDblParam(OsiDblParam key, double& value) const; // Get a string parameter bool getStrParam(OsiStrParam key, std::string& value) const; //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there a numerical difficulties? virtual bool isAbandoned() const; /// Is optimality proven? virtual bool isProvenOptimal() const; /// Is primal infeasiblity proven? virtual bool isProvenPrimalInfeasible() const; /// Is dual infeasiblity proven? virtual bool isProvenDualInfeasible() const; /// Is the given primal objective limit reached? virtual bool isPrimalObjectiveLimitReached() const; /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const; /// Time limit reached? virtual bool isTimeLimitReached() const; /// (Integer) Feasible solution found? virtual bool isFeasible() const; //@} //--------------------------------------------------------------------------- /**@name WarmStart related methods */ //@{ /*! \brief Get an empty warm start object This routine returns an empty CoinWarmStartBasis object. Its purpose is to provide a way to give a client a warm start basis object of the appropriate type, which can resized and modified as desired. */ inline CoinWarmStart *getEmptyWarmStart () const { return (dynamic_cast(new CoinWarmStartBasis())) ; } /// Get warmstarting information virtual CoinWarmStart* getWarmStart() const; /** Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. */ virtual bool setWarmStart(const CoinWarmStart* warmstart); //@} //--------------------------------------------------------------------------- /**@name Hotstart related methods (primarily used in strong branching).
The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there.
NOTE: between hotstarted optimizations only bound changes are allowed. */ //@{ /// Create a hotstart point of the optimization process virtual void markHotStart(); /// Optimize starting from the hotstart virtual void solveFromHotStart(); /// Delete the snapshot virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem information methods These methods call the solver's query routines to return information about the problem referred to by the current object. Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /**@name Methods related to querying the input data */ //@{ /// Get number of columns virtual int getNumCols() const; /// Get number of rows virtual int getNumRows() const; /// Get number of nonzero elements virtual int getNumElements() const; /// Get pointer to array[getNumCols()] of column lower bounds virtual const double * getColLower() const; /// Get pointer to array[getNumCols()] of column upper bounds virtual const double * getColUpper() const; /** Get pointer to array[getNumRows()] of row constraint senses.
  • 'L': <= constraint
  • 'E': = constraint
  • 'G': >= constraint
  • 'R': ranged constraint
  • 'N': free constraint
*/ virtual const char * getRowSense() const; /** Get pointer to array[getNumRows()] of rows right-hand sides
  • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
  • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
  • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
  • if rowsense()[i] == 'N' then rhs()[i] == 0.0
*/ virtual const double * getRightHandSide() const; /** Get pointer to array[getNumRows()] of row ranges.
  • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
  • if rowsense()[i] != 'R' then rowrange()[i] is 0.0
*/ virtual const double * getRowRange() const; /// Get pointer to array[getNumRows()] of row lower bounds virtual const double * getRowLower() const; /// Get pointer to array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const; /// Get pointer to array[getNumCols()] of objective function coefficients virtual const double * getObjCoefficients() const; /// Get objective function sense (1 for min (default), -1 for max) virtual double getObjSense() const; /// Return true if column is continuous virtual bool isContinuous(int colNumber) const; #if 0 /// Return true if column is binary virtual bool isBinary(int columnNumber) const; /** Return true if column is integer. Note: This function returns true if the the column is binary or a general integer. */ virtual bool isInteger(int columnNumber) const; /// Return true if column is general integer virtual bool isIntegerNonBinary(int columnNumber) const; /// Return true if column is binary and not fixed at either bound virtual bool isFreeBinary(int columnNumber) const; #endif /// Get pointer to row-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByRow() const; /// Get pointer to column-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByCol() const; /// Get solver's value for infinity virtual double getInfinity() const; //@} /**@name Methods related to querying the solution */ //@{ /// Get pointer to array[getNumCols()] of primal solution vector virtual const double * getColSolution() const; /// Get pointer to array[getNumRows()] of dual prices virtual const double * getRowPrice() const; /// Get a pointer to array[getNumCols()] of reduced costs virtual const double * getReducedCost() const; /** Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector */ virtual const double * getRowActivity() const; /// Get objective function value virtual double getObjValue() const; /** Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. */ virtual int getIterationCount() const; /** Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.) NOTE for implementers of solver interfaces:
The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].
NOTE for users of solver interfaces:
It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay=false) const; /** Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.) The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. NOTE for implementers of solver interfaces:
The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].
NOTE for users of solver interfaces:
It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getPrimalRays(int maxNumRays) const; #if 0 /** Get vector of indices of solution which are integer variables presently at fractional values */ virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const; #endif //@} //@} //--------------------------------------------------------------------------- /**@name Problem modifying methods */ //@{ //------------------------------------------------------------------------- /**@name Changing bounds on variables and constraints */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff( int elementIndex, double elementValue ); using OsiSolverInterface::setColLower ; /** Set a single column lower bound
Use -COIN_DBL_MAX for -infinity. */ virtual void setColLower( int elementIndex, double elementValue ); using OsiSolverInterface::setColUpper ; /** Set a single column upper bound
Use COIN_DBL_MAX for infinity. */ virtual void setColUpper( int elementIndex, double elementValue ); /** Set a single column lower and upper bound
The default implementation just invokes setColLower() and setColUpper() */ virtual void setColBounds( int elementIndex, double lower, double upper ); /** Set the bounds on a number of columns simultaneously
The default implementation just invokes setColLower() and setColUpper() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes @param boundList the new lower/upper bound pairs for the variables */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set a single row lower bound
Use -COIN_DBL_MAX for -infinity. */ virtual void setRowLower( int elementIndex, double elementValue ); /** Set a single row upper bound
Use COIN_DBL_MAX for infinity. */ virtual void setRowUpper( int elementIndex, double elementValue ); /** Set a single row lower and upper bound
The default implementation just invokes setRowLower() and setRowUpper() */ virtual void setRowBounds( int elementIndex, double lower, double upper ); /** Set the type of a single row
*/ virtual void setRowType(int index, char sense, double rightHandSide, double range); /** Set the bounds on a number of rows simultaneously
The default implementation just invokes setRowLower() and setRowUpper() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the constraints */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a number of rows simultaneously
The default implementation just invokes setRowType() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the constraints whose any characteristics changes @param senseList the new senses @param rhsList the new right hand sides @param rangeList the new ranges */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); //@} //------------------------------------------------------------------------- /**@name Integrality related changing methods */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index); /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index); /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); //@} //------------------------------------------------------------------------- /// Set objective function sense (1 for min (default), -1 for max,) virtual void setObjSense(double s); /** Set the primal solution column values colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double * colsol); /** Set dual solution vector rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice); //------------------------------------------------------------------------- /**@name Methods to expand a problem.
Note that if a column is added then by default it will correspond to a continuous variable. */ //@{ using OsiSolverInterface::addCol ; /** */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj); using OsiSolverInterface::addCols ; /** */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); /** */ virtual void deleteCols(const int num, const int * colIndices); using OsiSolverInterface::addRow ; /** */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng); using OsiSolverInterface::addRows ; /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); /** */ virtual void deleteRows(const int num, const int * rowIndices); #if 0 // ??? implemented in OsiSolverInterface //----------------------------------------------------------------------- /** Apply a collection of cuts.
Only cuts which have an effectiveness >= effectivenessLb are applied.
  • ReturnCode.numberIneffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
  • ReturnCode.numberInconsistent() -- number of invalid cuts
  • ReturnCode.numberInconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
  • ReturnCode.numberInfeasible() -- number of cuts that would make this integer model infeasible
  • ReturnCode.numberApplied() -- number of integer cuts which were applied to the integer model
  • cs.size() == numberIneffective() + numberInconsistent() + numberInconsistentWrtIntegerModel() + numberInfeasible() + nubmerApplied()
*/ virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); #endif //@} //@} //--------------------------------------------------------------------------- /**@name Methods to input a problem */ //@{ /** Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
  • colub: all columns have upper bound infinity
  • collb: all columns have lower bound 0
  • rowub: all rows have upper bound infinity
  • rowlb: all rows have lower bound -infinity
  • obj: all variables have 0 objective coefficient
*/ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). For default values see the previous method.
WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub); /** Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
  • colub: all columns have upper bound infinity
  • collb: all columns have lower bound 0
  • obj: all variables have 0 objective coefficient
  • rowsen: all rows are >=
  • rowrhs: all right hand sides are 0
  • rowrng: 0 for the ranged rows
*/ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). For default values see the previous method.
WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); using OsiSolverInterface::readMps ; /** Read an mps file from the given filename */ virtual int readMps(const char *filename, const char *extension = "mps"); /** Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants */ virtual void writeMps(const char *filename, const char *extension = "mps", double objSense=0.0) const; //@} //--------------------------------------------------------------------------- /*! \name Methods for row and column names. Only the set methods need to be overridden to ensure consistent names between OsiGlpk and the OSI base class. */ //@{ /*! \brief Set the objective function name */ void setObjName (std::string name) ; /*! \brief Set a row name Quietly does nothing if the name discipline (#OsiNameDiscipline) is auto. Quietly fails if the row index is invalid. */ void setRowName(int ndx, std::string name) ; /*! \brief Set a column name Quietly does nothing if the name discipline (#OsiNameDiscipline) is auto. Quietly fails if the column index is invalid. */ void setColName(int ndx, std::string name) ; //@} //--------------------------------------------------------------------------- /**@name GLPK specific public interfaces */ //@{ enum keepCachedFlag { /// discard all cached data (default) KEEPCACHED_NONE = 0, /// column information: objective values, lower and upper bounds, variable types KEEPCACHED_COLUMN = 1, /// row information: right hand sides, ranges and senses, lower and upper bounds for row KEEPCACHED_ROW = 2, /// problem matrix: matrix ordered by column and by row KEEPCACHED_MATRIX = 4, /// LP solution: primal and dual solution, reduced costs, row activities KEEPCACHED_RESULTS = 8, /// only discard cached LP solution KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX, /// keep all cached data (similar to getMutableLpPtr()) KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS, /// free only cached column and LP solution information FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN, /// free only cached row and LP solution information FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW, /// free only cached matrix and LP solution information FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX, /// free only cached LP solution information FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS }; /// Get pointer to GLPK model LPX * getModelPtr(); //@} /**@name Static instance counter methods */ /** GLPK has a context which must be freed after all GLPK LPs (or MIPs) are freed. * It is automatically created when the first LP is created. This method:
  • Increments by 1 the number of uses of the GLPK environment.
*/ static void incrementInstanceCounter() { ++numInstances_; } /** GLPK has a context which must be freed after all GLPK LPs (or MIPs) are freed. This method:
  • Decrements by 1 the number of uses of the GLPK environment.
  • Deletes the GLPK environment when the number of uses is change to 0 from 1.
*/ static void decrementInstanceCounter(); /// Return the number of LP/MIP instances of instantiated objects using the GLPK environment. static unsigned int getNumInstances() { return numInstances_; } //@} /**@name Constructors and destructor */ //@{ /// Default Constructor OsiGlpkSolverInterface(); /// Clone virtual OsiSolverInterface * clone(bool copyData = true) const; /// Copy constructor OsiGlpkSolverInterface( const OsiGlpkSolverInterface& ); /// Assignment operator OsiGlpkSolverInterface& operator=( const OsiGlpkSolverInterface& rhs ); /// Destructor virtual ~OsiGlpkSolverInterface(); /// Resets as if default constructor virtual void reset(); //@} protected: /**@name Protected methods */ //@{ /// Apply a row cut. Return true if cut was applied. virtual void applyRowCut( const OsiRowCut & rc ); /** Apply a column cut (bound adjustment). Return true if cut was applied. */ virtual void applyColCut( const OsiColCut & cc ); /// Pointer to the model LPX * getMutableModelPtr() const; //@} private: /**@name Private methods */ //@{ /// The real work of a copy constructor (used by copy and assignment) void gutsOfCopy( const OsiGlpkSolverInterface & source ); /// The real work of the constructor void gutsOfConstructor(); /// The real work of the destructor void gutsOfDestructor(); /// free cached column rim vectors void freeCachedColRim(); /// free cached row rim vectors void freeCachedRowRim(); /// free cached result vectors void freeCachedResults(); /// free cached matrices void freeCachedMatrix(); /// free all cached data (except specified entries, see getLpPtr()) void freeCachedData( int keepCached = KEEPCACHED_NONE ); /// free all allocated memory void freeAllMemory(); /// Just for testing purposes void printBounds(); /// Fill cached collumn bounds void fillColBounds() const; //@} /**@name Private member data */ //@{ /// GPLK model represented by this class instance mutable LPX* lp_; /// number of GLPK instances currently in use (counts only those created by OsiGlpk) static unsigned int numInstances_; // Remember whether simplex or b&b was most recently done // 0 = simplex; 1 = b&b int bbWasLast_; // Int parameters. /// simplex iteration limit (per call to solver) int maxIteration_; /// simplex iteration limit (for hot start) int hotStartMaxIteration_; /// OSI name discipline int nameDisc_; // Double parameters. /// dual objective limit (measure of badness; stop if we're worse) double dualObjectiveLimit_; /// primal objective limit (measure of goodness; stop if we're better) double primalObjectiveLimit_; /// dual feasibility tolerance double dualTolerance_; /// primal feasibility tolerance double primalTolerance_; /// constant offset for objective function double objOffset_; // String parameters /// Problem name std::string probName_; /*! \brief Array for info blocks associated with hints. */ mutable void *info_[OsiLastHintParam] ; /// Hotstart information /// size of column status and value arrays int hotStartCStatSize_; /// column status array int *hotStartCStat_; /// primal variable values double *hotStartCVal_; /// dual variable values double *hotStartCDualVal_; /// size of row status and value arrays int hotStartRStatSize_; /// row status array int *hotStartRStat_; /// row slack values double *hotStartRVal_; /// row dual values double *hotStartRDualVal_; // Status information /// glpk stopped on iteration limit bool isIterationLimitReached_; /// glpk stopped on time limit bool isTimeLimitReached_; /// glpk abandoned the problem bool isAbandoned_; /*! \brief glpk stopped on lower objective limit When minimising, this is the primal limit; when maximising, the dual limit. */ bool isObjLowerLimitReached_; /*! \brief glpk stopped on upper objective limit When minimising, this is the dual limit; when maximising, the primal limit. */ bool isObjUpperLimitReached_; /// glpk declared the problem primal infeasible bool isPrimInfeasible_; /// glpk declared the problem dual infeasible bool isDualInfeasible_; /// glpk declared the problem feasible bool isFeasible_; /**@name Cached information derived from the GLPK model */ //@{ /// Number of iterations mutable int iter_used_; /// Pointer to objective vector mutable double *obj_; /// Pointer to dense vector of variable lower bounds mutable double *collower_; /// Pointer to dense vector of variable lower bounds mutable double *colupper_; /// Pointer to dense vector of variable types (continous, binary, integer) mutable char *ctype_; /// Pointer to dense vector of row sense indicators mutable char *rowsense_; /// Pointer to dense vector of row right-hand side values mutable double *rhs_; /// Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) mutable double *rowrange_; /// Pointer to dense vector of row lower bounds mutable double *rowlower_; /// Pointer to dense vector of row upper bounds mutable double *rowupper_; /// Pointer to primal solution vector mutable double *colsol_; /// Pointer to dual solution vector mutable double *rowsol_; /// Pointer to reduced cost vector mutable double *redcost_; /// Pointer to row activity (slack) vector mutable double *rowact_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByRow_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByCol_; //@} //@} }; //############################################################################# /** A function that tests the methods in the OsiGlpkSolverInterface class. */ void OsiGlpkSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); #endif // OsiGlpkSolverInterface_H Osi-0.106.4/src/OsiGlpk/Makefile.in0000644000076600007660000005431212240315110015270 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006, 2007 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Andreas Waechter IBM 2006-04-13 srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/OsiGlpk DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsiGlpk_la_LIBADD = am_libOsiGlpk_la_OBJECTS = OsiGlpkSolverInterface.lo libOsiGlpk_la_OBJECTS = $(am_libOsiGlpk_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsiGlpk_la_SOURCES) DIST_SOURCES = $(libOsiGlpk_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiGlpk # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiGlpk.la # List all source files for this library, including headers libOsiGlpk_la_SOURCES = \ OsiGlpkSolverInterface.cpp OsiGlpkSolverInterface.hpp # This is for libtool libOsiGlpk_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../Osi` $(COINUTILS_CFLAGS) $(GLPK_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiGlpkSolverInterface.hpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OsiGlpk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/OsiGlpk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsiGlpk.la: $(libOsiGlpk_la_OBJECTS) $(libOsiGlpk_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsiGlpk_la_LDFLAGS) $(libOsiGlpk_la_OBJECTS) $(libOsiGlpk_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiGlpkSolverInterface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/OsiGlpk/OsiGlpkSolverInterface.cpp0000644000076600007660000027121412130015013020312 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for GLPK //----------------------------------------------------------------------------- // Copyright (C) 2001, 2002 Vivian De Smedt // Copyright (C) 2002, 2003 Braden Hunsaker // Copyright (C) 2003, 2004 University of Pittsburgh // Copyright (C) 2004 Joseph Young // Copyright (C) 2007 Lou Hafer // University of Pittsburgh coding done by Brady Hunsaker // All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). // // Comments: // // Areas that may need work in the code are marked with '???'. // // As of version 4.7, GLPK problems can be of class LPX_LP or LPX_MIP. // The difference is that LPX_MIP problems have a separate MIP data block, // and certain functions are only allowed for LPX_MIP problems. // // In (much) earlier versions of GLPK, if an LPX_MIP problem was // changed back into a LPX_LP problem, then the MIP data was lost, // including which columns are integer. However, LPX_MIP problems // still had access to LP information (like lpx_get_status). // // It appears that this behavior is no longer true in version 4.7. // Therefore it may be worthwhile to adjust the interface to change // the class of the problem as needed. For the time being, however, // all OSI problems are set to type LPX_MIP. The only trick is // differentiating when the user calls status routines like // isProvenOptimal(). For now, we assume that the user is referring // to the most recent solution call. We add an extra variable, // bbWasLast_, to the class to record which solution call was most // recent (lp or mip). // // Possible areas of improvement // ----------------------------- // // Methods that are not implemented: // // getPrimalRays, getDualRays // // Methods that are implemented, but do not do what you probably expect: // // setColSolution, setRowPrice // // Many methods have not been attempted to be improved (for speed) // to take advantage of how GLPK works. The emphasis has been on // making things functional and not too messy. There's plenty of room // for more efficient implementations. // /* Various bits and pieces of knowledge that are handy when working on OsiGlpk. Glpk uses 1-based indexing. Be careful. Primal and dual solutions may be set by the user. This means that getColSolution and getRowPrice are obliged to return the cached solution vector whenever it's available. Various other routines which calculate values based on primal and dual solutions must also use the cached vectors. On the other hand, we don't want to be rebuilding the cache with every call to the solver. The approach is that a call to the solver removes the cached values. Subsequent calls to retrieve solution values will repopulate the cache by interrogating glpk. */ #include #include #include #include #include extern "C" { #include "glpk.h" } #ifndef GLP_PROB_DEFINED #define GLP_PROB_DEFINED #endif #include "CoinError.hpp" #include "CoinPragma.hpp" #include "OsiConfig.h" #include "OsiGlpkSolverInterface.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" /* Grab the COIN standard finite infinity from CoinFinite.hpp. Also set a zero tolerance, so we can set clean zeros in computed reduced costs and row activities. The value 1.0e-9 is lifted from glpk --- this is the value that it uses when the LPX_K_ROUND parameter is active. */ #include "CoinFinite.hpp" namespace { const double CoinInfinity = COIN_DBL_MAX ; const double GlpkZeroTol = 1.0e-9 ; } /* Cut names down to a reasonable size. */ #define OGSI OsiGlpkSolverInterface /* A few defines to control execution tracing. OGSI_TRACK_SOLVERS track creation, copy, deletion of OGSI objects OGSI_TRACK_FRESH track how a solution is made stale/fresh OGSI_VERBOSITY enables warnings when > 0; probably should be converted to honest messages for message handler */ #define OGSI_TRACK_SOLVERS 0 #define OGSI_TRACK_FRESH 0 #define OGSI_VERBOSITY 0 //############################################################################# // File-local methods //############################################################################# namespace { /* Convenience routine for generating error messages. Who knows, maybe it'll get used eventually :-). */ inline void checkGLPKerror (int err, std::string glpkfuncname, std::string osimethod) { if (err != 0) { char s[100] ; sprintf(s,"%s returned error %d",glpkfuncname.c_str(),err) ; std::cout << "ERROR: " << s << " (" << osimethod << " in OsiGlpkSolverInterface)" << std::endl ; throw CoinError(s,osimethod.c_str(),"OsiGlpkSolverInterface") ; } return ; } } // end file-local namespace //############################################################################# // Solve methods //############################################################################# /* Solve an LP from scratch. */ void OGSI::initialSolve() { # if OGSI_TRACK_FRESH > 0 std::cout << "OGSI(" << std::hex << this << std::dec << ")::initialSolve." << std::endl ; # endif LPX *model = getMutableModelPtr() ; /* Prep. Toss any cached solution information. */ freeCachedData(OGSI::FREECACHED_RESULTS) ; /* Solve the lp. */ int err = lpx_simplex(model) ; // for Glpk, a solve fails if the initial basis is invalid or singular // thus, we construct a (advanced) basis first and try again #ifdef LPX_E_BADB if (err == LPX_E_BADB) { lpx_adv_basis(model); err = lpx_simplex(model) ; } else #endif if (err == LPX_E_SING || err == LPX_E_FAULT) { lpx_adv_basis(model); err = lpx_simplex(model) ; } iter_used_ = lpx_get_int_parm(model, LPX_K_ITCNT) ; /* Sort out the various state indications. When the presolver is turned on, lpx_simplex() will not be able to tell whether the objective function has hit it's upper or lower limit, and does not return OBJLL or OBJUL. The code for these cases should be beefed up to check the objective against the limit. The codes NOPFS and NODFS are returned only when the presolver is used. If we ever reach the default case, we're deeply confused. */ isIterationLimitReached_ = false ; isTimeLimitReached_ = false; isAbandoned_ = false ; isPrimInfeasible_ = false ; isDualInfeasible_ = false ; isFeasible_ = false ; isObjLowerLimitReached_ = false ; isObjUpperLimitReached_ = false ; switch (err) { case LPX_E_OK: { break ; } case LPX_E_ITLIM: { isIterationLimitReached_ = true ; break ; } case LPX_E_OBJLL: { isObjLowerLimitReached_ = true ; break ; } case LPX_E_OBJUL: { isObjUpperLimitReached_ = true ; break ; } case LPX_E_TMLIM: { isTimeLimitReached_ = true ; } // no break here, so we still report abandoned case LPX_E_FAULT: case LPX_E_SING: #ifdef LPX_E_BADB case LPX_E_BADB: #endif { isAbandoned_ = true ; break ; } case LPX_E_NOPFS: { isPrimInfeasible_ = true ; break ; } case LPX_E_NODFS: { isDualInfeasible_ = true ; break ; } default: { assert(false) ; } } switch (lpx_get_status(model)) { case LPX_OPT: case LPX_FEAS: { isFeasible_ = true ; break ; } default: { } } // Record that simplex was most recent bbWasLast_ = 0 ; return ; } //----------------------------------------------------------------------------- void OGSI::resolve() { # if OGSI_TRACK_FRESH > 0 std::cout << "OGSI(" << std::hex << this << std::dec << ")::resolve." << std::endl ; # endif LPX *model = getMutableModelPtr() ; freeCachedData(OGSI::FREECACHED_RESULTS) ; // lpx_simplex will use the current basis if possible int err = lpx_simplex(model) ; // for Glpk, a solve fails if the initial basis is invalid or singular // thus, we construct a (advanced) basis first and try again #ifdef LPX_E_BADB if (err == LPX_E_BADB) { lpx_adv_basis(model); err = lpx_simplex(model) ; } else #endif if (err == LPX_E_SING || err == LPX_E_FAULT) { lpx_adv_basis(model); err = lpx_simplex(model) ; } iter_used_ = lpx_get_int_parm(model,LPX_K_ITCNT) ; isIterationLimitReached_ = false ; isTimeLimitReached_ = false ; isAbandoned_ = false ; isObjLowerLimitReached_ = false ; isObjUpperLimitReached_ = false ; isPrimInfeasible_ = false ; isDualInfeasible_ = false ; isFeasible_ = false ; switch (err) { case LPX_E_OK: { break ; } case LPX_E_ITLIM: { isIterationLimitReached_ = true ; break ; } case LPX_E_OBJLL: { isObjLowerLimitReached_ = true ; break ; } case LPX_E_OBJUL: { isObjUpperLimitReached_ = true ; break ; } case LPX_E_TMLIM: { isTimeLimitReached_ = true ; } // no break here, so we still report abandoned case LPX_E_FAULT: case LPX_E_SING: #ifdef LPX_E_BADB case LPX_E_BADB: #endif { isAbandoned_ = true ; break ; } case LPX_E_NOPFS: { isPrimInfeasible_ = true ; break ; } case LPX_E_NODFS: { isDualInfeasible_ = true ; break ; } default: { assert(false) ; } } switch (lpx_get_status(model)) { case LPX_OPT: case LPX_FEAS: { isFeasible_ = true ; break ; } default: { } } // Record that simplex was most recent bbWasLast_ = 0 ; return ; } //----------------------------------------------------------------------------- /* Call glpk's built-in MIP solver. Any halfway recent version (from glpk 4.4, at least) will have lpx_intopt, a branch-and-cut solver. The presence of cut generators is more recent. */ void OGSI::branchAndBound () { LPX *model = getMutableModelPtr() ; /* Destroy cached data. */ freeCachedData(OGSI::FREECACHED_RESULTS) ; /* Assuming we have integer variables in the model, call the best MIP solver we can manage. lpx_intopt does not require an optimal LP solution as a starting point, so we can call it directly. lpx_integer needs an initial optimal solution to the relaxation. */ if (lpx_get_num_int(model)) { int err = LPX_E_FAULT ; # ifdef GLPK_HAS_INTOPT err = lpx_intopt(model) ; # else if (lpx_get_status(model) != LPX_OPT) { initialSolve() ; } err = lpx_integer(model) ; # endif /* We have a result. What is it? Start with a positive attitude and revise as needed. The various LPX_E_* and LPX_I_* defines are stable back as far as glpk-4.4. When we get LPX_E_OK (MIP terminated normally), we need to look more closely. LPX_I_OPT indicates a proven optimal integer solution. LPX_I_NOFEAS indicates that there is no integer feasible solution. LPX_I_UNDEF says the MIP solution is undefined. LPX_I_FEAS says that in integer feasible solution was found but not proven optimal (termination of search due to some limit is the common cause). It's not clear what to do with LPX_I_UNDEF; currently, it is not really reflected in termination status. LPX_I_FEAS is reflected by the OsiGlpk specific method isFeasible(). Various other codes are returned by lpx_intopt (lpx_integer returns a subset of these). LPX_E_NOPFS (LPX_E_NODFS) indicate no primal (dual) feasible solution; detected at the root, either by presolve or when attempting the root relaxation. LPX_E_ITLIM (LPX_E_TMLIM) indicate iteration (time) limit reached. Osi doesn't provide for time limit, so lump it in with iteration limit (an arguable choice, but seems better than the alternatives) and have extra method isTimeLimitReached(). LPX_E_SING (lp solver failed due to singular basis) is legimately characterised as abandoned. LPX_E_FAULT indicates a structural problem (problem not of class MIP, or an integer variable has a non-integer bound), which really translates into internal confusion in OsiGlpk. Previous comments expressed uncertainty about the iteration count. This should be checked at some point. -- lh, 070709 -- */ iter_used_ = lpx_get_int_parm(model,LPX_K_ITCNT) ; isIterationLimitReached_ = false ; isTimeLimitReached_ = false ; isAbandoned_ = false ; isPrimInfeasible_ = false ; isDualInfeasible_ = false ; isFeasible_ = false ; isObjLowerLimitReached_ = false ; isObjUpperLimitReached_ = false ; switch (err) { case LPX_E_OK: #ifdef LPX_E_MIPGAP case LPX_E_MIPGAP: #endif { break ; } case LPX_E_NOPFS: { isPrimInfeasible_ = true ; break ; } case LPX_E_NODFS: { isDualInfeasible_ = true ; break ; } case LPX_E_TMLIM: { isTimeLimitReached_ = true ; } // no break case LPX_E_ITLIM: { isIterationLimitReached_ = true ; break ; } case LPX_E_SING: { isAbandoned_ = true ; break ; } case LPX_E_FAULT: { assert(false) ; break ; } default: { assert(false) ; break ; } } //check this also if err!=LPX_E_OPT, so we know about feasibility in case time/resource limit is reached int mip_status = lpx_mip_status(model) ; switch (mip_status) { case LPX_I_OPT: { isFeasible_ = true ; break ; } case LPX_I_NOFEAS: { isPrimInfeasible_ = true ; break ; } case LPX_I_UNDEF: { break ; } case LPX_I_FEAS: { isFeasible_ = true ; break ; } default: { assert(false) ; break ; } } /* The final action is to note that our last call to glpk was the MIP solver. */ bbWasLast_ = 1 ; } /* Not a MIP (no integer variables). Call the LP solver. Since we can call branchAndBound with no initial LP solution, initialSolve is appropriate here. (But for glpk, it actually makes no difference --- lpx_simplex makes the decision on how to proceed.) */ else { initialSolve() ; } return ; } //############################################################################# // Parameter related methods //############################################################################# /* When we set parameters, we have to stash them locally as well as pushing them into the LPX object. The trouble comes when loading a new problem. If the LPX object is already loaded with a problem, the easiest approach is to simply delete it and start fresh. But then we lose all the parameters that are held in the LPX object. By keeping a copy, we have a way to recover. Really, we should be keeping these values in the OSI base class arrays, but the amount of storage involved is too small to provide motivation to change from the present setup. */ bool OGSI::setIntParam (OsiIntParam key, int value) { bool retval = false ; switch (key) { case OsiMaxNumIteration: { if (value >= 0) { maxIteration_ = value ; lpx_set_int_parm(lp_,LPX_K_ITLIM,value) ; retval = true ; } else { retval = false ; } break ; } case OsiMaxNumIterationHotStart: { if (value >= 0) { hotStartMaxIteration_ = value ; retval = true ; } else { retval = false ; } break ; } case OsiNameDiscipline: { if (value < 0 || value > 3) { retval = false ; } else { nameDisc_ = value ; retval = true ; } break ; } case OsiLastIntParam: { retval = false ; break ; } } return (retval) ; } //----------------------------------------------------------------------------- /* Self-protection is required here --- glpk will fault if handed a value it doesn't like. */ bool OGSI::setDblParam (OsiDblParam key, double value) { bool retval = false ; switch (key) { case OsiDualObjectiveLimit: // as of 4.7, GLPK only uses this if it does dual simplex { dualObjectiveLimit_ = value ; if (getObjSense() == 1) // minimization { lpx_set_real_parm(lp_,LPX_K_OBJUL,value) ; } else // maximization { lpx_set_real_parm(lp_,LPX_K_OBJLL,value) ; } retval = true ; break ; } case OsiPrimalObjectiveLimit: // as of 4.7, GLPK only uses this if it does dual simplex { primalObjectiveLimit_ = value ; if (getObjSense() == 1) { lpx_set_real_parm(lp_,LPX_K_OBJLL,value) ; } else { lpx_set_real_parm(lp_,LPX_K_OBJUL,value) ; } retval = true ; break ; } case OsiDualTolerance: { if (value >= 0 && value <= .001) { dualTolerance_ = value; lpx_set_real_parm(lp_,LPX_K_TOLDJ,value) ; retval = true ; } else { retval = false ; } break ; } case OsiPrimalTolerance: { if (value >= 0 && value <= .001) { primalTolerance_ = value ; lpx_set_real_parm(lp_,LPX_K_TOLBND,value) ; retval = true ; } else { retval = false ; } break ; } case OsiObjOffset: { objOffset_ = value ; lpx_set_obj_coef(lp_,0,value) ; retval = true ; break ; } case OsiLastDblParam: { retval = false ; break ; } } return (retval) ; } //----------------------------------------------------------------------------- bool OGSI::setStrParam (OsiStrParam key, const std::string &value) { bool retval = false ; switch (key) { case OsiProbName: { probName_ = value ; if (probName_.length() == 0) probName_ = "Pb"; lpx_set_prob_name(lp_,const_cast(value.c_str())) ; retval = true ; break ; } case OsiSolverName: { retval = true ; break ; } case OsiLastStrParam: { break ; } } return (retval) ; } //----------------------------------------------------------------------------- namespace { /*! A helper routine to deal with hints where glpk lacks any flexibility --- the facility is unimplemented, or always on. Failure is defined as OsiForceDo in the wrong direction; in this case an error is thrown. If the routine returns, then either the hint is compatible with glpk's capabilities, or it can be ignored. */ void unimp_hint (CoinMessageHandler *hdl, bool glpkSense, bool hintSense, OsiHintStrength hintStrength, const char *msgString) { if (glpkSense != hintSense) { std::string message = "glpk " ; if (glpkSense == true) { message += "cannot disable " ; } else { message += "does not support " ; } message += msgString ; *hdl << message << CoinMessageEol ; if (hintStrength == OsiForceDo) { throw CoinError(message,"setHintParam","OsiDylpSolverInterface") ; } } return ; } } // end file-local namespace bool OGSI::setHintParam (OsiHintParam key, bool sense, OsiHintStrength strength, void *info) /* OSI provides arrays for the sense and strength. OGSI provides the array for info. */ { bool retval = false ; CoinMessageHandler *msgHdl = messageHandler() ; /* Check for out of range. */ if (key >= OsiLastHintParam) return (false) ; /* Set the hint in the OSI structures. Unlike the other set*Param routines, setHintParam will return false for key == OsiLastHintParam. Unfortunately, it'll also throw for strength = OsiForceDo, without setting a return value. We need to catch that throw. */ try { retval = OsiSolverInterface::setHintParam(key,sense,strength) ; } catch (CoinError&) { retval = (strength == OsiForceDo) ; } if (retval == false) return (false) ; info_[key] = info ; /* Did the client say `ignore this'? Who are we to argue. */ if (strength == OsiHintIgnore) return (true) ; /* We have a valid hint which would be impolite to simply ignore. Deal with it as best we can. But say something if we're ignoring the hint. This is under construction. For the present, we don't distinguish between initial solve and resolve. */ switch (key) { case OsiDoPresolveInInitial: case OsiDoPresolveInResolve: { if (sense == false) { if (strength >= OsiHintTry) lpx_set_int_parm(lp_,LPX_K_PRESOL,0) ; } else { lpx_set_int_parm(lp_,LPX_K_PRESOL,1) ; } retval = true ; break ; } case OsiDoDualInInitial: case OsiDoDualInResolve: { unimp_hint(msgHdl,false,sense,strength,"exclusive use of dual simplex") ; if (sense == false) { if (strength >= OsiHintDo) lpx_set_int_parm(lp_,LPX_K_DUAL,0) ; } else { lpx_set_int_parm(lp_,LPX_K_DUAL,1) ; } retval = true ; break ; } case OsiDoCrash: { unimp_hint(msgHdl,false,sense,strength,"basis crash") ; retval = true ; break ; } case OsiDoInBranchAndCut: { unimp_hint(msgHdl,false,sense,strength,"do in branch and cut") ; retval = true ; break ; } /* 0 is no scaling, 3 is geometric mean followed by equilibration. */ case OsiDoScale: { if (sense == false) { if (strength >= OsiHintTry) lpx_set_int_parm(lp_,LPX_K_SCALE,0) ; } else { lpx_set_int_parm(lp_,LPX_K_SCALE,3) ; } retval = true ; break ; } /* Glpk supports four levels, 0 (no output), 1 (errors only), 2 (normal), and 3 (normal plus informational). */ case OsiDoReducePrint: { if (sense == true) { if (strength <= OsiHintTry) { lpx_set_int_parm(lp_,LPX_K_MSGLEV,1) ; } else { lpx_set_int_parm(lp_,LPX_K_MSGLEV,0) ; } } else { if (strength <= OsiHintTry) { lpx_set_int_parm(lp_,LPX_K_MSGLEV,2) ; } else { lpx_set_int_parm(lp_,LPX_K_MSGLEV,3) ; } } int logLevel = lpx_get_int_parm(lp_,LPX_K_MSGLEV) ; messageHandler()->setLogLevel(logLevel) ; retval = true ; break ; } /* The OSI spec says that unimplemented options (and, by implication, hints) should return false. In the case of a hint, however, we can ignore anything except OsiForceDo, so usability says we should anticipate new hints and set this up so the solver doesn't break. So return true. */ default: { unimp_hint(msgHdl,!sense,sense,strength,"unrecognized hint") ; retval = true ; break ; } } return (retval) ; } //----------------------------------------------------------------------------- bool OGSI::getIntParam( OsiIntParam key, int& value ) const { bool retval = false; switch( key ) { case OsiMaxNumIteration: value = maxIteration_; retval = true; break; case OsiMaxNumIterationHotStart: value = hotStartMaxIteration_; retval = true; break; case OsiNameDiscipline: value = nameDisc_; retval = true; break; case OsiLastIntParam: retval = false; break; } return retval; } //----------------------------------------------------------------------------- bool OGSI::getDblParam( OsiDblParam key, double& value ) const { bool retval = false; switch( key ) { case OsiDualObjectiveLimit: value = dualObjectiveLimit_; retval = true; break; case OsiPrimalObjectiveLimit: value = primalObjectiveLimit_; retval = true; break; case OsiDualTolerance: value = dualTolerance_; retval = true; break; case OsiPrimalTolerance: value = primalTolerance_; retval = true; break; case OsiObjOffset: value = lpx_get_obj_coef(getMutableModelPtr(),0); retval = true; break; case OsiLastDblParam: retval = false; break; } return retval; } bool OGSI::getStrParam(OsiStrParam key, std::string & value) const { // bool retval = false; switch (key) { case OsiProbName: value = lpx_get_prob_name( getMutableModelPtr() ); break; case OsiSolverName: value = "glpk"; break; case OsiLastStrParam: return false; } return true; } //############################################################################# // Methods returning info on how the solution process terminated //############################################################################# bool OGSI::isAbandoned() const { return isAbandoned_; } bool OGSI::isProvenOptimal() const { LPX *model = getMutableModelPtr(); if( bbWasLast_ == 0 ) { int stat = lpx_get_status( model ); return stat == LPX_OPT; } else { int stat = lpx_mip_status( model ); return stat == LPX_I_OPT; } } bool OGSI::isProvenPrimalInfeasible() const { LPX *model = getMutableModelPtr(); if(isPrimInfeasible_==true) return true; if( bbWasLast_ == 0 ) return lpx_get_prim_stat( model ) == LPX_P_NOFEAS; else return lpx_mip_status( model ) == LPX_I_NOFEAS; } bool OGSI::isProvenDualInfeasible() const { LPX *model = getMutableModelPtr(); if(isDualInfeasible_==true) return true; if( bbWasLast_ == 0 ) return lpx_get_dual_stat( model ) == LPX_D_NOFEAS; else // Not sure what to do for MIPs; does it just mean unbounded? // ??? for now, return false return false; } /* This should return true if the solver stopped on the primal limit, or if the current objective is better than the primal limit. getObjSense == 1 is minimisation, -1 is maximisation. */ bool OGSI::isPrimalObjectiveLimitReached() const { bool retval = false ; double obj = getObjValue() ; double objlim ; getDblParam(OsiPrimalObjectiveLimit,objlim) ; if (getObjSense() == 1) { if (isObjLowerLimitReached_ || obj < objlim) { retval = true ; } } else { if (isObjUpperLimitReached_ || obj > objlim) { retval = true ; } } return (retval) ; } /* This should return true if the solver stopped on the dual limit, or if the current objective is worse than the dual limit. */ bool OGSI::isDualObjectiveLimitReached() const { bool retval = false ; double obj = getObjValue() ; double objlim ; getDblParam(OsiDualObjectiveLimit,objlim) ; if (getObjSense() == 1) { if (isObjUpperLimitReached_ || obj > objlim) { retval = true ; } } else { if (isObjLowerLimitReached_ || obj < objlim) { retval = true ; } } return (retval) ; } bool OGSI::isIterationLimitReached() const { return isIterationLimitReached_; } bool OGSI::isTimeLimitReached() const { return isTimeLimitReached_; } bool OGSI::isFeasible() const { return isFeasible_; } //############################################################################# // WarmStart related methods //############################################################################# /* Return a warm start object matching the current state of the solver. Nonbasic fixed variables (LPX_NS) are translated to CWSB::atLowerBound. */ CoinWarmStart *OGSI::getWarmStart() const { /* Create an empty basis and size it to the correct dimensions. */ CoinWarmStartBasis *ws = new CoinWarmStartBasis() ; int numcols = getNumCols() ; int numrows = getNumRows() ; ws->setSize(numcols,numrows) ; /* Walk the rows. Retrieve the status information from the glpk model and store it in the CWSB object. The convention in Osi regarding the status of a row when on bounds is different from Glpk. Thus, Glpk's at-lower-bound will be mapped to Osi's at-upper-bound and Glpk's at-upper-bound will be mapped to Osi's at-lower-bound. */ for (int i = 0 ; i < numrows ; i++) { int stati = lpx_get_row_stat(lp_,i+1) ; switch (stati) { case LPX_BS: { ws->setArtifStatus(i,CoinWarmStartBasis::basic) ; break ; } case LPX_NS: case LPX_NL: { ws->setArtifStatus(i,CoinWarmStartBasis::atUpperBound) ; break ; } case LPX_NU: { ws->setArtifStatus(i,CoinWarmStartBasis::atLowerBound) ; break ; } case LPX_NF: { ws->setArtifStatus(i,CoinWarmStartBasis::isFree) ; break ; } default: { assert(false) ; break ; } } } /* And repeat for the columns. */ for (int j = 0 ; j < numcols ; j++) { int statj = lpx_get_col_stat(lp_,j+1) ; switch (statj) { case LPX_BS: { ws->setStructStatus(j,CoinWarmStartBasis::basic) ; break ; } case LPX_NS: case LPX_NL: { ws->setStructStatus(j,CoinWarmStartBasis::atLowerBound) ; break ; } case LPX_NU: { ws->setStructStatus(j,CoinWarmStartBasis::atUpperBound) ; break ; } case LPX_NF: { ws->setStructStatus(j,CoinWarmStartBasis::isFree) ; break ; } default: { assert(false) ; break ; } } } return (ws) ; } //----------------------------------------------------------------------------- /* Set the given warm start information in the solver. By definition, a null warmstart parameter is interpreted as `refresh warm start information from the solver.' Since OGSI does not cache warm start information, no action is required. The convention in Osi regarding the status of a row when on bounds is different from Glpk. Thus, Osi's at-upper-bound will be mapped to Glpk's at-lower-bound and Osi's at-lower-bound will be mapped to Glpk's at-upper-bound. */ bool OGSI::setWarmStart (const CoinWarmStart* warmstart) { /* If this is a simple refresh request, we're done. */ if (warmstart == 0) { return (true) ; } /* Check that the parameter is a CWSB of the appropriate size. */ const CoinWarmStartBasis *ws = dynamic_cast(warmstart) ; if (ws == 0) { return false ; } int numcols = ws->getNumStructural() ; int numrows = ws->getNumArtificial() ; if (numcols != getNumCols() || numrows != getNumRows()) { return (false) ; } /* Looks like a basis. Translate to the appropriate codes for glpk and install. Row status first (logical/artificial variables), then column status (architectural variables). */ for (int i = 0 ; i < numrows ; i++) { int stati ; switch (ws->getArtifStatus(i)) { case CoinWarmStartBasis::basic: { stati = LPX_BS ; break ; } case CoinWarmStartBasis::atLowerBound: { stati = LPX_NU ; break ; } case CoinWarmStartBasis::atUpperBound: { stati = LPX_NL ; break ; } case CoinWarmStartBasis::isFree: { stati = LPX_NF ; break ; } default: { assert(false) ; return (false) ; } } lpx_set_row_stat(lp_,i+1,stati) ; } for (int j = 0 ; j < numcols ; j++) { int statj ; switch (ws->getStructStatus(j)) { case CoinWarmStartBasis::basic: { statj = LPX_BS ; break ; } case CoinWarmStartBasis::atLowerBound: { statj = LPX_NL ; break ; } case CoinWarmStartBasis::atUpperBound: { statj = LPX_NU ; break ; } case CoinWarmStartBasis::isFree: { statj = LPX_NF ; break ; } default: { assert(false) ; return (false) ; } } lpx_set_col_stat(lp_,j+1,statj) ; } return (true) ; } //############################################################################# // Hotstart related methods (primarily used in strong branching) //############################################################################# void OGSI::markHotStart() { LPX *model = getMutableModelPtr(); int numcols, numrows; numcols = getNumCols(); numrows = getNumRows(); if( numcols > hotStartCStatSize_ ) { delete[] hotStartCStat_; delete [] hotStartCVal_; delete [] hotStartCDualVal_; hotStartCStatSize_ = static_cast( 1.2 * static_cast( numcols ) ); // get some extra space for future hot starts hotStartCStat_ = new int[hotStartCStatSize_]; hotStartCVal_ = new double[hotStartCStatSize_]; hotStartCDualVal_ = new double[hotStartCStatSize_]; } int j; for( j = 0; j < numcols; j++ ) { int stat; double val; double dualVal; stat=lpx_get_col_stat(model,j); val=lpx_get_col_prim(model,j); dualVal=lpx_get_col_dual(model,j); hotStartCStat_[j] = stat; hotStartCVal_[j] = val; hotStartCDualVal_[j] = dualVal; } if( numrows > hotStartRStatSize_ ) { delete [] hotStartRStat_; delete [] hotStartRVal_; delete [] hotStartRDualVal_; hotStartRStatSize_ = static_cast( 1.2 * static_cast( numrows ) ); // get some extra space for future hot starts hotStartRStat_ = new int[hotStartRStatSize_]; hotStartRVal_ = new double[hotStartRStatSize_]; hotStartRDualVal_ = new double[hotStartRStatSize_]; } int i; for( i = 0; i < numrows; i++ ) { int stat; double val; double dualVal; stat=lpx_get_row_stat(model,i+1); val=lpx_get_row_prim(model,i+1); dualVal=lpx_get_row_dual(model,i+1); hotStartRStat_[i] = stat; hotStartRVal_[i] = val; hotStartRDualVal_[i] = dualVal; } } //----------------------------------------------------------------------------- void OGSI::solveFromHotStart() { # if OGSI_TRACK_FRESH > 0 std::cout << "OGSI(" << std::hex << this << std::dec << ")::solveFromHotStart." << std::endl ; # endif LPX *model = getMutableModelPtr(); int numcols, numrows; numcols = getNumCols(); numrows = getNumRows(); assert( numcols <= hotStartCStatSize_ ); assert( numrows <= hotStartRStatSize_ ); int j; for( j = 0; j < numcols; j++ ) { lpx_set_col_stat( model, j+1, hotStartCStat_[j]); } int i; for( i = 0; i < numrows; i++ ) { lpx_set_row_stat( model, i+1, hotStartRStat_[i]); } freeCachedData( OGSI::FREECACHED_RESULTS ); int maxIteration = maxIteration_; maxIteration_ = hotStartMaxIteration_; resolve(); maxIteration_ = maxIteration; } //----------------------------------------------------------------------------- void OGSI::unmarkHotStart() { // ??? be lazy with deallocating memory and do nothing here, deallocate memory in the destructor. } //############################################################################# // Problem information methods (original data) //############################################################################# //----------------------------------------------------------------------------- // Get number of rows, columns, elements, ... //----------------------------------------------------------------------------- int OGSI::getNumCols() const { return lpx_get_num_cols( getMutableModelPtr() ); } int OGSI::getNumRows() const { return lpx_get_num_rows( getMutableModelPtr() ); } int OGSI::getNumElements() const { return lpx_get_num_nz( getMutableModelPtr() ); } //----------------------------------------------------------------------------- // Get pointer to rim vectors //------------------------------------------------------------------ const double * OGSI::getColLower() const { LPX *model = getMutableModelPtr(); if( collower_ == NULL ) { assert( colupper_ == NULL ); int numcols = getNumCols(); if( numcols > 0 ) { collower_ = new double[numcols]; colupper_ = new double[numcols]; } double inf = getInfinity(); int i; for( i = 0; i < numcols; i++) { int type; double lb; double ub; type=lpx_get_col_type(model,i+1); lb=lpx_get_col_lb(model,i+1); ub=lpx_get_col_ub(model,i+1); switch ( type ) { case LPX_FR: lb = -inf; ub = inf; break; case LPX_LO: ub = inf; break; case LPX_UP: lb = -inf; break; case LPX_FX: case LPX_DB: break; default: assert( false ); break; } collower_[i] = lb; colupper_[i] = ub; } } return collower_; } //----------------------------------------------------------------------------- const double * OGSI::getColUpper() const { if( colupper_ == NULL ) { getColLower(); //assert( colupper_ != NULL ); // Could be null if no columns. } return colupper_; } //----------------------------------------------------------------------------- const char * OGSI::getRowSense() const { // Could be in OsiSolverInterfaceImpl. if( rowsense_ == NULL ) { assert( rhs_ == NULL && rowrange_ == NULL ); int numrows = getNumRows(); if( numrows > 0 ) { rowsense_ = new char[numrows]; rhs_ = new double[numrows]; rowrange_ = new double[numrows]; } const double *rowlower = getRowLower(); const double *rowupper = getRowUpper(); int i; for( i = 0; i < numrows; i++ ) { char sense; double right; double range; convertBoundToSense( rowlower[i], rowupper[i], sense, right, range ); rowsense_[i] = sense; rhs_[i] = right; rowrange_[i] = range; } } return rowsense_; } //----------------------------------------------------------------------------- const double * OGSI::getRightHandSide() const { if( rhs_ == NULL ) { getRowSense(); //assert( rhs_ != NULL ); // Could be null if no rows. } return rhs_; } //----------------------------------------------------------------------------- const double * OGSI::getRowRange() const { if( rowrange_ == NULL ) { getRowSense(); //assert( rowrange_ != NULL ); // Could be null if no rows. } return rowrange_; } //----------------------------------------------------------------------------- const double * OGSI::getRowLower() const { LPX *model = getMutableModelPtr(); if( rowlower_ == NULL ) { assert( rowupper_ == NULL ); int numrows = getNumRows(); if( numrows > 0 ) { rowlower_ = new double[numrows]; rowupper_ = new double[numrows]; } int i; for( i = 0; i < numrows; i++ ) { double inf = getInfinity(); int type; double lb; double ub; type=lpx_get_row_type(model,i+1); lb=lpx_get_row_lb(model,i+1); ub=lpx_get_row_ub(model,i+1); switch( type ) { case LPX_FR: lb = -inf; ub = inf; break; case LPX_LO: ub = inf; break; case LPX_UP: lb = -inf; break; case LPX_DB: case LPX_FX: break; default: assert( false ); break; } rowlower_[i] = lb; rowupper_[i] = ub; } } return rowlower_; } //----------------------------------------------------------------------------- const double * OGSI::getRowUpper() const { if( rowupper_ == NULL ) { getRowLower(); //assert( rowupper_ != NULL ); // Could be null if no rows. } return rowupper_; } //----------------------------------------------------------------------------- const double * OGSI::getObjCoefficients() const { if( obj_ == NULL ) { LPX *model = getMutableModelPtr(); int numcols = getNumCols(); if( numcols > 0 ) { obj_ = new double[numcols]; } int i; for( i = 0; i < numcols; i++ ) { obj_[i] = lpx_get_obj_coef( model, i + 1); } } return obj_; } //----------------------------------------------------------------------------- double OGSI::getObjSense() const { if (lpx_get_obj_dir(lp_) == LPX_MIN) { return (+1.0) ; } else if (lpx_get_obj_dir(lp_) == LPX_MAX) { return (-1.0) ; } else // internal confusion { assert(false) ; return (0) ; } } //----------------------------------------------------------------------------- // Return information on integrality //----------------------------------------------------------------------------- bool OGSI::isContinuous( int colNumber ) const { return lpx_get_col_kind( getMutableModelPtr(), colNumber+1 ) == LPX_CV; } //----------------------------------------------------------------------------- // Row and column copies of the matrix ... //----------------------------------------------------------------------------- const CoinPackedMatrix * OGSI::getMatrixByRow() const { if( matrixByRow_ == NULL ) { LPX *model = getMutableModelPtr(); matrixByRow_ = new CoinPackedMatrix(); matrixByRow_->transpose(); // converts to row-order matrixByRow_->setDimensions( 0, getNumCols() ); int numcols = getNumCols(); int *colind = new int[numcols+1]; double *colelem = new double[numcols+1]; int i; for( i = 0; i < getNumRows(); i++ ) { int colsize = lpx_get_mat_row( model, i+1, colind, colelem); int j; for( j = 1; j <= colsize; j++ ) { --colind[j]; } // Note: lpx_get_mat_row apparently may return the // elements in decreasing order. This differs from // people's standard expectations but is not an error. matrixByRow_->appendRow( colsize, colind+1, colelem+1 ); } delete [] colind; delete [] colelem; if( numcols ) matrixByRow_->removeGaps(); } return matrixByRow_; } //----------------------------------------------------------------------------- const CoinPackedMatrix * OGSI::getMatrixByCol() const { if( matrixByCol_ == NULL ) { LPX *model = getMutableModelPtr(); matrixByCol_ = new CoinPackedMatrix(); matrixByCol_->setDimensions( getNumRows(), 0 ); int numrows = getNumRows(); int *rowind = new int[numrows+1]; double *rowelem = new double[numrows+1]; int j; for( j = 0; j < getNumCols(); j++ ) { int rowsize = lpx_get_mat_col( model, j+1, rowind, rowelem); int i; for( i = 1; i <= rowsize; i++ ) { --rowind[i]; } matrixByCol_->appendCol( rowsize, rowind+1, rowelem+1 ); } delete [] rowind; delete [] rowelem; if( numrows ) matrixByCol_->removeGaps(); } return matrixByCol_; } //----------------------------------------------------------------------------- // Get solver's value for infinity //----------------------------------------------------------------------------- double OGSI::getInfinity() const { return (CoinInfinity) ; } //############################################################################# // Problem information methods (results) //############################################################################# /* Retrieve column solution, querying solver if we don't have a cached solution. Refresh reduced costs while we're here. Reduced costs may or may not already exist (user can create a reduced cost vector by supplying duals (row price) and asking for reduced costs). Appropriate calls depend on whether last call to solver was simplex or branch-and-bound. */ const double *OGSI::getColSolution() const { /* Use the cached solution vector, if present. If we have no constraint system, return 0. */ if (colsol_ != 0) { return (colsol_) ; } int numcols = getNumCols() ; if (numcols == 0) { return (0) ; } colsol_ = new double[numcols] ; if (redcost_ != 0) delete [] redcost_ ; { redcost_ = new double[numcols] ; } /* Grab the problem status. */ int probStatus ; if (bbWasLast_) { probStatus = lpx_mip_status(lp_) ; } else { probStatus = lpx_get_status(lp_) ; } /* If the problem hasn't been solved, glpk returns zeros, but OSI requires that the solution be within bound. getColLower() will ensure both upper and lower bounds are present. There's an implicit assumption that we're feasible (i.e., collower[j] < colupper[j]). Solution values will be 0.0 unless that's outside the bounds. */ if (probStatus == LPX_UNDEF || probStatus == LPX_I_UNDEF) { getColLower() ; int j ; for (j = 0 ; j < numcols ; j++) { colsol_[j] = 0.0 ; if (collower_[j] > 0.0) { colsol_[j] = collower_[j] ; } else if (colupper_[j] < 0.0) { colsol_[j] = colupper_[j] ; } } } /* We should have a defined solution. For simplex, refresh the reduced costs as well as the primal solution. Remove infinitesimals from the results. */ else if (bbWasLast_ == 0) { int j ; for (j = 0 ; j < numcols ; j++) { colsol_[j] = lpx_get_col_prim(lp_,j+1) ; if (fabs(colsol_[j]) < GlpkZeroTol) { colsol_[j] = 0.0 ; } redcost_[j] = lpx_get_col_dual(lp_,j+1) ; if (fabs(redcost_[j]) < GlpkZeroTol) { redcost_[j] = 0.0 ; } } } /* Last solve was branch-and-bound. Set the reduced costs to 0. Remove infinitesimals from the results. */ else { int j ; for (j = 0 ; j < numcols ; j++) { colsol_[j] = lpx_mip_col_val(lp_,j+1) ; if (fabs(colsol_[j]) < GlpkZeroTol) { colsol_[j] = 0.0 ; } redcost_[j] = 0.0 ; } } return (colsol_) ; } //----------------------------------------------------------------------------- /* Acquire the row solution (dual variables). The user can set this independently, so use the cached copy if it's present. */ const double *OGSI::getRowPrice() const { /* If we have a cached solution, use it. If the constraint system is empty, return 0. Otherwise, allocate a new vector. */ if (rowsol_ != 0) { return (rowsol_) ; } int numrows = getNumRows() ; if (numrows == 0) { return (0) ; } rowsol_ = new double[numrows] ; /* For simplex, we have dual variables. For MIP, just set them to zero. Remove infinitesimals from the results. */ if (bbWasLast_ == 0) { int i ; for (i = 0 ; i < numrows; i++) { rowsol_[i] = lpx_get_row_dual(lp_,i+1) ; if (fabs(rowsol_[i]) < GlpkZeroTol) { rowsol_[i] = 0.0 ; } } } else { int i ; for (i = 0 ; i < numrows ; i++) { rowsol_[i] = 0 ; } } return (rowsol_) ; } //----------------------------------------------------------------------------- /* It's tempting to dive into glpk for this, but ... the client may have used setRowPrice(), and it'd be nice to return reduced costs that agree with the duals. To use glpk's routine (lpx_get_col_dual), the interface needs to track the origin of the dual (row price) values. */ const double * OGSI::getReducedCost() const { /* Return the cached copy, if it exists. */ if (redcost_ != 0) { return (redcost_) ; } /* We need to calculate. Make sure we have a constraint system, then allocate a vector and initialise it with the objective coefficients. */ int n = getNumCols() ; if (n == 0) { return (0) ; } redcost_ = new double[n] ; CoinDisjointCopyN(getObjCoefficients(),n,redcost_) ; /* Try and acquire dual variables. */ const double *y = getRowPrice() ; if (!y) { return (redcost_) ; } /* Acquire the constraint matrix and calculate y*A. */ const CoinPackedMatrix *mtx = getMatrixByCol() ; double *yA = new double[n] ; mtx->transposeTimes(y,yA) ; /* Calculate c-yA and remove infinitesimals from the result. */ for (int j = 0 ; j < n ; j++) { redcost_[j] -= yA[j] ; if (fabs(redcost_[j]) < GlpkZeroTol) { redcost_[j] = 0 ; } } delete[] yA ; return (redcost_) ; } //----------------------------------------------------------------------------- /* As with getReducedCost, we need to be mindful that the primal solution may have been set by the client. As it happens, however, glpk has no equivalent routine, so there's no temptation to resist. */ const double *OGSI::getRowActivity() const { /* Return the cached copy, if it exists. */ if (rowact_) { return (rowact_) ; } /* We need to calculate. Make sure we have a constraint system, then allocate a vector and initialise it with the objective coefficients. */ int m = getNumRows() ; if (m == 0) { return (0) ; } rowact_ = new double[m] ; /* Acquire primal variables. */ const double *x = getColSolution() ; if (!x) { CoinZeroN(rowact_,m) ; return (rowact_) ; } /* Acquire the constraint matrix and calculate A*x. */ const CoinPackedMatrix *mtx = getMatrixByRow() ; mtx->times(x,rowact_) ; /* Remove infinitesimals from the result. */ for (int i = 0 ; i < m ; i++) { if (fabs(rowact_[i]) < GlpkZeroTol) { rowact_[i] = 0 ; } } return (rowact_) ; } //----------------------------------------------------------------------------- double OGSI::getObjValue() const { return OsiSolverInterface::getObjValue(); } //----------------------------------------------------------------------------- int OGSI::getIterationCount() const { return iter_used_; } //----------------------------------------------------------------------------- std::vector OGSI::getDualRays(int /*maxNumRays*/, bool /*fullRay*/) const { // ??? not yet implemented. throw CoinError("method is not yet implemented", "getDualRays", "OsiGlpkSolverInterface"); return std::vector(); } //----------------------------------------------------------------------------- std::vector OGSI::getPrimalRays(int /*maxNumRays*/) const { // ??? not yet implemented. throw CoinError("method is not yet implemented", "getPrimalRays", "OsiGlpkSolverInterface"); return std::vector(); } //############################################################################# // Problem modifying methods (rim vectors) //############################################################################# /* Yes, I know the OSI spec says that pointers returned by get*() routines are valid only as long as the data is unchanged. But in practice, client code (in particular, portions of Cgl and Cbc) expects that simple changes to rim vector values will not invalidate pointers returned by the various get*() routines. So, for example, modifying an objective coefficient should not free the cached copies of the objective and column bounds. They should be updated on-the-fly. This is exactly the opposite of the original OsiGlpk design, hence this warning. Beyond that, it's helpful for an OSI to hold on to the current solution as long as possible. So, for example, a bounds change that does not make the current solution infeasible should not trash the cached solution. -- lh, 070326 */ void OGSI::setObjCoeff (int j, double cj) { assert(j >= 0 && j < getNumCols()) ; /* Remove the solution. Arguably the only thing that we should remove here is the cached reduced cost. */ freeCachedData(OGSI::KEEPCACHED_PROBLEM) ; /* Push the changed objective down to glpk. */ lpx_set_obj_coef(lp_,j+1,cj) ; if (obj_) { obj_[j] = cj ; } return ; } //----------------------------------------------------------------------------- void OGSI::setColLower (int j, double lbj) { /* Get the upper bound, so we can call setColBounds. glpk reports 0 for an infinite bound, so we need to check the status and possibly correct. */ double inf = getInfinity() ; int type = lpx_get_col_type(lp_,j+1) ; double ubj = lpx_get_col_ub(lp_,j+1) ; switch (type) { case LPX_UP: case LPX_DB: case LPX_FX: { break ; } case LPX_FR: case LPX_LO: { ubj = inf ; break ; } default: { assert (false) ; } } # if OGSI_TRACK_FRESH > 0 /* Check if this bound really invalidates the current solution. This check will give false positives because OsiGlpk needs a notion of `valid solution from solver'. getColSolution will always return something, even if it has to make it up on the spot. */ { const double *x = getColSolution() ; if (x) { if (x[j] < lbj-GlpkZeroTol) { std::cout << "OGSI(" << std::hex << this << std::dec << ")::setColLower: new bound " << lbj << " exceeds current value " << x[j] << " by " << (lbj-x[j]) << "." << std::endl ; } } } # endif setColBounds(j,lbj,ubj) ; return ; } //----------------------------------------------------------------------------- void OGSI::setColUpper (int j, double ubj) { /* Get the lower bound, so we can call setColBounds. glpk reports 0 for an infinite bound, so we need to check the status and possibly correct. */ double inf = getInfinity() ; int type = lpx_get_col_type(lp_,j+1) ; double lbj = lpx_get_col_lb(lp_,j+1) ; switch (type) { case LPX_LO: case LPX_DB: case LPX_FX: { break ; } case LPX_FR: case LPX_UP: { lbj = inf ; break ; } default: { assert (false) ; } } # if OGSI_TRACK_FRESH > 0 /* Check if this bound really invalidates the current solution. This check will give false positives because OsiGlpk needs a notion of `valid solution from solver'. getColSolution will always return something, even if it has to make it up on the spot. */ { const double *x = getColSolution() ; if (x) { if (x[j] > ubj+GlpkZeroTol) { std::cout << "OGSI(" << std::hex << this << std::dec << ")::setColUpper: new bound " << ubj << " exceeds current value " << x[j] << " by " << (x[j]-ubj) << "." << std::endl ; } } } # endif setColBounds(j,lbj,ubj) ; return ; } //----------------------------------------------------------------------------- /* Yes, in theory, we shouldn't need to worry about maintaining those cached column bounds over changes to the problem. See the note at the top of this section. */ void OGSI::setColBounds (int j, double lower, double upper) { assert(j >= 0 && j < getNumCols()) ; /* Free only the cached solution. Keep the cached structural variables. */ freeCachedData(OGSI::KEEPCACHED_PROBLEM) ; /* Figure out what type we should use for glpk. */ double inf = getInfinity() ; int type ; if (lower == upper) { type = LPX_FX ; } else if (lower > -inf && upper < inf) { type = LPX_DB ; } else if (lower > -inf) { type = LPX_LO ; } else if (upper < inf) { type = LPX_UP ; } else { type = LPX_FR ; } /* Push the bound change down into the solver. 1-based addressing. */ int statj = lpx_get_col_stat(lp_,j+1) ; lpx_set_col_bnds(lp_,j+1,type,lower,upper) ; lpx_set_col_stat(lp_,j+1,statj) ; statj = lpx_get_col_stat(lp_,j+1) ; /* Correct the cached upper and lower bound vectors, if present. */ if (collower_) { collower_[j] = lower ; } if (colupper_) { colupper_[j] = upper ; } return ; } //----------------------------------------------------------------------------- void OGSI::setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { OsiSolverInterface::setColSetBounds( indexFirst, indexLast, boundList ); } //----------------------------------------------------------------------------- void OGSI::setRowLower( int elementIndex, double elementValue ) { // Could be in OsiSolverInterfaceImpl. double inf = getInfinity(); int type; double lb; double ub; type=lpx_get_row_type(getMutableModelPtr(),elementIndex+1); ub=lpx_get_row_ub(getMutableModelPtr(),elementIndex+1); lb = elementValue; switch( type ) { case LPX_UP: case LPX_DB: case LPX_FX: break; case LPX_FR: case LPX_LO: ub = inf; break; default: assert( false ); } setRowBounds( elementIndex, lb, ub ); } //----------------------------------------------------------------------------- void OGSI::setRowUpper( int elementIndex, double elementValue ) { // Could be in OsiSolverInterfaceImpl. double inf = getInfinity(); int type; double lb; double ub; type=lpx_get_row_type(getMutableModelPtr(),elementIndex+1); lb=lpx_get_row_lb(getMutableModelPtr(),elementIndex+1); ub = elementValue; switch( type ) { case LPX_LO: case LPX_DB: case LPX_FX: break; case LPX_FR: case LPX_UP: lb = -inf; break; default: assert( false ); } setRowBounds( elementIndex, lb, ub ); } //----------------------------------------------------------------------------- /* As with setColBounds, just changing the bounds should not invalidate the current rim vectors. */ void OGSI::setRowBounds (int i, double lower, double upper) { /* Free only the row and column solution, keep the cached structural vectors. */ freeCachedData(OGSI::KEEPCACHED_PROBLEM) ; /* Figure out the correct row type for glpk and push the change down into the solver. 1-based addressing. */ double inf = getInfinity() ; int type ; if( lower == upper) { type = LPX_FX ; } else if (lower > -inf && upper < inf) { type = LPX_DB ; } else if (lower > -inf) { type = LPX_LO ; } else if (upper < inf) { type = LPX_UP ; } else { type = LPX_FR ; } lpx_set_row_bnds(lp_,i+1,type,lower,upper) ; /* Update cached vectors, if they exist. */ if (rowlower_) { rowlower_[i] = lower ; } if (rowupper_) { rowupper_[i] = upper ; } return ; } //----------------------------------------------------------------------------- void OGSI::setRowType(int elementIndex, char sense, double rightHandSide, double range) { // Could be in OsiSolverInterfaceImpl. double lower = 0.0 ; double upper = 0.0 ; convertSenseToBound( sense, rightHandSide, range, lower, upper ); setRowBounds( elementIndex, lower, upper ); } //----------------------------------------------------------------------------- void OGSI::setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { // Could be in OsiSolverInterface (should'nt be implemeted at here). OsiSolverInterface::setRowSetBounds( indexFirst, indexLast, boundList ); } //----------------------------------------------------------------------------- void OGSI::setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList) { // Could be in OsiSolverInterface (should'nt be implemeted at here). OsiSolverInterface::setRowSetTypes( indexFirst, indexLast, senseList, rhsList, rangeList ); } //############################################################################# void OGSI::setContinuous(int index) { LPX *model = getMutableModelPtr(); freeCachedData( OGSI::FREECACHED_COLUMN ); lpx_set_col_kind( model, index+1, LPX_CV ); } //----------------------------------------------------------------------------- void OGSI::setInteger (int index) { LPX *model = getMutableModelPtr() ; freeCachedData(OGSI::FREECACHED_COLUMN) ; lpx_set_col_kind(model,index+1,LPX_IV) ; /* Temporary hack to correct upper bounds on general integer variables. CoinMpsIO insists on forcing a bound of 1e30 for general integer variables with no upper bound. This causes several cut generators (MIR, MIR2) to fail. Put the bound back to infinity. -- lh, 070530 -- double uj = getColUpper()[index] ; if (uj >= 1e30) { setColUpper(index,getInfinity()) ; } */ return ; } //----------------------------------------------------------------------------- void OGSI::setContinuous(const int* indices, int len) { // Could be in OsiSolverInterfaceImpl. int i; for( i = 0; i < len; i++ ) { setContinuous( indices[i] ); } } //----------------------------------------------------------------------------- void OGSI::setInteger(const int* indices, int len) { // Could be in OsiSolverInterfaceImpl. int i; for( i = 0; i < len; i++ ) { setInteger( indices[i] ); } } //############################################################################# /* Opt for the natural sense (minimisation) unless the user is clear that maximisation is what's desired. */ void OGSI::setObjSense(double s) { freeCachedData(OGSI::FREECACHED_RESULTS) ; if (s <= -1.0) { lpx_set_obj_dir(lp_,LPX_MAX) ; } else { lpx_set_obj_dir(lp_,LPX_MIN) ; } return ; } //----------------------------------------------------------------------------- void OGSI::setColSolution(const double * cs) { // You probably don't want to use this function. You probably want // setWarmStart instead. // This implementation changes the cached information, // BUT DOES NOT TELL GLPK about the changes. In that sense, it's not // really useful. It is added to conform to current OSI expectations. // Other results (such as row prices) might not make sense with this // new solution, but we can't free all the results we have, since the // row prices may have already been set with setRowPrice. if (cs == 0) delete [] colsol_; else { int nc = getNumCols(); if (colsol_ == 0) colsol_ = new double[nc]; // Copy in new col solution. CoinDisjointCopyN( cs, nc, colsol_ ); } } //----------------------------------------------------------------------------- void OGSI::setRowPrice(const double * rs) { // You probably don't want to use this function. You probably want // setWarmStart instead. // This implementation changes the cached information, // BUT DOES NOT TELL GLPK about the changes. In that sense, it's not // really useful. It is added to conform to current OSI expectations. // Other results (such as column solutions) might not make sense with this // new solution, but we can't free all the results we have, since the // column solutions may have already been set with setColSolution. if (rs == 0) delete [] rowsol_; else { int nr = getNumRows(); if (rowsol_ == 0) rowsol_ = new double[nr]; // Copy in new col solution. CoinDisjointCopyN( rs, nr, rowsol_ ); } } //############################################################################# // Problem modifying methods (matrix) //############################################################################# void OGSI::addCol (const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) { // Note: GLPK expects only non-zero coefficients will be given in // lpx_set_mat_col and will abort if there are any zeros. So any // zeros must be removed prior to calling lpx_set_mat_col. LPX *model = getMutableModelPtr(); freeCachedData(OGSI::KEEPCACHED_ROW); lpx_add_cols( model, 1 ); int numcols = getNumCols(); setColBounds( numcols-1, collb, colub ); setObjCoeff( numcols-1, obj ); int i; // For GLPK, we don't want the arrays to start at 0 // We also need to weed out any 0.0 coefficients const int *indices = vec.getIndices(); const double *elements = vec.getElements(); int numrows = getNumRows(); int *indices_adj = new int[1+vec.getNumElements()]; double *elements_adj = new double[1+vec.getNumElements()]; int count = 0; for( i = 0; i < vec.getNumElements(); i++ ) { if (elements[i] != 0.0) { if ( indices[i]+1 > numrows ) { lpx_add_rows( model, indices[i]+1 - numrows ); numrows = indices[i]+1; // ??? could do this more efficiently with a single call based on the max } count++; // GLPK arrays start at 1 indices_adj[count] = indices[i] + 1; elements_adj[count] = elements[i]; } } lpx_set_mat_col( model, numcols, count, indices_adj, elements_adj ); delete [] indices_adj; delete [] elements_adj; # if OGSI_TRACK_FRESH > 2 std::cout << "OGSI(" << std::hex << this << std::dec << ")::addCol: new column." << std::endl ; # endif } //----------------------------------------------------------------------------- void OGSI::addCols (const int numcols, const CoinPackedVectorBase *const *cols, const double *collb, const double *colub, const double *obj) { // ??? We could do this more efficiently now // Could be in OsiSolverInterfaceImpl. int i; for( i = 0; i < numcols; ++i ) addCol( *(cols[i]), collb[i], colub[i], obj[i] ); } //----------------------------------------------------------------------------- void OGSI::deleteCols(const int num, const int * columnIndices) { int *columnIndicesPlus1 = new int[num+1]; LPX *model = getMutableModelPtr(); freeCachedData( OGSI::KEEPCACHED_ROW ); for( int i = 0; i < num; i++ ) { columnIndicesPlus1[i+1]=columnIndices[i]+1; deleteColNames(columnIndices[i],1); } lpx_del_cols(model,num,columnIndicesPlus1); delete [] columnIndicesPlus1; # if OGSI_TRACK_FRESH > 0 std::cout << "OGSI(" << std::hex << this << std::dec << ")::deleteCols: deleted " << num << "columns." << std::endl ; # endif } //----------------------------------------------------------------------------- void OGSI::addRow (const CoinPackedVectorBase& vec, const double rowlb, const double rowub) { // Note: GLPK expects only non-zero coefficients will be given in // lpx_set_mat_row and will abort if there are any zeros. So any // zeros must be removed prior to calling lpx_set_mat_row. LPX *model = getMutableModelPtr(); freeCachedData( OGSI::KEEPCACHED_COLUMN ); lpx_add_rows( model, 1 ); int numrows = getNumRows(); setRowBounds( numrows-1, rowlb, rowub ); int i; const int *indices = vec.getIndices(); const double *elements = vec.getElements(); int numcols = getNumCols(); // For GLPK, we don't want the arrays to start at 0 // Also, we need to weed out any 0.0 elements int *indices_adj = new int[1+vec.getNumElements()]; double *elements_adj = new double[1+vec.getNumElements()]; int count = 0; for( i = 0; i < vec.getNumElements(); i++ ) { if ( elements[i] != 0.0 ) { if ( indices[i]+1 > numcols ) { // ??? Could do this more efficiently with a single call lpx_add_cols( model, indices[i]+1 - numcols ); numcols = indices[i]+1; } count++; elements_adj[count] = elements[i]; indices_adj[count] = indices[i] + 1; } } lpx_set_mat_row( model, numrows, count, indices_adj, elements_adj ); delete [] indices_adj; delete [] elements_adj; # if OGSI_TRACK_FRESH > 0 std::cout << "OGSI(" << std::hex << this << std::dec << ")::addRow: new row." << std::endl ; # endif } //----------------------------------------------------------------------------- void OGSI::addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) { // Could be in OsiSolverInterfaceImpl. double lb = 0.0 ; double ub = 0.0 ; convertSenseToBound( rowsen, rowrhs, rowrng, lb, ub); addRow( vec, lb, ub ); } //----------------------------------------------------------------------------- void OGSI::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub) { // ??? Could do this more efficiently now // Could be in OsiSolverInterfaceImpl. int i; for( i = 0; i < numrows; ++i ) addRow( *(rows[i]), rowlb[i], rowub[i] ); } //----------------------------------------------------------------------------- void OGSI::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng) { // Could be in OsiSolverInterfaceImpl. int i; for( i = 0; i < numrows; ++i ) addRow( *(rows[i]), rowsen[i], rowrhs[i], rowrng[i] ); } //----------------------------------------------------------------------------- /* There's an expectation that a valid basis will be maintained across row deletions. Fortunately, glpk will do this automagically as long as we play by the rules and delete only slack constraints. If we delete a constraint with a nonbasic slack, we're in trouble. */ void OGSI::deleteRows (const int num, const int *osiIndices) { int *glpkIndices = new int[num+1] ; int i,ndx ; /* Arguably, column results remain valid across row deletion. */ freeCachedData(OGSI::KEEPCACHED_COLUMN) ; /* Glpk uses 1-based indexing, so convert the array of indices. While we're doing that, delete the row names. */ for (ndx = 0 ; ndx < num ; ndx++) { glpkIndices[ndx+1] = osiIndices[ndx]+1 ; deleteRowNames(osiIndices[ndx],1) ; } /* See if we're about to do damage. If we delete a row with a nonbasic slack, we'll have an excess of basic variables. */ int notBasic = 0 ; for (ndx = 1 ; ndx <= num ; ndx++) { i = glpkIndices[ndx] ; int stati = lpx_get_row_stat(lp_,i) ; if (stati != LPX_BS) { notBasic++ ; } } if (notBasic) { # if OGSI_VERBOSITY > 1 std::cout << "OGSI(" << std::hex << this << std::dec << ")::deleteRows: deleting " << notBasic << " tight constraints; " << "basis is no longer valid." << std::endl ; # endif } /* Tell glpk to delete the rows. */ lpx_del_rows(lp_,num,glpkIndices) ; delete [] glpkIndices ; # if OGSI_TRACK_FRESH > 0 std::cout << "OGSI(" << std::hex << this << std::dec << ")::deleteRows: deleted " << num << " rows." << std::endl ; # endif return ; } //############################################################################# // Methods to input a problem //############################################################################# void OGSI::loadProblem (const CoinPackedMatrix &matrix, const double *collb_parm, const double *colub_parm, const double *obj_parm, const double *rowlb_parm, const double *rowub_parm) { # if OGSI_TRACK_FRESH > 0 std::cout << "OGSI(" << std::hex << this << std::dec << ")::loadProblem." << std::endl ; # endif /* There's always an existing LPX object. If it's empty, we can simply load in the new data. If it's non-empty, easiest to delete it and start afresh. When we do this, we need to reload parameters. For hints, it's easiest to grab from the existing LPX structure. In any event, get rid of cached data in the OsiGlpk object. */ if (lpx_get_num_cols(lp_) != 0 || lpx_get_num_rows(lp_) != 0) { int presolVal = lpx_get_int_parm(lp_,LPX_K_PRESOL) ; int usedualVal = lpx_get_int_parm(lp_,LPX_K_DUAL) ; int scaleVal = lpx_get_int_parm(lp_,LPX_K_SCALE) ; int logVal = lpx_get_int_parm(lp_,LPX_K_MSGLEV) ; # if OGSI_TRACK_FRESH > 0 std::cout << " emptying LPX(" << std::hex << lp_ << std::dec << "), " # endif lpx_delete_prob(lp_) ; lp_ = lpx_create_prob() ; assert(lp_) ; # if OGSI_TRACK_FRESH > 0 std::cout << "loading LPX(" << std::hex << lp_ << std::dec << ")." << std::endl ; # endif lpx_set_class(lp_,LPX_MIP) ; lpx_set_int_parm(lp_,LPX_K_ITLIM,maxIteration_) ; if (getObjSense() == 1) // minimization { lpx_set_real_parm(lp_,LPX_K_OBJUL,dualObjectiveLimit_) ; lpx_set_real_parm(lp_,LPX_K_OBJLL,primalObjectiveLimit_) ; } else // maximization { lpx_set_real_parm(lp_,LPX_K_OBJLL,dualObjectiveLimit_) ; lpx_set_real_parm(lp_,LPX_K_OBJUL,primalObjectiveLimit_) ; } lpx_set_real_parm(lp_,LPX_K_TOLDJ,dualTolerance_) ; lpx_set_real_parm(lp_,LPX_K_TOLBND,primalTolerance_) ; lpx_set_obj_coef(lp_,0,objOffset_) ; lpx_set_prob_name(lp_,const_cast(probName_.c_str())) ; lpx_set_int_parm(lp_,LPX_K_PRESOL,presolVal) ; lpx_set_int_parm(lp_,LPX_K_DUAL,usedualVal) ; lpx_set_int_parm(lp_,LPX_K_SCALE,scaleVal) ; lpx_set_int_parm(lp_,LPX_K_MSGLEV,logVal) ; messageHandler()->setLogLevel(logVal) ; } freeCachedData(OGSI::KEEPCACHED_NONE) ; double inf = getInfinity() ; int m = matrix.getNumRows() ; int n = matrix.getNumCols() ; int i,j ; double *zeroVec,*infVec,*negInfVec ; const double *collb,*colub,*obj,*rowlb,*rowub ; /* Check if we need default values for any of the vectors, and set up accordingly. */ if (collb_parm == 0 || obj_parm == 0) { zeroVec = new double [n] ; CoinZeroN(zeroVec,n) ; } else { zeroVec = 0 ; } if (colub_parm == 0 || rowub_parm == 0) { if (colub_parm == 0 && rowub_parm == 0) { j = CoinMax(m,n) ; } else if (colub_parm == 0) { j = n ; } else { j = m ; } infVec = new double [j] ; CoinFillN(infVec,j,inf) ; } else { infVec = 0 ; } if (rowlb_parm == 0) { negInfVec = new double [m] ; CoinFillN(negInfVec,m,-inf) ; } else { negInfVec = 0 ; } if (collb_parm == 0) { collb = zeroVec ; } else { collb = collb_parm ; } if (colub_parm == 0) { colub = infVec ; } else { colub = colub_parm ; } if (obj_parm == 0) { obj = zeroVec ; } else { obj = obj_parm ; } if (rowlb_parm == 0) { rowlb = negInfVec ; } else { rowlb = rowlb_parm ; } if (rowub_parm == 0) { rowub = infVec ; } else { rowub = rowub_parm ; } /* The actual load. */ if (matrix.isColOrdered()) { for (j = 0 ; j < n ; j++) { const CoinShallowPackedVector reqdBySunCC = matrix.getVector(j) ; addCol(reqdBySunCC,collb[j],colub[j],obj[j]) ; } // Make sure there are enough rows if (m > getNumRows()) { lpx_add_rows(lp_,m-getNumRows()) ; } for (i = 0 ; i < m ; i++) { setRowBounds(i,rowlb[i],rowub[i]) ; } } else { for (i = 0 ; i < m ; i++) { const CoinShallowPackedVector reqdBySunCC = matrix.getVector(i) ; addRow(reqdBySunCC,rowlb[i],rowub[i]) ; } // Make sure there are enough columns if (n > getNumCols()) { lpx_add_cols(lp_,n-getNumCols()) ; } for (j = 0 ; j < n ; j++) { setColBounds(j,collb[j],colub[j]) ; setObjCoeff(j,obj[j]) ; } } /* Cleanup. */ if (zeroVec) delete[] zeroVec ; if (infVec) delete[] infVec ; if (negInfVec) delete[] negInfVec ; return ; } //----------------------------------------------------------------------------- void OGSI::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub ) { // Could be in OsiSolverInterfaceImpl. loadProblem( *matrix, collb, colub, obj, rowlb, rowub ); delete matrix; matrix = NULL; delete[] collb; collb = NULL; delete[] colub; colub = NULL; delete[] obj; obj = NULL; delete[] rowlb; rowlb = NULL; delete[] rowub; rowub = NULL; } //----------------------------------------------------------------------------- void OGSI::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { // Could be in OsiSolverInterfaceImpl. int numrows = matrix.getNumRows(); double * rowlb = new double[numrows]; double * rowub = new double[numrows]; int i; for( i = numrows - 1; i >= 0; --i ) { convertSenseToBound( rowsen ? rowsen[i]:'G', rowrhs ? rowrhs[i]:0.0, rowrng ? rowrng[i]:0.0, rowlb[i], rowub[i] ); } loadProblem( matrix, collb, colub, obj, rowlb, rowub ); delete [] rowlb; delete [] rowub; } //----------------------------------------------------------------------------- void OGSI::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng ) { // Could be in OsiSolverInterfaceImpl. loadProblem( *matrix, collb, colub, obj, rowsen, rowrhs, rowrng ); delete matrix; matrix = NULL; delete[] collb; collb = NULL; delete[] colub; colub = NULL; delete[] obj; obj = NULL; delete[] rowsen; rowsen = NULL; delete[] rowrhs; rowrhs = NULL; delete[] rowrng; rowrng = NULL; } //----------------------------------------------------------------------------- void OGSI::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub) { freeCachedData( OGSI::KEEPCACHED_NONE ); LPX *model = getMutableModelPtr(); double inf = getInfinity(); // Can't send 0 to lpx_add_xxx if (numcols > 0) lpx_add_cols( model, numcols ); if (numrows > 0) lpx_add_rows( model, numrows ); // How many elements? Column-major, so indices of start are columns int numelem = start[ numcols ]; // int numelem = 0; // while ( index[numelem] != 0 ) // numelem++; int *index_adj = new int[1+numelem]; double *value_adj = new double[1+numelem]; int i; for ( i=1; i <= numelem; i++) { index_adj[i] = index[i-1] + 1; value_adj[i] = value[i-1]; } for( i = 0; i < numcols; i++ ) { setColBounds( i, collb ? collb[i]:0.0, colub ? colub[i]:inf ); lpx_set_mat_col( model, i+1, start[i+1]-start[i], &(index_adj[start[i]]), &(value_adj[start[i]]) ); setObjCoeff( i, obj ? obj[i]:0.0 ); } int j; for( j = 0; j < numrows; j++ ) { setRowBounds( j, rowlb ? rowlb[j]:-inf, rowub ? rowub[j]:inf ); } delete [] index_adj; delete [] value_adj; } //----------------------------------------------------------------------------- void OGSI::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng) { double * rowlb = new double[numrows]; double * rowub = new double[numrows]; for (int i = numrows-1; i >= 0; --i) { convertSenseToBound(rowsen != NULL ? rowsen[i] : 'G', rowrhs != NULL ? rowrhs[i] : 0.0, rowrng != NULL ? rowrng[i] : 0.0, rowlb[i], rowub[i]); } loadProblem( numcols, numrows, start, index, value, collb, colub, obj, rowlb, rowub ); delete[] rowlb; delete[] rowub; } //----------------------------------------------------------------------------- // Read mps files //----------------------------------------------------------------------------- /* Call OSI::readMps, which will parse the mps file and call OsiGlpk::loadProblem. */ int OGSI::readMps (const char *filename, const char *extension) { int retval = OsiSolverInterface::readMps(filename,extension); return (retval) ; } //----------------------------------------------------------------------------- // Write mps files //----------------------------------------------------------------------------- void OGSI::writeMps( const char * filename, const char * extension, double /*objSense*/ ) const { // Could be in OsiSolverInterfaceImpl. #if 1 std::string f( filename ); std::string e( extension ); std::string fullname = f + "." + e; lpx_write_mps( getMutableModelPtr(), const_cast( fullname.c_str() )); #else // Fall back on native MPS writer. // These few lines of code haven't been tested. 2004/10/15 std::string f( filename ); std::string e( extension ); std::string fullname = f + "." + e; OsiSolverInterface::writeMpsNative(fullname.c_str(), NULL, NULL, 0, 2, objSense); #endif } //############################################################################ // GLPK-specific methods //############################################################################ // Get a pointer to the instance LPX * OGSI::getModelPtr () { freeCachedResults(); return lp_; } //############################################################################# // Constructors, destructors clone and assignment //############################################################################# //----------------------------------------------------------------------------- // Default Constructor //----------------------------------------------------------------------------- OGSI::OsiGlpkSolverInterface () : OsiSolverInterface() { gutsOfConstructor(); incrementInstanceCounter(); # if OGSI_TRACK_SOLVERS > 0 std::cout << "OGSI(" << std::hex << this << std::dec << "): default constructor." << std::endl ; # endif } //----------------------------------------------------------------------------- // Clone //----------------------------------------------------------------------------- OsiSolverInterface * OGSI::clone(bool copyData) const { # if OGSI_TRACK_SOLVERS > 0 std::cout << "OGSI(" << std::hex << this << std::dec << "): cloning." << std::endl ; # endif if (copyData) return( new OsiGlpkSolverInterface( *this ) ); else return( new OsiGlpkSolverInterface() ); } //----------------------------------------------------------------------------- // Copy constructor //----------------------------------------------------------------------------- OGSI::OsiGlpkSolverInterface( const OsiGlpkSolverInterface & source ) : OsiSolverInterface(source) { gutsOfConstructor(); gutsOfCopy( source ); incrementInstanceCounter(); # if OGSI_TRACK_SOLVERS > 0 std::cout << "OGSI(" << std::hex << this << "): copy from " << &source << std::dec << "." << std::endl ; # endif } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- OGSI::~OsiGlpkSolverInterface () { gutsOfDestructor(); decrementInstanceCounter(); # if OGSI_TRACK_SOLVERS > 0 std::cout << "OGSI(" << std::hex << this << std::dec << "): destructor." << std::endl ; # endif } // Resets // ??? look over this carefully to be sure it is correct void OGSI::reset() { setInitialData(); // this is from the base class OsiSolverInterface gutsOfDestructor(); gutsOfConstructor() ; # if OGSI_TRACK_SOLVERS > 0 std::cout << "OGSI(" << std::hex << this << std::dec << "): reset." << std::endl ; # endif return ; } //----------------------------------------------------------------------------- // Assignment operator //----------------------------------------------------------------------------- OsiGlpkSolverInterface& OGSI::operator=( const OsiGlpkSolverInterface& rhs ) { if( this != &rhs ) { OsiSolverInterface::operator=( rhs ); gutsOfDestructor(); gutsOfConstructor(); if( rhs.lp_ != NULL ) gutsOfCopy( rhs ); } # if OGSI_TRACK_SOLVERS > 0 std::cout << "OGSI(" << std::hex << this << "): assign from " << &rhs << std::dec << "." << std::endl ; # endif return *this; } //############################################################################# // Applying cuts //############################################################################# void OGSI::applyColCut( const OsiColCut & cc ) { // Could be in OsiSolverInterfaceImpl. const double * colLb = getColLower(); const double * colUb = getColUpper(); const CoinPackedVector & lbs = cc.lbs(); const CoinPackedVector & ubs = cc.ubs(); int i; #if 0 // replaced (JJF) because colLb and colUb are invalidated by sets for( i = 0; i < lbs.getNumElements(); ++i ) if( lbs.getElements()[i] > colLb[lbs.getIndices()[i]] ) setColLower( lbs.getIndices()[i], lbs.getElements()[i] ); for( i = 0; i < ubs.getNumElements(); ++i ) if( ubs.getElements()[i] < colUb[ubs.getIndices()[i]] ) setColUpper( ubs.getIndices()[i], ubs.getElements()[i] ); #else double inf = getInfinity(); int type; // lower bounds for( i = 0; i < lbs.getNumElements(); ++i ) { int column = lbs.getIndices()[i]; double lower = lbs.getElements()[i]; double upper = colUb[column]; if( lower > colLb[column] ) { // update cached version as well collower_[column] = lower; if( lower == upper ) type = LPX_FX; else if( lower > -inf && upper < inf ) type = LPX_DB; else if( lower > -inf ) type = LPX_LO; else if( upper < inf) type = LPX_UP; else type = LPX_FR; lpx_set_col_bnds( getMutableModelPtr(), column+1, type, lower, upper ); } } // lower bounds for( i = 0; i < ubs.getNumElements(); ++i ) { int column = ubs.getIndices()[i]; double upper = ubs.getElements()[i]; double lower = colLb[column]; if( upper < colUb[column] ) { // update cached version as well colupper_[column] = upper; if( lower == upper ) type = LPX_FX; else if( lower > -inf && upper < inf ) type = LPX_DB; else if( lower > -inf ) type = LPX_LO; else if( upper < inf) type = LPX_UP; else type = LPX_FR; lpx_set_col_bnds( getMutableModelPtr(), column+1, type, lower, upper ); } } #endif } //----------------------------------------------------------------------------- void OGSI::applyRowCut( const OsiRowCut & rowCut ) { // Could be in OsiSolverInterfaceImpl. addRow( rowCut.row(), rowCut.lb(), rowCut.ub() ); } //############################################################################# // Private methods (non-static and static) and static data //############################################################################# LPX * OGSI::getMutableModelPtr( void ) const { return lp_; } /* This routine must work even if there's no problem loaded in the solver. */ void OGSI::gutsOfCopy (const OsiGlpkSolverInterface &source) { LPX *srclpx = source.lp_ ; LPX *lpx = lp_ ; double dblParam ; int intParam ; std::string strParam ; /* Copy information from the source OSI that a user might change before loading a problem: objective sense and offset, other OSI parameters. Use the get/set parameter calls here to hide pushing information into the LPX object. */ setObjSense(source.getObjSense()) ; source.getDblParam(OsiObjOffset,dblParam) ; setDblParam(OsiObjOffset,dblParam) ; source.getIntParam(OsiNameDiscipline,intParam) ; setIntParam(OsiNameDiscipline,intParam) ; source.getIntParam(OsiMaxNumIteration,intParam) ; setIntParam(OsiMaxNumIteration,intParam) ; source.getIntParam(OsiMaxNumIterationHotStart,intParam) ; setIntParam(OsiMaxNumIterationHotStart,intParam) ; source.getDblParam(OsiPrimalObjectiveLimit,dblParam) ; setDblParam(OsiPrimalObjectiveLimit,dblParam) ; source.getDblParam(OsiDualObjectiveLimit,dblParam) ; setDblParam(OsiDualObjectiveLimit,dblParam) ; source.getDblParam(OsiPrimalTolerance,dblParam) ; setDblParam(OsiPrimalTolerance,dblParam) ; source.getDblParam(OsiDualTolerance,dblParam) ; setDblParam(OsiDualTolerance,dblParam) ; /* For hints, we need to be a little more circumspect, so as not to pump out a bunch of warnings. Pull parameters from the source LPX object and load into the copy. The actual values of the hint parameters (sense & strength) are held up on the parent OSI object, so we don't need to worry about copying them. */ intParam = lpx_get_int_parm(srclpx,LPX_K_PRESOL) ; lpx_set_int_parm(lpx,LPX_K_PRESOL,intParam) ; intParam = lpx_get_int_parm(srclpx,LPX_K_DUAL) ; lpx_set_int_parm(lpx,LPX_K_DUAL,intParam) ; intParam = lpx_get_int_parm(srclpx,LPX_K_SCALE) ; lpx_set_int_parm(lpx,LPX_K_SCALE,intParam) ; /* Printing is a bit more complicated. Pull the parameter and set the log level in the message handler and set the print parameter in glpk. */ intParam = lpx_get_int_parm(srclpx,LPX_K_MSGLEV) ; lpx_set_int_parm(lpx,LPX_K_MSGLEV,intParam) ; messageHandler()->setLogLevel(intParam) ; # ifdef LPX_K_USECUTS intParam=lpx_get_int_parm(lp_,LPX_K_USECUTS); lpx_set_int_parm(lp_,LPX_K_USECUTS,intParam); # endif /* Now --- do we have a problem loaded? If not, we're done. */ int n = source.getNumCols() ; int m = source.getNumRows() ; assert(m >= 0 && n >= 0) ; if (m == 0 && n == 0) { # if OGSI_TRACK_SOLVERS > 0 std::cout << " no problem loaded." << std::endl ; # endif return ; } /* We have rows and/or columns, so we need to transfer the problem. Do a few parameters and status fields that may have changed if a problem is loaded. Then pull the problem information and load it into the lpx object for this OSI. Information on integrality must be copied over separately. */ source.getStrParam(OsiProbName,strParam) ; setStrParam(OsiProbName,strParam) ; bbWasLast_ = source.bbWasLast_ ; iter_used_ = source.iter_used_ ; const double *obj = source.getObjCoefficients() ; const CoinPackedMatrix *cols = source.getMatrixByCol() ; const double *lb = source.getColLower() ; const double *ub = source.getColUpper() ; const double *rlb = source.getRowLower() ; const double *rub = source.getRowUpper() ; loadProblem(*cols,lb,ub,obj,rlb,rub) ; int i,j ; for (j = 0 ; j < n ; j++) { if (source.isInteger(j)) { setInteger(j) ; } } /* Copy the solution information. We need to be a bit careful here. Even though the source has something loaded as a problem, there's no guarantee that we've even called glpk, so we can't consult glpk directly for solution values. */ setColSolution(source.getColSolution()) ; setRowPrice(source.getRowPrice()) ; /* We can, however, consult it directly for variable status: glpk initialises this information as soon as columns and/or rows are created. Of course, that applies to the problem we've just created, too. If we're just copying nonsense, then don't bother. Once we've copied the status into the new lpx object, do the warm-up. */ if (lpx_get_status(srclpx) != LPX_UNDEF) { for (j = 1 ; j <= n ; j++) { int statj = lpx_get_col_stat(srclpx,j) ; lpx_set_col_stat(lpx,j,statj) ; } for (i = 1 ; i <= m ; i++) { int stati = lpx_get_row_stat(srclpx,i) ; lpx_set_row_stat(lpx,i,stati) ; } #ifndef NDEBUG int retval = lpx_warm_up(lpx) ; #endif # if OGSI_TRACK_SOLVERS > 1 std::cout << " lpx_warm_up returns " << retval << "." << std::endl ; # endif assert(retval == LPX_E_OK) ; } return ; } //----------------------------------------------------------------------------- void OGSI::gutsOfConstructor() { bbWasLast_ = 0; iter_used_ = 0; obj_ = NULL; collower_ = NULL; colupper_ = NULL; ctype_ = NULL; rowsense_ = NULL; rhs_ = NULL; rowrange_ = NULL; rowlower_ = NULL; rowupper_ = NULL; colsol_ = NULL; rowsol_ = NULL; redcost_ = NULL; rowact_ = NULL; matrixByRow_ = NULL; matrixByCol_ = NULL; maxIteration_ = COIN_INT_MAX; hotStartMaxIteration_ = 0; nameDisc_ = 0; dualObjectiveLimit_ = getInfinity() ; primalObjectiveLimit_ = -getInfinity() ; dualTolerance_ = 1.0e-6; primalTolerance_ = 1.0e-6; objOffset_ = 0.0 ; probName_ = "" ; hotStartCStat_ = NULL; hotStartCStatSize_ = 0; hotStartRStat_ = NULL; hotStartRStatSize_ = 0; isIterationLimitReached_ = false; isTimeLimitReached_ = false; isAbandoned_ = false; isPrimInfeasible_ = false; isDualInfeasible_ = false; isObjLowerLimitReached_ = false ; isObjUpperLimitReached_ = false ; isFeasible_ = false; lp_ = lpx_create_prob(); assert( lp_ != NULL ); // Make all problems MIPs. See note at top of file. lpx_set_class( lp_, LPX_MIP ); // Push OSI parameters down into LPX object. lpx_set_int_parm(lp_,LPX_K_ITLIM,maxIteration_) ; if (getObjSense() == 1.0) // minimization { lpx_set_real_parm(lp_,LPX_K_OBJUL,dualObjectiveLimit_) ; lpx_set_real_parm(lp_,LPX_K_OBJLL,primalObjectiveLimit_) ; } else // maximization { lpx_set_real_parm(lp_,LPX_K_OBJLL,dualObjectiveLimit_) ; lpx_set_real_parm(lp_,LPX_K_OBJUL,-primalObjectiveLimit_) ; } lpx_set_real_parm(lp_,LPX_K_TOLDJ,dualTolerance_) ; lpx_set_real_parm(lp_,LPX_K_TOLBND,primalTolerance_) ; lpx_set_obj_coef(lp_,0,objOffset_) ; lpx_set_prob_name(lp_,const_cast(probName_.c_str())) ; /* Stefan: with the new simplex algorithm in Glpk 4.31, some netlib instances (e.g., dfl001) take very long or get into a cycle. Thus, let's try to leave parameters onto their defaults. */ // lpx_set_int_parm(lp_,LPX_K_PRESOL,0) ; // lpx_set_int_parm(lp_,LPX_K_DUAL,1) ; // lpx_set_int_parm(lp_,LPX_K_SCALE,3) ; /* Printing is a bit more complicated. Set the log level in the handler and set the print parameter in glpk. */ lpx_set_int_parm(lp_,LPX_K_MSGLEV,1) ; messageHandler()->setLogLevel(1) ; /* Enable cuts if they're available. This is a bit of a pain, as the interface has changed since it was first introduced in 4.9. LPX_K_USECUTS appears in 4.9; the parameter value appears to be unused in this version. LPX_C_ALL appears in 4.10. */ # ifdef LPX_K_USECUTS # ifdef LPX_C_ALL lpx_set_int_parm(lp_,LPX_K_USECUTS,LPX_C_ALL) ; # else lpx_set_int_parm(lp_,LPX_K_USECUTS,0) ; # endif # endif } //----------------------------------------------------------------------------- void OGSI::gutsOfDestructor() { if( lp_ != NULL ) { lpx_delete_prob( lp_ ); lp_=NULL; freeAllMemory(); } assert( lp_ == NULL ); assert( obj_ == NULL ); assert( collower_ == NULL ); assert( colupper_ == NULL ); assert( ctype_ == NULL ); assert( rowsense_ == NULL ); assert( rhs_ == NULL ); assert( rowrange_ == NULL ); assert( rowlower_ == NULL ); assert( rowupper_ == NULL ); assert( colsol_ == NULL ); assert( rowsol_ == NULL ); assert( redcost_ == NULL ); assert( rowact_ == NULL ); assert( matrixByRow_ == NULL ); assert( matrixByCol_ == NULL ); } //----------------------------------------------------------------------------- // free cached vectors //----------------------------------------------------------------------------- void OGSI::freeCachedColRim() { delete [] ctype_; delete [] obj_; delete [] collower_; delete [] colupper_; ctype_ = NULL; obj_ = NULL; collower_ = NULL; colupper_ = NULL; } //----------------------------------------------------------------------------- void OGSI::freeCachedRowRim() { delete [] rowsense_; delete [] rhs_; delete [] rowrange_; delete [] rowlower_; delete [] rowupper_; rowsense_ = NULL; rhs_ = NULL; rowrange_ = NULL; rowlower_ = NULL; rowupper_ = NULL; } //----------------------------------------------------------------------------- void OGSI::freeCachedMatrix() { delete matrixByRow_; delete matrixByCol_; matrixByRow_ = NULL; matrixByCol_ = NULL; } //----------------------------------------------------------------------------- void OGSI::freeCachedResults() { iter_used_ = 0; isAbandoned_ = false; isIterationLimitReached_ = false; isTimeLimitReached_ = false; isPrimInfeasible_ = false; isDualInfeasible_ = false; isFeasible_ = false; delete [] colsol_; delete [] rowsol_; delete [] redcost_; delete [] rowact_; colsol_ = NULL; rowsol_ = NULL; redcost_ = NULL; rowact_ = NULL; } //----------------------------------------------------------------------------- void OGSI::freeCachedData( int keepCached ) { if( !(keepCached & OGSI::KEEPCACHED_COLUMN) ) freeCachedColRim(); if( !(keepCached & OGSI::KEEPCACHED_ROW) ) freeCachedRowRim(); if( !(keepCached & OGSI::KEEPCACHED_MATRIX) ) freeCachedMatrix(); if( !(keepCached & OGSI::KEEPCACHED_RESULTS) ) freeCachedResults(); } //----------------------------------------------------------------------------- void OGSI::freeAllMemory() { freeCachedData(OGSI::KEEPCACHED_NONE); delete[] hotStartCStat_; delete[] hotStartRStat_; hotStartCStat_ = NULL; hotStartCStatSize_ = 0; hotStartRStat_ = NULL; hotStartRStatSize_ = 0; } //----------------------------------------------------------------------------- /*! Set the objective function name. */ void OGSI::setObjName (std::string name) { OsiSolverInterface::setObjName(name) ; lpx_set_obj_name(lp_,const_cast(name.c_str())) ; } /*! Set a row name. Make sure both glpk and OSI see the same name. */ void OGSI::setRowName (int ndx, std::string name) { int nameDiscipline ; /* Quietly do nothing if the index is out of bounds. */ if (ndx < 0 || ndx >= getNumRows()) { return ; } /* Get the name discipline. Quietly do nothing if it's auto. */ (void) getIntParam(OsiNameDiscipline,nameDiscipline) ; if (nameDiscipline == 0) { return ; } /* Set the name in the OSI base, then in the consys structure. */ OsiSolverInterface::setRowName(ndx,name) ; lpx_set_row_name(lp_,ndx+1,const_cast(name.c_str())) ; return ; } /*! Set a column name. Make sure both glpk and OSI see the same name. */ void OGSI::setColName (int ndx, std::string name) { int nameDiscipline ; /* Quietly do nothing if the index is out of bounds. */ if (ndx < 0 || ndx >= getNumCols()) { return ; } /* Get the name discipline. Quietly do nothing if it's auto. */ (void) getIntParam(OsiNameDiscipline,nameDiscipline) ; if (nameDiscipline == 0) { return ; } /* Set the name in the OSI base, then in the consys structure. */ OsiSolverInterface::setColName(ndx,name) ; lpx_set_col_name(lp_,ndx+1,const_cast(name.c_str())) ; return ; } //----------------------------------------------------------------------------- unsigned int OsiGlpkSolverInterface::numInstances_ = 0; void OsiGlpkSolverInterface::decrementInstanceCounter() { assert( numInstances_ != 0 ); if ( --numInstances_ == 0 ) glp_free_env(); } Osi-0.106.4/src/OsiGlpk/osi-glpk.pc.in0000644000076600007660000000051111510106235015676 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: OsiGlpk Description: COIN-OR Open Solver Interface for GLPK URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsiGlpk @OSIGLPKLIB_PCLIBS@ Cflags: -I${includedir} Requires: osi @OSIGLPKLIB_PCREQUIRES@ Osi-0.106.4/src/Osi/0000755000076600007660000000000012244064313012412 5ustar coincoinOsi-0.106.4/src/Osi/config_osi.h.in0000644000076600007660000000052211573730114015311 0ustar coincoin/* src/Osi/config_osi.h.in. */ #ifndef __CONFIG_OSI_H__ #define __CONFIG_OSI_H__ /* Version number of project */ #undef OSI_VERSION /* Major Version number of project */ #undef OSI_VERSION_MAJOR /* Minor Version number of project */ #undef OSI_VERSION_MINOR /* Release Version number of project */ #undef OSI_VERSION_RELEASE #endif Osi-0.106.4/src/Osi/OsiSolverParameters.hpp0000644000076600007660000001113611670247610017103 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiSolverParameters_H #define OsiSolverParameters_H enum OsiIntParam { /*! \brief Iteration limit for initial solve and resolve. The maximum number of iterations (whatever that means for the given solver) the solver can execute in the OsiSolverinterface::initialSolve() and OsiSolverinterface::resolve() methods before terminating. */ OsiMaxNumIteration = 0, /*! \brief Iteration limit for hot start The maximum number of iterations (whatever that means for the given solver) the solver can execute in the OsiSolverinterface::solveFromHotStart() method before terminating. */ OsiMaxNumIterationHotStart, /*! \brief Handling of row and column names. The name discipline specifies how the solver will handle row and column names: - 0: Auto names: Names cannot be set by the client. Names of the form Rnnnnnnn or Cnnnnnnn are generated on demand when a name for a specific row or column is requested; nnnnnnn is derived from the row or column index. Requests for a vector of names return a vector with zero entries. - 1: Lazy names: Names supplied by the client are retained. Names of the form Rnnnnnnn or Cnnnnnnn are generated on demand if no name has been supplied by the client. Requests for a vector of names return a vector sized to the largest index of a name supplied by the client; some entries in the vector may be null strings. - 2: Full names: Names supplied by the client are retained. Names of the form Rnnnnnnn or Cnnnnnnn are generated on demand if no name has been supplied by the client. Requests for a vector of names return a vector sized to match the constraint system, and all entries will contain either the name specified by the client or a generated name. */ OsiNameDiscipline, /*! \brief End marker. Used by OsiSolverInterface to allocate a fixed-sized array to store integer parameters. */ OsiLastIntParam } ; enum OsiDblParam { /*! \brief Dual objective limit. This is to be used as a termination criteria in algorithms where the dual objective changes monotonically (e.g., dual simplex, volume algorithm). */ OsiDualObjectiveLimit = 0, /*! \brief Primal objective limit. This is to be used as a termination criteria in algorithms where the primal objective changes monotonically (e.g., primal simplex) */ OsiPrimalObjectiveLimit, /*! \brief Dual feasibility tolerance. The maximum amount a dual constraint can be violated and still be considered feasible. */ OsiDualTolerance, /*! \brief Primal feasibility tolerance. The maximum amount a primal constraint can be violated and still be considered feasible. */ OsiPrimalTolerance, /** The value of any constant term in the objective function. */ OsiObjOffset, /*! \brief End marker. Used by OsiSolverInterface to allocate a fixed-sized array to store double parameters. */ OsiLastDblParam }; enum OsiStrParam { /*! \brief The name of the loaded problem. This is the string specified on the Name card of an mps file. */ OsiProbName = 0, /*! \brief The name of the solver. This parameter is read-only. */ OsiSolverName, /*! \brief End marker. Used by OsiSolverInterface to allocate a fixed-sized array to store string parameters. */ OsiLastStrParam }; enum OsiHintParam { /** Whether to do a presolve in initialSolve */ OsiDoPresolveInInitial = 0, /** Whether to use a dual algorithm in initialSolve. The reverse is to use a primal algorithm */ OsiDoDualInInitial, /** Whether to do a presolve in resolve */ OsiDoPresolveInResolve, /** Whether to use a dual algorithm in resolve. The reverse is to use a primal algorithm */ OsiDoDualInResolve, /** Whether to scale problem */ OsiDoScale, /** Whether to create a non-slack basis (only in initialSolve) */ OsiDoCrash, /** Whether to reduce amount of printout, e.g., for branch and cut */ OsiDoReducePrint, /** Whether we are in branch and cut - so can modify behavior */ OsiDoInBranchAndCut, /** Just a marker, so that OsiSolverInterface can allocate a static sized array to store parameters. */ OsiLastHintParam }; enum OsiHintStrength { /** Ignore hint (default) */ OsiHintIgnore = 0, /** This means it is only a hint */ OsiHintTry, /** This means do hint if at all possible */ OsiHintDo, /** And this means throw an exception if not possible */ OsiForceDo }; #endif Osi-0.106.4/src/Osi/OsiSolverBranch.hpp0000644000076600007660000000777511552534623016215 0ustar coincoin// Copyright (C) 2005, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiSolverBranch_H #define OsiSolverBranch_H class OsiSolverInterface; #include "CoinWarmStartBasis.hpp" //############################################################################# /** Solver Branch Class This provides information on a branch as a set of tighter bounds on both ways */ class OsiSolverBranch { public: ///@name Add and Get methods //@{ /// Add a simple branch (i.e. first sets ub of floor(value), second lb of ceil(value)) void addBranch(int iColumn, double value); /// Add bounds - way =-1 is first , +1 is second void addBranch(int way,int numberTighterLower, const int * whichLower, const double * newLower, int numberTighterUpper, const int * whichUpper, const double * newUpper); /// Add bounds - way =-1 is first , +1 is second void addBranch(int way,int numberColumns,const double * oldLower, const double * newLower, const double * oldUpper, const double * newUpper); /// Apply bounds void applyBounds(OsiSolverInterface & solver,int way) const; /// Returns true if current solution satsifies one side of branch bool feasibleOneWay(const OsiSolverInterface & solver) const; /// Starts inline const int * starts() const { return start_;} /// Which variables inline const int * which() const { return indices_;} /// Bounds inline const double * bounds() const { return bound_;} //@} ///@name Constructors and destructors //@{ /// Default Constructor OsiSolverBranch(); /// Copy constructor OsiSolverBranch(const OsiSolverBranch & rhs); /// Assignment operator OsiSolverBranch & operator=(const OsiSolverBranch & rhs); /// Destructor ~OsiSolverBranch (); //@} private: ///@name Private member data //@{ /// Start of lower first, upper first, lower second, upper second int start_[5]; /// Column numbers (if >= numberColumns treat as rows) int * indices_; /// New bounds double * bound_; //@} }; //############################################################################# /** Solver Result Class This provides information on a result as a set of tighter bounds on both ways */ class OsiSolverResult { public: ///@name Add and Get methods //@{ /// Create result void createResult(const OsiSolverInterface & solver,const double * lowerBefore, const double * upperBefore); /// Restore result void restoreResult(OsiSolverInterface & solver) const; /// Get basis inline const CoinWarmStartBasis & basis() const { return basis_;} /// Objective value (as minimization) inline double objectiveValue() const { return objectiveValue_;} /// Primal solution inline const double * primalSolution() const { return primalSolution_;} /// Dual solution inline const double * dualSolution() const { return dualSolution_;} /// Extra fixed inline const OsiSolverBranch & fixed() const { return fixed_;} //@} ///@name Constructors and destructors //@{ /// Default Constructor OsiSolverResult(); /// Constructor from solver OsiSolverResult(const OsiSolverInterface & solver,const double * lowerBefore, const double * upperBefore); /// Copy constructor OsiSolverResult(const OsiSolverResult & rhs); /// Assignment operator OsiSolverResult & operator=(const OsiSolverResult & rhs); /// Destructor ~OsiSolverResult (); //@} private: ///@name Private member data //@{ /// Value of objective (if >= OsiSolverInterface::getInfinity() then infeasible) double objectiveValue_; /// Warm start information CoinWarmStartBasis basis_; /// Primal solution (numberColumns) double * primalSolution_; /// Dual solution (numberRows) double * dualSolution_; /// Which extra variables have been fixed (only way==-1 counts) OsiSolverBranch fixed_; //@} }; #endif Osi-0.106.4/src/Osi/OsiRowCut.cpp0000644000076600007660000002112211556575357015036 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include #include #include #include "CoinPragma.hpp" #include "CoinFinite.hpp" #include "OsiRowCut.hpp" #ifndef OSI_INLINE_ROWCUT_METHODS // //------------------------------------------------------------------- // // Set/Get lower & upper bounds // //------------------------------------------------------------------- double OsiRowCut::lb() const { return lb_; } void OsiRowCut::setLb(double lb) { lb_ = lb; } double OsiRowCut::ub() const { return ub_; } void OsiRowCut::setUb(double ub) { ub_ = ub; } //------------------------------------------------------------------- // Set row elements //------------------------------------------------------------------- void OsiRowCut::setRow(int size, const int* colIndices, const double* elements, bool testForDuplicateIndex) { row_.setVector(size, colIndices, elements, testForDuplicateIndex); } void OsiRowCut::setRow( const CoinPackedVector & v ) { row_ = v; } //------------------------------------------------------------------- // Get the row //------------------------------------------------------------------- const CoinPackedVector & OsiRowCut::row() const { return row_; } //------------------------------------------------------------------- // Get the row for changing //------------------------------------------------------------------- CoinPackedVector & OsiRowCut::mutableRow() { return row_; } //---------------------------------------------------------------- // == operator //------------------------------------------------------------------- bool OsiRowCut::operator==(const OsiRowCut& rhs) const { if ( this->OsiCut::operator!=(rhs) ) return false; if ( row() != rhs.row() ) return false; if ( lb() != rhs.lb() ) return false; if ( ub() != rhs.ub() ) return false; return true; } bool OsiRowCut::operator!=(const OsiRowCut& rhs) const { return !( (*this)==rhs ); } //---------------------------------------------------------------- // consistent & infeasible //------------------------------------------------------------------- bool OsiRowCut::consistent() const { const CoinPackedVector& r = row(); r.duplicateIndex("consistent", "OsiRowCut"); if ( r.getMinIndex() < 0 ) return false; return true; } bool OsiRowCut::consistent(const OsiSolverInterface& im) const { const CoinPackedVector& r = row(); if ( r.getMaxIndex() >= im.getNumCols() ) return false; return true; } bool OsiRowCut::infeasible(const OsiSolverInterface &) const { if ( lb() > ub() ) return true; return false; } #endif /* Returns infeasibility of the cut with respect to solution passed in i.e. is positive if cuts off that solution. solution is getNumCols() long.. */ double OsiRowCut::violated(const double * solution) const { int i; double sum = 0.0; const int* column = row_.getIndices(); int number = row_.getNumElements(); const double* element = row_.getElements(); for ( i = 0; i < number; i++ ) { int colIndx = column[i]; sum += solution[colIndx] * element[i]; } if ( sum > ub_ ) return sum-ub_; else if ( sum < lb_ ) return lb_-sum; else return 0.0; } //------------------------------------------------------------------- // Row sense, rhs, range //------------------------------------------------------------------- char OsiRowCut::sense() const { if ( lb_ == ub_ ) return 'E'; else if ( lb_ == -COIN_DBL_MAX && ub_ == COIN_DBL_MAX ) return 'N'; else if ( lb_ == -COIN_DBL_MAX ) return 'L'; else if ( ub_ == COIN_DBL_MAX ) return 'G'; else return 'R'; } double OsiRowCut::rhs() const { if ( lb_ == ub_ ) return ub_; else if ( lb_ == -COIN_DBL_MAX && ub_ == COIN_DBL_MAX ) return 0.0; else if ( lb_ == -COIN_DBL_MAX ) return ub_; else if ( ub_ == COIN_DBL_MAX ) return lb_; else return ub_; } double OsiRowCut::range() const { if ( lb_ == ub_ ) return 0.0; else if ( lb_ == -COIN_DBL_MAX && ub_ == COIN_DBL_MAX ) return 0.0; else if ( lb_ == -COIN_DBL_MAX ) return 0.0; else if ( ub_ == COIN_DBL_MAX ) return 0.0; else return ub_ - lb_; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiRowCut::OsiRowCut () : OsiCut(), row_(), lb_(-COIN_DBL_MAX), ub_( COIN_DBL_MAX) { //#ifdef NDEBUG //row_.setTestForDuplicateIndex(false); //#endif } //------------------------------------------------------------------- // Ownership constructor //------------------------------------------------------------------- OsiRowCut::OsiRowCut(double cutlb, double cutub, int capacity, int size, int *&colIndices, double *&elements): OsiCut(), row_(capacity, size, colIndices, elements), lb_(cutlb), ub_(cutub) {} //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiRowCut::OsiRowCut (const OsiRowCut & source) : OsiCut(source), row_(source.row_), lb_(source.lb_), ub_(source.ub_) { // Nothing to do here } //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiRowCut * OsiRowCut::clone() const { return (new OsiRowCut(*this)); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiRowCut::~OsiRowCut () { // Nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiRowCut & OsiRowCut::operator=(const OsiRowCut& rhs) { if ( this != &rhs ) { OsiCut::operator=(rhs); row_ = rhs.row_; lb_ = rhs.lb_; ub_ = rhs.ub_; } return *this; } //---------------------------------------------------------------- // Print //------------------------------------------------------------------- void OsiRowCut::print() const { int i; std::cout << "Row cut has " << row_.getNumElements() << " elements"; if ( lb_ < -1.0e20 && ub_<1.0e20 ) std::cout << " with upper rhs of " << ub_; else if ( lb_ > -1.0e20 && ub_ > 1.0e20 ) std::cout << " with lower rhs of " << lb_; else std::cout << " !!! with lower, upper rhs of " << lb_ << " and " << ub_; std::cout << std::endl; for ( i = 0; i < row_.getNumElements(); i++ ) { int colIndx = row_.getIndices()[i]; double element = row_.getElements()[i]; if ( i > 0 && element > 0 ) std::cout << " +"; std::cout << element << " * x" << colIndx << " "; } std::cout << std::endl; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiRowCut2::OsiRowCut2(int row) : OsiRowCut(), whichRow_(row) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiRowCut2::OsiRowCut2(const OsiRowCut2 & source) : OsiRowCut(source), whichRow_(source.whichRow_) { // Nothing to do here } //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiRowCut * OsiRowCut2::clone() const { return (new OsiRowCut2(*this)); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiRowCut2::~OsiRowCut2 () { // Nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiRowCut2 & OsiRowCut2::operator=(const OsiRowCut2& rhs) { if ( this != &rhs ) { OsiRowCut::operator = (rhs); whichRow_ = rhs.whichRow_; } return *this; } Osi-0.106.4/src/Osi/config_default.h0000644000076600007660000000240012101340333015517 0ustar coincoin /* include the COIN-OR-wide system specific configure header */ #include "configall_system.h" /* include the public project specific macros */ #include "config_osi_default.h" /***************************************************************************/ /* HERE DEFINE THE PROJECT SPECIFIC MACROS */ /* These are only in effect in a setting that doesn't use configure */ /***************************************************************************/ /* Define to the debug sanity check level (0 is no test) */ #define COIN_OSI_CHECKLEVEL 0 /* Define to the debug verbosity level (0 is no output) */ #define COIN_OSI_VERBOSITY 0 /* Define to 1 if the CoinUtils package is used. * Don't undef this unless you really know what you're doing. */ #define COIN_HAS_COINUTILS 1 /* Define to 1 if the Cplex package is used */ /* #define COIN_HAS_CPX 1 */ /* Define to 1 if the Glpk package is used */ /* #define COIN_HAS_GLPK 1 */ /* Define to 1 if the Gurobi package is used */ /* #define COIN_HAS_GRB 1 */ /* Define to 1 if the Mosek package is used */ /* #define COIN_HAS_MSK 1 */ /* Define to 1 if the SoPlex package is used */ /* #define COIN_HAS_SPX 1 */ /* Define to 1 if the Xpress package is used */ /* #define COIN_HAS_XPR 1 */ Osi-0.106.4/src/Osi/OsiColCut.cpp0000644000076600007660000000656611510425067015001 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #if defined(_MSC_VER) // Turn off compiler warning about long names # pragma warning(disable:4786) #endif #include "OsiColCut.hpp" #include #include #include //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiColCut::OsiColCut() : OsiCut(), lbs_(), ubs_() { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiColCut::OsiColCut(const OsiColCut & source) : OsiCut(source), lbs_(source.lbs_), ubs_(source.ubs_) { // Nothing to do here } //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiColCut * OsiColCut::clone() const { return (new OsiColCut(*this)); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiColCut::~OsiColCut () { // Nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiColCut & OsiColCut::operator=(const OsiColCut& rhs) { if (this != &rhs) { OsiCut::operator=(rhs); lbs_=rhs.lbs_; ubs_=rhs.ubs_; } return *this; } //---------------------------------------------------------------- // Print //------------------------------------------------------------------- void OsiColCut::print() const { const CoinPackedVector & cutLbs = lbs(); const CoinPackedVector & cutUbs = ubs(); int i; std::cout<<"Column cut has " <= "<solution[colIndx]) sum += newLb - solution[colIndx]; } column = cutUbs.getIndices(); number = cutUbs.getNumElements(); bound = cutUbs.getElements(); for ( i=0; i #include #include #include "CoinError.hpp" #include "CoinTypes.hpp" class OsiSolverInterface; class OsiSolverBranch; class OsiBranchingObject; class OsiBranchingInformation; //############################################################################# //This contains the abstract base class for an object and for branching. //It also contains a simple integer class //############################################################################# /** Abstract base class for `objects'. The branching model used in Osi is based on the idea of an object. In the abstract, an object is something that has a feasible region, can be evaluated for infeasibility, can be branched on (i.e., there's some constructive action to be taken to move toward feasibility), and allows comparison of the effect of branching. This class (OsiObject) is the base class for an object. To round out the branching model, the class OsiBranchingObject describes how to perform a branch, and the class OsiBranchDecision describes how to compare two OsiBranchingObjects. To create a new type of object you need to provide three methods: #infeasibility(), #feasibleRegion(), and #createBranch(), described below. This base class is primarily virtual to allow for any form of structure. Any form of discontinuity is allowed. As there is an overhead in getting information from solvers and because other useful information is available there is also an OsiBranchingInformation class which can contain pointers to information. If used it must at minimum contain pointers to current value of objective, maximum allowed objective and pointers to arrays for bounds and solution and direction of optimization. Also integer and primal tolerance. Classes which inherit might have other information such as depth, number of solutions, pseudo-shadow prices etc etc. May be easier just to throw in here - as I keep doing */ class OsiObject { public: /// Default Constructor OsiObject (); /// Copy constructor OsiObject ( const OsiObject &); /// Assignment operator OsiObject & operator=( const OsiObject& rhs); /// Clone virtual OsiObject * clone() const=0; /// Destructor virtual ~OsiObject (); /** Infeasibility of the object This is some measure of the infeasibility of the object. 0.0 indicates that the object is satisfied. The preferred branching direction is returned in whichWay, where for normal two-way branching 0 is down, 1 is up This is used to prepare for strong branching but should also think of case when no strong branching The object may also compute an estimate of cost of going "up" or "down". This will probably be based on pseudo-cost ideas This should also set mutable infeasibility_ and whichWay_ This is for instant re-use for speed Default for this just calls infeasibility with OsiBranchingInformation NOTE - Convention says that an infeasibility of COIN_DBL_MAX means object has worked out it can't be satisfied! */ double infeasibility(const OsiSolverInterface * solver,int &whichWay) const ; // Faster version when more information available virtual double infeasibility(const OsiBranchingInformation * info, int &whichWay) const =0; // This does NOT set mutable stuff virtual double checkInfeasibility(const OsiBranchingInformation * info) const; /** For the variable(s) referenced by the object, look at the current solution and set bounds to match the solution. Returns measure of how much it had to move solution to make feasible */ virtual double feasibleRegion(OsiSolverInterface * solver) const ; /** For the variable(s) referenced by the object, look at the current solution and set bounds to match the solution. Returns measure of how much it had to move solution to make feasible Faster version */ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const =0; /** Create a branching object and indicate which way to branch first. The branching object has to know how to create branches (fix variables, etc.) */ virtual OsiBranchingObject * createBranch(OsiSolverInterface * /*solver*/, const OsiBranchingInformation * /*info*/, int /*way*/) const {throw CoinError("Need code","createBranch","OsiBranchingObject"); return NULL; } /** \brief Return true if object can take part in normal heuristics */ virtual bool canDoHeuristics() const {return true;} /** \brief Return true if object can take part in move to nearest heuristic */ virtual bool canMoveToNearest() const {return false;} /** Column number if single column object -1 otherwise, Used by heuristics */ virtual int columnNumber() const; /// Return Priority - note 1 is highest priority inline int priority() const { return priority_;} /// Set priority inline void setPriority(int priority) { priority_ = priority;} /** \brief Return true if branch should only bound variables */ virtual bool boundBranch() const {return true;} /// Return true if knows how to deal with Pseudo Shadow Prices virtual bool canHandleShadowPrices() const { return false;} /// Return maximum number of ways branch may have inline int numberWays() const { return numberWays_;} /// Set maximum number of ways branch may have inline void setNumberWays(int numberWays) { numberWays_ = static_cast(numberWays) ; } /** Return preferred way to branch. If two then way=0 means down and 1 means up, otherwise way points to preferred branch */ inline void setWhichWay(int way) { whichWay_ = static_cast(way) ; } /** Return current preferred way to branch. If two then way=0 means down and 1 means up, otherwise way points to preferred branch */ inline int whichWay() const { return whichWay_;} /// Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way) virtual int preferredWay() const { return -1;} /// Return infeasibility inline double infeasibility() const { return infeasibility_;} /// Return "up" estimate (default 1.0e-5) virtual double upEstimate() const; /// Return "down" estimate (default 1.0e-5) virtual double downEstimate() const; /** Reset variable bounds to their original values. Bounds may be tightened, so it may be good to be able to reset them to their original values. */ virtual void resetBounds(const OsiSolverInterface * ) {} /** Change column numbers after preprocessing */ virtual void resetSequenceEtc(int , const int * ) {} /// Updates stuff like pseudocosts before threads virtual void updateBefore(const OsiObject * ) {} /// Updates stuff like pseudocosts after threads finished virtual void updateAfter(const OsiObject * , const OsiObject * ) {} protected: /// data /// Computed infeasibility mutable double infeasibility_; /// Computed preferred way to branch mutable short whichWay_; /// Maximum number of ways on branch short numberWays_; /// Priority int priority_; }; /// Define a class to add a bit of complexity to OsiObject /// This assumes 2 way branching class OsiObject2 : public OsiObject { public: /// Default Constructor OsiObject2 (); /// Copy constructor OsiObject2 ( const OsiObject2 &); /// Assignment operator OsiObject2 & operator=( const OsiObject2& rhs); /// Destructor virtual ~OsiObject2 (); /// Set preferred way of branching - -1 off, 0 down, 1 up (for 2-way) inline void setPreferredWay(int value) {preferredWay_=value;} /// Get preferred way of branching - -1 off, 0 down, 1 up (for 2-way) virtual int preferredWay() const { return preferredWay_;} protected: /// Preferred way of branching - -1 off, 0 down, 1 up (for 2-way) int preferredWay_; /// "Infeasibility" on other way mutable double otherInfeasibility_; }; /** \brief Abstract branching object base class In the abstract, an OsiBranchingObject contains instructions for how to branch. We want an abstract class so that we can describe how to branch on simple objects (e.g., integers) and more exotic objects (e.g., cliques or hyperplanes). The #branch() method is the crucial routine: it is expected to be able to step through a set of branch arms, executing the actions required to create each subproblem in turn. The base class is primarily virtual to allow for a wide range of problem modifications. See OsiObject for an overview of the two classes (OsiObject and OsiBranchingObject) which make up Osi's branching model. */ class OsiBranchingObject { public: /// Default Constructor OsiBranchingObject (); /// Constructor OsiBranchingObject (OsiSolverInterface * solver, double value); /// Copy constructor OsiBranchingObject ( const OsiBranchingObject &); /// Assignment operator OsiBranchingObject & operator=( const OsiBranchingObject& rhs); /// Clone virtual OsiBranchingObject * clone() const=0; /// Destructor virtual ~OsiBranchingObject (); /// The number of branch arms created for this branching object inline int numberBranches() const {return numberBranches_;} /// The number of branch arms left for this branching object inline int numberBranchesLeft() const {return numberBranches_-branchIndex_;} /// Increment the number of branch arms left for this branching object inline void incrementNumberBranchesLeft() { numberBranches_ ++;} /** Set the number of branch arms left for this branching object Just for forcing */ inline void setNumberBranchesLeft(int /*value*/) {/*assert (value==1&&!branchIndex_);*/ numberBranches_=1;} /// Decrement the number of branch arms left for this branching object inline void decrementNumberBranchesLeft() {branchIndex_++;} /** \brief Execute the actions required to branch, as specified by the current state of the branching object, and advance the object's state. Returns change in guessed objective on next branch */ virtual double branch(OsiSolverInterface * solver)=0; /** \brief Execute the actions required to branch, as specified by the current state of the branching object, and advance the object's state. Returns change in guessed objective on next branch */ virtual double branch() {return branch(NULL);} /** \brief Return true if branch should fix variables */ virtual bool boundBranch() const {return true;} /** Get the state of the branching object This is just the branch index */ inline int branchIndex() const {return branchIndex_;} /** Set the state of the branching object. */ inline void setBranchingIndex(int branchIndex) { branchIndex_ = static_cast(branchIndex) ; } /// Current value inline double value() const {return value_;} /// Return pointer back to object which created inline const OsiObject * originalObject() const {return originalObject_;} /// Set pointer back to object which created inline void setOriginalObject(const OsiObject * object) {originalObject_=object;} /** Double checks in case node can change its mind! Returns objective value Can change objective etc */ virtual void checkIsCutoff(double ) {} /// For debug int columnNumber() const; /** \brief Print something about branch - only if log level high */ virtual void print(const OsiSolverInterface * =NULL) const {} protected: /// Current value - has some meaning about branch double value_; /// Pointer back to object which created const OsiObject * originalObject_; /** Number of branches */ int numberBranches_; /** The state of the branching object. i.e. branch index This starts at 0 when created */ short branchIndex_; }; /* This contains information This could also contain pseudo shadow prices or information for dealing with computing and trusting pseudo-costs */ class OsiBranchingInformation { public: /// Default Constructor OsiBranchingInformation (); /** Useful Constructor (normalSolver true if has matrix etc etc) copySolution true if constructot should make a copy */ OsiBranchingInformation (const OsiSolverInterface * solver, bool normalSolver,bool copySolution=false); /// Copy constructor OsiBranchingInformation ( const OsiBranchingInformation &); /// Assignment operator OsiBranchingInformation & operator=( const OsiBranchingInformation& rhs); /// Clone virtual OsiBranchingInformation * clone() const; /// Destructor virtual ~OsiBranchingInformation (); // Note public public: /// data /** State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes */ int stateOfSearch_; /// Value of objective function (in minimization sense) double objectiveValue_; /// Value of objective cutoff (in minimization sense) double cutoff_; /// Direction 1.0 for minimization, -1.0 for maximization double direction_; /// Integer tolerance double integerTolerance_; /// Primal tolerance double primalTolerance_; /// Maximum time remaining before stopping on time double timeRemaining_; /// Dual to use if row bound violated (if negative then pseudoShadowPrices off) double defaultDual_; /// Pointer to solver mutable const OsiSolverInterface * solver_; /// The number of columns int numberColumns_; /// Pointer to current lower bounds on columns mutable const double * lower_; /// Pointer to current solution mutable const double * solution_; /// Pointer to current upper bounds on columns mutable const double * upper_; /// Highly optional target (hot start) solution const double * hotstartSolution_; /// Pointer to duals const double * pi_; /// Pointer to row activity const double * rowActivity_; /// Objective const double * objective_; /// Pointer to current lower bounds on rows const double * rowLower_; /// Pointer to current upper bounds on rows const double * rowUpper_; /// Elements in column copy of matrix const double * elementByColumn_; /// Column starts const CoinBigIndex * columnStart_; /// Column lengths const int * columnLength_; /// Row indices const int * row_; /** Useful region of length CoinMax(numberColumns,2*numberRows) This is allocated and deleted before OsiObject::infeasibility It is zeroed on entry and should be so on exit It only exists if defaultDual_>=0.0 */ double * usefulRegion_; /// Useful index region to go with usefulRegion_ int * indexRegion_; /// Number of solutions found int numberSolutions_; /// Number of branching solutions found (i.e. exclude heuristics) int numberBranchingSolutions_; /// Depth in tree int depth_; /// TEMP bool owningSolution_; }; /// This just adds two-wayness to a branching object class OsiTwoWayBranchingObject : public OsiBranchingObject { public: /// Default constructor OsiTwoWayBranchingObject (); /** Create a standard tw0-way branch object Specifies a simple two-way branch. Specify way = -1 to set the object state to perform the down arm first, way = 1 for the up arm. */ OsiTwoWayBranchingObject (OsiSolverInterface *solver,const OsiObject * originalObject, int way , double value) ; /// Copy constructor OsiTwoWayBranchingObject ( const OsiTwoWayBranchingObject &); /// Assignment operator OsiTwoWayBranchingObject & operator= (const OsiTwoWayBranchingObject& rhs); /// Destructor virtual ~OsiTwoWayBranchingObject (); using OsiBranchingObject::branch ; /** \brief Sets the bounds for the variable according to the current arm of the branch and advances the object state to the next arm. state. Returns change in guessed objective on next branch */ virtual double branch(OsiSolverInterface * solver)=0; inline int firstBranch() const { return firstBranch_; } /// Way returns -1 on down +1 on up inline int way() const { return !branchIndex_ ? firstBranch_ : -firstBranch_;} protected: /// Which way was first branch -1 = down, +1 = up int firstBranch_; }; /// Define a single integer class class OsiSimpleInteger : public OsiObject2 { public: /// Default Constructor OsiSimpleInteger (); /// Useful constructor - passed solver index OsiSimpleInteger (const OsiSolverInterface * solver, int iColumn); /// Useful constructor - passed solver index and original bounds OsiSimpleInteger (int iColumn, double lower, double upper); /// Copy constructor OsiSimpleInteger ( const OsiSimpleInteger &); /// Clone virtual OsiObject * clone() const; /// Assignment operator OsiSimpleInteger & operator=( const OsiSimpleInteger& rhs); /// Destructor virtual ~OsiSimpleInteger (); using OsiObject::infeasibility ; /// Infeasibility - large is 0.5 virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const; using OsiObject::feasibleRegion ; /** Set bounds to fix the variable at the current (integer) value. Given an integer value, set the lower and upper bounds to fix the variable. Returns amount it had to move variable. */ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const; /** Creates a branching object The preferred direction is set by \p way, 0 for down, 1 for up. */ virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const; /// Set solver column number inline void setColumnNumber(int value) {columnNumber_=value;} /** Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics */ virtual int columnNumber() const; /// Original bounds inline double originalLowerBound() const { return originalLower_;} inline void setOriginalLowerBound(double value) { originalLower_=value;} inline double originalUpperBound() const { return originalUpper_;} inline void setOriginalUpperBound(double value) { originalUpper_=value;} /** Reset variable bounds to their original values. Bounds may be tightened, so it may be good to be able to reset them to their original values. */ virtual void resetBounds(const OsiSolverInterface * solver) ; /** Change column numbers after preprocessing */ virtual void resetSequenceEtc(int numberColumns, const int * originalColumns); /// Return "up" estimate (default 1.0e-5) virtual double upEstimate() const; /// Return "down" estimate (default 1.0e-5) virtual double downEstimate() const; /// Return true if knows how to deal with Pseudo Shadow Prices virtual bool canHandleShadowPrices() const { return false;} protected: /// data /// Original lower bound double originalLower_; /// Original upper bound double originalUpper_; /// Column number in solver int columnNumber_; }; /** Simple branching object for an integer variable This object can specify a two-way branch on an integer variable. For each arm of the branch, the upper and lower bounds on the variable can be independently specified. 0 -> down, 1-> up. */ class OsiIntegerBranchingObject : public OsiTwoWayBranchingObject { public: /// Default constructor OsiIntegerBranchingObject (); /** Create a standard floor/ceiling branch object Specifies a simple two-way branch. Let \p value = x*. One arm of the branch will be lb <= x <= floor(x*), the other ceil(x*) <= x <= ub. Specify way = -1 to set the object state to perform the down arm first, way = 1 for the up arm. */ OsiIntegerBranchingObject (OsiSolverInterface *solver,const OsiSimpleInteger * originalObject, int way , double value) ; /** Create a standard floor/ceiling branch object Specifies a simple two-way branch in a more flexible way. One arm of the branch will be lb <= x <= downUpperBound, the other upLowerBound <= x <= ub. Specify way = -1 to set the object state to perform the down arm first, way = 1 for the up arm. */ OsiIntegerBranchingObject (OsiSolverInterface *solver,const OsiSimpleInteger * originalObject, int way , double value, double downUpperBound, double upLowerBound) ; /// Copy constructor OsiIntegerBranchingObject ( const OsiIntegerBranchingObject &); /// Assignment operator OsiIntegerBranchingObject & operator= (const OsiIntegerBranchingObject& rhs); /// Clone virtual OsiBranchingObject * clone() const; /// Destructor virtual ~OsiIntegerBranchingObject (); using OsiBranchingObject::branch ; /** \brief Sets the bounds for the variable according to the current arm of the branch and advances the object state to the next arm. state. Returns change in guessed objective on next branch */ virtual double branch(OsiSolverInterface * solver); using OsiBranchingObject::print ; /** \brief Print something about branch - only if log level high */ virtual void print(const OsiSolverInterface * solver=NULL); protected: // Probably could get away with just value which is already stored /// Lower [0] and upper [1] bounds for the down arm (way_ = -1) double down_[2]; /// Lower [0] and upper [1] bounds for the up arm (way_ = 1) double up_[2]; }; /** Define Special Ordered Sets of type 1 and 2. These do not have to be integer - so do not appear in lists of integers. which_ points columns of matrix */ class OsiSOS : public OsiObject2 { public: // Default Constructor OsiSOS (); /** Useful constructor - which are indices and weights are also given. If null then 0,1,2.. type is SOS type */ OsiSOS (const OsiSolverInterface * solver, int numberMembers, const int * which, const double * weights, int type=1); // Copy constructor OsiSOS ( const OsiSOS &); /// Clone virtual OsiObject * clone() const; // Assignment operator OsiSOS & operator=( const OsiSOS& rhs); // Destructor virtual ~OsiSOS (); using OsiObject::infeasibility ; /// Infeasibility - large is 0.5 virtual double infeasibility(const OsiBranchingInformation * info,int & whichWay) const; using OsiObject::feasibleRegion ; /** Set bounds to fix the variable at the current (integer) value. Given an integer value, set the lower and upper bounds to fix the variable. Returns amount it had to move variable. */ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const; /** Creates a branching object The preferred direction is set by \p way, 0 for down, 1 for up. */ virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const; /// Return "up" estimate (default 1.0e-5) virtual double upEstimate() const; /// Return "down" estimate (default 1.0e-5) virtual double downEstimate() const; /// Redoes data when sequence numbers change virtual void resetSequenceEtc(int numberColumns, const int * originalColumns); /// Number of members inline int numberMembers() const {return numberMembers_;} /// Members (indices in range 0 ... numberColumns-1) inline const int * members() const {return members_;} /// SOS type inline int sosType() const {return sosType_;} /// SOS type inline int setType() const {return sosType_;} /** Array of weights */ inline const double * weights() const { return weights_;} /** \brief Return true if object can take part in normal heuristics */ virtual bool canDoHeuristics() const {return (sosType_==1&&integerValued_);} /// Set whether set is integer valued or not inline void setIntegerValued(bool yesNo) { integerValued_=yesNo;} /// Return true if knows how to deal with Pseudo Shadow Prices virtual bool canHandleShadowPrices() const { return true;} /// Set number of members inline void setNumberMembers(int value) {numberMembers_=value;} /// Members (indices in range 0 ... numberColumns-1) inline int * mutableMembers() const {return members_;} /// Set SOS type inline void setSosType(int value) {sosType_=value;} /** Array of weights */ inline double * mutableWeights() const { return weights_;} protected: /// data /// Members (indices in range 0 ... numberColumns-1) int * members_; /// Weights double * weights_; /// Number of members int numberMembers_; /// SOS type int sosType_; /// Whether integer valued bool integerValued_; }; /** Branching object for Special ordered sets */ class OsiSOSBranchingObject : public OsiTwoWayBranchingObject { public: // Default Constructor OsiSOSBranchingObject (); // Useful constructor OsiSOSBranchingObject (OsiSolverInterface * solver, const OsiSOS * originalObject, int way, double separator); // Copy constructor OsiSOSBranchingObject ( const OsiSOSBranchingObject &); // Assignment operator OsiSOSBranchingObject & operator=( const OsiSOSBranchingObject& rhs); /// Clone virtual OsiBranchingObject * clone() const; // Destructor virtual ~OsiSOSBranchingObject (); using OsiBranchingObject::branch ; /// Does next branch and updates state virtual double branch(OsiSolverInterface * solver); using OsiBranchingObject::print ; /** \brief Print something about branch - only if log level high */ virtual void print(const OsiSolverInterface * solver=NULL); private: /// data }; /** Lotsize class */ class OsiLotsize : public OsiObject2 { public: // Default Constructor OsiLotsize (); /* Useful constructor - passed model index. Also passed valid values - if range then pairs */ OsiLotsize (const OsiSolverInterface * solver, int iColumn, int numberPoints, const double * points, bool range=false); // Copy constructor OsiLotsize ( const OsiLotsize &); /// Clone virtual OsiObject * clone() const; // Assignment operator OsiLotsize & operator=( const OsiLotsize& rhs); // Destructor virtual ~OsiLotsize (); using OsiObject::infeasibility ; /// Infeasibility - large is 0.5 virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const; using OsiObject::feasibleRegion ; /** Set bounds to contain the current solution. More precisely, for the variable associated with this object, take the value given in the current solution, force it within the current bounds if required, then set the bounds to fix the variable at the integer nearest the solution value. Returns amount it had to move variable. */ virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const; /** Creates a branching object The preferred direction is set by \p way, 0 for down, 1 for up. */ virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const; /// Set solver column number inline void setColumnNumber(int value) {columnNumber_=value;} /** Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics */ virtual int columnNumber() const; /** Reset original upper and lower bound values from the solver. Handy for updating bounds held in this object after bounds held in the solver have been tightened. */ virtual void resetBounds(const OsiSolverInterface * solver); /** Finds range of interest so value is feasible in range range_ or infeasible between hi[range_] and lo[range_+1]. Returns true if feasible. */ bool findRange(double value, double integerTolerance) const; /** Returns floor and ceiling */ virtual void floorCeiling(double & floorLotsize, double & ceilingLotsize, double value, double tolerance) const; /// Original bounds inline double originalLowerBound() const { return bound_[0];} inline double originalUpperBound() const { return bound_[rangeType_*numberRanges_-1];} /// Type - 1 points, 2 ranges inline int rangeType() const { return rangeType_;} /// Number of points inline int numberRanges() const { return numberRanges_;} /// Ranges inline double * bound() const { return bound_;} /** Change column numbers after preprocessing */ virtual void resetSequenceEtc(int numberColumns, const int * originalColumns); /// Return "up" estimate (default 1.0e-5) virtual double upEstimate() const; /// Return "down" estimate (default 1.0e-5) virtual double downEstimate() const; /// Return true if knows how to deal with Pseudo Shadow Prices virtual bool canHandleShadowPrices() const { return true;} /** \brief Return true if object can take part in normal heuristics */ virtual bool canDoHeuristics() const {return false;} private: /// data /// Column number in model int columnNumber_; /// Type - 1 points, 2 ranges int rangeType_; /// Number of points int numberRanges_; // largest gap double largestGap_; /// Ranges double * bound_; /// Current range mutable int range_; }; /** Lotsize branching object This object can specify a two-way branch on an integer variable. For each arm of the branch, the upper and lower bounds on the variable can be independently specified. Variable_ holds the index of the integer variable in the integerVariable_ array of the model. */ class OsiLotsizeBranchingObject : public OsiTwoWayBranchingObject { public: /// Default constructor OsiLotsizeBranchingObject (); /** Create a lotsize floor/ceiling branch object Specifies a simple two-way branch. Let \p value = x*. One arm of the branch will be is lb <= x <= valid range below(x*), the other valid range above(x*) <= x <= ub. Specify way = -1 to set the object state to perform the down arm first, way = 1 for the up arm. */ OsiLotsizeBranchingObject (OsiSolverInterface *solver,const OsiLotsize * originalObject, int way , double value) ; /// Copy constructor OsiLotsizeBranchingObject ( const OsiLotsizeBranchingObject &); /// Assignment operator OsiLotsizeBranchingObject & operator= (const OsiLotsizeBranchingObject& rhs); /// Clone virtual OsiBranchingObject * clone() const; /// Destructor virtual ~OsiLotsizeBranchingObject (); using OsiBranchingObject::branch ; /** \brief Sets the bounds for the variable according to the current arm of the branch and advances the object state to the next arm. state. Returns change in guessed objective on next branch */ virtual double branch(OsiSolverInterface * solver); using OsiBranchingObject::print ; /** \brief Print something about branch - only if log level high */ virtual void print(const OsiSolverInterface * solver=NULL); protected: /// Lower [0] and upper [1] bounds for the down arm (way_ = -1) double down_[2]; /// Lower [0] and upper [1] bounds for the up arm (way_ = 1) double up_[2]; }; #endif Osi-0.106.4/src/Osi/OsiChooseVariable.cpp0000644000076600007660000010735612101340333016462 0ustar coincoin// Copyright (C) 2006, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include #include #include #include "CoinPragma.hpp" #include "OsiSolverInterface.hpp" #include "OsiAuxInfo.hpp" #include "OsiSolverBranch.hpp" #include "CoinWarmStartBasis.hpp" #include "CoinPackedMatrix.hpp" #include "CoinTime.hpp" #include "CoinSort.hpp" #include "CoinFinite.hpp" #include "OsiChooseVariable.hpp" using namespace std; OsiChooseVariable::OsiChooseVariable() : goodObjectiveValue_(COIN_DBL_MAX), upChange_(0.0), downChange_(0.0), goodSolution_(NULL), list_(NULL), useful_(NULL), solver_(NULL), status_(-1), bestObjectIndex_(-1), bestWhichWay_(-1), firstForcedObjectIndex_(-1), firstForcedWhichWay_(-1), numberUnsatisfied_(0), numberStrong_(0), numberOnList_(0), numberStrongDone_(0), numberStrongIterations_(0), numberStrongFixed_(0), trustStrongForBound_(true), trustStrongForSolution_(true) { } OsiChooseVariable::OsiChooseVariable(const OsiSolverInterface * solver) : goodObjectiveValue_(COIN_DBL_MAX), upChange_(0.0), downChange_(0.0), goodSolution_(NULL), solver_(solver), status_(-1), bestObjectIndex_(-1), bestWhichWay_(-1), firstForcedObjectIndex_(-1), firstForcedWhichWay_(-1), numberUnsatisfied_(0), numberStrong_(0), numberOnList_(0), numberStrongDone_(0), numberStrongIterations_(0), numberStrongFixed_(0), trustStrongForBound_(true), trustStrongForSolution_(true) { // create useful arrays int numberObjects = solver_->numberObjects(); list_ = new int [numberObjects]; useful_ = new double [numberObjects]; } OsiChooseVariable::OsiChooseVariable(const OsiChooseVariable & rhs) { goodObjectiveValue_ = rhs.goodObjectiveValue_; upChange_ = rhs.upChange_; downChange_ = rhs.downChange_; status_ = rhs.status_; bestObjectIndex_ = rhs.bestObjectIndex_; bestWhichWay_ = rhs.bestWhichWay_; firstForcedObjectIndex_ = rhs.firstForcedObjectIndex_; firstForcedWhichWay_ = rhs.firstForcedWhichWay_; numberUnsatisfied_ = rhs.numberUnsatisfied_; numberStrong_ = rhs.numberStrong_; numberOnList_ = rhs.numberOnList_; numberStrongDone_ = rhs.numberStrongDone_; numberStrongIterations_ = rhs.numberStrongIterations_; numberStrongFixed_ = rhs.numberStrongFixed_; trustStrongForBound_ = rhs.trustStrongForBound_; trustStrongForSolution_ = rhs.trustStrongForSolution_; solver_ = rhs.solver_; if (solver_) { int numberObjects = solver_->numberObjects(); int numberColumns = solver_->getNumCols(); if (rhs.goodSolution_) { goodSolution_ = CoinCopyOfArray(rhs.goodSolution_,numberColumns); } else { goodSolution_ = NULL; } list_ = CoinCopyOfArray(rhs.list_,numberObjects); useful_ = CoinCopyOfArray(rhs.useful_,numberObjects); } else { goodSolution_ = NULL; list_ = NULL; useful_ = NULL; } } OsiChooseVariable & OsiChooseVariable::operator=(const OsiChooseVariable & rhs) { if (this != &rhs) { delete [] goodSolution_; delete [] list_; delete [] useful_; goodObjectiveValue_ = rhs.goodObjectiveValue_; upChange_ = rhs.upChange_; downChange_ = rhs.downChange_; status_ = rhs.status_; bestObjectIndex_ = rhs.bestObjectIndex_; bestWhichWay_ = rhs.bestWhichWay_; firstForcedObjectIndex_ = rhs.firstForcedObjectIndex_; firstForcedWhichWay_ = rhs.firstForcedWhichWay_; numberUnsatisfied_ = rhs.numberUnsatisfied_; numberStrong_ = rhs.numberStrong_; numberOnList_ = rhs.numberOnList_; numberStrongDone_ = rhs.numberStrongDone_; numberStrongIterations_ = rhs.numberStrongIterations_; numberStrongFixed_ = rhs.numberStrongFixed_; trustStrongForBound_ = rhs.trustStrongForBound_; trustStrongForSolution_ = rhs.trustStrongForSolution_; solver_ = rhs.solver_; if (solver_) { int numberObjects = solver_->numberObjects(); int numberColumns = solver_->getNumCols(); if (rhs.goodSolution_) { goodSolution_ = CoinCopyOfArray(rhs.goodSolution_,numberColumns); } else { goodSolution_ = NULL; } list_ = CoinCopyOfArray(rhs.list_,numberObjects); useful_ = CoinCopyOfArray(rhs.useful_,numberObjects); } else { goodSolution_ = NULL; list_ = NULL; useful_ = NULL; } } return *this; } OsiChooseVariable::~OsiChooseVariable () { delete [] goodSolution_; delete [] list_; delete [] useful_; } // Clone OsiChooseVariable * OsiChooseVariable::clone() const { return new OsiChooseVariable(*this); } // Set solver and redo arrays void OsiChooseVariable::setSolver (const OsiSolverInterface * solver) { solver_ = solver; delete [] list_; delete [] useful_; // create useful arrays int numberObjects = solver_->numberObjects(); list_ = new int [numberObjects]; useful_ = new double [numberObjects]; } // Initialize int OsiChooseVariable::setupList ( OsiBranchingInformation *info, bool initialize) { if (initialize) { status_=-2; delete [] goodSolution_; bestObjectIndex_=-1; numberStrongDone_=0; numberStrongIterations_ = 0; numberStrongFixed_ = 0; goodSolution_ = NULL; goodObjectiveValue_ = COIN_DBL_MAX; } numberOnList_=0; numberUnsatisfied_=0; int numberObjects = solver_->numberObjects(); assert (numberObjects); double check = 0.0; int checkIndex=0; int bestPriority=COIN_INT_MAX; // pretend one strong even if none int maximumStrong= numberStrong_ ? CoinMin(numberStrong_,numberObjects) : 1; int putOther = numberObjects; int i; for (i=0;isolver_->objects(); // Say feasible bool feasible = true; for ( i=0;iinfeasibility(info,way); if (value>0.0) { numberUnsatisfied_++; if (value==COIN_DBL_MAX) { // infeasible feasible=false; break; } int priorityLevel = object[i]->priority(); // Better priority? Flush choices. if (priorityLevel=0) { int iObject = list_[j]; list_[j]=-1; useful_[j]=0.0; list_[--putOther]=iObject; } } bestPriority = priorityLevel; check=0.0; } if (priorityLevel==bestPriority) { if (value>check) { //add to list int iObject = list_[checkIndex]; if (iObject>=0) list_[--putOther]=iObject; // to end list_[checkIndex]=i; useful_[checkIndex]=value; // find worst check=COIN_DBL_MAX; for (int j=0;j=0) { if (useful_[j]=0) { list_[numberOnList_]=list_[i]; useful_[numberOnList_++]=-useful_[i]; } } if (numberOnList_) { // Sort CoinSort_2(useful_,useful_+numberOnList_,list_); // move others i = numberOnList_; for (;putOtherobject(bestObjectIndex_)->whichWay(); firstForcedObjectIndex_ = -1; firstForcedWhichWay_ =-1; return 0; } else { return 1; } } // Returns true if solution looks feasible against given objects bool OsiChooseVariable::feasibleSolution(const OsiBranchingInformation * info, const double * solution, int numberObjects, const OsiObject ** objects) { bool satisfied=true; const double * saveSolution = info->solution_; info->solution_ = solution; for (int i=0;icheckInfeasibility(info); if (value>0.0) { satisfied=false; break; } } info->solution_ = saveSolution; return satisfied; } // Saves a good solution void OsiChooseVariable::saveSolution(const OsiSolverInterface * solver) { delete [] goodSolution_; int numberColumns = solver->getNumCols(); goodSolution_ = CoinCopyOfArray(solver->getColSolution(),numberColumns); goodObjectiveValue_ = solver->getObjSense()*solver->getObjValue(); } // Clears out good solution after use void OsiChooseVariable::clearGoodSolution() { delete [] goodSolution_; goodSolution_ = NULL; goodObjectiveValue_ = COIN_DBL_MAX; } /* This is a utility function which does strong branching on a list of objects and stores the results in OsiHotInfo.objects. On entry the object sequence is stored in the OsiHotInfo object and maybe more. It returns - -1 - one branch was infeasible both ways 0 - all inspected - nothing can be fixed 1 - all inspected - some can be fixed (returnCriterion==0) 2 - may be returning early - one can be fixed (last one done) (returnCriterion==1) 3 - returning because max time */ int OsiChooseStrong::doStrongBranching( OsiSolverInterface * solver, OsiBranchingInformation *info, int numberToDo, int returnCriterion) { // Might be faster to extend branch() to return bounds changed double * saveLower = NULL; double * saveUpper = NULL; int numberColumns = solver->getNumCols(); solver->markHotStart(); const double * lower = info->lower_; const double * upper = info->upper_; saveLower = CoinCopyOfArray(info->lower_,numberColumns); saveUpper = CoinCopyOfArray(info->upper_,numberColumns); numResults_=0; int returnCode=0; double timeStart = CoinCpuTime(); for (int iDo=0;iDobranchingObject(); assert (branch->numberBranches()==2); /* Try the first direction. Each subsequent call to branch() performs the specified branch and advances the branch object state to the next branch alternative.) */ OsiSolverInterface * thisSolver = solver; if (branch->boundBranch()) { // ordinary branch->branch(solver); // maybe we should check bounds for stupidities here? solver->solveFromHotStart() ; } else { // adding cuts or something thisSolver = solver->clone(); branch->branch(thisSolver); // set hot start iterations int limit; thisSolver->getIntParam(OsiMaxNumIterationHotStart,limit); thisSolver->setIntParam(OsiMaxNumIteration,limit); thisSolver->resolve(); } // can check if we got solution // status is 0 finished, 1 infeasible and 2 unfinished and 3 is solution int status0 = result->updateInformation(thisSolver,info,this); numberStrongIterations_ += thisSolver->getIterationCount(); if (status0==3) { // new solution already saved if (trustStrongForSolution_) { info->cutoff_ = goodObjectiveValue_; status0=0; } } if (solver!=thisSolver) delete thisSolver; // Restore bounds for (int j=0;jsetColLower(j,saveLower[j]); if (saveUpper[j] != upper[j]) solver->setColUpper(j,saveUpper[j]); } /* Try the next direction */ thisSolver = solver; if (branch->boundBranch()) { // ordinary branch->branch(solver); // maybe we should check bounds for stupidities here? solver->solveFromHotStart() ; } else { // adding cuts or something thisSolver = solver->clone(); branch->branch(thisSolver); // set hot start iterations int limit; thisSolver->getIntParam(OsiMaxNumIterationHotStart,limit); thisSolver->setIntParam(OsiMaxNumIteration,limit); thisSolver->resolve(); } // can check if we got solution // status is 0 finished, 1 infeasible and 2 unfinished and 3 is solution int status1 = result->updateInformation(thisSolver,info,this); numberStrongDone_++; numberStrongIterations_ += thisSolver->getIterationCount(); if (status1==3) { // new solution already saved if (trustStrongForSolution_) { info->cutoff_ = goodObjectiveValue_; status1=0; } } if (solver!=thisSolver) delete thisSolver; // Restore bounds for (int j=0;jsetColLower(j,saveLower[j]); if (saveUpper[j] != upper[j]) solver->setColUpper(j,saveUpper[j]); } /* End of evaluation for this candidate variable. Possibilities are: * Both sides below cutoff; this variable is a candidate for branching. * Both sides infeasible or above the objective cutoff: no further action here. Break from the evaluation loop and assume the node will be purged by the caller. * One side below cutoff: Install the branch (i.e., fix the variable). Possibly break from the evaluation loop and assume the node will be reoptimised by the caller. */ numResults_++; if (status0==1&&status1==1) { // infeasible returnCode=-1; break; // exit loop } else if (status0==1||status1==1) { numberStrongFixed_++; if (!returnCriterion) { returnCode=1; } else { returnCode=2; break; } } bool hitMaxTime = ( CoinCpuTime()-timeStart > info->timeRemaining_); if (hitMaxTime) { returnCode=3; break; } } delete [] saveLower; delete [] saveUpper; // Delete the snapshot solver->unmarkHotStart(); return returnCode; } // Given a candidate fill in useful information e.g. estimates void OsiChooseVariable::updateInformation(const OsiBranchingInformation *info, int , OsiHotInfo * hotInfo) { int index = hotInfo->whichObject(); assert (indexnumberObjects()); //assert (branch<2); OsiObject ** object = info->solver_->objects(); upChange_ = object[index]->upEstimate(); downChange_ = object[index]->downEstimate(); } #if 1 // Given a branch fill in useful information e.g. estimates void OsiChooseVariable::updateInformation( int index, int branch, double , double , int ) { assert (indexnumberObjects()); assert (branch<2); OsiObject ** object = solver_->objects(); if (branch) upChange_ = object[index]->upEstimate(); else downChange_ = object[index]->downEstimate(); } #endif //############################################################################## void OsiPseudoCosts::gutsOfDelete() { if (numberObjects_ > 0) { numberObjects_ = 0; numberBeforeTrusted_ = 0; delete[] upTotalChange_; upTotalChange_ = NULL; delete[] downTotalChange_; downTotalChange_ = NULL; delete[] upNumber_; upNumber_ = NULL; delete[] downNumber_; downNumber_ = NULL; } } void OsiPseudoCosts::gutsOfCopy(const OsiPseudoCosts& rhs) { numberObjects_ = rhs.numberObjects_; numberBeforeTrusted_ = rhs.numberBeforeTrusted_; if (numberObjects_ > 0) { upTotalChange_ = CoinCopyOfArray(rhs.upTotalChange_,numberObjects_); downTotalChange_ = CoinCopyOfArray(rhs.downTotalChange_,numberObjects_); upNumber_ = CoinCopyOfArray(rhs.upNumber_,numberObjects_); downNumber_ = CoinCopyOfArray(rhs.downNumber_,numberObjects_); } } OsiPseudoCosts::OsiPseudoCosts() : upTotalChange_(NULL), downTotalChange_(NULL), upNumber_(NULL), downNumber_(NULL), numberObjects_(0), numberBeforeTrusted_(0) { } OsiPseudoCosts::~OsiPseudoCosts() { gutsOfDelete(); } OsiPseudoCosts::OsiPseudoCosts(const OsiPseudoCosts& rhs) : upTotalChange_(NULL), downTotalChange_(NULL), upNumber_(NULL), downNumber_(NULL), numberObjects_(0), numberBeforeTrusted_(0) { gutsOfCopy(rhs); } OsiPseudoCosts& OsiPseudoCosts::operator=(const OsiPseudoCosts& rhs) { if (this != &rhs) { gutsOfDelete(); gutsOfCopy(rhs); } return *this; } void OsiPseudoCosts::initialize(int n) { gutsOfDelete(); numberObjects_ = n; if (numberObjects_ > 0) { upTotalChange_ = new double [numberObjects_]; downTotalChange_ = new double [numberObjects_]; upNumber_ = new int [numberObjects_]; downNumber_ = new int [numberObjects_]; CoinZeroN(upTotalChange_,numberObjects_); CoinZeroN(downTotalChange_,numberObjects_); CoinZeroN(upNumber_,numberObjects_); CoinZeroN(downNumber_,numberObjects_); } } //############################################################################## OsiChooseStrong::OsiChooseStrong() : OsiChooseVariable(), shadowPriceMode_(0), pseudoCosts_(), results_(NULL), numResults_(0) { } OsiChooseStrong::OsiChooseStrong(const OsiSolverInterface * solver) : OsiChooseVariable(solver), shadowPriceMode_(0), pseudoCosts_(), results_(NULL), numResults_(0) { // create useful arrays pseudoCosts_.initialize(solver_->numberObjects()); } OsiChooseStrong::OsiChooseStrong(const OsiChooseStrong & rhs) : OsiChooseVariable(rhs), shadowPriceMode_(rhs.shadowPriceMode_), pseudoCosts_(rhs.pseudoCosts_), results_(NULL), numResults_(0) { } OsiChooseStrong & OsiChooseStrong::operator=(const OsiChooseStrong & rhs) { if (this != &rhs) { OsiChooseVariable::operator=(rhs); shadowPriceMode_ = rhs.shadowPriceMode_; pseudoCosts_ = rhs.pseudoCosts_; delete[] results_; results_ = NULL; numResults_ = 0; } return *this; } OsiChooseStrong::~OsiChooseStrong () { delete[] results_; } // Clone OsiChooseVariable * OsiChooseStrong::clone() const { return new OsiChooseStrong(*this); } #define MAXMIN_CRITERION 0.85 // Initialize int OsiChooseStrong::setupList ( OsiBranchingInformation *info, bool initialize) { if (initialize) { status_=-2; delete [] goodSolution_; bestObjectIndex_=-1; numberStrongDone_=0; numberStrongIterations_ = 0; numberStrongFixed_ = 0; goodSolution_ = NULL; goodObjectiveValue_ = COIN_DBL_MAX; } numberOnList_=0; numberUnsatisfied_=0; int numberObjects = solver_->numberObjects(); if (numberObjects>pseudoCosts_.numberObjects()) { // redo useful arrays pseudoCosts_.initialize(numberObjects); } double check = -COIN_DBL_MAX; int checkIndex=0; int bestPriority=COIN_INT_MAX; int maximumStrong= CoinMin(numberStrong_,numberObjects) ; int putOther = numberObjects; int i; for (i=0;isolver_->objects(); // Get average pseudo costs and see if pseudo shadow prices possible int shadowPossible=shadowPriceMode_; if (shadowPossible) { for ( i=0;icanHandleShadowPrices()) { shadowPossible=0; break; } } if (shadowPossible) { int numberRows = solver_->getNumRows(); const double * pi = info->pi_; double sumPi=0.0; for (i=0;i (numberRows); // and scale back sumPi *= 0.01; info->defaultDual_ = sumPi; // switch on int numberColumns = solver_->getNumCols(); int size = CoinMax(numberColumns,2*numberRows); info->usefulRegion_ = new double [size]; CoinZeroN(info->usefulRegion_,size); info->indexRegion_ = new int [size]; } } double sumUp=0.0; double numberUp=0.0; double sumDown=0.0; double numberDown=0.0; const double* upTotalChange = pseudoCosts_.upTotalChange(); const double* downTotalChange = pseudoCosts_.downTotalChange(); const int* upNumber = pseudoCosts_.upNumber(); const int* downNumber = pseudoCosts_.downNumber(); const int numberBeforeTrusted = pseudoCosts_.numberBeforeTrusted(); for ( i=0;iinfeasibility(info,way); if (value>0.0) { numberUnsatisfied_++; if (value==COIN_DBL_MAX) { // infeasible feasible=false; break; } int priorityLevel = object[i]->priority(); #if 0 for (int k=0;k<3;k++) { if (priorityLevel==pri[k]) priCount[k]++; } #endif // Better priority? Flush choices. if (priorityLevel=0;j--) { if (list_[j]>=0) { int iObject = list_[j]; list_[j]=-1; useful_[j]=0.0; list_[--putOther]=iObject; } } maximumStrong = CoinMin(maximumStrong,putOther); bestPriority = priorityLevel; check=-COIN_DBL_MAX; checkIndex=0; } if (priorityLevel==bestPriority) { // Modify value sumUp = upTotalChange[i]+1.0e-30; numberUp = upNumber[i]; sumDown = downTotalChange[i]+1.0e-30; numberDown = downNumber[i]; double upEstimate = object[i]->upEstimate(); double downEstimate = object[i]->downEstimate(); if (shadowPossible<2) { upEstimate = numberUp ? ((upEstimate*sumUp)/numberUp) : (upEstimate*upMultiplier); if (numberUpcheck) { //add to list int iObject = list_[checkIndex]; if (iObject>=0) { assert (list_[putOther-1]<0); list_[--putOther]=iObject; // to end } list_[checkIndex]=i; assert (checkIndex=0) { if (useful_[j]=0) { list_[numberOnList_]=list_[i]; useful_[numberOnList_++]=-useful_[i]; } } if (numberOnList_) { // Sort CoinSort_2(useful_,useful_+numberOnList_,list_); // move others i = numberOnList_; for (;putOtherdefaultDual_ = -1.0; // switch off delete [] info->usefulRegion_; delete [] info->indexRegion_; return numberUnsatisfied_; } void OsiChooseStrong::resetResults(int num) { delete[] results_; numResults_ = 0; results_ = new OsiHotInfo[num]; } /* Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfied - no candidate 2 We can change the bound on a variable - but we also have a strong branching candidate 3 We can change the bound on a variable - but we have a non-strong branching candidate 4 We can change the bound on a variable - no other candidates We can pick up branch from whichObject() and whichWay() We can pick up a forced branch (can change bound) from whichForcedObject() and whichForcedWay() If we have a solution then we can pick up from goodObjectiveValue() and goodSolution() */ int OsiChooseStrong::chooseVariable( OsiSolverInterface * solver, OsiBranchingInformation *info, bool fixVariables) { if (numberUnsatisfied_) { const double* upTotalChange = pseudoCosts_.upTotalChange(); const double* downTotalChange = pseudoCosts_.downTotalChange(); const int* upNumber = pseudoCosts_.upNumber(); const int* downNumber = pseudoCosts_.downNumber(); int numberBeforeTrusted = pseudoCosts_.numberBeforeTrusted(); // Somehow we can get here with it 0 ! if (!numberBeforeTrusted) { numberBeforeTrusted=5; pseudoCosts_.setNumberBeforeTrusted(numberBeforeTrusted); } int numberLeft = CoinMin(numberStrong_-numberStrongDone_,numberUnsatisfied_); int numberToDo=0; resetResults(numberLeft); int returnCode=0; bestObjectIndex_ = -1; bestWhichWay_ = -1; firstForcedObjectIndex_ = -1; firstForcedWhichWay_ =-1; double bestTrusted=-COIN_DBL_MAX; for (int i=0;iobjects(), iObject); } else { const OsiObject * obj = solver->object(iObject); double upEstimate = (upTotalChange[iObject]*obj->upEstimate())/upNumber[iObject]; double downEstimate = (downTotalChange[iObject]*obj->downEstimate())/downNumber[iObject]; double value = MAXMIN_CRITERION*CoinMin(upEstimate,downEstimate) + (1.0-MAXMIN_CRITERION)*CoinMax(upEstimate,downEstimate); if (value > bestTrusted) { bestObjectIndex_=iObject; bestWhichWay_ = upEstimate>downEstimate ? 0 : 1; bestTrusted = value; } } } int numberFixed=0; if (numberToDo) { returnCode = doStrongBranching(solver, info, numberToDo, 1); if (returnCode>=0&&returnCode<=2) { if (returnCode) { returnCode=4; if (bestObjectIndex_>=0) returnCode=3; } for (int i=0;i=0); upEstimate = results_[i].upChange(); } else { // infeasible - just say expensive if (info->cutoff_<1.0e50) upEstimate = 2.0*(info->cutoff_-info->objectiveValue_); else upEstimate = 2.0*fabs(info->objectiveValue_); if (firstForcedObjectIndex_ <0) { firstForcedObjectIndex_ = iObject; firstForcedWhichWay_ =0; } numberFixed++; if (fixVariables) { const OsiObject * obj = solver->object(iObject); OsiBranchingObject * branch = obj->createBranch(solver,info,0); branch->branch(solver); delete branch; } } double downEstimate; if (results_[i].downStatus()!=1) { assert (results_[i].downStatus()>=0); downEstimate = results_[i].downChange(); } else { // infeasible - just say expensive if (info->cutoff_<1.0e50) downEstimate = 2.0*(info->cutoff_-info->objectiveValue_); else downEstimate = 2.0*fabs(info->objectiveValue_); if (firstForcedObjectIndex_ <0) { firstForcedObjectIndex_ = iObject; firstForcedWhichWay_ =1; } numberFixed++; if (fixVariables) { const OsiObject * obj = solver->object(iObject); OsiBranchingObject * branch = obj->createBranch(solver,info,1); branch->branch(solver); delete branch; } } double value = MAXMIN_CRITERION*CoinMin(upEstimate,downEstimate) + (1.0-MAXMIN_CRITERION)*CoinMax(upEstimate,downEstimate); if (value>bestTrusted) { bestTrusted = value; bestObjectIndex_ = iObject; bestWhichWay_ = upEstimate>downEstimate ? 0 : 1; // but override if there is a preferred way const OsiObject * obj = solver->object(iObject); if (obj->preferredWay()>=0&&obj->infeasibility()) bestWhichWay_ = obj->preferredWay(); if (returnCode) returnCode=2; } } } else if (returnCode==3) { // max time - just choose one bestObjectIndex_ = list_[0]; bestWhichWay_ = 0; returnCode=0; } } else { bestObjectIndex_=list_[0]; } if ( bestObjectIndex_ >=0 ) { OsiObject * obj = solver->objects()[bestObjectIndex_]; obj->setWhichWay( bestWhichWay_); } if (numberFixed==numberUnsatisfied_&&numberFixed) returnCode=4; return returnCode; } else { return 1; } } // Given a candidate fill in useful information e.g. estimates void OsiPseudoCosts::updateInformation(const OsiBranchingInformation *info, int branch, OsiHotInfo * hotInfo) { int index = hotInfo->whichObject(); assert (indexsolver_->numberObjects()); const OsiObject * object = info->solver_->object(index); assert (object->upEstimate()>0.0&&object->downEstimate()>0.0); assert (branch<2); if (branch) { if (hotInfo->upStatus()!=1) { assert (hotInfo->upStatus()>=0); upTotalChange_[index] += hotInfo->upChange()/object->upEstimate(); upNumber_[index]++; } else { #if 0 // infeasible - just say expensive if (info->cutoff_<1.0e50) upTotalChange_[index] += 2.0*(info->cutoff_-info->objectiveValue_)/object->upEstimate(); else upTotalChange_[index] += 2.0*fabs(info->objectiveValue_)/object->upEstimate(); #endif } } else { if (hotInfo->downStatus()!=1) { assert (hotInfo->downStatus()>=0); downTotalChange_[index] += hotInfo->downChange()/object->downEstimate(); downNumber_[index]++; } else { #if 0 // infeasible - just say expensive if (info->cutoff_<1.0e50) downTotalChange_[index] += 2.0*(info->cutoff_-info->objectiveValue_)/object->downEstimate(); else downTotalChange_[index] += 2.0*fabs(info->objectiveValue_)/object->downEstimate(); #endif } } } #if 1 // Given a branch fill in useful information e.g. estimates void OsiPseudoCosts::updateInformation(int index, int branch, double changeInObjective, double changeInValue, int status) { //assert (indexnumberObjects()); assert (branch<2); assert (changeInValue>0.0); assert (branch<2); if (branch) { if (status!=1) { assert (status>=0); upTotalChange_[index] += changeInObjective/changeInValue; upNumber_[index]++; } } else { if (status!=1) { assert (status>=0); downTotalChange_[index] += changeInObjective/changeInValue; downNumber_[index]++; } } } #endif OsiHotInfo::OsiHotInfo() : originalObjectiveValue_(COIN_DBL_MAX), changes_(NULL), iterationCounts_(NULL), statuses_(NULL), branchingObject_(NULL), whichObject_(-1) { } OsiHotInfo::OsiHotInfo(OsiSolverInterface * solver, const OsiBranchingInformation * info, const OsiObject * const * objects, int whichObject) : originalObjectiveValue_(COIN_DBL_MAX), whichObject_(whichObject) { originalObjectiveValue_ = info->objectiveValue_; const OsiObject * object = objects[whichObject_]; // create object - "down" first branchingObject_ = object->createBranch(solver,info,0); // create arrays int numberBranches = branchingObject_->numberBranches(); changes_ = new double [numberBranches]; iterationCounts_ = new int [numberBranches]; statuses_ = new int [numberBranches]; CoinZeroN(changes_,numberBranches); CoinZeroN(iterationCounts_,numberBranches); CoinFillN(statuses_,numberBranches,-1); } OsiHotInfo::OsiHotInfo(const OsiHotInfo & rhs) { originalObjectiveValue_ = rhs.originalObjectiveValue_; whichObject_ = rhs.whichObject_; if (rhs.branchingObject_) { branchingObject_ = rhs.branchingObject_->clone(); int numberBranches = branchingObject_->numberBranches(); changes_ = CoinCopyOfArray(rhs.changes_,numberBranches); iterationCounts_ = CoinCopyOfArray(rhs.iterationCounts_,numberBranches); statuses_ = CoinCopyOfArray(rhs.statuses_,numberBranches); } else { branchingObject_ = NULL; changes_ = NULL; iterationCounts_ = NULL; statuses_ = NULL; } } OsiHotInfo & OsiHotInfo::operator=(const OsiHotInfo & rhs) { if (this != &rhs) { delete branchingObject_; delete [] changes_; delete [] iterationCounts_; delete [] statuses_; originalObjectiveValue_ = rhs.originalObjectiveValue_; whichObject_ = rhs.whichObject_; if (rhs.branchingObject_) { branchingObject_ = rhs.branchingObject_->clone(); int numberBranches = branchingObject_->numberBranches(); changes_ = CoinCopyOfArray(rhs.changes_,numberBranches); iterationCounts_ = CoinCopyOfArray(rhs.iterationCounts_,numberBranches); statuses_ = CoinCopyOfArray(rhs.statuses_,numberBranches); } else { branchingObject_ = NULL; changes_ = NULL; iterationCounts_ = NULL; statuses_ = NULL; } } return *this; } OsiHotInfo::~OsiHotInfo () { delete branchingObject_; delete [] changes_; delete [] iterationCounts_; delete [] statuses_; } // Clone OsiHotInfo * OsiHotInfo::clone() const { return new OsiHotInfo(*this); } /* Fill in useful information after strong branch */ int OsiHotInfo::updateInformation( const OsiSolverInterface * solver, const OsiBranchingInformation * info, OsiChooseVariable * choose) { int iBranch = branchingObject_->branchIndex()-1; assert (iBranch>=0&&iBranchnumberBranches()); iterationCounts_[iBranch] += solver->getIterationCount(); int status; if (solver->isProvenOptimal()) status=0; // optimal else if (solver->isIterationLimitReached() &&!solver->isDualObjectiveLimitReached()) status=2; // unknown else status=1; // infeasible // Could do something different if we can't trust double newObjectiveValue = solver->getObjSense()*solver->getObjValue(); changes_[iBranch] =CoinMax(0.0,newObjectiveValue-originalObjectiveValue_); // we might have got here by primal if (choose->trustStrongForBound()) { if (!status&&newObjectiveValue>=info->cutoff_) { status=1; // infeasible changes_[iBranch] = 1.0e100; } } statuses_[iBranch] = status; if (!status&&choose->trustStrongForSolution()&&newObjectiveValuegoodObjectiveValue()) { // check if solution const OsiSolverInterface * saveSolver = info->solver_; info->solver_=solver; const double * saveLower = info->lower_; info->lower_ = solver->getColLower(); const double * saveUpper = info->upper_; info->upper_ = solver->getColUpper(); // also need to make sure bounds OK as may not be info solver #if 0 if (saveSolver->getMatrixByCol()) { const CoinBigIndex * columnStart = info->columnStart_; assert (saveSolver->getMatrixByCol()->getVectorStarts()==columnStart); } #endif if (choose->feasibleSolution(info,solver->getColSolution(),solver->numberObjects(), const_cast (solver->objects()))) { // put solution somewhere choose->saveSolution(solver); status=3; } info->solver_=saveSolver; info->lower_ = saveLower; info->upper_ = saveUpper; } // Now update - possible strong branching info choose->updateInformation( info,iBranch,this); return status; } Osi-0.106.4/src/Osi/OsiPresolve.cpp0000644000076600007660000014017112136515471015402 0ustar coincoin// Copyright (C) 2002, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). /* Debug compile symbols for CoinPresolve. PRESOLVE_CONSISTENCY, PRESOLVE_DEBUG, and PRESOLVE_SUMMARY control consistency checking and debugging in the continuous presolve. See the comments in CoinPresolvePsdebug.hpp. DO NOT just define the symbols here in this file. Unless these symbols are consistent across all presolve code, you'll get something between garbage and a core dump. */ #include #include #include #include "CoinHelperFunctions.hpp" #include "CoinFinite.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" #include "OsiSolverInterface.hpp" #include "OsiPresolve.hpp" #include "CoinPresolveMatrix.hpp" #if PRESOLVE_CONSISTENCY > 0 || PRESOLVE_DEBUG > 0 || PRESOLVE_SUMMARY > 0 #include "CoinPresolvePsdebug.hpp" #include "CoinPresolveMonitor.hpp" #endif #include "CoinPresolveEmpty.hpp" #include "CoinPresolveFixed.hpp" #include "CoinPresolveSingleton.hpp" #include "CoinPresolveDoubleton.hpp" #include "CoinPresolveTripleton.hpp" #include "CoinPresolveZeros.hpp" #include "CoinPresolveSubst.hpp" #include "CoinPresolveForcing.hpp" #include "CoinPresolveDual.hpp" #include "CoinPresolveTighten.hpp" #include "CoinPresolveUseless.hpp" #include "CoinPresolveDupcol.hpp" #include "CoinPresolveImpliedFree.hpp" #include "CoinPresolveIsolated.hpp" #include "CoinMessage.hpp" OsiPresolve::OsiPresolve() : originalModel_(NULL), presolvedModel_(NULL), nonLinearValue_(0.0), originalColumn_(NULL), originalRow_(NULL), paction_(0), ncols_(0), nrows_(0), nelems_(0), presolveActions_(0), numberPasses_(5) { } OsiPresolve::~OsiPresolve() { gutsOfDestroy(); } // Gets rid of presolve actions (e.g.when infeasible) void OsiPresolve::gutsOfDestroy() { const CoinPresolveAction *paction = paction_; while (paction) { const CoinPresolveAction *next = paction->next; delete paction; paction = next; } delete [] originalColumn_; delete [] originalRow_; paction_=NULL; originalColumn_=NULL; originalRow_=NULL; } /* This version of presolve returns a pointer to a new presolved model. NULL if infeasible doStatus controls activities required to transform an existing solution to match the presolved problem. I'd (lh) argue that this should default to false, but to maintain previous behaviour it defaults to true. Really, this is only useful if you've already optimised before applying presolve and also want to work with the solution after presolve. I think that this is the less common case. The more common situation is to apply presolve before optimising. */ OsiSolverInterface * OsiPresolve::presolvedModel(OsiSolverInterface & si, double feasibilityTolerance, bool keepIntegers, int numberPasses, const char * prohibited, bool doStatus, const char * rowProhibited) { ncols_ = si.getNumCols(); nrows_ = si.getNumRows(); nelems_ = si.getNumElements(); numberPasses_ = numberPasses; double maxmin = si.getObjSense(); originalModel_ = &si; delete [] originalColumn_; originalColumn_ = new int[ncols_]; delete [] originalRow_; originalRow_ = new int[nrows_]; int i; for (i=0;isetContinuous(i); } CoinPresolveMatrix prob(ncols_, maxmin, presolvedModel_, nrows_, nelems_,doStatus,nonLinearValue_,prohibited, rowProhibited); // make sure row solution correct if (doStatus) { double *colels = prob.colels_; int *hrow = prob.hrow_; CoinBigIndex *mcstrt = prob.mcstrt_; int *hincol = prob.hincol_; int ncols = prob.ncols_; double * csol = prob.sol_; double * acts = prob.acts_; int nrows = prob.nrows_; int colx; memset(acts,0,nrows*sizeof(double)); for (colx = 0; colx < ncols; ++colx) { double solutionValue = csol[colx]; for (int i=mcstrt[colx]; i 0 if (doStatus) { int basicCnt = 0 ; int basicColumns = 0; int i ; CoinPresolveMatrix::Status status ; for (i = 0 ; i < prob.ncols_ ; i++) { status = prob.getColumnStatus(i); if (status == CoinPrePostsolveMatrix::basic) basicColumns++ ; } basicCnt = basicColumns; for (i = 0 ; i < prob.nrows_ ; i++) { status = prob.getRowStatus(i); if (status == CoinPrePostsolveMatrix::basic) basicCnt++ ; } # if PRESOLVE_DEBUG > 0 presolve_check_nbasic(&prob) ; # endif if (basicCnt>prob.nrows_) { // Take out slacks double * acts = prob.acts_; double * rlo = prob.rlo_; double * rup = prob.rup_; double infinity = si.getInfinity(); for (i = 0 ; i < prob.nrows_ ; i++) { status = prob.getRowStatus(i); if (status == CoinPrePostsolveMatrix::basic) { basicCnt-- ; double down = acts[i]-rlo[i]; double up = rup[i]-acts[i]; if (CoinMin(up,down)setColSolution(prob.sol_); CoinWarmStartBasis *basis = dynamic_cast(presolvedModel_->getEmptyWarmStart()); basis->resize(prob.nrows_,prob.ncols_); int i; for (i=0;i (prob.getColumnStatus(i)); basis->setStructStatus(i,status); } for (i=0;i (prob.getRowStatus(i)); basis->setArtifStatus(i,status); } presolvedModel_->setWarmStart(basis); delete basis ; delete [] prob.sol_; delete [] prob.acts_; delete [] prob.colstat_; prob.sol_=NULL; prob.acts_=NULL; prob.colstat_=NULL; } /* Copy original column and row information from the CoinPresolveMatrix object so it'll be available for postsolve. */ int ncolsNow = presolvedModel_->getNumCols(); memcpy(originalColumn_,prob.originalColumn_,ncolsNow*sizeof(int)); delete [] prob.originalColumn_; prob.originalColumn_=NULL; int nrowsNow = presolvedModel_->getNumRows(); memcpy(originalRow_,prob.originalRow_,nrowsNow*sizeof(int)); delete [] prob.originalRow_; prob.originalRow_=NULL; // now clean up integer variables. This can modify original { int numberChanges=0; const double * lower0 = originalModel_->getColLower(); const double * upper0 = originalModel_->getColUpper(); const double * lower = presolvedModel_->getColLower(); const double * upper = presolvedModel_->getColUpper(); for (i=0;iisInteger(i)) continue; int iOriginal = originalColumn_[i]; double lowerValue0 = lower0[iOriginal]; double upperValue0 = upper0[iOriginal]; double lowerValue = ceil(lower[i]-1.0e-5); double upperValue = floor(upper[i]+1.0e-5); presolvedModel_->setColBounds(i,lowerValue,upperValue); if (lowerValue>upperValue) { numberChanges++; CoinMessageHandler *hdlr = presolvedModel_->messageHandler() ; hdlr->message(COIN_PRESOLVE_COLINFEAS,msgs) << iOriginal << lowerValue << upperValue << CoinMessageEol ; result=1; } else { if (lowerValue>lowerValue0+1.0e-8) { originalModel_->setColLower(iOriginal,lowerValue); numberChanges++; } if (upperValuesetColUpper(iOriginal,upperValue); numberChanges++; } } } if (numberChanges) { CoinMessageHandler *hdlr = presolvedModel_->messageHandler() ; hdlr->message(COIN_PRESOLVE_INTEGERMODS,msgs) << numberChanges << CoinMessageEol; // we can't go round again in integer if dupcols if (!result && totalPasses > 0 && (prob.presolveOptions_&0x80000000) == 0) { result = -1; // round again const CoinPresolveAction *paction = paction_; while (paction) { const CoinPresolveAction *next = paction->next; delete paction; paction = next; } paction_=NULL; } } } } else if (prob.status_ != 0) { // infeasible or unbounded result = 1 ; } } if (!result) { int nrowsAfter = presolvedModel_->getNumRows(); int ncolsAfter = presolvedModel_->getNumCols(); CoinBigIndex nelsAfter = presolvedModel_->getNumElements(); CoinMessageHandler *hdlr = presolvedModel_->messageHandler() ; hdlr->message(COIN_PRESOLVE_STATS,msgs) << nrowsAfter << -(nrows_-nrowsAfter) << ncolsAfter << -(ncols_-ncolsAfter) << nelsAfter << -(nelems_-nelsAfter) << CoinMessageEol ; } else { gutsOfDestroy(); delete presolvedModel_; presolvedModel_=NULL; } return presolvedModel_; } // Return pointer to presolved model OsiSolverInterface * OsiPresolve::model() const { return presolvedModel_; } // Return pointer to original model OsiSolverInterface * OsiPresolve::originalModel() const { return originalModel_; } void OsiPresolve::postsolve(bool updateStatus) { // Messages CoinMessages msgs = CoinMessage(presolvedModel_->messages().language()) ; CoinMessageHandler *hdlr = presolvedModel_->messageHandler() ; if (!presolvedModel_->isProvenOptimal()) { hdlr->message(COIN_PRESOLVE_NONOPTIMAL,msgs) << CoinMessageEol ; } // this is the size of the original problem const int ncols0 = ncols_ ; const int nrows0 = nrows_ ; const CoinBigIndex nelems0 = nelems_ ; // reality check assert(ncols0 == originalModel_->getNumCols()) ; assert(nrows0 == originalModel_->getNumRows()) ; // this is the reduced problem int ncols = presolvedModel_->getNumCols() ; int nrows = presolvedModel_->getNumRows() ; double *acts = new double [nrows0] ; double *sol = new double [ncols0] ; CoinZeroN(acts,nrows0) ; CoinZeroN(sol,ncols0) ; unsigned char *rowstat = NULL ; unsigned char *colstat = NULL ; CoinWarmStartBasis *presolvedBasis = dynamic_cast(presolvedModel_->getWarmStart()) ; if (!presolvedBasis) updateStatus = false ; if (updateStatus) { colstat = new unsigned char[ncols0+nrows0] ; # ifdef ZEROFAULT memset(colstat,0,((ncols0+nrows0)*sizeof(char))) ; # endif rowstat = colstat+ncols0 ; for (int i = 0 ; i < ncols ; i++) { colstat[i] = presolvedBasis->getStructStatus(i) ; } for (int i = 0 ; i < nrows ; i++) { rowstat[i] = presolvedBasis->getArtifStatus(i) ; } } delete presolvedBasis ; # if PRESOLVE_CONSISTENCY > 0 if (updateStatus) { int basicCnt = 0 ; for (int i = 0 ; i < ncols ; i++) { if (colstat[i] == CoinWarmStartBasis::basic) basicCnt++ ; } for (int i = 0 ; i < nrows ; i++) { if (rowstat[i] == CoinWarmStartBasis::basic) basicCnt++ ; } assert (basicCnt == nrows) ; } # endif /* Postsolve back to the original problem. The CoinPostsolveMatrix object assumes ownership of sol, acts, colstat, and rowstat. */ CoinPostsolveMatrix prob(presolvedModel_,ncols0,nrows0,nelems0, presolvedModel_->getObjSense(), sol,acts,colstat,rowstat) ; postsolve(prob) ; # if PRESOLVE_CONSISTENCY > 0 if (updateStatus) { int basicCnt = 0 ; for (int i = 0 ; i < ncols0 ; i++) { if (prob.getColumnStatus(i) == CoinPrePostsolveMatrix::basic) basicCnt++ ; } for (int i = 0 ; i < nrows0 ; i++) { if (prob.getRowStatus(i) == CoinPrePostsolveMatrix::basic) basicCnt++ ; } assert (basicCnt == nrows0) ; } # endif originalModel_->setColSolution(sol) ; if (updateStatus) { CoinWarmStartBasis *basis = dynamic_cast(presolvedModel_->getEmptyWarmStart()) ; basis->setSize(ncols0,nrows0) ; for (int i = 0 ; i < ncols0 ; i++) { CoinWarmStartBasis::Status status = static_cast(prob.getColumnStatus(i)) ; assert(status != CoinWarmStartBasis::atLowerBound || originalModel_->getColLower()[i] > -originalModel_->getInfinity()) ; assert(status != CoinWarmStartBasis::atUpperBound || originalModel_->getColUpper()[i] < originalModel_->getInfinity()) ; basis->setStructStatus(i,status); } # if PRESOLVE_DEBUG > 0 /* Do a thorough check of row and column solutions. There should be no inconsistencies at this point. */ std::cout << "Checking solution before transferring basis." << std::endl ; presolve_check_sol(&prob,2,2,2) ; int errs = 0 ; # endif for (int i = 0 ; i < nrows0 ; i++) { CoinWarmStartBasis::Status status = static_cast(prob.getRowStatus(i)) ; basis->setArtifStatus(i,status); } originalModel_->setWarmStart(basis); delete basis ; } } // return pointer to original columns const int * OsiPresolve::originalColumns() const { return originalColumn_; } // return pointer to original rows const int * OsiPresolve::originalRows() const { return originalRow_; } // Set pointer to original model void OsiPresolve::setOriginalModel(OsiSolverInterface * model) { originalModel_=model; } #if 0 // A lazy way to restrict which transformations are applied // during debugging. static int ATOI(const char *name) { return true; #if PRESOLVE_DEBUG > 0 || PRESOLVE_SUMMARY > 0 if (getenv(name)) { int val = atoi(getenv(name)); printf("%s = %d\n", name, val); return (val); } else { if (strcmp(name,"off")) return (true); else return (false); } #else return (true); #endif } #endif #if PRESOLVE_DEBUG > 0 // Anonymous namespace for debug routines namespace { /* A control routine for debug checks --- keeps down the clutter in doPresolve. Each time it's called, it prints a list of transforms applied since the last call, then does checks. */ void check_and_tell (const CoinPresolveMatrix *const prob, const CoinPresolveAction *first, const CoinPresolveAction *&mark) { const CoinPresolveAction *current ; if (first != mark) { printf("PRESOLVE: applied") ; for (current = first ; current != mark && current != 0 ; current = current->next) { printf(" %s",current->name()) ; } printf("\n") ; presolve_check_sol(prob) ; presolve_check_nbasic(prob) ; mark = first ; } return ; } /* At a guess, this code is intended to allow a known solution to be checked against presolve progress. Pulled it into the local debug namespace, but really should be integrated with CoinPresolvePsdebug. At the least, needs a method to conveniently set debugSolution. -- lh, 110605 -- */ double *debugSolution = NULL ; int debugNumberColumns = -1 ; int counter = 1000000 ; bool break2 (CoinPresolveMatrix *prob) { if (counter > 0) printf("break2: counter %d\n",counter) ; counter-- ; if (debugSolution && prob->ncols_ == debugNumberColumns) { for (int i = 0 ; i < prob->ncols_ ; i++) { double value = debugSolution[i] ; if (value < prob->clo_[i]) { printf("%d inf %g %g %g\n",i,prob->clo_[i],value,prob->cup_[i]) ; } else if (value > prob->cup_[i]) { printf("%d inf %g %g %g\n",i,prob->clo_[i],value,prob->cup_[i]) ; } } } if (!counter) { printf("skipping next and all\n") ; } return (counter <= 0) ; } } // end anonymous namespace for debug routines #endif #if PRESOLVE_DEBUG > 0 # define possibleBreak if (break2(prob)) break # define possibleSkip if (!break2(prob)) #else # define possibleBreak # define possibleSkip #endif // This is the presolve loop. // It is a separate virtual function so that it can be easily // customized by subclassing CoinPresolve. const CoinPresolveAction *OsiPresolve::presolve(CoinPresolveMatrix *prob) { paction_ = 0 ; prob->status_ = 0 ; // say feasible # if PRESOLVE_DEBUG > 0 const CoinPresolveAction *pactiond = 0 ; presolve_check_sol(prob,2,1,1) ; // CoinPresolveMonitor *monitor = new CoinPresolveMonitor(prob,true,22) ; CoinPresolveMonitor *monitor = 0 ; # endif /* Transfer costs off of singleton variables, and also between integer variables when advantageous. transferCosts is defined in CoinPresolveFixed.cpp */ if ((presolveActions_&0x04) != 0) { transferCosts(prob) ; # if PRESOLVE_DEBUG > 0 if (monitor) monitor->checkAndTell(prob) ; # endif } /* Fix variables before we get into the main transform loop. */ paction_ = make_fixed(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif // if integers then switch off dual stuff // later just do individually bool doDualStuff = true ; if ((presolveActions_&0x01) == 0) { int ncol = presolvedModel_->getNumCols() ; for (int i = 0 ; i < ncol ; i++) if (presolvedModel_->isInteger(i)) doDualStuff = false ; } # if PRESOLVE_CONSISTENCY > 0 presolve_links_ok(prob) ; # endif /* If we're feasible, set up for the main presolve transform loop. */ if (!prob->status_) { # if 0 /* This block is used during debugging. See ATOI to see how it works. Some editing will be required to turn it all on. */ bool slackd = ATOI("SLACKD")!=0; //bool forcing = ATOI("FORCING")!=0; bool doubleton = ATOI("DOUBLETON")!=0; bool forcing = ATOI("off")!=0; bool ifree = ATOI("off")!=0; bool zerocost = ATOI("off")!=0; bool dupcol = ATOI("off")!=0; bool duprow = ATOI("off")!=0; bool dual = ATOI("off")!=0; # else # if 1 // normal operation --- all transforms enabled bool slackSingleton = true; bool slackd = true; bool doubleton = true; bool tripleton = true; bool forcing = true; bool ifree = true; bool zerocost = true; bool dupcol = true; bool duprow = true; bool dual = doDualStuff; # else // compile time selection of transforms. bool slackSingleton = true; bool slackd = false; bool doubleton = true; bool tripleton = true; bool forcing = true; bool ifree = false; bool zerocost = false; bool dupcol = false; bool duprow = false; bool dual = false; # endif # endif /* Process OsiPresolve options. Set corresponding CoinPresolve options and control variables here. */ // Switch off some stuff if would annoy set partitioning etc if ((presolveActions_&0x02) != 0) { doubleton = false; tripleton = false; ifree = false; } // stop x+y+z=1 if ((presolveActions_&0x08) != 0) prob->setPresolveOptions(prob->presolveOptions()|0x04) ; // switch on stuff which can't be unrolled easily if ((presolveActions_&0x10) != 0) prob->setPresolveOptions(prob->presolveOptions()|0x10) ; // switch on gub stuff (unimplemented as of 110605 -- lh --) if ((presolveActions_&0x20) != 0) prob->setPresolveOptions(prob->presolveOptions()|0x20) ; // allow duplicate column processing for integer columns if ((presolveActions_&0x01) != 0) prob->setPresolveOptions(prob->presolveOptions()|0x01) ; /* Set [rows,cols]ToDo to process all rows & cols unless there are specific prohibitions. */ prob->initColsToDo() ; prob->initRowsToDo() ; /* Try to remove duplicate rows and columns. */ if (dupcol) { possibleSkip ; paction_ = dupcol_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 if (monitor) monitor->checkAndTell(prob) ; # endif } if (duprow) { possibleSkip ; paction_ = duprow_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 if (monitor) monitor->checkAndTell(prob) ; # endif } /* The main loop starts with a minor loop that does inexpensive presolve transforms until convergence. At each iteration of this loop, next[Rows,Cols]ToDo is copied over to [rows,cols]ToDo. Then there's a block to set [rows,cols]ToDo to examine all rows & cols, followed by executions of expensive transforms. Then we come back around for another iteration of the main loop. [rows,cols]ToDo is not reset as we come back around, so we dive into the inexpensive loop set up to process all. lastDropped is a count of total number of rows dropped by presolve. Used as an additional criterion to end the main presolve loop. */ int lastDropped = 0 ; prob->pass_ = 0 ; for (int iLoop = 0 ; iLoop < numberPasses_ ; iLoop++) { # if PRESOLVE_SUMMARY > 0 std::cout << "Starting major pass " << (iLoop+1) << std::endl ; # endif const CoinPresolveAction *const paction0 = paction_ ; // #define IMPLIED 3 #ifdef IMPLIED int fill_level = 3 ; # define IMPLIED2 1 # if IMPLIED != 3 # if IMPLIED > 0 && IMPLIED < 11 fill_level = IMPLIED ; printf("** fill_level == %d !\n",fill_level) ; # endif # if IMPLIED > 11 && IMPLIED < 21 fill_level = -(IMPLIED-10) ; printf("** fill_level == %d !\n",fill_level); # endif # endif #else // look for substitutions with no fill int fill_level = 2 ; #endif int whichPass = 0 ; /* Apply inexpensive transforms until convergence or infeasible/unbounded. */ while (true) { whichPass++ ; prob->pass_++ ; const CoinPresolveAction *const paction1 = paction_ ; if (slackd) { bool notFinished = true ; while (notFinished) { possibleBreak ; paction_ = slack_doubleton_action::presolve(prob,paction_,notFinished) ; } # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (dual && whichPass == 1) { possibleBreak; // this can also make E rows so do one bit here paction_ = remove_dual_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (doubleton) { possibleBreak ; paction_ = doubleton_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (tripleton) { possibleBreak ; paction_ = tripleton_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (zerocost) { possibleBreak ; paction_ = do_tighten_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (forcing) { possibleBreak; paction_ = forcing_constraint_action::presolve(prob, paction_); # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (ifree && (whichPass%5) == 1) { possibleBreak ; paction_ = implied_free_action::presolve(prob,paction_,fill_level) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } # if PRESOLVE_CONSISTENCY > 0 presolve_links_ok(prob) ; presolve_no_zeros(prob) ; presolve_consistent(prob) ; # endif /* Set up for next pass. Original comment adds: later do faster if many changes i.e. memset and memcpy */ prob->stepRowsToDo() ; # if PRESOLVE_DEBUG > 0 int rowCheck = -1 ; bool rowFound = false ; for (int i = 0 ; i < prob->numberRowsToDo_ ; i++) { int index = prob->rowsToDo_[i]; if (index == rowCheck) { std::cout << " row " << index << " on list after pass " << whichPass << std::endl ; rowFound = true ; } } if (!rowFound && rowCheck >= 0) prob->rowsToDo_[prob->numberRowsToDo_++] = rowCheck ; # endif prob->stepColsToDo() ; # if PRESOLVE_DEBUG > 0 int colCheck = -1 ; bool colFound = false ; for (int i = 0 ; i < prob->numberNextColsToDo_ ; i++) { int index = prob->colsToDo_[i] ; if (index == colCheck) { std::cout << " col " << index << " on list after pass " << whichPass << std::endl ; colFound = true ; } } if (!colFound && colCheck >= 0) prob->colsToDo_[prob->numberColsToDo_++] = colCheck ; # endif /* Break if nothing happened (no postsolve actions queued). The check for fill_level > 0 is a hack to allow repeating the loop with some modified fill level (playing with negative values). fill_level = 0 (as set in other places) will clearly be a problem. -- lh, 110605 -- */ if (paction_ == paction1 && fill_level > 0) break ; } /* End of inexpensive transform loop. Reset [rows,cols]ToDo to process all rows and columns unless there are specfic prohibitions. */ prob->initRowsToDo() ; prob->initColsToDo() ; /* Try expensive presolve transforms. Original comment adds: this caused world.mps to run into numerical difficulties */ # if PRESOLVE_SUMMARY > 0 std::cout << "Starting expensive." << std::endl ; # endif /* Try and fix variables at upper or lower bound by calculating bounds on the dual variables and propagating them to the reduced costs. Every other iteration, see if this has created free variables. */ if (dual) { for (int itry = 0 ; itry < 5 ; itry++) { const CoinPresolveAction *const paction2 = paction_ ; possibleBreak ; paction_ = remove_dual_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; if (ifree) { #ifdef IMPLIED # if IMPLIED2 == 0 int fill_level = 0 ; // switches off substitution # elif IMPLIED2 != 99 int fill_level = IMPLIED2 ; # endif #endif if ((itry&1) == 0) { possibleBreak ; paction_ = implied_free_action::presolve(prob,paction_,fill_level) ; } # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (paction_ == paction2) break ; } } else if (ifree) { /* Just check for free variables. */ #ifdef IMPLIED # if IMPLIED2 == 0 int fill_level = 0 ; // switches off substitution # elif IMPLIED2 != 99 int fill_level = IMPLIED2 ; # endif #endif possibleBreak ; paction_ = implied_free_action::presolve(prob,paction_,fill_level) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } /* Check if other transformations have produced duplicate rows or columns. */ if (dupcol) { possibleBreak ; paction_ = dupcol_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } if (duprow) { possibleBreak ; paction_ = duprow_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif if (prob->status_) break ; } // Will trigger abort due to unimplemented postsolve -- lh, 110605 -- if ((presolveActions_&0x20) != 0) { possibleBreak ; paction_ = gubrow_action::presolve(prob,paction_) ; } /* Count the number of empty rows and see if we've made progress in this pass. */ bool stopLoop = false ; { const int *const hinrow = prob->hinrow_ ; int numberDropped = 0 ; for (int i = 0 ; i < nrows_ ; i++) if (!hinrow[i]) numberDropped++ ; # if PRESOLVE_DEBUG > 0 std::cout << " " << (numberDropped-lastDropped) << " rows dropped in pass " << iLoop << "." << std::endl ; # endif if (numberDropped == lastDropped) stopLoop = true ; else lastDropped = numberDropped ; } /* Check for singleton variables that can act like a logical, allowing a row to be transformed from an equality to an inequality. The third parameter allows for costs for the existing logicals. This is apparently used by clp; consult the clp presolve before implementing it here. -- lh, 110605 -- Original comment: Do this here as not very loopy */ if (slackSingleton) { possibleBreak ; paction_ = slack_singleton_action::presolve(prob,paction_,NULL) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif } # if PRESOLVE_DEBUG > 0 presolve_check_sol(prob,1) ; # endif if (paction_ == paction0 || stopLoop) break ; } // End of major pass loop } /* Final cleanup: drop zero coefficients from the matrix, then drop empty rows and columns. */ if (!prob->status_) { paction_ = drop_zero_coefficients(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; if (monitor) monitor->checkAndTell(prob) ; # endif paction_ = drop_empty_cols_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; # endif paction_ = drop_empty_rows_action::presolve(prob,paction_) ; # if PRESOLVE_DEBUG > 0 check_and_tell(prob,paction_,pactiond) ; # endif } /* Not feasible? Say something and clean up. */ CoinMessageHandler *hdlr = prob->messageHandler() ; CoinMessages msgs = CoinMessage(prob->messages().language()); if (prob->status_) { if (prob->status_ == 1) hdlr->message(COIN_PRESOLVE_INFEAS,msgs) << prob->feasibilityTolerance_ << CoinMessageEol ; else if (prob->status_ == 2) hdlr->message(COIN_PRESOLVE_UNBOUND,msgs) << CoinMessageEol ; else hdlr->message(COIN_PRESOLVE_INFEASUNBOUND,msgs) << CoinMessageEol ; gutsOfDestroy() ; } return (paction_) ; } /* We could have implemented this by having each postsolve routine directly call the next one, but this makes it easier to add debugging checks. */ void OsiPresolve::postsolve (CoinPostsolveMatrix &prob) { const CoinPresolveAction *paction = paction_; # if PRESOLVE_DEBUG > 0 std::cout << "Begin POSTSOLVING." << std::endl ; if (prob.colstat_) { presolve_check_nbasic(&prob) ; presolve_check_sol(&prob,2,2,2) ; } presolve_check_duals(&prob) ; # endif while (paction) { # if PRESOLVE_DEBUG > 0 std::cout << "POSTSOLVING " << paction->name() << std::endl ; # endif paction->postsolve(&prob); # if PRESOLVE_DEBUG > 0 if (prob.colstat_) { presolve_check_nbasic(&prob) ; presolve_check_sol(&prob,2,2,2) ; } # endif paction = paction->next ; # if PRESOLVE_DEBUG > 0 presolve_check_duals(&prob); # endif } # if PRESOLVE_DEBUG > 0 std::cout << "End POSTSOLVING" << std::endl ; # endif # if PRESOLVE_DEBUG > 0 for (int j = 0 ; j < prob.ncols_ ; j++) { if (!prob.cdone_[j]) { printf("!cdone[%d]\n", j) ; abort() ; } } for (int i = 0 ; i < prob.nrows_ ; i++) { if (!prob.rdone_[i]) { printf("!rdone[%d]\n", i) ; abort() ; } } for (int j = 0 ; j < prob.ncols_ ; j++) { if (prob.sol_[j] < -1e10 || prob.sol_[j] > 1e10) printf("!!!%d %g\n",j,prob.sol_[j]) ; } # endif /* Put back duals. Flip sign for maximisation problems. */ double maxmin = originalModel_->getObjSense() ; if (maxmin < 0.0) { double *pi = prob.rowduals_ ; for (int i = 0 ; i < nrows_ ; i++) pi[i] = -pi[i] ; } originalModel_->setRowPrice(prob.rowduals_) ; } static inline double getTolerance(const OsiSolverInterface *si, OsiDblParam key) { double tol; if (!si->getDblParam(key,tol)) { CoinPresolveAction::throwCoinError("getDblParam failed", "CoinPrePostsolveMatrix::CoinPrePostsolveMatrix") ; } return (tol) ; } // Assumptions: // 1. nrows>=m.getNumRows() // 2. ncols>=m.getNumCols() // // In presolve, these values are equal. // In postsolve, they may be inequal, since the reduced problem // may be smaller, but we need room for the large problem. // ncols may be larger than si.getNumCols() in postsolve, // this at that point si will be the reduced problem, // but we need to reserve enough space for the original problem. CoinPrePostsolveMatrix::CoinPrePostsolveMatrix(const OsiSolverInterface * si, int ncols_in, int nrows_in, CoinBigIndex nelems_in) : ncols_(si->getNumCols()), nelems_(si->getNumElements()), ncols0_(ncols_in), nrows0_(nrows_in), bulkRatio_(2.0), mcstrt_(new CoinBigIndex[ncols_in+1]), hincol_(new int[ncols_in+1]), cost_(new double[ncols_in]), clo_(new double[ncols_in]), cup_(new double[ncols_in]), rlo_(new double[nrows_in]), rup_(new double[nrows_in]), originalColumn_(new int[ncols_in]), originalRow_(new int[nrows_in]), ztolzb_(getTolerance(si, OsiPrimalTolerance)), ztoldj_(getTolerance(si, OsiDualTolerance)), maxmin_(si->getObjSense()), handler_(0), defaultHandler_(false), messages_() { bulk0_ = static_cast(bulkRatio_*nelems_in) ; hrow_ = new int [bulk0_] ; colels_ = new double[bulk0_] ; si->getDblParam(OsiObjOffset,originalOffset_); int ncols = si->getNumCols(); int nrows = si->getNumRows(); setMessageHandler(si->messageHandler()) ; CoinDisjointCopyN(si->getColLower(), ncols, clo_); CoinDisjointCopyN(si->getColUpper(), ncols, cup_); CoinDisjointCopyN(si->getObjCoefficients(), ncols, cost_); CoinDisjointCopyN(si->getRowLower(), nrows, rlo_); CoinDisjointCopyN(si->getRowUpper(), nrows, rup_); int i; // initialize and clean up bounds double infinity = si->getInfinity(); if (infinity!=COIN_DBL_MAX) { for (i=0;i= 0; --i) { if (start[i+1] - start[i] != length[i]) break; } return (! (i >= 0)); } CoinPresolveMatrix::CoinPresolveMatrix(int ncols0_in, double maxmin, // end prepost members OsiSolverInterface * si, // rowrep int nrows_in, CoinBigIndex nelems_in, bool doStatus, double nonLinearValue, const char * prohibited, const char * rowProhibited) : CoinPrePostsolveMatrix(si,ncols0_in,nrows_in,nelems_in), clink_(new presolvehlink[ncols0_in+1]), rlink_(new presolvehlink[nrows_in+1]), dobias_(0.0), // temporary init mrstrt_(new CoinBigIndex[nrows_in+1]), hinrow_(new int[nrows_in+1]), integerType_(new unsigned char[ncols0_in]), tuning_(false), startTime_(0.0), feasibilityTolerance_(0.0), status_(-1), maxSubstLevel_(3), colsToDo_(new int [ncols0_in]), numberColsToDo_(0), nextColsToDo_(new int[ncols0_in]), numberNextColsToDo_(0), rowsToDo_(new int [nrows_in]), numberRowsToDo_(0), nextRowsToDo_(new int[nrows_in]), numberNextRowsToDo_(0), presolveOptions_(0) { rowels_ = new double [bulk0_] ; hcol_ = new int [bulk0_] ; nrows_ = si->getNumRows() ; const CoinBigIndex bufsize = static_cast(bulkRatio_*nelems_in) ; // Set up change bits rowChanged_ = new unsigned char[nrows_]; memset(rowChanged_,0,nrows_); colChanged_ = new unsigned char[ncols_]; memset(colChanged_,0,ncols_); const CoinPackedMatrix * m1 = si->getMatrixByCol(); // The coefficient matrix is a big hunk of stuff. // Do the copy here to try to avoid running out of memory. const CoinBigIndex * start = m1->getVectorStarts(); const int * length = m1->getVectorLengths(); const int * row = m1->getIndices(); const double * element = m1->getElements(); int icol,nel=0; mcstrt_[0]=0; for (icol=0;icolZTOLDP) { hrow_[nel]=row[j]; colels_[nel++]=element[j]; } } hincol_[icol]=nel-mcstrt_[icol]; mcstrt_[icol+1]=nel; } // same thing for row rep CoinPackedMatrix * m = new CoinPackedMatrix(); m->reverseOrderedCopyOf(*si->getMatrixByCol()); // do by hand because of zeros m->removeGaps(); CoinDisjointCopyN(m->getVectorStarts(), nrows_, mrstrt_); mrstrt_[nrows_] = nelems_; CoinDisjointCopyN(m->getVectorLengths(), nrows_, hinrow_); CoinDisjointCopyN(m->getIndices(), nelems_, hcol_); CoinDisjointCopyN(m->getElements(), nelems_, rowels_); start = m->getVectorStarts(); length = m->getVectorLengths(); const int * column = m->getIndices(); element = m->getElements(); // out zeros int irow; nel=0; mrstrt_[0]=0; for (irow=0;irowZTOLDP) { hcol_[nel]=column[j]; rowels_[nel++]=element[j]; } } hinrow_[irow]=nel-mrstrt_[irow]; mrstrt_[irow+1]=nel; } nelems_=nel; delete m; { int i; for (i=0;iisInteger(i)) integerType_[i] = 1; else integerType_[i] = 0; } } // Set up prohibited bits if needed if (nonLinearValue) { anyProhibited_ = true; for (icol=0;icolgetColSolution() ; memcpy(sol_,presol,ncols_*sizeof(double));; acts_ = new double [nrows_]; memcpy(acts_,si->getRowActivity(),nrows_*sizeof(double)); CoinWarmStartBasis * basis = dynamic_cast(si->getWarmStart()); colstat_ = new unsigned char [nrows_+ncols_]; rowstat_ = colstat_+ncols_; // If basis is NULL then put in all slack basis if (basis&&basis->getNumStructural()==ncols_) { int i; for (i=0;igetStructStatus(i); } for (i=0;igetArtifStatus(i); } } else { int i; // no basis for (i=0;i 0 presolve_consistent(this) ; # endif } // avoid compiler warnings about unused variables #if PRESOLVE_SUMMARY > 0 void CoinPresolveMatrix::update_model(OsiSolverInterface * si, int nrows0, int ncols0, CoinBigIndex nelems0) #else void CoinPresolveMatrix::update_model(OsiSolverInterface * si, int /*nrows0*/, int /*ncols0*/, CoinBigIndex /*nelems0*/) #endif { int nels=0; int i; if (si->getObjSense() < 0.0) { for (int i=0;iloadProblem(m, clo_, cup_, cost_, rlo_, rup_); for ( i=0; isetInteger(i); else si->setContinuous(i); } si->setDblParam(OsiObjOffset,originalOffset_-dobias_); # if PRESOLVE_SUMMARY > 0 std::cout << "New ncol/nrow/nels: " << ncols_ << "(-" << ncols0-ncols_ << ") " << nrows_ << "(-" << nrows0-nrows_ << ") " << si->getNumElements() << "(-" << nelems0-si->getNumElements() << ") " << std::endl ; # endif } //////////////// POSTSOLVE CoinPostsolveMatrix::CoinPostsolveMatrix(OsiSolverInterface* si, int ncols0_in, int nrows0_in, CoinBigIndex nelems0, double maxmin, // end prepost members double *sol_in, double *acts_in, unsigned char *colstat_in, unsigned char *rowstat_in) : CoinPrePostsolveMatrix(si, ncols0_in, nrows0_in, nelems0), /* Used only to mark processed columns and rows so that debugging routines know what to check. */ # if PRESOLVE_DEBUG > 0 || PRESOLVE_CONSISTENCY > 0 cdone_(new char[ncols0_in]), rdone_(new char[nrows0_in]) # else cdone_(0), rdone_(0) # endif { /* The CoinPrePostsolveMatrix constructor will set bulk0_ to bulkRatio_*nelems0. By default, bulkRatio_ is 2. This is certainly larger than absolutely necessary, but good for efficiency (minimises the need to compress the bulk store). The main storage arrays for the threaded column-major representation (hrow_, colels_, link_) should be allocated to this size. */ free_list_ = 0 ; maxlink_ = bulk0_ ; link_ = new int[maxlink_] ; nrows_ = si->getNumRows() ; ncols_ = si->getNumCols() ; sol_=sol_in; rowduals_=NULL; acts_=acts_in; rcosts_=NULL; colstat_=colstat_in; rowstat_=rowstat_in; // this is the *reduced* model, which is probably smaller int ncols1 = ncols_ ; int nrows1 = nrows_ ; const CoinPackedMatrix * m = si->getMatrixByCol(); #if 0 if (! isGapFree(*m)) { CoinPresolveAction::throwCoinError("Matrix not gap free", "CoinPostsolveMatrix"); } #endif const CoinBigIndex nelemsr = m->getNumElements(); if (isGapFree(*m)) { CoinDisjointCopyN(m->getVectorStarts(), ncols1, mcstrt_); CoinZeroN(mcstrt_+ncols1,ncols0_-ncols1); mcstrt_[ncols_] = nelems0; // points to end of bulk store CoinDisjointCopyN(m->getVectorLengths(),ncols1, hincol_); CoinDisjointCopyN(m->getIndices(), nelemsr, hrow_); CoinDisjointCopyN(m->getElements(), nelemsr, colels_); } else { CoinPackedMatrix* mm = new CoinPackedMatrix(*m); if( mm->hasGaps()) mm->removeGaps(); assert(nelemsr == mm->getNumElements()); CoinDisjointCopyN(mm->getVectorStarts(), ncols1, mcstrt_); CoinZeroN(mcstrt_+ncols1,ncols0_-ncols1); mcstrt_[ncols_] = nelems0; // points to end of bulk store CoinDisjointCopyN(mm->getVectorLengths(),ncols1, hincol_); CoinDisjointCopyN(mm->getIndices(), nelemsr, hrow_); CoinDisjointCopyN(mm->getElements(), nelemsr, colels_); } # if PRESOLVE_DEBUG > 0 || PRESOLVE_CONSISTENCY > 0 memset(cdone_, -1, ncols0_); memset(rdone_, -1, nrows0_); # endif rowduals_ = new double[nrows0_]; CoinDisjointCopyN(si->getRowPrice(), nrows1, rowduals_); rcosts_ = new double[ncols0_]; CoinDisjointCopyN(si->getReducedCost(), ncols1, rcosts_); #if PRESOLVE_DEBUG > 0 // check accuracy of reduced costs (rcosts_ is recalculated reduced costs) si->getMatrixByCol()->transposeTimes(rowduals_,rcosts_) ; const double *obj = si->getObjCoefficients() ; const double *dj = si->getReducedCost() ; { int i; for (i=0;igetColSolution(), ncols1, sol_); CoinDisjointCopyN(si->getRowActivity(), nrows1, acts_) ; si->setDblParam(OsiObjOffset,originalOffset_); for (int j=0; j0) link_[kce-1] = NO_LINK ; } if (maxlink_>0) { int ml = maxlink_; for (CoinBigIndex k=nelemsr; k 0 || PRESOLVE_CONSISTENCY > 0 /* These are used to track the action of postsolve transforms during debugging. */ CoinFillN(cdone_,ncols1,PRESENT_IN_REDUCED) ; CoinZeroN(cdone_+ncols1,ncols0_in-ncols1) ; CoinFillN(rdone_,nrows1,PRESENT_IN_REDUCED) ; CoinZeroN(rdone_+nrows1,nrows0_in-nrows1) ; # endif } Osi-0.106.4/src/Osi/OsiCut.hpp0000644000076600007660000001652311552534623014347 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiCut_H #define OsiCut_H #include "OsiCollections.hpp" #include "OsiSolverInterface.hpp" /** Base Class for cut. The Base cut class contains:
  • a measure of the cut's effectivness
*/ /* COIN_NOTEST_DUPLICATE is rooted in CoinUtils. Check there before you meddle here. */ #ifdef COIN_FAST_CODE #ifndef COIN_NOTEST_DUPLICATE #define COIN_NOTEST_DUPLICATE #endif #endif #ifndef COIN_NOTEST_DUPLICATE #define COIN_DEFAULT_VALUE_FOR_DUPLICATE true #else #define COIN_DEFAULT_VALUE_FOR_DUPLICATE false #endif class OsiCut { public: //------------------------------------------------------------------- /**@name Effectiveness */ //@{ /// Set effectiveness inline void setEffectiveness( double e ); /// Get effectiveness inline double effectiveness() const; //@} /**@name GloballyValid */ //@{ /// Set globallyValid (nonzero true) inline void setGloballyValid( bool trueFalse ) { globallyValid_=trueFalse ? 1 : 0;} inline void setGloballyValid( ) { globallyValid_=1;} inline void setNotGloballyValid( ) { globallyValid_=0;} /// Get globallyValid inline bool globallyValid() const { return globallyValid_!=0;} /// Set globallyValid as integer (nonzero true) inline void setGloballyValidAsInteger( int trueFalse ) { globallyValid_=trueFalse;} /// Get globallyValid inline int globallyValidAsInteger() const { return globallyValid_;} //@} /**@name Debug stuff */ //@{ /// Print cuts in collection virtual void print() const {} //@} #if 0 / **@name Times used */ / /@{ / // Set times used inline void setTimesUsed( int t ); / // Increment times used inline void incrementTimesUsed(); / // Get times used inline int timesUsed() const; / /@} / **@name Times tested */ / /@{ / // Set times tested inline void setTimesTested( int t ); / // Increment times tested inline void incrementTimesTested(); / // Get times tested inline int timesTested() const; / /@} #endif //---------------------------------------------------------------- /**@name Comparison operators */ //@{ ///equal. 2 cuts are equal if there effectiveness are equal inline virtual bool operator==(const OsiCut& rhs) const; /// not equal inline virtual bool operator!=(const OsiCut& rhs) const; /// less than. True if this.effectiveness < rhs.effectiveness inline virtual bool operator< (const OsiCut& rhs) const; /// less than. True if this.effectiveness > rhs.effectiveness inline virtual bool operator> (const OsiCut& rhs) const; //@} //---------------------------------------------------------------- // consistent() - returns true if the cut is consistent with repect to itself. // This might include checks to ensure that a packed vector // itself does not have a negative index. // consistent(const OsiSolverInterface& si) - returns true if cut is consistent with // respect to the solver interface's model. This might include a check to // make sure a column index is not greater than the number // of columns in the problem. // infeasible(const OsiSolverInterface& si) - returns true if the cut is infeasible // "with respect to itself". This might include a check to ensure // the lower bound is greater than the upper bound, or if the // cut simply replaces bounds that the new bounds are feasible with // respect to the old bounds. //----------------------------------------------------------------- /**@name Sanity checks on cut */ //@{ /** Returns true if the cut is consistent with respect to itself, without considering any data in the model. For example, it might check to ensure that a column index is not negative. */ inline virtual bool consistent() const=0; /** Returns true if cut is consistent when considering the solver interface's model. For example, it might check to ensure that a column index is not greater than the number of columns in the model. Assumes consistent() is true. */ inline virtual bool consistent(const OsiSolverInterface& si) const=0; /** Returns true if the cut is infeasible "with respect to itself" and cannot be satisfied. This method does NOT check whether adding the cut to the solver interface's model will make the -model- infeasble. A cut which returns !infeasible(si) may very well make the model infeasible. (Of course, adding a cut with returns infeasible(si) will make the model infeasible.) The "with respect to itself" is in quotes becaues in the case where the cut simply replaces existing bounds, it may make sense to test infeasibility with respect to the current bounds held in the solver interface's model. For example, if the cut has a single variable in it, it might check that the maximum of new and existing lower bounds is greater than the minium of the new and existing upper bounds. Assumes that consistent(si) is true.
Infeasible cuts can be a useful mechanism for a cut generator to inform the solver interface that its detected infeasibility of the problem. */ inline virtual bool infeasible(const OsiSolverInterface &si) const=0; /** Returns infeasibility of the cut with respect to solution passed in i.e. is positive if cuts off that solution. solution is getNumCols() long.. */ virtual double violated(const double * solution) const=0; //@} protected: /**@name Constructors and destructors */ //@{ /// Default Constructor OsiCut (); /// Copy constructor OsiCut ( const OsiCut &); /// Assignment operator OsiCut & operator=( const OsiCut& rhs); /// Destructor virtual ~OsiCut (); //@} private: /**@name Private member data */ //@{ /// Effectiveness double effectiveness_; /// If cut has global validity i.e. can be used anywhere in tree int globallyValid_; #if 0 /// Times used int timesUsed_; /// Times tested int timesTested_; #endif //@} }; //------------------------------------------------------------------- // Set/Get member data //------------------------------------------------------------------- void OsiCut::setEffectiveness(double e) { effectiveness_=e; } double OsiCut::effectiveness() const { return effectiveness_; } #if 0 void OsiCut::setTimesUsed( int t ) { timesUsed_=t; } void OsiCut::incrementTimesUsed() { timesUsed_++; } int OsiCut::timesUsed() const { return timesUsed_; } void OsiCut::setTimesTested( int t ) { timesTested_=t; } void OsiCut::incrementTimesTested() { timesTested_++; } int OsiCut::timesTested() const{ return timesTested_; } #endif //---------------------------------------------------------------- // == operator //------------------------------------------------------------------- bool OsiCut::operator==(const OsiCut& rhs) const { return effectiveness()==rhs.effectiveness(); } bool OsiCut::operator!=(const OsiCut& rhs) const { return !( (*this)==rhs ); } bool OsiCut::operator< (const OsiCut& rhs) const { return effectiveness() (const OsiCut& rhs) const { return effectiveness()>rhs.effectiveness(); } #endif Osi-0.106.4/src/Osi/OsiRowCutDebugger.cpp0000644000076600007660000016105412130104324016457 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include #include #include #include #include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" #include "OsiRowCutDebugger.hpp" /* Check if any cuts cut off the known solution. If so then print offending cuts and return non-zero code */ int OsiRowCutDebugger::validateCuts (const OsiCuts & cs, int first, int last) const { int nbad=0; int i; const double epsilon=1.0e-8; const int nRowCuts = CoinMin(cs.sizeRowCuts(),last); for (i=first; iub + epsilon ||sum < lb - epsilon) { double violation=CoinMax(sum-ub,lb-sum); std::cout<<"Cut "<1.0e-9) { std::cout<<"( "<ub + epsilon ||sum < lb - epsilon) { double violation=CoinMax(sum-ub,lb-sum); std::cout<<"Cut with "<1.0e-9) { std::cout<<"( "<colupper[i]+1.0e-12) { printf("Infeasible bounds for %d - %g, %g\n", i,collower[i],colupper[i]); } if (si.isInteger(i)) { // value of integer variable in solution double value=knownSolution_[i]; if (value>colupper[i]+1.0e-3 || value colupper[j]+1.0e-3 || value < collower[j]-1.0e-3) { if (bad[0] < 0) { bad[0] = j ; } else { bad[1] = j ; } ok = false ; std::cout << "* " ; } if (value || !ok) std::cout << j << " " << value << std::endl ; } } for (int i = 0 ; i < 2 ; i++) { if (bad[i] >= 0) { int j = bad[i] ; std::cout << "BAD " << j << " " << collower[j] << " <= " << knownSolution_[j] << " <= " << colupper[j] << std::endl ; } } return (badVars) ; } else { // no information return -1; } } /* Activate a row cut debugger using the name of the model. A known optimal solution will be used to validate cuts. See the source below for the set of known problems. Most are miplib3. Returns true if the debugger is successfully activated. */ bool OsiRowCutDebugger::activate( const OsiSolverInterface & si, const char * model) { // set to true to print an activation message const bool printActivationNotice = false ; int i; //get rid of any arrays delete [] integerVariable_; delete [] knownSolution_; numberColumns_ = 0; int expectedNumberColumns = 0; enum {undefined, pure0_1, continuousWith0_1, generalMip } probType; // Convert input parameter model to be lowercase and // only consider characters between '/' and '.' std::string modelL; //name in lowercase for (i=0;i (strlen(model));i++) { char value=static_cast(tolower(model[i])); if (value=='/') { modelL.erase(); } else if (value=='.') { break; } else { modelL.append(1,value); } } CoinPackedVector intSoln; probType = undefined; //-------------------------------------------------------- // // Define additional problems by adding it as an additional // "else if ( modelL == '???' ) { ... }" // stanza below. // // Assign values to probType and intSoln. // // probType - pure0_1, continuousWith0_1, or generalMip // // intSoln - // when probType is pure0_1 // intSoln contains the indices of the variables // at 1 in the optimal solution // when probType is continuousWith0_1 // intSoln contains the indices of integer // variables at one in the optimal solution // when probType is generalMip // intSoln contains the the indices of the integer // variables and their value in the optimal solution //-------------------------------------------------------- // exmip1 if ( modelL == "exmip1" ) { probType=continuousWith0_1; intSoln.insert(2,1.); intSoln.insert(3,1.); expectedNumberColumns=8; } // p0033 else if ( modelL == "p0033" ) { probType=pure0_1; // Alternate solution -- 21,23 replace 22. // int intIndicesAt1[]={ 0,6,7,9,13,17,18,21,23,24,25,26,27,28,29 }; int intIndicesAt1[]={ 0,6,7,9,13,17,18,22,24,25,26,27,28,29 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=33; } // flugpl else if ( modelL == "flugpl" ) { probType=generalMip; int intIndicesV[] = { 1 , 3 , 4 , 6 , 7 , 9 ,10 ,12 ,13 ,15 }; double intSolnV[] = { 6.,60., 6.,60.,16.,70., 7.,70.,12.,75.}; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=18; } // enigma else if ( modelL == "enigma" ) { probType=pure0_1; int intIndicesAt1[]={ 0,18,25,36,44,59,61,77,82,93 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=100; } // mod011 else if ( modelL == "mod011" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 10,29,32,40,58,77,80,88 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=10958; } // probing else if ( modelL == "probing" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 1, 18, 33, 59 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=149; } // mas76 else if ( modelL == "mas76" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 4,11,13,18,42,46,48,52,85,93,114,119,123,128,147}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=151; } // ltw3 else if ( modelL == "ltw3" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 20,23,24,26,32,33,40,47 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=48; } // mod008 else if ( modelL == "mod008" ) { probType=pure0_1; int intIndicesAt1[]={1,59,83,116,123}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=319; } // mod010 else if ( modelL == "mod010" ) { probType=pure0_1; int intIndicesAt1[]={2,9,16,22,26,50,65,68,82,86,102,145, 149,158,181,191,266,296,376,479,555,625,725,851,981, 1030,1095,1260,1321,1339,1443,1459,1568,1602,1780,1856, 1951,2332,2352,2380,2471,2555,2577,2610,2646,2647}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=2655; } // modglob else if ( modelL == "modglob" ) { probType=continuousWith0_1; int intIndicesAt1[]={204,206,208,212,216,218,220,222,230,232, 234,236,244,248,250,254,256,258,260,262,264,266,268,274, 278,282,284,286,288}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=422; } // p0201 else if ( modelL == "p0201" ) { probType=pure0_1; int intIndicesAt1[]={8,10,21,38,39,56,60,74,79,92,94,110,111, 128,132,146,151,164,166,182,183,200}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=201; } // p0282 else if ( modelL == "p0282" ) { probType=pure0_1; int intIndicesAt1[]={3,11,91,101,103,117,155,169,191,199,215, 223,225,237,240,242,243,244,246,248,251,254,256,257,260, 262,263,273,275,276,277,280,281}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=282; } // p0548 else if ( modelL == "p0548" ) { probType=pure0_1; int intIndicesAt1[]={2,3,13,14,17,23,24,43,44,47,61,62,74,75, 81,82,92,93,96,98,105,120,126,129,140,141,153,154,161,162, 165,177,182,184,189,192,193,194,199,200,209,214,215,218,222, 226,234,239,247,256,257,260,274,286,301,305,306,314,317,318, 327,330,332,334,336,340,347,349,354,358,368,369,379,380,385, 388,389,390,393,394,397,401,402,406,407,417,419,420,423,427, 428,430,437,439,444,446,447,450,451,452,472,476,477,480,488, 491,494,500,503,508,509,510,511,512,515,517,518,519,521,522, 523,525,526,527,528,529,530,531,532,533,536,537,538,539,541, 542,545,547}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=548; } // p2756 else if ( modelL == "p2756" ) { probType=pure0_1; int intIndicesAt1[]={7,25,50,63,69,71,81,124,164,208,210,212,214, 220,266,268,285,299,301,322,362,399,455,464,468,475,518,574, 588,590,612,632,652,679,751,767,794,819,838,844,892,894,913, 919,954,966,996,998,1021,1027,1044,1188,1230,1248,1315,1348, 1366,1367,1420,1436,1473,1507,1509,1521,1555,1558,1607,1659, 1715,1746,1761,1789,1800,1844,1885,1913,1916,1931,1992,2002, 2050,2091,2155,2158,2159,2197,2198,2238,2264,2292,2318,2481, 2496,2497,2522,2531,2573,2583,2587,2588,2596,2635,2637,2639, 2643,2645,2651,2653,2672,2675,2680,2683,2708,2727,2730,2751}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=2756; } /* nw04 It turns out that the NAME line in nw04.mps distributed in miplib is actually NW-capital O-4. Who'd a thunk it? -- lh, 110402 -- */ else if ( modelL == "nw04" || modelL == "nwo4" ) { probType=pure0_1; int intIndicesAt1[]={ 231 ,1792 ,1980 ,7548 ,21051 ,28514 ,53087 ,53382 ,76917 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=87482; } // bell3a else if ( modelL == "bell3a" ) { probType=generalMip; int intIndicesV[]={61,62,65,66,67,68,69,70}; double intSolnV[] = {4.,21.,4.,4.,6.,1.,25.,8.}; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=133; } // 10teams else if ( modelL == "10teams" ) { probType=continuousWith0_1; int intIndicesAt1[]={236,298,339,379,443,462,520,576,616,646,690, 749,778,850,878,918,986,996,1065,1102,1164,1177,1232,1281,1338, 1358,1421,1474,1522,1533,1607,1621,1708,1714,1775,1835,1887, 1892,1945,1989}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=2025; } // rentacar else if ( modelL == "rentacar" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 9502 ,9505 ,9507 ,9511 ,9512 ,9513 ,9514 ,9515 ,9516 ,9521 , 9522 ,9526 ,9534 ,9535 ,9536 ,9537 ,9542 ,9543 ,9544 ,9548 , 9550 ,9554 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=9557; } // qiu else if ( modelL == "qiu" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 0 ,5 ,8 ,9 ,11 ,13 ,16 ,17 ,19 ,20 , 24 ,28 ,32 ,33 ,35 ,37 ,40 ,47 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=840; } // pk1 else if ( modelL == "pk1" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 1 ,4 ,5 ,6 ,7 ,11 ,13 ,16 ,17 ,23 , 24 ,27 ,28 ,34 ,35 ,37 ,43 ,44 ,45 ,46 , 47 ,51 ,52 ,54 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=86; } // pp08a else if ( modelL == "pp08a" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 177 ,179 ,181 ,183 ,185 ,190 ,193 ,195 ,197 ,199 , 202 ,204 ,206 ,208 ,216 ,220 ,222 ,229 ,235 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=240; } // pp08aCUTS else if ( modelL == "pp08acuts" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 177 ,179 ,181 ,183 ,185 ,190 ,193 ,195 ,197 ,199 , 202 ,204 ,206 ,208 ,216 ,220 ,222 ,229 ,235 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=240; } // danoint else if ( modelL == "danoint" ) { probType=continuousWith0_1; int intIndicesAt1[]={3,5,8,11,15,21,24,25,31,34,37,42,46,48,51,56}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=521; } // dcmulti else if ( modelL == "dcmulti" ) { probType=continuousWith0_1; int intIndicesAt1[]={2,3,11,14,15,16,21,24,28,34,35,36,39,40,41,42, 45,52,53,60,61,64,65,66,67}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=548; } // egout else if ( modelL == "egout" ) { probType=continuousWith0_1; int intIndicesAt1[]={0,3,5,7,8,9,11,12,13,15,16,17,18,20,21,22, 23,24,25,26,27,28,29,32,34,36,37,38,39,40,42,43,44,45,46,47, 48,49,52,53,54}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=141; } // fixnet6 else if ( modelL == "fixnet6" ) { probType=continuousWith0_1; int intIndicesAt1[]={1,16,23,31,37,51,64,179,200,220,243,287, 375,413,423,533,537,574,688,690,693,712,753,773,778,783,847}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=878; } // khb05250 else if ( modelL == "khb05250" ) { probType=continuousWith0_1; int intIndicesAt1[]={1,3,8,11,12,15,16,17,18,21,22,23}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=1350; } // lseu else if ( modelL == "lseu" ) { probType=pure0_1; int intIndicesAt1[]={0,1,6,13,26,33,38,43,50,52,63,65,85}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=89; } // air03 else if ( modelL == "air03" ) { probType=pure0_1; int intIndicesAt1[]={ 1, 3, 5, 13, 14, 28, 38, 49, 75, 76, 151, 185, 186, 271, 370, 466, 570, 614, 732, 819, 1151, 1257, 1490, 2303, 2524, 3301, 3616, 4129, 4390, 4712, 5013, 5457, 5673, 6436, 7623, 8122, 8929, 10689, 10694, 10741, 10751 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=10757; } // air04 else if ( modelL == "air04" ) { probType=pure0_1; int intIndicesAt1[]={ 0, 1, 3, 4, 5, 6, 7, 9, 11, 12, 13, 17, 19, 20, 21, 25, 26, 27, 28, 29, 32, 35, 36, 39, 40, 42, 44, 45, 47, 48, 49, 50, 51, 52, 53, 56, 57, 58, 60, 63, 64, 66, 67, 68, 73, 74, 80, 81, 83, 85, 87, 92, 93, 94, 95, 99, 101, 102, 105, 472, 616, 680, 902, 1432, 1466, 1827, 2389, 2535, 2551, 2883, 3202, 3215, 3432, 3438, 3505, 3517, 3586, 3811, 3904, 4092, 4685, 4700, 4834, 4847, 4892, 5189, 5211, 5394, 5878, 6045, 6143, 6493, 6988, 7511, 7664, 7730, 7910, 8041, 8350, 8615, 8635, 8670 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=8904; } // air05 else if ( modelL == "air05" ) { probType=pure0_1; int intIndicesAt1[]={ 2, 4, 5, 6, 7, 8, 9, 10, 14, 15, 19, 20, 25, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 47, 48, 50, 52, 55, 57, 58, 66, 72, 105, 218, 254, 293, 381, 695, 1091, 1209, 1294, 1323, 1348, 1580, 1769, 2067, 2156, 2162, 2714, 2732, 3113, 3131, 3145, 3323, 3398, 3520, 3579, 4295, 5025, 5175, 5317, 5340, 6324, 6504, 6645, 6809 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=7195; } // seymour else if ( modelL == "seymour" ) { probType=pure0_1; int intIndicesAt1[]= { 1, 2, 3, 5, 6, 7, 9, 11, 12, 16, 18, 22, 23, 25, 27, 31, 32, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 49, 50, 51, 52, 54, 55, 56, 58, 61, 63, 65, 67, 68, 69, 70, 71, 75, 79, 81, 82, 84, 85, 86, 87, 88, 89, 91, 93, 95, 97, 98, 99, 100, 101, 102, 103, 106, 108, 112, 116, 118, 119, 120, 122, 123, 124, 125, 126, 129, 130, 132, 135, 137, 140, 141, 142, 143, 144, 148, 150, 151, 154, 156, 159, 160, 162, 163, 164, 165, 167, 169, 170, 174, 177, 178, 180, 181, 182, 183, 188, 189, 192, 194, 200, 201, 202, 203, 204, 211, 214, 218, 226, 227, 228, 231, 232, 237, 240, 242, 244, 247, 248, 249, 251, 253, 256, 257, 259, 261, 264, 265, 266, 268, 270, 272, 278, 280, 284, 286, 288, 289, 291, 292, 296, 299, 302, 305, 307, 308, 311, 312, 313, 314, 315, 316, 317, 319, 321, 325, 328, 332, 334, 335, 337, 338, 339, 340, 343, 346, 355, 357, 358, 365, 369, 372, 373, 374, 375, 376, 378, 381, 383, 386, 392, 396, 399, 402, 403, 412, 416, 419, 424, 425, 426, 427, 430, 431, 432, 436, 437, 438, 440, 441, 443, 450, 451, 452, 453, 456, 460, 461, 462, 467, 469, 475, 476, 477, 478, 479, 485, 486, 489, 491, 493, 498, 500, 501, 508, 513, 515, 516, 518, 519, 520, 524, 527, 541, 545, 547, 548, 559, 562, 563, 564, 566, 567, 570, 572, 575, 576, 582, 583, 587, 589, 595, 599, 602, 610, 611, 615, 622, 631, 646, 647, 649, 652, 658, 662, 665, 667, 671, 676, 679, 683, 685, 686, 688, 689, 691, 699, 705, 709, 711, 712, 716, 721, 722, 724, 726, 729, 732, 738, 739, 741, 745, 746, 747, 749, 752, 757, 765, 767, 768, 775, 779, 780, 791, 796, 798, 808, 809, 812, 813, 817, 819, 824, 825, 837, 839, 849, 851, 852, 857, 865, 874, 883, 885, 890, 897, 902, 907, 913, 915, 923, 924, 927, 931, 933, 936, 938, 941, 945, 949, 961, 970, 971, 978, 984, 985, 995, 997, 999, 1001, 1010, 1011, 1012, 1025, 1027, 1035, 1043, 1055, 1056, 1065, 1077, 1089, 1091, 1096, 1100, 1104, 1112, 1126, 1130, 1131, 1132, 1134, 1136, 1143, 1149, 1162, 1163, 1164, 1183, 1184, 1191, 1200, 1201, 1209, 1215, 1220, 1226, 1228, 1229, 1233, 1241, 1243, 1244, 1258, 1277, 1279, 1285, 1291, 1300, 1303, 1306, 1311, 1320, 1323, 1333, 1344, 1348, 1349, 1351, 1356, 1363, 1364, 1365, 1366}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=1372; } // stein27 else if ( modelL == "stein27" ) { probType=pure0_1; int intIndicesAt1[]={0,1,3,4,5,6,7,8,9,11,13,16,17,19,21,22,25,26}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=27; } // stein45 else if ( modelL == "stein45" ) { probType=pure0_1; int intIndicesAt1[]={0,1,4,5,6,7,8,9,10,11,14,17,18,19,21,23,24,25,26,28, 31,32,33,36,37,39,40,42,43,44}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=45; } // misc03 else if ( modelL == "misc03" ) { probType=continuousWith0_1; int intIndicesAt1[]={4,40,62,75,99,114,127,134,147,148,150, 152,154,155,157}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=160; } // misc06 else if ( modelL == "misc06" ) { probType=continuousWith0_1; int intIndicesAt1[]={ 1557 ,1560 ,1561 ,1580 ,1585 ,1588 ,1589 ,1614 ,1615 ,1616 , 1617 ,1626 ,1630 ,1631 ,1642 ,1643 ,1644 ,1645 ,1650 ,1654 , 1658 ,1659 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=1808; } // misc07 else if ( modelL == "misc07" ) { probType=continuousWith0_1; int intIndicesAt1[]={21,27,57,103,118,148,185,195,205,209,243, 245,247,249,251,253,255,257}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=260; } // rgn else if ( modelL == "rgn" ) { probType=continuousWith0_1; int intIndicesAt1[]={16 ,49 ,72 ,92 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=180; } // mitre else if ( modelL == "mitre" ) { probType=pure0_1; int intIndicesAt1[]={ 4,37,67,93,124,154,177,209,240,255,287,319,340, 372,403,425,455,486,516,547,579,596,628,661,676, 713,744,758,795,825,851,881,910,933,963,993,1021, 1052,1082,1111,1141,1172,1182,1212,1242,1272,1303, 1332,1351,1382,1414,1445,1478,1508,1516,1546,1576, 1601,1632,1662,1693,1716,1749,1781,1795,1828,1860, 1876,1909,1940,1962,1994,2027,2058,2091,2122,2128, 2161,2192,2226,2261,2290,2304,2339,2369,2393,2426, 2457,2465,2500,2529,2555,2590,2619,2633,2665,2696, 2728,2760,2792,2808,2838,2871,2896,2928,2960,2981, 3014,3045,3065,3098,3127,3139,3170,3200,3227,3260, 3292,3310,3345,3375,3404,3437,3467,3482,3513,3543, 3558,3593,3623,3653,3686,3717,3730,3762,3794,3814, 3845,3877,3901,3936,3966,3988,4019,4049,4063,4096, 4126,4153,4186,4216,4245,4276,4306,4318,4350,4383, 4402,4435,4464,4486,4519,4550,4578,4611,4641,4663, 4695,4726,4738,4768,4799,4830,4863,4892,4919,4950, 4979,4991,5024,5054,5074,5107,5137,5165,5198,5228, 5244,5275,5307,5325,5355,5384,5406,5436,5469,5508, 5538,5568,5585,5615,5646,5675,5705,5734,5745,5774, 5804,5836,5865,5895,5924,5954,5987,6001,6033,6064, 6096,6126,6155,6172,6202,6232,6250,6280,6309,6328, 6361,6392,6420,6450,6482,6500,6531,6561,6598,6629, 6639,6669,6699,6731,6762,6784,6814,6844,6861,6894, 6924,6955,6988,7018,7042,7075,7105,7116,7149,7179, 7196,7229,7258,7282,7312,7345,7376,7409,7438,7457, 7487,7520,7534,7563,7593,7624,7662,7692,7701,7738, 7769,7794,7827,7857,7872,7904,7935,7960,7990,8022, 8038,8071,8101,8137,8167,8199,8207,8240,8269,8301, 8334,8363,8387,8420,8450,8470,8502,8534,8550,8580, 8610,8639,8669,8699,8709,8741,8772,8803,8834,8867, 8883,8912,8942,8973,9002,9032,9061,9094,9124,9128, 9159,9201,9232,9251,9280,9310,9333,9338,9405,9419, 9423,9428,9465,9472,9482,9526,9639,9644,9666,9673, 9729,9746,9751,9819,9832,9833,9894,9911,9934,9990, 10007,10012,10083,10090,10095,10137,10176,10177, 10271,10279,10280,10288,10292,10298,10299,10319, 10351,10490,10505,10553,10571,10579,10600,10612, 10683,10688}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=10724; } // cap6000 else if ( modelL == "cap6000" ) { probType=pure0_1; int intIndicesAt1[]={ 46 ,141 ,238 ,250 ,253 ,257 ,260 ,261 ,266 ,268 , 270 ,274 ,277 ,280 ,289 ,292 ,296 ,297 ,300 ,305 , 306 ,310 ,314 ,317 ,319 ,321 ,324 ,329 ,332 ,333 , 336 ,339 ,343 ,345 ,350 ,353 ,354 ,357 ,361 ,364 , 367 ,370 ,372 ,376 ,379 ,381 ,386 ,387 ,392 ,395 , 397 ,400 ,402 ,405 ,410 ,413 ,416 ,419 ,420 ,425 , 427 ,430 ,434 ,436 ,441 ,444 ,447 ,451 ,454 ,456 , 459 ,463 ,467 ,468 ,473 ,474 ,479 ,480 ,483 ,488 , 490 ,493 ,496 ,499 ,501 ,506 ,509 ,511 ,522 ,536 , 537 ,552 ,563 ,565 ,569 ,571 ,574 ,576 ,580 ,582 , 588 ,591 ,596 ,597 ,601 ,607 ,609 ,613 ,616 ,618 , 621 ,626 ,632 ,634 ,644 ,647 ,648 ,658 ,661 ,663 , 668 ,670 ,680 ,688 ,691 ,695 ,698 ,699 ,703 ,713 , 721 ,723 ,730 ,740 ,742 ,746 ,751 ,755 ,757 ,760 , 765 ,770 ,775 ,777 ,781 ,785 ,792 ,796 ,801 ,804 , 812 ,821 ,826 ,834 ,838 ,840 ,844 ,872 ,881 ,883 , 887 ,888 ,899 ,904 ,906 ,917 ,919 ,931 ,938 ,945 , 948 ,953 ,958 ,962 ,963 ,970 ,976 ,979 ,981 ,997 , 1000 ,1004 ,1005 ,1009 ,1013 ,1014 ,1024 ,1026 ,1034 ,1039 , 1055 ,1061 ,1069 ,1076 ,1078 ,1084 ,1089 ,1099 ,1101 ,1104 , 1109 ,1111 ,1124 ,1127 ,1129 ,1133 ,1138 ,1140 ,1145 ,1148 , 1149 ,1159 ,1166 ,1167 ,1171 ,1180 ,1187 ,1194 ,1197 ,1205 , 1224 ,1228 ,1246 ,1255 ,1261 ,1269 ,1275 ,1286 ,1289 ,1291 , 1311 ,1390 ,1406 ,1410 ,1413 ,1418 ,1427 ,1435 ,1440 ,1446 , 1453 ,1455 ,1468 ,1477 ,1479 ,1486 ,1492 ,1502 ,1508 ,1509 , 1525 ,1551 ,1559 ,1591 ,1643 ,1657 ,1660 ,1662 ,1677 ,1710 , 1719 ,1752 ,1840 ,1862 ,1870 ,1891 ,1936 ,1986 ,2087 ,2178 , 2203 ,2212 ,2311 ,2503 ,2505 ,2530 ,2532 ,2557 ,2561 ,2564 , 2567 ,2571 ,2578 ,2581 ,2588 ,2591 ,2594 ,2595 ,2598 ,2603 , 2605 ,2616 ,2620 ,2624 ,2630 ,2637 ,2643 ,2647 ,2654 ,2656 , 2681 ,2689 ,2699 ,2703 ,2761 ,2764 ,2867 ,2871 ,2879 ,2936 , 2971 ,3024 ,3076 ,3094 ,3119 ,3378 ,3435 ,3438 ,3446 ,3476 , 3570 ,3605 ,3646 ,3702 ,3725 ,3751 ,3755 ,3758 ,3760 ,3764 , 3765 ,3770 ,3773 ,3776 ,3779 ,3782 ,3784 ,3788 ,3791 ,3792 , 3796 ,3799 ,3803 ,3804 ,3807 ,3811 ,3814 ,3816 ,3821 ,3823 , 3826 ,3830 ,3831 ,3836 ,3838 ,3840 ,3844 ,3847 ,3851 ,3852 , 3855 ,3859 ,3863 ,3864 ,3867 ,3895 ,3921 ,3948 ,3960 ,3970 , 3988 ,4026 ,4032 ,4035 ,4036 ,4038 ,4041 ,4042 ,4045 ,4046 , 4048 ,4050 ,4053 ,4055 ,4057 ,4058 ,4060 ,4063 ,4065 ,4067 , 4069 ,4071 ,4072 ,4075 ,4076 ,4079 ,4081 ,4082 ,4085 ,4087 , 4088 ,4090 ,4092 ,4094 ,4097 ,4099 ,4100 ,4102 ,4104 ,4107 , 4109 ,4111 ,4113 ,4114 ,4207 ,4209 ,4213 ,4216 ,4220 ,4227 , 4233 ,4238 ,4240 ,4248 ,4253 ,4259 ,4260 ,4267 ,4268 ,4273 , 4280 ,4284 ,4290 ,4292 ,4295 ,4301 ,4303 ,4311 ,4319 ,4326 , 4329 ,4332 ,4335 ,4336 ,4344 ,4349 ,4351 ,4355 ,4363 ,4371 , 4372 ,4378 ,4388 ,4401 ,4409 ,4413 ,4417 ,4420 ,4435 ,4441 , 4451 ,4458 ,4463 ,4468 ,4474 ,4478 ,4482 ,4483 ,4488 ,4497 , 4499 ,4522 ,4614 ,4626 ,4645 ,4648 ,4751 ,4755 ,4758 ,4759 , 4763 ,4840 ,4846 ,4859 ,4865 ,4883 ,4943 ,4970 ,5030 ,5084 , 5124 ,5181 ,5224 ,5236 ,5238 ,5328 ,5362 ,5375 ,5378 ,5434 , 5478 ,5483 ,5562 ,5581 ,5586 ,5591 ,5644 ,5684 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=6000; } // gen else if ( modelL == "gen" ) { probType=generalMip; int intIndicesV[]={15,34,35,36,37,38,39,40,41,42,43,44,45,57,58, 59,60,61,62,63,64,65,66,67,68,69,84,85,86,87,88,89,90,91,92, 93,107,108,109,110,111,112,113,114,120,121,122,123,124,125, 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140, 141,142,143,432,433,434,435,436}; double intSolnV[] = {1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,23.,12.,11.,14.,16.}; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=870; } // dsbmip else if ( modelL == "dsbmip" ) { probType=generalMip; int intIndicesV[]={ 1694 ,1695 ,1696 ,1697 ,1698 ,1699 ,1700 ,1701 ,1702 ,1703 , 1729 ,1745 ,1748 ,1751 ,1753 ,1754 ,1758 ,1760 ,1766 ,1771 , 1774 ,1777 ,1781 ,1787 ,1792 ,1796 ,1800 ,1805 ,1811 ,1817 , 1819 ,1821 ,1822 ,1824 ,1828 ,1835 ,1839 ,1841 ,1844 ,1845 , 1851 ,1856 ,1860 ,1862 ,1864 ,1869 ,1875 ,1883 }; double intSolnV[]={ 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=1886; } // gesa2 else if ( modelL == "gesa2" ) { probType=generalMip; int intIndicesV[]={ 323 ,324 ,336 ,337 ,349 ,350 ,362 ,363 ,375 ,376 , 388 ,389 ,401 ,402 ,414 ,415 ,423 ,424 ,426 ,427 , 428 ,436 ,437 ,439 ,440 ,441 ,449 ,450 ,452 ,453 , 454 ,462 ,463 ,465 ,466 ,467 ,475 ,476 ,478 ,479 , 480 ,489 ,491 ,492 ,493 ,502 ,504 ,505 ,506 ,514 , 515 ,517 ,518 ,519 ,527 ,528 ,530 ,531 ,532 ,537 , 538 ,540 ,541 ,543 ,544 ,545 ,550 ,551 ,553 ,554 , 556 ,557 ,558 ,563 ,564 ,566 ,567 ,569 ,570 ,571 , 573 ,577 ,579 ,580 ,582 ,583 ,584 ,592 ,593 ,595 , 596 ,597 ,605 ,606 ,608 ,609 ,610 ,622 ,623 ,1130 , 1131 ,1134 ,1135 ,1138 ,1139 ,1142 ,1143 ,1146 ,1147 ,1150 , 1151 ,1154 ,1155 ,1158 ,1159 ,1161 ,1162 ,1165 ,1166 ,1169 , 1170 ,1173 ,1174 ,1177 ,1178 ,1182 ,1183 ,1185 ,1186 ,1189 , 1190 ,1193 ,1194 ,1196 ,1197 ,1200 ,1201 ,1204 ,1205 ,1209 , 1210 ,1213 ,1214 ,1218 ,1222 ,1223 }; double intSolnV[]={ 1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. , 1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. ,2. ,1. , 2. ,3. ,2. ,2. ,1. ,2. ,3. ,2. ,2. ,1. , 2. ,3. ,2. ,2. ,1. ,2. ,2. ,2. ,2. ,1. , 2. ,2. ,2. ,1. ,2. ,2. ,2. ,1. ,2. ,1. , 2. ,2. ,1. ,2. ,2. ,2. ,2. ,1. ,2. ,1. , 4. ,3. ,3. ,2. ,1. ,2. ,1. ,4. ,3. ,3. , 2. ,1. ,2. ,1. ,4. ,3. ,3. ,2. ,1. ,2. , 1. ,4. ,3. ,3. ,2. ,1. ,2. ,3. ,3. ,2. , 1. ,2. ,1. ,2. ,2. ,1. ,2. ,1. ,2. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=1224; } // gesa2_o else if ( modelL == "gesa2_o" ) { probType=generalMip; int intIndicesV[]={ 315 ,316 ,328 ,329 ,341 ,342 ,354 ,355 ,367 ,368 , 380 ,381 ,393 ,394 ,406 ,407 ,419 ,420 ,423 ,427 , 428 ,432 ,433 ,436 ,440 ,441 ,445 ,446 ,449 ,453 , 454 ,458 ,459 ,462 ,466 ,467 ,471 ,472 ,475 ,479 , 480 ,484 ,485 ,492 ,493 ,497 ,498 ,505 ,506 ,510 , 511 ,514 ,518 ,519 ,523 ,524 ,527 ,531 ,532 ,536 , 537 ,539 ,540 ,543 ,544 ,545 ,549 ,550 ,552 ,553 , 556 ,557 ,558 ,562 ,563 ,565 ,566 ,569 ,570 ,571 , 575 ,576 ,577 ,579 ,582 ,583 ,584 ,588 ,589 ,592 , 596 ,597 ,601 ,602 ,605 ,609 ,610 ,614 ,615 ,735 , 739 ,740 ,748 ,826 ,839 ,851 ,852 ,855 ,856 ,889 , 1136 ,1137 ,1138 ,1139 ,1140 ,1142 ,1143 ,1144 ,1145 ,1146 , 1147 ,1148 ,1149 ,1152 ,1153 ,1154 ,1155 ,1156 ,1157 ,1158 , 1159 ,1165 ,1175 ,1193 ,1194 ,1195 ,1200 ,1201 ,1202 ,1203 , 1204 ,1205 ,1206 ,1207 ,1208 ,1209 ,1210 ,1211 ,1212 ,1213 , 1214 ,1215 ,1216 ,1220 ,1221 ,1222 ,1223 }; double intSolnV[]={ 1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. , 1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. , 2. ,1. ,2. ,3. ,2. ,2. ,1. ,2. ,3. ,2. , 2. ,1. ,2. ,3. ,2. ,2. ,1. ,2. ,2. ,2. , 2. ,1. ,2. ,2. ,2. ,1. ,2. ,2. ,2. ,1. , 2. ,1. ,2. ,2. ,1. ,2. ,2. ,2. ,2. ,1. , 2. ,1. ,3. ,4. ,3. ,2. ,1. ,2. ,1. ,3. , 4. ,3. ,2. ,1. ,2. ,1. ,3. ,4. ,3. ,2. , 1. ,2. ,1. ,3. ,4. ,3. ,2. ,1. ,2. ,3. , 3. ,2. ,1. ,2. ,1. ,2. ,2. ,1. ,2. ,1. , 2. ,2. ,2. ,1. ,1. ,1. ,1. ,4. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=1224; } // gesa3 else if ( modelL == "gesa3" ) { probType=generalMip; int intIndicesV[]={ 298 ,299 ,310 ,311 ,322 ,323 ,334 ,335 ,346 ,347 , 358 ,359 ,365 ,370 ,371 ,377 ,378 ,380 ,382 ,383 , 389 ,390 ,392 ,394 ,395 ,401 ,402 ,404 ,405 ,406 , 407 ,413 ,414 ,416 ,417 ,418 ,419 ,425 ,426 ,428 , 429 ,430 ,431 ,437 ,438 ,440 ,441 ,442 ,443 ,449 , 450 ,452 ,454 ,455 ,461 ,462 ,464 ,466 ,467 ,473 , 474 ,476 ,478 ,479 ,485 ,486 ,488 ,490 ,491 ,497 , 498 ,500 ,502 ,503 ,509 ,510 ,512 ,514 ,515 ,521 , 522 ,524 ,526 ,527 ,533 ,534 ,536 ,538 ,539 ,545 , 546 ,548 ,550 ,551 ,557 ,558 ,560 ,562 ,563 ,569 , 572 ,574 ,575 ,1058 ,1059 ,1062 ,1063 ,1066 ,1067 ,1070 , 1071 ,1074 ,1075 ,1078 ,1079 ,1082 ,1083 ,1086 ,1087 ,1090 , 1091 ,1094 ,1095 ,1098 ,1099 ,1102 ,1103 ,1106 ,1107 ,1110 , 1111 ,1114 ,1115 ,1118 ,1119 ,1122 ,1123 ,1126 ,1127 ,1130 , 1131 ,1134 ,1135 ,1138 ,1139 ,1142 ,1143 ,1146 ,1147 ,1150 , 1151 }; double intSolnV[]={ 1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. , 1. ,2. ,1. ,1. ,2. ,2. ,1. ,1. ,1. ,2. , 2. ,1. ,2. ,1. ,2. ,2. ,1. ,2. ,2. ,1. , 2. ,2. ,1. ,2. ,2. ,1. ,2. ,2. ,1. ,2. , 2. ,1. ,2. ,2. ,1. ,2. ,1. ,1. ,2. ,2. , 1. ,2. ,1. ,2. ,2. ,1. ,2. ,1. ,2. ,2. , 1. ,2. ,1. ,2. ,4. ,1. ,2. ,1. ,2. ,4. , 2. ,4. ,1. ,2. ,4. ,2. ,4. ,1. ,2. ,4. , 2. ,4. ,1. ,2. ,4. ,1. ,4. ,1. ,2. ,3. , 1. ,3. ,1. ,2. ,2. ,1. ,2. ,1. ,2. ,1. , 1. ,1. ,2. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=1152; } // gesa3_o else if ( modelL == "gesa3_o" ) { probType=generalMip; int intIndicesV[]={ 291 ,292 ,303 ,304 ,315 ,316 ,327 ,328 ,339 ,340 , 351 ,352 ,361 ,363 ,364 ,373 ,374 ,375 ,376 ,379 , 385 ,386 ,387 ,388 ,391 ,397 ,398 ,399 ,400 ,403 , 407 ,409 ,410 ,411 ,412 ,415 ,419 ,421 ,422 ,423 , 424 ,427 ,431 ,433 ,434 ,435 ,436 ,439 ,443 ,445 , 446 ,447 ,448 ,451 ,457 ,458 ,459 ,460 ,463 ,469 , 470 ,471 ,472 ,475 ,481 ,482 ,483 ,484 ,487 ,493 , 494 ,495 ,496 ,499 ,505 ,506 ,507 ,508 ,511 ,517 , 518 ,519 ,520 ,523 ,529 ,530 ,531 ,532 ,535 ,541 , 542 ,543 ,544 ,547 ,553 ,554 ,555 ,556 ,559 ,565 , 566 ,567 ,568 ,578 ,590 ,602 ,614 ,626 ,638 ,649 , 650 ,661 ,662 ,667 ,674 ,686 ,695 ,698 ,710 ,722 , 734 ,746 ,758 ,769 ,770 ,782 ,787 ,794 ,806 ,818 , 830 ,842 ,854 ,1080 ,1081 ,1082 ,1083 ,1084 ,1085 ,1086 , 1087 ,1088 ,1089 ,1090 ,1091 ,1092 ,1093 ,1094 ,1095 ,1096 , 1097 ,1098 ,1099 ,1100 ,1101 ,1102 ,1103 ,1128 ,1129 ,1130 , 1131 ,1132 ,1133 ,1134 ,1135 ,1136 ,1137 ,1138 ,1139 ,1140 , 1141 ,1142 ,1143 ,1144 ,1145 ,1146 ,1147 ,1148 ,1149 ,1150 , 1151 }; double intSolnV[]={ 1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. ,1. ,2. , 1. ,2. ,1. ,1. ,2. ,2. ,1. ,1. ,2. ,1. , 2. ,2. ,1. ,2. ,1. ,2. ,2. ,1. ,2. ,1. , 2. ,2. ,2. ,1. ,2. ,1. ,2. ,2. ,2. ,1. , 2. ,1. ,2. ,2. ,2. ,1. ,2. ,1. ,1. ,2. , 2. ,1. ,2. ,1. ,2. ,2. ,1. ,2. ,1. ,2. , 2. ,1. ,2. ,1. ,4. ,2. ,1. ,2. ,1. ,4. , 4. ,1. ,2. ,2. ,4. ,4. ,1. ,2. ,2. ,4. , 4. ,1. ,2. ,2. ,4. ,4. ,1. ,2. ,1. ,3. , 3. ,1. ,2. ,1. ,2. ,2. ,1. ,2. ,1. ,1. , 1. ,1. ,2. ,4. ,4. ,4. ,4. ,4. ,4. ,1. , 4. ,1. ,4. ,1. ,4. ,4. ,2. ,4. ,4. ,4. , 4. ,4. ,4. ,2. ,4. ,4. ,1. ,4. ,4. ,4. , 4. ,4. ,4. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=1152; } // noswot else if ( modelL == "noswot_z" ) { probType=generalMip; int intIndicesV[]={1}; double intSolnV[]={1.0}; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=128; } // qnet1 else if ( modelL == "qnet1" ) { probType=generalMip; int intIndicesV[]={ 61 ,69 ,79 ,81 ,101 ,104 ,111 ,115 ,232 ,265 , 267 ,268 ,269 ,285 ,398 ,412 ,546 ,547 ,556 ,642 , 709 ,718 ,721 ,741 ,760 ,1073 ,1077 ,1084 ,1097 ,1100 , 1104 ,1106 ,1109 ,1248 ,1259 ,1260 ,1263 ,1265 ,1273 ,1274 , 1276 ,1286 ,1291 ,1302 ,1306 ,1307 ,1316 ,1350 ,1351 ,1363 , 1366 ,1368 ,1371 ,1372 ,1380 ,1381 ,1385 ,1409 }; double intSolnV[]={ 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,2. ,1. ,1. ,1. ,1. ,3. , 1. ,2. ,1. ,1. ,1. ,1. ,6. ,3. ,1. ,1. , 5. ,2. ,1. ,2. ,2. ,1. ,2. ,1. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=1541; } // qnet1_o (? marginally different from qnet1) else if ( modelL == "qnet1_o" ) { probType=generalMip; int intIndicesV[]={ 61 ,69 ,79 ,81 ,101 ,106 ,111 ,114 ,115 ,232 , 266 ,267 ,268 ,269 ,277 ,285 ,398 ,412 ,546 ,547 , 556 ,642 ,709 ,718 ,721 ,741 ,760 ,1073 ,1077 ,1084 , 1097 ,1100 ,1104 ,1106 ,1109 ,1248 ,1259 ,1260 ,1263 ,1265 , 1273 ,1274 ,1276 ,1286 ,1291 ,1302 ,1306 ,1307 ,1316 ,1350 , 1351 ,1363 ,1366 ,1368 ,1371 ,1372 ,1380 ,1381 ,1385 ,1409 }; double intSolnV[]={ 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. , 1. ,1. ,1. ,1. ,1. ,1. ,2. ,1. ,1. ,1. , 1. ,3. ,1. ,2. ,1. ,1. ,1. ,1. ,6. ,3. , 1. ,1. ,5. ,2. ,1. ,2. ,2. ,1. ,2. ,1. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=1541; } // gt2 else if ( modelL == "gt2" ) { probType=generalMip; int intIndicesV[]={82,85,88,92,94,95,102,103,117,121,122,128, 141,146,151,152,165,166,176,179}; double intSolnV[] = {1.,3.,1.,5.,2.,1.,1.,2.,2.,2.,1.,2.,1.,1., 2.,1.,1.,6.,1.,1.}; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=188; } // fiber else if ( modelL == "fiber" ) { probType=continuousWith0_1; int intIndicesAt1[]={36,111,190,214,235,270,338,346,372,386, 421,424,441,470,473,483,484,498,580,594,597,660,689,735, 742,761,762,776,779,817,860,1044,1067,1122,1238}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=1298; } // vpm1 else if ( modelL == "vpm1" ) { probType=continuousWith0_1; int intIndicesAt1[]= { 180,181,182,185,195,211,214,226,231,232,244,251,263,269, 285,294,306,307,314, 319}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=378; } // vpm2 else if ( modelL == "vpm2" ) { probType=continuousWith0_1; int intIndicesAt1[]= {170,173,180,181,182,185,193,194,196,213,219,220,226, 245,251,262,263,267,269,273,288,289,294,319,320}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=378; } // markshare1 else if ( modelL == "markshare1" ) { probType=continuousWith0_1; int intIndicesAt1[]= {12 ,13 ,17 ,18 ,22 ,27 ,28 ,29 ,33 ,34 ,35 ,36 , 39 ,42 ,43 ,44 ,46 ,47 ,49 ,51 ,52 ,53 ,54 ,55 ,59 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=62; } // markshare2 else if ( modelL == "markshare2" ) { probType=continuousWith0_1; int intIndicesAt1[]= {16 ,21 ,25 ,26 ,29 ,30 ,31 ,32 ,34 ,35 , 37 ,40 ,42 ,44 ,45 ,47 ,48 ,52 ,53 ,57 , 58 ,59 ,60 ,61 ,62 ,63 ,65 ,71 ,73 }; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=74; } // l152lav else if ( modelL == "l152lav" ) { probType=pure0_1; int intIndicesAt1[]={1,16,30,33,67,111,165,192,198,321,411,449, 906,961,981,1052,1075,1107,1176,1231,1309,1415,1727,1847, 1902,1917,1948,1950}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); expectedNumberColumns=1989; } // bell5 else if ( modelL == "bell5" ) { probType=generalMip; int intIndicesV[]={ 0 ,1 ,2 ,3 ,4 ,6 ,33 ,34 ,36 ,47 , 48 ,49 ,50 ,51 ,52 ,53 ,54 ,56 }; double intSolnV[]={ 1. ,1. ,1. ,1. ,1. ,1. ,1. ,1. ,11. ,2. , 38. ,2. ,498. ,125. ,10. ,17. ,41. ,19. }; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=104; } // blend2 else if ( modelL == "blend2" ) { probType=generalMip; int intIndicesV[]={24,35,44,45,46,52,63,64,70,71,76,84,85, 132,134,151,152,159,164,172,173,289,300,309,310,311, 317,328,329,335,336,341,349,350}; double intSolnV[] = {2.,1.,1.,1.,1.,1.,1.,1.,2.,1.,1.,1., 2.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 1.,1.,1.,1.,1.,1.,1.,1.,1.}; int vecLen = sizeof(intIndicesV)/sizeof(int); intSoln.setVector(vecLen,intIndicesV,intSolnV); expectedNumberColumns=353; } // seymour1 else if ( modelL == "seymour_1" ) { probType=continuousWith0_1; int intIndicesAt1[]= {0,2,3,4,6,7,8,11,12,15,18,22,23,25,27,31,32,34,35,36,37,39,40,41,42,44,45,46,49,51,54,55,56,58,61,62,63,65,67,68,69,70,71,75,79,81,82,84,85,86,87,88,89,91,93,94,95,97,98,99,101,102,103,104,106,108,110,111,112,116,118,119,120,122,123,125,126,128,129,130,131,135,140,141,142,143,144,148,149,151,152,153,156,158,160,162,163,164,165,167,169,170,173,177,178,179,181,182,186,188,189,192,193,200,201,202,203,204,211,214,218,226,227,228,231,233,234,235,238,242,244,246,249,251,252,254,257,259,260,263,266,268,270,271,276,278,284,286,288,289,291,292,299,305,307,308,311,313,315,316,317,319,321,325,328,332,334,335,337,338,340,343,346,347,354,355,357,358,365,369,372,373,374,375,376,379,381,383,386,392,396,399,402,403,412,416,423,424,425,427,430,431,432,436,437,438,440,441,443,449,450,451,452}; int numIndices = sizeof(intIndicesAt1)/sizeof(int); intSoln.setConstant(numIndices,intIndicesAt1,1.0); probType=generalMip; expectedNumberColumns=1372; } // check to see if the model parameter is // a known problem. if ( probType != undefined && si.getNumCols() == expectedNumberColumns) { // Specified model is a known problem numberColumns_ = si.getNumCols(); integerVariable_= new bool[numberColumns_]; knownSolution_=new double[numberColumns_]; //CoinFillN(integerVariable_, numberColumns_,0); //CoinFillN(knownSolution_,numberColumns_,0.0); if ( probType == pure0_1 ) { // mark all variables as integer CoinFillN(integerVariable_,numberColumns_,true); // set solution to 0.0 for all not mentioned CoinFillN(knownSolution_,numberColumns_,0.0); // mark column solution that have value 1 for ( i=0; igetMatrixByCol()->isEquivalent(*si.getMatrixByCol())); // Loop once for each column looking for integer variables for (i=0;iisInteger(i)) { // integer variable found integerVariable_[i]=true; // Determine optimal solution value for integer i // from values saved in intSoln and probType. double soln; if ( probType==continuousWith0_1 ) { // Since 0_1 problem, had better be binary assert( siCopy->isBinary(i) ); // intSoln only contains integers with optimal value of 1 if ( intSoln.isExistingIndex(i) ) { soln = 1.0; assert( intSoln[i]==1. ); } else { soln = 0.0; } } else { // intSoln only contains integers with nonzero optimal values if ( intSoln.isExistingIndex(i) ) { soln = intSoln[i]; assert( intSoln[i]>=1. ); } else { soln = 0.0; } } // Set bounds in copyied problem to fix variable to its solution siCopy->setColUpper(i,soln); siCopy->setColLower(i,soln); } else { // this is not an integer variable integerVariable_[i]=false; } } // All integers have been fixed at optimal value. // Now solve to get continuous values #if 0 assert( siCopy->getNumRows()==5); assert( siCopy->getNumCols()==8); int r,c; for ( r=0; rgetNumRows(); r++ ) { std::cerr <<"rhs[" <rhs())[r] <getNumCols(); c++ ) { std::cerr <<"collower[" <collower())[c] <colupper())[c] <setWarmStart(&allSlack); siCopy->setHintParam(OsiDoScale,false); siCopy->initialSolve(); #if 0 for ( c=0; cgetNumCols(); c++ ) { std::cerr <<"colsol[" <colsol())[c] <getObjValue(),3.2368421052632)); #endif assert (siCopy->isProvenOptimal()); knownValue_ = siCopy->getObjValue(); // Save column solution CoinCopyN(siCopy->getColSolution(),numberColumns_,knownSolution_); delete siCopy; } } else if (printActivationNotice) { if (probType != undefined && si.getNumCols() != expectedNumberColumns) { std::cout << std::endl << " OsiRowCutDebugger::activate: expected " << expectedNumberColumns << " cols but see " << si.getNumCols() << "; cannot activate." << std::endl ; } else { std::cout << " OsiRowCutDebugger::activate: unrecognised problem " << model << "; cannot activate." << std::endl ; } } //if (integerVariable_!=NULL) si.rowCutDebugger_=this; return (integerVariable_!=NULL); } /* Activate a row cut debugger using a full solution array. It's up to the user to get it correct. Returns true if the debugger is activated. The solution array must be getNumCols() in length, but only the entries for integer variables need to be correct. keepContinuous defaults to false, but in some uses (nonlinear solvers, for example) it's useful to keep the given values, as they reflect constraints that are not present in the linear relaxation. */ bool OsiRowCutDebugger::activate (const OsiSolverInterface &si, const double *solution, bool keepContinuous) { // set true to get a debug message about activation const bool printActivationNotice = false ; int i ; //get rid of any arrays delete [] integerVariable_ ; delete [] knownSolution_ ; OsiSolverInterface *siCopy = si.clone() ; numberColumns_ = siCopy->getNumCols() ; integerVariable_ = new bool[numberColumns_] ; knownSolution_ = new double[numberColumns_] ; /* Fix the integer variables from the supplied solution (making sure that the values are integer). */ for (i = 0 ; i < numberColumns_ ; i++) { if (siCopy->isInteger(i)) { integerVariable_[i] = true ; double soln = floor(solution[i]+0.5) ; siCopy->setColUpper(i,soln) ; siCopy->setColLower(i,soln) ; } else { integerVariable_[i] = false ; } } /* Solve the lp relaxation, then cache the primal solution and objective. If we're preserving the values of the given continuous variables, we can't trust the solver's calculation of the objective; it may well be using different values for the continuous variables. */ siCopy->setHintParam(OsiDoScale,false); //siCopy->writeMps("bad.mps") ; siCopy->initialSolve() ; if (keepContinuous == false) { if (siCopy->isProvenOptimal()) { CoinCopyN(siCopy->getColSolution(),numberColumns_,knownSolution_) ; knownValue_ = siCopy->getObjValue() ; if (printActivationNotice) { std::cout << std::endl << "OsiRowCutDebugger::activate: activated (opt), z = " << knownValue_ << std::endl ; } } else { if (printActivationNotice) { std::cout << std::endl << "OsiRowCutDebugger::activate: solution was not optimal; " << "cannot activate." << std::endl ; } delete [] integerVariable_ ; delete [] knownSolution_ ; integerVariable_ = NULL ; knownSolution_ = NULL ; knownValue_ = COIN_DBL_MAX ; } } else { CoinCopyN(solution,numberColumns_,knownSolution_) ; const double *c = siCopy->getObjCoefficients() ; knownValue_ = 0.0 ; for (int j = 0 ; j < numberColumns_ ; j++) { knownValue_ += c[j]*solution[j] ; } knownValue_ = knownValue_*siCopy->getObjSense() ; if (printActivationNotice) { std::cout << std::endl << "OsiRowCutDebugger::activate: activated, z = " << knownValue_ << std::endl ; } } delete siCopy; return (integerVariable_ != NULL) ; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiRowCutDebugger::OsiRowCutDebugger () :knownValue_(COIN_DBL_MAX), numberColumns_(0), integerVariable_(NULL), knownSolution_(NULL) { // nothing to do here } //------------------------------------------------------------------- // Alternate Constructor with model name //------------------------------------------------------------------- // Constructor with name of model OsiRowCutDebugger::OsiRowCutDebugger ( const OsiSolverInterface & si, const char * model) :knownValue_(COIN_DBL_MAX), numberColumns_(0), integerVariable_(NULL), knownSolution_(NULL) { activate(si,model); } // Constructor with full solution (only integers need be correct) OsiRowCutDebugger::OsiRowCutDebugger (const OsiSolverInterface &si, const double *solution, bool enforceOptimality) :knownValue_(COIN_DBL_MAX), numberColumns_(0), integerVariable_(NULL), knownSolution_(NULL) { activate(si,solution,enforceOptimality); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiRowCutDebugger::OsiRowCutDebugger (const OsiRowCutDebugger & source) : knownValue_(COIN_DBL_MAX), numberColumns_(0), integerVariable_(NULL), knownSolution_(NULL) { // copy if (source.active()) { assert(source.integerVariable_ != NULL); assert(source.knownSolution_ != NULL); knownValue_ = source.knownValue_; numberColumns_=source.numberColumns_; integerVariable_=new bool[numberColumns_]; knownSolution_=new double[numberColumns_]; CoinCopyN(source.integerVariable_, numberColumns_, integerVariable_ ); CoinCopyN(source.knownSolution_, numberColumns_, knownSolution_); } } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiRowCutDebugger::~OsiRowCutDebugger () { // free memory delete [] integerVariable_; delete [] knownSolution_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiRowCutDebugger & OsiRowCutDebugger::operator=(const OsiRowCutDebugger& rhs) { if (this != &rhs) { delete [] integerVariable_; delete [] knownSolution_; knownValue_ = COIN_DBL_MAX; // copy if (rhs.active()) { assert(rhs.integerVariable_ != NULL); assert(rhs.knownSolution_ != NULL); knownValue_ = rhs.knownValue_; numberColumns_ = rhs.numberColumns_; integerVariable_ = new bool[numberColumns_]; knownSolution_ = new double[numberColumns_]; CoinCopyN(rhs.integerVariable_,numberColumns_,integerVariable_ ); CoinCopyN(rhs.knownSolution_,numberColumns_,knownSolution_); } } return *this; } /* Edit a solution after column changes (typically column deletion and/or transposition due to preprocessing). Given an array which translates current column indices to original column indices, shrink the solution to match. The transform is irreversible (in the sense that the debugger doesn't keep a record of the changes). */ void OsiRowCutDebugger::redoSolution(int numberColumns,const int * originalColumns) { const bool printRecalcMessage = false ; assert (numberColumns<=numberColumns_); if (numberColumns
  • Create a copy of the original problem.
  • Subject the copy to a series of transformations (the presolve methods) to produce a presolved model. Each transformation is also expected to provide a method to reverse the transformation (the postsolve method). The postsolve methods are collected in a linked list; the postsolve method for the final presolve transformation is at the head of the list.
  • Hand the presolved problem to the solver for optimization.
  • Apply the collected postsolve methods to the presolved problem and solution, restating the solution in terms of the original problem.
  • The COIN presolve algorithms are unaware of OSI. The OsiPresolve class takes care of the interface. Given an OsiSolverInterface \c origModel, it will take care of creating a clone properly loaded with the presolved problem and ready for optimization. After optimization, it will apply postsolve transformations and load the result back into \c origModel. Assuming a problem has been loaded into an \c OsiSolverInterface \c origModel, a bare-bones application looks like this: \code OsiPresolve pinfo ; OsiSolverInterface *presolvedModel ; // Return an OsiSolverInterface loaded with the presolved problem. presolvedModel = pinfo.presolvedModel(*origModel,1.0e-8,false,numberPasses) ; presolvedModel->initialSolve() ; // Restate the solution and load it back into origModel. pinfo.postsolve(true) ; delete presolvedModel ; \endcode */ class OsiPresolve { public: /// Default constructor (empty object) OsiPresolve(); /// Virtual destructor virtual ~OsiPresolve(); /*! \brief Create a new OsiSolverInterface loaded with the presolved problem. This method implements the first two steps described in the class documentation. It clones \c origModel and applies presolve transformations, storing the resulting list of postsolve transformations. It returns a pointer to a new OsiSolverInterface loaded with the presolved problem, or NULL if the problem is infeasible or unbounded. If \c keepIntegers is true then bounds may be tightened in the original. Bounds will be moved by up to \c feasibilityTolerance to try and stay feasible. When \c doStatus is true, the current solution will be transformed to match the presolved model. This should be paired with postsolve(). It is up to the client to destroy the returned OsiSolverInterface, after calling postsolve(). This method is virtual. Override this method if you need to customize the steps of creating a model to apply presolve transformations. In some sense, a wrapper for presolve(CoinPresolveMatrix*). */ virtual OsiSolverInterface *presolvedModel(OsiSolverInterface & origModel, double feasibilityTolerance=0.0, bool keepIntegers=true, int numberPasses=5, const char * prohibited=NULL, bool doStatus=true, const char * rowProhibited=NULL); /*! \brief Restate the solution to the presolved problem in terms of the original problem and load it into the original model. postsolve() restates the solution in terms of the original problem and updates the original OsiSolverInterface supplied to presolvedModel(). If the problem has not been solved to optimality, there are no guarantees. If you are using an algorithm like simplex that has a concept of a basic solution, then set updateStatus The advantage of going back to the original problem is that it will be exactly as it was, i.e., 0.0 will not become 1.0e-19. Note that if you modified the original problem after presolving, then you must ``undo'' these modifications before calling postsolve(). In some sense, a wrapper for postsolve(CoinPostsolveMatrix&). */ virtual void postsolve(bool updateStatus=true); /*! \brief Return a pointer to the presolved model. */ OsiSolverInterface * model() const; /// Return a pointer to the original model OsiSolverInterface * originalModel() const; /// Set the pointer to the original model void setOriginalModel(OsiSolverInterface *model); /// Return a pointer to the original columns const int * originalColumns() const; /// Return a pointer to the original rows const int * originalRows() const; /// Return number of rows in original model inline int getNumRows() const { return nrows_;} /// Return number of columns in original model inline int getNumCols() const { return ncols_;} /** "Magic" number. If this is non-zero then any elements with this value may change and so presolve is very limited in what can be done to the row and column. This is for non-linear problems. */ inline void setNonLinearValue(double value) { nonLinearValue_ = value;} inline double nonLinearValue() const { return nonLinearValue_;} /*! \brief Fine control over presolve actions Set/clear the following bits to allow or suppress actions: - 0x01 allow duplicate column processing on integer columns and dual stuff on integers - 0x02 switch off actions which can change +1 to something else (doubleton, tripleton, implied free) - 0x04 allow transfer of costs from singletons and between integer variables (when advantageous) - 0x08 do not allow x+y+z=1 transform - 0x10 allow actions that don't easily unroll - 0x20 allow dubious gub element reduction GUB element reduction is only partially implemented in CoinPresolve (see gubrow_action) and willl cause an abort at postsolve. It's not clear what's meant by `dual stuff on integers'. -- lh, 110605 -- */ inline void setPresolveActions(int action) { presolveActions_ = (presolveActions_&0xffff0000)|(action&0xffff);} private: /*! Original model (solver interface loaded with the original problem). Must not be destroyed until after postsolve(). */ OsiSolverInterface * originalModel_; /*! Presolved model (solver interface loaded with the presolved problem) Must be destroyed by the client (using delete) after postsolve(). */ OsiSolverInterface * presolvedModel_; /*! "Magic" number. If this is non-zero then any elements with this value may change and so presolve is very limited in what can be done to the row and column. This is for non-linear problems. One could also allow for cases where sign of coefficient is known. */ double nonLinearValue_; /// Original column numbers int * originalColumn_; /// Original row numbers int * originalRow_; /// The list of transformations applied. const CoinPresolveAction *paction_; /*! \brief Number of columns in original model. The problem will expand back to its former size as postsolve transformations are applied. It is efficient to allocate data structures for the final size of the problem rather than expand them as needed. */ int ncols_; /*! \brief Number of rows in original model. */ int nrows_; /*! \brief Number of nonzero matrix coefficients in the original model. */ CoinBigIndex nelems_; /** Whether we want to skip dual part of presolve etc. 1 bit allows duplicate column processing on integer columns and dual stuff on integers 4 transfers costs to integer variables */ int presolveActions_; /// Number of major passes int numberPasses_; protected: /*! \brief Apply presolve transformations to the problem. Handles the core activity of applying presolve transformations. If you want to apply the individual presolve routines differently, or perhaps add your own to the mix, define a derived class and override this method */ virtual const CoinPresolveAction *presolve(CoinPresolveMatrix *prob); /*! \brief Reverse presolve transformations to recover the solution to the original problem. Handles the core activity of applying postsolve transformations. Postsolving is pretty generic; just apply the transformations in reverse order. You will probably only be interested in overriding this method if you want to add code to test for consistency while debugging new presolve techniques. */ virtual void postsolve(CoinPostsolveMatrix &prob); /*! \brief Destroys queued postsolve actions. E.g., when presolve() determines the problem is infeasible, so that it will not be necessary to actually solve the presolved problem and convert the result back to the original problem. */ void gutsOfDestroy(); }; #endif Osi-0.106.4/src/Osi/OsiSolverInterface.hpp0000644000076600007660000023157512062577416016721 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiSolverInterface_H #define OsiSolverInterface_H #include #include #include #include "CoinTypes.hpp" #include "CoinMessageHandler.hpp" #include "CoinPackedVectorBase.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStart.hpp" #include "CoinFinite.hpp" #include "CoinError.hpp" #include "OsiCollections.hpp" #include "OsiSolverParameters.hpp" class CoinSnapshot; class CoinLpIO; class CoinMpsIO; class OsiCuts; class OsiAuxInfo; class OsiRowCut; class OsiRowCutDebugger; class CoinSet; class CoinBuild; class CoinModel; class OsiSolverBranch; class OsiSolverResult; class OsiObject; //############################################################################# /*! \brief Abstract Base Class for describing an interface to a solver. Many OsiSolverInterface query methods return a const pointer to the requested read-only data. If the model data is changed or the solver is called, these pointers may no longer be valid and should be refreshed by invoking the member function to obtain an updated copy of the pointer. For example: \code OsiSolverInterface solverInterfacePtr ; const double * ruBnds = solverInterfacePtr->getRowUpper(); solverInterfacePtr->applyCuts(someSetOfCuts); // ruBnds is no longer a valid pointer and must be refreshed ruBnds = solverInterfacePtr->getRowUpper(); \endcode Querying a problem that has no data associated with it will result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. */ class OsiSolverInterface { friend void OsiSolverInterfaceCommonUnitTest( const OsiSolverInterface* emptySi, const std::string & mpsDir, const std::string & netlibDir); friend void OsiSolverInterfaceMpsUnitTest( const std::vector & vecSiP, const std::string & mpsDir); public: /// Internal class for obtaining status from the applyCuts method class ApplyCutsReturnCode { friend class OsiSolverInterface; friend class OsiClpSolverInterface; friend class OsiGrbSolverInterface; public: ///@name Constructors and desctructors //@{ /// Default constructor ApplyCutsReturnCode(): intInconsistent_(0), extInconsistent_(0), infeasible_(0), ineffective_(0), applied_(0) {} /// Copy constructor ApplyCutsReturnCode(const ApplyCutsReturnCode & rhs): intInconsistent_(rhs.intInconsistent_), extInconsistent_(rhs.extInconsistent_), infeasible_(rhs.infeasible_), ineffective_(rhs.ineffective_), applied_(rhs.applied_) {} /// Assignment operator ApplyCutsReturnCode & operator=(const ApplyCutsReturnCode& rhs) { if (this != &rhs) { intInconsistent_ = rhs.intInconsistent_; extInconsistent_ = rhs.extInconsistent_; infeasible_ = rhs.infeasible_; ineffective_ = rhs.ineffective_; applied_ = rhs.applied_; } return *this; } /// Destructor ~ApplyCutsReturnCode(){} //@} /**@name Accessing return code attributes */ //@{ /// Number of logically inconsistent cuts inline int getNumInconsistent() const {return intInconsistent_;} /// Number of cuts inconsistent with the current model inline int getNumInconsistentWrtIntegerModel() const {return extInconsistent_;} /// Number of cuts that cause obvious infeasibility inline int getNumInfeasible() const {return infeasible_;} /// Number of redundant or ineffective cuts inline int getNumIneffective() const {return ineffective_;} /// Number of cuts applied inline int getNumApplied() const {return applied_;} //@} private: /**@name Private methods */ //@{ /// Increment logically inconsistent cut counter inline void incrementInternallyInconsistent(){intInconsistent_++;} /// Increment model-inconsistent counter inline void incrementExternallyInconsistent(){extInconsistent_++;} /// Increment infeasible cut counter inline void incrementInfeasible(){infeasible_++;} /// Increment ineffective cut counter inline void incrementIneffective(){ineffective_++;} /// Increment applied cut counter inline void incrementApplied(){applied_++;} //@} ///@name Private member data //@{ /// Counter for logically inconsistent cuts int intInconsistent_; /// Counter for model-inconsistent cuts int extInconsistent_; /// Counter for infeasible cuts int infeasible_; /// Counter for ineffective cuts int ineffective_; /// Counter for applied cuts int applied_; //@} }; //--------------------------------------------------------------------------- ///@name Solve methods //@{ /// Solve initial LP relaxation virtual void initialSolve() = 0; /*! \brief Resolve an LP relaxation after problem modification Note the `re-' in `resolve'. initialSolve() should be used to solve the problem for the first time. */ virtual void resolve() = 0; /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound() = 0; #ifdef CBC_NEXT_VERSION /* Would it make sense to collect all of these routines in a `MIP Helper' section? It'd make it easier for users and implementors to find them. */ /** Solve 2**N (N==depth) problems and return solutions and bases. There are N branches each of which changes bounds on both sides as given by branch. The user should provide an array of (empty) results which will be filled in. See OsiSolveResult for more details (in OsiSolveBranch.?pp) but it will include a basis and primal solution. The order of results is left to right at feasible leaf nodes so first one is down, down, ..... Returns number of feasible leaves. Also sets number of solves done and number of iterations. This is provided so a solver can do faster. If forceBranch true then branch done even if satisfied */ virtual int solveBranches(int depth,const OsiSolverBranch * branch, OsiSolverResult * result, int & numberSolves, int & numberIterations, bool forceBranch=false); #endif //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. When a set method returns false, the original value (if any) should be unchanged. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. \note There is a default implementation of the set/get methods, namely to store/retrieve the given value using an array in the base class. A specific solver implementation can use this feature, for example, to store parameters that should be used later on. Implementors of a solver interface should overload these functions to provide the proper interface to and accurately reflect the capabilities of a specific solver. The format for hints is slightly different in that a boolean specifies the sense of the hint and an enum specifies the strength of the hint. Hints should be initialised when a solver is instantiated. (See OsiSolverParameters.hpp for defined hint parameters and strength.) When specifying the sense of the hint, a value of true means to work with the hint, false to work against it. For example,
    • \code setHintParam(OsiDoScale,true,OsiHintTry) \endcode is a mild suggestion to the solver to scale the constraint system.
    • \code setHintParam(OsiDoScale,false,OsiForceDo) \endcode tells the solver to disable scaling, or throw an exception if it cannot comply.
    As another example, a solver interface could use the value and strength of the \c OsiDoReducePrint hint to adjust the amount of information printed by the interface and/or solver. The extent to which a solver obeys hints is left to the solver. The value and strength returned by \c getHintParam will match the most recent call to \c setHintParam, and will not necessarily reflect the solver's ability to comply with the hint. If the hint strength is \c OsiForceDo, the solver is required to throw an exception if it cannot perform the specified action. \note As with the other set/get methods, there is a default implementation which maintains arrays in the base class for hint sense and strength. The default implementation does not store the \c otherInformation pointer, and always throws an exception for strength \c OsiForceDo. Implementors of a solver interface should override these functions to provide the proper interface to and accurately reflect the capabilities of a specific solver. */ //@{ //! Set an integer parameter virtual bool setIntParam(OsiIntParam key, int value) { if (key == OsiLastIntParam) return (false) ; intParam_[key] = value; return true; } //! Set a double parameter virtual bool setDblParam(OsiDblParam key, double value) { if (key == OsiLastDblParam) return (false) ; dblParam_[key] = value; return true; } //! Set a string parameter virtual bool setStrParam(OsiStrParam key, const std::string & value) { if (key == OsiLastStrParam) return (false) ; strParam_[key] = value; return true; } /*! \brief Set a hint parameter The \c otherInformation parameter can be used to pass in an arbitrary block of information which is interpreted by the OSI and the underlying solver. Users are cautioned that this hook is solver-specific. Implementors: The default implementation completely ignores \c otherInformation and always throws an exception for OsiForceDo. This is almost certainly not the behaviour you want; you really should override this method. */ virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void * /*otherInformation*/ = NULL) { if (key==OsiLastHintParam) return false; hintParam_[key] = yesNo; hintStrength_[key] = strength; if (strength == OsiForceDo) throw CoinError("OsiForceDo illegal", "setHintParam", "OsiSolverInterface"); return true; } //! Get an integer parameter virtual bool getIntParam(OsiIntParam key, int& value) const { if (key == OsiLastIntParam) return (false) ; value = intParam_[key]; return true; } //! Get a double parameter virtual bool getDblParam(OsiDblParam key, double& value) const { if (key == OsiLastDblParam) return (false) ; value = dblParam_[key]; return true; } //! Get a string parameter virtual bool getStrParam(OsiStrParam key, std::string& value) const { if (key == OsiLastStrParam) return (false) ; value = strParam_[key]; return true; } /*! \brief Get a hint parameter (all information) Return all available information for the hint: sense, strength, and any extra information associated with the hint. Implementors: The default implementation will always set \c otherInformation to NULL. This is almost certainly not the behaviour you want; you really should override this method. */ virtual bool getHintParam(OsiHintParam key, bool& yesNo, OsiHintStrength& strength, void *& otherInformation) const { if (key==OsiLastHintParam) return false; yesNo = hintParam_[key]; strength = hintStrength_[key]; otherInformation=NULL; return true; } /*! \brief Get a hint parameter (sense and strength only) Return only the sense and strength of the hint. */ virtual bool getHintParam(OsiHintParam key, bool& yesNo, OsiHintStrength& strength) const { if (key==OsiLastHintParam) return false; yesNo = hintParam_[key]; strength = hintStrength_[key]; return true; } /*! \brief Get a hint parameter (sense only) Return only the sense (true/false) of the hint. */ virtual bool getHintParam(OsiHintParam key, bool& yesNo) const { if (key==OsiLastHintParam) return false; yesNo = hintParam_[key]; return true; } /*! \brief Copy all parameters in this section from one solver to another Note that the current implementation also copies the appData block, message handler, and rowCutDebugger. Arguably these should have independent copy methods. */ void copyParameters(OsiSolverInterface & rhs); /** \brief Return the integrality tolerance of the underlying solver. We should be able to get an integrality tolerance, but until that time just use the primal tolerance \todo This method should be replaced; it's architecturally wrong. This should be an honest dblParam with a keyword. Underlying solvers that do not support integer variables should return false for set and get on this parameter. Underlying solvers that support integrality should add this to the parameters they support, using whatever tolerance is appropriate. -lh, 091021- */ inline double getIntegerTolerance() const { return dblParam_[OsiPrimalTolerance];} //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there numerical difficulties? virtual bool isAbandoned() const = 0; /// Is optimality proven? virtual bool isProvenOptimal() const = 0; /// Is primal infeasibility proven? virtual bool isProvenPrimalInfeasible() const = 0; /// Is dual infeasibility proven? virtual bool isProvenDualInfeasible() const = 0; /// Is the given primal objective limit reached? virtual bool isPrimalObjectiveLimitReached() const; /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const = 0; //@} //--------------------------------------------------------------------------- /** \name Warm start methods Note that the warm start methods return a generic CoinWarmStart object. The precise characteristics of this object are solver-dependent. Clients who wish to maintain a maximum degree of solver independence should take care to avoid unnecessary assumptions about the properties of a warm start object. */ //@{ /*! \brief Get an empty warm start object This routine returns an empty warm start object. Its purpose is to provide a way for a client to acquire a warm start object of the appropriate type for the solver, which can then be resized and modified as desired. */ virtual CoinWarmStart *getEmptyWarmStart () const = 0 ; /** \brief Get warm start information. Return warm start information for the current state of the solver interface. If there is no valid warm start information, an empty warm start object wil be returned. */ virtual CoinWarmStart* getWarmStart() const = 0; /** \brief Get warm start information. Return warm start information for the current state of the solver interface. If there is no valid warm start information, an empty warm start object wil be returned. This does not necessarily create an object - may just point to one. must Delete set true if user should delete returned object. */ virtual CoinWarmStart* getPointerToWarmStart(bool & mustDelete) ; /** \brief Set warm start information. Return true or false depending on whether the warm start information was accepted or not. By definition, a call to setWarmStart with a null parameter should cause the solver interface to refresh its warm start information from the underlying solver. */ virtual bool setWarmStart(const CoinWarmStart* warmstart) = 0; //@} //--------------------------------------------------------------------------- /**@name Hot start methods Primarily used in strong branching. The user can create a hot start object --- a snapshot of the optimization process --- then reoptimize over and over again, starting from the same point. \note
    • Between hot started optimizations only bound changes are allowed.
    • The copy constructor and assignment operator should NOT copy any hot start information.
    • The default implementation simply extracts a warm start object in \c markHotStart, resets to the warm start object in \c solveFromHotStart, and deletes the warm start object in \c unmarkHotStart. Actual solver implementations are encouraged to do better.
    */ //@{ /// Create a hot start snapshot of the optimization process. virtual void markHotStart(); /// Optimize starting from the hot start snapshot. virtual void solveFromHotStart(); /// Delete the hot start snapshot. virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem query methods Querying a problem that has no data associated with it will result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /// Get the number of columns virtual int getNumCols() const = 0; /// Get the number of rows virtual int getNumRows() const = 0; /// Get the number of nonzero elements virtual int getNumElements() const = 0; /// Get the number of integer variables virtual int getNumIntegers() const ; /// Get a pointer to an array[getNumCols()] of column lower bounds virtual const double * getColLower() const = 0; /// Get a pointer to an array[getNumCols()] of column upper bounds virtual const double * getColUpper() const = 0; /*! \brief Get a pointer to an array[getNumRows()] of row constraint senses.
    • 'L': <= constraint
    • 'E': = constraint
    • 'G': >= constraint
    • 'R': ranged constraint
    • 'N': free constraint
    */ virtual const char * getRowSense() const = 0; /*! \brief Get a pointer to an array[getNumRows()] of row right-hand sides
    • if getRowSense()[i] == 'L' then getRightHandSide()[i] == getRowUpper()[i]
    • if getRowSense()[i] == 'G' then getRightHandSide()[i] == getRowLower()[i]
    • if getRowSense()[i] == 'R' then getRightHandSide()[i] == getRowUpper()[i]
    • if getRowSense()[i] == 'N' then getRightHandSide()[i] == 0.0
    */ virtual const double * getRightHandSide() const = 0; /*! \brief Get a pointer to an array[getNumRows()] of row ranges.
    • if getRowSense()[i] == 'R' then getRowRange()[i] == getRowUpper()[i] - getRowLower()[i]
    • if getRowSense()[i] != 'R' then getRowRange()[i] is 0.0
    */ virtual const double * getRowRange() const = 0; /// Get a pointer to an array[getNumRows()] of row lower bounds virtual const double * getRowLower() const = 0; /// Get a pointer to an array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const = 0; /*! \brief Get a pointer to an array[getNumCols()] of objective function coefficients. */ virtual const double * getObjCoefficients() const = 0; /*! \brief Get the objective function sense - 1 for minimisation (default) - -1 for maximisation */ virtual double getObjSense() const = 0; /// Return true if the variable is continuous virtual bool isContinuous(int colIndex) const = 0; /// Return true if the variable is binary virtual bool isBinary(int colIndex) const; /*! \brief Return true if the variable is integer. This method returns true if the variable is binary or general integer. */ virtual bool isInteger(int colIndex) const; /// Return true if the variable is general integer virtual bool isIntegerNonBinary(int colIndex) const; /// Return true if the variable is binary and not fixed virtual bool isFreeBinary(int colIndex) const; /*! \brief Return an array[getNumCols()] of column types \deprecated See #getColType */ inline const char *columnType(bool refresh=false) const { return getColType(refresh); } /*! \brief Return an array[getNumCols()] of column types - 0 - continuous - 1 - binary - 2 - general integer If \p refresh is true, the classification of integer variables as binary or general integer will be reevaluated. If the current bounds are [0,1], or if the variable is fixed at 0 or 1, it will be classified as binary, otherwise it will be classified as general integer. */ virtual const char * getColType(bool refresh=false) const; /// Get a pointer to a row-wise copy of the matrix virtual const CoinPackedMatrix * getMatrixByRow() const = 0; /// Get a pointer to a column-wise copy of the matrix virtual const CoinPackedMatrix * getMatrixByCol() const = 0; /*! \brief Get a pointer to a mutable row-wise copy of the matrix. Returns NULL if the request is not meaningful (i.e., the OSI will not recognise any modifications to the matrix). */ virtual CoinPackedMatrix * getMutableMatrixByRow() const {return NULL;} /*! \brief Get a pointer to a mutable column-wise copy of the matrix Returns NULL if the request is not meaningful (i.e., the OSI will not recognise any modifications to the matrix). */ virtual CoinPackedMatrix * getMutableMatrixByCol() const {return NULL;} /// Get the solver's value for infinity virtual double getInfinity() const = 0; //@} /**@name Solution query methods */ //@{ /// Get a pointer to an array[getNumCols()] of primal variable values virtual const double * getColSolution() const = 0; /** Get a pointer to an array[getNumCols()] of primal variable values guaranteed to be between the column lower and upper bounds. */ virtual const double * getStrictColSolution(); /// Get pointer to array[getNumRows()] of dual variable values virtual const double * getRowPrice() const = 0; /// Get a pointer to an array[getNumCols()] of reduced costs virtual const double * getReducedCost() const = 0; /** Get a pointer to array[getNumRows()] of row activity levels. The row activity for a row is the left-hand side evaluated at the current solution. */ virtual const double * getRowActivity() const = 0; /// Get the objective function value. virtual double getObjValue() const = 0; /** Get the number of iterations it took to solve the problem (whatever `iteration' means to the solver). */ virtual int getIterationCount() const = 0; /** Get as many dual rays as the solver can provide. In case of proven primal infeasibility there should (with high probability) be at least one. The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. \note Implementors of solver interfaces note that the double pointers in the vector should point to arrays of length getNumRows() (fullRay = false) or (getNumRows()+getNumCols()) (fullRay = true) and they should be allocated with new[]. \note Clients of solver interfaces note that it is the client's responsibility to free the double pointers in the vector using delete[]. Clients are reminded that a problem can be dual and primal infeasible. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay = false) const = 0; /** Get as many primal rays as the solver can provide. In case of proven dual infeasibility there should (with high probability) be at least one. \note Implementors of solver interfaces note that the double pointers in the vector should point to arrays of length getNumCols() and they should be allocated with new[]. \note Clients of solver interfaces note that it is the client's responsibility to free the double pointers in the vector using delete[]. Clients are reminded that a problem can be dual and primal infeasible. */ virtual std::vector getPrimalRays(int maxNumRays) const = 0; /** Get vector of indices of primal variables which are integer variables but have fractional values in the current solution. */ virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const; //@} //------------------------------------------------------------------------- /**@name Methods to modify the objective, bounds, and solution For functions which take a set of indices as parameters (\c setObjCoeffSet(), \c setColSetBounds(), \c setRowSetBounds(), \c setRowSetTypes()), the parameters follow the C++ STL iterator convention: \c indexFirst points to the first index in the set, and \c indexLast points to a position one past the last index in the set. */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff( int elementIndex, double elementValue ) = 0; /** Set a set of objective function coefficients */ virtual void setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList); /** Set the objective coefficients for all columns. array [getNumCols()] is an array of values for the objective. This defaults to a series of set operations and is here for speed. */ virtual void setObjective(const double * array); /** Set the objective function sense. Use 1 for minimisation (default), -1 for maximisation. \note Implementors note that objective function sense is a parameter of the OSI, not a property of the problem. Objective sense can be set prior to problem load and should not be affected by loading a new problem. */ virtual void setObjSense(double s) = 0; /** Set a single column lower bound. Use -getInfinity() for -infinity. */ virtual void setColLower( int elementIndex, double elementValue ) = 0; /** Set the lower bounds for all columns. array [getNumCols()] is an array of values for the lower bounds. This defaults to a series of set operations and is here for speed. */ virtual void setColLower(const double * array); /** Set a single column upper bound. Use getInfinity() for infinity. */ virtual void setColUpper( int elementIndex, double elementValue ) = 0; /** Set the upper bounds for all columns. array [getNumCols()] is an array of values for the upper bounds. This defaults to a series of set operations and is here for speed. */ virtual void setColUpper(const double * array); /** Set a single column lower and upper bound. The default implementation just invokes setColLower() and setColUpper() */ virtual void setColBounds( int elementIndex, double lower, double upper ) { setColLower(elementIndex, lower); setColUpper(elementIndex, upper); } /** Set the upper and lower bounds of a set of columns. The default implementation just invokes setColBounds() over and over again. For each column, boundList must contain both a lower and upper bound, in that order. */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set a single row lower bound. Use -getInfinity() for -infinity. */ virtual void setRowLower( int elementIndex, double elementValue ) = 0; /** Set a single row upper bound. Use getInfinity() for infinity. */ virtual void setRowUpper( int elementIndex, double elementValue ) = 0; /** Set a single row lower and upper bound. The default implementation just invokes setRowLower() and setRowUpper() */ virtual void setRowBounds( int elementIndex, double lower, double upper ) { setRowLower(elementIndex, lower); setRowUpper(elementIndex, upper); } /** Set the bounds on a set of rows. The default implementation just invokes setRowBounds() over and over again. For each row, boundList must contain both a lower and upper bound, in that order. */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a single row */ virtual void setRowType(int index, char sense, double rightHandSide, double range) = 0; /** Set the type of a set of rows. The default implementation just invokes setRowType() over and over again. */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); /** Set the primal solution variable values colsol[getNumCols()] is an array of values for the primal variables. These values are copied to memory owned by the solver interface object or the solver. They will be returned as the result of getColSolution() until changed by another call to setColSolution() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double *colsol) = 0; /** Set dual solution variable values rowprice[getNumRows()] is an array of values for the dual variables. These values are copied to memory owned by the solver interface object or the solver. They will be returned as the result of getRowPrice() until changed by another call to setRowPrice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice) = 0; /** Fix variables at bound based on reduced cost For variables currently at bound, fix the variable at bound if the reduced cost exceeds the gap. Return the number of variables fixed. If justInteger is set to false, the routine will also fix continuous variables, but the test still assumes a delta of 1.0. */ virtual int reducedCostFix(double gap, bool justInteger=true); //@} //------------------------------------------------------------------------- /**@name Methods to set variable type */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index) = 0; /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index) = 0; /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); //@} //------------------------------------------------------------------------- //------------------------------------------------------------------------- /*! \brief Data type for name vectors. */ typedef std::vector OsiNameVec ; /*! \name Methods for row and column names Osi defines three name management disciplines: `auto names' (0), `lazy names' (1), and `full names' (2). See the description of #OsiNameDiscipline for details. Changing the name discipline (via setIntParam()) will not automatically add or remove name information, but setting the discipline to auto will make existing information inaccessible until the discipline is reset to lazy or full. By definition, a row index of getNumRows() (i.e., one larger than the largest valid row index) refers to the objective function. OSI users and implementors: While the OSI base class can define an interface and provide rudimentary support, use of names really depends on support by the OsiXXX class to ensure that names are managed correctly. If an OsiXXX class does not support names, it should return false for calls to getIntParam() or setIntParam() that reference OsiNameDiscipline. */ //@{ /*! \brief Generate a standard name of the form Rnnnnnnn or Cnnnnnnn Set \p rc to 'r' for a row name, 'c' for a column name. The `nnnnnnn' part is generated from ndx and will contain 7 digits by default, padded with zeros if necessary. As a special case, ndx = getNumRows() is interpreted as a request for the name of the objective function. OBJECTIVE is returned, truncated to digits+1 characters to match the row and column names. */ virtual std::string dfltRowColName(char rc, int ndx, unsigned digits = 7) const ; /*! \brief Return the name of the objective function */ virtual std::string getObjName (unsigned maxLen = static_cast(std::string::npos)) const ; /*! \brief Set the name of the objective function */ virtual inline void setObjName (std::string name) { objName_ = name ; } /*! \brief Return the name of the row. The routine will always return some name, regardless of the name discipline or the level of support by an OsiXXX derived class. Use maxLen to limit the length. */ virtual std::string getRowName(int rowIndex, unsigned maxLen = static_cast(std::string::npos)) const ; /*! \brief Return a pointer to a vector of row names If the name discipline (#OsiNameDiscipline) is auto, the return value will be a vector of length zero. If the name discipline is lazy, the vector will contain only names supplied by the client and will be no larger than needed to hold those names; entries not supplied will be null strings. In particular, the objective name is not included in the vector for lazy names. If the name discipline is full, the vector will have getNumRows() names, either supplied or generated, plus one additional entry for the objective name. */ virtual const OsiNameVec &getRowNames() ; /*! \brief Set a row name Quietly does nothing if the name discipline (#OsiNameDiscipline) is auto. Quietly fails if the row index is invalid. */ virtual void setRowName(int ndx, std::string name) ; /*! \brief Set multiple row names The run of len entries starting at srcNames[srcStart] are installed as row names starting at row index tgtStart. The base class implementation makes repeated calls to setRowName. */ virtual void setRowNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart) ; /*! \brief Delete len row names starting at index tgtStart The specified row names are removed and the remaining row names are copied down to close the gap. */ virtual void deleteRowNames(int tgtStart, int len) ; /*! \brief Return the name of the column The routine will always return some name, regardless of the name discipline or the level of support by an OsiXXX derived class. Use maxLen to limit the length. */ virtual std::string getColName(int colIndex, unsigned maxLen = static_cast(std::string::npos)) const ; /*! \brief Return a pointer to a vector of column names If the name discipline (#OsiNameDiscipline) is auto, the return value will be a vector of length zero. If the name discipline is lazy, the vector will contain only names supplied by the client and will be no larger than needed to hold those names; entries not supplied will be null strings. If the name discipline is full, the vector will have getNumCols() names, either supplied or generated. */ virtual const OsiNameVec &getColNames() ; /*! \brief Set a column name Quietly does nothing if the name discipline (#OsiNameDiscipline) is auto. Quietly fails if the column index is invalid. */ virtual void setColName(int ndx, std::string name) ; /*! \brief Set multiple column names The run of len entries starting at srcNames[srcStart] are installed as column names starting at column index tgtStart. The base class implementation makes repeated calls to setColName. */ virtual void setColNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart) ; /*! \brief Delete len column names starting at index tgtStart The specified column names are removed and the remaining column names are copied down to close the gap. */ virtual void deleteColNames(int tgtStart, int len) ; /*! \brief Set row and column names from a CoinMpsIO object. Also sets the name of the objective function. If the name discipline is auto, you get what you asked for. This routine does not use setRowName or setColName. */ void setRowColNames(const CoinMpsIO &mps) ; /*! \brief Set row and column names from a CoinModel object. If the name discipline is auto, you get what you asked for. This routine does not use setRowName or setColName. */ void setRowColNames(CoinModel &mod) ; /*! \brief Set row and column names from a CoinLpIO object. Also sets the name of the objective function. If the name discipline is auto, you get what you asked for. This routine does not use setRowName or setColName. */ void setRowColNames(CoinLpIO &mod) ; //@} //------------------------------------------------------------------------- //------------------------------------------------------------------------- /**@name Methods to modify the constraint system. Note that new columns are added as continuous variables. */ //@{ /** Add a column (primal variable) to the problem. */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) = 0; /*! \brief Add a named column (primal variable) to the problem. The default implementation adds the column, then changes the name. This can surely be made more efficient within an OsiXXX class. */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj, std::string name) ; /** Add a column (primal variable) to the problem. */ virtual void addCol(int numberElements, const int* rows, const double* elements, const double collb, const double colub, const double obj) ; /*! \brief Add a named column (primal variable) to the problem. The default implementation adds the column, then changes the name. This can surely be made more efficient within an OsiXXX class. */ virtual void addCol(int numberElements, const int* rows, const double* elements, const double collb, const double colub, const double obj, std::string name) ; /** Add a set of columns (primal variables) to the problem. The default implementation simply makes repeated calls to addCol(). */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); /** Add a set of columns (primal variables) to the problem. The default implementation simply makes repeated calls to addCol(). */ virtual void addCols(const int numcols, const int* columnStarts, const int* rows, const double* elements, const double* collb, const double* colub, const double* obj); /// Add columns using a CoinBuild object void addCols(const CoinBuild & buildObject); /** Add columns from a model object. returns -1 if object in bad state (i.e. has row information) otherwise number of errors modelObject non const as can be regularized as part of build */ int addCols(CoinModel & modelObject); #if 0 /** */ virtual void addCols(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj); #endif /** \brief Remove a set of columns (primal variables) from the problem. The solver interface for a basis-oriented solver will maintain valid warm start information if all deleted variables are nonbasic. */ virtual void deleteCols(const int num, const int * colIndices) = 0; /*! \brief Add a row (constraint) to the problem. */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub) = 0; /*! \brief Add a named row (constraint) to the problem. The default implementation adds the row, then changes the name. This can surely be made more efficient within an OsiXXX class. */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub, std::string name) ; /*! \brief Add a row (constraint) to the problem. */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) = 0; /*! \brief Add a named row (constraint) to the problem. The default implementation adds the row, then changes the name. This can surely be made more efficient within an OsiXXX class. */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng, std::string name) ; /*! Add a row (constraint) to the problem. Converts to addRow(CoinPackedVectorBase&,const double,const double). */ virtual void addRow(int numberElements, const int *columns, const double *element, const double rowlb, const double rowub) ; /*! Add a set of rows (constraints) to the problem. The default implementation simply makes repeated calls to addRow(). */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** Add a set of rows (constraints) to the problem. The default implementation simply makes repeated calls to addRow(). */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); /** Add a set of rows (constraints) to the problem. The default implementation simply makes repeated calls to addRow(). */ virtual void addRows(const int numrows, const int *rowStarts, const int *columns, const double *element, const double *rowlb, const double *rowub); /// Add rows using a CoinBuild object void addRows(const CoinBuild &buildObject); /*! Add rows from a CoinModel object. Returns -1 if the object is in the wrong state (i.e., has column-major information), otherwise the number of errors. The modelObject is not const as it can be regularized as part of the build. */ int addRows(CoinModel &modelObject); #if 0 /** */ virtual void addRows(const CoinPackedMatrix& matrix, const double* rowlb, const double* rowub); /** */ virtual void addRows(const CoinPackedMatrix& matrix, const char* rowsen, const double* rowrhs, const double* rowrng); #endif /** \brief Delete a set of rows (constraints) from the problem. The solver interface for a basis-oriented solver will maintain valid warm start information if all deleted rows are loose. */ virtual void deleteRows(const int num, const int * rowIndices) = 0; /** \brief Replace the constraint matrix I (JJF) am getting annoyed because I can't just replace a matrix. The default behavior of this is do nothing so only use where that would not matter, e.g. strengthening a matrix for MIP. */ virtual void replaceMatrixOptional(const CoinPackedMatrix & ) {} /** \brief Replace the constraint matrix And if it does matter (not used at present) */ virtual void replaceMatrix(const CoinPackedMatrix & ) {abort();} /** \brief Save a copy of the base model If solver wants it can save a copy of "base" (continuous) model here. */ virtual void saveBaseModel() {} /** \brief Reduce the constraint system to the specified number of constraints. If solver wants it can restore a copy of "base" (continuous) model here. \note The name is somewhat misleading. Implementors should consider the opportunity to optimise behaviour in the common case where \p numberRows is exactly the number of original constraints. Do not, however, neglect the possibility that \p numberRows does not equal the number of original constraints. */ virtual void restoreBaseModel(int numberRows); //----------------------------------------------------------------------- /** Apply a collection of cuts. Only cuts which have an effectiveness >= effectivenessLb are applied.
    • ReturnCode.getNumineffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
    • ReturnCode.getNuminconsistent() -- number of invalid cuts
    • ReturnCode.getNuminconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
    • ReturnCode.getNuminfeasible() -- number of cuts that would make this integer model infeasible
    • ReturnCode.getNumApplied() -- number of integer cuts which were applied to the integer model
    • cs.size() == getNumineffective() + getNuminconsistent() + getNuminconsistentWrtIntegerModel() + getNuminfeasible() + getNumApplied()
    */ virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); /** Apply a collection of row cuts which are all effective. applyCuts seems to do one at a time which seems inefficient. Would be even more efficient to pass an array of pointers. */ virtual void applyRowCuts(int numberCuts, const OsiRowCut * cuts); /** Apply a collection of row cuts which are all effective. This is passed in as an array of pointers. */ virtual void applyRowCuts(int numberCuts, const OsiRowCut ** cuts); /// Deletes branching information before columns deleted void deleteBranchingInfo(int numberDeleted, const int * which); //@} //--------------------------------------------------------------------------- /**@name Methods for problem input and output */ //@{ /*! \brief Load in a problem by copying the arguments. The constraints on the rows are given by lower and upper bounds. If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • rowub: all rows have upper bound infinity
    • rowlb: all rows have lower bound -infinity
    • obj: all variables have 0 objective coefficient
    Note that the default values for rowub and rowlb produce the constraint -infty <= ax <= infty. This is probably not what you want. */ virtual void loadProblem (const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub) = 0; /*! \brief Load in a problem by assuming ownership of the arguments. The constraints on the rows are given by lower and upper bounds. For default argument values see the matching loadProblem method. \warning The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem (CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub) = 0; /*! \brief Load in a problem by copying the arguments. The constraints on the rows are given by sense/rhs/range triplets. If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • obj: all variables have 0 objective coefficient
    • rowsen: all rows are >=
    • rowrhs: all right hand sides are 0
    • rowrng: 0 for the ranged rows
    Note that the default values for rowsen, rowrhs, and rowrng produce the constraint ax >= 0. */ virtual void loadProblem (const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng) = 0; /*! \brief Load in a problem by assuming ownership of the arguments. The constraints on the rows are given by sense/rhs/range triplets. For default argument values see the matching loadProblem method. \warning The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem (CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng) = 0; /*! \brief Load in a problem by copying the arguments. The constraint matrix is is specified with standard column-major column starts / row indices / coefficients vectors. The constraints on the rows are given by lower and upper bounds. The matrix vectors must be gap-free. Note that start must have numcols+1 entries so that the length of the last column can be calculated as start[numcols]-start[numcols-1]. See the previous loadProblem method using rowlb and rowub for default argument values. */ virtual void loadProblem (const int numcols, const int numrows, const CoinBigIndex * start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub) = 0; /*! \brief Load in a problem by copying the arguments. The constraint matrix is is specified with standard column-major column starts / row indices / coefficients vectors. The constraints on the rows are given by sense/rhs/range triplets. The matrix vectors must be gap-free. Note that start must have numcols+1 entries so that the length of the last column can be calculated as start[numcols]-start[numcols-1]. See the previous loadProblem method using sense/rhs/range for default argument values. */ virtual void loadProblem (const int numcols, const int numrows, const CoinBigIndex * start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng) = 0; /*! \brief Load a model from a CoinModel object. Return the number of errors encountered. The modelObject parameter cannot be const as it may be changed as part of process. If keepSolution is true will try and keep warmStart. */ virtual int loadFromCoinModel (CoinModel & modelObject, bool keepSolution=false); /*! \brief Read a problem in MPS format from the given filename. The default implementation uses CoinMpsIO::readMps() to read the MPS file and returns the number of errors encountered. */ virtual int readMps (const char *filename, const char *extension = "mps") ; /*! \brief Read a problem in MPS format from the given full filename. This uses CoinMpsIO::readMps() to read the MPS file and returns the number of errors encountered. It also may return an array of set information */ virtual int readMps (const char *filename, const char*extension, int & numberSets, CoinSet ** & sets); /*! \brief Read a problem in GMPL format from the given filenames. The default implementation uses CoinMpsIO::readGMPL(). This capability is available only if the third-party package Glpk is installed. */ virtual int readGMPL (const char *filename, const char *dataname=NULL); /*! \brief Write the problem in MPS format to the specified file. If objSense is non-zero, a value of -1.0 causes the problem to be written with a maximization objective; +1.0 forces a minimization objective. If objSense is zero, the choice is left to the implementation. */ virtual void writeMps (const char *filename, const char *extension = "mps", double objSense=0.0) const = 0; /*! \brief Write the problem in MPS format to the specified file with more control over the output. Row and column names may be null. formatType is
    • 0 - normal
    • 1 - extra accuracy
    • 2 - IEEE hex
    Returns non-zero on I/O error */ int writeMpsNative (const char *filename, const char ** rowNames, const char ** columnNames, int formatType=0,int numberAcross=2, double objSense=0.0, int numberSOS=0, const CoinSet * setInfo=NULL) const ; /***********************************************************************/ // Lp files /** Write the problem into an Lp file of the given filename with the specified extension. Coefficients with value less than epsilon away from an integer value are written as integers. Write at most numberAcross monomials on a line. Write non integer numbers with decimals digits after the decimal point. The written problem is always a minimization problem. If the current problem is a maximization problem, the intended objective function for the written problem is the current objective function multiplied by -1. If the current problem is a minimization problem, the intended objective function for the written problem is the current objective function. If objSense < 0, the intended objective function is multiplied by -1 before writing the problem. It is left unchanged otherwise. Write objective function name and constraint names if useRowNames is true. This version calls writeLpNative(). */ virtual void writeLp(const char *filename, const char *extension = "lp", double epsilon = 1e-5, int numberAcross = 10, int decimals = 5, double objSense = 0.0, bool useRowNames = true) const; /** Write the problem into the file pointed to by the parameter fp. Other parameters are similar to those of writeLp() with first parameter filename. */ virtual void writeLp(FILE *fp, double epsilon = 1e-5, int numberAcross = 10, int decimals = 5, double objSense = 0.0, bool useRowNames = true) const; /** Write the problem into an Lp file. Parameters are similar to those of writeLp(), but in addition row names and column names may be given. Parameter rowNames may be NULL, in which case default row names are used. If rowNames is not NULL, it must have exactly one entry per row in the problem and one additional entry (rowNames[getNumRows()] with the objective function name. These getNumRows()+1 entries must be distinct. If this is not the case, default row names are used. In addition, format restrictions are imposed on names (see CoinLpIO::is_invalid_name() for details). Similar remarks can be made for the parameter columnNames which must either be NULL or have exactly getNumCols() distinct entries. Write objective function name and constraint names if useRowNames is true. */ int writeLpNative(const char *filename, char const * const * const rowNames, char const * const * const columnNames, const double epsilon = 1.0e-5, const int numberAcross = 10, const int decimals = 5, const double objSense = 0.0, const bool useRowNames = true) const; /** Write the problem into the file pointed to by the parameter fp. Other parameters are similar to those of writeLpNative() with first parameter filename. */ int writeLpNative(FILE *fp, char const * const * const rowNames, char const * const * const columnNames, const double epsilon = 1.0e-5, const int numberAcross = 10, const int decimals = 5, const double objSense = 0.0, const bool useRowNames = true) const; /// Read file in LP format from file with name filename. /// See class CoinLpIO for description of this format. virtual int readLp(const char *filename, const double epsilon = 1e-5); /// Read file in LP format from the file pointed to by fp. /// See class CoinLpIO for description of this format. int readLp(FILE *fp, const double epsilon = 1e-5); //@} //--------------------------------------------------------------------------- /**@name Miscellaneous */ //@{ #ifdef COIN_SNAPSHOT /// Return a CoinSnapshot virtual CoinSnapshot * snapshot(bool createArrays=true) const; #endif #ifdef COIN_FACTORIZATION_INFO /// Return number of entries in L part of current factorization virtual CoinBigIndex getSizeL() const; /// Return number of entries in U part of current factorization virtual CoinBigIndex getSizeU() const; #endif //@} //--------------------------------------------------------------------------- /**@name Setting/Accessing application data */ //@{ /** Set application data. This is a pointer that the application can store into and retrieve from the solver interface. This field is available for the application to optionally define and use. */ void setApplicationData (void * appData); /** Create a clone of an Auxiliary Information object. The base class just stores an application data pointer but can be more general. Application data pointer is designed for one user while this can be extended to cope with more general extensions. */ void setAuxiliaryInfo(OsiAuxInfo * auxiliaryInfo); /// Get application data void * getApplicationData() const; /// Get pointer to auxiliary info object OsiAuxInfo * getAuxiliaryInfo() const; //@} //--------------------------------------------------------------------------- /**@name Message handling See the COIN library documentation for additional information about COIN message facilities. */ //@{ /** Pass in a message handler It is the client's responsibility to destroy a message handler installed by this routine; it will not be destroyed when the solver interface is destroyed. */ virtual void passInMessageHandler(CoinMessageHandler * handler); /// Set language void newLanguage(CoinMessages::Language language); inline void setLanguage(CoinMessages::Language language) {newLanguage(language);} /// Return a pointer to the current message handler inline CoinMessageHandler * messageHandler() const {return handler_;} /// Return the current set of messages inline CoinMessages messages() {return messages_;} /// Return a pointer to the current set of messages inline CoinMessages * messagesPointer() {return &messages_;} /// Return true if default handler inline bool defaultHandler() const { return defaultHandler_;} //@} //--------------------------------------------------------------------------- /**@name Methods for dealing with discontinuities other than integers. Osi should be able to know about SOS and other types. This is an optional section where such information can be stored. */ //@{ /** \brief Identify integer variables and create corresponding objects. Record integer variables and create an OsiSimpleInteger object for each one. All existing OsiSimpleInteger objects will be destroyed. If justCount then no objects created and we just store numberIntegers_ */ void findIntegers(bool justCount); /** \brief Identify integer variables and SOS and create corresponding objects. Record integer variables and create an OsiSimpleInteger object for each one. All existing OsiSimpleInteger objects will be destroyed. If the solver supports SOS then do the same for SOS. If justCount then no objects created and we just store numberIntegers_ Returns number of SOS */ virtual int findIntegersAndSOS(bool justCount); /// Get the number of objects inline int numberObjects() const { return numberObjects_;} /// Set the number of objects inline void setNumberObjects(int number) { numberObjects_=number;} /// Get the array of objects inline OsiObject ** objects() const { return object_;} /// Get the specified object const inline OsiObject * object(int which) const { return object_[which];} /// Get the specified object inline OsiObject * modifiableObject(int which) const { return object_[which];} /// Delete all object information void deleteObjects(); /** Add in object information. Objects are cloned; the owner can delete the originals. */ void addObjects(int numberObjects, OsiObject ** objects); /** Use current solution to set bounds so current integer feasible solution will stay feasible. Only feasible bounds will be used, even if current solution outside bounds. The amount of such violation will be returned (and if small can be ignored) */ double forceFeasible(); //@} //--------------------------------------------------------------------------- /*! @name Methods related to testing generated cuts See the documentation for OsiRowCutDebugger for additional details. */ //@{ /*! \brief Activate the row cut debugger. If \p modelName is in the set of known models then all cuts are checked to see that they do NOT cut off the optimal solution known to the debugger. */ virtual void activateRowCutDebugger (const char *modelName); /*! \brief Activate the row cut debugger using a full solution array. Activate the debugger for a model not included in the debugger's internal database. Cuts will be checked to see that they do NOT cut off the given solution. \p solution must be a full solution vector, but only the integer variables need to be correct. The debugger will fill in the continuous variables by solving an lp relaxation with the integer variables fixed as specified. If the given values for the continuous variables should be preserved, set \p keepContinuous to true. */ virtual void activateRowCutDebugger(const double *solution, bool enforceOptimality = true); /*! \brief Get the row cut debugger provided the solution known to the debugger is within the feasible region held in the solver. If there is a row cut debugger object associated with model AND if the solution known to the debugger is within the solver's current feasible region (i.e., the column bounds held in the solver are compatible with the known solution) then a pointer to the debugger is returned which may be used to test validity of cuts. Otherwise NULL is returned */ const OsiRowCutDebugger *getRowCutDebugger() const; /*! \brief Get the row cut debugger object Return the row cut debugger object if it exists. One common usage of this method is to obtain a debugger object in order to execute OsiRowCutDebugger::redoSolution (so that the stored solution is again compatible with the problem held in the solver). */ OsiRowCutDebugger * getRowCutDebuggerAlways() const; //@} /*! \name OsiSimplexInterface \brief Simplex Interface Methods for an advanced interface to a simplex solver. The interface comprises two groups of methods. Group 1 contains methods for tableau access. Group 2 contains methods for dictating individual simplex pivots. */ //@{ /*! \brief Return the simplex implementation level. The return codes are: - 0: the simplex interface is not implemented. - 1: the Group 1 (tableau access) methods are implemented. - 2: the Group 2 (pivoting) methods are implemented The codes are cumulative - a solver which implements Group 2 also implements Group 1. */ virtual int canDoSimplexInterface() const ; //@} /*! \name OsiSimplex Group 1 \brief Tableau access methods. This group of methods provides access to rows and columns of the basis inverse and to rows and columns of the tableau. */ //@{ /*! \brief Prepare the solver for the use of tableau access methods. Prepares the solver for the use of the tableau access methods, if any such preparation is required. The \c const attribute is required due to the places this method may be called (e.g., within CglCutGenerator::generateCuts()). */ virtual void enableFactorization() const ; /*! \brief Undo the effects of #enableFactorization. */ virtual void disableFactorization() const ; /*! \brief Check if an optimal basis is available. Returns true if the problem has been solved to optimality and a basis is available. This should be used to see if the tableau access operations are possible and meaningful. \note Implementors please note that this method may be called before #enableFactorization. */ virtual bool basisIsAvailable() const ; /// Synonym for #basisIsAvailable inline bool optimalBasisIsAvailable() const { return basisIsAvailable() ; } /*! \brief Retrieve status information for column and row variables. This method returns status as integer codes:
    • 0: free
    • 1: basic
    • 2: nonbasic at upper bound
    • 3: nonbasic at lower bound
    The #getWarmStart method provides essentially the same functionality for a simplex-oriented solver, but the implementation details are very different. \note Logical variables associated with rows are all assumed to have +1 coefficients, so for a <= constraint the logical will be at lower bound if the constraint is tight. \note Implementors may choose to implement this method as a wrapper which converts a CoinWarmStartBasis to the requested representation. */ virtual void getBasisStatus(int* cstat, int* rstat) const ; /*! \brief Set the status of column and row variables and update the basis factorization and solution. Status information should be coded as documented for #getBasisStatus. Returns 0 if all goes well, 1 if something goes wrong. This method differs from #setWarmStart in the format of the input and in its immediate effect. Think of it as #setWarmStart immediately followed by #resolve, but no pivots are allowed. \note Implementors may choose to implement this method as a wrapper that calls #setWarmStart and #resolve if the no pivot requirement can be satisfied. */ virtual int setBasisStatus(const int* cstat, const int* rstat) ; /*! \brief Calculate duals and reduced costs for the given objective coefficients. The solver's objective coefficient vector is not changed. */ virtual void getReducedGradient(double* columnReducedCosts, double* duals, const double* c) const ; /*! \brief Get a row of the tableau If \p slack is not null, it will be loaded with the coefficients for the artificial (logical) variables (i.e., the row of the basis inverse). */ virtual void getBInvARow(int row, double* z, double* slack = NULL) const ; /*! \brief Get a row of the basis inverse */ virtual void getBInvRow(int row, double* z) const ; /*! \brief Get a column of the tableau */ virtual void getBInvACol(int col, double* vec) const ; /*! \brief Get a column of the basis inverse */ virtual void getBInvCol(int col, double* vec) const ; /*! \brief Get indices of basic variables If the logical (artificial) for row i is basic, the index should be coded as (#getNumCols + i). The order of indices must match the order of elements in the vectors returned by #getBInvACol and #getBInvCol. */ virtual void getBasics(int* index) const ; //@} /*! \name OsiSimplex Group 2 \brief Pivoting methods This group of methods provides for control of individual pivots by a simplex solver. */ //@{ /**Enables normal operation of subsequent functions. This method is supposed to ensure that all typical things (like reduced costs, etc.) are updated when individual pivots are executed and can be queried by other methods. says whether will be doing primal or dual */ virtual void enableSimplexInterface(bool doingPrimal) ; ///Undo whatever setting changes the above method had to make virtual void disableSimplexInterface() ; /** Perform a pivot by substituting a colIn for colOut in the basis. The status of the leaving variable is given in outStatus. Where 1 is to upper bound, -1 to lower bound Return code was undefined - now for OsiClp is 0 for okay, 1 if inaccuracy forced re-factorization (should be okay) and -1 for singular factorization */ virtual int pivot(int colIn, int colOut, int outStatus) ; /** Obtain a result of the primal pivot Outputs: colOut -- leaving column, outStatus -- its status, t -- step size, and, if dx!=NULL, *dx -- primal ray direction. Inputs: colIn -- entering column, sign -- direction of its change (+/-1). Both for colIn and colOut, artificial variables are index by the negative of the row index minus 1. Return code (for now): 0 -- leaving variable found, -1 -- everything else? Clearly, more informative set of return values is required Primal and dual solutions are updated */ virtual int primalPivotResult(int colIn, int sign, int& colOut, int& outStatus, double& t, CoinPackedVector* dx); /** Obtain a result of the dual pivot (similar to the previous method) Differences: entering variable and a sign of its change are now the outputs, the leaving variable and its statuts -- the inputs If dx!=NULL, then *dx contains dual ray Return code: same */ virtual int dualPivotResult(int& colIn, int& sign, int colOut, int outStatus, double& t, CoinPackedVector* dx) ; //@} //--------------------------------------------------------------------------- ///@name Constructors and destructors //@{ /// Default Constructor OsiSolverInterface(); /** Clone The result of calling clone(false) is defined to be equivalent to calling the default constructor OsiSolverInterface(). */ virtual OsiSolverInterface * clone(bool copyData = true) const = 0; /// Copy constructor OsiSolverInterface(const OsiSolverInterface &); /// Assignment operator OsiSolverInterface & operator=(const OsiSolverInterface& rhs); /// Destructor virtual ~OsiSolverInterface (); /** Reset the solver interface. A call to reset() returns the solver interface to the same state as it would have if it had just been constructed by calling the default constructor OsiSolverInterface(). */ virtual void reset(); //@} //--------------------------------------------------------------------------- protected: ///@name Protected methods //@{ /** Apply a row cut (append to the constraint matrix). */ virtual void applyRowCut( const OsiRowCut & rc ) = 0; /** Apply a column cut (adjust the bounds of one or more variables). */ virtual void applyColCut( const OsiColCut & cc ) = 0; /** A quick inlined function to convert from the lb/ub style of constraint definition to the sense/rhs/range style */ inline void convertBoundToSense(const double lower, const double upper, char& sense, double& right, double& range) const; /** A quick inlined function to convert from the sense/rhs/range style of constraint definition to the lb/ub style */ inline void convertSenseToBound(const char sense, const double right, const double range, double& lower, double& upper) const; /** A quick inlined function to force a value to be between a minimum and a maximum value */ template inline T forceIntoRange(const T value, const T lower, const T upper) const { return value < lower ? lower : (value > upper ? upper : value); } /** Set OsiSolverInterface object state for default constructor This routine establishes the initial values of data fields in the OsiSolverInterface object when the object is created using the default constructor. */ void setInitialData(); //@} ///@name Protected member data //@{ /*! \brief Pointer to row cut debugger object Mutable so that we can update the solution held in the debugger while maintaining const'ness for the Osi object. */ mutable OsiRowCutDebugger * rowCutDebugger_; // Why not just make useful stuff protected? /// Message handler CoinMessageHandler * handler_; /** Flag to say if the currrent handler is the default handler. Indicates if the solver interface object is responsible for destruction of the handler (true) or if the client is responsible (false). */ bool defaultHandler_; /// Messages CoinMessages messages_; /// Number of integers int numberIntegers_; /// Total number of objects int numberObjects_; /// Integer and ... information (integer info normally at beginning) OsiObject ** object_; /** Column type 0 - continuous 1 - binary (may get fixed later) 2 - general integer (may get fixed later) */ mutable char * columnType_; //@} //--------------------------------------------------------------------------- private: ///@name Private member data //@{ /// Pointer to user-defined data structure - and more if user wants OsiAuxInfo * appDataEtc_; /// Array of integer parameters int intParam_[OsiLastIntParam]; /// Array of double parameters double dblParam_[OsiLastDblParam]; /// Array of string parameters std::string strParam_[OsiLastStrParam]; /// Array of hint parameters bool hintParam_[OsiLastHintParam]; /// Array of hint strengths OsiHintStrength hintStrength_[OsiLastHintParam]; /** Warm start information used for hot starts when the default hot start implementation is used. */ CoinWarmStart* ws_; /// Column solution satisfying lower and upper column bounds std::vector strictColSolution_; /// Row names OsiNameVec rowNames_ ; /// Column names OsiNameVec colNames_ ; /// Objective name std::string objName_ ; //@} }; //############################################################################# /** A quick inlined function to convert from the lb/ub style of constraint definition to the sense/rhs/range style */ inline void OsiSolverInterface::convertBoundToSense(const double lower, const double upper, char& sense, double& right, double& range) const { double inf = getInfinity(); range = 0.0; if (lower > -inf) { if (upper < inf) { right = upper; if (upper==lower) { sense = 'E'; } else { sense = 'R'; range = upper - lower; } } else { sense = 'G'; right = lower; } } else { if (upper < inf) { sense = 'L'; right = upper; } else { sense = 'N'; right = 0.0; } } } //----------------------------------------------------------------------------- /** A quick inlined function to convert from the sense/rhs/range style of constraint definition to the lb/ub style */ inline void OsiSolverInterface::convertSenseToBound(const char sense, const double right, const double range, double& lower, double& upper) const { double inf=getInfinity(); switch (sense) { case 'E': lower = upper = right; break; case 'L': lower = -inf; upper = right; break; case 'G': lower = right; upper = inf; break; case 'R': lower = right - range; upper = right; break; case 'N': lower = -inf; upper = inf; break; } } #endif Osi-0.106.4/src/Osi/config_osi_default.h0000644000076600007660000000110712244016312016401 0ustar coincoin /***************************************************************************/ /* HERE DEFINE THE PROJECT SPECIFIC PUBLIC MACROS */ /* These are only in effect in a setting that doesn't use configure */ /***************************************************************************/ /* Version number of project */ #define OSI_VERSION "0.106.4" /* Major Version number of project */ #define OSI_VERSION_MAJOR 0 /* Minor Version number of project */ #define OSI_VERSION_MINOR 106 /* Release Version number of project */ #define OSI_VERSION_RELEASE 4 Osi-0.106.4/src/Osi/OsiCuts.cpp0000644000076600007660000002272011510425067014514 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #if defined(_MSC_VER) // Turn off compiler warning about long names # pragma warning(disable:4786) #endif #include #include #include "OsiCuts.hpp" //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiCuts::OsiCuts () : rowCutPtrs_(), colCutPtrs_() { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiCuts::OsiCuts (const OsiCuts & source) : rowCutPtrs_(), colCutPtrs_() { gutsOfCopy( source ); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiCuts::~OsiCuts () { gutsOfDestructor(); } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiCuts & OsiCuts::operator=(const OsiCuts& rhs) { if (this != &rhs) { gutsOfDestructor(); gutsOfCopy( rhs ); } return *this; } //------------------------------------------------------------------- void OsiCuts::gutsOfCopy(const OsiCuts& source) { assert( sizeRowCuts()==0 ); assert( sizeColCuts()==0 ); assert( sizeCuts()==0 ); int i; int ne = source.sizeRowCuts(); for (i=0; i(rowCutPtrs_.size()); for (i=0; igloballyValidAsInteger()!=2) delete rowCutPtrs_[i]; } rowCutPtrs_.clear(); ne = static_cast(colCutPtrs_.size()); for (i=0; igloballyValidAsInteger()!=2) delete colCutPtrs_[i]; } colCutPtrs_.clear(); assert( sizeRowCuts()==0 ); assert( sizeColCuts()==0 ); assert( sizeCuts() ==0 ); } //------------------------------------------------------------ // // Embedded iterator class implementation // //------------------------------------------------------------ OsiCuts::iterator::iterator(OsiCuts& cuts) : cuts_(cuts), rowCutIndex_(-1), colCutIndex_(-1), cutP_(NULL) { this->operator++(); } OsiCuts::iterator::iterator(const OsiCuts::iterator &src) : cuts_(src.cuts_), rowCutIndex_(src.rowCutIndex_), colCutIndex_(src.colCutIndex_), cutP_(src.cutP_) { // nothing to do here } OsiCuts::iterator & OsiCuts::iterator::operator=(const OsiCuts::iterator &rhs) { if (this != &rhs) { cuts_=rhs.cuts_; rowCutIndex_=rhs.rowCutIndex_; colCutIndex_=rhs.colCutIndex_; cutP_=rhs.cutP_; } return *this; } OsiCuts::iterator::~iterator() { //nothing to do } OsiCuts::iterator OsiCuts::iterator::begin() { rowCutIndex_=-1; colCutIndex_=-1; this->operator++(); return *this; } OsiCuts::iterator OsiCuts::iterator::end() { rowCutIndex_=cuts_.sizeRowCuts(); colCutIndex_=cuts_.sizeColCuts()-1; cutP_=NULL; return *this; } OsiCuts::iterator OsiCuts::iterator::operator++() { cutP_ = NULL; // Are there any more row cuts to consider? if ( (rowCutIndex_+1)>=cuts_.sizeRowCuts() ) { // Only column cuts left. colCutIndex_++; // Only update cutP if there is a column cut. // This is necessary for the iterator to work for // OsiCuts that don't have any cuts. if ( cuts_.sizeColCuts() > 0 && colCutIndex_=cuts_.sizeColCuts() ) { // Only row cuts left rowCutIndex_++; if ( rowCutIndex_nextRowCutE ) { colCutIndex_++; cutP_=cuts_.colCutPtr(colCutIndex_); } else { rowCutIndex_++; cutP_=cuts_.rowCutPtr(rowCutIndex_); } } return *this; } //------------------------------------------------------------ // // Embedded const_iterator class implementation // //------------------------------------------------------------ OsiCuts::const_iterator::const_iterator(const OsiCuts& cuts) : cutsPtr_(&cuts), rowCutIndex_(-1), colCutIndex_(-1), cutP_(NULL) { this->operator++(); } OsiCuts::const_iterator::const_iterator(const OsiCuts::const_iterator &src) : cutsPtr_(src.cutsPtr_), rowCutIndex_(src.rowCutIndex_), colCutIndex_(src.colCutIndex_), cutP_(src.cutP_) { // nothing to do here } OsiCuts::const_iterator & OsiCuts::const_iterator::operator=(const OsiCuts::const_iterator &rhs) { if (this != &rhs) { cutsPtr_=rhs.cutsPtr_; rowCutIndex_=rhs.rowCutIndex_; colCutIndex_=rhs.colCutIndex_; cutP_=rhs.cutP_; } return *this; } OsiCuts::const_iterator::~const_iterator() { //nothing to do } OsiCuts::const_iterator OsiCuts::const_iterator::begin() { rowCutIndex_=-1; colCutIndex_=-1; this->operator++(); return *this; } OsiCuts::const_iterator OsiCuts::const_iterator::end() { rowCutIndex_=cutsPtr_->sizeRowCuts(); colCutIndex_=cutsPtr_->sizeColCuts()-1; cutP_=NULL; return *this; } OsiCuts::const_iterator OsiCuts::const_iterator::operator++() { cutP_ = NULL; // Are there any more row cuts to consider? if ( (rowCutIndex_+1)>=cutsPtr_->sizeRowCuts() ) { // Only column cuts left. colCutIndex_++; // Only update cutP if there is a column cut. // This is necessary for the iterator to work for // OsiCuts that don't have any cuts. if ( cutsPtr_->sizeRowCuts() > 0 && colCutIndex_sizeColCuts() ) cutP_= cutsPtr_->colCutPtr(colCutIndex_); } // Are there any more col cuts to consider? else if ( (colCutIndex_+1)>=cutsPtr_->sizeColCuts() ) { // Only row cuts left rowCutIndex_++; if ( rowCutIndex_sizeRowCuts() ) cutP_= cutsPtr_->rowCutPtr(rowCutIndex_); } // There are still Row & column cuts left to consider else { double nextColCutE=cutsPtr_->colCut(colCutIndex_+1).effectiveness(); double nextRowCutE=cutsPtr_->rowCut(rowCutIndex_+1).effectiveness(); if ( nextColCutE>nextRowCutE ) { colCutIndex_++; cutP_=cutsPtr_->colCutPtr(colCutIndex_); } else { rowCutIndex_++; cutP_=cutsPtr_->rowCutPtr(rowCutIndex_); } } return *this; } /* Insert a row cut unless it is a duplicate (CoinAbsFltEq)*/ void OsiCuts::insertIfNotDuplicate( OsiRowCut & rc , CoinAbsFltEq treatAsSame) { double newLb = rc.lb(); double newUb = rc.ub(); CoinPackedVector vector = rc.row(); int numberElements =vector.getNumElements(); int * newIndices = vector.getIndices(); double * newElements = vector.getElements(); CoinSort_2(newIndices,newIndices+numberElements,newElements); bool notDuplicate=true; int numberRowCuts = sizeRowCuts(); for ( int i =0; irow().getNumElements()!=numberElements) continue; if (!treatAsSame(cutPtr->lb(),newLb)) continue; if (!treatAsSame(cutPtr->ub(),newUb)) continue; const CoinPackedVector * thisVector = &(cutPtr->row()); const int * indices = thisVector->getIndices(); const double * elements = thisVector->getElements(); int j; for(j=0;jsetLb(newLb); newCutPtr->setUb(newUb); newCutPtr->setRow(vector); rowCutPtrs_.push_back(newCutPtr); } } /* Insert a row cut unless it is a duplicate (CoinRelFltEq)*/ void OsiCuts::insertIfNotDuplicate( OsiRowCut & rc , CoinRelFltEq treatAsSame) { double newLb = rc.lb(); double newUb = rc.ub(); CoinPackedVector vector = rc.row(); int numberElements =vector.getNumElements(); int * newIndices = vector.getIndices(); double * newElements = vector.getElements(); CoinSort_2(newIndices,newIndices+numberElements,newElements); bool notDuplicate=true; int numberRowCuts = sizeRowCuts(); for ( int i =0; irow().getNumElements()!=numberElements) continue; if (!treatAsSame(cutPtr->lb(),newLb)) continue; if (!treatAsSame(cutPtr->ub(),newUb)) continue; const CoinPackedVector * thisVector = &(cutPtr->row()); const int * indices = thisVector->getIndices(); const double * elements = thisVector->getElements(); int j; for(j=0;jsetLb(newLb); newCutPtr->setUb(newUb); newCutPtr->setRow(vector); rowCutPtrs_.push_back(newCutPtr); } } Osi-0.106.4/src/Osi/OsiCut.cpp0000644000076600007660000000345311510425067014333 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #if defined(_MSC_VER) // Turn off compiler warning about long names # pragma warning(disable:4786) #endif #include "OsiCut.hpp" //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiCut::OsiCut () : effectiveness_(0.), globallyValid_(0) //timesUsed_(0), //timesTested_(0) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiCut::OsiCut ( const OsiCut & source) : effectiveness_(source.effectiveness_), globallyValid_(source.globallyValid_) //timesUsed_(source.timesUsed_), //timesTested_(source.timesTested_) { // nothing to do here } #if 0 //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiCut * OsiCut::clone() const { return (new OsiCut(*this));} #endif //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiCut::~OsiCut () { // nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiCut & OsiCut::operator=(const OsiCut& rhs) { if (this != &rhs) { effectiveness_=rhs.effectiveness_; globallyValid_ = rhs.globallyValid_; //timesUsed_=rhs.timesUsed_; //timesTested_=rhs.timesTested_; } return *this; } Osi-0.106.4/src/Osi/Makefile.am0000644000076600007660000000443012101340333014436 0ustar coincoin# Copyright (C) 2010 Lou Hafer # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1881 2013-01-28 00:05:47Z stefan $ # Author: Lou Hafer SFU 2010-07-29 AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsi # ######################################################################## # Name of the library compiled in this directory. We want it to be installed # in $libdir lib_LTLIBRARIES = libOsi.la # List all source files for this library, including headers libOsi_la_SOURCES = \ OsiConfig.h \ OsiAuxInfo.cpp OsiAuxInfo.hpp \ OsiBranchingObject.cpp OsiBranchingObject.hpp \ OsiChooseVariable.cpp OsiChooseVariable.hpp \ OsiColCut.cpp OsiColCut.hpp \ OsiCollections.hpp \ OsiCut.cpp OsiCut.hpp \ OsiCuts.cpp OsiCuts.hpp \ OsiNames.cpp \ OsiPresolve.cpp OsiPresolve.hpp \ OsiRowCut.cpp OsiRowCut.hpp \ OsiRowCutDebugger.cpp OsiRowCutDebugger.hpp \ OsiSolverBranch.cpp OsiSolverBranch.hpp \ OsiSolverInterface.cpp OsiSolverInterface.hpp \ OsiSolverParameters.hpp # This is for libtool libOsi_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags. AM_CPPFLAGS = $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation. # This "cygpath" stuff is necessary to compile with native compilers on Windows. DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'includedir/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = \ OsiAuxInfo.hpp \ OsiBranchingObject.hpp \ OsiChooseVariable.hpp \ OsiColCut.hpp \ OsiCollections.hpp \ OsiCut.hpp \ OsiCuts.hpp \ OsiPresolve.hpp \ OsiRowCut.hpp \ OsiRowCutDebugger.hpp \ OsiSolverBranch.hpp \ OsiSolverInterface.hpp \ OsiSolverParameters.hpp install-exec-local: $(install_sh_DATA) config_osi.h $(DESTDIR)$(includecoindir)/OsiConfig.h uninstall-local: rm -f $(DESTDIR)$(includecoindir)/OsiConfig.h Osi-0.106.4/src/Osi/Makefile.in0000644000076600007660000006144712240315110014461 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2010 Lou Hafer # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Lou Hafer SFU 2010-07-29 srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/Osi DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/config_osi.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsi_la_LIBADD = am_libOsi_la_OBJECTS = OsiAuxInfo.lo OsiBranchingObject.lo \ OsiChooseVariable.lo OsiColCut.lo OsiCut.lo OsiCuts.lo \ OsiNames.lo OsiPresolve.lo OsiRowCut.lo OsiRowCutDebugger.lo \ OsiSolverBranch.lo OsiSolverInterface.lo libOsi_la_OBJECTS = $(am_libOsi_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsi_la_SOURCES) DIST_SOURCES = $(libOsi_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsi # ######################################################################## # Name of the library compiled in this directory. We want it to be installed # in $libdir lib_LTLIBRARIES = libOsi.la # List all source files for this library, including headers libOsi_la_SOURCES = \ OsiConfig.h \ OsiAuxInfo.cpp OsiAuxInfo.hpp \ OsiBranchingObject.cpp OsiBranchingObject.hpp \ OsiChooseVariable.cpp OsiChooseVariable.hpp \ OsiColCut.cpp OsiColCut.hpp \ OsiCollections.hpp \ OsiCut.cpp OsiCut.hpp \ OsiCuts.cpp OsiCuts.hpp \ OsiNames.cpp \ OsiPresolve.cpp OsiPresolve.hpp \ OsiRowCut.cpp OsiRowCut.hpp \ OsiRowCutDebugger.cpp OsiRowCutDebugger.hpp \ OsiSolverBranch.cpp OsiSolverBranch.hpp \ OsiSolverInterface.cpp OsiSolverInterface.hpp \ OsiSolverParameters.hpp # This is for libtool libOsi_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags. AM_CPPFLAGS = $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation. # This "cygpath" stuff is necessary to compile with native compilers on Windows. DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'includedir/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = \ OsiAuxInfo.hpp \ OsiBranchingObject.hpp \ OsiChooseVariable.hpp \ OsiColCut.hpp \ OsiCollections.hpp \ OsiCut.hpp \ OsiCuts.hpp \ OsiPresolve.hpp \ OsiRowCut.hpp \ OsiRowCutDebugger.hpp \ OsiSolverBranch.hpp \ OsiSolverInterface.hpp \ OsiSolverParameters.hpp all: config.h config_osi.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Osi/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Osi/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/Osi/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ config_osi.h: stamp-h2 @if test ! -f $@; then \ rm -f stamp-h2; \ $(MAKE) stamp-h2; \ else :; fi stamp-h2: $(srcdir)/config_osi.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status src/Osi/config_osi.h distclean-hdr: -rm -f config.h stamp-h1 config_osi.h stamp-h2 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsi.la: $(libOsi_la_OBJECTS) $(libOsi_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsi_la_LDFLAGS) $(libOsi_la_OBJECTS) $(libOsi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiAuxInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiBranchingObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiChooseVariable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiColCut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiCut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiCuts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiNames.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiPresolve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiRowCut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiRowCutDebugger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiSolverBranch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiSolverInterface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in config_osi.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in config_osi.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in config_osi.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in config_osi.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h config_osi.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-exec-local install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-local .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am \ install-exec-local install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-local install-exec-local: $(install_sh_DATA) config_osi.h $(DESTDIR)$(includecoindir)/OsiConfig.h uninstall-local: rm -f $(DESTDIR)$(includecoindir)/OsiConfig.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/Osi/OsiAuxInfo.cpp0000644000076600007660000001062311552534623015153 0ustar coincoin// Copyright (C) 2006, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include #include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "OsiSolverInterface.hpp" #include "OsiAuxInfo.hpp" // Default Constructor OsiAuxInfo::OsiAuxInfo(void * appData) : appData_(appData) { } // Destructor OsiAuxInfo::~OsiAuxInfo () { } // Clone OsiAuxInfo * OsiAuxInfo::clone() const { return new OsiAuxInfo(*this); } // Copy constructor OsiAuxInfo::OsiAuxInfo(const OsiAuxInfo & rhs) : appData_(rhs.appData_) { } OsiAuxInfo & OsiAuxInfo::operator=(const OsiAuxInfo &rhs) { if (this != &rhs) { appData_ = rhs.appData_; } return *this; } // Default Constructor OsiBabSolver::OsiBabSolver(int solverType) :OsiAuxInfo(), bestObjectiveValue_(1.0e100), mipBound_(-1.0e100), solver_(NULL), bestSolution_(NULL), beforeLower_(NULL), beforeUpper_(NULL), solverType_(solverType), sizeSolution_(0), extraCharacteristics_(0) { } // Destructor OsiBabSolver::~OsiBabSolver () { delete [] bestSolution_; } // Clone OsiAuxInfo * OsiBabSolver::clone() const { return new OsiBabSolver(*this); } // Copy constructor OsiBabSolver::OsiBabSolver(const OsiBabSolver & rhs) : OsiAuxInfo(rhs), bestObjectiveValue_(rhs.bestObjectiveValue_), mipBound_(rhs.mipBound_), solver_(rhs.solver_), bestSolution_(NULL), beforeLower_(rhs.beforeLower_), beforeUpper_(rhs.beforeUpper_), solverType_(rhs.solverType_), sizeSolution_(rhs.sizeSolution_), extraCharacteristics_(rhs.extraCharacteristics_) { if (rhs.bestSolution_) { assert (solver_); bestSolution_ = CoinCopyOfArray(rhs.bestSolution_,sizeSolution_); } } OsiBabSolver & OsiBabSolver::operator=(const OsiBabSolver &rhs) { if (this != &rhs) { OsiAuxInfo::operator=(rhs); delete [] bestSolution_; solver_ = rhs.solver_; solverType_ = rhs.solverType_; bestObjectiveValue_ = rhs.bestObjectiveValue_; bestSolution_ = NULL; mipBound_ = rhs.mipBound_; sizeSolution_ = rhs.sizeSolution_; extraCharacteristics_ = rhs.extraCharacteristics_; beforeLower_ = rhs.beforeLower_; beforeUpper_ = rhs.beforeUpper_; if (rhs.bestSolution_) { assert (solver_); bestSolution_ = CoinCopyOfArray(rhs.bestSolution_,sizeSolution_); } } return *this; } // Returns 1 if solution, 0 if not int OsiBabSolver::solution(double & solutionValue, double * betterSolution, int numberColumns) { if (!solver_) return 0; //printf("getSol %x solution_address %x - value %g\n", // this,bestSolution_,bestObjectiveValue_); if (bestObjectiveValue_getNumCols(); memcpy(solution,bestSolution_,numberColumns*sizeof(double)); solutionValue = bestObjectiveValue_; return true; } // set solution void OsiBabSolver::setSolution(const double * solution, int numberColumns, double objectiveValue) { assert (solver_); // just in case size has changed delete [] bestSolution_; sizeSolution_ = CoinMin(solver_->getNumCols(),numberColumns); bestSolution_ = new double [sizeSolution_]; CoinZeroN(bestSolution_,sizeSolution_); CoinMemcpyN(solution,CoinMin(sizeSolution_,numberColumns),bestSolution_); bestObjectiveValue_ = objectiveValue*solver_->getObjSense(); } // Get objective (well mip bound) double OsiBabSolver::mipBound() const { assert (solver_); if (solverType_!=3) return solver_->getObjSense()*solver_->getObjValue(); else return mipBound_; } // Returns true if node feasible bool OsiBabSolver::mipFeasible() const { assert (solver_); if (solverType_==0) return true; else if (solverType_!=3) return solver_->isProvenOptimal(); else return mipBound_<1.0e50; } Osi-0.106.4/src/Osi/OsiCuts.hpp0000644000076600007660000003320711575423733014534 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiCuts_H #define OsiCuts_H #include "CoinPragma.hpp" #include #include #include "OsiCollections.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinFloatEqual.hpp" /** Collections of row cuts and column cuts */ class OsiCuts { friend void OsiCutsUnitTest(); public: /**@name Iterator classes */ //@{ /** Iterator This is a class for iterating over the collection of cuts. */ class iterator { friend class OsiCuts; public: iterator(OsiCuts& cuts); iterator(const iterator & src); iterator & operator=( const iterator& rhs); ~iterator (); OsiCut* operator*() const { return cutP_; } iterator operator++(); iterator operator++(int) { iterator temp = *this; ++*this; return temp; } bool operator==(const iterator& it) const { return (colCutIndex_+rowCutIndex_)==(it.colCutIndex_+it.rowCutIndex_); } bool operator!=(const iterator& it) const { return !((*this)==it); } bool operator<(const iterator& it) const { return (colCutIndex_+rowCutIndex_)<(it.colCutIndex_+it.rowCutIndex_); } private: iterator(); // *THINK* : how to inline these without sticking the code here (ugly...) iterator begin(); iterator end(); OsiCuts& cuts_; int rowCutIndex_; int colCutIndex_; OsiCut * cutP_; }; /** Const Iterator This is a class for iterating over the collection of cuts. */ class const_iterator { friend class OsiCuts; public: typedef std::bidirectional_iterator_tag iterator_category; typedef OsiCut* value_type; typedef size_t difference_type; typedef OsiCut ** pointer; typedef OsiCut *& reference; public: const_iterator(const OsiCuts& cuts); const_iterator(const const_iterator & src); const_iterator & operator=( const const_iterator& rhs); ~const_iterator (); const OsiCut* operator*() const { return cutP_; } const_iterator operator++(); const_iterator operator++(int) { const_iterator temp = *this; ++*this; return temp; } bool operator==(const const_iterator& it) const { return (colCutIndex_+rowCutIndex_)==(it.colCutIndex_+it.rowCutIndex_); } bool operator!=(const const_iterator& it) const { return !((*this)==it); } bool operator<(const const_iterator& it) const { return (colCutIndex_+rowCutIndex_)<(it.colCutIndex_+it.rowCutIndex_); } private: inline const_iterator(); // *THINK* : how to inline these without sticking the code here (ugly...) const_iterator begin(); const_iterator end(); const OsiCuts * cutsPtr_; int rowCutIndex_; int colCutIndex_; const OsiCut * cutP_; }; //@} //------------------------------------------------------------------- // // Cuts class definition begins here: // //------------------------------------------------------------------- /** \name Inserting a cut into collection */ //@{ /** \brief Insert a row cut */ inline void insert( const OsiRowCut & rc ); /** \brief Insert a row cut unless it is a duplicate - cut may get sorted. Duplicate is defined as CoinAbsFltEq says same*/ void insertIfNotDuplicate( OsiRowCut & rc , CoinAbsFltEq treatAsSame=CoinAbsFltEq(1.0e-12) ); /** \brief Insert a row cut unless it is a duplicate - cut may get sorted. Duplicate is defined as CoinRelFltEq says same*/ void insertIfNotDuplicate( OsiRowCut & rc , CoinRelFltEq treatAsSame ); /** \brief Insert a column cut */ inline void insert( const OsiColCut & cc ); /** \brief Insert a row cut. The OsiCuts object takes control of the cut object. On return, \c rcPtr is NULL. */ inline void insert( OsiRowCut * & rcPtr ); /** \brief Insert a column cut. The OsiCuts object takes control of the cut object. On return \c ccPtr is NULL. */ inline void insert( OsiColCut * & ccPtr ); #if 0 inline void insert( OsiCut * & cPtr ); #endif /** \brief Insert a set of cuts */ inline void insert(const OsiCuts & cs); //@} /**@name Number of cuts in collection */ //@{ /// Number of row cuts in collection inline int sizeRowCuts() const; /// Number of column cuts in collection inline int sizeColCuts() const; /// Number of cuts in collection inline int sizeCuts() const; //@} /**@name Debug stuff */ //@{ /// Print cuts in collection inline void printCuts() const; //@} /**@name Get a cut from collection */ //@{ /// Get pointer to i'th row cut inline OsiRowCut * rowCutPtr(int i); /// Get const pointer to i'th row cut inline const OsiRowCut * rowCutPtr(int i) const; /// Get pointer to i'th column cut inline OsiColCut * colCutPtr(int i); /// Get const pointer to i'th column cut inline const OsiColCut * colCutPtr(int i) const; /// Get reference to i'th row cut inline OsiRowCut & rowCut(int i); /// Get const reference to i'th row cut inline const OsiRowCut & rowCut(int i) const; /// Get reference to i'th column cut inline OsiColCut & colCut(int i); /// Get const reference to i'th column cut inline const OsiColCut & colCut(int i) const; /// Get const pointer to the most effective cut inline const OsiCut * mostEffectiveCutPtr() const; /// Get pointer to the most effective cut inline OsiCut * mostEffectiveCutPtr(); //@} /**@name Deleting cut from collection */ //@{ /// Remove i'th row cut from collection inline void eraseRowCut(int i); /// Remove i'th column cut from collection inline void eraseColCut(int i); /// Get pointer to i'th row cut and remove ptr from collection inline OsiRowCut * rowCutPtrAndZap(int i); /*! \brief Clear all row cuts without deleting them Handy in case one wants to use CGL without managing cuts in one of the OSI containers. Client is ultimately responsible for deleting the data structures holding the row cuts. */ inline void dumpCuts() ; /*! \brief Selective delete and clear for row cuts. Deletes the cuts specified in \p to_erase then clears remaining cuts without deleting them. A hybrid of eraseRowCut(int) and dumpCuts(). Client is ultimately responsible for deleting the data structures for row cuts not specified in \p to_erase. */ inline void eraseAndDumpCuts(const std::vector to_erase) ; //@} /**@name Sorting collection */ //@{ /// Cuts with greatest effectiveness are first. inline void sort(); //@} /**@name Iterators Example of using an iterator to sum effectiveness of all cuts in the collection.
         double sumEff=0.0;
         for ( OsiCuts::iterator it=cuts.begin(); it!=cuts.end(); ++it )
               sumEff+= (*it)->effectiveness();
         
    */ //@{ /// Get iterator to beginning of collection inline iterator begin() { iterator it(*this); it.begin(); return it; } /// Get const iterator to beginning of collection inline const_iterator begin() const { const_iterator it(*this); it.begin(); return it; } /// Get iterator to end of collection inline iterator end() { iterator it(*this); it.end(); return it; } /// Get const iterator to end of collection inline const_iterator end() const { const_iterator it(*this); it.end(); return it; } //@} /**@name Constructors and destructors */ //@{ /// Default constructor OsiCuts (); /// Copy constructor OsiCuts ( const OsiCuts &); /// Assignment operator OsiCuts & operator=( const OsiCuts& rhs); /// Destructor virtual ~OsiCuts (); //@} private: //*@name Function operator for sorting cuts by efectiveness */ //@{ class OsiCutCompare { public: /// Function for sorting cuts by effectiveness inline bool operator()(const OsiCut * c1P,const OsiCut * c2P) { return c1P->effectiveness() > c2P->effectiveness(); } }; //@} /**@name Private methods */ //@{ /// Copy internal data void gutsOfCopy( const OsiCuts & source ); /// Delete internal data void gutsOfDestructor(); //@} /**@name Private member data */ //@{ /// Vector of row cuts pointers OsiVectorRowCutPtr rowCutPtrs_; /// Vector of column cuts pointers OsiVectorColCutPtr colCutPtrs_; //@} }; //------------------------------------------------------------------- // insert cuts into collection //------------------------------------------------------------------- void OsiCuts::insert( const OsiRowCut & rc ) { OsiRowCut * newCutPtr = rc.clone(); //assert(dynamic_cast(newCutPtr) != NULL ); rowCutPtrs_.push_back(static_cast(newCutPtr)); } void OsiCuts::insert( const OsiColCut & cc ) { OsiColCut * newCutPtr = cc.clone(); //assert(dynamic_cast(newCutPtr) != NULL ); colCutPtrs_.push_back(static_cast(newCutPtr)); } void OsiCuts::insert( OsiRowCut* & rcPtr ) { rowCutPtrs_.push_back(rcPtr); rcPtr = NULL; } void OsiCuts::insert( OsiColCut* &ccPtr ) { colCutPtrs_.push_back(ccPtr); ccPtr = NULL; } #if 0 void OsiCuts::insert( OsiCut* & cPtr ) { OsiRowCut * rcPtr = dynamic_cast(cPtr); if ( rcPtr != NULL ) { insert( rcPtr ); cPtr = rcPtr; } else { OsiColCut * ccPtr = dynamic_cast(cPtr); assert( ccPtr != NULL ); insert( ccPtr ); cPtr = ccPtr; } } #endif // LANNEZ SEBASTIEN added Thu May 25 01:22:51 EDT 2006 void OsiCuts::insert(const OsiCuts & cs) { for (OsiCuts::const_iterator it = cs.begin (); it != cs.end (); it++) { const OsiRowCut * rCut = dynamic_cast (*it); const OsiColCut * cCut = dynamic_cast (*it); assert (rCut || cCut); if (rCut) insert (*rCut); else insert (*cCut); } } //------------------------------------------------------------------- // sort //------------------------------------------------------------------- void OsiCuts::sort() { std::sort(colCutPtrs_.begin(),colCutPtrs_.end(),OsiCutCompare()); std::sort(rowCutPtrs_.begin(),rowCutPtrs_.end(),OsiCutCompare()); } //------------------------------------------------------------------- // Get number of in collections //------------------------------------------------------------------- int OsiCuts::sizeRowCuts() const { return static_cast(rowCutPtrs_.size()); } int OsiCuts::sizeColCuts() const { return static_cast(colCutPtrs_.size()); } int OsiCuts::sizeCuts() const { return static_cast(sizeRowCuts()+sizeColCuts()); } //---------------------------------------------------------------- // Get i'th cut from the collection //---------------------------------------------------------------- const OsiRowCut * OsiCuts::rowCutPtr(int i) const { return rowCutPtrs_[i]; } const OsiColCut * OsiCuts::colCutPtr(int i) const { return colCutPtrs_[i]; } OsiRowCut * OsiCuts::rowCutPtr(int i) { return rowCutPtrs_[i]; } OsiColCut * OsiCuts::colCutPtr(int i) { return colCutPtrs_[i]; } const OsiRowCut & OsiCuts::rowCut(int i) const { return *rowCutPtr(i); } const OsiColCut & OsiCuts::colCut(int i) const { return *colCutPtr(i); } OsiRowCut & OsiCuts::rowCut(int i) { return *rowCutPtr(i); } OsiColCut & OsiCuts::colCut(int i) { return *colCutPtr(i); } //---------------------------------------------------------------- // Get most effective cut from collection //---------------------------------------------------------------- const OsiCut * OsiCuts::mostEffectiveCutPtr() const { const_iterator b=begin(); const_iterator e=end(); return *(std::min_element(b,e,OsiCutCompare())); } OsiCut * OsiCuts::mostEffectiveCutPtr() { iterator b=begin(); iterator e=end(); //return *(std::min_element(b,e,OsiCutCompare())); OsiCut * retVal = NULL; double maxEff = COIN_DBL_MIN; for ( OsiCuts::iterator it=b; it!=e; ++it ) { if (maxEff < (*it)->effectiveness() ) { maxEff = (*it)->effectiveness(); retVal = *it; } } return retVal; } //---------------------------------------------------------------- // Print all cuts //---------------------------------------------------------------- void OsiCuts::printCuts() const { // do all column cuts first int i; int numberColCuts=sizeColCuts(); for (i=0;iprint(); } int numberRowCuts=sizeRowCuts(); for (i=0;iprint(); } } //---------------------------------------------------------------- // Erase i'th cut from the collection //---------------------------------------------------------------- void OsiCuts::eraseRowCut(int i) { delete rowCutPtrs_[i]; rowCutPtrs_.erase( rowCutPtrs_.begin()+i ); } void OsiCuts::eraseColCut(int i) { delete colCutPtrs_[i]; colCutPtrs_.erase( colCutPtrs_.begin()+i ); } /// Get pointer to i'th row cut and remove ptr from collection OsiRowCut * OsiCuts::rowCutPtrAndZap(int i) { OsiRowCut * cut = rowCutPtrs_[i]; rowCutPtrs_[i]=NULL; rowCutPtrs_.erase( rowCutPtrs_.begin()+i ); return cut; } void OsiCuts::dumpCuts() { rowCutPtrs_.clear() ; } void OsiCuts::eraseAndDumpCuts(const std::vector to_erase) { for (unsigned i=0; i
  • a lower bound
  • an upper bound
  • a vector of row elements */ class OsiRowCut : public OsiCut { friend void OsiRowCutUnitTest(const OsiSolverInterface * baseSiP, const std::string & mpsDir); public: /**@name Row bounds */ //@{ /// Get lower bound OsiRowCut_inline double lb() const; /// Set lower bound OsiRowCut_inline void setLb(double lb); /// Get upper bound OsiRowCut_inline double ub() const; /// Set upper bound OsiRowCut_inline void setUb(double ub); //@} /**@name Row rhs, sense, range */ //@{ /// Get sense ('E', 'G', 'L', 'N', 'R') char sense() const; /// Get right-hand side double rhs() const; /// Get range (ub - lb for 'R' rows, 0 otherwise) double range() const; //@} //------------------------------------------------------------------- /**@name Row elements */ //@{ /// Set row elements OsiRowCut_inline void setRow( int size, const int * colIndices, const double * elements, bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE); /// Set row elements from a packed vector OsiRowCut_inline void setRow( const CoinPackedVector & v ); /// Get row elements OsiRowCut_inline const CoinPackedVector & row() const; /// Get row elements for changing OsiRowCut_inline CoinPackedVector & mutableRow() ; //@} /**@name Comparison operators */ //@{ #if __GNUC__ != 2 using OsiCut::operator== ; #endif /** equal - true if lower bound, upper bound, row elements, and OsiCut are equal. */ OsiRowCut_inline bool operator==(const OsiRowCut& rhs) const; #if __GNUC__ != 2 using OsiCut::operator!= ; #endif /// not equal OsiRowCut_inline bool operator!=(const OsiRowCut& rhs) const; //@} //---------------------------------------------------------------- /**@name Sanity checks on cut */ //@{ /** Returns true if the cut is consistent. This checks to ensure that:
    • The row element vector does not have duplicate indices
    • The row element vector indices are >= 0
    */ OsiRowCut_inline bool consistent() const; /** Returns true if cut is consistent with respect to the solver interface's model. This checks to ensure that
    • The row element vector indices are < the number of columns in the model
    */ OsiRowCut_inline bool consistent(const OsiSolverInterface& im) const; /** Returns true if the row cut itself is infeasible and cannot be satisfied. This checks whether
    • the lower bound is strictly greater than the upper bound.
    */ OsiRowCut_inline bool infeasible(const OsiSolverInterface &im) const; /** Returns infeasibility of the cut with respect to solution passed in i.e. is positive if cuts off that solution. solution is getNumCols() long.. */ virtual double violated(const double * solution) const; //@} /**@name Arithmetic operators. Apply CoinPackedVector methods to the vector */ //@{ /// add value to every vector entry void operator+=(double value) { row_ += value; } /// subtract value from every vector entry void operator-=(double value) { row_ -= value; } /// multiply every vector entry by value void operator*=(double value) { row_ *= value; } /// divide every vector entry by value void operator/=(double value) { row_ /= value; } //@} /// Allow access row sorting function void sortIncrIndex() {row_.sortIncrIndex();} /**@name Constructors and destructors */ //@{ /// Assignment operator OsiRowCut & operator=( const OsiRowCut& rhs); /// Copy constructor OsiRowCut ( const OsiRowCut &); /// Clone virtual OsiRowCut * clone() const; /// Default Constructor OsiRowCut (); /** \brief Ownership Constructor This constructor assumes ownership of the vectors passed as parameters for indices and elements. \p colIndices and \p elements will be NULL on return. */ OsiRowCut(double cutlb, double cutub, int capacity, int size, int *&colIndices, double *&elements); /// Destructor virtual ~OsiRowCut (); //@} /**@name Debug stuff */ //@{ /// Print cuts in collection virtual void print() const ; //@} private: /**@name Private member data */ //@{ /// Row elements CoinPackedVector row_; /// Row lower bound double lb_; /// Row upper bound double ub_; //@} }; #ifdef OSI_INLINE_ROWCUT_METHODS //------------------------------------------------------------------- // Set/Get lower & upper bounds //------------------------------------------------------------------- double OsiRowCut::lb() const { return lb_; } void OsiRowCut::setLb(double lb) { lb_ = lb; } double OsiRowCut::ub() const { return ub_; } void OsiRowCut::setUb(double ub) { ub_ = ub; } //------------------------------------------------------------------- // Set row elements //------------------------------------------------------------------- void OsiRowCut::setRow(int size, const int * colIndices, const double * elements) { row_.setVector(size,colIndices,elements); } void OsiRowCut::setRow( const CoinPackedVector & v ) { row_ = v; } //------------------------------------------------------------------- // Get the row //------------------------------------------------------------------- const CoinPackedVector & OsiRowCut::row() const { return row_; } //------------------------------------------------------------------- // Get the row so we can change //------------------------------------------------------------------- CoinPackedVector & OsiRowCut::mutableRow() { return row_; } //---------------------------------------------------------------- // == operator //------------------------------------------------------------------- bool OsiRowCut::operator==(const OsiRowCut& rhs) const { if ( this->OsiCut::operator!=(rhs) ) return false; if ( row() != rhs.row() ) return false; if ( lb() != rhs.lb() ) return false; if ( ub() != rhs.ub() ) return false; return true; } bool OsiRowCut::operator!=(const OsiRowCut& rhs) const { return !( (*this)==rhs ); } //---------------------------------------------------------------- // consistent & infeasible //------------------------------------------------------------------- bool OsiRowCut::consistent() const { const CoinPackedVector & r=row(); r.duplicateIndex("consistent", "OsiRowCut"); if ( r.getMinIndex() < 0 ) return false; return true; } bool OsiRowCut::consistent(const OsiSolverInterface& im) const { const CoinPackedVector & r=row(); if ( r.getMaxIndex() >= im.getNumCols() ) return false; return true; } bool OsiRowCut::infeasible(const OsiSolverInterface &im) const { if ( lb() > ub() ) return true; return false; } #endif /** Row Cut Class which refers back to row which created it. It may be useful to strengthen a row rather than add a cut. To do this we need to know which row is strengthened. This trivial extension to OsiRowCut does that. */ class OsiRowCut2 : public OsiRowCut { public: /**@name Which row */ //@{ /// Get row inline int whichRow() const { return whichRow_;} /// Set row inline void setWhichRow(int row) { whichRow_=row;} //@} /**@name Constructors and destructors */ //@{ /// Assignment operator OsiRowCut2 & operator=( const OsiRowCut2& rhs); /// Copy constructor OsiRowCut2 ( const OsiRowCut2 &); /// Clone virtual OsiRowCut * clone() const; /// Default Constructor OsiRowCut2 (int row=-1); /// Destructor virtual ~OsiRowCut2 (); //@} private: /**@name Private member data */ //@{ /// Which row int whichRow_; //@} }; #endif Osi-0.106.4/src/Osi/OsiBranchingObject.cpp0000644000076600007660000015267212130104324016617 0ustar coincoin// Copyright (C) 2006, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #if defined(_MSC_VER) // Turn off compiler warning about long names # pragma warning(disable:4786) #endif #include #include #include #include //#define OSI_DEBUG #include "OsiSolverInterface.hpp" #include "OsiBranchingObject.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedMatrix.hpp" #include "CoinSort.hpp" #include "CoinError.hpp" #include "CoinFinite.hpp" // Default Constructor OsiObject::OsiObject() :infeasibility_(0.0), whichWay_(0), numberWays_(2), priority_(1000) { } // Destructor OsiObject::~OsiObject () { } // Copy constructor OsiObject::OsiObject ( const OsiObject & rhs) { infeasibility_ = rhs.infeasibility_; whichWay_ = rhs.whichWay_; priority_ = rhs.priority_; numberWays_ = rhs.numberWays_; } // Assignment operator OsiObject & OsiObject::operator=( const OsiObject& rhs) { if (this!=&rhs) { infeasibility_ = rhs.infeasibility_; whichWay_ = rhs.whichWay_; priority_ = rhs.priority_; numberWays_ = rhs.numberWays_; } return *this; } // Return "up" estimate (default 1.0e-5) double OsiObject::upEstimate() const { return 1.0e-5; } // Return "down" estimate (default 1.0e-5) double OsiObject::downEstimate() const { return 1.0e-5; } // Column number if single column object -1 otherwise int OsiObject::columnNumber() const { return -1; } // Infeasibility - large is 0.5 double OsiObject::infeasibility(const OsiSolverInterface * solver, int & preferredWay) const { // Can't guarantee has matrix OsiBranchingInformation info(solver,false,false); return infeasibility(&info,preferredWay); } // This does NOT set mutable stuff double OsiObject::checkInfeasibility(const OsiBranchingInformation * info) const { int way; double saveInfeasibility = infeasibility_; short int saveWhichWay = whichWay_ ; double value = infeasibility(info,way); infeasibility_ = saveInfeasibility; whichWay_ = saveWhichWay; return value; } /* For the variable(s) referenced by the object, look at the current solution and set bounds to match the solution. Returns measure of how much it had to move solution to make feasible */ double OsiObject::feasibleRegion(OsiSolverInterface * solver) const { // Can't guarantee has matrix OsiBranchingInformation info(solver,false,false); return feasibleRegion(solver,&info); } // Default Constructor OsiObject2::OsiObject2() : OsiObject(), preferredWay_(-1), otherInfeasibility_(0.0) { } // Destructor OsiObject2::~OsiObject2 () { } // Copy constructor OsiObject2::OsiObject2 ( const OsiObject2 & rhs) : OsiObject(rhs), preferredWay_(rhs.preferredWay_), otherInfeasibility_ (rhs.otherInfeasibility_) { } // Assignment operator OsiObject2 & OsiObject2::operator=( const OsiObject2& rhs) { if (this!=&rhs) { OsiObject::operator=(rhs); preferredWay_ = rhs.preferredWay_; otherInfeasibility_ = rhs.otherInfeasibility_; } return *this; } // Default Constructor OsiBranchingObject::OsiBranchingObject() { originalObject_=NULL; branchIndex_=0; value_=0.0; numberBranches_=2; } // Useful constructor OsiBranchingObject::OsiBranchingObject (OsiSolverInterface * , double value) { originalObject_=NULL; branchIndex_=0; value_=value; numberBranches_=2; } // Copy constructor OsiBranchingObject::OsiBranchingObject ( const OsiBranchingObject & rhs) { originalObject_=rhs.originalObject_; branchIndex_=rhs.branchIndex_; value_=rhs.value_; numberBranches_=rhs.numberBranches_; } // Assignment operator OsiBranchingObject & OsiBranchingObject::operator=( const OsiBranchingObject& rhs) { if (this != &rhs) { originalObject_=rhs.originalObject_; branchIndex_=rhs.branchIndex_; value_=rhs.value_; numberBranches_=rhs.numberBranches_; } return *this; } // Destructor OsiBranchingObject::~OsiBranchingObject () { } // For debug int OsiBranchingObject::columnNumber() const { if (originalObject_) return originalObject_->columnNumber(); else return -1; } /** Default Constructor */ OsiBranchingInformation::OsiBranchingInformation () : objectiveValue_(COIN_DBL_MAX), cutoff_(COIN_DBL_MAX), direction_(COIN_DBL_MAX), integerTolerance_(1.0e-7), primalTolerance_(1.0e-7), timeRemaining_(COIN_DBL_MAX), defaultDual_(-1.0), solver_(NULL), numberColumns_(0), lower_(NULL), solution_(NULL), upper_(NULL), hotstartSolution_(NULL), pi_(NULL), rowActivity_(NULL), objective_(NULL), rowLower_(NULL), rowUpper_(NULL), elementByColumn_(NULL), columnStart_(NULL), columnLength_(NULL), row_(NULL), usefulRegion_(NULL), indexRegion_(NULL), numberSolutions_(0), numberBranchingSolutions_(0), depth_(0), owningSolution_(false) { } /** Useful constructor */ OsiBranchingInformation::OsiBranchingInformation (const OsiSolverInterface * solver, bool /*normalSolver*/, bool owningSolution) : timeRemaining_(COIN_DBL_MAX), defaultDual_(-1.0), solver_(solver), hotstartSolution_(NULL), usefulRegion_(NULL), indexRegion_(NULL), numberSolutions_(0), numberBranchingSolutions_(0), depth_(0), owningSolution_(owningSolution) { direction_ = solver_->getObjSense(); objectiveValue_ = solver_->getObjValue(); objectiveValue_ *= direction_; solver_->getDblParam(OsiDualObjectiveLimit,cutoff_) ; cutoff_ *= direction_; integerTolerance_ = solver_->getIntegerTolerance(); solver_->getDblParam(OsiPrimalTolerance,primalTolerance_) ; numberColumns_ = solver_->getNumCols(); lower_ = solver_->getColLower(); if (owningSolution_) solution_ = CoinCopyOfArray(solver_->getColSolution(),numberColumns_); else solution_ = solver_->getColSolution(); upper_ = solver_->getColUpper(); pi_ = solver_->getRowPrice(); rowActivity_ = solver_->getRowActivity(); objective_ = solver_->getObjCoefficients(); rowLower_ = solver_->getRowLower(); rowUpper_ = solver_->getRowUpper(); const CoinPackedMatrix* matrix = solver_->getMatrixByCol(); if (matrix) { // Column copy of matrix if matrix exists elementByColumn_ = matrix->getElements(); row_ = matrix->getIndices(); columnStart_ = matrix->getVectorStarts(); columnLength_ = matrix->getVectorLengths(); } else { // Matrix does not exist elementByColumn_ = NULL; row_ = NULL; columnStart_ = NULL; columnLength_ = NULL; } } // Copy constructor OsiBranchingInformation::OsiBranchingInformation ( const OsiBranchingInformation & rhs) { objectiveValue_ = rhs.objectiveValue_; cutoff_ = rhs.cutoff_; direction_ = rhs.direction_; integerTolerance_ = rhs.integerTolerance_; primalTolerance_ = rhs.primalTolerance_; timeRemaining_ = rhs.timeRemaining_; defaultDual_ = rhs.defaultDual_; solver_ = rhs.solver_; numberColumns_ = rhs.numberColumns_; lower_ = rhs.lower_; owningSolution_ = rhs.owningSolution_; if (owningSolution_) solution_ = CoinCopyOfArray(rhs.solution_,numberColumns_); else solution_ = rhs.solution_; upper_ = rhs.upper_; hotstartSolution_ = rhs.hotstartSolution_; pi_ = rhs.pi_; rowActivity_ = rhs.rowActivity_; objective_ = rhs.objective_; rowLower_ = rhs.rowLower_; rowUpper_ = rhs.rowUpper_; elementByColumn_ = rhs.elementByColumn_; row_ = rhs.row_; columnStart_ = rhs.columnStart_; columnLength_ = rhs.columnLength_; usefulRegion_ = rhs.usefulRegion_; assert (!usefulRegion_); indexRegion_ = rhs.indexRegion_; numberSolutions_ = rhs.numberSolutions_; numberBranchingSolutions_ = rhs.numberBranchingSolutions_; depth_ = rhs.depth_; } // Clone OsiBranchingInformation * OsiBranchingInformation::clone() const { return new OsiBranchingInformation(*this); } // Assignment operator OsiBranchingInformation & OsiBranchingInformation::operator=( const OsiBranchingInformation& rhs) { if (this!=&rhs) { objectiveValue_ = rhs.objectiveValue_; cutoff_ = rhs.cutoff_; direction_ = rhs.direction_; integerTolerance_ = rhs.integerTolerance_; primalTolerance_ = rhs.primalTolerance_; timeRemaining_ = rhs.timeRemaining_; defaultDual_ = rhs.defaultDual_; numberColumns_ = rhs.numberColumns_; lower_ = rhs.lower_; owningSolution_ = rhs.owningSolution_; if (owningSolution_) { solution_ = CoinCopyOfArray(rhs.solution_,numberColumns_); delete [] solution_; } else { solution_ = rhs.solution_; } upper_ = rhs.upper_; hotstartSolution_ = rhs.hotstartSolution_; pi_ = rhs.pi_; rowActivity_ = rhs.rowActivity_; objective_ = rhs.objective_; rowLower_ = rhs.rowLower_; rowUpper_ = rhs.rowUpper_; elementByColumn_ = rhs.elementByColumn_; row_ = rhs.row_; columnStart_ = rhs.columnStart_; columnLength_ = rhs.columnLength_; usefulRegion_ = rhs.usefulRegion_; assert (!usefulRegion_); indexRegion_ = rhs.indexRegion_; numberSolutions_ = rhs.numberSolutions_; numberBranchingSolutions_ = rhs.numberBranchingSolutions_; depth_ = rhs.depth_; } return *this; } // Destructor OsiBranchingInformation::~OsiBranchingInformation () { if (owningSolution_) delete[] solution_; } // Default Constructor OsiTwoWayBranchingObject::OsiTwoWayBranchingObject() :OsiBranchingObject() { firstBranch_=0; } // Useful constructor OsiTwoWayBranchingObject::OsiTwoWayBranchingObject (OsiSolverInterface * solver, const OsiObject * object, int way , double value) :OsiBranchingObject(solver,value) { originalObject_ = object; firstBranch_=way; } // Copy constructor OsiTwoWayBranchingObject::OsiTwoWayBranchingObject ( const OsiTwoWayBranchingObject & rhs) :OsiBranchingObject(rhs) { firstBranch_=rhs.firstBranch_; } // Assignment operator OsiTwoWayBranchingObject & OsiTwoWayBranchingObject::operator=( const OsiTwoWayBranchingObject& rhs) { if (this != &rhs) { OsiBranchingObject::operator=(rhs); firstBranch_=rhs.firstBranch_; } return *this; } // Destructor OsiTwoWayBranchingObject::~OsiTwoWayBranchingObject () { } /********* Simple Integers *******************************/ /** Default Constructor Equivalent to an unspecified binary variable. */ OsiSimpleInteger::OsiSimpleInteger () : OsiObject2(), originalLower_(0.0), originalUpper_(1.0), columnNumber_(-1) { } /** Useful constructor Loads actual upper & lower bounds for the specified variable. */ OsiSimpleInteger::OsiSimpleInteger (const OsiSolverInterface * solver, int iColumn) : OsiObject2() { columnNumber_ = iColumn ; originalLower_ = solver->getColLower()[columnNumber_] ; originalUpper_ = solver->getColUpper()[columnNumber_] ; } // Useful constructor - passed solver index and original bounds OsiSimpleInteger::OsiSimpleInteger ( int iColumn, double lower, double upper) : OsiObject2() { columnNumber_ = iColumn ; originalLower_ = lower; originalUpper_ = upper; } // Copy constructor OsiSimpleInteger::OsiSimpleInteger ( const OsiSimpleInteger & rhs) :OsiObject2(rhs) { columnNumber_ = rhs.columnNumber_; originalLower_ = rhs.originalLower_; originalUpper_ = rhs.originalUpper_; } // Clone OsiObject * OsiSimpleInteger::clone() const { return new OsiSimpleInteger(*this); } // Assignment operator OsiSimpleInteger & OsiSimpleInteger::operator=( const OsiSimpleInteger& rhs) { if (this!=&rhs) { OsiObject2::operator=(rhs); columnNumber_ = rhs.columnNumber_; originalLower_ = rhs.originalLower_; originalUpper_ = rhs.originalUpper_; } return *this; } // Destructor OsiSimpleInteger::~OsiSimpleInteger () { } /* Reset variable bounds to their original values. Bounds may be tightened, so it may be good to be able to reset them to their original values. */ void OsiSimpleInteger::resetBounds(const OsiSolverInterface * solver) { originalLower_ = solver->getColLower()[columnNumber_] ; originalUpper_ = solver->getColUpper()[columnNumber_] ; } // Redoes data when sequence numbers change void OsiSimpleInteger::resetSequenceEtc(int numberColumns, const int * originalColumns) { int i; for (i=0;isolution_[columnNumber_]; value = CoinMax(value, info->lower_[columnNumber_]); value = CoinMin(value, info->upper_[columnNumber_]); double nearest = floor(value+(1.0-0.5)); if (nearest>value) { whichWay=1; } else { whichWay=0; } infeasibility_ = fabs(value-nearest); double returnValue = infeasibility_; if (infeasibility_<=info->integerTolerance_) { otherInfeasibility_ = 1.0; returnValue = 0.0; } else if (info->defaultDual_<0.0) { otherInfeasibility_ = 1.0-infeasibility_; } else { const double * pi = info->pi_; const double * activity = info->rowActivity_; const double * lower = info->rowLower_; const double * upper = info->rowUpper_; const double * element = info->elementByColumn_; const int * row = info->row_; const CoinBigIndex * columnStart = info->columnStart_; const int * columnLength = info->columnLength_; double direction = info->direction_; double downMovement = value - floor(value); double upMovement = 1.0-downMovement; double valueP = info->objective_[columnNumber_]*direction; CoinBigIndex start = columnStart[columnNumber_]; CoinBigIndex end = start + columnLength[columnNumber_]; double upEstimate = 0.0; double downEstimate = 0.0; if (valueP>0.0) upEstimate = valueP*upMovement; else downEstimate -= valueP*downMovement; double tolerance = info->primalTolerance_; for (CoinBigIndex j=start;j1.0e20) assert (pi[iRow]>=-1.0e-4); valueP = pi[iRow]*direction; double el2 = element[j]; double value2 = valueP*el2; double u=0.0; double d=0.0; if (value2>0.0) u = value2; else d = -value2; // if up makes infeasible then make at least default double newUp = activity[iRow] + upMovement*el2; if (newUp>upper[iRow]+tolerance||newUpdefaultDual_); upEstimate += u*upMovement; // if down makes infeasible then make at least default double newDown = activity[iRow] - downMovement*el2; if (newDown>upper[iRow]+tolerance||newDowndefaultDual_); downEstimate += d*downMovement; } if (downEstimate>=upEstimate) { infeasibility_ = CoinMax(1.0e-12,upEstimate); otherInfeasibility_ = CoinMax(1.0e-12,downEstimate); whichWay = 1; } else { infeasibility_ = CoinMax(1.0e-12,downEstimate); otherInfeasibility_ = CoinMax(1.0e-12,upEstimate); whichWay = 0; } returnValue = infeasibility_; } if (preferredWay_>=0&&returnValue) whichWay = preferredWay_; whichWay_ = static_cast(whichWay) ; return returnValue; } // This looks at solution and sets bounds to contain solution /** More precisely: it first forces the variable within the existing bounds, and then tightens the bounds to fix the variable at the nearest integer value. */ double OsiSimpleInteger::feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const { double value = info->solution_[columnNumber_]; double newValue = CoinMax(value, info->lower_[columnNumber_]); newValue = CoinMin(newValue, info->upper_[columnNumber_]); newValue = floor(newValue+0.5); solver->setColLower(columnNumber_,newValue); solver->setColUpper(columnNumber_,newValue); return fabs(value-newValue); } /* Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics */ int OsiSimpleInteger::columnNumber() const { return columnNumber_; } // Creates a branching object OsiBranchingObject * OsiSimpleInteger::createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const { double value = info->solution_[columnNumber_]; value = CoinMax(value, info->lower_[columnNumber_]); value = CoinMin(value, info->upper_[columnNumber_]); assert (info->upper_[columnNumber_]>info->lower_[columnNumber_]); #ifndef NDEBUG double nearest = floor(value+0.5); assert (fabs(value-nearest)>info->integerTolerance_); #endif OsiBranchingObject * branch = new OsiIntegerBranchingObject(solver,this,way, value); return branch; } // Return "down" estimate double OsiSimpleInteger::downEstimate() const { if (whichWay_) return 1.0-infeasibility_; else return infeasibility_; } // Return "up" estimate double OsiSimpleInteger::upEstimate() const { if (!whichWay_) return 1.0-infeasibility_; else return infeasibility_; } // Default Constructor OsiIntegerBranchingObject::OsiIntegerBranchingObject() :OsiTwoWayBranchingObject() { down_[0] = 0.0; down_[1] = 0.0; up_[0] = 0.0; up_[1] = 0.0; } // Useful constructor OsiIntegerBranchingObject::OsiIntegerBranchingObject (OsiSolverInterface * solver, const OsiSimpleInteger * object, int way , double value) :OsiTwoWayBranchingObject(solver,object, way, value) { int iColumn = object->columnNumber(); down_[0] = solver->getColLower()[iColumn]; down_[1] = floor(value_); up_[0] = ceil(value_); up_[1] = solver->getColUpper()[iColumn]; } /* Create a standard floor/ceiling branch object Specifies a simple two-way branch in a more flexible way. One arm of the branch will be lb <= x <= downUpperBound, the other upLowerBound <= x <= ub. Specify way = -1 to set the object state to perform the down arm first, way = 1 for the up arm. */ OsiIntegerBranchingObject::OsiIntegerBranchingObject (OsiSolverInterface * solver, const OsiSimpleInteger * object, int way , double value, double downUpperBound, double upLowerBound) :OsiTwoWayBranchingObject(solver,object, way, value) { int iColumn = object->columnNumber(); down_[0] = solver->getColLower()[iColumn]; down_[1] = downUpperBound; up_[0] = upLowerBound; up_[1] = solver->getColUpper()[iColumn]; } // Copy constructor OsiIntegerBranchingObject::OsiIntegerBranchingObject ( const OsiIntegerBranchingObject & rhs) :OsiTwoWayBranchingObject(rhs) { down_[0] = rhs.down_[0]; down_[1] = rhs.down_[1]; up_[0] = rhs.up_[0]; up_[1] = rhs.up_[1]; } // Assignment operator OsiIntegerBranchingObject & OsiIntegerBranchingObject::operator=( const OsiIntegerBranchingObject& rhs) { if (this != &rhs) { OsiTwoWayBranchingObject::operator=(rhs); down_[0] = rhs.down_[0]; down_[1] = rhs.down_[1]; up_[0] = rhs.up_[0]; up_[1] = rhs.up_[1]; } return *this; } OsiBranchingObject * OsiIntegerBranchingObject::clone() const { return (new OsiIntegerBranchingObject(*this)); } // Destructor OsiIntegerBranchingObject::~OsiIntegerBranchingObject () { } /* Perform a branch by adjusting the bounds of the specified variable. Note that each arm of the branch advances the object to the next arm by advancing the value of branchIndex_. Providing new values for the variable's lower and upper bounds for each branching direction gives a little bit of additional flexibility and will be easily extensible to multi-way branching. Returns change in guessed objective on next branch */ double OsiIntegerBranchingObject::branch(OsiSolverInterface * solver) { const OsiSimpleInteger * obj = dynamic_cast (originalObject_) ; assert (obj); int iColumn = obj->columnNumber(); double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; int way = (!branchIndex_) ? (2*firstBranch_-1) : -(2*firstBranch_-1); if (0) { printf("branching %s on %d bounds %g %g / %g %g\n", (way==-1) ? "down" :"up",iColumn, down_[0],down_[1],up_[0],up_[1]); const double * lower = solver->getColLower(); const double * upper = solver->getColUpper(); for (int i=0;i<8;i++) printf(" [%d (%g,%g)]",i,lower[i],upper[i]); printf("\n"); } if (way<0) { #ifdef OSI_DEBUG { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("branching down on var %d: [%g,%g] => [%g,%g]\n", iColumn,olb,oub,down_[0],down_[1]) ; } #endif solver->setColLower(iColumn,down_[0]); solver->setColUpper(iColumn,down_[1]); } else { #ifdef OSI_DEBUG { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("branching up on var %d: [%g,%g] => [%g,%g]\n", iColumn,olb,oub,up_[0],up_[1]) ; } #endif solver->setColLower(iColumn,up_[0]); solver->setColUpper(iColumn,up_[1]); } double nlb = solver->getColLower()[iColumn]; if (nlbsetColLower(iColumn,olb); } double nub = solver->getColUpper()[iColumn]; if (nub>oub) { #ifndef NDEBUG printf("bad ub change for column %d from %g to %g\n",iColumn,oub,nub); #endif solver->setColUpper(iColumn,oub); } #ifndef NDEBUG if (nlboub-1.0e-8) printf("bad null change for column %d - bounds %g,%g\n",iColumn,olb,oub); #endif branchIndex_++; return 0.0; } // Print what would happen void OsiIntegerBranchingObject::print(const OsiSolverInterface * solver) { const OsiSimpleInteger * obj = dynamic_cast (originalObject_) ; assert (obj); int iColumn = obj->columnNumber(); int way = (!branchIndex_) ? (2*firstBranch_-1) : -(2*firstBranch_-1); if (way<0) { { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("OsiInteger would branch down on var %d : [%g,%g] => [%g,%g]\n", iColumn,olb,oub,down_[0],down_[1]) ; } } else { { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("OsiInteger would branch up on var %d : [%g,%g] => [%g,%g]\n", iColumn,olb,oub,up_[0],up_[1]) ; } } } // Default Constructor OsiSOS::OsiSOS () : OsiObject2(), members_(NULL), weights_(NULL), numberMembers_(0), sosType_(-1), integerValued_(false) { } // Useful constructor (which are indices) OsiSOS::OsiSOS (const OsiSolverInterface * , int numberMembers, const int * which, const double * weights, int type) : OsiObject2(), numberMembers_(numberMembers), sosType_(type) { integerValued_ = type==1; // not strictly true - should check problem if (numberMembers_) { members_ = new int[numberMembers_]; weights_ = new double[numberMembers_]; memcpy(members_,which,numberMembers_*sizeof(int)); if (weights) { memcpy(weights_,weights,numberMembers_*sizeof(double)); } else { for (int i=0;i0&&sosType_<3); } // Copy constructor OsiSOS::OsiSOS ( const OsiSOS & rhs) :OsiObject2(rhs) { numberMembers_ = rhs.numberMembers_; sosType_ = rhs.sosType_; integerValued_ = rhs.integerValued_; if (numberMembers_) { members_ = new int[numberMembers_]; weights_ = new double[numberMembers_]; memcpy(members_,rhs.members_,numberMembers_*sizeof(int)); memcpy(weights_,rhs.weights_,numberMembers_*sizeof(double)); } else { members_ = NULL; weights_ = NULL; } } // Clone OsiObject * OsiSOS::clone() const { return new OsiSOS(*this); } // Assignment operator OsiSOS & OsiSOS::operator=( const OsiSOS& rhs) { if (this!=&rhs) { OsiObject2::operator=(rhs); delete [] members_; delete [] weights_; numberMembers_ = rhs.numberMembers_; sosType_ = rhs.sosType_; integerValued_ = rhs.integerValued_; if (numberMembers_) { members_ = new int[numberMembers_]; weights_ = new double[numberMembers_]; memcpy(members_,rhs.members_,numberMembers_*sizeof(int)); memcpy(weights_,rhs.weights_,numberMembers_*sizeof(double)); } else { members_ = NULL; weights_ = NULL; } } return *this; } // Destructor OsiSOS::~OsiSOS () { delete [] members_; delete [] weights_; } // Infeasibility - large is 0.5 double OsiSOS::infeasibility(const OsiBranchingInformation * info,int & whichWay) const { int j; int firstNonZero=-1; int lastNonZero = -1; int firstNonFixed=-1; int lastNonFixed = -1; const double * solution = info->solution_; //const double * lower = info->lower_; const double * upper = info->upper_; //double largestValue=0.0; double integerTolerance = info->integerTolerance_; double primalTolerance = info->primalTolerance_; double weight = 0.0; double sum =0.0; // check bounds etc double lastWeight=-1.0e100; for (j=0;j=weights_[j]-1.0e-12) throw CoinError("Weights too close together in SOS","infeasibility","OsiSOS"); lastWeight = weights_[j]; if (upper[iColumn]) { double value = CoinMax(0.0,solution[iColumn]); if (value>integerTolerance) { // Possibly due to scaling a fixed variable might slip through #ifdef COIN_DEVELOP if (value>upper[iColumn]+10.0*primalTolerance) printf("** Variable %d (%d) has value %g and upper bound of %g\n", iColumn,j,value,upper[iColumn]); #endif if (value>upper[iColumn]) { value=upper[iColumn]; } sum += value; weight += weights_[j]*value; if (firstNonZero<0) firstNonZero=j; lastNonZero=j; } if (firstNonFixed<0) firstNonFixed=j; lastNonFixed=j; } } whichWay=1; whichWay_=1; if (lastNonZero-firstNonZero>=sosType_) { // find where to branch assert (sum>0.0); // probably best to use pseudo duals double value = lastNonZero-firstNonZero+1; value *= 0.5/static_cast (numberMembers_); infeasibility_=value; otherInfeasibility_=1.0-value; if (info->defaultDual_>=0.0) { // Using pseudo shadow prices weight /= sum; int iWhere; for (iWhere=firstNonZero;iWhere=weights_[iWhere+1]-weight) lastDown++; // But make sure OK if (lastDown==firstNonFixed) { lastDown ++; } else if (lastDown==lastNonFixed) { lastDown --; } firstUp=lastDown; } // Now get current contribution and compute weight for end points double weightDown = 0.0; double weightUp = 0.0; const double * element = info->elementByColumn_; const int * row = info->row_; const CoinBigIndex * columnStart = info->columnStart_; const int * columnLength = info->columnLength_; double direction = info->direction_; const double * objective = info->objective_; // Compute where we would move to double objValue=0.0; double * useful = info->usefulRegion_; int * index = info->indexRegion_; int n=0; for (j=firstNonZero;j<=lastNonZero;j++) { int iColumn = members_[j]; double multiplier = solution[iColumn]; if (j>=lastDown) weightDown += multiplier; if (j<=firstUp) weightUp += multiplier; if (multiplier>0.0) { objValue += objective[iColumn]*multiplier; CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; for (CoinBigIndex j=start;jpi_; const double * activity = info->rowActivity_; const double * lower = info->rowLower_; const double * upper = info->rowUpper_; int numberRows = info->solver_->getNumRows(); double * useful2 = useful+numberRows; int * index2 = index+numberRows; for (int i=0;i<2;i++) { double obj=0.0; int n2=0; for (j=startX[i];j<=endX[i];j++) { int iColumn = members_[j]; double multiplier = solution[iColumn]; if (iColumn==check[i]) multiplier=fakeSolution[i]; if (multiplier>0.0) { obj += objective[iColumn]*multiplier; CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; for (CoinBigIndex j=start;j0.0) ? obj : 0.0; for (j=0;j1.0e20) assert (valueP>=-1.0e-4); double value2 = valueP*movement; double thisEstimate = (value2>0.0) ? value2 : 0; // if makes infeasible then make at least default double newValue = activity[iRow] + movement; if (newValue>upper[iRow]+primalTolerance||newValuedefaultDual_); estimate += thisEstimate; } for (j=0;j1.0e20) assert (valueP>=-1.0e-4); double value2 = valueP*movement; double thisEstimate = (value2>0.0) ? value2 : 0; // if makes infeasible then make at least default double newValue = activity[iRow] + movement; if (newValue>upper[iRow]+primalTolerance||newValuedefaultDual_); estimate += thisEstimate; } } // store in fakeSolution fakeSolution[i]=estimate; } double downEstimate = fakeSolution[0]; double upEstimate = fakeSolution[1]; if (downEstimate>=upEstimate) { infeasibility_ = CoinMax(1.0e-12,upEstimate); otherInfeasibility_ = CoinMax(1.0e-12,downEstimate); whichWay = 1; } else { infeasibility_ = CoinMax(1.0e-12,downEstimate); otherInfeasibility_ = CoinMax(1.0e-12,upEstimate); whichWay = 0; } whichWay_=static_cast(whichWay); value=infeasibility_; } return value; } else { infeasibility_=0.0; otherInfeasibility_=1.0; return 0.0; // satisfied } } // This looks at solution and sets bounds to contain solution double OsiSOS::feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const { int j; int firstNonZero=-1; int lastNonZero = -1; const double * solution = info->solution_; //const double * lower = info->lower_; const double * upper = info->upper_; double sum =0.0; // Find largest one or pair double movement=0.0; if (sosType_==1) { for (j=0;jsum&&upper[iColumn]) { firstNonZero=j; sum=value; } } lastNonZero=firstNonZero; } else { // type 2 for (j=1;jsum) { if (upper[iColumn]||upper[jColumn]) { firstNonZero=upper[jColumn] ? j-1 : j; lastNonZero=upper[iColumn] ? j : j-1; sum=value; } } } } for (j=0;jlastNonZero) { int iColumn = members_[j]; double value = CoinMax(0.0,solution[iColumn]); movement += value; solver->setColUpper(iColumn,0.0); } } return movement; } // Redoes data when sequence numbers change void OsiSOS::resetSequenceEtc(int numberColumns, const int * originalColumns) { int n2=0; for (int j=0;jsolution_; double tolerance = info->primalTolerance_; const double * upper = info->upper_; int firstNonFixed=-1; int lastNonFixed=-1; int firstNonZero=-1; int lastNonZero = -1; double weight = 0.0; double sum =0.0; for (j=0;jtolerance) { weight += weights_[j]*value; if (firstNonZero<0) firstNonZero=j; lastNonZero=j; } } } assert (lastNonZero-firstNonZero>=sosType_) ; // find where to branch assert (sum>0.0); weight /= sum; int iWhere; double separator=0.0; for (iWhere=firstNonZero;iWhere(originalObject_) ; assert (set); int way = (!branchIndex_) ? (2*firstBranch_-1) : -(2*firstBranch_-1); branchIndex_++; int numberMembers = set->numberMembers(); const int * which = set->members(); const double * weights = set->weights(); //const double * lower = solver->getColLower(); //const double * upper = solver->getColUpper(); // *** for way - up means fix all those in down section if (way<0) { int i; for ( i=0;i value_) break; } assert (isetColUpper(which[i],0.0); } else { int i; for ( i=0;i= value_) break; else solver->setColUpper(which[i],0.0); } assert (i(originalObject_) ; assert (set); int way = (!branchIndex_) ? (2*firstBranch_-1) : -(2*firstBranch_-1); int numberMembers = set->numberMembers(); const int * which = set->members(); const double * weights = set->weights(); //const double * lower = solver->getColLower(); const double * upper = solver->getColUpper(); int first=numberMembers; int last=-1; int numberFixed=0; int numberOther=0; int i; for ( i=0;i value_) break; else if (bound) numberOther++; } assert (i= value_) break; else if (bound) numberFixed++; } assert (i %d (%g), %d would be fixed, %d other way\n", value_,which[first],weights[first],which[last],weights[last],numberFixed,numberOther); } /** Default Constructor */ OsiLotsize::OsiLotsize () : OsiObject2(), columnNumber_(-1), rangeType_(0), numberRanges_(0), largestGap_(0), bound_(NULL), range_(0) { } /** Useful constructor Loads actual upper & lower bounds for the specified variable. */ OsiLotsize::OsiLotsize (const OsiSolverInterface * , int iColumn, int numberPoints, const double * points, bool range) : OsiObject2() { assert (numberPoints>0); columnNumber_ = iColumn ; // sort ranges int * sort = new int[numberPoints]; double * weight = new double [numberPoints]; int i; if (range) { rangeType_=2; } else { rangeType_=1; } for (i=0;i=bound_[0]); for (i=1;i=thisLo); if (thisLo>hi) { bound_[2*numberRanges_]=thisLo; bound_[2*numberRanges_+1]=thisHi; numberRanges_++; hi=thisHi; } else { //overlap hi=CoinMax(hi,thisHi); bound_[2*numberRanges_-1]=hi; } } // and for safety bound_[2*numberRanges_]=bound_[2*numberRanges_-2]; bound_[2*numberRanges_+1]=bound_[2*numberRanges_-1]; for (i=1;i0&&rangeType_<3); bound_= new double [(numberRanges_+1)*rangeType_]; memcpy(bound_,rhs.bound_,(numberRanges_+1)*rangeType_*sizeof(double)); } else { bound_=NULL; } } // Clone OsiObject * OsiLotsize::clone() const { return new OsiLotsize(*this); } // Assignment operator OsiLotsize & OsiLotsize::operator=( const OsiLotsize& rhs) { if (this!=&rhs) { OsiObject2::operator=(rhs); columnNumber_ = rhs.columnNumber_; rangeType_ = rhs.rangeType_; numberRanges_ = rhs.numberRanges_; largestGap_ = rhs.largestGap_; delete [] bound_; range_ = rhs.range_; if (numberRanges_) { assert (rangeType_>0&&rangeType_<3); bound_= new double [(numberRanges_+1)*rangeType_]; memcpy(bound_,rhs.bound_,(numberRanges_+1)*rangeType_*sizeof(double)); } else { bound_=NULL; } } return *this; } // Destructor OsiLotsize::~OsiLotsize () { delete [] bound_; } /* Finds range of interest so value is feasible in range range_ or infeasible between hi[range_] and lo[range_+1]. Returns true if feasible. */ bool OsiLotsize::findRange(double value, double integerTolerance) const { assert (range_>=0&&range_bound_[iLo]-integerTolerance&&valuebound_[iHi]-integerTolerance&&value>1; } //points while (!found) { if (value=bound_[range_-1]) { // found range_--; break; } else { iHi = range_; } } else { if (value>1; } if (value-bound_[range_]<=bound_[range_+1]-value) { infeasibility = value-bound_[range_]; } else { infeasibility = bound_[range_+1]-value; if (infeasibilitybound_[2*iLo]-integerTolerance&&value=bound_[2*iHi]-integerTolerance) { range_=iHi; found=true; } else { range_ = (iLo+iHi)>>1; } //points while (!found) { if (value=bound_[2*range_-2]) { // found range_--; break; } else { iHi = range_; } } else { if (value>1; } if (value>=bound_[2*range_]-integerTolerance&&value<=bound_[2*range_+1]+integerTolerance) infeasibility=0.0; else if (value-bound_[2*range_+1]fabs(value-ceilingLotsize)) { floorLotsize=bound_[range_+1]; ceilingLotsize=bound_[range_+2]; } } else { // ranges assert (value>=bound_[2*range_+1]); floorLotsize=bound_[2*range_+1]; ceilingLotsize=bound_[2*range_+2]; } } // Infeasibility - large is 0.5 double OsiLotsize::infeasibility(const OsiBranchingInformation * info, int & preferredWay) const { const double * solution = info->solution_; const double * lower = info->lower_; const double * upper = info->upper_; double value = solution[columnNumber_]; value = CoinMax(value, lower[columnNumber_]); value = CoinMin(value, upper[columnNumber_]); double integerTolerance = info->integerTolerance_; /*printf("%d %g %g %g %g\n",columnNumber_,value,lower[columnNumber_], solution[columnNumber_],upper[columnNumber_]);*/ assert (value>=bound_[0]-integerTolerance &&value<=bound_[rangeType_*numberRanges_-1]+integerTolerance); infeasibility_=0.0; bool feasible = findRange(value,integerTolerance); if (!feasible) { if (rangeType_==1) { if (value-bound_[range_]= 0 Used by heuristics */ int OsiLotsize::columnNumber() const { return columnNumber_; } /* Set bounds to contain the current solution. More precisely, for the variable associated with this object, take the value given in the current solution, force it within the current bounds if required, then set the bounds to fix the variable at the integer nearest the solution value. Returns amount it had to move variable. */ double OsiLotsize::feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const { const double * lower = solver->getColLower(); const double * upper = solver->getColUpper(); const double * solution = info->solution_; double value = solution[columnNumber_]; value = CoinMax(value, lower[columnNumber_]); value = CoinMin(value, upper[columnNumber_]); findRange(value,info->integerTolerance_); double nearest; if (rangeType_==1) { nearest = bound_[range_]; solver->setColLower(columnNumber_,nearest); solver->setColUpper(columnNumber_,nearest); } else { // ranges solver->setColLower(columnNumber_,bound_[2*range_]); solver->setColUpper(columnNumber_,bound_[2*range_+1]); if (value>bound_[2*range_+1]) nearest=bound_[2*range_+1]; else if (valueintegerTolerance_); #endif return fabs(value-nearest); } // Creates a branching object // Creates a branching object OsiBranchingObject * OsiLotsize::createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const { const double * solution = info->solution_; const double * lower = solver->getColLower(); const double * upper = solver->getColUpper(); double value = solution[columnNumber_]; value = CoinMax(value, lower[columnNumber_]); value = CoinMin(value, upper[columnNumber_]); assert (!findRange(value,info->integerTolerance_)); return new OsiLotsizeBranchingObject(solver,this,way, value); } /* Bounds may be tightened, so it may be good to be able to refresh the local copy of the original bounds. */ void OsiLotsize::resetBounds(const OsiSolverInterface * ) { } // Return "down" estimate double OsiLotsize::downEstimate() const { if (whichWay_) return otherInfeasibility_; else return infeasibility_; } // Return "up" estimate double OsiLotsize::upEstimate() const { if (!whichWay_) return otherInfeasibility_; else return infeasibility_; } // Redoes data when sequence numbers change void OsiLotsize::resetSequenceEtc(int numberColumns, const int * originalColumns) { int i; for (i=0;icolumnNumber(); down_[0] = solver->getColLower()[iColumn]; double integerTolerance = solver->getIntegerTolerance(); originalObject->floorCeiling(down_[1],up_[0],value,integerTolerance); up_[1] = solver->getColUpper()[iColumn]; } // Copy constructor OsiLotsizeBranchingObject::OsiLotsizeBranchingObject ( const OsiLotsizeBranchingObject & rhs) :OsiTwoWayBranchingObject(rhs) { down_[0] = rhs.down_[0]; down_[1] = rhs.down_[1]; up_[0] = rhs.up_[0]; up_[1] = rhs.up_[1]; } // Assignment operator OsiLotsizeBranchingObject & OsiLotsizeBranchingObject::operator=( const OsiLotsizeBranchingObject& rhs) { if (this != &rhs) { OsiTwoWayBranchingObject::operator=(rhs); down_[0] = rhs.down_[0]; down_[1] = rhs.down_[1]; up_[0] = rhs.up_[0]; up_[1] = rhs.up_[1]; } return *this; } OsiBranchingObject * OsiLotsizeBranchingObject::clone() const { return (new OsiLotsizeBranchingObject(*this)); } // Destructor OsiLotsizeBranchingObject::~OsiLotsizeBranchingObject () { } /* Perform a branch by adjusting the bounds of the specified variable. Note that each arm of the branch advances the object to the next arm by advancing the value of way_. Providing new values for the variable's lower and upper bounds for each branching direction gives a little bit of additional flexibility and will be easily extensible to multi-way branching. */ double OsiLotsizeBranchingObject::branch(OsiSolverInterface * solver) { const OsiLotsize * obj = dynamic_cast (originalObject_) ; assert (obj); int iColumn = obj->columnNumber(); int way = (!branchIndex_) ? (2*firstBranch_-1) : -(2*firstBranch_-1); if (way<0) { #ifdef OSI_DEBUG { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("branching down on var %d: [%g,%g] => [%g,%g]\n", iColumn,olb,oub,down_[0],down_[1]) ; } #endif solver->setColLower(iColumn,down_[0]); solver->setColUpper(iColumn,down_[1]); } else { #ifdef OSI_DEBUG { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("branching up on var %d: [%g,%g] => [%g,%g]\n", iColumn,olb,oub,up_[0],up_[1]) ; } #endif solver->setColLower(iColumn,up_[0]); solver->setColUpper(iColumn,up_[1]); } branchIndex_++; return 0.0; } // Print void OsiLotsizeBranchingObject::print(const OsiSolverInterface * solver) { const OsiLotsize * obj = dynamic_cast (originalObject_) ; assert (obj); int iColumn = obj->columnNumber(); int way = (!branchIndex_) ? (2*firstBranch_-1) : -(2*firstBranch_-1); if (way<0) { { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("branching down on var %d: [%g,%g] => [%g,%g]\n", iColumn,olb,oub,down_[0],down_[1]) ; } } else { { double olb,oub ; olb = solver->getColLower()[iColumn] ; oub = solver->getColUpper()[iColumn] ; printf("branching up on var %d: [%g,%g] => [%g,%g]\n", iColumn,olb,oub,up_[0],up_[1]) ; } } } Osi-0.106.4/src/Osi/OsiSolverInterface.cpp0000644000076600007660000022210611615040541016665 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinMpsIO.hpp" #include "CoinMessage.hpp" #include "CoinWarmStart.hpp" #ifdef COIN_SNAPSHOT #include "CoinSnapshot.hpp" #endif #include "OsiSolverInterface.hpp" #ifdef CBC_NEXT_VERSION #include "OsiSolverBranch.hpp" #endif #include "OsiCuts.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "OsiRowCutDebugger.hpp" #include "OsiAuxInfo.hpp" #include "OsiBranchingObject.hpp" #include #include "CoinFinite.hpp" #include "CoinBuild.hpp" #include "CoinModel.hpp" #include "CoinLpIO.hpp" //############################################################################# // Hotstart related methods (primarily used in strong branching) // It is assumed that only bounds (on vars/constraints) can change between // markHotStart() and unmarkHotStart() //############################################################################# void OsiSolverInterface::markHotStart() { delete ws_; ws_ = getWarmStart(); } void OsiSolverInterface::solveFromHotStart() { setWarmStart(ws_); resolve(); } void OsiSolverInterface::unmarkHotStart() { delete ws_; ws_ = NULL; } //############################################################################# // Get indices of solution vector which are integer variables presently at // fractional values //############################################################################# OsiVectorInt OsiSolverInterface::getFractionalIndices(const double etol) const { const int colnum = getNumCols(); OsiVectorInt frac; CoinAbsFltEq eq(etol); for (int i = 0; i < colnum; ++i) { if (isInteger(i)) { const double ci = getColSolution()[i]; const double distanceFromInteger = ci - floor(ci + 0.5); if (! eq(distanceFromInteger, 0.0)) frac.push_back(i); } } return frac; } int OsiSolverInterface::getNumElements() const { return getMatrixByRow()->getNumElements(); } //############################################################################# // Methods for determining the type of column variable. // The method isContinuous() is presently implemented in the derived classes. // The methods below depend on isContinuous and the values // stored in the column bounds. //############################################################################# bool OsiSolverInterface::isBinary(int colIndex) const { if ( isContinuous(colIndex) ) return false; const double * cu = getColUpper(); const double * cl = getColLower(); if ( (cu[colIndex]== 1 || cu[colIndex]== 0) && (cl[colIndex]== 0 || cl[colIndex]==1) ) return true; else return false; } //############################################################################# // Method for getting a column solution that is guaranteed to be // between the column lower and upper bounds. // // This method is was introduced for Cgl. Osi developers can // improve performance for their favorite solvers by // overriding this method and providing an implementation that caches // strictColSolution_. //############################################################################# const double * OsiSolverInterface::getStrictColSolution() { const double * colSolution = getColSolution(); const double * colLower = getColLower(); const double * colUpper = getColUpper(); const int numCols = getNumCols(); strictColSolution_.clear(); strictColSolution_.insert(strictColSolution_.end(),colSolution, colSolution+numCols); for (int i=numCols-1; i> 0; --i){ if (colSolution[i] <= colUpper[i]){ if (colSolution[i] >= colLower[i]){ continue; } else { strictColSolution_[i] = colLower[i]; } } else { strictColSolution_[i] = colUpper[i]; } } return &strictColSolution_[0]; } //----------------------------------------------------------------------------- bool OsiSolverInterface::isInteger(int colIndex) const { return !isContinuous(colIndex); } //----------------------------------------------------------------------------- /* Return number of integer variables. OSI implementors really should replace this one, it's generally trivial from within the OSI, but this is the only safe way to do it generically. */ int OsiSolverInterface::getNumIntegers () const { if (numberIntegers_>=0) { // we already know return numberIntegers_; } else { // work out const int numCols = getNumCols() ; int numIntegers = 0 ; for (int i = 0 ; i < numCols ; ++i) { if (!isContinuous(i)) { numIntegers++ ; } } return (numIntegers) ; } } //----------------------------------------------------------------------------- bool OsiSolverInterface::isIntegerNonBinary(int colIndex) const { if ( isInteger(colIndex) && !isBinary(colIndex) ) return true; else return false; } //----------------------------------------------------------------------------- bool OsiSolverInterface::isFreeBinary(int colIndex) const { if ( isContinuous(colIndex) ) return false; const double * cu = getColUpper(); const double * cl = getColLower(); if ( (cu[colIndex]== 1) && (cl[colIndex]== 0) ) return true; else return false; } /* Return array of column length 0 - continuous 1 - binary (may get fixed later) 2 - general integer (may get fixed later) */ const char * OsiSolverInterface::getColType(bool refresh) const { if (!columnType_||refresh) { const int numCols = getNumCols() ; if (!columnType_) columnType_ = new char [numCols]; const double * cu = getColUpper(); const double * cl = getColLower(); for (int i = 0 ; i < numCols ; ++i) { if (!isContinuous(i)) { if ((cu[i]== 1 || cu[i]== 0) && (cl[i]== 0 || cl[i]==1)) columnType_[i]=1; else columnType_[i]=2; } else { columnType_[i]=0; } } } return columnType_; } /* ############################################################################### Built-in methods for problem modification Some of these can surely be reimplemented more efficiently given knowledge of the derived OsiXXX data structures, but we can't make assumptions here. For others, it's less clear. Given standard vector data structures in the underlying OsiXXX, likely the only possible gain is avoiding a method call. ############################################################################### */ void OsiSolverInterface::setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList) { const std::ptrdiff_t cnt = indexLast - indexFirst; for (std::ptrdiff_t i = 0; i < cnt; ++i) { setObjCoeff(indexFirst[i], coeffList[i]); } } //----------------------------------------------------------------------------- void OsiSolverInterface::setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { while (indexFirst != indexLast) { setColBounds(*indexFirst, boundList[0], boundList[1]); ++indexFirst; boundList += 2; } } //----------------------------------------------------------------------------- void OsiSolverInterface::setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { while (indexFirst != indexLast) { setRowBounds(*indexFirst, boundList[0], boundList[1]); ++indexFirst; boundList += 2; } } //----------------------------------------------------------------------------- void OsiSolverInterface::setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList) { while (indexFirst != indexLast) { setRowType(*indexFirst++, *senseList++, *rhsList++, *rangeList++); } } //----------------------------------------------------------------------------- void OsiSolverInterface::setContinuous(const int* indices, int len) { for (int i = 0; i < len; ++i) { setContinuous(indices[i]); } } //----------------------------------------------------------------------------- void OsiSolverInterface::setInteger(const int* indices, int len) { for (int i = 0; i < len; ++i) { setInteger(indices[i]); } } //----------------------------------------------------------------------------- /* Set the objective coefficients for all columns array [getNumCols()] is an array of values for the objective. This defaults to a series of set operations and is here for speed. */ void OsiSolverInterface::setObjective(const double * array) { int n=getNumCols(); for (int i=0;i=0); addCol(number, rows+start, elements+start, collb ? collb[i] : 0.0, colub ? colub[i] : infinity, obj ? obj[i] : 0.0); } } //----------------------------------------------------------------------------- // Add columns from a build object void OsiSolverInterface::addCols(const CoinBuild & buildObject) { assert (buildObject.type()==1); // check correct int number = buildObject.numberColumns(); if (number) { CoinPackedVectorBase ** columns= new CoinPackedVectorBase * [number]; int iColumn; double * objective = new double [number]; double * lower = new double [number]; double * upper = new double [number]; for (iColumn=0;iColumn1.0e30) columnUpper[iColumn]=infinity; if (columnLower[iColumn]<-1.0e30) columnLower[iColumn]=-infinity; } const int * row = matrix.getIndices(); const int * columnLength = matrix.getVectorLengths(); const CoinBigIndex * columnStart = matrix.getVectorStarts(); const double * element = matrix.getElements(); CoinPackedVectorBase ** columns= new CoinPackedVectorBase * [numberColumns2]; assert (columnLower); for (iColumn=0;iColumnmessage(CLP_BAD_STRING_VALUES,messages_) // <message(CLP_COMPLICATED_MODEL,messages_) //<=0); addRow(number, columns+start, elements+start, rowlb ? rowlb[i] : -infinity, rowub ? rowub[i] : infinity); } } void OsiSolverInterface::addRows(const int numrows, const CoinPackedVectorBase* const* rows, const double* rowlb, const double* rowub) { for (int i = 0; i < numrows; ++i) { addRow(*rows[i], rowlb[i], rowub[i]); } } void OsiSolverInterface::addRows(const int numrows, const CoinPackedVectorBase* const* rows, const char* rowsen, const double* rowrhs, const double* rowrng) { for (int i = 0; i < numrows; ++i) { addRow(*rows[i], rowsen[i], rowrhs[i], rowrng[i]); } } //----------------------------------------------------------------------------- void OsiSolverInterface::addRows(const CoinBuild & buildObject) { int number = buildObject.numberRows(); if (number) { CoinPackedVectorBase ** rows= new CoinPackedVectorBase * [number]; int iRow; double * lower = new double [number]; double * upper = new double [number]; for (iRow=0;iRow1.0e30) rowUpper[iRow]=infinity; if (rowLower[iRow]<-1.0e30) rowLower[iRow]=-infinity; } // matrix by rows matrix.reverseOrdering(); const int * column = matrix.getIndices(); const int * rowLength = matrix.getVectorLengths(); const CoinBigIndex * rowStart = matrix.getVectorStarts(); const double * element = matrix.getElements(); CoinPackedVectorBase ** rows= new CoinPackedVectorBase * [numberRows2]; assert (rowLower); for (iRow=0;iRowmessage(CLP_BAD_STRING_VALUES,messages_) // <message(CLP_COMPLICATED_MODEL,messages_) //<1.0e30) columnUpper[iColumn]=infinity; if (columnLower[iColumn]<-1.0e30) columnLower[iColumn]=-infinity; } for (iRow=0;iRow1.0e30) rowUpper[iRow]=infinity; if (rowLower[iRow]<-1.0e30) rowLower[iRow]=-infinity; } CoinWarmStart * ws = getWarmStart(); bool restoreBasis = keepSolution && numberRows&&numberRows==getNumRows()&& numberColumns==getNumCols(); loadProblem(matrix, columnLower, columnUpper, objective, rowLower, rowUpper); setRowColNames(modelObject) ; if (restoreBasis) setWarmStart(ws); delete ws; // Do integers if wanted assert(integerType); for (int iColumn=0;iColumnmessage(CLP_BAD_STRING_VALUES,messages_) // <getApplicationData(); } void OsiSolverInterface::setAuxiliaryInfo(OsiAuxInfo * auxiliaryInfo) { delete appDataEtc_; appDataEtc_ = auxiliaryInfo->clone(); } // Get pointer to auxiliary info object OsiAuxInfo * OsiSolverInterface::getAuxiliaryInfo() const { return appDataEtc_; } //############################################################################# // Methods related to Row Cut Debuggers //############################################################################# //------------------------------------------------------------------- // Activate Row Cut Debugger
    // If the model name passed is on list of known models // then all cuts are checked to see that they do NOT cut // off the known optimal solution. void OsiSolverInterface::activateRowCutDebugger (const char * modelName) { delete rowCutDebugger_; rowCutDebugger_=NULL; // so won't use in new rowCutDebugger_ = new OsiRowCutDebugger(*this,modelName); } /* Activate debugger using full solution array. Only integer values need to be correct. Up to user to get it correct. */ void OsiSolverInterface::activateRowCutDebugger (const double * solution, bool keepContinuous) { delete rowCutDebugger_; rowCutDebugger_=NULL; // so won't use in new rowCutDebugger_ = new OsiRowCutDebugger(*this,solution,keepContinuous); } //------------------------------------------------------------------- // Get Row Cut Debugger
    // If there is a row cut debugger object associated with // model AND if the known optimal solution is within the // current feasible region then a pointer to the object is // returned which may be used to test validity of cuts. // Otherwise NULL is returned const OsiRowCutDebugger * OsiSolverInterface::getRowCutDebugger() const { if (rowCutDebugger_&&rowCutDebugger_->onOptimalPath(*this)) { return rowCutDebugger_; } else { return NULL; } } // If you want to get debugger object even if not on optimal path then use this OsiRowCutDebugger * OsiSolverInterface::getRowCutDebuggerAlways() const { if (rowCutDebugger_&&rowCutDebugger_->active()) { return rowCutDebugger_; } else { return NULL; } } //############################################################################# // Constructors / Destructor / Assignment //############################################################################# //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiSolverInterface::OsiSolverInterface () : rowCutDebugger_(NULL), handler_(NULL), defaultHandler_(true), columnType_(NULL), appDataEtc_(NULL), ws_(NULL) { setInitialData(); } // Set data for default constructor void OsiSolverInterface::setInitialData() { delete rowCutDebugger_; rowCutDebugger_ = NULL; delete ws_; ws_ = NULL; delete appDataEtc_; appDataEtc_ = new OsiAuxInfo(); if (defaultHandler_) { delete handler_; handler_ = NULL; } defaultHandler_=true; delete [] columnType_; columnType_ = NULL; intParam_[OsiMaxNumIteration] = 9999999; intParam_[OsiMaxNumIterationHotStart] = 9999999; intParam_[OsiNameDiscipline] = 0; // Dual objective limit is acceptable `badness'; for minimisation, COIN_DBL_MAX dblParam_[OsiDualObjectiveLimit] = COIN_DBL_MAX; // Primal objective limit is desired `goodness'; for minimisation, -COIN_DBL_MAX dblParam_[OsiPrimalObjectiveLimit] = -COIN_DBL_MAX; dblParam_[OsiDualTolerance] = 1e-6; dblParam_[OsiPrimalTolerance] = 1e-6; dblParam_[OsiObjOffset] = 0.0; strParam_[OsiProbName] = "OsiDefaultName"; strParam_[OsiSolverName] = "Unknown Solver"; handler_ = new CoinMessageHandler(); messages_ = CoinMessage(); // initialize all hints int hint; for (hint=OsiDoPresolveInInitial;hintclone(); if ( rhs.rowCutDebugger_!=NULL ) rowCutDebugger_ = new OsiRowCutDebugger(*rhs.rowCutDebugger_); defaultHandler_ = rhs.defaultHandler_; if (defaultHandler_) { handler_ = new CoinMessageHandler(*rhs.handler_); } else { handler_ = rhs.handler_; } messages_ = CoinMessages(rhs.messages_); CoinDisjointCopyN(rhs.intParam_, OsiLastIntParam, intParam_); CoinDisjointCopyN(rhs.dblParam_, OsiLastDblParam, dblParam_); CoinDisjointCopyN(rhs.strParam_, OsiLastStrParam, strParam_); CoinDisjointCopyN(rhs.hintParam_, OsiLastHintParam, hintParam_); CoinDisjointCopyN(rhs.hintStrength_, OsiLastHintParam, hintStrength_); // objects numberObjects_=rhs.numberObjects_; numberIntegers_=rhs.numberIntegers_; if (numberObjects_) { object_ = new OsiObject * [numberObjects_]; for (int i=0;iclone(); } else { object_=NULL; } // names rowNames_ = rhs.rowNames_ ; colNames_ = rhs.colNames_ ; objName_ = rhs.objName_ ; // NULL as number of columns not known columnType_ = NULL; } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiSolverInterface::~OsiSolverInterface () { // delete debugger - should be safe as only ever returned const delete rowCutDebugger_; rowCutDebugger_ = NULL; delete ws_; ws_ = NULL; delete appDataEtc_; if (defaultHandler_) { delete handler_; handler_ = NULL; } for (int i=0;iclone(); delete rowCutDebugger_; if ( rhs.rowCutDebugger_!=NULL ) rowCutDebugger_ = new OsiRowCutDebugger(*rhs.rowCutDebugger_); else rowCutDebugger_ = NULL; CoinDisjointCopyN(rhs.intParam_, OsiLastIntParam, intParam_); CoinDisjointCopyN(rhs.dblParam_, OsiLastDblParam, dblParam_); CoinDisjointCopyN(rhs.strParam_, OsiLastStrParam, strParam_); CoinDisjointCopyN(rhs.hintParam_, OsiLastHintParam, hintParam_); CoinDisjointCopyN(rhs.hintStrength_, OsiLastHintParam, hintStrength_); delete ws_; ws_ = NULL; if (defaultHandler_) { delete handler_; handler_ = NULL; } defaultHandler_ = rhs.defaultHandler_; if (defaultHandler_) { handler_ = new CoinMessageHandler(*rhs.handler_); } else { handler_ = rhs.handler_; } // objects int i; for (i=0;iclone(); } else { object_=NULL; } // names rowNames_ = rhs.rowNames_ ; colNames_ = rhs.colNames_ ; objName_ = rhs.objName_ ; delete [] columnType_; // NULL as number of columns not known columnType_ = NULL; } return *this; } //----------------------------------------------------------------------------- // Read mps files //----------------------------------------------------------------------------- int OsiSolverInterface::readMps(const char * filename, const char * extension) { CoinMpsIO m; int logLvl = handler_->logLevel() ; if (logLvl > 1) { m.messageHandler()->setLogLevel(handler_->logLevel()) ; } else { m.messageHandler()->setLogLevel(0) ; } m.setInfinity(getInfinity()); int numberErrors = m.readMps(filename,extension); handler_->message(COIN_SOLVER_MPS,messages_) <message(COIN_SOLVER_MPS,messages_) <message(COIN_SOLVER_MPS,messages_) < getObjSense() * dualobjlimit; else return false; } // copy all parameters in this section from one solver to another void OsiSolverInterface::copyParameters(OsiSolverInterface & rhs) { /* We should think about this block of code. appData, rowCutDebugger, and handler_ are not part of the standard parameter data. Arguably copy actions for them belong in the base Osi.clone() or as separate methods. -lh, 091021- */ delete appDataEtc_; appDataEtc_ = rhs.appDataEtc_->clone(); delete rowCutDebugger_; if ( rhs.rowCutDebugger_!=NULL ) rowCutDebugger_ = new OsiRowCutDebugger(*rhs.rowCutDebugger_); else rowCutDebugger_ = NULL; if (defaultHandler_) { delete handler_; } /* Is this correct? Shouldn't we clone a non-default handler instead of simply assigning the pointer? -lh, 091021- */ defaultHandler_ = rhs.defaultHandler_; if (defaultHandler_) { handler_ = new CoinMessageHandler(*rhs.handler_); } else { handler_ = rhs.handler_; } CoinDisjointCopyN(rhs.intParam_, OsiLastIntParam, intParam_); CoinDisjointCopyN(rhs.dblParam_, OsiLastDblParam, dblParam_); CoinDisjointCopyN(rhs.strParam_, OsiLastStrParam, strParam_); CoinDisjointCopyN(rhs.hintParam_, OsiLastHintParam, hintParam_); CoinDisjointCopyN(rhs.hintStrength_, OsiLastHintParam, hintStrength_); } // Resets as if default constructor void OsiSolverInterface::reset() { // Throw an exception throw CoinError("Needs coding for this interface", "reset", "OsiSolverInterface"); } /*Enables normal operation of subsequent functions. This method is supposed to ensure that all typical things (like reduced costs, etc.) are updated when individual pivots are executed and can be queried by other methods. says whether will be doing primal or dual */ void OsiSolverInterface::enableSimplexInterface(bool ) {} //Undo whatever setting changes the above method had to make void OsiSolverInterface::disableSimplexInterface() {} /* Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none */ int OsiSolverInterface::canDoSimplexInterface() const { return 0; } /* Tells solver that calls to getBInv etc are about to take place. Underlying code may need mutable as this may be called from CglCut:;generateCuts which is const. If that is too horrific then each solver e.g. BCP or CBC will have to do something outside main loop. */ void OsiSolverInterface::enableFactorization() const { // Throw an exception throw CoinError("Needs coding for this interface", "enableFactorization", "OsiSolverInterface"); } // and stop void OsiSolverInterface::disableFactorization() const { // Throw an exception throw CoinError("Needs coding for this interface", "disableFactorization", "OsiSolverInterface"); } //Returns true if a basis is available bool OsiSolverInterface::basisIsAvailable() const { return false; } /* (JJF ?date?) The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasis if: 1. OsiWarmStartBasis resize operation is implemented more efficiently and 2. It is ensured that effects on the solver are the same (lh 100818) 1. CoinWarmStartBasis is the relevant resize, and John's right, it needs to be reworked. The problem is that when new columns or rows are added, the new space is initialised two bits at a time. It needs to be done in bulk. There are other problems with CoinWarmStartBasis that should be addressed at the same time. 2. setWarmStart followed by resolve should do it. */ void OsiSolverInterface::getBasisStatus(int* , int* ) const { // Throw an exception throw CoinError("Needs coding for this interface", "getBasisStatus", "OsiSolverInterface"); } /* Set the status of structural/artificial variables and factorize, update solution etc NOTE artificials are treated as +1 elements so for <= rhs artificial will be at lower bound if constraint is tight */ int OsiSolverInterface::setBasisStatus(const int* , const int* ) { // Throw an exception throw CoinError("Needs coding for this interface", "setBasisStatus", "OsiSolverInterface"); } /* Perform a pivot by substituting a colIn for colOut in the basis. The status of the leaving variable is given in statOut. Where 1 is to upper bound, -1 to lower bound */ int OsiSolverInterface::pivot(int , int , int ) { // Throw an exception throw CoinError("Needs coding for this interface", "pivot", "OsiSolverInterface"); } /* Obtain a result of the primal pivot Outputs: colOut -- leaving column, outStatus -- its status, t -- step size, and, if dx!=NULL, *dx -- primal ray direction. Inputs: colIn -- entering column, sign -- direction of its change (+/-1). Both for colIn and colOut, artificial variables are index by the negative of the row index minus 1. Return code (for now): 0 -- leaving variable found, -1 -- everything else? Clearly, more informative set of return values is required Primal and dual solutions are updated */ int OsiSolverInterface::primalPivotResult(int, int , int& , int& , double& , CoinPackedVector* ) { // Throw an exception throw CoinError("Needs coding for this interface", "primalPivotResult", "OsiSolverInterface"); } /* Obtain a result of the dual pivot (similar to the previous method) Differences: entering variable and a sign of its change are now the outputs, the leaving variable and its statuts -- the inputs If dx!=NULL, then *dx contains dual ray Return code: same */ int OsiSolverInterface::dualPivotResult(int& , int& , int , int , double& , CoinPackedVector* ) { // Throw an exception throw CoinError("Needs coding for this interface", "dualPivotResult", "OsiSolverInterface"); } //Get the reduced gradient for the cost vector c void OsiSolverInterface::getReducedGradient(double* , double * , const double * ) const { // Throw an exception throw CoinError("Needs coding for this interface", "getReducedGradient", "OsiSolverInterface"); } //Get a row of the tableau (slack part in slack if not NULL) void OsiSolverInterface::getBInvARow(int , double* , double * ) const { // Throw an exception throw CoinError("Needs coding for this interface", "getBInvARow", "OsiSolverInterface"); } //Get a row of the basis inverse void OsiSolverInterface::getBInvRow(int , double* ) const { // Throw an exception throw CoinError("Needs coding for this interface", "getBInvRow", "OsiSolverInterface"); } //Get a column of the tableau void OsiSolverInterface::getBInvACol(int , double* ) const { // Throw an exception throw CoinError("Needs coding for this interface", "getBInvACol", "OsiSolverInterface"); } //Get a column of the basis inverse void OsiSolverInterface::getBInvCol(int , double* ) const { // Throw an exception throw CoinError("Needs coding for this interface", "getBInvCol", "OsiSolverInterface"); } /* Get warm start information. Return warm start information for the current state of the solver interface. If there is no valid warm start information, an empty warm start object wil be returned. This does not necessarily create an object - may just point to one. must Delete set true if user should delete returned object. OsiClp version always returns pointer and false. */ CoinWarmStart* OsiSolverInterface::getPointerToWarmStart(bool & mustDelete) { mustDelete = true; return getWarmStart(); } /* Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBInvACol() and getBInvCol()). */ void OsiSolverInterface::getBasics(int* ) const { // Throw an exception throw CoinError("Needs coding for this interface", "getBasics", "OsiSolverInterface"); } #ifdef COIN_SNAPSHOT // Fill in a CoinSnapshot CoinSnapshot * OsiSolverInterface::snapshot(bool createArrays) const { CoinSnapshot * snap = new CoinSnapshot(); // scalars snap->setObjSense(getObjSense()); snap->setInfinity(getInfinity()); snap->setObjValue(getObjValue()); double objOffset=0.0; getDblParam(OsiObjOffset,objOffset); snap->setObjOffset(objOffset); snap->setDualTolerance(dblParam_[OsiDualTolerance]); snap->setPrimalTolerance(dblParam_[OsiPrimalTolerance]); snap->setIntegerTolerance(getIntegerTolerance()); snap->setIntegerUpperBound(dblParam_[OsiDualObjectiveLimit]); if (createArrays) { snap->loadProblem(*getMatrixByCol(),getColLower(),getColUpper(), getObjCoefficients(),getRowLower(), getRowUpper()); snap->createRightHandSide(); // Solution snap->setColSolution(getColSolution(),true); snap->setRowPrice(getRowPrice(),true); snap->setReducedCost(getReducedCost(),true); snap->setRowActivity(getRowActivity(),true); } else { snap->setNumCols(getNumCols()); snap->setNumRows(getNumRows()); snap->setNumElements(getNumElements()); snap->setMatrixByCol(getMatrixByCol(),false); snap->setColLower(getColLower(),false); snap->setColUpper(getColUpper(),false); snap->setObjCoefficients(getObjCoefficients(),false); snap->setRowLower(getRowLower(),false); snap->setRowUpper(getRowUpper(),false); // Solution snap->setColSolution(getColSolution(),false); snap->setRowPrice(getRowPrice(),false); snap->setReducedCost(getReducedCost(),false); snap->setRowActivity(getRowActivity(),false); } // If integer then create array (which snapshot has to own); int numberColumns = getNumCols(); char * type = new char[numberColumns]; int numberIntegers=0; for (int i=0;isetColType(type,true); else snap->setNumIntegers(0); delete [] type; return snap; } #endif /* Identify integer variables and create corresponding objects. Record integer variables and create an OsiSimpleInteger object for each one. All existing OsiSimpleInteger objects will be destroyed. New */ void OsiSolverInterface::findIntegers(bool justCount) { numberIntegers_=0; int numberColumns = getNumCols(); int iColumn; for (iColumn=0;iColumn(object_[iObject]) ; if (obj) numberIntegers++; } // if same number return if (numberIntegers_==numberIntegers) return; // space for integers int * marked = new int[numberColumns]; for (iColumn=0;iColumn(oldObject[iObject]) ; if (obj) { iColumn = obj->columnNumber(); assert (iColumn>=0&&iColumn=0) object_[numberObjects_++] = oldObject[iObject]; else object_[numberObjects_++] = new OsiSimpleInteger(this,iColumn); } } // Now append other objects for (iObject = 0;iObject(oldObject[iObject]) ; if (!obj) object_[numberObjects_++] = oldObject[iObject]; } // Delete old array (just array) delete [] oldObject; delete [] marked; } /* Identify integer variables and SOS and create corresponding objects. Record integer variables and create an OsiSimpleInteger object for each one. All existing OsiSimpleInteger objects will be destroyed. If the solver supports SOS then do the same for SOS. If justCount then no objects created and we just store numberIntegers_ Returns number of SOS */ int OsiSolverInterface::findIntegersAndSOS(bool justCount) { findIntegers(justCount); return 0; } // Delete all object information void OsiSolverInterface::deleteObjects() { for (int i=0;i=0 if using existing simple integer and >=numberColumns if using new integer */ int * mark = new int[numberColumns]; int i; for (i=0;i(objects[i]) ; if (obj) { int iColumn = obj->columnNumber(); mark[iColumn]=i+numberColumns; newIntegers++; } } // and existing for (i=0;i(object_[i]) ; if (obj) { int iColumn = obj->columnNumber(); if (mark[iColumn]<0) { newIntegers++; newNumberObjects++; mark[iColumn]=i; } else { // But delete existing delete object_[i]; object_[i]=NULL; } } else { newNumberObjects++; } } numberIntegers_ = newIntegers; OsiObject ** temp = new OsiObject * [newNumberObjects]; // Put integers first newIntegers=0; numberIntegers_=0; for (i=0;i=0) { if (!isInteger(i)) { newIntegers++; setInteger(i); } if (whichclone(); } numberIntegers_++; } } int n=numberIntegers_; // Now rest of old for (i=0;i(object_[i]) ; if (!obj) { temp[n++]=object_[i]; } } } // and rest of new for (i=0;i(objects[i]) ; if (!obj) { temp[n++]=objects[i]->clone(); } } delete [] mark; delete [] object_; object_ = temp; numberObjects_ = newNumberObjects; } // Deletes branching information before columns deleted void OsiSolverInterface::deleteBranchingInfo(int numberDeleted, const int * which) { if (numberObjects_) { int numberColumns = getNumCols(); // mark is -1 if deleted and new number if not deleted int * mark = new int[numberColumns]; int i; int iColumn; for (i=0;i=0&&iColumn=0) { mark[i]=iColumn; iColumn++; } } int oldNumberObjects = numberObjects_; numberIntegers_=0; numberObjects_=0; for (i=0;i(object_[i]) ; if (obj) { iColumn = obj->columnNumber(); int jColumn = mark[iColumn]; if (jColumn>=0) { obj->setColumnNumber(jColumn); object_[numberObjects_++]=obj; numberIntegers_++; } else { delete obj; } } else { // not integer - all I know about is SOS OsiSOS * obj = dynamic_cast (object_[i]) ; if (obj) { int oldNumberMembers=obj->numberMembers(); int numberMembers=0; double * weight = obj->mutableWeights(); int * members = obj->mutableMembers(); for (int k=0;k=0) { members[numberMembers]=jColumn; weight[numberMembers++]=weight[k]; } } if (numberMembers) { obj->setNumberMembers(numberMembers); object_[numberObjects_++]=obj; } } } } delete [] mark; } else { findIntegers(false); } } /* Use current solution to set bounds so current integer feasible solution will stay feasible. Only feasible bounds will be used, even if current solution outside bounds. The amount of such violation will be returned (and if small can be ignored) */ double OsiSolverInterface::forceFeasible() { /* Run through the objects and use feasibleRegion() to set variable bounds so as to fix the variables specified in the objects at their value in this solution. Since the object list contains (at least) one object for every integer variable, this has the effect of fixing all integer variables. */ int i; // Can't guarantee has matrix const OsiBranchingInformation info(this,false,false); double infeasibility=0.0; for (i=0;ifeasibleRegion(this,&info); return infeasibility; } /* For variables currently at bound, fix at bound if reduced cost >= gap Returns number fixed */ int OsiSolverInterface::reducedCostFix(double gap, bool justInteger) { double direction = getObjSense() ; double tolerance; getDblParam(OsiPrimalTolerance,tolerance) ; if (gap<=0.0) return 0; const double *lower = getColLower() ; const double *upper = getColUpper() ; const double *solution = getColSolution() ; const double *reducedCost = getReducedCost() ; int numberFixed = 0 ; int numberColumns = getNumCols(); for (int iColumn = 0 ; iColumn < numberColumns ; iColumn++) { if (isInteger(iColumn)||!justInteger) { double djValue = direction*reducedCost[iColumn] ; if (upper[iColumn]-lower[iColumn] > tolerance) { if (solution[iColumn] < lower[iColumn]+tolerance && djValue > gap) { setColUpper(iColumn,lower[iColumn]) ; numberFixed++ ; } else if (solution[iColumn] > upper[iColumn]-tolerance && -djValue > gap) { setColLower(iColumn,upper[iColumn]) ; numberFixed++ ; } } } } return numberFixed; } #ifdef COIN_FACTORIZATION_INFO // Return number of entries in L part of current factorization CoinBigIndex OsiSolverInterface::getSizeL() const { return -1; } // Return number of entries in U part of current factorization CoinBigIndex OsiSolverInterface::getSizeU() const { return -1; } #endif #ifdef CBC_NEXT_VERSION /* Solve 2**N (N==depth) problems and return solutions and bases. There are N branches each of which changes bounds on both sides as given by branch. The user should provide an array of (empty) results which will be filled in. See OsiSolveResult for more details (in OsiSolveBranch.?pp) but it will include a basis and primal solution. The order of results is left to right at feasible leaf nodes so first one is down, down, ..... Returns number of feasible leaves. Also sets number of solves done and number of iterations. This is provided so a solver can do faster. If forceBranch true then branch done even if satisfied */ int OsiSolverInterface::solveBranches(int depth,const OsiSolverBranch * branch, OsiSolverResult * result, int & numberSolves, int & numberIterations, bool forceBranch) { int * stack = new int [depth]; CoinWarmStart ** basis = new CoinWarmStart * [depth]; int iDepth; for (iDepth=0;iDepth=0) { if (iDepth==0) { // finished finished=true; break; } stack[iDepth]=-1; iDepth--; } if (!finished) { stack[iDepth]=1; } } } delete [] stack; for (iDepth=0;iDepth #include #include "OsiSolverInterface.hpp" #include "CoinLpIO.hpp" #include "CoinMpsIO.hpp" #include "CoinModel.hpp" /* These routines support three name disciplines: 0: No names: No name information is retained. rowNames_ and colNames_ are always vectors of length 0. Requests for individual names will return a name of the form RowNNN or ColNNN, generated on request. 1: Lazy names: Name information supplied by the client is retained. rowNames_ and colNames_ are sized to be large enough to hold names supplied by the client, and no larger. If the client has left holes, those entries will contain a null string. Requests for individual names will return the name supplied by the client, or a generated name. Requests for a vector of names will return a reference to rowNames_ or colNames_, with no modification. This mode is intended for applications like branch-and-cut, where the client is only interested in the original constraint system and could care less about names for generated constraints and variables. The various read[Mps,GMPL,Lp] routines capture the names that are part of the input format. If the client is building from scratch, they'll need to supply the names as they install constraints and variables. 2: Full names: From the client's point of view, this looks exactly like lazy names, except that when a vector of names is requested, the vector is always sized to match the constraint system and all entries have names (either supplied or generated). Internally, full names looks just like lazy names, with the exception that if the client requests one of the name vectors, we generate the full version on the spot and keep it around for further use. This approach sidesteps some ugly implementation issues. The base routines to add a row or column, or load a problem from matrices, are pure virtual. There's just no way to guarantee we can keep the name vectors up-to-date with each modification. Nor do we want to be in the business of generating a name as soon as the row or column appears, only to have our generated name immediately overridden by the client. Arguably these magic numbers should be an enum, but that's not the current OSI style. */ namespace { /* Generate a `name' that's really an error message. A separate routine strictly for standardisation and ease of use. The 'u' code is intended to be used when a routine is expecting one of 'r' or 'c' and saw something else. */ std::string invRowColName (char rcd, int ndx) { std::ostringstream buildName ; buildName << "!!invalid " ; switch (rcd) { case 'r': { buildName << "Row " << ndx << "!!" ; break ; } case 'c': { buildName << "Col " << ndx << "!!" ; break ; } case 'd': { buildName << "Discipline " << ndx << "!!" ; break ; } case 'u': { buildName << "Row/Col " << ndx << "!!" ; break ; } default: { buildName << "!!Internal Confusion!!" ; break ; } } return (buildName.str()) ; } /* Adjust the allocated capacity of the name vectors, if they're sufficiently far off (more than 1000 elements). Use this routine only if you don't need the current contents of the vectors. The `assignment & swap' bit is a trick lifted from Stroustrop 16.3.8 to make sure we really give back some space. */ void reallocRowColNames (OsiSolverInterface::OsiNameVec &rowNames, int m, OsiSolverInterface::OsiNameVec &colNames, int n) { int rowCap = static_cast(rowNames.capacity()) ; int colCap = static_cast(colNames.capacity()) ; if (rowCap-m > 1000) { rowNames.resize(m) ; OsiSolverInterface::OsiNameVec tmp = rowNames ; rowNames.swap(tmp) ; } else if (rowCap < m) { rowNames.reserve(m) ; } assert(rowNames.capacity() >= static_cast(m)) ; if (colCap-n > 1000) { colNames.resize(n) ; OsiSolverInterface::OsiNameVec tmp = colNames ; colNames.swap(tmp) ; } else if (colCap < n) { colNames.reserve(n) ; } assert(colNames.capacity() >= static_cast(n)) ; return ; } /* It's handy to have a 0-length name vector hanging around to use as a return value when the name discipline = auto. Then we don't have to worry about what's actually occupying rowNames_ or colNames_. */ const OsiSolverInterface::OsiNameVec zeroLengthNameVec(0) ; } /* Generate the default RNNNNNNN/CNNNNNNN. This is a separate routine so that it's available to generate names for new rows and columns. If digits is nonzero, it's used, otherwise the default is 7 digits after the initial R or C. If rc = 'o', return the default name for the objective function. Yes, it's true that ndx = m is (by definition) supposed to refer to the objective function. But ... we're often calling this routine to get a name *before* installing the row. Unless you want all your rows to be named OBJECTIVE, something different is needed here. */ std::string OsiSolverInterface::dfltRowColName (char rc, int ndx, unsigned digits) const { std::ostringstream buildName ; if (!(rc == 'r' || rc == 'c' || rc == 'o')) { return (invRowColName('u',ndx)) ; } if (ndx < 0) { return (invRowColName(rc,ndx)) ; } if (digits <= 0) { digits = 7 ; } if (rc == 'o') { std::string dfltObjName = "OBJECTIVE" ; buildName << dfltObjName.substr(0,digits+1) ; } else { buildName << ((rc == 'r')?"R":"C") ; buildName << std::setw(digits) << std::setfill('0') ; buildName << ndx ; } return buildName.str() ; } /* Return the name of the objective function. */ std::string OsiSolverInterface::getObjName (unsigned maxLen) const { std::string name ; if (objName_.length() == 0) { name = dfltRowColName('o',0,maxLen) ; } else { name = objName_.substr(0,maxLen) ; } return (name) ; } /* Return a row name, according to the current name discipline, truncated if necessary. If the row index is out of range, the name becomes an error message. By definition, ndx = getNumRows() (i.e., one greater than the largest valid row index) is the objective function. */ std::string OsiSolverInterface::getRowName (int ndx, unsigned maxLen) const { int nameDiscipline ; std::string name ; /* Check for valid row index. */ int m = getNumRows() ; if (ndx < 0 || ndx > m) { name = invRowColName('r',ndx) ; return (name) ; } /* The objective is kept separately, so we don't always have an entry at index m in the names vector. If no name is set, return the default. */ if (ndx == m) { return (getObjName(maxLen)) ; } /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Find/generate the proper name, based on discipline. */ switch (nameDiscipline) { case 0: { name = dfltRowColName('r',ndx) ; break ; } case 1: case 2: { name = "" ; if (static_cast(ndx) < rowNames_.size()) name = rowNames_[ndx] ; if (name.length() == 0) name = dfltRowColName('r',ndx) ; break ; } default: { name = invRowColName('d',nameDiscipline) ; return (name) ; } } /* Return the (possibly truncated) substring. The default for maxLen is npos (no truncation). */ return (name.substr(0,maxLen)) ; } /* Return the vector of row names. The vector we need depends on the name discipline: 0: return a vector of length 0 1: return rowNames_, no tweaking required 2: Check that rowNames_ is complete. Generate a complete vector on the spot if we need it. */ const OsiSolverInterface::OsiNameVec &OsiSolverInterface::getRowNames () { int nameDiscipline ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Return the proper vector, as described at the head of the routine. If we need to generate a full vector, resize the existing vector and scan, filling in entries as required. */ switch (nameDiscipline) { case 0: { return (zeroLengthNameVec) ; } case 1: { return (rowNames_) ; } case 2: { int m = getNumRows() ; if (rowNames_.size() < static_cast(m+1)) { rowNames_.resize(m+1) ; } for (int i = 0 ; i < m ; i++) { if (rowNames_[i].length() == 0) { rowNames_[i] = dfltRowColName('r',i) ; } } if (rowNames_[m].length() == 0) { rowNames_[m] = getObjName() ; } return (rowNames_) ; } default: { /* quietly fail */ return (zeroLengthNameVec) ; } } /* We should never reach here. */ assert(false) ; return (zeroLengthNameVec) ; } /* Return a column name, according to the current name discipline, truncated if necessary. If the column index is out of range, the name becomes an error message. */ std::string OsiSolverInterface::getColName (int ndx, unsigned maxLen) const { int nameDiscipline ; std::string name ; /* Check for valid column index. */ if (ndx < 0 || ndx >= getNumCols()) { name = invRowColName('c',ndx) ; return (name) ; } /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Find/generate the proper name, based on discipline. */ switch (nameDiscipline) { case 0: { name = dfltRowColName('c',ndx) ; break ; } case 1: case 2: { name = "" ; if (static_cast(ndx) < colNames_.size()) name = colNames_[ndx] ; if (name.length() == 0) name = dfltRowColName('c',ndx) ; break ; } default: { name = invRowColName('d',nameDiscipline) ; return (name) ; } } /* Return the (possibly truncated) substring. The default for maxLen is npos (no truncation). */ return (name.substr(0,maxLen)) ; } /* Return the vector of column names. The vector we need depends on the name discipline: 0: return a vector of length 0 1: return colNames_, no tweaking required 2: Check that colNames_ is complete. Generate a complete vector on the spot if we need it. */ const OsiSolverInterface::OsiNameVec &OsiSolverInterface::getColNames () { int nameDiscipline ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Return the proper vector, as described at the head of the routine. If we need to generate a full vector, resize the existing vector and scan, filling in entries as required. */ switch (nameDiscipline) { case 0: { return (zeroLengthNameVec) ; } case 1: { return (colNames_) ; } case 2: { int n = getNumCols() ; if (colNames_.size() < static_cast(n)) { colNames_.resize(n) ; } for (int j = 0 ; j < n ; j++) { if (colNames_[j].length() == 0) { colNames_[j] = dfltRowColName('c',j) ; } } return (colNames_) ; } default: { /* quietly fail */ return (zeroLengthNameVec) ; } } /* We should never reach here. */ assert(false) ; return (zeroLengthNameVec) ; } /* Set a single row name. Quietly does nothing if the index or name discipline is invalid. */ void OsiSolverInterface::setRowName (int ndx, std::string name) { int nameDiscipline ; /* Quietly do nothing if the index is out of bounds. This should be changed, but what's our error convention, eh? There's no precedent in OsiSolverInterface.cpp. */ if (ndx < 0 || ndx >= getNumRows()) { return ; } /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Do the right thing, according to the discipline. */ switch (nameDiscipline) { case 0: { break ; } case 1: case 2: { if (static_cast(ndx) > rowNames_.capacity()) { rowNames_.resize(ndx+1) ; } else if (static_cast(ndx) >= rowNames_.size()) { rowNames_.resize(ndx+1) ; } rowNames_[ndx] = name ; break ; } default: { break ; } } return ; } /* Set a run of row names. Quietly fail if the specified indices are invalid. On the target side, [tgtStart, tgtStart+len-1] must be in the range [0,m-1], where m is the number of rows. On the source side, srcStart must be zero or greater. If we run off the end of srcNames, we just generate default names. */ void OsiSolverInterface::setRowNames (OsiNameVec &srcNames, int srcStart, int len, int tgtStart) { int nameDiscipline ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* If the name discipline is auto, we're already done. */ if (nameDiscipline == 0) { return ; } /* A little self-protection. Check that we're within [0,m-1] on the target side, and that srcStart is zero or greater. Quietly fail if the indices don't fit. */ int m = getNumRows() ; if (tgtStart < 0 || tgtStart+len > m) { return ; } if (srcStart < 0) { return ; } int srcLen = static_cast(srcNames.size()) ; /* Load 'em up. */ int srcNdx = srcStart ; int tgtNdx = tgtStart ; for ( ; tgtNdx < tgtStart+len ; srcNdx++,tgtNdx++) { if (srcNdx < srcLen) { setRowName(tgtNdx,srcNames[srcNdx]) ; } else { setRowName(tgtNdx,dfltRowColName('r',tgtNdx)) ; } } return ; } /* Delete one or more row names. */ void OsiSolverInterface::deleteRowNames (int tgtStart, int len) { int nameDiscipline ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* If the name discipline is auto, we're done. */ if (nameDiscipline == 0) { return ; } /* Trim the range to names that exist in the name vector. If we're doing lazy names, it's quite likely that we don't need to do any work. */ int lastNdx = static_cast(rowNames_.size()) ; if (tgtStart < 0 || tgtStart >= lastNdx) { return ; } if (tgtStart+len > lastNdx) { len = lastNdx-tgtStart ; } /* Erase the names. */ OsiNameVec::iterator firstIter,lastIter ; firstIter = rowNames_.begin()+tgtStart ; lastIter = firstIter+len ; rowNames_.erase(firstIter,lastIter) ; return ; } /* Set a single column name. Quietly does nothing if the index or name discipline is invalid. */ void OsiSolverInterface::setColName (int ndx, std::string name) { int nameDiscipline ; /* Quietly do nothing if the index is out of bounds. This should be changed, but what's our error convention, eh? There's no precedent in OsiSolverInterface.cpp. */ if (ndx < 0 || ndx >= getNumCols()) { return ; } /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Do the right thing, according to the discipline. */ switch (nameDiscipline) { case 0: { break ; } case 1: case 2: { if (static_cast(ndx) > colNames_.capacity()) { colNames_.resize(ndx+1) ; } else if (static_cast(ndx) >= colNames_.size()) { colNames_.resize(ndx+1) ; } colNames_[ndx] = name ; break ; } default: { break ; } } return ; } /* Set a run of column names. Quietly fail if the specified indices are invalid. On the target side, [tgtStart, tgtStart+len-1] must be in the range [0,n-1], where n is the number of columns. On the source side, srcStart must be zero or greater. If we run off the end of srcNames, we just generate default names. */ void OsiSolverInterface::setColNames (OsiNameVec &srcNames, int srcStart, int len, int tgtStart) { int nameDiscipline ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* If the name discipline is auto, we're already done. */ if (nameDiscipline == 0) { return ; } /* A little self-protection. Check that we're within [0,m-1] on the target side, and that srcStart is zero or greater. Quietly fail if the indices don't fit. */ int n = getNumCols() ; if (tgtStart < 0 || tgtStart+len > n) { return ; } if (srcStart < 0) { return ; } int srcLen = static_cast(srcNames.size()) ; /* Load 'em up. */ int srcNdx = srcStart ; int tgtNdx = tgtStart ; for ( ; tgtNdx < tgtStart+len ; srcNdx++,tgtNdx++) { if (srcNdx < srcLen) { setColName(tgtNdx,srcNames[srcNdx]) ; } else { setColName(tgtNdx,dfltRowColName('c',tgtNdx)) ; } } return ; } /* Delete one or more column names. Quietly fail if firstNdx is less than zero or if firstNdx+len is greater than the number of columns. */ void OsiSolverInterface::deleteColNames (int tgtStart, int len) { int nameDiscipline ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* If the name discipline is auto, we're done. */ if (nameDiscipline == 0) { return ; } /* Trim the range to names that exist in the name vector. If we're doing lazy names, it's quite likely that we don't need to do any work. */ int lastNdx = static_cast(colNames_.size()) ; if (tgtStart < 0 || tgtStart >= lastNdx) { return ; } if (tgtStart+len > lastNdx) { len = lastNdx-tgtStart ; } /* Erase the names. */ OsiNameVec::iterator firstIter,lastIter ; firstIter = colNames_.begin()+tgtStart ; lastIter = firstIter+len ; colNames_.erase(firstIter,lastIter) ; return ; } /* Install the name information from a CoinMpsIO object. */ void OsiSolverInterface::setRowColNames (const CoinMpsIO &mps) { int nameDiscipline,m,n ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Whatever happens, we're about to clean out the current name vectors. Decide on an appropriate size and call reallocRowColNames to adjust capacity. */ if (nameDiscipline == 0) { m = 0 ; n = 0 ; } else { m = mps.getNumRows() ; n = mps.getNumCols() ; } reallocRowColNames(rowNames_,m,colNames_,n) ; /* If name discipline is auto, we're done already. Otherwise, load 'em up. If I understand MPS correctly, names are required. */ if (nameDiscipline != 0) { rowNames_.resize(m) ; for (int i = 0 ; i < m ; i++) { rowNames_[i] = mps.rowName(i) ; } objName_ = mps.getObjectiveName() ; colNames_.resize(n) ; for (int j = 0 ; j < n ; j++) { colNames_[j] = mps.columnName(j) ; } } return ; } /* Install the name information from a CoinModel object. CoinModel does not maintain a name for the objective function (in fact, it has no concept of objective function). */ void OsiSolverInterface::setRowColNames (CoinModel &mod) { int nameDiscipline,m,n ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Whatever happens, we're about to clean out the current name vectors. Decide on an appropriate size and call reallocRowColNames to adjust capacity. */ if (nameDiscipline == 0) { m = 0 ; n = 0 ; } else { m = mod.rowNames()->numberItems() ; n = mod.columnNames()->numberItems() ; } reallocRowColNames(rowNames_,m,colNames_,n) ; /* If name discipline is auto, we're done already. Otherwise, load 'em up. As best I can see, there's no guarantee that we'll have names for all rows and columns, so we need to pay attention. */ if (nameDiscipline != 0) { int maxRowNdx=-1, maxColNdx=-1 ; const char *const *names = mod.rowNames()->names() ; rowNames_.resize(m) ; for (int i = 0 ; i < m ; i++) { std::string nme = names[i] ; if (nme.length() == 0) { if (nameDiscipline == 2) { nme = dfltRowColName('r',i) ; } } if (nme.length() > 0) { maxRowNdx = i ; } rowNames_[i] = nme ; } rowNames_.resize(maxRowNdx+1) ; names = mod.columnNames()->names() ; colNames_.resize(n) ; for (int j = 0 ; j < n ; j++) { std::string nme = names[j] ; if (nme.length() == 0) { if (nameDiscipline == 2) { nme = dfltRowColName('c',j) ; } } if (nme.length() > 0) { maxColNdx = j ; } colNames_[j] = nme ; } colNames_.resize(maxColNdx+1) ; } /* And we're done. */ return ; } /* Install the name information from a CoinLpIO object. Nearly identical to the previous routine, but we start from a different object. */ void OsiSolverInterface::setRowColNames (CoinLpIO &mod) { int nameDiscipline,m,n ; /* Determine how we're handling names. It's possible that the underlying solver has overridden getIntParam, but doesn't recognise OsiNameDiscipline. In that case, we want to default to auto names */ bool recognisesOsiNames = getIntParam(OsiNameDiscipline,nameDiscipline) ; if (recognisesOsiNames == false) { nameDiscipline = 0 ; } /* Whatever happens, we're about to clean out the current name vectors. Decide on an appropriate size and call reallocRowColNames to adjust capacity. */ if (nameDiscipline == 0) { m = 0 ; n = 0 ; } else { m = mod.getNumRows() ; n = mod.getNumCols() ; } reallocRowColNames(rowNames_,m,colNames_,n) ; /* If name discipline is auto, we're done already. Otherwise, load 'em up. I have no idea whether we can guarantee valid names for all rows and columns, so we need to pay attention. */ if (nameDiscipline != 0) { int maxRowNdx=-1, maxColNdx=-1 ; const char *const *names = mod.getRowNames() ; rowNames_.resize(m) ; for (int i = 0 ; i < m ; i++) { std::string nme = names[i] ; if (nme.length() == 0) { if (nameDiscipline == 2) { nme = dfltRowColName('r',i) ; } } if (nme.length() > 0) { maxRowNdx = i ; } rowNames_[i] = nme ; } rowNames_.resize(maxRowNdx+1) ; objName_ = mod.getObjName() ; names = mod.getColNames() ; colNames_.resize(n) ; for (int j = 0 ; j < n ; j++) { std::string nme = names[j] ; if (nme.length() == 0) { if (nameDiscipline == 2) { nme = dfltRowColName('c',j) ; } } if (nme.length() > 0) { maxColNdx = j ; } colNames_[j] = nme ; } colNames_.resize(maxColNdx+1) ; } /* And we're done. */ return ; } Osi-0.106.4/src/Osi/OsiChooseVariable.hpp0000644000076600007660000004552612101340333016467 0ustar coincoin// Copyright (C) 2006, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiChooseVariable_H #define OsiChooseVariable_H #include #include #include "CoinWarmStartBasis.hpp" #include "OsiBranchingObject.hpp" class OsiSolverInterface; class OsiHotInfo; /** This class chooses a variable to branch on The base class just chooses the variable and direction without strong branching but it has information which would normally be used by strong branching e.g. to re-enter having fixed a variable but using same candidates for strong branching. The flow is : a) initialize the process. This decides on strong branching list and stores indices of all infeasible objects b) do strong branching on list. If list is empty then just choose one candidate and return without strong branching. If not empty then go through list and return best. However we may find that the node is infeasible or that we can fix a variable. If so we return and it is up to user to call again (after fixing a variable). */ class OsiChooseVariable { public: /// Default Constructor OsiChooseVariable (); /// Constructor from solver (so we can set up arrays etc) OsiChooseVariable (const OsiSolverInterface * solver); /// Copy constructor OsiChooseVariable (const OsiChooseVariable &); /// Assignment operator OsiChooseVariable & operator= (const OsiChooseVariable& rhs); /// Clone virtual OsiChooseVariable * clone() const; /// Destructor virtual ~OsiChooseVariable (); /** Sets up strong list and clears all if initialize is true. Returns number of infeasibilities. If returns -1 then has worked out node is infeasible! */ virtual int setupList ( OsiBranchingInformation *info, bool initialize); /** Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfied - no candidate 2 We can change the bound on a variable - but we also have a strong branching candidate 3 We can change the bound on a variable - but we have a non-strong branching candidate 4 We can change the bound on a variable - no other candidates We can pick up branch from bestObjectIndex() and bestWhichWay() We can pick up a forced branch (can change bound) from firstForcedObjectIndex() and firstForcedWhichWay() If we have a solution then we can pick up from goodObjectiveValue() and goodSolution() If fixVariables is true then 2,3,4 are all really same as problem changed */ virtual int chooseVariable( OsiSolverInterface * solver, OsiBranchingInformation *info, bool fixVariables); /// Returns true if solution looks feasible against given objects virtual bool feasibleSolution(const OsiBranchingInformation * info, const double * solution, int numberObjects, const OsiObject ** objects); /// Saves a good solution void saveSolution(const OsiSolverInterface * solver); /// Clears out good solution after use void clearGoodSolution(); /// Given a candidate fill in useful information e.g. estimates virtual void updateInformation( const OsiBranchingInformation *info, int branch, OsiHotInfo * hotInfo); #if 1 /// Given a branch fill in useful information e.g. estimates virtual void updateInformation( int whichObject, int branch, double changeInObjective, double changeInValue, int status); #endif /// Objective value for feasible solution inline double goodObjectiveValue() const { return goodObjectiveValue_;} /// Estimate of up change or change on chosen if n-way inline double upChange() const { return upChange_;} /// Estimate of down change or max change on other possibilities if n-way inline double downChange() const { return downChange_;} /// Good solution - deleted by finalize inline const double * goodSolution() const { return goodSolution_;} /// Index of chosen object inline int bestObjectIndex() const { return bestObjectIndex_;} /// Set index of chosen object inline void setBestObjectIndex(int value) { bestObjectIndex_ = value;} /// Preferred way of chosen object inline int bestWhichWay() const { return bestWhichWay_;} /// Set preferred way of chosen object inline void setBestWhichWay(int value) { bestWhichWay_ = value;} /// Index of forced object inline int firstForcedObjectIndex() const { return firstForcedObjectIndex_;} /// Set index of forced object inline void setFirstForcedObjectIndex(int value) { firstForcedObjectIndex_ = value;} /// Preferred way of forced object inline int firstForcedWhichWay() const { return firstForcedWhichWay_;} /// Set preferred way of forced object inline void setFirstForcedWhichWay(int value) { firstForcedWhichWay_ = value;} /// Get the number of objects unsatisfied at this node - accurate on first pass inline int numberUnsatisfied() const {return numberUnsatisfied_;} /// Number of objects to choose for strong branching inline int numberStrong() const { return numberStrong_;} /// Set number of objects to choose for strong branching inline void setNumberStrong(int value) { numberStrong_ = value;} /// Number left on strong list inline int numberOnList() const { return numberOnList_;} /// Number of strong branches actually done inline int numberStrongDone() const { return numberStrongDone_;} /// Number of strong iterations actually done inline int numberStrongIterations() const { return numberStrongIterations_;} /// Number of strong branches which changed bounds inline int numberStrongFixed() const { return numberStrongFixed_;} /// List of candidates inline const int * candidates() const { return list_;} /// Trust results from strong branching for changing bounds inline bool trustStrongForBound() const { return trustStrongForBound_;} /// Set trust results from strong branching for changing bounds inline void setTrustStrongForBound(bool yesNo) { trustStrongForBound_ = yesNo;} /// Trust results from strong branching for valid solution inline bool trustStrongForSolution() const { return trustStrongForSolution_;} /// Set trust results from strong branching for valid solution inline void setTrustStrongForSolution(bool yesNo) { trustStrongForSolution_ = yesNo;} /// Set solver and redo arrays void setSolver (const OsiSolverInterface * solver); /** Return status - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfied - no candidate 2 We can change the bound on a variable - but we also have a strong branching candidate 3 We can change the bound on a variable - but we have a non-strong branching candidate 4 We can change the bound on a variable - no other candidates We can pick up branch from bestObjectIndex() and bestWhichWay() We can pick up a forced branch (can change bound) from firstForcedObjectIndex() and firstForcedWhichWay() If we have a solution then we can pick up from goodObjectiveValue() and goodSolution() */ inline int status() const { return status_;} inline void setStatus(int value) { status_ = value;} protected: // Data /// Objective value for feasible solution double goodObjectiveValue_; /// Estimate of up change or change on chosen if n-way double upChange_; /// Estimate of down change or max change on other possibilities if n-way double downChange_; /// Good solution - deleted by finalize double * goodSolution_; /// List of candidates int * list_; /// Useful array (for sorting etc) double * useful_; /// Pointer to solver const OsiSolverInterface * solver_; /* Status - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfied - no candidate 2 We can change the bound on a variable - but we also have a strong branching candidate 3 We can change the bound on a variable - but we have a non-strong branching candidate 4 We can change the bound on a variable - no other candidates */ int status_; /// Index of chosen object int bestObjectIndex_; /// Preferred way of chosen object int bestWhichWay_; /// Index of forced object int firstForcedObjectIndex_; /// Preferred way of forced object int firstForcedWhichWay_; /// The number of objects unsatisfied at this node. int numberUnsatisfied_; /// Number of objects to choose for strong branching int numberStrong_; /// Number left on strong list int numberOnList_; /// Number of strong branches actually done int numberStrongDone_; /// Number of strong iterations actually done int numberStrongIterations_; /// Number of bound changes due to strong branching int numberStrongFixed_; /// List of unsatisfied objects - first numberOnList_ for strong branching /// Trust results from strong branching for changing bounds bool trustStrongForBound_; /// Trust results from strong branching for valid solution bool trustStrongForSolution_; }; /** This class is the placeholder for the pseudocosts used by OsiChooseStrong. It can also be used by any other pseudocost based strong branching algorithm. */ class OsiPseudoCosts { protected: // Data /// Total of all changes up double * upTotalChange_; /// Total of all changes down double * downTotalChange_; /// Number of times up int * upNumber_; /// Number of times down int * downNumber_; /// Number of objects (could be found from solver) int numberObjects_; /// Number before we trust int numberBeforeTrusted_; private: void gutsOfDelete(); void gutsOfCopy(const OsiPseudoCosts& rhs); public: OsiPseudoCosts(); virtual ~OsiPseudoCosts(); OsiPseudoCosts(const OsiPseudoCosts& rhs); OsiPseudoCosts& operator=(const OsiPseudoCosts& rhs); /// Number of times before trusted inline int numberBeforeTrusted() const { return numberBeforeTrusted_; } /// Set number of times before trusted inline void setNumberBeforeTrusted(int value) { numberBeforeTrusted_ = value; } /// Initialize the pseudocosts with n entries void initialize(int n); /// Give the number of objects for which pseudo costs are stored inline int numberObjects() const { return numberObjects_; } /** @name Accessor methods to pseudo costs data */ //@{ inline double* upTotalChange() { return upTotalChange_; } inline const double* upTotalChange() const { return upTotalChange_; } inline double* downTotalChange() { return downTotalChange_; } inline const double* downTotalChange() const { return downTotalChange_; } inline int* upNumber() { return upNumber_; } inline const int* upNumber() const { return upNumber_; } inline int* downNumber() { return downNumber_; } inline const int* downNumber() const { return downNumber_; } //@} /// Given a candidate fill in useful information e.g. estimates virtual void updateInformation(const OsiBranchingInformation *info, int branch, OsiHotInfo * hotInfo); #if 1 /// Given a branch fill in useful information e.g. estimates virtual void updateInformation( int whichObject, int branch, double changeInObjective, double changeInValue, int status); #endif }; /** This class chooses a variable to branch on This chooses the variable and direction with reliability strong branching. The flow is : a) initialize the process. This decides on strong branching list and stores indices of all infeasible objects b) do strong branching on list. If list is empty then just choose one candidate and return without strong branching. If not empty then go through list and return best. However we may find that the node is infeasible or that we can fix a variable. If so we return and it is up to user to call again (after fixing a variable). */ class OsiChooseStrong : public OsiChooseVariable { public: /// Default Constructor OsiChooseStrong (); /// Constructor from solver (so we can set up arrays etc) OsiChooseStrong (const OsiSolverInterface * solver); /// Copy constructor OsiChooseStrong (const OsiChooseStrong &); /// Assignment operator OsiChooseStrong & operator= (const OsiChooseStrong& rhs); /// Clone virtual OsiChooseVariable * clone() const; /// Destructor virtual ~OsiChooseStrong (); /** Sets up strong list and clears all if initialize is true. Returns number of infeasibilities. If returns -1 then has worked out node is infeasible! */ virtual int setupList ( OsiBranchingInformation *info, bool initialize); /** Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfied - no candidate 2 We can change the bound on a variable - but we also have a strong branching candidate 3 We can change the bound on a variable - but we have a non-strong branching candidate 4 We can change the bound on a variable - no other candidates We can pick up branch from bestObjectIndex() and bestWhichWay() We can pick up a forced branch (can change bound) from firstForcedObjectIndex() and firstForcedWhichWay() If we have a solution then we can pick up from goodObjectiveValue() and goodSolution() If fixVariables is true then 2,3,4 are all really same as problem changed */ virtual int chooseVariable( OsiSolverInterface * solver, OsiBranchingInformation *info, bool fixVariables); /** Pseudo Shadow Price mode 0 - off 1 - use if no strong info 2 - use if strong not trusted 3 - use even if trusted */ inline int shadowPriceMode() const { return shadowPriceMode_;} /// Set Shadow price mode inline void setShadowPriceMode(int value) { shadowPriceMode_ = value;} /** Accessor method to pseudo cost object*/ const OsiPseudoCosts& pseudoCosts() const { return pseudoCosts_; } /** Accessor method to pseudo cost object*/ OsiPseudoCosts& pseudoCosts() { return pseudoCosts_; } /** A feww pass-through methods to access members of pseudoCosts_ as if they were members of OsiChooseStrong object */ inline int numberBeforeTrusted() const { return pseudoCosts_.numberBeforeTrusted(); } inline void setNumberBeforeTrusted(int value) { pseudoCosts_.setNumberBeforeTrusted(value); } inline int numberObjects() const { return pseudoCosts_.numberObjects(); } protected: /** This is a utility function which does strong branching on a list of objects and stores the results in OsiHotInfo.objects. On entry the object sequence is stored in the OsiHotInfo object and maybe more. It returns - -1 - one branch was infeasible both ways 0 - all inspected - nothing can be fixed 1 - all inspected - some can be fixed (returnCriterion==0) 2 - may be returning early - one can be fixed (last one done) (returnCriterion==1) 3 - returning because max time */ int doStrongBranching( OsiSolverInterface * solver, OsiBranchingInformation *info, int numberToDo, int returnCriterion); /** Clear out the results array */ void resetResults(int num); protected: /** Pseudo Shadow Price mode 0 - off 1 - use and multiply by strong info 2 - use */ int shadowPriceMode_; /** The pseudo costs for the chooser */ OsiPseudoCosts pseudoCosts_; /** The results of the strong branching done on the candidates where the pseudocosts were not sufficient */ OsiHotInfo* results_; /** The number of OsiHotInfo objetcs that contain information */ int numResults_; }; /** This class contains the result of strong branching on a variable When created it stores enough information for strong branching */ class OsiHotInfo { public: /// Default Constructor OsiHotInfo (); /// Constructor from useful information OsiHotInfo ( OsiSolverInterface * solver, const OsiBranchingInformation *info, const OsiObject * const * objects, int whichObject); /// Copy constructor OsiHotInfo (const OsiHotInfo &); /// Assignment operator OsiHotInfo & operator= (const OsiHotInfo& rhs); /// Clone virtual OsiHotInfo * clone() const; /// Destructor virtual ~OsiHotInfo (); /** Fill in useful information after strong branch. Return status */ int updateInformation( const OsiSolverInterface * solver, const OsiBranchingInformation * info, OsiChooseVariable * choose); /// Original objective value inline double originalObjectiveValue() const { return originalObjectiveValue_;} /// Up change - invalid if n-way inline double upChange() const { assert (branchingObject_->numberBranches()==2); return changes_[1];} /// Down change - invalid if n-way inline double downChange() const { assert (branchingObject_->numberBranches()==2); return changes_[0];} /// Set up change - invalid if n-way inline void setUpChange(double value) { assert (branchingObject_->numberBranches()==2); changes_[1] = value;} /// Set down change - invalid if n-way inline void setDownChange(double value) { assert (branchingObject_->numberBranches()==2); changes_[0] = value;} /// Change on way k inline double change(int k) const { return changes_[k];} /// Up iteration count - invalid if n-way inline int upIterationCount() const { assert (branchingObject_->numberBranches()==2); return iterationCounts_[1];} /// Down iteration count - invalid if n-way inline int downIterationCount() const { assert (branchingObject_->numberBranches()==2); return iterationCounts_[0];} /// Iteration count on way k inline int iterationCount(int k) const { return iterationCounts_[k];} /// Up status - invalid if n-way inline int upStatus() const { assert (branchingObject_->numberBranches()==2); return statuses_[1];} /// Down status - invalid if n-way inline int downStatus() const { assert (branchingObject_->numberBranches()==2); return statuses_[0];} /// Set up status - invalid if n-way inline void setUpStatus(int value) { assert (branchingObject_->numberBranches()==2); statuses_[1] = value;} /// Set down status - invalid if n-way inline void setDownStatus(int value) { assert (branchingObject_->numberBranches()==2); statuses_[0] = value;} /// Status on way k inline int status(int k) const { return statuses_[k];} /// Branching object inline OsiBranchingObject * branchingObject() const { return branchingObject_;} inline int whichObject() const { return whichObject_;} protected: // Data /// Original objective value double originalObjectiveValue_; /// Objective changes double * changes_; /// Iteration counts int * iterationCounts_; /** Status -1 - not done 0 - feasible and finished 1 - infeasible 2 - not finished */ int * statuses_; /// Branching object OsiBranchingObject * branchingObject_; /// Which object on list int whichObject_; }; #endif Osi-0.106.4/src/Osi/OsiSolverBranch.cpp0000644000076600007660000003425611552534623016202 0ustar coincoin// Copyright (C) 2005, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #if defined(_MSC_VER) // Turn off compiler warning about long names # pragma warning(disable:4786) #endif #include "CoinHelperFunctions.hpp" #include "CoinWarmStartBasis.hpp" #include "OsiConfig.h" #include "CoinFinite.hpp" #include "OsiSolverInterface.hpp" #include "OsiSolverBranch.hpp" #include #include #include //############################################################################# // Constructors / Destructor / Assignment //############################################################################# //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiSolverBranch::OsiSolverBranch () : indices_(NULL), bound_(NULL) { memset(start_,0,sizeof(start_)); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiSolverBranch::OsiSolverBranch (const OsiSolverBranch & rhs) { memcpy(start_,rhs.start_,sizeof(start_)); int size = start_[4]; if (size) { indices_ = CoinCopyOfArray(rhs.indices_,size); bound_ = CoinCopyOfArray(rhs.bound_,size); } else { indices_=NULL; bound_=NULL; } } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiSolverBranch::~OsiSolverBranch () { delete [] indices_; delete [] bound_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiSolverBranch & OsiSolverBranch::operator=(const OsiSolverBranch& rhs) { if (this != &rhs) { delete [] indices_; delete [] bound_; memcpy(start_,rhs.start_,sizeof(start_)); int size = start_[4]; if (size) { indices_ = CoinCopyOfArray(rhs.indices_,size); bound_ = CoinCopyOfArray(rhs.bound_,size); } else { indices_=NULL; bound_=NULL; } } return *this; } //----------------------------------------------------------------------------- // add simple branch //----------------------------------------------------------------------------- void OsiSolverBranch::addBranch(int iColumn, double value) { delete [] indices_; delete [] bound_; indices_ = new int[2]; bound_ = new double[2]; indices_[0]=iColumn; indices_[1]=iColumn; start_[0]=0; start_[1]=0; start_[2]=1; bound_[0]=floor(value); start_[3]=2; bound_[1]=ceil(value); start_[4]=2; assert (bound_[0]!=bound_[1]); } //----------------------------------------------------------------------------- // Add bounds - way =-1 is first , +1 is second //----------------------------------------------------------------------------- void OsiSolverBranch::addBranch(int way,int numberTighterLower, const int * whichLower, const double * newLower, int numberTighterUpper, const int * whichUpper, const double * newUpper) { assert (way==-1||way==1); int numberNew = numberTighterLower+numberTighterUpper; int base = way+1; // will be 0 or 2 int numberNow = start_[4-base]-start_[2-base]; int * tempI = new int[numberNow+numberNew]; double * tempD = new double[numberNow+numberNew]; int putNew = (way==-1) ? 0 : start_[2]; int putNow = (way==-1) ? numberNew : 0; memcpy(tempI+putNow,indices_+start_[2-base],numberNow*sizeof(int)); memcpy(tempD+putNow,bound_+start_[2-base],numberNow*sizeof(double)); memcpy(tempI+putNew,whichLower,numberTighterLower*sizeof(int)); memcpy(tempD+putNew,newLower,numberTighterLower*sizeof(double)); putNew += numberTighterLower; memcpy(tempI+putNew,whichUpper,numberTighterUpper*sizeof(int)); memcpy(tempD+putNew,newUpper,numberTighterUpper*sizeof(double)); delete [] indices_; indices_ = tempI; delete [] bound_; bound_ = tempD; int numberOldLower = start_[3-base]-start_[2-base]; int numberOldUpper = start_[4-base]-start_[3-base]; start_[0]=0; if (way==-1) { start_[1] = numberTighterLower; start_[2] = start_[1] + numberTighterUpper; start_[3] = start_[2] + numberOldLower; start_[4] = start_[3] + numberOldUpper; } else { start_[1] = numberOldLower; start_[2] = start_[1] + numberOldUpper; start_[3] = start_[2] + numberTighterLower; start_[4] = start_[3] + numberTighterUpper; } } //----------------------------------------------------------------------------- // Add bounds - way =-1 is first , +1 is second //----------------------------------------------------------------------------- void OsiSolverBranch::addBranch(int way,int numberColumns, const double * oldLower, const double * newLower2, const double * oldUpper, const double * newUpper2) { assert (way==-1||way==1); // find int i; int * whichLower = new int[numberColumns]; double * newLower = new double[numberColumns]; int numberTighterLower=0; for (i=0;ioldLower[i]) { whichLower[numberTighterLower]=i; newLower[numberTighterLower++]=newLower2[i]; } } int * whichUpper = new int[numberColumns]; double * newUpper = new double[numberColumns]; int numberTighterUpper=0; for (i=0;ivalue+primalTolerance) { feasible=false; break; } } else { abort(); // do later (other stuff messed up anyway - e.g. CBC) } } if (feasible) break; // OK this way } return feasible; } //############################################################################# // Constructors / Destructor / Assignment //############################################################################# //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiSolverResult::OsiSolverResult () : objectiveValue_(COIN_DBL_MAX), primalSolution_(NULL), dualSolution_(NULL) { } //------------------------------------------------------------------- // Constructor from solver //------------------------------------------------------------------- OsiSolverResult::OsiSolverResult (const OsiSolverInterface & solver,const double * lowerBefore, const double * upperBefore) : objectiveValue_(COIN_DBL_MAX), primalSolution_(NULL), dualSolution_(NULL) { if (solver.isProvenOptimal()&&!solver.isDualObjectiveLimitReached()) { objectiveValue_ = solver.getObjValue()*solver.getObjSense(); CoinWarmStartBasis * basis = dynamic_cast (solver.getWarmStart()); assert (basis); basis_ = * basis; delete basis; int numberRows = basis_.getNumArtificial(); int numberColumns = basis_.getNumStructural(); assert (numberColumns==solver.getNumCols()); assert (numberRows==solver.getNumRows()); primalSolution_ = CoinCopyOfArray(solver.getColSolution(),numberColumns); dualSolution_ = CoinCopyOfArray(solver.getRowPrice(),numberRows); fixed_.addBranch(-1,numberColumns,lowerBefore,solver.getColLower(), upperBefore,solver.getColUpper()); } } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiSolverResult::OsiSolverResult (const OsiSolverResult & rhs) { objectiveValue_ = rhs.objectiveValue_; basis_ = rhs.basis_; fixed_ = rhs.fixed_; int numberRows = basis_.getNumArtificial(); int numberColumns = basis_.getNumStructural(); if (numberColumns) { primalSolution_ = CoinCopyOfArray(rhs.primalSolution_,numberColumns); dualSolution_ = CoinCopyOfArray(rhs.dualSolution_,numberRows); } else { primalSolution_=NULL; dualSolution_=NULL; } } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiSolverResult::~OsiSolverResult () { delete [] primalSolution_; delete [] dualSolution_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiSolverResult & OsiSolverResult::operator=(const OsiSolverResult& rhs) { if (this != &rhs) { delete [] primalSolution_; delete [] dualSolution_; objectiveValue_ = rhs.objectiveValue_; basis_ = rhs.basis_; fixed_ = rhs.fixed_; int numberRows = basis_.getNumArtificial(); int numberColumns = basis_.getNumStructural(); if (numberColumns) { primalSolution_ = CoinCopyOfArray(rhs.primalSolution_,numberColumns); dualSolution_ = CoinCopyOfArray(rhs.dualSolution_,numberRows); } else { primalSolution_=NULL; dualSolution_=NULL; } } return *this; } // Create result void OsiSolverResult::createResult(const OsiSolverInterface & solver, const double * lowerBefore, const double * upperBefore) { delete [] primalSolution_; delete [] dualSolution_; if (solver.isProvenOptimal()&&!solver.isDualObjectiveLimitReached()) { objectiveValue_ = solver.getObjValue()*solver.getObjSense(); CoinWarmStartBasis * basis = dynamic_cast (solver.getWarmStart()); assert (basis); basis_ = * basis; int numberRows = basis_.getNumArtificial(); int numberColumns = basis_.getNumStructural(); assert (numberColumns==solver.getNumCols()); assert (numberRows==solver.getNumRows()); primalSolution_ = CoinCopyOfArray(solver.getColSolution(),numberColumns); dualSolution_ = CoinCopyOfArray(solver.getRowPrice(),numberRows); fixed_.addBranch(-1,numberColumns,lowerBefore,solver.getColLower(), upperBefore,solver.getColUpper()); } else { // infeasible objectiveValue_ = COIN_DBL_MAX; basis_ = CoinWarmStartBasis();; primalSolution_=NULL; dualSolution_=NULL; } } // Restore result void OsiSolverResult::restoreResult(OsiSolverInterface & solver) const { //solver.setObjValue(objectiveValue_)*solver.getObjSense(); solver.setWarmStart(&basis_); solver.setColSolution(primalSolution_); solver.setRowPrice(dualSolution_); fixed_.applyBounds(solver,-1); } Osi-0.106.4/src/Osi/OsiRowCutDebugger.hpp0000644000076600007660000001373111575423733016506 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiRowCutDebugger_H #define OsiRowCutDebugger_H /*! \file OsiRowCutDebugger.hpp \brief Provides a facility to validate cut constraints to ensure that they do not cut off a given solution. */ #include #include "OsiCuts.hpp" #include "OsiSolverInterface.hpp" /*! \brief Validate cuts against a known solution OsiRowCutDebugger provides a facility for validating cuts against a known solution for a problem. The debugger knows an optimal solution for many of the miplib3 problems. Check the source for #activate(const OsiSolverInterface&,const char*) in OsiRowCutDebugger.cpp for the full set of known problems. A full solution vector can be supplied as a parameter with (#activate(const OsiSolverInterface&,const double*,bool)). Only the integer values need to be valid. The default behaviour is to solve an lp relaxation with the integer variables fixed to the specified values and use the optimal solution to fill in the continuous variables in the solution. The debugger can be instructed to preserve the continuous variables (useful when debugging solvers where the linear relaxation doesn't capture all the constraints). Note that the solution must match the problem held in the solver interface. If you want to use the row cut debugger on a problem after applying presolve transformations, your solution must match the presolved problem. (But see #redoSolution().) */ class OsiRowCutDebugger { friend void OsiRowCutDebuggerUnitTest(const OsiSolverInterface * siP, const std::string & mpsDir); public: /*! @name Validate Row Cuts Check that the specified cuts do not cut off the known solution. */ //@{ /*! \brief Check that the set of cuts does not cut off the solution known to the debugger. Check if any generated cuts cut off the solution known to the debugger! If so then print offending cuts. Return the number of invalid cuts. */ virtual int validateCuts(const OsiCuts & cs, int first, int last) const; /*! \brief Check that the cut does not cut off the solution known to the debugger. Return true if cut is invalid */ virtual bool invalidCut(const OsiRowCut & rowcut) const; /*! \brief Returns true if the solution held in the solver is compatible with the known solution. More specifically, returns true if the known solution satisfies the column bounds held in the solver. */ bool onOptimalPath(const OsiSolverInterface &si) const; //@} /*! @name Activate the Debugger The debugger is considered to be active when it holds a known solution. */ //@{ /*! \brief Activate a debugger using the name of a problem. The debugger knows an optimal solution for most of miplib3. Check the source code for the full list. Returns true if the debugger is successfully activated. */ bool activate(const OsiSolverInterface &si, const char *model) ; /*! \brief Activate a debugger using a full solution array. The solution must have one entry for every variable, but only the entries for integer values are used. By default the debugger will solve an lp relaxation with the integer variables fixed and fill in values for the continuous variables from this solution. If the debugger should preserve the given values for the continuous variables, set \p keepContinuous to \c true. Returns true if debugger activates successfully. */ bool activate(const OsiSolverInterface &si, const double* solution, bool keepContinuous = false) ; /// Returns true if the debugger is active bool active() const; //@} /*! @name Query or Manipulate the Known Solution */ //@{ /// Return the known solution inline const double * optimalSolution() const { return knownSolution_;} /// Return the number of columns in the known solution inline int numberColumns() const { return (numberColumns_) ; } /// Return the value of the objective for the known solution inline double optimalValue() const { return knownValue_;} /*! \brief Edit the known solution to reflect column changes Given a translation array \p originalColumns[numberColumns] which can translate current column indices to original column indices, this method will edit the solution held in the debugger so that it matches the current set of columns. Useful when the original problem is preprocessed prior to cut generation. The debugger does keep a record of the changes. */ void redoSolution(int numberColumns, const int *originalColumns); /// Print optimal solution (returns -1 bad debug, 0 on optimal, 1 not) int printOptimalSolution(const OsiSolverInterface & si) const; //@} /**@name Constructors and Destructors */ //@{ /// Default constructor - no checking OsiRowCutDebugger (); /*! \brief Constructor with name of model. See #activate(const OsiSolverInterface&,const char*). */ OsiRowCutDebugger(const OsiSolverInterface &si, const char *model) ; /*! \brief Constructor with full solution. See #activate(const OsiSolverInterface&,const double*,bool). */ OsiRowCutDebugger(const OsiSolverInterface &si, const double *solution, bool enforceOptimality = false) ; /// Copy constructor OsiRowCutDebugger(const OsiRowCutDebugger &); /// Assignment operator OsiRowCutDebugger& operator=(const OsiRowCutDebugger& rhs); /// Destructor virtual ~OsiRowCutDebugger (); //@} private: // Private member data /**@name Private member data */ //@{ /// Value of known solution double knownValue_; /*! \brief Number of columns in known solution This must match the number of columns reported by the solver. */ int numberColumns_; /// array specifying integer variables bool * integerVariable_; /// array specifying known solution double * knownSolution_; //@} }; #endif Osi-0.106.4/src/Osi/OsiColCut.hpp0000644000076600007660000002053511575423733015007 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiColCut_H #define OsiColCut_H #include #include "CoinPackedVector.hpp" #include "OsiCollections.hpp" #include "OsiCut.hpp" /** Column Cut Class Column Cut Class has:
    • a sparse vector of column lower bounds
    • a sparse vector of column upper bounds
    */ class OsiColCut : public OsiCut { friend void OsiColCutUnitTest(const OsiSolverInterface * baseSiP, const std::string & mpsDir); public: //---------------------------------------------------------------- /**@name Setting column bounds */ //@{ /// Set column lower bounds inline void setLbs( int nElements, const int * colIndices, const double * lbElements ); /// Set column lower bounds from a packed vector inline void setLbs( const CoinPackedVector & lbs ); /// Set column upper bounds inline void setUbs( int nElements, const int * colIndices, const double * ubElements ); /// Set column upper bounds from a packed vector inline void setUbs( const CoinPackedVector & ubs ); //@} //---------------------------------------------------------------- /**@name Getting column bounds */ //@{ /// Get column lower bounds inline const CoinPackedVector & lbs() const; /// Get column upper bounds inline const CoinPackedVector & ubs() const; //@} /**@name Comparison operators */ //@{ #if __GNUC__ != 2 using OsiCut::operator== ; #endif /** equal - true if lower bounds, upper bounds, and OsiCut are equal. */ inline virtual bool operator==(const OsiColCut& rhs) const; #if __GNUC__ != 2 using OsiCut::operator!= ; #endif /// not equal inline virtual bool operator!=(const OsiColCut& rhs) const; //@} //---------------------------------------------------------------- /**@name Sanity checks on cut */ //@{ /** Returns true if the cut is consistent with respect to itself. This checks to ensure that:
    • The bound vectors do not have duplicate indices,
    • The bound vectors indices are >=0
    */ inline virtual bool consistent() const; /** Returns true if cut is consistent with respect to the solver interface's model. This checks to ensure that the lower & upperbound packed vectors:
    • do not have an index >= the number of column is the model.
    */ inline virtual bool consistent(const OsiSolverInterface& im) const; /** Returns true if the cut is infeasible with respect to its bounds and the column bounds in the solver interface's models. This checks whether:
    • the maximum of the new and existing lower bounds is strictly greater than the minimum of the new and existing upper bounds.
    */ inline virtual bool infeasible(const OsiSolverInterface &im) const; /** Returns infeasibility of the cut with respect to solution passed in i.e. is positive if cuts off that solution. solution is getNumCols() long.. */ virtual double violated(const double * solution) const; //@} //---------------------------------------------------------------- /**@name Constructors and destructors */ //@{ /// Assignment operator OsiColCut & operator=( const OsiColCut& rhs); /// Copy constructor OsiColCut ( const OsiColCut &); /// Default Constructor OsiColCut (); /// Clone virtual OsiColCut * clone() const; /// Destructor virtual ~OsiColCut (); //@} /**@name Debug stuff */ //@{ /// Print cuts in collection virtual void print() const; //@} private: /**@name Private member data */ //@{ /// Lower bounds CoinPackedVector lbs_; /// Upper bounds CoinPackedVector ubs_; //@} }; //------------------------------------------------------------------- // Set lower & upper bound vectors //------------------------------------------------------------------- void OsiColCut::setLbs( int size, const int * colIndices, const double * lbElements ) { lbs_.setVector(size,colIndices,lbElements); } // void OsiColCut::setUbs( int size, const int * colIndices, const double * ubElements ) { ubs_.setVector(size,colIndices,ubElements); } // void OsiColCut::setLbs( const CoinPackedVector & lbs ) { lbs_ = lbs; } // void OsiColCut::setUbs( const CoinPackedVector & ubs ) { ubs_ = ubs; } //------------------------------------------------------------------- // Get Column Lower Bounds and Column Upper Bounds //------------------------------------------------------------------- const CoinPackedVector & OsiColCut::lbs() const { return lbs_; } // const CoinPackedVector & OsiColCut::ubs() const { return ubs_; } //---------------------------------------------------------------- // == operator //------------------------------------------------------------------- bool OsiColCut::operator==( const OsiColCut& rhs) const { if ( this->OsiCut::operator!=(rhs) ) return false; if ( lbs() != rhs.lbs() ) return false; if ( ubs() != rhs.ubs() ) return false; return true; } // bool OsiColCut::operator!=( const OsiColCut& rhs) const { return !( (*this)==rhs ); } //---------------------------------------------------------------- // consistent & infeasible //------------------------------------------------------------------- bool OsiColCut::consistent() const { const CoinPackedVector & lb = lbs(); const CoinPackedVector & ub = ubs(); // Test for consistent cut. // Are packed vectors consistent? lb.duplicateIndex("consistent", "OsiColCut"); ub.duplicateIndex("consistent", "OsiColCut"); if ( lb.getMinIndex() < 0 ) return false; if ( ub.getMinIndex() < 0 ) return false; return true; } // bool OsiColCut::consistent(const OsiSolverInterface& im) const { const CoinPackedVector & lb = lbs(); const CoinPackedVector & ub = ubs(); // Test for consistent cut. if ( lb.getMaxIndex() >= im.getNumCols() ) return false; if ( ub.getMaxIndex() >= im.getNumCols() ) return false; return true; } #if 0 bool OsiColCut::feasible(const OsiSolverInterface &im) const { const double * oldColLb = im.getColLower(); const double * oldColUb = im.getColUpper(); const CoinPackedVector & cutLbs = lbs(); const CoinPackedVector & cutUbs = ubs(); int i; for ( i=0; i oldColLb[colIndx] ) newLb = cutLbs.elements()[i]; else newLb = oldColLb[colIndx]; double newUb = oldColUb[colIndx]; if ( cutUbs.indexExists(colIndx) ) if ( cutUbs[colIndx] < newUb ) newUb = cutUbs[colIndx]; if ( newLb > newUb ) return false; } for ( i=0; i newLb ) newLb = cutLbs[colIndx]; if ( newUb < newLb ) return false; } return true; } #endif bool OsiColCut::infeasible(const OsiSolverInterface &im) const { const double * oldColLb = im.getColLower(); const double * oldColUb = im.getColUpper(); const CoinPackedVector & cutLbs = lbs(); const CoinPackedVector & cutUbs = ubs(); int i; for ( i=0; i oldColLb[colIndx] ? cutLbs.getElements()[i] : oldColLb[colIndx]; double newUb = oldColUb[colIndx]; if ( cutUbs.isExistingIndex(colIndx) ) if ( cutUbs[colIndx] < newUb ) newUb = cutUbs[colIndx]; if ( newLb > newUb ) return true; } for ( i=0; i newLb ) newLb = cutLbs[colIndx]; if ( newUb < newLb ) return true; } return false; } #endif Osi-0.106.4/src/Osi/OsiConfig.h0000644000076600007660000000242412101340333014434 0ustar coincoin/* Copyright (C) 2011 * All Rights Reserved. * This code is published under the Eclipse Public License. * * $Id: OsiConfig.h 1881 2013-01-28 00:05:47Z stefan $ * * Include file for the configuration of Osi. * * On systems where the code is configured with the configure script * (i.e., compilation is always done with HAVE_CONFIG_H defined), this * header file includes the automatically generated header file. * * On systems that are compiled in other ways (e.g., with the * Developer Studio), a header files is included to define those * macros that depend on the operating system and the compiler. The * macros that define the configuration of the particular user setting * (e.g., presence of other COIN-OR packages or third party code) are set * by the files config_*default.h. The project maintainer needs to remember * to update these file and choose reasonable defines. * A user can modify the default setting by editing the config_*default.h files. */ #ifndef __OSICONFIG_H__ #define __OSICONFIG_H__ #ifdef HAVE_CONFIG_H #ifdef OSI_BUILD #include "config.h" #else #include "config_osi.h" #endif #else /* HAVE_CONFIG_H */ #ifdef OSI_BUILD #include "config_default.h" #else #include "config_osi_default.h" #endif #endif /* HAVE_CONFIG_H */ #endif /*__OSICONFIG_H__*/ Osi-0.106.4/src/Osi/OsiCollections.hpp0000644000076600007660000000147611510425067016066 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiCollections_H #define OsiCollections_H #include //Forward declarations class OsiColCut; class OsiRowCut; class OsiCut; /* Collection Classes */ /**@name Typedefs for Standard Template Library collections of Osi Objects. */ //@{ /// Vector of int typedef std::vector OsiVectorInt; /// Vector of double typedef std::vector OsiVectorDouble; /// Vector of OsiColCut pointers typedef std::vector OsiVectorColCutPtr; /// Vector of OsiRowCut pointers typedef std::vector OsiVectorRowCutPtr; /// Vector of OsiCut pointers typedef std::vector OsiVectorCutPtr; //@} #endif Osi-0.106.4/src/Osi/config.h.in0000644000076600007660000000613611573725230014451 0ustar coincoin/* src/Osi/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if the CoinUtils package is available */ #undef COIN_HAS_COINUTILS /* Define to 1 if the Cplex package is available */ #undef COIN_HAS_CPX /* Define to 1 if the Glpk package is available */ #undef COIN_HAS_GLPK /* Define to 1 if the Gurobi package is available */ #undef COIN_HAS_GRB /* Define to 1 if the Mosek package is available */ #undef COIN_HAS_MSK /* Define to 1 if the Netlib package is available */ #undef COIN_HAS_NETLIB /* Define to 1 if the Sample package is available */ #undef COIN_HAS_SAMPLE /* Define to 1 if the SoPlex package is available */ #undef COIN_HAS_SOPLEX /* Define to 1 if the Xpress package is available */ #undef COIN_HAS_XPR /* Define to the debug sanity check level (0 is no test) */ #undef COIN_OSI_CHECKLEVEL /* Define to the debug verbosity level (0 is no output) */ #undef COIN_OSI_VERBOSITY /* Define to 1 if GLPK has the advanced B&B solver lpx_intopt */ #undef GLPK_HAS_INTOPT /* Define to 1 if you have the header file. */ #undef HAVE_CFLOAT /* Define to 1 if you have the header file. */ #undef HAVE_CIEEEFP /* Define to 1 if you have the header file. */ #undef HAVE_CMATH /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the header file. */ #undef HAVE_IEEEFP_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* SVN revision number of project */ #undef OSI_SVN_REV /* Version number of project */ #undef OSI_VERSION /* Major Version number of project */ #undef OSI_VERSION_MAJOR /* Minor Version number of project */ #undef OSI_VERSION_MINOR /* Release Version number of project */ #undef OSI_VERSION_RELEASE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION Osi-0.106.4/src/Osi/OsiAuxInfo.hpp0000644000076600007660000001776711510425067015173 0ustar coincoin// Copyright (C) 2006, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiAuxInfo_H #define OsiAuxInfo_H class OsiSolverInterface; //############################################################################# /** This class allows for a more structured use of algorithmic tweaking to an OsiSolverInterface. It is designed to replace the simple use of appData_ pointer. This has been done to make it easier to use NonLinear solvers and other exotic beasts in a branch and bound mode. After this class definition there is one for a derived class for just such a purpose. */ class OsiAuxInfo { public: // Default Constructor OsiAuxInfo (void * appData = NULL); // Copy Constructor OsiAuxInfo (const OsiAuxInfo & rhs); // Destructor virtual ~OsiAuxInfo(); /// Clone virtual OsiAuxInfo * clone() const; /// Assignment operator OsiAuxInfo & operator=(const OsiAuxInfo& rhs); /// Get application data inline void * getApplicationData() const { return appData_;} protected: /// Pointer to user-defined data structure void * appData_; }; //############################################################################# /** This class allows for the use of more exotic solvers e.g. Non-Linear or Volume. You can derive from this although at present I can't see the need. */ class OsiBabSolver : public OsiAuxInfo { public: // Default Constructor OsiBabSolver (int solverType=0); // Copy Constructor OsiBabSolver (const OsiBabSolver & rhs); // Destructor virtual ~OsiBabSolver(); /// Clone virtual OsiAuxInfo * clone() const; /// Assignment operator OsiBabSolver & operator=(const OsiBabSolver& rhs); /// Update solver inline void setSolver(const OsiSolverInterface * solver) { solver_ = solver;} /// Update solver inline void setSolver(const OsiSolverInterface & solver) { solver_ = &solver;} /** returns 0 if no heuristic solution, 1 if valid solution with better objective value than one passed in Sets solution values if good, sets objective value numberColumns is size of newSolution */ int solution(double & objectiveValue, double * newSolution, int numberColumns); /** Set solution and objective value. Number of columns and optimization direction taken from current solver. Size of solution is numberColumns (may be padded or truncated in function) */ void setSolution(const double * solution, int numberColumns, double objectiveValue); /** returns true if the object stores a solution, false otherwise. If there is a solution then solutionValue and solution will be filled out as well. In that case the user needs to allocate solution to be a big enough array. */ bool hasSolution(double & solutionValue, double * solution); /** Sets solver type 0 - normal LP solver 1 - DW - may also return heuristic solutions 2 - NLP solver or similar - can't compute objective value just from solution check solver to see if feasible and what objective value is - may also return heuristic solution 3 - NLP solver or similar - can't compute objective value just from solution check this (rather than solver) to see if feasible and what objective value is. Using Outer Approximation so called lp based - may also return heuristic solution 4 - normal solver but cuts are needed for integral solution */ inline void setSolverType(int value) { solverType_=value;} /** gets solver type 0 - normal LP solver 1 - DW - may also return heuristic solutions 2 - NLP solver or similar - can't compute objective value just from solution check this (rather than solver) to see if feasible and what objective value is - may also return heuristic solution 3 - NLP solver or similar - can't compute objective value just from solution check this (rather than solver) to see if feasible and what objective value is. Using Outer Approximation so called lp based - may also return heuristic solution 4 - normal solver but cuts are needed for integral solution */ inline int solverType() const { return solverType_;} /** Return true if getting solution may add cuts so hot start etc will be obsolete */ inline bool solutionAddsCuts() const { return solverType_==3;} /// Return true if we should try cuts at root even if looks satisfied inline bool alwaysTryCutsAtRootNode() const { return solverType_==4;} /** Returns true if can use solver objective or feasible values, otherwise use mipBound etc */ inline bool solverAccurate() const { return solverType_==0||solverType_==2||solverType_==4;} /// Returns true if can use reduced costs for fixing inline bool reducedCostsAccurate() const { return solverType_==0||solverType_==4;} /// Get objective (well mip bound) double mipBound() const; /// Returns true if node feasible bool mipFeasible() const; /// Set mip bound (only used for some solvers) inline void setMipBound(double value) { mipBound_ = value;} /// Get objective value of saved solution inline double bestObjectiveValue() const { return bestObjectiveValue_;} /// Says whether we want to try cuts at all inline bool tryCuts() const { return solverType_!=2;} /// Says whether we have a warm start (so can do strong branching) inline bool warmStart() const { return solverType_!=2;} /** Get bit mask for odd actions of solvers 1 - solution or bound arrays may move in mysterious ways e.g. cplex 2 - solver may want bounds before branch */ inline int extraCharacteristics() const { return extraCharacteristics_;} /** Set bit mask for odd actions of solvers 1 - solution or bound arrays may move in mysterious ways e.g. cplex 2 - solver may want bounds before branch */ inline void setExtraCharacteristics(int value) { extraCharacteristics_=value;} /// Pointer to lower bounds before branch (only if extraCharacteristics set) inline const double * beforeLower() const { return beforeLower_;} /// Set pointer to lower bounds before branch (only if extraCharacteristics set) inline void setBeforeLower(const double * array) { beforeLower_ = array;} /// Pointer to upper bounds before branch (only if extraCharacteristics set) inline const double * beforeUpper() const { return beforeUpper_;} /// Set pointer to upper bounds before branch (only if extraCharacteristics set) inline void setBeforeUpper(const double * array) { beforeUpper_ = array;} protected: /// Objective value of best solution (if there is one) (minimization) double bestObjectiveValue_; /// Current lower bound on solution ( if > 1.0e50 infeasible) double mipBound_; /// Solver to use for getting/setting solutions etc const OsiSolverInterface * solver_; /// Best integer feasible solution double * bestSolution_; /// Pointer to lower bounds before branch (only if extraCharacteristics set) const double * beforeLower_; /// Pointer to upper bounds before branch (only if extraCharacteristics set) const double * beforeUpper_; /** Solver type 0 - normal LP solver 1 - DW - may also return heuristic solutions 2 - NLP solver or similar - can't compute objective value just from solution check this (rather than solver) to see if feasible and what objective value is - may also return heuristic solution 3 - NLP solver or similar - can't compute objective value just from solution check this (rather than solver) to see if feasible and what objective value is. Using Outer Approximation so called lp based - may also return heuristic solution */ int solverType_; /// Size of solution int sizeSolution_; /** Bit mask for odd actions of solvers 1 - solution or bound arrays may move in mysterious ways e.g. cplex 2 - solver may want bounds before branch */ int extraCharacteristics_; }; #endif Osi-0.106.4/src/OsiSpx/0000755000076600007660000000000012244064313013105 5ustar coincoinOsi-0.106.4/src/OsiSpx/OsiSpxSolverInterface.cpp0000644000076600007660000014367712130104324020063 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for SoPlex >= 1.4.2c // authors: Tobias Pfender // Ambros Gleixner // Wei Huang // Konrad-Zuse-Zentrum Berlin (Germany) // date: 01/16/2002 // license: this file may be freely distributed under the terms of EPL //----------------------------------------------------------------------------- // Copyright (C) 2002, Tobias Pfender, International Business Machines // Corporation and others. All Rights Reserved. // Last edit: $Id: OsiSpxSolverInterface.cpp 1899 2013-04-06 20:43:00Z stefan $ #include "CoinPragma.hpp" #include #include #include #include #include #include "CoinError.hpp" #include "OsiSpxSolverInterface.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" #include "soplex.h" //############################################################################# // A couple of helper functions //############################################################################# inline void freeCacheDouble( double*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } inline void freeCacheChar( char*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } inline void freeCacheMatrix( CoinPackedMatrix*& ptr ) { if( ptr != NULL ) { delete ptr; ptr = NULL; } } inline void throwSPXerror( std::string error, std::string osimethod ) { std::cout << "ERROR: " << error << " (" << osimethod << " in OsiSpxSolverInterface)" << std::endl; throw CoinError( error.c_str(), osimethod.c_str(), "OsiSpxSolverInterface" ); } //############################################################################# // Solve methods //############################################################################# void OsiSpxSolverInterface::initialSolve() { bool takeHint; OsiHintStrength strength; // by default we use dual simplex // unless we get the hint to use primal simplex bool dual = true; getHintParam(OsiDoDualInInitial,takeHint,strength); if (strength!=OsiHintIgnore) dual = takeHint; // always use column representation if( soplex_->rep() != soplex::SPxSolver::COLUMN ) soplex_->setRep( soplex::SPxSolver::COLUMN ); // set algorithm type if( dual ) { if( soplex_->type() != soplex::SPxSolver::LEAVE ) soplex_->setType( soplex::SPxSolver::LEAVE ); } else { if( soplex_->type() != soplex::SPxSolver::ENTER ) soplex_->setType( soplex::SPxSolver::ENTER ); } // set dual objective limit double dualobjlimit; OsiSolverInterface::getDblParam(OsiDualObjectiveLimit, dualobjlimit); if( fabs(dualobjlimit) < getInfinity() ) { double objoffset; OsiSolverInterface::getDblParam(OsiDualObjectiveLimit, objoffset); dualobjlimit += objoffset; } soplex_->setTerminationValue( dualobjlimit ); // solve try { soplex_->solve(); } catch (soplex::SPxException e) { *messageHandler() << "SoPlex initial solve failed with exception " << e.what() << CoinMessageEol; #if (SOPLEX_VERSION >= 160) || (SOPLEX_SUBVERSION >= 7) try { *messageHandler() << "Retry with cleared basis" << CoinMessageEol; soplex_->clearBasis(); soplex_->solve(); } catch (soplex::SPxException e) { *messageHandler() << "SoPlex initial solve with cleared basis failed with exception " << e.what() << CoinMessageEol; } #endif } freeCachedResults(); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::resolve() { bool takeHint; OsiHintStrength strength; // by default we use dual simplex // unless we get the hint to use primal simplex bool dual = true; getHintParam(OsiDoDualInResolve,takeHint,strength); if (strength!=OsiHintIgnore) dual = takeHint; // always use column representation if( soplex_->rep() != soplex::SPxSolver::COLUMN ) soplex_->setRep( soplex::SPxSolver::COLUMN ); // set algorithm type if( dual ) { if( soplex_->type() != soplex::SPxSolver::LEAVE ) soplex_->setType( soplex::SPxSolver::LEAVE ); } else { if( soplex_->type() != soplex::SPxSolver::ENTER ) soplex_->setType( soplex::SPxSolver::ENTER ); } // set dual objective limit double dualobjlimit; OsiSolverInterface::getDblParam(OsiDualObjectiveLimit, dualobjlimit); if( fabs(dualobjlimit) < getInfinity() ) { double objoffset; OsiSolverInterface::getDblParam(OsiDualObjectiveLimit, objoffset); dualobjlimit += objoffset; } soplex_->setTerminationValue( dualobjlimit ); // solve try { soplex_->solve(); } catch (soplex::SPxException e) { *messageHandler() << "SoPlex resolve failed with exception " << e.what() << CoinMessageEol; #if (SOPLEX_VERSION >= 160) || (SOPLEX_SUBVERSION >= 7) try { *messageHandler() << "Retry with cleared basis" << CoinMessageEol; soplex_->clearBasis(); soplex_->solve(); } catch (soplex::SPxException e) { *messageHandler() << "SoPlex resolve with cleared basis failed with exception " << e.what() << CoinMessageEol; } #endif } freeCachedResults(); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::branchAndBound() { throwSPXerror( "SoPlex does not provide an internal branch and bound procedure", "branchAndBound" ); } //############################################################################# // Parameter related methods //############################################################################# bool OsiSpxSolverInterface::setIntParam(OsiIntParam key, int value) { bool retval = false; try { switch (key) { case OsiMaxNumIteration: soplex_->setTerminationIter( value ); retval = true; break; case OsiMaxNumIterationHotStart: if( value >= 0 ) { hotStartMaxIteration_ = value; retval = true; } else retval = false; break; case OsiLastIntParam: retval = false; break; case OsiNameDiscipline: retval = OsiSolverInterface::setIntParam(key,value); break; } } catch (soplex::SPxException e) { *messageHandler() << "OsiSpx::setDblParam failed with exception " << e.what() << CoinMessageEol; retval = false; } return retval; } //----------------------------------------------------------------------------- bool OsiSpxSolverInterface::setDblParam(OsiDblParam key, double value) { bool retval = false; try { switch (key) { case OsiDualObjectiveLimit: retval = OsiSolverInterface::setDblParam(key,value); break; case OsiPrimalObjectiveLimit: retval = OsiSolverInterface::setDblParam(key,value); break; case OsiDualTolerance: // SoPlex doesn't support different deltas for primal and dual soplex_->setDelta( value ); retval = true; break; case OsiPrimalTolerance: // SoPlex doesn't support different deltas for primal and dual soplex_->setDelta( value ); retval = true; break; case OsiObjOffset: retval = OsiSolverInterface::setDblParam(key,value); break; case OsiLastDblParam: retval = false; break; } } catch (soplex::SPxException e) { *messageHandler() << "OsiSpx::setDblParam failed with exception " << e.what() << CoinMessageEol; retval = false; } return retval; } void OsiSpxSolverInterface::setTimeLimit(double value) { soplex_->setTerminationTime(value); } //----------------------------------------------------------------------------- bool OsiSpxSolverInterface::getIntParam(OsiIntParam key, int& value) const { bool retval = false; switch (key) { case OsiMaxNumIteration: value = soplex_->terminationIter(); retval = true; break; case OsiMaxNumIterationHotStart: value = hotStartMaxIteration_; retval = true; break; case OsiLastIntParam: retval = false; break; case OsiNameDiscipline: retval = OsiSolverInterface::getIntParam(key,value); break; } return retval; } //----------------------------------------------------------------------------- bool OsiSpxSolverInterface::getDblParam(OsiDblParam key, double& value) const { bool retval = false; switch (key) { case OsiDualObjectiveLimit: retval = OsiSolverInterface::getDblParam(key, value); break; case OsiPrimalObjectiveLimit: retval = OsiSolverInterface::getDblParam(key, value); break; case OsiDualTolerance: value = soplex_->delta(); retval = true; break; case OsiPrimalTolerance: value = soplex_->delta(); retval = true; break; case OsiObjOffset: retval = OsiSolverInterface::getDblParam(key, value); break; case OsiLastDblParam: retval = false; break; } return retval; } bool OsiSpxSolverInterface::getStrParam(OsiStrParam key, std::string & value) const { switch (key) { case OsiSolverName: value = "SoPlex"; return true; default: ; } return false; } double OsiSpxSolverInterface::getTimeLimit() const { return soplex_->terminationTime(); } //############################################################################# // Methods returning info on how the solution process terminated //############################################################################# bool OsiSpxSolverInterface::isAbandoned() const { int stat = soplex_->status(); return ( stat == soplex::SPxSolver::SINGULAR || stat == soplex::SPxSolver::ERROR ); } bool OsiSpxSolverInterface::isProvenOptimal() const { int stat = soplex_->status(); return ( stat == soplex::SPxSolver::OPTIMAL ); } bool OsiSpxSolverInterface::isProvenPrimalInfeasible() const { int stat = soplex_->status(); return ( stat == soplex::SPxSolver::INFEASIBLE ); } bool OsiSpxSolverInterface::isProvenDualInfeasible() const { int stat = soplex_->status(); return ( stat == soplex::SPxSolver::UNBOUNDED ); } bool OsiSpxSolverInterface::isDualObjectiveLimitReached() const { if( soplex_->status() == soplex::SPxSolver::ABORT_VALUE ) return true; return OsiSolverInterface::isDualObjectiveLimitReached(); } bool OsiSpxSolverInterface::isIterationLimitReached() const { return ( soplex_->status() == soplex::SPxSolver::ABORT_ITER ); } bool OsiSpxSolverInterface::isTimeLimitReached() const { return ( soplex_->status() == soplex::SPxSolver::ABORT_TIME ); } //############################################################################# // WarmStart related methods //############################################################################# CoinWarmStart* OsiSpxSolverInterface::getWarmStart() const { CoinWarmStartBasis* ws = NULL; int numcols = getNumCols(); int numrows = getNumRows(); int i; ws = new CoinWarmStartBasis(); ws->setSize( numcols, numrows ); if( soplex_->status() <= soplex::SPxSolver::NO_PROBLEM ) return ws; // The OSI standard assumes the artificial slack variables to have positive coefficients. SoPlex uses the convention // Ax - s = 0, lhs <= s <= rhs, so we have to invert the ON_LOWER and ON_UPPER statuses. for( i = 0; i < numrows; ++i ) { switch( soplex_->getBasisRowStatus( i ) ) { case soplex::SPxSolver::BASIC: ws->setArtifStatus( i, CoinWarmStartBasis::basic ); break; case soplex::SPxSolver::FIXED: case soplex::SPxSolver::ON_LOWER: ws->setArtifStatus( i, CoinWarmStartBasis::atUpperBound ); break; case soplex::SPxSolver::ON_UPPER: ws->setArtifStatus( i, CoinWarmStartBasis::atLowerBound ); break; case soplex::SPxSolver::ZERO: ws->setArtifStatus( i, CoinWarmStartBasis::isFree ); break; default: throwSPXerror( "invalid row status", "getWarmStart" ); break; } } for( i = 0; i < numcols; ++i ) { switch( soplex_->getBasisColStatus( i ) ) { case soplex::SPxSolver::BASIC: ws->setStructStatus( i, CoinWarmStartBasis::basic ); break; case soplex::SPxSolver::FIXED: case soplex::SPxSolver::ON_LOWER: ws->setStructStatus( i, CoinWarmStartBasis::atLowerBound ); break; case soplex::SPxSolver::ON_UPPER: ws->setStructStatus( i, CoinWarmStartBasis::atUpperBound ); break; case soplex::SPxSolver::ZERO: ws->setStructStatus( i, CoinWarmStartBasis::isFree ); break; default: throwSPXerror( "invalid column status", "getWarmStart" ); break; } } return ws; } //----------------------------------------------------------------------------- bool OsiSpxSolverInterface::setWarmStart(const CoinWarmStart* warmstart) { const CoinWarmStartBasis* ws = dynamic_cast(warmstart); int numcols, numrows, i; soplex::SPxSolver::VarStatus *cstat, *rstat; bool retval = false; if( !ws ) return false; numcols = ws->getNumStructural(); numrows = ws->getNumArtificial(); if( numcols != getNumCols() || numrows != getNumRows() ) return false; cstat = new soplex::SPxSolver::VarStatus[numcols]; rstat = new soplex::SPxSolver::VarStatus[numrows]; // The OSI standard assumes the artificial slack variables to have positive coefficients. SoPlex uses the convention // Ax - s = 0, lhs <= s <= rhs, so we have to invert the atLowerBound and atUpperBound statuses. for( i = 0; i < numrows; ++i ) { switch( ws->getArtifStatus( i ) ) { case CoinWarmStartBasis::basic: rstat[i] = soplex::SPxSolver::BASIC; break; case CoinWarmStartBasis::atLowerBound: rstat[i] = soplex::SPxSolver::ON_UPPER; break; case CoinWarmStartBasis::atUpperBound: rstat[i] = soplex::SPxSolver::ON_LOWER; break; case CoinWarmStartBasis::isFree: rstat[i] = soplex::SPxSolver::ZERO; break; default: // unknown row status retval = false; goto TERMINATE; } } for( i = 0; i < numcols; ++i ) { switch( ws->getStructStatus( i ) ) { case CoinWarmStartBasis::basic: cstat[i] = soplex::SPxSolver::BASIC; break; case CoinWarmStartBasis::atLowerBound: cstat[i] = soplex::SPxSolver::ON_LOWER; break; case CoinWarmStartBasis::atUpperBound: cstat[i] = soplex::SPxSolver::ON_UPPER; break; case CoinWarmStartBasis::isFree: cstat[i] = soplex::SPxSolver::ZERO; break; default: // unknown column status retval = false; goto TERMINATE; } } try { soplex_->setBasis( rstat, cstat ); } catch (soplex::SPxException e) { std::cerr << "SoPlex setting starting basis failed with exception " << e.what() << std::endl; retval = false; goto TERMINATE; } retval = true; TERMINATE: delete[] cstat; delete[] rstat; return retval; } //############################################################################# // Hotstart related methods (primarily used in strong branching) //############################################################################# void OsiSpxSolverInterface::markHotStart() { int numcols, numrows; numcols = getNumCols(); numrows = getNumRows(); if( numcols > hotStartCStatSize_ ) { delete[] reinterpret_cast(hotStartCStat_); hotStartCStatSize_ = static_cast( 1.2 * static_cast( numcols ) ); // get some extra space for future hot starts hotStartCStat_ = reinterpret_cast(new soplex::SPxSolver::VarStatus[hotStartCStatSize_]); } if( numrows > hotStartRStatSize_ ) { delete[] reinterpret_cast(hotStartRStat_); hotStartRStatSize_ = static_cast( 1.2 * static_cast( numrows ) ); // get some extra space for future hot starts hotStartRStat_ = reinterpret_cast(new soplex::SPxSolver::VarStatus[hotStartRStatSize_]); } soplex_->getBasis( reinterpret_cast(hotStartRStat_), reinterpret_cast(hotStartCStat_) ); } void OsiSpxSolverInterface::solveFromHotStart() { int maxiter; assert( getNumCols() <= hotStartCStatSize_ ); assert( getNumRows() <= hotStartRStatSize_ ); // @todo why the hotstart basis is not set here ????? //soplex_->setBasis( reinterpret_cast(hotStartRStat_), reinterpret_cast(hotStartCStat_) ); maxiter = soplex_->terminationIter(); soplex_->setTerminationIter( hotStartMaxIteration_ ); resolve(); soplex_->setTerminationIter( maxiter ); } void OsiSpxSolverInterface::unmarkHotStart() { // be lazy with deallocating memory and do nothing here, deallocate memory in the destructor } //############################################################################# // Problem information methods (original data) //############################################################################# //------------------------------------------------------------------ // Get number of rows, columns, elements, ... //------------------------------------------------------------------ int OsiSpxSolverInterface::getNumCols() const { return soplex_->nCols(); } int OsiSpxSolverInterface::getNumRows() const { return soplex_->nRows(); } int OsiSpxSolverInterface::getNumElements() const { #if 0 return soplex_->nNzos(); #else int retVal = 0; int nrows = getNumRows(); int row; for( row = 0; row < nrows; ++row ) { const soplex::SVector& rowvec = soplex_->rowVector( row ); retVal += rowvec.size(); } return retVal; #endif } //------------------------------------------------------------------ // Get pointer to rim vectors //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getColLower() const { const double * retVal = NULL; if ( getNumCols()!=0 ) retVal = soplex_->lower().get_const_ptr(); return retVal; } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getColUpper() const { const double * retVal = NULL; if ( getNumCols()!=0 ) retVal = soplex_->upper().get_const_ptr(); return retVal; } //------------------------------------------------------------------ const char * OsiSpxSolverInterface::getRowSense() const { if ( rowsense_ == NULL ) { // rowsense is determined with rhs, so invoke rhs getRightHandSide(); assert( rowsense_ != NULL || getNumRows() == 0 ); } return rowsense_; } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getRightHandSide() const { if ( rhs_ == NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { int row; assert( rowrange_ == NULL ); assert( rowsense_ == NULL ); rhs_ = new double[nrows]; rowrange_ = new double[nrows]; rowsense_ = new char[nrows]; for( row = 0; row < nrows; ++row ) convertBoundToSense( soplex_->lhs( row ), soplex_->rhs( row ), rowsense_[row], rhs_[row], rowrange_[row] ); } } return rhs_; } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getRowRange() const { if ( rowrange_==NULL ) { // rowrange is determined with rhs, so invoke rhs getRightHandSide(); assert( rowrange_ != NULL || getNumRows() == 0 ); } return rowrange_; } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getRowLower() const { const double * retVal = NULL; if ( getNumRows() != 0 ) retVal = soplex_->lhs().get_const_ptr(); return retVal; } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getRowUpper() const { const double * retVal = NULL; if ( getNumRows() != 0 ) retVal = soplex_->rhs().get_const_ptr(); return retVal; } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getObjCoefficients() const { const double * retVal = NULL; if( obj_ == NULL ) { if ( getNumCols()!=0 ) { obj_ = new soplex::DVector( getNumCols() ); soplex_->getObj( *obj_ ); retVal = obj_->get_const_ptr(); } } else { retVal = obj_->get_const_ptr(); } return retVal; } //------------------------------------------------------------------ double OsiSpxSolverInterface::getObjSense() const { switch( soplex_->spxSense() ) { case soplex::SPxLP::MINIMIZE: return +1.0; case soplex::SPxLP::MAXIMIZE: return -1.0; default: throwSPXerror( "invalid optimization sense", "getObjSense" ); return 0.0; } } //------------------------------------------------------------------ // Return information on integrality //------------------------------------------------------------------ bool OsiSpxSolverInterface::isContinuous( int colNumber ) const { return( spxintvars_->number( colNumber ) < 0 ); } //------------------------------------------------------------------ // Row and column copies of the matrix ... //------------------------------------------------------------------ const CoinPackedMatrix * OsiSpxSolverInterface::getMatrixByRow() const { if( matrixByRow_ == NULL ) { int nrows = getNumRows(); int ncols = getNumCols(); int nelems = getNumElements(); double *elements = new double [nelems]; int *indices = new int [nelems]; int *starts = new int [nrows+1]; int *len = new int [nrows]; int row, i, elem; elem = 0; for( row = 0; row < nrows; ++row ) { const soplex::SVector& rowvec = soplex_->rowVector( row ); starts[row] = elem; len [row] = rowvec.size(); for( i = 0; i < len[row]; ++i, ++elem ) { assert( elem < nelems ); elements[elem] = rowvec.value( i ); indices [elem] = rowvec.index( i ); } } starts[nrows] = elem; assert( elem == nelems ); matrixByRow_ = new CoinPackedMatrix(); matrixByRow_->assignMatrix( false /* not column ordered */, ncols, nrows, nelems, elements, indices, starts, len ); } return matrixByRow_; } //------------------------------------------------------------------ const CoinPackedMatrix * OsiSpxSolverInterface::getMatrixByCol() const { if( matrixByCol_ == NULL ) { int nrows = getNumRows(); int ncols = getNumCols(); int nelems = getNumElements(); double *elements = new double [nelems]; int *indices = new int [nelems]; int *starts = new int [ncols+1]; int *len = new int [ncols]; int col, i, elem; elem = 0; for( col = 0; col < ncols; ++col ) { const soplex::SVector& colvec = soplex_->colVector( col ); starts[col] = elem; len [col] = colvec.size(); for( i = 0; i < len[col]; ++i, ++elem ) { assert( elem < nelems ); elements[elem] = colvec.value( i ); indices [elem] = colvec.index( i ); } } starts[ncols] = elem; assert( elem == nelems ); matrixByCol_ = new CoinPackedMatrix(); matrixByCol_->assignMatrix( true /* column ordered */, nrows, ncols, nelems, elements, indices, starts, len ); } return matrixByCol_; } //------------------------------------------------------------------ // Get solver's value for infinity //------------------------------------------------------------------ double OsiSpxSolverInterface::getInfinity() const { return soplex::infinity; } //############################################################################# // Problem information methods (results) //############################################################################# // *FIXME*: what should be done if a certain vector doesn't exist??? const double * OsiSpxSolverInterface::getColSolution() const { if( colsol_ == NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { colsol_ = new soplex::DVector( ncols ); if( isProvenOptimal() ) soplex_->getPrimal( *colsol_ ); else *colsol_ = soplex_->lower(); } else return NULL; } return colsol_->get_const_ptr(); } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getRowPrice() const { if( rowsol_ == NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowsol_ = new soplex::DVector( nrows ); if( isProvenOptimal() ) soplex_->getDual( *rowsol_ ); else rowsol_->clear(); } else return NULL; } return rowsol_->get_const_ptr(); } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getReducedCost() const { if( redcost_ == NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { redcost_ = new soplex::DVector( ncols ); if( isProvenOptimal() ) soplex_->getRedCost( *redcost_ ); else redcost_->clear(); } else return NULL; } return redcost_->get_const_ptr(); } //------------------------------------------------------------------ const double * OsiSpxSolverInterface::getRowActivity() const { if( rowact_ == NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowact_ = new soplex::DVector( nrows ); if( isProvenOptimal() ) soplex_->getSlacks( *rowact_ ); else rowact_->clear(); } else return NULL; } return rowact_->get_const_ptr(); } //------------------------------------------------------------------ double OsiSpxSolverInterface::getObjValue() const { double objval; switch( soplex_->status() ) { case soplex::SPxSolver::OPTIMAL: case soplex::SPxSolver::UNBOUNDED: case soplex::SPxSolver::INFEASIBLE: objval = soplex_->objValue(); break; default: { const double* colsol = getColSolution(); const double* objcoef = getObjCoefficients(); int ncols = getNumCols(); objval = 0.0; for( int i = 0; i < ncols; ++i ) objval += colsol[i] * objcoef[i]; break; } } // Adjust objective function value by constant term in objective function double objOffset; getDblParam(OsiObjOffset,objOffset); objval = objval - objOffset; return objval; } //------------------------------------------------------------------ int OsiSpxSolverInterface::getIterationCount() const { return soplex_->iteration(); } //------------------------------------------------------------------ std::vector OsiSpxSolverInterface::getDualRays(int maxNumRays, bool fullRay) const { if (fullRay == true) { throw CoinError("Full dual rays not yet implemented.","getDualRays", "OsiSpxSolverInterface"); } std::vector ret = std::vector(); if (soplex_->status() == soplex::SPxSolver::INFEASIBLE && maxNumRays > 0) { ret.push_back(new double[getNumRows()]); soplex::Vector proof(getNumRows(), ret[0]); soplex_->getDualfarkas(proof); for (int i = 0; i < getNumRows(); ++i) ret[0][i] *= -1.0; } return ret; } //------------------------------------------------------------------ std::vector OsiSpxSolverInterface::getPrimalRays(int maxNumRays) const { // *FIXME* : must write the method throw CoinError("method is not yet written", "getPrimalRays", "OsiSpxSolverInterface"); return std::vector(); } //############################################################################# // Problem modifying methods (rim vectors) //############################################################################# void OsiSpxSolverInterface::setObjCoeff( int elementIndex, double elementValue ) { soplex_->changeObj( elementIndex, elementValue ); freeCachedData( OsiSpxSolverInterface::FREECACHED_COLUMN ); } void OsiSpxSolverInterface::setColLower(int elementIndex, double elementValue) { soplex_->changeLower( elementIndex, elementValue ); freeCachedData( OsiSpxSolverInterface::FREECACHED_COLUMN ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setColUpper(int elementIndex, double elementValue) { soplex_->changeUpper( elementIndex, elementValue ); freeCachedData( OsiSpxSolverInterface::FREECACHED_COLUMN ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setColBounds( int elementIndex, double lower, double upper ) { soplex_->changeBounds( elementIndex, lower, upper ); freeCachedData( OsiSpxSolverInterface::FREECACHED_COLUMN ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setRowLower( int i, double elementValue ) { soplex_->changeLhs( i, elementValue ); freeCachedData( OsiSpxSolverInterface::FREECACHED_ROW ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setRowUpper( int i, double elementValue ) { soplex_->changeRhs( i, elementValue ); freeCachedData( OsiSpxSolverInterface::FREECACHED_ROW ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setRowBounds( int elementIndex, double lower, double upper ) { soplex_->changeRange( elementIndex, lower, upper ); freeCachedData( OsiSpxSolverInterface::FREECACHED_ROW ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setRowType(int i, char sense, double rightHandSide, double range) { double lower = 0.0; double upper = 0.0; convertSenseToBound( sense, rightHandSide, range, lower, upper ); setRowBounds( i, lower, upper ); } //############################################################################# void OsiSpxSolverInterface::setContinuous(int index) { int pos = spxintvars_->number( index ); if( pos >= 0 ) { spxintvars_->remove( pos ); freeCachedData( OsiSpxSolverInterface::FREECACHED_COLUMN ); } } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setInteger(int index) { int pos = spxintvars_->number( index ); if( pos < 0 ) { spxintvars_->addIdx( index ); freeCachedData( OsiSpxSolverInterface::FREECACHED_COLUMN ); } } //############################################################################# void OsiSpxSolverInterface::setObjSense(double s) { if( s != getObjSense() ) { if( s == +1.0 ) soplex_->changeSense( soplex::SPxLP::MINIMIZE ); else soplex_->changeSense( soplex::SPxLP::MAXIMIZE ); freeCachedData( OsiSpxSolverInterface::FREECACHED_RESULTS ); } } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setColSolution(const double * cs) { int col; int ncols = getNumCols(); if( colsol_ != NULL ) delete colsol_; if( ncols > 0 && cs != NULL ) { colsol_ = new soplex::DVector( ncols ); for( col = 0; col < ncols; ++col ) (*colsol_)[col] = cs[col]; } else colsol_ = NULL; } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::setRowPrice(const double * rs) { int row; int nrows = getNumRows(); if( rowsol_ != NULL ) delete rowsol_; if( nrows > 0 && rs != NULL ) { rowsol_ = new soplex::DVector( nrows ); for( row = 0; row < nrows; ++row ) (*rowsol_)[row] = rs[row]; } else rowsol_ = NULL; } //############################################################################# // Problem modifying methods (matrix) //############################################################################# void OsiSpxSolverInterface::addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) { soplex::DSVector colvec; colvec.add( vec.getNumElements(), vec.getIndices(), vec.getElements() ); soplex_->addCol( soplex::LPCol( obj, colvec, colub, collb ) ); freeCachedData( OsiSpxSolverInterface::KEEPCACHED_ROW ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::deleteCols(const int num, const int * columnIndices) { soplex_->removeCols( const_cast(columnIndices), num ); freeCachedData( OsiSpxSolverInterface::KEEPCACHED_ROW ); // took from OsiClp for updating names int nameDiscipline; getIntParam(OsiNameDiscipline,nameDiscipline) ; if (num && nameDiscipline) { // Very clumsy (and inefficient) - need to sort and then go backwards in ? chunks int * indices = CoinCopyOfArray(columnIndices,num); std::sort(indices,indices+num); int num2 = num; while (num2) { int next = indices[num2-1]; int firstDelete = num2-1; int i; for (i = num2-2; i>=0; --i) { if (indices[i]+1 == next) { --next; firstDelete = i; } else { break; } } OsiSolverInterface::deleteColNames(indices[firstDelete],num2-firstDelete); num2 = firstDelete; assert (num2>=0); } delete [] indices; } } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub) { soplex::DSVector rowvec; rowvec.add( vec.getNumElements(), vec.getIndices(), vec.getElements() ); soplex_->addRow( soplex::LPRow( rowlb, rowvec, rowub ) ); freeCachedData( OsiSpxSolverInterface::KEEPCACHED_COLUMN ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) { double rowlb = 0.0; double rowub = 0.0; convertSenseToBound( rowsen, rowrhs, rowrng, rowlb, rowub ); addRow( vec, rowlb, rowub ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::deleteRows(const int num, const int * rowIndices) { soplex_->removeRows( const_cast(rowIndices), num ); freeCachedData( OsiSpxSolverInterface::KEEPCACHED_COLUMN ); // took from OsiClp for updating names int nameDiscipline; getIntParam(OsiNameDiscipline,nameDiscipline) ; if (num && nameDiscipline) { // Very clumsy (and inefficient) - need to sort and then go backwards in ? chunks int * indices = CoinCopyOfArray(rowIndices,num); std::sort(indices,indices+num); int num2=num; while (num2) { int next = indices[num2-1]; int firstDelete = num2-1; int i; for (i = num2-2; i>=0; --i) { if (indices[i]+1 == next) { --next; firstDelete = i; } else { break; } } OsiSolverInterface::deleteRowNames(indices[firstDelete],num2-firstDelete); num2 = firstDelete; assert(num2 >= 0); } delete [] indices; } } //############################################################################# // Methods to input a problem //############################################################################# void OsiSpxSolverInterface::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { int ncols = matrix.getNumCols(); int nrows = matrix.getNumRows(); const int *length = matrix.getVectorLengths(); const int *start = matrix.getVectorStarts(); const double *elem = matrix.getElements(); const int *index = matrix.getIndices(); double *thecollb, *thecolub, *theobj, *therowlb, *therowub; // create defaults if parameter is NULL if( collb == NULL ) { thecollb = new double[ncols]; CoinFillN( thecollb, ncols, 0.0 ); } else thecollb = const_cast(collb); if( colub == NULL ) { thecolub = new double[ncols]; CoinFillN( thecolub, ncols, getInfinity() ); } else thecolub = const_cast(colub); if( obj == NULL ) { theobj = new double[ncols]; CoinFillN( theobj, ncols, 0.0 ); } else theobj = const_cast(obj); if( rowlb == NULL ) { therowlb = new double[nrows]; CoinFillN( therowlb, nrows, -getInfinity() ); } else therowlb = const_cast(rowlb); if( rowub == NULL ) { therowub = new double[nrows]; CoinFillN( therowub, nrows, +getInfinity() ); } else therowub = const_cast(rowub); // copy problem into soplex_ soplex_->clear(); spxintvars_->clear(); freeCachedData( OsiSpxSolverInterface::KEEPCACHED_NONE ); if( matrix.isColOrdered() ) { int row, col, pos; soplex::LPRowSet rowset( nrows, 0 ); soplex::DSVector rowvec; soplex::LPColSet colset( ncols, matrix.getNumElements() ); soplex::DSVector colvec; /* insert empty rows */ rowvec.clear(); for( row = 0; row < nrows; ++row ) rowset.add( therowlb[row], rowvec, therowub[row] ); soplex_->addRows( rowset ); /* create columns */ for( col = 0; col < ncols; ++col ) { pos = start[col]; colvec.clear(); colvec.add( length[col], &(index[pos]), &(elem[pos]) ); colset.add( theobj[col], thecollb[col], colvec, thecolub[col] ); } soplex_->addCols( colset ); // soplex_->changeRange( soplex::Vector( nrows, therowlb ), soplex::Vector( nrows, therowub ) ); } else { int row, col, pos; soplex::LPRowSet rowset( nrows, matrix.getNumElements() ); soplex::DSVector rowvec; soplex::LPColSet colset( ncols, 0 ); soplex::DSVector colvec; /* insert empty columns */ colvec.clear(); for( col = 0; col < ncols; ++col ) colset.add( theobj[col], thecollb[col], colvec, thecolub[col] ); soplex_->addCols( colset ); /* create rows */ for( row = 0; row < nrows; ++row ) { pos = start[row]; rowvec.clear(); rowvec.add( length[row], &(index[pos]), &(elem[pos]) ); rowset.add( therowlb[row], rowvec, therowub[row] ); } soplex_->addRows( rowset ); // soplex_->changeObj( soplex::Vector( ncols, theobj ) ); // soplex_->changeBounds( soplex::Vector( ncols, thecollb ), soplex::Vector( ncols, thecolub ) ); } // switch sense to minimization problem soplex_->changeSense( soplex::SPxSolver::MINIMIZE ); // delete default arrays if neccessary if( collb == NULL ) delete[] thecollb; if( colub == NULL ) delete[] thecolub; if( obj == NULL ) delete[] theobj; if( rowlb == NULL ) delete[] therowlb; if( rowub == NULL ) delete[] therowub; } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub ) { loadProblem( *matrix, collb, colub, obj, rowlb, rowub ); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowlb; rowlb = 0; delete[] rowub; rowub = 0; } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { int nrows = matrix.getNumRows(); double* rowlb = new double[nrows]; double* rowub = new double[nrows]; int row; char *therowsen; double *therowrhs, *therowrng; if( rowsen == NULL ) { therowsen = new char[nrows]; CoinFillN( therowsen, nrows, 'G' ); } else therowsen = const_cast(rowsen); if( rowrhs == NULL ) { therowrhs = new double[nrows]; CoinFillN( therowrhs, nrows, 0.0 ); } else therowrhs = const_cast(rowrhs); if( rowrng == NULL ) { therowrng = new double[nrows]; CoinFillN( therowrng, nrows, 0.0 ); } else therowrng = const_cast(rowrng); for( row = 0; row < nrows; ++row ) convertSenseToBound( therowsen[row], therowrhs[row], therowrng[row], rowlb[row], rowub[row] ); loadProblem( matrix, collb, colub, obj, rowlb, rowub ); if( rowsen == NULL ) delete[] therowsen; if( rowrhs == NULL ) delete[] therowrhs; if( rowrng == NULL ) delete[] therowrng; delete[] rowlb; delete[] rowub; } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng ) { loadProblem( *matrix, collb, colub, obj, rowsen, rowrhs, rowrng ); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowsen; rowsen = 0; delete[] rowrhs; rowrhs = 0; delete[] rowrng; rowrng = 0; } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { int col, pos; soplex::LPColSet colset( numcols, start[numcols] ); soplex::DSVector colvec; soplex_->clear(); spxintvars_->clear(); freeCachedData( OsiSpxSolverInterface::KEEPCACHED_NONE ); for( col = 0; col < numcols; ++col ) { pos = start[col]; colvec.clear(); colvec.add( start[col+1] - pos, &(index[pos]), &(value[pos]) ); colset.add( obj[col], collb[col], colvec, colub[col] ); } soplex_->addCols( colset ); soplex_->changeRange( soplex::Vector( numrows, const_cast(rowlb) ), soplex::Vector( numrows, const_cast(rowub) ) ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { double* rowlb = new double[numrows]; double* rowub = new double[numrows]; int row; for( row = 0; row < numrows; ++row ) convertSenseToBound( rowsen != NULL ? rowsen[row] : 'G', rowrhs != NULL ? rowrhs[row] : 0.0, rowrng != NULL ? rowrng[row] : 0.0, rowlb[row], rowub[row] ); loadProblem( numcols, numrows, start, index, value, collb, colub, obj, rowlb, rowub ); delete[] rowlb; delete[] rowub; } //----------------------------------------------------------------------------- // Read mps files //----------------------------------------------------------------------------- int OsiSpxSolverInterface::readMps( const char * filename, const char * extension ) { #if 0 std::string f(filename); std::string e(extension); std::string fullname = f + "." + e; std::ifstream file(fullname.c_str()); if (!file.good()) { std::cerr << "Error opening file " << fullname << " for reading!" << std::endl; return 1; } soplex_->clear(); if( !soplex_->readMPS(file, NULL, NULL, NULL) ) throwSPXerror( "error reading file <" + fullname + ">", "readMps" ); #endif // we preserve the objective sense independent of the problem which is read soplex::SPxLP::SPxSense objsen = soplex_->spxSense(); int retval = OsiSolverInterface::readMps(filename,extension); soplex_->changeSense(objsen); return retval; } //----------------------------------------------------------------------------- // Write mps files //----------------------------------------------------------------------------- void OsiSpxSolverInterface::writeMps( const char * filename, const char * extension, double objSense) const { std::string f(filename); std::string e(extension); std::string fullname = f+"."+e; std::ofstream file(fullname.c_str()); if (!file.good()) { std::cerr << "Error opening file " << fullname << " for writing!" << std::endl; return; } soplex::DIdxSet integers(getNumIntegers()); for (int i = 0; i < getNumCols(); ++i) if (isInteger(i)) integers.addIdx(i); soplex_->writeMPS(file, NULL, NULL, &integers); } //############################################################################# // Constructors, destructors clone and assignment //############################################################################# //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiSpxSolverInterface::OsiSpxSolverInterface () : OsiSolverInterface(), soplex_(new soplex::SoPlex(soplex::SPxSolver::ENTER, soplex::SPxSolver::COLUMN)), // default is primal simplex algorithm spxintvars_(new soplex::DIdxSet()), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(1000000), // ??? default iteration limit for strong branching is large obj_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL) { #ifndef NDEBUG soplex::Param::setVerbose( 3 ); #else soplex::Param::setVerbose( 2 ); #endif // SoPlex default objective sense is maximization, thus we explicitly set it to minimization soplex_->changeSense( soplex::SPxLP::MINIMIZE ); } //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiSolverInterface * OsiSpxSolverInterface::clone(bool copyData) const { return( new OsiSpxSolverInterface( *this ) ); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiSpxSolverInterface::OsiSpxSolverInterface( const OsiSpxSolverInterface & source ) : OsiSolverInterface(source), soplex_(new soplex::SoPlex(*source.soplex_)), spxintvars_(new soplex::DIdxSet(*source.spxintvars_)), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(source.hotStartMaxIteration_), obj_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL) { if (source.colsol_ != NULL) setColSolution(source.getColSolution()); if (source.rowsol_ != NULL) setRowPrice(source.getRowPrice()); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiSpxSolverInterface::~OsiSpxSolverInterface () { freeAllMemory(); } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiSpxSolverInterface& OsiSpxSolverInterface::operator=( const OsiSpxSolverInterface& source ) { if (this != &source) { freeAllMemory(); OsiSolverInterface::operator=( source ); spxintvars_ = new soplex::DIdxSet(*source.spxintvars_); soplex_ = new soplex::SoPlex(*source.soplex_); if (source.colsol_ != NULL) setColSolution(source.getColSolution()); if (source.rowsol_ != NULL) setRowPrice(source.getRowPrice()); hotStartMaxIteration_ = source.hotStartMaxIteration_; } return *this; } //############################################################################# // Applying cuts //############################################################################# void OsiSpxSolverInterface::applyColCut( const OsiColCut & cc ) { const double * soplexColLB = getColLower(); const double * soplexColUB = getColUpper(); const CoinPackedVector & lbs = cc.lbs(); const CoinPackedVector & ubs = cc.ubs(); int i; for( i = 0; i < lbs.getNumElements(); ++i ) if ( lbs.getElements()[i] > soplexColLB[lbs.getIndices()[i]] ) setColLower( lbs.getIndices()[i], lbs.getElements()[i] ); for( i = 0; i < ubs.getNumElements(); ++i ) if ( ubs.getElements()[i] < soplexColUB[ubs.getIndices()[i]] ) setColUpper( ubs.getIndices()[i], ubs.getElements()[i] ); } //----------------------------------------------------------------------------- void OsiSpxSolverInterface::applyRowCut( const OsiRowCut & rowCut ) { addRow( rowCut.row(), rowCut.lb(), rowCut.ub() ); } //############################################################################# // Private methods (non-static and static) //############################################################################# //------------------------------------------------------------------- /// free cached vectors void OsiSpxSolverInterface::freeCachedColRim() { delete obj_; obj_ = NULL; } void OsiSpxSolverInterface::freeCachedRowRim() { freeCacheChar ( rowsense_ ); freeCacheDouble( rhs_ ); freeCacheDouble( rowrange_ ); assert( rowsense_ == NULL ); assert( rhs_ == NULL ); assert( rowrange_ == NULL ); } void OsiSpxSolverInterface::freeCachedMatrix() { freeCacheMatrix( matrixByRow_ ); freeCacheMatrix( matrixByCol_ ); assert( matrixByRow_ == NULL ); assert( matrixByCol_ == NULL ); } void OsiSpxSolverInterface::freeCachedResults() { delete colsol_; delete rowsol_; delete redcost_; delete rowact_; colsol_ = NULL; rowsol_ = NULL; redcost_ = NULL; rowact_ = NULL; } void OsiSpxSolverInterface::freeCachedData( int keepCached ) { if( !(keepCached & OsiSpxSolverInterface::KEEPCACHED_COLUMN) ) freeCachedColRim(); if( !(keepCached & OsiSpxSolverInterface::KEEPCACHED_ROW) ) freeCachedRowRim(); if( !(keepCached & OsiSpxSolverInterface::KEEPCACHED_MATRIX) ) freeCachedMatrix(); if( !(keepCached & OsiSpxSolverInterface::KEEPCACHED_RESULTS) ) freeCachedResults(); } void OsiSpxSolverInterface::freeAllMemory() { freeCachedData(); delete[] reinterpret_cast(hotStartCStat_); delete[] reinterpret_cast(hotStartRStat_); hotStartCStat_ = NULL; hotStartCStatSize_ = 0; hotStartRStat_ = NULL; hotStartRStatSize_ = 0; delete soplex_; delete spxintvars_; } Osi-0.106.4/src/OsiSpx/Makefile.am0000644000076600007660000000300111621722556015143 0ustar coincoin# Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1800 2011-08-14 10:37:34Z stefan $ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiSpx # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiSpx.la # List all source files for this library, including headers libOsiSpx_la_SOURCES = OsiSpxSolverInterface.cpp OsiSpxSolverInterface.hpp # This is for libtool libOsiSpx_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../Osi` $(COINUTILS_CFLAGS) $(SOPLEX_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiSpxSolverInterface.hpp Osi-0.106.4/src/OsiSpx/OsiSpxSolverInterface.hpp0000644000076600007660000006735311601420547020076 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for SoPlex >= 1.4.2c // authors: Tobias Pfender // Ambros Gleixner // Wei Huang // Konrad-Zuse-Zentrum Berlin (Germany) // email: pfender@zib.de // date: 01/16/2002 // license: this file may be freely distributed under the terms of the EPL //----------------------------------------------------------------------------- // Copyright (C) 2002, Tobias Pfender, International Business Machines // Corporation and others. All Rights Reserved. // Last edit: $Id: OsiSpxSolverInterface.hpp 1762 2011-06-25 17:56:55Z stefan $ #ifndef OsiSpxSolverInterface_H #define OsiSpxSolverInterface_H #include #include "OsiSolverInterface.hpp" #include "CoinWarmStartBasis.hpp" /* forward declarations so the header can be compiled without having to include soplex.h */ namespace soplex { class DIdxSet; class DVector; class SoPlex; } /** SoPlex Solver Interface Instantiation of OsiSpxSolverInterface for SoPlex */ class OsiSpxSolverInterface : virtual public OsiSolverInterface { friend void OsiSpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); public: //--------------------------------------------------------------------------- /**@name Solve methods */ //@{ /// Solve initial LP relaxation virtual void initialSolve(); /// Resolve an LP relaxation after problem modification virtual void resolve(); /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound(); //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. */ //@{ // Set an integer parameter bool setIntParam(OsiIntParam key, int value); // Set an double parameter bool setDblParam(OsiDblParam key, double value); // Get an integer parameter bool getIntParam(OsiIntParam key, int& value) const; // Get an double parameter bool getDblParam(OsiDblParam key, double& value) const; // Get a string parameter bool getStrParam(OsiStrParam key, std::string& value) const; // Set timelimit void setTimeLimit(double value); // Get timelimit double getTimeLimit() const; //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there a numerical difficulties? virtual bool isAbandoned() const; /// Is optimality proven? virtual bool isProvenOptimal() const; /// Is primal infeasiblity proven? virtual bool isProvenPrimalInfeasible() const; /// Is dual infeasiblity proven? virtual bool isProvenDualInfeasible() const; // Is the given primal objective limit reached? - use implementation from OsiSolverInterface /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const; /// Time limit reached? virtual bool isTimeLimitReached() const; //@} //--------------------------------------------------------------------------- /**@name WarmStart related methods */ //@{ /// Get empty warm start object inline CoinWarmStart *getEmptyWarmStart () const { return (dynamic_cast(new CoinWarmStartBasis())) ; } /// Get warmstarting information virtual CoinWarmStart* getWarmStart() const; /** Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. */ virtual bool setWarmStart(const CoinWarmStart* warmstart); //@} //--------------------------------------------------------------------------- /**@name Hotstart related methods (primarily used in strong branching).
    The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there.
    NOTE: between hotstarted optimizations only bound changes are allowed. */ //@{ /// Create a hotstart point of the optimization process virtual void markHotStart(); /// Optimize starting from the hotstart virtual void solveFromHotStart(); /// Delete the snapshot virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem information methods These methods call the solver's query routines to return information about the problem referred to by the current object. Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /**@name Methods related to querying the input data */ //@{ /// Get number of columns virtual int getNumCols() const; /// Get number of rows virtual int getNumRows() const; /// Get number of nonzero elements virtual int getNumElements() const; /// Get pointer to array[getNumCols()] of column lower bounds virtual const double * getColLower() const; /// Get pointer to array[getNumCols()] of column upper bounds virtual const double * getColUpper() const; /** Get pointer to array[getNumRows()] of row constraint senses.
    • 'L': <= constraint
    • 'E': = constraint
    • 'G': >= constraint
    • 'R': ranged constraint
    • 'N': free constraint
    */ virtual const char * getRowSense() const; /** Get pointer to array[getNumRows()] of rows right-hand sides
    • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
    • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'N' then rhs()[i] == 0.0
    */ virtual const double * getRightHandSide() const; /** Get pointer to array[getNumRows()] of row ranges.
    • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
    • if rowsense()[i] != 'R' then rowrange()[i] is 0.0
    */ virtual const double * getRowRange() const; /// Get pointer to array[getNumRows()] of row lower bounds virtual const double * getRowLower() const; /// Get pointer to array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const; /// Get pointer to array[getNumCols()] of objective function coefficients virtual const double * getObjCoefficients() const; /// Get objective function sense (1 for min (default), -1 for max) virtual double getObjSense() const; /// Return true if column is continuous virtual bool isContinuous(int colNumber) const; #if 0 /// Return true if column is binary virtual bool isBinary(int columnNumber) const; /** Return true if column is integer. Note: This function returns true if the the column is binary or a general integer. */ virtual bool isInteger(int columnNumber) const; /// Return true if column is general integer virtual bool isIntegerNonBinary(int columnNumber) const; /// Return true if column is binary and not fixed at either bound virtual bool isFreeBinary(int columnNumber) const; #endif /// Get pointer to row-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByRow() const; /// Get pointer to column-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByCol() const; /// Get solver's value for infinity virtual double getInfinity() const; //@} /**@name Methods related to querying the solution */ //@{ /// Get pointer to array[getNumCols()] of primal solution vector virtual const double * getColSolution() const; /// Get pointer to array[getNumRows()] of dual prices virtual const double * getRowPrice() const; /// Get a pointer to array[getNumCols()] of reduced costs virtual const double * getReducedCost() const; /** Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector */ virtual const double * getRowActivity() const; /// Get objective function value virtual double getObjValue() const; /** Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. */ virtual int getIterationCount() const; /** Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.) The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay=false) const; /** Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.) NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getPrimalRays(int maxNumRays) const; #if 0 /** Get vector of indices of solution which are integer variables presently at fractional values */ virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const; #endif //@} //@} //--------------------------------------------------------------------------- /**@name Problem modifying methods */ //@{ //------------------------------------------------------------------------- /**@name Changing bounds on variables and constraints */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff( int elementIndex, double elementValue ); /** Set a single column lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setColLower( int elementIndex, double elementValue ); /** Set a single column upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setColUpper( int elementIndex, double elementValue ); /** Set a single column lower and upper bound
    The default implementation just invokes setColLower and setColUpper */ virtual void setColBounds( int elementIndex, double lower, double upper ); #if 0 // we are using the default implementation of OsiSolverInterface /** Set the bounds on a number of columns simultaneously
    The default implementation just invokes setCollower and setColupper over and over again. @param [indexfirst,indexLast) contains the indices of the constraints whose either bound changes @param indexList the indices of those variables @param boundList the new lower/upper bound pairs for the variables */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); #endif /** Set a single row lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setRowLower( int elementIndex, double elementValue ); /** Set a single row upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setRowUpper( int elementIndex, double elementValue ); /** Set a single row lower and upper bound
    The default implementation just invokes setRowUower and setRowUpper */ virtual void setRowBounds( int elementIndex, double lower, double upper ); /** Set the type of a single row
    */ virtual void setRowType(int index, char sense, double rightHandSide, double range); #if 0 // we are using the default implementation of OsiSolverInterface /** Set the bounds on a number of rows simultaneously
    The default implementation just invokes setRowlower and setRowupper over and over again. @param [indexfirst,indexLast) contains the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the constraints */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a number of rows simultaneously
    The default implementation just invokes setRowtype and over and over again. @param [indexfirst,indexLast) contains the indices of the constraints whose type changes @param senseList the new senses @param rhsList the new right hand sides @param rangeList the new ranges */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); #endif //@} //------------------------------------------------------------------------- /**@name Integrality related changing methods */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index); /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index); #if 0 // we are using the default implementation of OsiSolverInterface /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); #endif //@} //------------------------------------------------------------------------- /// Set objective function sense (1 for min (default), -1 for max,) virtual void setObjSense(double s); /** Set the primal solution column values colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double * colsol); /** Set dual solution vector rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice); //------------------------------------------------------------------------- /**@name Methods to expand a problem.
    Note that if a column is added then by default it will correspond to a continuous variable. */ //@{ /** */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj); #if 0 // we are using the default implementation of OsiSolverInterface /** */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); #endif /** */ virtual void deleteCols(const int num, const int * colIndices); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng); #if 0 // we are using the default implementation of OsiSolverInterface /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); #endif /** */ virtual void deleteRows(const int num, const int * rowIndices); #if 0 // we are using the default implementation of OsiSolverInterface //----------------------------------------------------------------------- /** Apply a collection of cuts.
    Only cuts which have an effectiveness >= effectivenessLb are applied.
    • ReturnCode.numberIneffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
    • ReturnCode.numberInconsistent() -- number of invalid cuts
    • ReturnCode.numberInconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
    • ReturnCode.numberInfeasible() -- number of cuts that would make this integer model infeasible
    • ReturnCode.numberApplied() -- number of integer cuts which were applied to the integer model
    • cs.size() == numberIneffective() + numberInconsistent() + numberInconsistentWrtIntegerModel() + numberInfeasible() + nubmerApplied()
    */ virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); #endif //@} //@} //--------------------------------------------------------------------------- /**@name Methods to input a problem */ //@{ /** Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • rowub: all rows have upper bound infinity
    • rowlb: all rows have lower bound -infinity
    • obj: all variables have 0 objective coefficient
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub); /** Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • obj: all variables have 0 objective coefficient
    • rowsen: all rows are >=
    • rowrhs: all right hand sides are 0
    • rowrng: 0 for the ranged rows
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Read an mps file from the given filename */ virtual int readMps(const char *filename, const char *extension = "mps"); /** Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants */ virtual void writeMps(const char *filename, const char *extension = "mps", double objSense=0.0) const; //@} //--------------------------------------------------------------------------- /**@name Constructors and destructor */ //@{ /// Default Constructor OsiSpxSolverInterface(); /// Clone virtual OsiSolverInterface * clone(bool copyData = true) const; /// Copy constructor OsiSpxSolverInterface( const OsiSpxSolverInterface& ); /// Assignment operator OsiSpxSolverInterface& operator=( const OsiSpxSolverInterface& rhs ); /// Destructor virtual ~OsiSpxSolverInterface(); //@} protected: /**@name Protected methods */ //@{ /// Apply a row cut. Return true if cut was applied. virtual void applyRowCut( const OsiRowCut & rc ); /** Apply a column cut (bound adjustment). Return true if cut was applied. */ virtual void applyColCut( const OsiColCut & cc ); //@} /**@name Protected member data */ //@{ /// SoPlex solver object soplex::SoPlex* soplex_; //@} private: /**@name Private methods */ //@{ /// free cached column rim vectors void freeCachedColRim(); /// free cached row rim vectors void freeCachedRowRim(); /// free cached result vectors void freeCachedResults(); /// free cached matrices void freeCachedMatrix(); enum keepCachedFlag { /// discard all cached data (default) KEEPCACHED_NONE = 0, /// column information: objective values, lower and upper bounds, variable types KEEPCACHED_COLUMN = 1, /// row information: right hand sides, ranges and senses, lower and upper bounds for row KEEPCACHED_ROW = 2, /// problem matrix: matrix ordered by column and by row KEEPCACHED_MATRIX = 4, /// LP solution: primal and dual solution, reduced costs, row activities KEEPCACHED_RESULTS = 8, /// only discard cached LP solution KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX, /// keep all cached data (similar to getMutableLpPtr()) KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS, /// free only cached column and LP solution information FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN, /// free only cached row and LP solution information FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW, /// free only cached matrix and LP solution information FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX, /// free only cached LP solution information FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS }; /// free all cached data (except specified entries, see getLpPtr()) void freeCachedData( int keepCached = KEEPCACHED_NONE ); /// free all allocated memory void freeAllMemory(); //@} /**@name Private member data */ //@{ /// indices of integer variables soplex::DIdxSet* spxintvars_; /// Hotstart information void* hotStartCStat_; int hotStartCStatSize_; void* hotStartRStat_; int hotStartRStatSize_; int hotStartMaxIteration_; /**@name Cached information derived from the SoPlex model */ //@{ /// Pointer to objective Vector mutable soplex::DVector *obj_; /// Pointer to dense vector of row sense indicators mutable char *rowsense_; /// Pointer to dense vector of row right-hand side values mutable double *rhs_; /// Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) mutable double *rowrange_; /// Pointer to primal solution vector mutable soplex::DVector *colsol_; /// Pointer to dual solution vector mutable soplex::DVector *rowsol_; /// Pointer to reduced cost vector mutable soplex::DVector *redcost_; /// Pointer to row activity (slack) vector mutable soplex::DVector *rowact_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByRow_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByCol_; //@} //@} }; //############################################################################# /** A function that tests the methods in the OsiSpxSolverInterface class. */ void OsiSpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); #endif Osi-0.106.4/src/OsiSpx/Makefile.in0000644000076600007660000005416212240315110015150 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/OsiSpx DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsiSpx_la_LIBADD = am_libOsiSpx_la_OBJECTS = OsiSpxSolverInterface.lo libOsiSpx_la_OBJECTS = $(am_libOsiSpx_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsiSpx_la_SOURCES) DIST_SOURCES = $(libOsiSpx_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiSpx # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiSpx.la # List all source files for this library, including headers libOsiSpx_la_SOURCES = OsiSpxSolverInterface.cpp OsiSpxSolverInterface.hpp # This is for libtool libOsiSpx_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../Osi` $(COINUTILS_CFLAGS) $(SOPLEX_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiSpxSolverInterface.hpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OsiSpx/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/OsiSpx/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsiSpx.la: $(libOsiSpx_la_OBJECTS) $(libOsiSpx_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsiSpx_la_LDFLAGS) $(libOsiSpx_la_OBJECTS) $(libOsiSpx_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiSpxSolverInterface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/OsiSpx/osi-soplex.pc.in0000644000076600007660000000051211564020404016133 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: OsiSoplex Description: COIN-OR Open Solver Interface for SoPlex URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsiSpx @OSISPXLIB_PCLIBS@ Cflags: -I${includedir} Requires: osi @OSISPXLIB_PCREQUIRES@ Osi-0.106.4/src/OsiSpx/osi-soplex-uninstalled.pc.in0000644000076600007660000000046311573154674020501 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src/OsiSpx Name: OsiSoplex Description: COIN-OR Open Solver Interface for SoPlex URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: ${libdir}/libOsiSpx.la @OSISPXLIB_PCLIBS@ Cflags: -I@abs_source_dir@/src/OsiSpx Requires: osi @OSISPXLIB_PCREQUIRES@ Osi-0.106.4/src/OsiMsk/0000755000076600007660000000000012244064313013065 5ustar coincoinOsi-0.106.4/src/OsiMsk/OsiMskSolverInterface.cpp0000644000076600007660000044507712244006221020025 0ustar coincoin/* Osi interface for Mosek ver. 7.0 Lower versions are not supported ----------------------------------------------------------------------------- name: OSI Interface for MOSEK ----------------------------------------------------------------------------- This code is licensed under the terms of the Eclipse Public License (EPL). Originally developed by Bo Jensen from MOSEK ApS. No longer a maintainer. */ #include #include #include #include #include "OsiConfig.h" #include "CoinPragma.hpp" #include "CoinError.hpp" #include "CoinFinite.hpp" #include "OsiMskSolverInterface.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" #include "mosek.h" #define MSK_OSI_DEBUG_LEVEL 0 #ifndef NDEBUG #define MSK_OSI_ASSERT_LEVEL 0 #else #define MSK_OSI_ASSERT_LEVEL 4 #endif #define MSK_DO_MOSEK_LOG 0 #define debugMessage printf //Choose algorithm to be default in initial solve #define INITIAL_SOLVE MSK_OPTIMIZER_FREE //Choose algorithm to be default in resolve #define RESOLVE_SOLVE MSK_OPTIMIZER_FREE_SIMPLEX // Unset this flag to disable the warnings from interface. #define MSK_WARNING_ON #undef getc //############################################################################# // A couple of helper functions //############################################################################# // Free memory pointet to by a double pointer inline void freeCacheDouble( double*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } // Free memory pointet to by a char pointer inline void freeCacheChar( char*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } // Free memory pointet to by a CoinPackedMatrix pointer inline void freeCacheMatrix( CoinPackedMatrix*& ptr ) { if( ptr != NULL ) { delete ptr; ptr = NULL; } } // Function used to connect MOSEK to stream #if MSK_VERSION_MAJOR >= 7 static void MSKAPI printlog(void *ptr, const char* s) #else static void MSKAPI printlog(void *ptr, char* s) #endif { printf("%s",s); } static void MSKAPI OsiMskStreamFuncLog(MSKuserhandle_t handle, MSKCONST char* str) { if (handle) { if (((CoinMessageHandler*)handle)->logLevel() >= 1) ((CoinMessageHandler*)handle)->message(0, "MSK", str, ' ') << CoinMessageEol; } else { printf(str); printf("\n"); } } static void MSKAPI OsiMskStreamFuncWarning(MSKuserhandle_t handle, MSKCONST char* str) { if (handle) { if (((CoinMessageHandler*)handle)->logLevel() >= 0) ((CoinMessageHandler*)handle)->message(0, "MSK", str, ' ') << CoinMessageEol; } else { printf(str); printf("\n"); } } static void MSKAPI OsiMskStreamFuncError(MSKuserhandle_t handle, MSKCONST char* str) { if (handle) { ((CoinMessageHandler*)handle)->message(0, "MSK", str, ' ') << CoinMessageEol; } else { fprintf(stderr, str); fprintf(stderr, "\n"); } } // Prints a error message and throws a exception static inline void checkMSKerror( int err, std::string mskfuncname, std::string osimethod ) { if( err != MSK_RES_OK ) { char s[100]; sprintf( s, "%s returned error %d", mskfuncname.c_str(), err ); std::cout << "ERROR: " << s << " (" << osimethod << " in OsiMskSolverInterface)" << std::endl; throw CoinError( s, osimethod.c_str(), "OsiMskSolverInterface" ); } } // Prints a error message and throws a exception static inline void MSKassert(int assertlevel, int test, std::string assertname, std::string osimethod ) { if( assertlevel > MSK_OSI_ASSERT_LEVEL && !test ) { char s[100]; sprintf( s, "%s", assertname.c_str()); std::cout << "Assert: " << s << " (" << osimethod << " in OsiMskSolverInterface)" << std::endl; throw CoinError( s, osimethod.c_str(), "OsiMskSolverInterface" ); } } // Prints a warning message, can be shut off by undefining MSK_WARNING_ON static inline void OsiMSK_warning(std::string osimethod, std::string warning) { std::cout << "OsiMsk_warning: "<= 0 ) { rlb = rowrhs - rowrng; rub = rowrhs; } else { rlb = rowrhs; rub = rowrhs + rowrng; } rtag = MSK_BK_RA; break; case 'N': rlb = -MSK_INFINITY; rub = MSK_INFINITY; rtag = MSK_BK_FR; break; default: MSKassert(3,1,"Unknown rowsen","MskConvertSenseToBound"); } } // Converts a set of bounds to MSK boundkeys static inline void MskConvertColBoundToTag(const double collb, const double colub, double &clb, double &cub, int &ctag) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin MskConvertColBoundToTag()\n"); #endif if(collb > -MSK_INFINITY && colub < MSK_INFINITY) { ctag = MSK_BK_RA; clb = collb; cub = colub; } else if(collb <= - MSK_INFINITY && colub < MSK_INFINITY) { ctag = MSK_BK_UP; clb = -MSK_INFINITY; cub = colub; } else if(collb > - MSK_INFINITY && colub >= MSK_INFINITY) { ctag = MSK_BK_LO; clb = collb; cub = MSK_INFINITY; } else if(collb <= -MSK_INFINITY && colub >= MSK_INFINITY) { ctag = MSK_BK_FR; clb = -MSK_INFINITY; cub = MSK_INFINITY; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End MskConvertColBoundToTag()\n"); #endif } // Returns true if "solution" is defined in MOSEK, where solution can be basic, interior or // integer resp. (MSK_SOL_BAS), (MSK_SOL_ITR) or (MSK_SOL_ITG). bool OsiMskSolverInterface::definedSolution(int solution) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::definedSolution() %p\n",(void*)this); #endif int err, res; err = MSK_solutiondef(getMutableLpPtr(), (MSKsoltypee) solution, &res); checkMSKerror(err,"MSK_solutiondef","definedSolution"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::definedSolution()\n"); #endif return ( res != MSK_RES_OK); } // Returns the flag for solver currently switched on in MOSEK resp. (MSK_OPTIMIZER_FREE), // (MSK_OPTIMIZER_INTPNT), (MSK_OPTIMIZER_PRIMAL_SIMPLEX), (MSK_OPTIMIZER_MIXED_INT), or // (MSK_OPTIMIZER_MIXED_INT_CONIC). // MOSEK also has Conic and nonconvex solvers, but these are for obvious reasons not // an option in the Osi interface. int OsiMskSolverInterface::solverUsed() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::solverUsed()\n"); #endif #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::solverUsed()\n"); #endif return MSKsolverused_; } // Switch the MOSEK solver to LP uses default solver specified by 'InitialSolver' void OsiMskSolverInterface::switchToLP( void ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::switchToLP()\n"); #endif int err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_MIO_MODE, MSK_MIO_MODE_IGNORED); checkMSKerror(err,"MSK_putintparam","switchToLp"); probtypemip_ = false; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::switchToLP()\n"); #endif } // Switch the MOSEK solver to MIP. void OsiMskSolverInterface::switchToMIP( void ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::switchToMIP()\n"); #endif int err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_MIO_MODE, MSK_MIO_MODE_SATISFIED); checkMSKerror(err,"MSK_putintparam","switchToMIP"); #if MSK_VERSION_MAJOR >= 7 err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_MIXED_INT_CONIC); #else err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_MIXED_INT); #endif checkMSKerror(err,"MSK_putintparam","switchToMIP"); probtypemip_ = true; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::switchToMIP()\n"); #endif } // Resize the coltype array. void OsiMskSolverInterface::resizeColType( int minsize ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::resizeColType()\n"); #endif if( minsize > coltypesize_ ) { int newcoltypesize = 2*coltypesize_; if( minsize > newcoltypesize ) newcoltypesize = minsize; char *newcoltype = new char[newcoltypesize]; if( coltype_ != NULL ) { CoinDisjointCopyN( coltype_, coltypesize_, newcoltype ); delete[] coltype_; } coltype_ = newcoltype; coltypesize_ = newcoltypesize; } MSKassert(3,minsize == 0 || coltype_ != NULL,"Unknown rowsen","MskConvertSenseToBound"); MSKassert(3,coltypesize_ >= minsize,"coltypesize_ >= minsize","MskConvertSenseToBound"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::resizeColType()\n"); #endif } // Free coltype array void OsiMskSolverInterface::freeColType() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::freeColType()\n"); #endif if( coltypesize_ > 0 ) { delete[] coltype_; coltype_ = NULL; coltypesize_ = 0; } MSKassert(3,coltype_ == NULL,"coltype_ == NULL","freeColType"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::freeColType()\n"); #endif } //############################################################################# // Solve methods //############################################################################# //----------------------------------------------------------------------------- // Free cached results and optimize the LP problem in task void OsiMskSolverInterface::initialSolve() { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::initialSolve() %p\n", (void*)this); #endif if( definedSolution( MSK_SOL_BAS ) == true ) { resolve(); } else { int err,solver; err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_SIM_HOTSTART, MSK_SIM_HOTSTART_STATUS_KEYS); checkMSKerror(err,"MSK_putintparam","initialsolve"); err = MSK_getintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, &solver); checkMSKerror(err,"MSK_getintparam","initialsolve"); switchToLP(); err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, INITIAL_SOLVE); checkMSKerror(err,"MSK_putintparam","initialSolve"); err = MSK_getintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, &MSKsolverused_); checkMSKerror(err,"MSK_getintparam","initialsolve"); #if MSK_DO_MOSEK_LOG > 0 err = MSK_putintparam( getMutableLpPtr(),MSK_IPAR_LOG_SIM,MSK_DO_MOSEK_LOG); checkMSKerror(err,"MSK_putintparam","initialsolve"); #endif Mskerr = MSK_optimize(getLpPtr( OsiMskSolverInterface::FREECACHED_RESULTS )); #if MSK_DO_MOSEK_LOG > 0 err = MSK_solutionsummary( getMutableLpPtr(),MSK_STREAM_LOG); checkMSKerror(err,"MSK_solutionsummary","initialsolve"); #endif err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, solver); checkMSKerror(err,"MSK_putintparam","initialsolve"); } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::initialSolve()\n"); #endif } //----------------------------------------------------------------------------- // Resolves an LP problem. void OsiMskSolverInterface::resolve() { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::resolve %p\n", (void*)this); #endif if( definedSolution( MSK_SOL_BAS ) == true ) { int err,solver; err = MSK_getintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, &solver); checkMSKerror(err,"MSK_getintparam","resolve"); switchToLP(); err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_SIM_HOTSTART, MSK_SIM_HOTSTART_STATUS_KEYS); checkMSKerror(err,"MSK_putintparam","resolve"); err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, RESOLVE_SOLVE); checkMSKerror(err,"MSK_putintparam","resolve"); #if 0 err = MSK_putintparam( getMutableLpPtr(), MSK_IPAR_SIM_MAX_ITERATIONS, 20000000 ); #endif err = MSK_getintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, &MSKsolverused_); checkMSKerror(err,"MSK_getintparam","resolve"); #if MSK_DO_MOSEK_LOG > 0 err = MSK_putintparam( getMutableLpPtr(),MSK_IPAR_LOG,MSK_DO_MOSEK_LOG); checkMSKerror(err,"MSK_putintparam","resolve"); err = MSK_putintparam( getMutableLpPtr(),MSK_IPAR_LOG_SIM,MSK_DO_MOSEK_LOG); checkMSKerror(err,"MSK_putintparam","resolve"); #endif Mskerr = MSK_optimize(getLpPtr( OsiMskSolverInterface::FREECACHED_RESULTS )); #if MSK_DO_MOSEK_LOG > 0 err = MSK_solutionsummary( getMutableLpPtr(),MSK_STREAM_LOG); printf("Mskerr : %d\n",Mskerr); #endif err = MSK_putintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, solver); checkMSKerror(err,"MSK_putintparam","resolve"); } else { initialSolve(); } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::resolve... press any key to continue\n"); getchar(); #endif } //----------------------------------------------------------------------------- // Resolves an MIP problem with MOSEK MIP solver. void OsiMskSolverInterface::branchAndBound() { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::branchAndBound()\n"); #endif switchToMIP(); int err = MSK_getintparam(getMutableLpPtr(), MSK_IPAR_OPTIMIZER, &MSKsolverused_); checkMSKerror(err,"MSK_getintparam","branchAndBound"); Mskerr = MSK_optimize(getLpPtr( OsiMskSolverInterface::FREECACHED_RESULTS )); #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::branchAndBound()\n"); #endif } //############################################################################# // Parameter related methods //############################################################################# //----------------------------------------------------------------------------- // Sets a int parameter in MOSEK bool OsiMskSolverInterface::setIntParam(OsiIntParam key, int value) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setIntParam(%d, %d)\n", key, value); #endif bool retval = false; switch (key) { case OsiMaxNumIteration: retval = (MSK_putintparam(getMutableLpPtr(), MSK_IPAR_SIM_MAX_ITERATIONS, value ) == MSK_RES_OK); break; case OsiMaxNumIterationHotStart: if (value < 0) { retval = false; } else { hotStartMaxIteration_ = value; retval = true; } break; case OsiNameDiscipline: retval = false; break; case OsiLastIntParam: retval = false; break; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setIntParam(%d, %d)\n", key, value); #endif return retval; } //----------------------------------------------------------------------------- // Sets a double parameter in MOSEK. bool OsiMskSolverInterface::setDblParam(OsiDblParam key, double value) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setDblParam(%d, %g)\n", key, value); #endif bool retval = false; switch (key) { case OsiDualObjectiveLimit: if( getObjSense() == +1 ) // Minimize retval = ( MSK_putdouparam( getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, value ) == MSK_RES_OK ); // min else retval = ( MSK_putdouparam( getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, value ) == MSK_RES_OK ); // max break; case OsiPrimalObjectiveLimit: if( getObjSense() == +1 ) // Minimize retval = ( MSK_putdouparam( getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, value ) == MSK_RES_OK ); // min else retval = ( MSK_putdouparam( getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, value ) == MSK_RES_OK ); // max break; case OsiDualTolerance: retval = ( MSK_putdouparam( getMutableLpPtr(), MSK_DPAR_BASIS_TOL_S, value ) == MSK_RES_OK ); break; case OsiPrimalTolerance: retval = ( MSK_putdouparam( getMutableLpPtr(), MSK_DPAR_BASIS_TOL_X, value ) == MSK_RES_OK ); break; case OsiObjOffset: ObjOffset_ = value; retval = true; break; case OsiLastDblParam: retval = false; break; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setDblParam(%d, %g)\n", key, value); #endif return retval; } //----------------------------------------------------------------------------- // Sets a string parameter in MOSEK. bool OsiMskSolverInterface::setStrParam(OsiStrParam key, const std::string & value) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setStrParam(%d, %s)\n", key, value.c_str()); #endif bool retval=false; switch (key) { case OsiProbName: OsiSolverInterface::setStrParam(key,value); return retval = true; case OsiSolverName: return false; case OsiLastStrParam: return false; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setStrParam(%d, %s)\n", key, value.c_str()); #endif return retval; } //----------------------------------------------------------------------------- // Gets a int parameter in MOSEK. bool OsiMskSolverInterface::getIntParam(OsiIntParam key, int& value) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getIntParam(%d)\n", key); #endif bool retval = false; switch (key) { case OsiMaxNumIteration: retval = (MSK_getintparam(getMutableLpPtr(), MSK_IPAR_SIM_MAX_ITERATIONS, &value ) == MSK_RES_OK); break; case OsiMaxNumIterationHotStart: value = hotStartMaxIteration_; retval = true; break; case OsiNameDiscipline: value = 0; retval = false; break; case OsiLastIntParam: retval = false; break; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getIntParam(%d)\n", key); #endif return retval; } //----------------------------------------------------------------------------- // Get a double parameter in MOSEK. bool OsiMskSolverInterface::getDblParam(OsiDblParam key, double& value) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getDblParam(%d)\n", key); #endif bool retval = false; switch (key) { case OsiDualObjectiveLimit: if( getObjSense() == +1 ) retval = ( MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, &value ) == MSK_RES_OK ); // max else retval = ( MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, &value ) == MSK_RES_OK ); // min break; case OsiPrimalObjectiveLimit: if( getObjSense() == +1 ) retval = ( MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, &value ) == MSK_RES_OK ); // min else retval = ( MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, &value ) == MSK_RES_OK ); // max break; case OsiDualTolerance: retval = ( MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_BASIS_TOL_S, &value ) == MSK_RES_OK ); break; case OsiPrimalTolerance: retval = ( MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_BASIS_TOL_X, &value ) == MSK_RES_OK ); break; case OsiObjOffset: value = ObjOffset_; retval = true; break; case OsiLastDblParam: retval = false; break; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getDblParam(%d)\n", key); #endif return retval; } //----------------------------------------------------------------------------- // Gets a string parameter from MOSEK bool OsiMskSolverInterface::getStrParam(OsiStrParam key, std::string & value) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getStrParam(%d)\n", key); #endif switch (key) { case OsiProbName: OsiSolverInterface::getStrParam(key, value); break; case OsiSolverName: value = "MOSEK"; break; case OsiLastStrParam: return false; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getStrParam(%d)\n", key); #endif return true; } //############################################################################# // Methods returning info on how the solution process terminated //############################################################################# //----------------------------------------------------------------------------- // Returns true if solver abandoned in last call to solver. // Mosek does not use this functionality bool OsiMskSolverInterface::isAbandoned() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isAbandoned()\n"); debugMessage("isAbandoned() %d\n",(Mskerr != MSK_RES_OK)); debugMessage("End OsiMskSolverInterface::isAbandoned()\n"); #endif return (Mskerr != MSK_RES_OK); } //----------------------------------------------------------------------------- // Returns true if "solution" available is proved to be optimal, where "solution" in LP // could be both interior and basic, checks for both. bool OsiMskSolverInterface::isProvenOptimal() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isProvenOptimal()\n"); #endif int err; MSKsolstae status; MSKsoltypee solution; if( probtypemip_ == false) { if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else { if( definedSolution( MSK_SOL_ITR ) == true ) solution = MSK_SOL_ITR; else return false; } } else { if( definedSolution( MSK_SOL_ITG ) == true ) solution = MSK_SOL_ITG; else return false; } err = MSK_getsolution(getMutableLpPtr(), solution, NULL, &status, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror(err,"MSK_getsolution","isProvenOptimal"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Solution type , %d status %d \n ",(status == MSK_SOL_STA_OPTIMAL), status) ; debugMessage("End OsiMskSolverInterface::isProvenOptimal()\n"); #endif return ( status == MSK_SOL_STA_OPTIMAL || status == MSK_SOL_STA_INTEGER_OPTIMAL); } //----------------------------------------------------------------------------- // Returns true if a certificate of primal inf. exits bool OsiMskSolverInterface::isProvenPrimalInfeasible() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isProvenPrimalInfeasible()\n"); #endif int err; MSKsolstae status; MSKsoltypee solution; if( probtypemip_ == false) { if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else { if( definedSolution( MSK_SOL_ITR ) == true ) solution = MSK_SOL_ITR; else return false; } } else { if( definedSolution( MSK_SOL_ITG ) == true) solution = MSK_SOL_ITG; else return false; } err = MSK_getsolution(getMutableLpPtr(), solution, NULL, &status, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror(err,"MSK_getsolution","isProvenPrimalInfeasible"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("isProvenPrimalInfeasible %d \n",(status == MSK_SOL_STA_PRIM_INFEAS_CER)); debugMessage("End OsiMskSolverInterface::isProvenPrimalInfeasible()\n"); #endif return ( status == MSK_SOL_STA_PRIM_INFEAS_CER ); } //----------------------------------------------------------------------------- // Should return true if a certificate of dual inf. exits // But COIN does not support this feature thus we return false bool OsiMskSolverInterface::isProvenDualInfeasible() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isProvenDualInfeasible()\n"); #endif int err; MSKsolstae status; MSKsoltypee solution; if( probtypemip_ == false ) { if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else { if( definedSolution( MSK_SOL_ITR ) == true ) solution = MSK_SOL_ITR; else return false; } } else { if( definedSolution( MSK_SOL_ITG ) == true) solution = MSK_SOL_ITG; else return false; } err = MSK_getsolution(getMutableLpPtr(), solution, NULL, &status, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ); checkMSKerror(err,"MSK_getsolution","isProvenDualInfeasible"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("isProvenDualInfeasible %d \n",(status == MSK_SOL_STA_DUAL_INFEAS_CER)); debugMessage("End OsiMskSolverInterface::isProvenDualInfeasible()\n"); #endif return ( status == MSK_SOL_STA_DUAL_INFEAS_CER ); } //----------------------------------------------------------------------------- // Returns true if primal objective limit is reached. Checks the objective sense // first. bool OsiMskSolverInterface::isPrimalObjectiveLimitReached() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isPrimalObjectiveLimitReached()\n"); #endif if( Mskerr == MSK_RES_TRM_OBJECTIVE_RANGE ) { int err; double obj = getObjValue(),value=MSK_INFINITY; if( getObjSense() == +1 ) { err = MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, &value); checkMSKerror(err,"MSK_getdouparam","isPrimalObjectiveLimitReached"); } else { err = MSK_getdouparam(getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, &value ); checkMSKerror(err,"MSK_getdouparam","isPrimalObjectiveLimitReached"); obj = -obj; value = -value; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("primal objective value %-16.10e , lowerbound %-16.10e , reached %d \n",obj,value,(value <= obj)); debugMessage("End OsiMskSolverInterface::isPrimalObjectiveLimitReached()\n"); #endif return ( !( value == MSK_INFINITY || value == -MSK_INFINITY ) && value > obj ); } else { if( Mskerr == MSK_RES_OK ) { if( definedSolution( MSK_SOL_BAS ) == true ) { int err; double obj = getObjValue(),value=MSK_INFINITY; if( getObjSense() == +1 ) { err = MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, &value); checkMSKerror(err,"MSK_getdouparam","isPrimalObjectiveLimitReached"); return (obj < value); } else { err = MSK_getdouparam(getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, &value ); checkMSKerror(err,"MSK_getdouparam","isPrimalObjectiveLimitReached"); obj = -obj; value = -value; return (obj < value); } } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::isPrimalObjectiveLimitReached()\n"); #endif return false; } } //----------------------------------------------------------------------------- // Returns true if dual objective limit is reached. Checks the objective sense // first. bool OsiMskSolverInterface::isDualObjectiveLimitReached() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isDualObjectiveLimitReached()\n"); #endif if( Mskerr == MSK_RES_TRM_OBJECTIVE_RANGE ) { int err; double obj = getObjValue(),value=MSK_INFINITY; if( getObjSense() == +1 ) { err = MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, &value); checkMSKerror(err,"MSK_getdouparam","isDualObjectiveLimitReached"); } else { err = MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, &value ); checkMSKerror(err,"MSK_getdouparam","isDualObjectiveLimitReached"); obj = -obj; value = -value; } checkMSKerror( err, "MSK_getdouparam", "isPrimalObjectiveLimitReached" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("dual objective value %f , lowerbound %f , reached %i \n",obj,value,(value <= obj)); debugMessage("End OsiMskSolverInterface::isDualObjectiveLimitReached()\n"); #endif return ( !( value == MSK_INFINITY || value == -MSK_INFINITY ) && value <= obj ); } else { if( Mskerr == MSK_RES_OK ) { if( definedSolution( MSK_SOL_BAS ) == true ) { int err; double obj = getObjValue(),value=MSK_INFINITY; if( getObjSense() == +1 ) { err = MSK_getdouparam( getMutableLpPtr(), MSK_DPAR_UPPER_OBJ_CUT, &value); checkMSKerror(err,"MSK_getdouparam","isDualObjectiveLimitReached"); return (obj > value); } else { err = MSK_getdouparam(getMutableLpPtr(), MSK_DPAR_LOWER_OBJ_CUT, &value ); checkMSKerror(err,"MSK_getdouparam","isDualObjectiveLimitReached"); obj = -obj; value = -value; return (obj > value); } } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::isDualObjectiveLimitReached()\n"); #endif return false; } } //----------------------------------------------------------------------------- // Returns true if iteration number used in last call to optimize eq. max number for // the solver used. bool OsiMskSolverInterface::isIterationLimitReached() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isIterationLimitReached()\n"); #endif #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("iteration limit reached %d \n",Mskerr); debugMessage("End OsiMskSolverInterface::isIterationLimitReached()\n"); #endif return Mskerr == MSK_RES_TRM_MAX_ITERATIONS; } //----------------------------------------------------------------------------- // Returns true if a license problem occured in last call to optimize. bool OsiMskSolverInterface::isLicenseError() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isLicenseError()\n"); #endif #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("license error %d \n",Mskerr); debugMessage("End OsiMskSolverInterface::isLicenseError()\n"); #endif return Mskerr >= MSK_RES_ERR_LICENSE && Mskerr <= MSK_RES_ERR_LICENSE_NO_SERVER_SUPPORT; } //############################################################################# // WarmStart related methods //############################################################################# // Get an empty warm start object CoinWarmStart* OsiMskSolverInterface::getEmptyWarmStart () const { return (dynamic_cast(new CoinWarmStartBasis())) ; } //----------------------------------------------------------------------------- // Get warm start, returns NULL pointer if not available CoinWarmStart* OsiMskSolverInterface::getWarmStart() const { CoinWarmStartBasis* ws = NULL; int numbas = 0,numcols = getNumCols(),numrows = getNumRows(),*skx,*skc, err, i,*bkc,*bkx; double *blc,*buc,*blx,*bux,*xc,*xx; bool skip = false; #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::getWarmStart numcols %d numrows %d %p\n",numcols,numrows, (void*)this); #endif skx = new int[numcols]; skc = new int[numrows]; bkc = new int[numrows]; blc = new double[numrows]; buc = new double[numrows]; xc = new double[numrows]; bkx = new int[numcols]; blx = new double[numcols]; bux = new double[numcols]; xx = new double[numcols]; err = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_CON, 0, numrows, (MSKboundkeye*)bkc, (MSKrealt*)blc, (MSKrealt*)buc); checkMSKerror( err, "MSK_getsolution", "getWarmStart" ); err = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_VAR, 0, numcols, (MSKboundkeye*)bkx, (MSKrealt*)blx, (MSKrealt*)bux); checkMSKerror( err, "MSK_getsolution", "getWarmStart" ); MSKassert(3,!probtypemip_,"!probtypemip_","getWarmStart"); if( definedSolution( MSK_SOL_BAS ) == true ) { err = MSK_getsolution(getMutableLpPtr(), MSK_SOL_BAS, NULL, NULL, (MSKstakeye*)skc, (MSKstakeye*)skx, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror( err, "MSK_getsolution", "getWarmStart" ); } else { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("No basic solution in OsiMskSolverInterface::getWarmStart()\n"); #endif /* No basic solution stored choose slack basis */ /* Otherwise the unittest can not be passed */ ws = new CoinWarmStartBasis; ws->setSize( numcols, numrows ); for( i = 0; i < numrows; ++i ) ws->setArtifStatus( i, CoinWarmStartBasis::basic ); numbas = numrows; for( i = 0; i < numcols; ++i ) { switch(bkx[i]) { case MSK_BK_RA: case MSK_BK_LO: ws->setStructStatus( i, CoinWarmStartBasis::atLowerBound ); break; case MSK_BK_FX: case MSK_BK_UP: ws->setStructStatus( i, CoinWarmStartBasis::atUpperBound ); break; case MSK_BK_FR: ws->setStructStatus( i, CoinWarmStartBasis::isFree ); break; default: checkMSKerror( 1, "Wrong bound key", "getWarmStart" ); } } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::getWarmStart()\n"); #endif delete[] skc; delete[] skx; delete[] bkc; delete[] blc; delete[] buc; delete[] xc; delete[] bkx; delete[] blx; delete[] bux; delete[] xx; /* Leave function */ return ws; } if( err == MSK_RES_OK ) { /* Status keys should be defined */ ws = new CoinWarmStartBasis; MSKassert(3,ws != NULL,"1) ws != NULL","getWarmStart"); ws->setSize( numcols, numrows ); for( i = 0; i < numrows && ws != NULL; ++i ) { switch( skc[i] ) { case MSK_SK_UNK: case MSK_SK_BAS: /* Warning : Slacks in Osi and Mosek er negated */ ws->setArtifStatus( i, CoinWarmStartBasis::basic ); ++numbas; break; case MSK_SK_LOW: /* Warning : Slacks in Osi and Mosek er negated */ ws->setArtifStatus( i, CoinWarmStartBasis::atUpperBound ); break; case MSK_SK_FIX: case MSK_SK_UPR: /* Warning : Slacks in Osi and Mosek er negated */ ws->setArtifStatus( i, CoinWarmStartBasis::atLowerBound ); break; case MSK_SK_SUPBAS: ws->setArtifStatus( i, CoinWarmStartBasis::isFree ); break; default: // unknown row status delete ws; ws = NULL; skip = true; checkMSKerror( 1, "Wrong slack status key", "getWarmStart" ); break; } } if( skip == false ) { for( i = 0; i < numcols && ws != NULL; ++i ) { switch( skx[i] ) { case MSK_SK_UNK: case MSK_SK_BAS: ++numbas; ws->setStructStatus( i, CoinWarmStartBasis::basic ); break; case MSK_SK_FIX: case MSK_SK_LOW: ws->setStructStatus( i, CoinWarmStartBasis::atLowerBound ); break; case MSK_SK_UPR: ws->setStructStatus( i, CoinWarmStartBasis::atUpperBound ); break; case MSK_SK_SUPBAS: ws->setStructStatus( i, CoinWarmStartBasis::isFree ); break; default: // unknown column status delete ws; ws = NULL; checkMSKerror( 1, "Wrong variable status key", "getWarmStart" ); break; } } } } delete[] skx; delete[] skc; delete[] bkc; delete[] blc; delete[] buc; delete[] xc; delete[] bkx; delete[] blx; delete[] bux; delete[] xx; MSKassert(3,ws!=NULL,"2) ws!=NULL","getWarmStart"); #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::getWarmStart() (%p) numcols %d numrows %d numbas %d\n",(void*)(ws),numcols,numrows,numbas); #endif return ws; } //----------------------------------------------------------------------------- // Set warm start bool OsiMskSolverInterface::setWarmStart(const CoinWarmStart* warmstart) { const CoinWarmStartBasis* ws = dynamic_cast(warmstart); int numcols, numrows, i, restat,numbas=0; int *skx, *skc, *bkc, *bkx; bool retval = false, skip = false; if( !ws ) return false; numcols = ws->getNumStructural(); numrows = ws->getNumArtificial(); #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::setWarmStart(%p) this = %p numcols %d numrows %d\n", (void *)warmstart,(void*)this,numcols,numrows); #endif if( numcols != getNumCols() || numrows != getNumRows() ) return false; switchToLP(); skx = new int[numcols]; skc = new int[numrows]; bkc = new int[numrows]; restat = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_CON, 0, numrows, (MSKboundkeye*) (bkc), NULL, NULL); checkMSKerror( restat, "MSK_getboundslice", "setWarmStart" ); for( i = 0; i < numrows; ++i ) { switch( ws->getArtifStatus( i ) ) { case CoinWarmStartBasis::basic: skc[i] = MSK_SK_BAS; ++numbas; break; /* Warning : Slacks in Osi and Mosek er negated */ case CoinWarmStartBasis::atUpperBound: switch(bkc[i]) { case MSK_BK_LO: case MSK_BK_RA: skc[i] = MSK_SK_LOW; break; case MSK_BK_FX: skc[i] = MSK_SK_FIX; break; default: skc[i] = MSK_SK_UNK; break; } break; /* Warning : Slacks in Osi and Mosek er negated */ case CoinWarmStartBasis::atLowerBound: switch(bkc[i]) { case MSK_BK_UP: case MSK_BK_RA: skc[i] = MSK_SK_UPR; break; case MSK_BK_FX: skc[i] = MSK_SK_FIX; break; default: skc[i] = MSK_SK_UNK; break; } break; case CoinWarmStartBasis::isFree: skc[i] = MSK_SK_SUPBAS; break; default: // unknown row status retval = false; skip = true; MSKassert(3,1,"Unkown rowstatus","setWarmStart"); break; } } delete[] bkc; if( skip == false ) { bkx = new int[numcols]; restat = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_VAR, 0, numcols, (MSKboundkeye*) (bkx), NULL, NULL); checkMSKerror( restat, "MSK_getboundslice", "setWarmStart" ); for( i = 0; i < numcols; ++i ) { switch( ws->getStructStatus( i ) ) { case CoinWarmStartBasis::basic: skx[i] = MSK_SK_BAS; ++numbas; break; case CoinWarmStartBasis::atLowerBound: switch(bkx[i]) { case MSK_BK_LO: case MSK_BK_RA: skx[i] = MSK_SK_LOW; break; case MSK_BK_FX: skx[i] = MSK_SK_FIX; default: skx[i] = MSK_SK_UNK; break; } break; case CoinWarmStartBasis::atUpperBound: switch(bkx[i]) { case MSK_BK_UP: case MSK_BK_RA: skx[i] = MSK_SK_UPR; break; case MSK_BK_FX: skx[i] = MSK_SK_FIX; default: skx[i] = MSK_SK_UNK; break; } break; case CoinWarmStartBasis::isFree: skx[i] = MSK_SK_SUPBAS; break; default: // unknown col status retval = false; skip = true; MSKassert(3,1,"Unkown col status","setWarmStart"); break; } } delete[] bkx; } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("OsiMskSolverInterface::setWarmStart(%p) numcols %d numrows %d numbas %d\n", (void *)warmstart,numcols,numrows,numbas); #endif #if 0 MSKassert(3,numbas == numrows,"Wrong number of basis variables","setWarmStart"); #endif if( skip == false ) { restat = MSK_putsolution( getLpPtr( OsiMskSolverInterface::FREECACHED_RESULTS ), MSK_SOL_BAS, (MSKstakeye*) (skc), (MSKstakeye*) (skx), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); delete[] skx; delete[] skc; } else { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Skipping setting values in OsiMskSolverInterface::setWarmStart()\n"); #endif #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::setWarmStart(%p)\n", (void *)warmstart); #endif delete[] skx; delete[] skc; return false; } retval = (restat == MSK_RES_OK); #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::setWarmStart(%p)\n", (void *)warmstart); #endif return retval; } //############################################################################# // Hotstart related methods (primarily used in strong branching) //############################################################################# //----------------------------------------------------------------------------- // Mark hot start void OsiMskSolverInterface::markHotStart() { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::markHotStart()\n"); #endif int err; int numcols, numrows; MSKassert(3,!probtypemip_,"probtypemip_","markHotStart"); numcols = getNumCols(); numrows = getNumRows(); if( numcols > hotStartCStatSize_ ) { delete[] hotStartCStat_; hotStartCStatSize_ = static_cast( 1.0 * static_cast( numcols ) ); // get some extra space for future hot starts hotStartCStat_ = new int[hotStartCStatSize_]; } if( numrows > hotStartRStatSize_ ) { delete[] hotStartRStat_; hotStartRStatSize_ = static_cast( 1.0 * static_cast( numrows ) ); // get some extra space for future hot starts hotStartRStat_ = new int[hotStartRStatSize_]; } err = MSK_getsolution(getMutableLpPtr(), MSK_SOL_BAS, NULL, NULL, (MSKstakeye*) (hotStartRStat_), (MSKstakeye*) (hotStartCStat_), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror( err, "MSK_getsolution", "markHotStart" ); #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::markHotStart()\n"); #endif } //----------------------------------------------------------------------------- // Solve from a hot start void OsiMskSolverInterface::solveFromHotStart() { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::solveFromHotStart()\n"); #endif int err; int maxiter; switchToLP(); MSKassert(3,getNumCols() <= hotStartCStatSize_,"getNumCols() <= hotStartCStatSize_","solveFromHotStart"); MSKassert(3,getNumRows() <= hotStartRStatSize_,"getNumRows() <= hotStartRStatSize_","solveFromHotStart"); err = MSK_putsolution(getLpPtr( OsiMskSolverInterface::FREECACHED_RESULTS ), MSK_SOL_BAS, (MSKstakeye*) (hotStartRStat_), (MSKstakeye*) (hotStartCStat_), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror( err, "MSK_putsolution", "solveFromHotStart" ); err = MSK_getintparam( getMutableLpPtr(), MSK_IPAR_SIM_MAX_ITERATIONS, &maxiter ); checkMSKerror( err, "MSK_getintparam", "solveFromHotStart" ); err = MSK_putintparam( getMutableLpPtr(), MSK_IPAR_SIM_MAX_ITERATIONS, hotStartMaxIteration_ ); checkMSKerror( err, "MSK_putintparam", "solveFromHotStart" ); resolve(); err = MSK_putintparam( getMutableLpPtr(), MSK_IPAR_SIM_MAX_ITERATIONS, maxiter ); checkMSKerror( err, "MSK_putintparam", "solveFromHotStart" ); #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::solveFromHotStart()\n"); #endif } //----------------------------------------------------------------------------- // Unmark a hot start void OsiMskSolverInterface::unmarkHotStart() { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::unmarkHotStart()\n"); #endif freeCachedData(); if( hotStartCStat_ != NULL ) delete[] hotStartCStat_; if( hotStartRStat_ != NULL ) delete[] hotStartRStat_; hotStartCStat_ = NULL; hotStartCStatSize_ = 0; hotStartRStat_ = NULL; hotStartRStatSize_ = 0; #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::unmarkHotStart()\n"); #endif } //############################################################################# // Problem information methods (original data) //############################################################################# //----------------------------------------------------------------------------- // Returns number of columns in MOSEK task int OsiMskSolverInterface::getNumCols() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getNumCols()\n"); #endif int numcol, err; err = MSK_getnumvar(getMutableLpPtr(),&numcol); checkMSKerror( err, "MSK_getnumvar", "getNumCols" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getNumCols()\n"); #endif return numcol; } //----------------------------------------------------------------------------- // Returns number of rows in MOSEK task int OsiMskSolverInterface::getNumRows() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getNumRows()\n"); #endif int numrow, err; err = MSK_getnumcon(getMutableLpPtr(),&numrow); checkMSKerror( err, "MSK_getnumcon", "getNumRows" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getNumRows()\n"); #endif return numrow; } //----------------------------------------------------------------------------- // Returns number of non-zeroes (in matrix) in MOSEK task int OsiMskSolverInterface::getNumElements() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getNumElements()\n"); #endif int numnon, err; err = MSK_getnumanz(getMutableLpPtr(),&numnon); checkMSKerror( err, "MSK_getnumanz", "getNumElements" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getNumElements()\n"); #endif return numnon; } //----------------------------------------------------------------------------- // Returns lower bounds on columns in MOSEK task const double * OsiMskSolverInterface::getColLower() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getColLower()\n"); #endif if(collower_ == NULL ) { int ncols = getNumCols(); MSKassert(3,colupper_ == NULL,"colupper_","getColLower"); if( ncols > 0 ) { if(colupper_ == NULL) colupper_ = new double[ncols]; if(collower_ == NULL) collower_ = new double[ncols]; int *dummy_tags = new int[ncols]; int err = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_VAR, (MSKidxt)0, (MSKidxt)ncols, (MSKboundkeye*) (dummy_tags), collower_, colupper_); checkMSKerror(err, "MSK_getboundslice","getColUpper"); for( int k = 0; k < ncols; ++k ) { if( dummy_tags[k] == MSK_BK_UP || dummy_tags[k] == MSK_BK_FR ) { /* No lower */ collower_[k] = -getInfinity(); } if( dummy_tags[k] == MSK_BK_LO || dummy_tags[k] == MSK_BK_FR ) { /* No upper */ colupper_[k] = getInfinity(); } } delete[] dummy_tags; } else { if(colupper_ != NULL) delete [] colupper_; if(collower_ != NULL) delete [] collower_; colupper_ = collower_ = NULL; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getColLower()\n"); #endif return collower_; } //----------------------------------------------------------------------------- // Returns upper bounds on columns in MOSEK task const double * OsiMskSolverInterface::getColUpper() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getColUpper()\n"); #endif if( colupper_ == NULL ) { int ncols = getNumCols(); MSKassert(3,collower_ == NULL,"collower_ == NULL","getColUpper"); if( ncols > 0 ) { if(colupper_ == NULL) colupper_ = new double[ncols]; if(collower_ == NULL) collower_ = new double[ncols]; int *dummy_tags = new int[ncols]; int err = MSK_getboundslice( getMutableLpPtr(), MSK_ACC_VAR, (MSKidxt)0, (MSKidxt)ncols, (MSKboundkeye*) (dummy_tags), collower_, colupper_); checkMSKerror(err,"MSK_getboundslice","getColUpper"); delete[] dummy_tags; } else { if(colupper_ != NULL) delete [] colupper_; if(collower_ != NULL) delete [] collower_; colupper_ = collower_ = NULL; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getColUpper()\n"); #endif return colupper_; } //----------------------------------------------------------------------------- // Returns rowsense in MOSEK task, call getRightHandSide to produce triplets. const char * OsiMskSolverInterface::getRowSense() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getRowSense()\n"); #endif if( rowsense_==NULL ) { getRightHandSide(); if( getNumRows() != 0 ) MSKassert(3,rowsense_!=NULL,"rowsense_!=NULL","getRowSense"); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getRowSense()\n"); #endif return rowsense_; } //----------------------------------------------------------------------------- // Returns the RHS in triplet form. MOSEK uses always boundkeys instead of the // triplet, so we have to convert back to triplet. const double * OsiMskSolverInterface::getRightHandSide() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getRightHandSide()\n"); #endif if(rowsense_ == NULL) { int nr = getNumRows(); if ( nr != 0 ) { MSKassert(3,(rhs_ == NULL) && (rowrange_ == NULL),"(rhs_ == NULL) && (rowrange_ == NULL)","getRightHandSide"); rowsense_ = new char[nr]; rhs_ = new double[nr]; rowrange_ = new double[nr]; const double * lb = getRowLower(); const double * ub = getRowUpper(); int i; for ( i=0; i 3 debugMessage("End OsiMskSolverInterface::getRightHandSide()\n"); #endif return rhs_; } //----------------------------------------------------------------------------- // Returns rowrange in MOSEK task, call getRightHandSide to produce triplets. const double * OsiMskSolverInterface::getRowRange() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getRowRange()\n"); #endif if( rowrange_ == NULL ) { getRightHandSide(); MSKassert(3,rowrange_!=NULL || getNumRows() == 0,"rowrange_!=NULL || getNumRows() == 0","getRowRange"); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getRowRange()\n"); #endif return rowrange_; } //----------------------------------------------------------------------------- // Returns lower bounds on rows in MOSEK task. const double * OsiMskSolverInterface::getRowLower() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getRowLower()\n"); #endif if( rowlower_ == NULL ) { MSKassert(3,rowupper_ == NULL,"rowupper_ == NULL","getRowLower"); int nrows = getNumRows(); if( nrows > 0 ) { rowlower_ = new double[nrows]; rowupper_ = new double[nrows]; int *dummy_tags = new int[nrows]; int err = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_CON, (MSKidxt)0, (MSKidxt)nrows, (MSKboundkeye*) (dummy_tags), rowlower_, rowupper_); checkMSKerror(err,"MSK_getboundslice","getRowLower"); delete[] dummy_tags; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getRowLower()\n"); #endif return rowlower_; } //----------------------------------------------------------------------------- // Returns upper bounds on rows in MOSEK task. const double * OsiMskSolverInterface::getRowUpper() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getRowUpper()\n"); #endif if( rowupper_ == NULL ) { MSKassert(3,rowlower_ == NULL,"probtypemip_","getRowUpper"); int nrows = getNumRows(); if( nrows > 0 ) { rowupper_ = new double[nrows]; rowlower_ = new double[nrows]; int *dummy_tags = new int[nrows]; int err = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_CON, (MSKidxt)0, (MSKidxt)nrows, (MSKboundkeye*) (dummy_tags), rowlower_, rowupper_); checkMSKerror(err,"MSK_getboundslice","getRowUpper"); delete[] dummy_tags; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getRowUpper()\n"); #endif return rowupper_; } //----------------------------------------------------------------------------- // Returns objective coefficient in MOSEK task. const double * OsiMskSolverInterface::getObjCoefficients() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getObjCoefficients()\n"); #endif if( obj_ == NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { obj_ = new double[ncols]; int err = MSK_getc( getMutableLpPtr(), obj_ ); checkMSKerror( err, "MSK_getc", "getObjCoefficients" ); } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getObjCoefficients()\n"); #endif return obj_; } //----------------------------------------------------------------------------- // Returns the direction of optimization double OsiMskSolverInterface::getObjSense() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getObjSense()\n"); #endif int err; MSKobjsensee objsen; err = MSK_getobjsense(getMutableLpPtr(), &objsen); checkMSKerror(err,"MSK_getintparam","getObjSense"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getObjSense()\n"); #endif if( objsen == MSK_OBJECTIVE_SENSE_MAXIMIZE ) return -1.0; else return +1.0; } //----------------------------------------------------------------------------- // Returns true if variabel is set to continuous bool OsiMskSolverInterface::isContinuous( int colNumber ) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::isContinuous(%d)\n", colNumber); debugMessage("End OsiMskSolverInterface::isContinuous(%d)\n", colNumber); #endif return getCtype()[colNumber] == 'C'; } //----------------------------------------------------------------------------- // Returns a Coin matrix by row const CoinPackedMatrix * OsiMskSolverInterface::getMatrixByRow() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getMatrixByRow()\n"); #endif if ( matrixByRow_ == NULL ) { int nc, nr, nz, *sub, *ptrb, *ptre, surp, *len; double *val; nc = getNumCols(); nr = getNumRows(); nz = surp = getNumElements(); ptrb = new int[nr+1]; ptre = new int[nr]; sub = new int[nz]; val = new double[nz]; len = new int[nr]; ptrb[nr] = nz; int err = MSK_getaslice(getMutableLpPtr(), MSK_ACC_CON, 0, nr, nz, &surp, ptrb, ptre, sub, val); checkMSKerror(err, "MSK_getaslice", "getMatrixByRow"); for(int i=0; iassignMatrix(false , nc, nr, nz, val, sub, ptrb, len); MSKassert(3,matrixByRow_->getNumCols()==nc,"matrixByRow_->getNumCols()==nc","getMatrixByRow"); MSKassert(3,matrixByRow_->getNumRows()==nr,"matrixByRow_->getNumRows()==nr","getMatrixByRow"); delete[] ptrb; delete[] ptre; delete[] sub; delete[] val; delete[] len; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getMatrixByRow()\n"); #endif return matrixByRow_; } //----------------------------------------------------------------------------- // Returns a Coin matrix by column const CoinPackedMatrix * OsiMskSolverInterface::getMatrixByCol() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getMatrixByCol()\n"); #endif if ( matrixByCol_ == NULL ) { int nc, nr, nz, *sub, *ptrb, *ptre, surp, *len; double *val; nc = getNumCols(); nr = getNumRows(); nz = surp = getNumElements(); ptrb = new int[nc+1]; ptre = new int[nc]; sub = new int[nz]; val = new double[nz]; len = new int[nc]; ptrb[nc] = nz; int err = MSK_getaslice(getMutableLpPtr(), MSK_ACC_VAR, 0, nc, nz, &surp, ptrb, ptre, sub, val); checkMSKerror(err, "MSK_getaslice", "getMatrixByCol"); for(int i=0; iassignMatrix(true , nr, nc, nz, val, sub, ptrb, len); MSKassert(3,matrixByCol_->getNumCols()==nc,"matrixByCol_->getNumCols()==nc","getMatrixByCol"); MSKassert(3,matrixByCol_->getNumRows()==nr,"matrixByCol_->getNumRows()==nr","getMatrixByCol"); delete[] ptrb; delete[] ptre; delete[] sub; delete[] val; delete[] len; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getMatrixByCol()\n"); #endif return matrixByCol_; } //----------------------------------------------------------------------------- // Returns the infinity level used in MOSEK. double OsiMskSolverInterface::getInfinity() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getInfinity()\n"); debugMessage("End OsiMskSolverInterface::getInfinity()\n"); #endif return MSK_INFINITY; } //############################################################################# // Problem information methods (results) //############################################################################# //----------------------------------------------------------------------------- // Returns the current col solution. const double * OsiMskSolverInterface::getColSolution() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getColSolution() %p\n",(void*)this); #endif if( colsol_ != NULL ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("colsol_ != NULL\n"); #endif return colsol_; } int i; int nc = getNumCols(); if( nc > 0 ) { MSKsoltypee solution = MSK_SOL_END; if(colsol_ == NULL) colsol_ = new double[nc]; if( probtypemip_ == false) { if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else if( definedSolution( MSK_SOL_ITR) == true ) solution = MSK_SOL_ITR; } else if( definedSolution( MSK_SOL_ITG ) == true ) solution = MSK_SOL_ITG; if ( solution == MSK_SOL_END ) { double const *cl=getColLower(),*cu=getColLower(); /* this is just plain stupid, but needed to pass unit test */ for( i = 0; i < nc; ++i ) { if( cl[i] > -getInfinity() ) { colsol_[i] = cl[i]; } else if( cu[i] < getInfinity() ) { colsol_[i] = cu[i]; } else { colsol_[i] = 0.0; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("colsol_ truncated to zero due to no solution\n"); debugMessage("probtypemip_ %d\n",probtypemip_); #endif return colsol_; } int err = MSK_getsolution(getMutableLpPtr(), solution, NULL, NULL, NULL, NULL, NULL, NULL, colsol_, NULL, NULL, NULL, NULL, NULL, NULL ); checkMSKerror(err,"MSK_getsolution","getColSolution"); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getColSolution()\n"); #endif return colsol_; } //----------------------------------------------------------------------------- // Returns the row price / dual variabels in MOSEK task const double * OsiMskSolverInterface::getRowPrice() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getRowPrice()\n"); #endif if( rowsol_ == NULL ) { int i; int nr = getNumRows(); if( nr > 0 ) { MSKsoltypee solution = MSK_SOL_END; rowsol_ = new double[nr]; if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else if( definedSolution( MSK_SOL_ITR) == true ) solution = MSK_SOL_ITR; if ( solution == MSK_SOL_END ) { for( i = 0; i < nr; ++i ) rowsol_[i] = 0.0; return rowsol_; } int err = MSK_getsolution(getMutableLpPtr(), solution, NULL, NULL, NULL, NULL, NULL, NULL, NULL, rowsol_, NULL, NULL, NULL, NULL, NULL); checkMSKerror( err, "MSK_getsolution", "getRowPrice" ); } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getRowPrice()\n"); #endif return rowsol_; } //----------------------------------------------------------------------------- // Returns the reduced cost in MOSEK task. const double * OsiMskSolverInterface::getReducedCost() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getReducedCost()\n"); #endif if( redcost_ == NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { MSKsoltypee solution = MSK_SOL_END; if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else if( definedSolution( MSK_SOL_ITR) == true ) solution = MSK_SOL_ITR; if ( solution == MSK_SOL_END ) return NULL; redcost_ = new double[ncols]; double *slx = new double[ncols]; double *sux = new double[ncols]; int err = MSK_getsolution(getMutableLpPtr(), solution, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, slx, sux, NULL); // Calculate reduced cost for(int i = 0; i < ncols; i++) redcost_[i] = slx[i]-sux[i]; delete[] slx; delete[] sux; checkMSKerror( err, "MSK_getsolution", "getReducedCost" ); } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getReducedCost()\n"); #endif return redcost_; } //----------------------------------------------------------------------------- // Returns the rowactivity in MOSEK task. const double * OsiMskSolverInterface::getRowActivity() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getRowActivity()\n"); #endif if( rowact_ == NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowact_ = new double[nrows]; const double *x = getColSolution() ; const CoinPackedMatrix *mtx = getMatrixByRow() ; mtx->times(x,rowact_) ; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getRowActivity()\n"); #endif return rowact_; } //----------------------------------------------------------------------------- // Returns the objective for defined solution in MOSEK task. double OsiMskSolverInterface::getObjValue() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getObjValue()\n"); #endif double objval = OsiSolverInterface::getObjValue(); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getObjValue()\n"); #endif return objval; } //----------------------------------------------------------------------------- // Returns the iteration used in last call to optimize. Notice that the cross // over phase in interior methods is not returned, when interior point is // used, only the interior point iterations. int OsiMskSolverInterface::getIterationCount() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getIterationCount()\n"); #endif int nr = 0, solver, err; int nrp=0; solver = solverUsed(); if( solver == MSK_OPTIMIZER_PRIMAL_SIMPLEX ) { { err = MSK_getintinf(getMutableLpPtr(), MSK_IINF_SIM_PRIMAL_ITER, &nr); checkMSKerror(err,"MSK_getintinf","getIterationsCount"); } } else if( solver == MSK_OPTIMIZER_DUAL_SIMPLEX ) { { err = MSK_getintinf(getMutableLpPtr(), MSK_IINF_SIM_DUAL_ITER, &nr); checkMSKerror(err,"MSK_getintinf","getIterationsCount"); } } else if( solver == MSK_OPTIMIZER_FREE_SIMPLEX ) { { err = MSK_getintinf(getMutableLpPtr(), MSK_IINF_SIM_DUAL_ITER, &nr); checkMSKerror(err,"MSK_getintinf","getIterationsCount"); err = MSK_getintinf(getMutableLpPtr(), MSK_IINF_SIM_PRIMAL_ITER, &nrp); checkMSKerror(err,"MSK_getintinf","getIterationsCount"); nr = nr+nrp; } } else if( solver == MSK_OPTIMIZER_INTPNT ) { { err = MSK_getintinf(getMutableLpPtr(), MSK_IINF_INTPNT_ITER, &nr); checkMSKerror(err,"MSK_getintinf","getIterationsCount"); } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getIterationCount()\n"); #endif return nr; } //----------------------------------------------------------------------------- // Returns one dual ray std::vector OsiMskSolverInterface::getDualRays(int maxNumRays, bool fullRay) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getDualRays(%d,%s)\n", maxNumRays, fullRay?"true":"false"); #endif if (fullRay == true) { throw CoinError("Full dual rays not yet implemented.","getDualRays", "OsiMskSolverInterface"); } OsiMskSolverInterface solver(*this); int numrows = getNumRows(), r; MSKsolstae status; MSKsoltypee solution; if( probtypemip_ == false ) { if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else { if( definedSolution( MSK_SOL_ITR ) == true ) solution = MSK_SOL_ITR; else return std::vector(); } } else { if( definedSolution( MSK_SOL_ITG ) == true ) solution = MSK_SOL_ITG; else return std::vector(); } double *farkasray = new double[numrows]; r = MSK_getsolution(getMutableLpPtr(), solution, NULL, &status, NULL, NULL, NULL, NULL, NULL, farkasray, NULL, NULL, NULL, NULL, NULL); checkMSKerror( r, "MSK_getsolution", "getDualRays" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getDualRays(%d)\n", maxNumRays); #endif if( status != MSK_SOL_STA_PRIM_INFEAS_CER ) { delete[] farkasray; return std::vector(); } else return std::vector(1, farkasray); } //----------------------------------------------------------------------------- // Returns one primal ray std::vector OsiMskSolverInterface::getPrimalRays(int maxNumRays) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getPrimalRays(%d)\n", maxNumRays); #endif OsiMskSolverInterface solver(*this); int numrows = getNumRows(), r; MSKsolstae status; MSKsoltypee solution; if( probtypemip_ == false ) { if( definedSolution( MSK_SOL_BAS ) == true ) solution = MSK_SOL_BAS; else { if( definedSolution( MSK_SOL_ITR ) == true ) solution = MSK_SOL_ITR; else return std::vector(); } } else { if( definedSolution( MSK_SOL_ITG ) == true ) solution = MSK_SOL_ITG; else return std::vector(); } double *farkasray = new double[numrows]; r = MSK_getsolution(getMutableLpPtr(), solution, NULL, &status, NULL, NULL, NULL, NULL, farkasray, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror( r, "MSK_getsolution", "getPrimalRays" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getPrimalRays(%d)\n", maxNumRays); #endif if( status != MSK_SOL_STA_DUAL_INFEAS_CER ) { delete[] farkasray; return std::vector(); } else return std::vector(1, farkasray); } //############################################################################# // Problem modifying methods (rim vectors) //############################################################################# //----------------------------------------------------------------------------- // Sets a variabels objective coeff. void OsiMskSolverInterface::setObjCoeff( int elementIndex, double elementValue ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setObjCoeff(%d, %g)\n", elementIndex, elementValue); #endif const double *oldobj; if( redcost_ && !obj_ ) oldobj = getObjCoefficients(); else oldobj = obj_; int err = MSK_putclist(getMutableLpPtr(), 1, &elementIndex, &elementValue); checkMSKerror(err, "MSK_putclist", "setObjCoeff"); if( obj_ ) { if( redcost_ ) { redcost_[elementIndex] += elementValue-oldobj[elementIndex]; obj_[elementIndex] = elementValue; } else { obj_[elementIndex] = elementValue; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setObjCoeff(%d, %g)\n", elementIndex, elementValue); #endif } //----------------------------------------------------------------------------- // Sets a list of objective coeff. void OsiMskSolverInterface::setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setObjCoeffSet(%p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)coeffList); #endif const double *oldobj; const long int cnt = indexLast - indexFirst; if( redcost_ && !obj_ ) oldobj = getObjCoefficients(); else oldobj = obj_; int err = MSK_putclist(getMutableLpPtr(), static_cast(cnt), const_cast(indexFirst), const_cast(coeffList)); checkMSKerror(err, "MSK_putclist", "setObjCoeffSet"); if( obj_ ) { if( redcost_ ) { for( int j = 0; j < cnt; ++j) { redcost_[j] += coeffList[indexFirst[j]]-oldobj[j]; obj_[j] = coeffList[indexFirst[j]]; } } else { for( int j = 0; j < cnt; ++j) { obj_[j] = coeffList[indexFirst[j]]; } } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setObjCoeffSet(%p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)coeffList); #endif } //----------------------------------------------------------------------------- // Sets lower bound on one specific column void OsiMskSolverInterface::setColLower(int elementIndex, double elementValue) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setColLower(%d, %g)\n", elementIndex, elementValue); #endif int finite = 1; if( elementValue <= -getInfinity() ) finite = 0; int err = MSK_chgbound(getMutableLpPtr(), MSK_ACC_VAR, elementIndex, 1, /*It is a lower bound*/ finite, /* Is it finite */ elementValue); checkMSKerror( err, "MSK_chgbound", "setColLower" ); if( collower_ != NULL ) collower_[elementIndex] = elementValue; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setColLower(%d, %g)\n", elementIndex, elementValue); #endif } //----------------------------------------------------------------------------- // Sets upper bound on one specific column. void OsiMskSolverInterface::setColUpper(int elementIndex, double elementValue) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setColUpper(%d, %g)\n", elementIndex, elementValue); #endif int finite = 1; if( elementValue >= getInfinity() ) finite = 0; int err = MSK_chgbound( getMutableLpPtr(), MSK_ACC_VAR, elementIndex, 0, /* It is a upper bound */ finite, /* Is it finite */ elementValue); checkMSKerror( err, "MSK_chgbound", "setColUpper" ); if( colupper_ != NULL ) colupper_[elementIndex] = elementValue; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setColUpper(%d, %g)\n", elementIndex, elementValue); #endif } //----------------------------------------------------------------------------- // Sets upper and lower bound on one specific column void OsiMskSolverInterface::setColBounds( int elementIndex, double lower, double upper ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setColBounds(%d, %g, %g)\n", elementIndex, lower, upper); #endif setColLower(elementIndex, lower); setColUpper(elementIndex, upper); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setColBounds(%d, %g, %g)\n", elementIndex, lower, upper); #endif } //----------------------------------------------------------------------------- // Sets upper and lower bounds on a list of columns. Due to the strange storage of // boundlist, it is not possible to change all the bounds in one call to MOSEK, // so the standard method is used. void OsiMskSolverInterface::setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setColSetBounds(%p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)boundList); #endif OsiSolverInterface::setColSetBounds( indexFirst, indexLast, boundList ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setColSetBounds(%p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)boundList); #endif } //----------------------------------------------------------------------------- // Sets the lower bound on a row void OsiMskSolverInterface::setRowLower( int i, double elementValue ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setRowLower(%d, %g)\n", i, elementValue); #endif double rhs = getRightHandSide()[i]; double range = getRowRange()[i]; char sense = getRowSense()[i]; double lower=-MSK_INFINITY, upper=MSK_INFINITY; convertSenseToBound( sense, rhs, range, lower, upper ); if( lower != elementValue ) { convertBoundToSense( elementValue, upper, sense, rhs, range ); setRowType( i, sense, rhs, range ); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setRowLower(%d, %g)\n", i, elementValue); #endif } //----------------------------------------------------------------------------- // Sets the upper bound on a row void OsiMskSolverInterface::setRowUpper( int i, double elementValue ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setRowUpper(%d, %g)\n", i, elementValue); #endif double rhs = getRightHandSide()[i]; double range = getRowRange()[i]; char sense = getRowSense()[i]; double lower=-MSK_INFINITY, upper=MSK_INFINITY; convertSenseToBound( sense, rhs, range, lower, upper ); if( upper != elementValue ) { convertBoundToSense( lower, elementValue, sense, rhs, range ); setRowType( i, sense, rhs, range ); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setRowUpper(%d, %g)\n", i, elementValue); #endif } //----------------------------------------------------------------------------- // Sets the upper and lower bound on a row void OsiMskSolverInterface::setRowBounds( int elementIndex, double lower, double upper ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setRowBounds(%d, %g, %g)\n", elementIndex, lower, upper); #endif double rhs, range; char sense; convertBoundToSense( lower, upper, sense, rhs, range ); setRowType( elementIndex, sense, rhs, range ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setRowBounds(%d, %g, %g)\n", elementIndex, lower, upper); #endif } //----------------------------------------------------------------------------- // Sets the triplet on a row void OsiMskSolverInterface::setRowType(int i, char sense, double rightHandSide,double range) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setRowType(%d, %c, %g, %g)\n", i, sense, rightHandSide, range); #endif double rub=MSK_INFINITY,rlb=-MSK_INFINITY; int rtag=MSK_BK_FR; MskConvertSenseToBound(sense, range, rightHandSide, rlb, rub, rtag); int err = MSK_putbound(getMutableLpPtr(), MSK_ACC_CON, i, (MSKboundkeye)rtag, rlb, rub); if( rowsense_ != NULL ) rowsense_[i] = sense; if( rowrange_ != NULL ) rowrange_[i] = range; if( rhs_ != NULL ) rhs_[i] = rightHandSide; checkMSKerror( err, "MSK_putbound", "setRowType" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setRowType(%d, %c, %g, %g)\n", i, sense, rightHandSide, range); #endif } //----------------------------------------------------------------------------- // Set upper og lower bounds for a lisit of rows. Due to the strange storage of // boundlist, it is not possible to change all the bounds in one call to MOSEK, // so the standard method is used. void OsiMskSolverInterface::setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setRowSetBounds(%p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)boundList); #endif const long int cnt = indexLast - indexFirst; if (cnt <= 0) return; for (int i = 0; i < cnt; ++i) setRowBounds(indexFirst[i], boundList[2*i], boundList[2*i+1]); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setRowSetBounds(%p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)boundList); #endif } //----------------------------------------------------------------------------- // Set triplets for a list of rows void OsiMskSolverInterface::setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setRowSetTypes(%p, %p, %p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)senseList, (void *)rhsList, (void *)rangeList); #endif const long int cnt = indexLast - indexFirst; if (cnt <= 0) return; for (int i = 0; i < cnt; ++i) setRowType(indexFirst[i], senseList[i], rhsList[i], rangeList[i]); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setRowSetTypes(%p, %p, %p, %p, %p)\n", (void *)indexFirst, (void *)indexLast, (void *)senseList, (void *)rhsList, (void *)rangeList); #endif } //----------------------------------------------------------------------------- // Sets a variabel to continuous void OsiMskSolverInterface::setContinuous(int index) { int numcols = getNumCols(); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setContinuous(%d)\n", index); #endif MSKassert(3,coltype_ != NULL,"coltype_ != NULL","setContinuous"); MSKassert(3,coltypesize_ >= getNumCols(),"coltypesize_ >= getNumCols()","setContinuous"); coltype_[index] = 'C'; if( index < numcols ) { int err = MSK_putvartype( getMutableLpPtr(), index, MSK_VAR_TYPE_CONT); checkMSKerror( err, "MSK_putvartype", "setContinuous" ); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setContinuous(%d)\n", index); #endif } //----------------------------------------------------------------------------- // Sets a variabel to integer void OsiMskSolverInterface::setInteger(int index) { int numcols = getNumCols(); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setInteger(%d)\n", index); #endif MSKassert(3,coltype_ != NULL,"coltype_ != NULL","setInteger"); MSKassert(3,coltypesize_ >= getNumCols(),"coltypesize_ >= getNumCols()","setInteger"); coltype_[index] = 'I'; if( index < numcols ) { int err = MSK_putvartype( getMutableLpPtr(), index, MSK_VAR_TYPE_INT); checkMSKerror( err, "MSK_putvartype", "setInteger" ); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setInteger(%d)\n", index); #endif } //----------------------------------------------------------------------------- // Sets a list of variables to continuous void OsiMskSolverInterface::setContinuous(const int* indices, int len) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setContinuous(%p, %d)\n", (void *)indices, len); #endif for( int i = 0; i < len; ++i ) setContinuous(indices[i]); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setContinuous(%p, %d)\n", (void *)indices, len); #endif } //----------------------------------------------------------------------------- // Sets a list of variables to integer void OsiMskSolverInterface::setInteger(const int* indices, int len) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setInteger(%p, %d)\n", (void *)indices, len); #endif for( int i = 0; i < len; ++i ) setInteger(indices[i]); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setInteger(%p, %d)\n", (void *)indices, len); #endif } //----------------------------------------------------------------------------- // Sets the direction of optimization void OsiMskSolverInterface::setObjSense(double s) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::setObjSense(%g)\n", s); #endif int err; double pre; pre = getObjSense(); if( s == +1.0 ) { err = MSK_putobjsense(getMutableLpPtr(), MSK_OBJECTIVE_SENSE_MINIMIZE); } else { err = MSK_putobjsense(getMutableLpPtr(), MSK_OBJECTIVE_SENSE_MAXIMIZE); } checkMSKerror(err,"MSK_putintparam","setObjSense"); if( pre != s ) { /* A hack to pass unit test, ugly as hell */ /* When objective sense is changed then reset obj cuts */ if( s > 0 ) { setDblParam(OsiPrimalObjectiveLimit,-COIN_DBL_MAX) ; setDblParam(OsiDualObjectiveLimit,COIN_DBL_MAX) ; } else { setDblParam(OsiPrimalObjectiveLimit,COIN_DBL_MAX) ; setDblParam(OsiDualObjectiveLimit,-COIN_DBL_MAX) ; } } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::setObjSense(%g)\n", s); #endif } //----------------------------------------------------------------------------- // Sets the col solution. This is very fuzzy WE LIKE STATUS KEYS not numerical values i.e superbasics or basic !!!. void OsiMskSolverInterface::setColSolution(const double * cs) { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::setColSolution %p\n", (void*)this); #endif int err,nc = getNumCols(),nr = getNumRows(), numbas = 0; MSKstakeye *tskc,*tskx; MSKboundkeye *tbkx,*tbkc; MSKrealt *tblx,*tbux,*tblc,*tbuc; double *txc; if( cs == NULL ) { freeCachedResults(); } else if( nc > 0 ) { if( colsol_ != NULL ) delete[] colsol_; colsol_ = new double[nc]; CoinDisjointCopyN( cs, nc, colsol_ ); tbkx = new MSKboundkeye[nc]; tskx = new MSKstakeye[nc]; tblx = new MSKrealt[nc]; tbux = new MSKrealt[nc]; tskc = new MSKstakeye[nr]; txc = new double[nr]; tbkc = new MSKboundkeye[nr]; tblc = new MSKrealt[nr]; tbuc = new MSKrealt[nr]; const CoinPackedMatrix *mtx = getMatrixByCol() ; assert(mtx->getNumCols() == nc); assert(mtx->getNumRows() == nr); mtx->times(cs,txc) ; /* Negate due to different Osi and Mosek slack representation */ for( int i = 0; i < nr; ++i ) { txc[i] = -txc[i]; tskc[i] = MSK_SK_UNK; } err = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_CON, 0, nr, tbkc, tblc, tbuc); checkMSKerror( err, "MSK_getboundslice", "setColsolution" ); err = MSK_getboundslice(getMutableLpPtr(), MSK_ACC_VAR, 0, nc, tbkx, tblx, tbux); checkMSKerror( err, "MSK_getboundslice", "setColsolution" ); if( definedSolution( MSK_SOL_BAS ) == true ) { err = MSK_getsolution(getMutableLpPtr(), MSK_SOL_BAS, NULL, NULL, tskc, tskx, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror(err,"MSK_getsolution","setColSol"); } for( int i = 0; i < nr; ++i ) { if( tbkc[i] == MSK_BK_FX && tblc[i] == txc[i] ) { tskc[i] = MSK_SK_FIX; } else if( ( tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_RA ) && tblc[i] == txc[i] ) { tskc[i] = MSK_SK_LOW; } else if( ( tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_RA ) && tbuc[i] == txc[i] ) { tskc[i] = MSK_SK_UPR; } else if( tbkc[i] == MSK_BK_FR && txc[i] == 0.0 ) { tskc[i] = MSK_SK_SUPBAS; } else { #if 0 printf("Slack : %d bkc : %d blc : %-16.10e buc : %-16.10e xc : %-16.10e\n", i,tbkc[i],tblc[i],tbuc[i],txc[i]); #endif ++numbas; tskc[i] = MSK_SK_BAS; } } for( int j = 0; j < nc; ++j ) { if( tbkx[j] == MSK_BK_FX && tblx[j] == cs[j] ) { tskx[j] = MSK_SK_FIX; } else if( ( tbkx[j] == MSK_BK_LO || tbkx[j] == MSK_BK_RA ) && tblx[j] == cs[j] ) { tskx[j] = MSK_SK_LOW; } else if( ( tbkx[j] == MSK_BK_UP || tbkx[j] == MSK_BK_RA ) && tbux[j] == cs[j] ) { tskx[j] = MSK_SK_UPR; } else if( ( tbkx[j] == MSK_BK_FR && cs[j] == 0.0 ) || numbas >= nr ) { tskx[j] = MSK_SK_SUPBAS; } else { #if 0 printf("Org %d : bkx : %d blx : %-16.10e bux : %-16.10e xx : %-16.10e\n", j,tbkx[j],tblx[j],tbux[j],cs[j]); #endif tskx[j] = MSK_SK_BAS; } } err = MSK_putsolution(getMutableLpPtr(), MSK_SOL_BAS, tskc, tskx, NULL, (MSKrealt*) txc, const_cast(cs), NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror(err,"MSK_putsolution","setColSol"); MSKassert(3,definedSolution( MSK_SOL_BAS ) == true,"definedSolution( MSK_SOL_BAS ) == true","setColSolution"); delete [] tbkx; delete [] tblx; delete [] tbux; delete [] tskx; delete [] tskc; delete [] txc; delete [] tbkc; delete [] tblc; delete [] tbuc; } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::setColSolution(%p)\n", (void *)cs); #endif } //----------------------------------------------------------------------------- // Sets the rowprices. void OsiMskSolverInterface::setRowPrice(const double * rs) { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::setRowPrice(%p)\n", (void *)rs); #endif int err,nr = getNumRows(),nc = getNumCols(); MSKstakeye *tskc,*tskx; MSKrealt *tslc,*tsuc,*tslx,*tsux,sn,*txc,*txx; double *redcost; if( rs == NULL ) freeCachedResults(); else if( nr > 0 ) { if ( rowsol_ == NULL ) rowsol_ = new double[nr]; colsol_ = new double[nc]; tskc = new MSKstakeye[nr]; tslc = new MSKrealt[nr]; tsuc = new MSKrealt[nr]; txc = new MSKrealt[nr]; tskx = new MSKstakeye[nc]; tslx = new MSKrealt[nc]; tsux = new MSKrealt[nc]; txx = new MSKrealt[nc]; redcost = new double[nc]; CoinDisjointCopyN( rs, nr, rowsol_ ); /* Calc reduced costs */ const CoinPackedMatrix *mtx = getMatrixByCol() ; mtx->transposeTimes(rs,redcost) ; for( int j = 0; j < nc; ++j ) { redcost[j] = getObjCoefficients()[j]-redcost[j]; tslx[j] = CoinMax(0.0,redcost[j]); tsux[j] = CoinMax(0.0,-redcost[j]); } if( definedSolution( MSK_SOL_BAS ) == true ) { for( int i = 0; i < nr; ++i ) { err = MSK_getsolutioni(getMutableLpPtr(), MSK_ACC_CON, i, MSK_SOL_BAS, &tskc[i], &txc[i], &tslc[i], &tsuc[i], &sn); tslc[i] = CoinMax(0.0,rowsol_[i]); tsuc[i] = CoinMax(0.0,-rowsol_[i]); checkMSKerror(err,"MSK_putsolutioni","setRowPrice"); } err = MSK_getsolution(getMutableLpPtr(), MSK_SOL_BAS, NULL, NULL, NULL, tskx, NULL, NULL, txx, NULL, NULL, NULL, NULL, NULL, NULL); checkMSKerror(err,"MSK_getsolution","setRowPrice"); err = MSK_putsolution(getMutableLpPtr(), MSK_SOL_BAS, tskc, tskx, NULL, txc, txx, rowsol_, tslc, tsuc, tslx, tsux, NULL); checkMSKerror(err,"MSK_putsolution","setRowPrice"); } else { for( int i = 0; i < nr; ++i ) { tslc[i] = CoinMax(0.0,rowsol_[i]); tsuc[i] = CoinMax(0.0,-rowsol_[i]); tskc[i] = MSK_SK_UNK; } for( int i = 0; i < nc; ++i ) { tskx[i] = MSK_SK_UNK; txx[i] = 0.0; } err = MSK_putsolution(getMutableLpPtr(), MSK_SOL_BAS, tskc, tskx, NULL, NULL, NULL, rowsol_, tslc, tsuc, tslx, tsux, NULL); checkMSKerror(err,"MSK_putsolution","setRowPrice"); } for( int i = 0; i < nc; ++i ) { colsol_[i] = txx[i]; } delete [] tskc; delete [] tslc; delete [] tsuc; delete [] txc; delete [] tskx; delete [] tslx; delete [] tsux; delete [] txx; delete [] redcost; } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::setRowPrice(%p)\n", (void *)rs); #endif } //############################################################################# // Problem modifying methods (matrix) //############################################################################# //----------------------------------------------------------------------------- // Adds a column to the MOSEK task void OsiMskSolverInterface::addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::addCol(%p, %g, %g, %g)\n", (void *)&vec, collb, colub, obj); #endif int nc = getNumCols(); MSKassert(3,coltypesize_ >= nc,"coltypesize_ >= nc","addCol"); resizeColType(nc + 1); coltype_[nc] = 'C'; int ends = vec.getNumElements(); MSKboundkeye tag; MSKtask_t task=getLpPtr(); double inf = getInfinity(); if(collb > -inf && colub >= inf) tag = MSK_BK_LO; else if(collb <= -inf && colub < inf) tag = MSK_BK_UP; else if(collb > -inf && colub < inf) tag = MSK_BK_RA; else if(collb <= -inf && colub >= inf) tag = MSK_BK_FR; else throw CoinError("Bound error", "addCol", "OsiMSKSolverInterface"); #if MSK_VERSION_MAJOR >= 7 int err; MSKint32t j; err = MSK_getnumvar(task,&j); if ( err==MSK_RES_OK ) err = MSK_appendvars(task,1); if ( err==MSK_RES_OK ) err = MSK_putcj(task,j,obj); if ( err==MSK_RES_OK ) err = MSK_putacol(task,j,ends,const_cast(vec.getIndices()),const_cast(vec.getElements())); if ( err==MSK_RES_OK ) err = MSK_putvarbound(task,j,tag,collb,colub); #else int start = 0; int err = MSK_appendvars(task, 1, const_cast (&obj), &start, &ends, const_cast(vec.getIndices()), const_cast(vec.getElements()), (&tag), const_cast (&collb), const_cast (&colub)); #endif checkMSKerror( err, "MSK_appendvars", "addCol" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::addCol(%p, %g, %g, %g)\n", (void *)&vec, collb, colub, obj); #endif } //----------------------------------------------------------------------------- // Adds a list of columns to the MOSEK task void OsiMskSolverInterface::addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::addCols(%d, %p, %p, %p, %p)\n", numcols, (void *)cols, (void *)collb, (void *)colub, (void *)obj); #endif int i, nz = 0, err = MSK_RES_OK; // For efficiency we put hints on the total future size err = MSK_getmaxnumanz(getLpPtr(), &nz); checkMSKerror( err, "MSK_getmaxanz", "addCols" ); for( i = 0; i < numcols; ++i) nz += cols[i]->getNumElements(); err = MSK_putmaxnumanz(getLpPtr(), nz); checkMSKerror( err, "MSK_putmaxanz", "addCols" ); err = MSK_putmaxnumvar(getLpPtr(), numcols+getNumCols()); checkMSKerror( err, "MSK_putmaxnumvar", "addCols" ); for( i = 0; i < numcols; ++i ) addCol( *(cols[i]), collb[i], colub[i], obj[i] ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::addCols(%d, %p, %p, %p, %p)\n", numcols, (void *)cols, (void *)collb, (void *)colub, (void *)obj); #endif } //----------------------------------------------------------------------------- // Deletes a list of columns from the MOSEK task void OsiMskSolverInterface::deleteCols(const int num, const int * columnIndices) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::deleteCols(%d, %p)\n", num, (void *)columnIndices); #endif #if MSK_VERSION_MAJOR >= 7 int err; err = MSK_removevars(getLpPtr( OsiMskSolverInterface::KEEPCACHED_ROW ), num, const_cast(columnIndices)); checkMSKerror( err, "MSK_removevars", "deleteCols" ); #else int err; err = MSK_remove(getLpPtr( OsiMskSolverInterface::KEEPCACHED_ROW ), MSK_ACC_VAR, num, const_cast(columnIndices)); checkMSKerror( err, "MSK_remove", "deleteCols" ); #endif #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::deleteCols(%d, %p)\n", num, (void *)columnIndices); #endif } //----------------------------------------------------------------------------- // Adds a row in bound form to the MOSEK task void OsiMskSolverInterface::addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::addRow(%p, %g, %g)\n", (void *)&vec, rowlb, rowub); #endif getNumRows(); int ends = vec.getNumElements(); double inf = getInfinity(); MSKboundkeye tag; MSKtask_t task = getLpPtr( OsiMskSolverInterface::KEEPCACHED_COLUMN ); if(rowlb > -inf && rowub >= inf) tag = MSK_BK_LO; else if(rowlb <= -inf && rowub < inf) tag = MSK_BK_UP; else if(rowlb > -inf && rowub < inf) tag = MSK_BK_RA; else if(rowlb <= -inf && rowub >= inf) tag = MSK_BK_FR; else throw CoinError("Bound error", "addRow", "OsiMSKSolverInterface"); #if MSK_VERSION_MAJOR >= 7 int err; MSKint32t i; err = MSK_getnumcon(task,&i); if ( err==MSK_RES_OK ) err = MSK_appendcons(task,1); if ( err==MSK_RES_OK ) err = MSK_putconbound(task,i,tag,rowlb,rowub); if ( err==MSK_RES_OK ) err = MSK_putarow(task,i,ends, const_cast(vec.getIndices()), const_cast(vec.getElements())); #else int start = 0; int err = MSK_appendcons(task, 1, &start, &ends, const_cast(vec.getIndices()), const_cast(vec.getElements()), (&tag), const_cast (&rowlb), const_cast (&rowub)); #endif checkMSKerror( err, "MSK_appendcons", "addRow" ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::addRow(%p, %g, %g)\n", (void *)&vec, rowlb, rowub); #endif } //----------------------------------------------------------------------------- // Adds a row in triplet form to the MOSEK task void OsiMskSolverInterface::addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::addRow(%p, %c, %g, %g)\n", (void *)&vec, rowsen, rowrhs, rowrng); #endif int rtag=MSK_BK_FR; double lb=-MSK_INFINITY,ub=MSK_INFINITY; MskConvertSenseToBound( rowsen, rowrng, rowrhs, lb, ub, rtag ); addRow(vec, lb, ub); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::addRow(%p, %c, %g, %g)\n", (void *)&vec, rowsen, rowrhs, rowrng); #endif } //----------------------------------------------------------------------------- // Adds a serie of rows in bound form to the MOSEK task void OsiMskSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::addRows(%d, %p, %p, %p)\n", numrows, (void *)rows, (void *)rowlb, (void *)rowub); #endif int i,nz = 0, err = MSK_RES_OK; // For efficiency we put hints on the total future size err = MSK_getmaxnumanz( getLpPtr(), &nz); checkMSKerror( err, "MSK_getmaxanz", "addRows" ); for( i = 0; i < numrows; ++i) nz += rows[i]->getNumElements(); err = MSK_putmaxnumanz(getLpPtr(), nz); checkMSKerror( err, "MSK_putmaxanz", "addRows" ); err = MSK_putmaxnumcon(getLpPtr(), numrows+getNumRows()); checkMSKerror( err, "MSK_putmaxnumcon", "addRows" ); for( i = 0; i < numrows; ++i ) addRow( *(rows[i]), rowlb[i], rowub[i] ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::addRows(%d, %p, %p, %p)\n", numrows, (void *)rows, (void *)rowlb, (void *)rowub); #endif } //----------------------------------------------------------------------------- // Adds a list of rows in triplet form to the MOSEK task void OsiMskSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::addRows(%d, %p, %p, %p, %p)\n", numrows, (void *)rows, (void *)rowsen, (void *)rowrhs, (void *)rowrng); #endif int i, err = MSK_RES_OK, nz = 0; // For efficiency we put hints on the total future size for( i = 0; i < numrows; ++i) nz += rows[i]->getNumElements(); err = MSK_putmaxnumanz( getLpPtr(), nz); checkMSKerror( err, "MSK_putmaxanz", "addRows" ); err = MSK_putmaxnumcon( getLpPtr(), numrows); checkMSKerror( err, "MSK_putmaxnumcon", "addRows" ); for( i = 0; i < numrows; ++i ) addRow( *(rows[i]), rowsen[i], rowrhs[i], rowrng[i] ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::addRows(%d, %p, %p, %p, %p)\n", numrows, (void *)rows, (void *)rowsen, (void *)rowrhs, (void *)rowrng); #endif } //----------------------------------------------------------------------------- // Deletes a list of rows the MOSEK task void OsiMskSolverInterface::deleteRows(const int num, const int * rowIndices) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::deleteRows(%d, %p)\n", num, (void *)rowIndices); #endif int err; #if MSK_VERSION_MAJOR >= 7 err = MSK_removecons(getLpPtr( OsiMskSolverInterface::KEEPCACHED_COLUMN ), num, const_cast(rowIndices)); checkMSKerror( err, "MSK_removecons", "deleteRows" ); #else err = MSK_remove(getLpPtr( OsiMskSolverInterface::KEEPCACHED_COLUMN ), MSK_ACC_CON, num, const_cast(rowIndices)); checkMSKerror( err, "MSK_remove", "deleteRows" ); #endif #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::deleteRows(%d, %p)\n", num, (void *)rowIndices); #endif } //############################################################################# // Methods to input a problem //############################################################################# //----------------------------------------------------------------------------- // Loads a problem. Should have its "own" implementation so we don't have to convert // to triplet, since this is convertet back in the load function called. But // for simplicity, this is not done. void OsiMskSolverInterface::loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::loadProblem(%p, %p, %p, %p, %p, %p)\n", (void *)&matrix, (void *)collb, (void *)colub, (void *)obj, (void *)rowlb, (void *)rowub); #endif const double inf = getInfinity(); int nrows = matrix.getNumRows(); char * rowSense; double * rowRhs; double * rowRange; if( nrows ) { rowSense = new char [nrows]; rowRhs = new double[nrows]; rowRange = new double[nrows]; } else { rowSense = NULL; rowRhs = NULL; rowRange = NULL; } int i; if( rowlb == NULL && rowub == NULL) for ( i = nrows - 1; i >= 0; --i ) convertBoundToSense( -inf, inf, rowSense[i], rowRhs[i], rowRange[i] ); else if( rowlb == NULL) for ( i = nrows - 1; i >= 0; --i ) convertBoundToSense( -inf, rowub[i], rowSense[i], rowRhs[i], rowRange[i] ); else if( rowub == NULL) for ( i = nrows - 1; i >= 0; --i ) convertBoundToSense( rowlb[i], inf, rowSense[i], rowRhs[i], rowRange[i] ); else for ( i = nrows - 1; i >= 0; --i ) convertBoundToSense( rowlb[i], rowub[i], rowSense[i], rowRhs[i], rowRange[i] ); loadProblem( matrix, collb, colub, obj, rowSense, rowRhs, rowRange ); if( nrows ) { delete [] rowSense; delete [] rowRhs; delete [] rowRange; } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::loadProblem(%p, %p, %p, %p, %p, %p)\n", (void *)&matrix, (void *)collb, (void *)colub, (void *)obj, (void *)rowlb, (void *)rowub); #endif } //----------------------------------------------------------------------------- // Loads a problem void OsiMskSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::assignProblem()\n"); #endif loadProblem( *matrix, collb, colub, obj, rowlb, rowub ); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowlb; rowlb = 0; delete[] rowub; rowub = 0; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::assignProblem()\n"); #endif } //----------------------------------------------------------------------------- // Loads a problem void OsiMskSolverInterface::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { int nc=matrix.getNumCols(); int nr=matrix.getNumRows(); #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::loadProblem(%p, %p, %p, %p, %p, %p, %p) numcols : %d numrows : %d\n", (void *)&matrix, (void *)collb, (void *)colub, (void *)obj, (void *)rowsen, (void *)rowrhs, (void *)rowrng,nc,nr); #endif if( nr == 0 && nc == 0 ) gutsOfDestructor(); else { /* Warning input pointers can be NULL */ int i,j; double * ob; int * rtag = NULL; double * rlb = NULL; double * rub = NULL; int * ctag = NULL; int * cends = NULL; const int *len; const int *start; double * clb = NULL; double * cub = NULL; if( obj != NULL ) ob=const_cast(obj); else { ob = new double[nc]; CoinFillN(ob, nc, 0.0); } if( nr ) { rtag = new int[nr]; rlb = new double[nr]; rub = new double[nr]; } if( rowsen && rowrng && rowrhs ) { for( i=0; i < nr; i++ ) MskConvertSenseToBound( rowsen[i], rowrng[i], rowrhs[i], rlb[i], rub[i], rtag[i]); } else { for( i=0; i < nr; i++ ) { rlb[i] = 0.0; rub[i] = MSK_INFINITY; rtag[i] = MSK_BK_LO; } } bool freeMatrixRequired = false; CoinPackedMatrix * m = NULL; if( !matrix.isColOrdered() ) { m = new CoinPackedMatrix(); m->reverseOrderedCopyOf(matrix); freeMatrixRequired = true; } else m = const_cast(&matrix); MSKassert(3,nc == m->getNumCols(),"nc == m->getNumCols()","loadProblem"); MSKassert(3,nr == m->getNumRows(),"nr == m->getNumRows()","loadProblem"); MSKassert(3,m->isColOrdered(),"m->isColOrdered()","loadProblem"); double inf =getInfinity(); if( nc ) { ctag = new int[nc]; cends = new int[nc]; clb = new double[nc]; cub = new double[nc]; } len = (m->getVectorLengths()); start = (m->getVectorStarts()); if( collb == NULL && colub == NULL ) { for(j=0; j < nc; j++) { cends[j] = start[j] + len[j]; MskConvertColBoundToTag(0, inf, clb[j], cub[j], ctag[j]); } } else if( collb == NULL ) { for(j=0; j < nc; j++) { cends[j] = start[j] + len[j]; MskConvertColBoundToTag( 0, colub[j], clb[j], cub[j], ctag[j]); } } else if( colub == NULL ) { for(j=0; j < nc; j++) { cends[j] = start[j] + len[j]; MskConvertColBoundToTag(collb[j], inf, clb[j], cub[j], ctag[j]); } } else { for(j=0; j < nc; j++) { cends[j] = start[j] + len[j]; MskConvertColBoundToTag( collb[j], colub[j], clb[j], cub[j], ctag[j]); } } int err=MSK_inputdata(getLpPtr( OsiMskSolverInterface::KEEPCACHED_NONE ), nr, nc, nr, nc, ob, 0.0, const_cast(m->getVectorStarts()), cends, const_cast(m->getIndices()), const_cast(m->getElements()), (MSKboundkeye*)rtag, rlb, rub, (MSKboundkeye*)ctag, clb, cub); checkMSKerror( err, "MSK_inputdata", "loadProblem" ); if( obj == NULL ) delete[] ob; if( nr ) { delete[] rtag; delete[] rlb; delete[] rub; } if( nc ) { delete[] ctag; delete[] clb; delete[] cub; delete[] cends; } if ( freeMatrixRequired ) delete m; resizeColType(nc); CoinFillN(coltype_, nc, 'C'); } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::loadProblem(%p, %p, %p, %p, %p, %p, %p)\n", (void *)&matrix, (void *)collb, (void *)colub, (void *)obj, (void *)rowsen, (void *)rowrhs, (void *)rowrng); #endif } //----------------------------------------------------------------------------- // Assigns a problem void OsiMskSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::assignProblem()\n"); #endif loadProblem( *matrix, collb, colub, obj, rowsen, rowrhs, rowrng ); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowsen; rowsen = 0; delete[] rowrhs; rowrhs = 0; delete[] rowrng; rowrng = 0; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::assignProblem()\n"); #endif } //----------------------------------------------------------------------------- // Loads a problem void OsiMskSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::loadProblem() numcols : %d numrows : %d\n",numcols,numrows); #endif const double inf = getInfinity(); char * rowSense = new char [numrows]; double * rowRhs = new double[numrows]; double * rowRange = new double[numrows]; for ( int i = numrows - 1; i >= 0; --i ) { const double lower = rowlb ? rowlb[i] : -inf; const double upper = rowub ? rowub[i] : inf; convertBoundToSense( lower, upper, rowSense[i], rowRhs[i], rowRange[i] ); } loadProblem(numcols, numrows, start, index, value, collb, colub, obj, rowSense, rowRhs, rowRange); delete [] rowSense; delete [] rowRhs; delete [] rowRange; #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::loadProblem()\n"); #endif } //----------------------------------------------------------------------------- // Loads a problem void OsiMskSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::loadProblem(%d, %d, %p, %p, %p, %p, %p, %p, %p, %p, %p)\n", numcols, numrows, (void *)start, (void *)index, (void *)value, (void *)collb, (void *)colub, (void *)obj, (void *)rowsen,(void *)rowrhs, (void *)rowrng); #endif const int nc = numcols; const int nr = numrows; if( nr == 0 && nc == 0 ) gutsOfDestructor(); else { MSKassert(3,rowsen != NULL,"rowsen != NULL","loadProblem"); MSKassert(3,rowrhs != NULL,"rowrhs != NULL","loadProblem"); int i,j; double * ob; int * rtag =NULL; double * rlb = NULL; double * rub = NULL; int * ctag =NULL; int * cends = NULL; double * clb = NULL; double * cub = NULL; if( obj != NULL ) ob=const_cast(obj); else { ob = new double[nc]; CoinFillN(ob, nc, 0.0); } if( nr ) { rtag = new int[nr]; rlb = new double[nr]; rub = new double[nr]; } for( i=0; i < nr; i++ ) MskConvertSenseToBound( rowsen[i], rowrng != NULL ? rowrng[i] : 0.0, rowrhs[i], rlb[i], rub[i], rtag[i]); double inf = getInfinity(); if( nc ) { ctag = new int[nc]; cends = new int[nc]; clb = new double[nc]; cub = new double[nc]; } if( collb == NULL && colub == NULL ) for(j=0; j < nc; j++) { cends[j] = start[j+1]; MskConvertColBoundToTag(0, inf, clb[j], cub[j], ctag[j]); } else if( collb == NULL ) for(j=0; j < nc; j++) { cends[j] = start[j+1]; MskConvertColBoundToTag( 0, colub[j], clb[j], cub[j], ctag[j]); } else if( colub == NULL ) for(j=0; j < nc; j++) { cends[j] = start[j+1]; MskConvertColBoundToTag(collb[j], inf, clb[j], cub[j], ctag[j]); } else for(j=0; j < nc; j++) { cends[j] = start[j+1]; MskConvertColBoundToTag( collb[j], colub[j], clb[j], cub[j], ctag[j]); } int err=MSK_inputdata(getLpPtr( OsiMskSolverInterface::KEEPCACHED_NONE ), nr, nc, nr, nc, ob, 0.0, const_cast(start), cends, const_cast(index), const_cast(value), (MSKboundkeye*)rtag, rlb, rub, (MSKboundkeye*)ctag, clb, cub); checkMSKerror( err, "MSK_inputdata", "loadProblem3" ); if( obj == NULL ) delete[] ob; if( nr ) { delete[] rtag; delete[] rlb; delete[] rub; } if( nc ) { delete[] ctag; delete[] cends; delete[] clb; delete[] cub; } resizeColType(nc); CoinFillN(coltype_, nc, 'C'); } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::loadProblem(%d, %d, %p, %p, %p, %p, %p, %p, %p, %p, %p)\n", numcols, numrows, (void *)start, (void *)index, (void *)value, (void *)collb, (void *)colub, (void *)obj, (void *)rowsen, (void *)rowrhs, (void *)rowrng); #endif } //----------------------------------------------------------------------------- // Reads a MPS file with Coin native MPS reader. If marked code is switch on // then MOSEK file reader is used, and .gz files can be read aswell. int OsiMskSolverInterface::readMps(const char * filename, const char * extension ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::readMps(%s, %s) %p\n", filename, extension,(void*)this); debugMessage("End OsiMskSolverInterface::readMps(%s, %s)\n", filename, extension); #endif return OsiSolverInterface::readMps(filename,extension); } //----------------------------------------------------------------------------- // Writes the problem in MPS format, uses MOSEK writer. void OsiMskSolverInterface::writeMps( const char * filename, const char * extension, double objSense ) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::writeMps(%s, %s, %g)\n", filename, extension, objSense); #endif std::string f(filename); std::string e(extension); std::string fullname = f + "." + e; OsiSolverInterface::writeMpsNative(fullname.c_str(),NULL, NULL, 0, 2, objSense); #if 0 int err = MSK_writedata( getMutableLpPtr(), const_cast( fullname.c_str() )); checkMSKerror( err, "MSK_writedatafile", "writeMps" ); #endif #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::writeMps(%s, %s, %g)\n", filename, extension, objSense); #endif } void OsiMskSolverInterface::passInMessageHandler(CoinMessageHandler * handler) { OsiSolverInterface::passInMessageHandler(handler); MSK_linkfunctotaskstream(getMutableLpPtr(), MSK_STREAM_LOG, messageHandler(), OsiMskStreamFuncLog); MSK_linkfunctotaskstream(getMutableLpPtr(), MSK_STREAM_ERR, messageHandler(), OsiMskStreamFuncWarning); MSK_linkfunctotaskstream(getMutableLpPtr(), MSK_STREAM_WRN, messageHandler(), OsiMskStreamFuncError); } //############################################################################# // MSK specific public interfaces //############################################################################# //----------------------------------------------------------------------------- // Returns MOSEK task in the interface object MSKenv_t OsiMskSolverInterface::getEnvironmentPtr() { MSKassert(3,env_ != NULL,"probtypemip_","getEnvironmentPtr"); return env_; } //----------------------------------------------------------------------------- // Returns MOSEK task in the interface object MSKtask_t OsiMskSolverInterface::getLpPtr( int keepCached ) { freeCachedData( keepCached ); return getMutableLpPtr(); } //----------------------------------------------------------------------------- // Returns the coltype_ array const char * OsiMskSolverInterface::getCtype() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getCtype()\n"); debugMessage("End OsiMskSolverInterface::getCtype()\n"); #endif return coltype_; } //############################################################################# // Static instance counter methods //############################################################################# //----------------------------------------------------------------------------- // Increment the instance count, so we know when to close and open MOSEK. void OsiMskSolverInterface::incrementInstanceCounter() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::incrementInstanceCounter()\n"); #endif if ( numInstances_ == 0 ) { int err=0; #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("creating new Mosek environment\n"); #endif #if MSK_VERSION_MAJOR >= 7 err = MSK_makeenv(&env_,NULL); #else err = MSK_makeenv(&env_,NULL,NULL,NULL,NULL); #endif checkMSKerror( err, "MSK_makeenv", "incrementInstanceCounter" ); err = MSK_linkfunctoenvstream(env_, MSK_STREAM_LOG, NULL, printlog); checkMSKerror( err, "MSK_linkfunctoenvstream", "incrementInstanceCounter" ); err = MSK_initenv(env_); checkMSKerror( err, "MSK_initenv", "incrementInstanceCounter" ); } numInstances_++; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::incrementInstanceCounter()\n"); #endif } //----------------------------------------------------------------------------- // Decrement the instance count, so we know when to close and open MOSEK. void OsiMskSolverInterface::decrementInstanceCounter() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::decrementInstanceCounter()\n"); #endif MSKassert(3,numInstances_ != 0,"numInstances_ != 0","decrementInstanceCounter"); numInstances_--; if ( numInstances_ == 0 ) { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("deleting Mosek environment\n"); #endif int err = MSK_deleteenv(&env_); checkMSKerror( err, "MSK_deleteenv", "decrementInstanceCounter" ); env_ = NULL; } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::decrementInstanceCounter()\n"); #endif } //----------------------------------------------------------------------------- // Returns the number of OsiMskSolverInterface objects in play unsigned int OsiMskSolverInterface::getNumInstances() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getNumInstances()\n"); debugMessage("End OsiMskSolverInterface::getNumInstances()\n"); #endif return numInstances_; } //############################################################################# // Constructors, destructors clone and assignment //############################################################################# //----------------------------------------------------------------------------- // Constructor OsiMskSolverInterface::OsiMskSolverInterface(MSKenv_t mskenv) : OsiSolverInterface(), Mskerr(MSK_RES_OK), ObjOffset_(0.0), InitialSolver(INITIAL_SOLVE), task_(NULL), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(1000000), obj_(NULL), collower_(NULL), colupper_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), rowlower_(NULL), rowupper_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), coltype_(NULL), coltypesize_(0), probtypemip_(false) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::OsiMskSolverinterface()\n"); #endif if (mskenv) { if (env_) { throw CoinError("Already have a global Mosek environment. Cannot use second one.", "OsiMskSolverInterface", "OsiMskSolverInterface"); } env_ = mskenv; ++numInstances_; } else incrementInstanceCounter(); gutsOfConstructor(); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::OsiMskSolverinterface()\n"); #endif } //----------------------------------------------------------------------------- // Clone from one to another object OsiSolverInterface * OsiMskSolverInterface::clone(bool copyData) const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::clone(%d)\n", copyData); debugMessage("End OsiMskSolverInterface::clone(%d)\n", copyData); #endif return( new OsiMskSolverInterface( *this ) ); } //----------------------------------------------------------------------------- // Copy constructor OsiMskSolverInterface::OsiMskSolverInterface( const OsiMskSolverInterface & source ) : OsiSolverInterface(source), Mskerr(MSK_RES_OK), MSKsolverused_(INITIAL_SOLVE), ObjOffset_(source.ObjOffset_), InitialSolver(INITIAL_SOLVE), task_(NULL), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(source.hotStartMaxIteration_), obj_(NULL), collower_(NULL), colupper_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), rowlower_(NULL), rowupper_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), coltype_(NULL), coltypesize_(0), probtypemip_(false) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::OsiMskSolverInterface from (%p) to %p\n", (void *)&source,(void*)this); #endif incrementInstanceCounter(); gutsOfConstructor(); gutsOfCopy( source ); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::OsiMskSolverInterface(%p)\n", (void *)&source); #endif } //----------------------------------------------------------------------------- // Destructor OsiMskSolverInterface::~OsiMskSolverInterface() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::~OsiMskSolverInterface()\n"); #endif gutsOfDestructor(); decrementInstanceCounter(); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::~OsiMskSolverInterface()\n"); #endif } //----------------------------------------------------------------------------- // Assign operator OsiMskSolverInterface& OsiMskSolverInterface::operator=( const OsiMskSolverInterface& rhs ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::operator=(%p)\n", (void *)&rhs); #endif if (this != &rhs) { OsiSolverInterface::operator=( rhs ); gutsOfDestructor(); gutsOfConstructor(); if ( rhs.task_ !=NULL ) gutsOfCopy( rhs ); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::operator=(%p)\n", (void *)&rhs); #endif return *this; } //############################################################################# // Applying cuts //############################################################################# //----------------------------------------------------------------------------- // Apply col cut void OsiMskSolverInterface::applyColCut( const OsiColCut & cc ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::applyColCut(%p)\n", (void *)&cc); #endif double * MskColLB = new double[getNumCols()]; double * MskColUB = new double[getNumCols()]; const CoinPackedVector & lbs = cc.lbs(); const CoinPackedVector & ubs = cc.ubs(); int i; for( i = 0; i < getNumCols(); ++i ) { MskColLB[i] = getColLower()[i]; MskColUB[i] = getColUpper()[i]; } for( i = 0; i < lbs.getNumElements(); ++i ) if ( lbs.getElements()[i] > MskColLB[lbs.getIndices()[i]] ) setColLower( lbs.getIndices()[i], lbs.getElements()[i] ); for( i = 0; i < ubs.getNumElements(); ++i ) if ( ubs.getElements()[i] < MskColUB[ubs.getIndices()[i]] ) setColUpper( ubs.getIndices()[i], ubs.getElements()[i] ); delete[] MskColLB; delete[] MskColUB; #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::applyColCut(%p)\n", (void *)&cc); #endif } //----------------------------------------------------------------------------- // Apply row cut void OsiMskSolverInterface::applyRowCut( const OsiRowCut & rowCut ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::applyRowCut(%p)\n", (void *)&rowCut); #endif const CoinPackedVector & row=rowCut.row(); addRow(row , rowCut.lb(),rowCut.ub()); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::applyRowCut(%p)\n", (void *)&rowCut); #endif } //############################################################################# // Private methods (non-static and static) and static data //############################################################################# unsigned int OsiMskSolverInterface::numInstances_ = 0; MSKenv_t OsiMskSolverInterface::env_=NULL; //----------------------------------------------------------------------------- // Returns MOSEK task in object MSKtask_t OsiMskSolverInterface::getMutableLpPtr() const { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::getMutableLpPtr()\n"); #endif if ( task_ == NULL ) { MSKassert(3,env_ != NULL,"env_ == NULL","getMutableLpPtr"); int err = MSK_makeemptytask(env_,&task_); checkMSKerror(err, "MSK_makeemptytask","getMutableLpPtr"); err = MSK_linkfunctotaskstream(task_, MSK_STREAM_LOG, messageHandler(), OsiMskStreamFuncLog); checkMSKerror( err, "MSK_linkfunctotaskstream", "getMutableLpPtr" ); err = MSK_linkfunctotaskstream(task_, MSK_STREAM_WRN, messageHandler(), OsiMskStreamFuncWarning); checkMSKerror( err, "MSK_linkfunctotaskstream", "getMutableLpPtr" ); err = MSK_linkfunctotaskstream(task_, MSK_STREAM_ERR, messageHandler(), OsiMskStreamFuncError); checkMSKerror( err, "MSK_linkfunctotaskstream", "getMutableLpPtr" ); err = MSK_putintparam(task_, MSK_IPAR_WRITE_GENERIC_NAMES, MSK_ON); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); err = MSK_putintparam(task_, MSK_IPAR_PRESOLVE_USE, MSK_ON); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); err = MSK_putintparam(task_, MSK_IPAR_WRITE_DATA_FORMAT, MSK_DATA_FORMAT_MPS); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); err = MSK_putintparam(task_, MSK_IPAR_WRITE_GENERIC_NAMES, MSK_ON); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); #if MSK_DO_MOSEK_LOG > 0 char file[] = "MOSEK.log"; err = MSK_linkfiletotaskstream(task_, MSK_STREAM_LOG, file, 0); checkMSKerror( err, "MSK_linkfiletotaskstream", "getMutableLpPtr" ); err = MSK_putintparam(task_, MSK_IPAR_LOG, 100); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); err = MSK_putintparam(task_, MSK_IPAR_LOG_SIM, 100); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); err = MSK_putintparam(task_, MSK_IPAR_LOG_INTPNT, 100); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); #else err = MSK_putintparam(task_, MSK_IPAR_LOG, 100); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); #endif err = MSK_putintparam(task_,MSK_IPAR_SIM_SOLVE_FORM,MSK_SOLVE_PRIMAL); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); err = MSK_putintparam(task_,MSK_IPAR_SIM_HOTSTART,MSK_SIM_HOTSTART_STATUS_KEYS); checkMSKerror(err,"MSK_putintparam","getMutableLpPtr()"); std::string pn; getStrParam(OsiProbName,pn); MSK_puttaskname( task_, const_cast(pn.c_str()) ); checkMSKerror(err,"MSK_puttaskname","getMutableLpPtr()"); } #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::getMutableLpPtr()\n"); #endif return task_; } //----------------------------------------------------------------------------- // Makes a copy void OsiMskSolverInterface::gutsOfCopy( const OsiMskSolverInterface & source ) { #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("Begin OsiMskSolverInterface::gutsOfCopy()\n"); #endif int err; InitialSolver = source.InitialSolver; MSKassert(3, task_ == NULL, "task_ == NULL", "gutsOfCopy"); err = MSK_clonetask(source.getMutableLpPtr(),&task_); checkMSKerror( err, "MSK_clonetask", "gutsOfCopy" ); // Set MIP information resizeColType(source.coltypesize_); CoinDisjointCopyN( source.coltype_, source.coltypesize_, coltype_ ); // Updates task MIP information for( int k = 0; k < source.coltypesize_; ++k ) { switch(coltype_[k]) { case 'I': setInteger(k); break; case 'C': setContinuous(k); break; } } #if MSK_OSI_DEBUG_LEVEL > 1 debugMessage("End OsiMskSolverInterface::gutsOfCopy()\n"); #endif } //----------------------------------------------------------------------------- // Empty function void OsiMskSolverInterface::gutsOfConstructor() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::gutsOfConstructor()\n"); #endif #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::gutsOfConstructor()\n"); #endif } //----------------------------------------------------------------------------- // Function called from destructor void OsiMskSolverInterface::gutsOfDestructor() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::gutsOfDestructor()\n"); #endif freeCachedData(KEEPCACHED_NONE); if ( task_ != NULL ) { MSK_unlinkfuncfromtaskstream(getMutableLpPtr(), MSK_STREAM_LOG); MSK_unlinkfuncfromtaskstream(getMutableLpPtr(), MSK_STREAM_ERR); MSK_unlinkfuncfromtaskstream(getMutableLpPtr(), MSK_STREAM_WRN); int err = MSK_deletetask(&task_); checkMSKerror( err, "MSK_deletetask", "gutsOfDestructor" ); task_ = NULL; freeAllMemory(); } MSKassert(3,task_==NULL,"task_==NULL","gutsOfDestructor"); MSKassert(3,obj_==NULL,"obj_==NULL","gutsOfDestructor"); MSKassert(3,collower_==NULL,"collower_==NULL","gutsOfDestructor"); MSKassert(3,colupper_==NULL,"colupper_==NULL","gutsOfDestructor"); MSKassert(3,rowsense_==NULL,"rowsense_==NULL","gutsOfDestructor"); MSKassert(3,rhs_==NULL,"rhs_==NULL","gutsOfDestructor"); MSKassert(3,rowrange_==NULL,"rowrange_==NULL","gutsOfDestructor"); MSKassert(3,rowlower_==NULL,"rowlower_==NULL","gutsOfDestructor"); MSKassert(3,rowupper_==NULL,"rowupper_==NULL","gutsOfDestructor"); MSKassert(3,colsol_==NULL,"colsol_==NULL","gutsOfDestructor"); MSKassert(3,rowsol_==NULL,"rowsol_==NULL","gutsOfDestructor"); MSKassert(3,redcost_==NULL,"redcost_==NULL","gutsOfDestructor"); MSKassert(3,rowact_==NULL,"rowact_==NULL","gutsOfDestructor"); MSKassert(3,matrixByRow_==NULL,"probtypemip_","gutsOfDestructor"); MSKassert(3,matrixByCol_==NULL,"matrixByCol_==NULL","gutsOfDestructor"); MSKassert(3,coltype_==NULL,"coltype_==NULL","gutsOfDestructor"); MSKassert(3,coltypesize_==0,"coltypesize_==0","gutsOfDestructor"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::gutsOfDestructor()\n"); #endif } //----------------------------------------------------------------------------- // Free function void OsiMskSolverInterface::freeCachedColRim() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::freeCachedColRim()\n"); #endif freeCacheDouble( obj_ ); freeCacheDouble( collower_ ); freeCacheDouble( colupper_ ); MSKassert(3,obj_==NULL,"obj_==NULL","freeCachedColRim"); MSKassert(3,collower_==NULL,"collower_==NULL","freeCachedColRim"); MSKassert(3,colupper_==NULL,"colupper_==NULL","freeCachedColRim"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::freeCachedColRim()\n"); #endif } //----------------------------------------------------------------------------- // Free function void OsiMskSolverInterface::freeCachedRowRim() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::freeCachedRowRim()\n"); #endif freeCacheChar( rowsense_ ); freeCacheDouble( rhs_ ); freeCacheDouble( rowrange_ ); freeCacheDouble( rowlower_ ); freeCacheDouble( rowupper_ ); MSKassert(3,rowsense_==NULL,"rowsense_==NULL","freeCachedRowRim"); MSKassert(3,rhs_==NULL,"rhs_==NULL","freeCachedRowRim"); MSKassert(3,rowrange_==NULL,"rowrange_==NULL","freeCachedRowRim"); MSKassert(3,rowlower_==NULL,"rowlower_==NULL","freeCachedRowRim"); MSKassert(3,rowupper_==NULL,"rowupper_==NULL","freeCachedRowRim"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::freeCachedRowRim()\n"); #endif } //----------------------------------------------------------------------------- // Free function void OsiMskSolverInterface::freeCachedMatrix() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::freeCachedMatrix()\n"); #endif freeCacheMatrix( matrixByRow_ ); freeCacheMatrix( matrixByCol_ ); MSKassert(3,matrixByRow_==NULL,"matrixByRow_==NULL","freeCachedMatrix"); MSKassert(3,matrixByCol_==NULL,"matrixByCol_==NULL","freeCachedMatrix"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::freeCachedMatrix()\n"); #endif } //----------------------------------------------------------------------------- // Free function void OsiMskSolverInterface::freeCachedResults() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::freeCachedResults()\n"); #endif freeCacheDouble( colsol_ ); freeCacheDouble( rowsol_ ); freeCacheDouble( redcost_ ); freeCacheDouble( rowact_ ); MSKassert(3,colsol_==NULL,"colsol_==NULL","freeCachedResults"); MSKassert(3,rowsol_==NULL,"rowsol_==NULL","freeCachedResults"); MSKassert(3,redcost_==NULL,"redcost_==NULL","freeCachedResults"); MSKassert(3,rowact_==NULL,"rowact_==NULL","freeCachedResults"); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::freeCachedResults()\n"); #endif } //----------------------------------------------------------------------------- // Free function void OsiMskSolverInterface::freeCachedData( int keepCached ) { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::freeCachedResults()\n"); #endif if( !(keepCached & OsiMskSolverInterface::KEEPCACHED_COLUMN) ) freeCachedColRim(); if( !(keepCached & OsiMskSolverInterface::KEEPCACHED_ROW) ) freeCachedRowRim(); if( !(keepCached & OsiMskSolverInterface::KEEPCACHED_MATRIX) ) freeCachedMatrix(); if( !(keepCached & OsiMskSolverInterface::KEEPCACHED_RESULTS) ) freeCachedResults(); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::freeCachedResults()\n"); #endif } //----------------------------------------------------------------------------- // Free function void OsiMskSolverInterface::freeAllMemory() { #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("Begin OsiMskSolverInterface::freeCachedResults()\n"); #endif freeCachedData(); if( hotStartCStat_ != NULL ) delete[] hotStartCStat_; if( hotStartRStat_ != NULL ) delete[] hotStartRStat_; hotStartCStat_ = NULL; hotStartCStatSize_ = 0; hotStartRStat_ = NULL; hotStartRStatSize_ = 0; freeColType(); #if MSK_OSI_DEBUG_LEVEL > 3 debugMessage("End OsiMskSolverInterface::freeCachedResults()\n"); #endif } Osi-0.106.4/src/OsiMsk/Makefile.am0000644000076600007660000000314011621722556015127 0ustar coincoin# Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1800 2011-08-14 10:37:34Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiMsk # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiMsk.la # List all source files for this library, including headers libOsiMsk_la_SOURCES = \ OsiMskSolverInterface.cpp OsiMskSolverInterface.hpp # This is for libtool (on Windows) libOsiMsk_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ -I`$(CYGPATH_W) $(MSKINCDIR)` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiMskSolverInterface.hpp Osi-0.106.4/src/OsiMsk/Makefile.in0000644000076600007660000005432312240315110015127 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Andreas Waechter IBM 2006-04-13 srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/OsiMsk DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsiMsk_la_LIBADD = am_libOsiMsk_la_OBJECTS = OsiMskSolverInterface.lo libOsiMsk_la_OBJECTS = $(am_libOsiMsk_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsiMsk_la_SOURCES) DIST_SOURCES = $(libOsiMsk_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiMsk # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiMsk.la # List all source files for this library, including headers libOsiMsk_la_SOURCES = \ OsiMskSolverInterface.cpp OsiMskSolverInterface.hpp # This is for libtool (on Windows) libOsiMsk_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ -I`$(CYGPATH_W) $(MSKINCDIR)` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiMskSolverInterface.hpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OsiMsk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/OsiMsk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsiMsk.la: $(libOsiMsk_la_OBJECTS) $(libOsiMsk_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsiMsk_la_LDFLAGS) $(libOsiMsk_la_OBJECTS) $(libOsiMsk_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiMskSolverInterface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/OsiMsk/osi-mosek-uninstalled.pc.in0000644000076600007660000000043611507670402020252 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src/OsiMsk Name: OsiMosek Description: COIN-OR Open Solver Interface for Mosek URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: ${libdir}/libOsiMsk.la @MSKLIB@ Cflags: -I@abs_source_dir@/src/OsiMsk -I@MSKINCDIR@ Requires: osi Osi-0.106.4/src/OsiMsk/OsiMskSolverInterface.hpp0000644000076600007660000007530412055732267020042 0ustar coincoin// Osi interface for Mosek ver. 5.0 // Lower versions are not supported //----------------------------------------------------------------------------- // name: OSI Interface for MOSEK // author: Bo Jensen // email: support@MOSEK.com //----------------------------------------------------------------------------- // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiMskSolverInterface_H #define OsiMskSolverInterface_H #include "OsiSolverInterface.hpp" typedef void* MSKtask_t; typedef void* MSKenv_t; /* MOSEK Solver Interface Instantiation of OsiMskSolverInterface for MOSEK */ class OsiMskSolverInterface : virtual public OsiSolverInterface { friend void OsiMskSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); public: //--------------------------------------------------------------------------- /**@name Solve methods */ //@{ /// Solve initial LP relaxation virtual void initialSolve(); /// Resolve an LP relaxation after problem modification virtual void resolve(); /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound(); //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. */ //@{ // Set an integer parameter bool setIntParam(OsiIntParam key, int value); // Set an double parameter bool setDblParam(OsiDblParam key, double value); // Set a string parameter bool setStrParam(OsiStrParam key, const std::string & value); // Get an integer parameter bool getIntParam(OsiIntParam key, int& value) const; // Get an double parameter bool getDblParam(OsiDblParam key, double& value) const; // Get a string parameter bool getStrParam(OsiStrParam key, std::string& value) const; //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there a numerical difficulties? virtual bool isAbandoned() const; /// Is optimality proven? virtual bool isProvenOptimal() const; /// Is primal infeasiblity proven? virtual bool isProvenPrimalInfeasible() const; /// Is dual infeasiblity proven? virtual bool isProvenDualInfeasible() const; /// Is the given primal objective limit reached? virtual bool isPrimalObjectiveLimitReached() const; /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const; /// Has there been a license problem? virtual bool isLicenseError() const; /// Get rescode return of last Mosek optimizer call int getRescode() const { return Mskerr; } //@} //--------------------------------------------------------------------------- /**@name WarmStart related methods */ /*! \brief Get an empty warm start object This routine returns an empty CoinWarmStartBasis object. Its purpose is to provide a way to give a client a warm start basis object of the appropriate type, which can resized and modified as desired. */ CoinWarmStart* getEmptyWarmStart () const; //@{ /// Get warmstarting information virtual CoinWarmStart* getWarmStart() const; /** Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. */ virtual bool setWarmStart(const CoinWarmStart* warmstart); //@} //--------------------------------------------------------------------------- /**@name Hotstart related methods (primarily used in strong branching).
    The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there.
    NOTE: between hotstarted optimizations only bound changes are allowed. */ //@{ /// Create a hotstart point of the optimization process virtual void markHotStart(); /// Optimize starting from the hotstart virtual void solveFromHotStart(); /// Delete the snapshot virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem information methods These methods call the solver's query routines to return information about the problem referred to by the current object. Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /**@name Methods related to querying the input data */ //@{ /// Get number of columns virtual int getNumCols() const; /// Get number of rows virtual int getNumRows() const; /// Get number of nonzero elements virtual int getNumElements() const; /// Get pointer to array[getNumCols()] of column lower bounds virtual const double * getColLower() const; /// Get pointer to array[getNumCols()] of column upper bounds virtual const double * getColUpper() const; /** Get pointer to array[getNumRows()] of row constraint senses.
    • 'L': <= constraint
    • 'E': = constraint
    • 'G': >= constraint
    • 'R': ranged constraint
    • 'N': free constraint
    */ virtual const char * getRowSense() const; /** Get pointer to array[getNumRows()] of rows right-hand sides
    • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
    • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'N' then rhs()[i] == 0.0
    */ virtual const double * getRightHandSide() const; /** Get pointer to array[getNumRows()] of row ranges.
    • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
    • if rowsense()[i] != 'R' then rowrange()[i] is 0.0
    */ virtual const double * getRowRange() const; /// Get pointer to array[getNumRows()] of row lower bounds virtual const double * getRowLower() const; /// Get pointer to array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const; /// Get pointer to array[getNumCols()] of objective function coefficients virtual const double * getObjCoefficients() const; /// Get objective function sense (1 for min (default), -1 for max) virtual double getObjSense() const; /// Return true if column is continuous virtual bool isContinuous(int colNumber) const; #if 0 /// Return true if column is binary virtual bool isBinary(int columnNumber) const; /** Return true if column is integer. Note: This function returns true if the the column is binary or a general integer. */ virtual bool isInteger(int columnNumber) const; /// Return true if column is general integer virtual bool isIntegerNonBinary(int columnNumber) const; /// Return true if column is binary and not fixed at either bound virtual bool isFreeBinary(int columnNumber) const; #endif /// Get pointer to row-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByRow() const; /// Get pointer to column-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByCol() const; /// Get solver's value for infinity virtual double getInfinity() const; //@} /**@name Methods related to querying the solution */ //@{ /// Get pointer to array[getNumCols()] of primal solution vector virtual const double * getColSolution() const; /// Get pointer to array[getNumRows()] of dual prices virtual const double * getRowPrice() const; /// Get a pointer to array[getNumCols()] of reduced costs virtual const double * getReducedCost() const; /** Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector */ virtual const double * getRowActivity() const; /// Get objective function value virtual double getObjValue() const; /** Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. */ virtual int getIterationCount() const; /** Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.) The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay=false) const; /** Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.) NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getPrimalRays(int maxNumRays) const; #if 0 /** Get vector of indices of solution which are integer variables presently at fractional values */ virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const; #endif //@} //@} //--------------------------------------------------------------------------- /**@name Problem modifying methods */ //@{ //------------------------------------------------------------------------- /**@name Changing bounds on variables and constraints */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff( int elementIndex, double elementValue ); /** Set a a set of objective function coefficients */ virtual void setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList); /** Set a single column lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setColLower( int elementIndex, double elementValue ); /** Set a single column upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setColUpper( int elementIndex, double elementValue ); /** Set a single column lower and upper bound
    The default implementation just invokes setColLower() and setColUpper() */ virtual void setColBounds( int elementIndex, double lower, double upper ); /** Set the bounds on a number of columns simultaneously
    The default implementation just invokes setCollower() and setColupper() over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the variables */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set a single row lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setRowLower( int elementIndex, double elementValue ); /** Set a single row upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setRowUpper( int elementIndex, double elementValue ); /** Set a single row lower and upper bound
    The default implementation just invokes setRowLower() and setRowUpper() */ virtual void setRowBounds( int elementIndex, double lower, double upper ); /** Set the type of a single row
    */ virtual void setRowType(int index, char sense, double rightHandSide, double range); /** Set the bounds on a number of rows simultaneously
    The default implementation just invokes setRowLower() and setRowUpper() over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the constraints */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a number of rows simultaneously
    The default implementation just invokes setRowType() and over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose type changes @param senseList the new senses @param rhsList the new right hand sides @param rangeList the new ranges */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); //@} //------------------------------------------------------------------------- /**@name Integrality related changing methods */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index); /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index); /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); //@} //------------------------------------------------------------------------- /// Set objective function sense (1 for min (default), -1 for max,) virtual void setObjSense(double s); /** Set the primal solution column values colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double * colsol); /** Set dual solution vector rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice); //------------------------------------------------------------------------- /**@name Methods to expand a problem.
    Note that if a column is added then by default it will correspond to a continuous variable. */ //@{ /** */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj); /** */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); /** */ virtual void deleteCols(const int num, const int * colIndices); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); /** */ virtual void deleteRows(const int num, const int * rowIndices); #if 0 // ??? implemented in OsiSolverInterface //----------------------------------------------------------------------- /** Apply a collection of cuts.
    Only cuts which have an effectiveness >= effectivenessLb are applied.
    • ReturnCode.numberIneffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
    • ReturnCode.numberInconsistent() -- number of invalid cuts
    • ReturnCode.numberInconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
    • ReturnCode.numberInfeasible() -- number of cuts that would make this integer model infeasible
    • ReturnCode.numberApplied() -- number of integer cuts which were applied to the integer model
    • cs.size() == numberIneffective() + numberInconsistent() + numberInconsistentWrtIntegerModel() + numberInfeasible() + nubmerApplied()
    */ virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); #endif //@} //@} //--------------------------------------------------------------------------- /**@name Methods to input a problem */ //@{ /** Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • rowub: all rows have upper bound infinity
    • rowlb: all rows have lower bound -infinity
    • obj: all variables have 0 objective coefficient
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub); /** Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • obj: all variables have 0 objective coefficient
    • rowsen: all rows are >=
    • rowrhs: all right hand sides are 0
    • rowrng: 0 for the ranged rows
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Read an mps file from the given filename */ virtual int readMps(const char *filename, const char *extension = "mps"); /** Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants */ virtual void writeMps(const char *filename, const char *extension = "mps", double objSense=0.0) const; //@} /**@name Message handling */ //@{ /** Pass in a message handler It is the client's responsibility to destroy a message handler installed by this routine; it will not be destroyed when the solver interface is destroyed. */ void passInMessageHandler(CoinMessageHandler * handler); //@} //--------------------------------------------------------------------------- /**@name MOSEK specific public interfaces */ //@{ /** Get pointer to MOSEK model and free all specified cached data entries (combined with logical or-operator '|' ): */ enum keepCachedFlag { /// discard all cached data (default) KEEPCACHED_NONE = 0, /// column information: objective values, lower and upper bounds, variable types KEEPCACHED_COLUMN = 1, /// row information: right hand sides, ranges and senses, lower and upper bounds for row KEEPCACHED_ROW = 2, /// problem matrix: matrix ordered by column and by row KEEPCACHED_MATRIX = 4, /// LP solution: primal and dual solution, reduced costs, row activities KEEPCACHED_RESULTS = 8, /// only discard cached LP solution KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX, /// keep all cached data (similar to getMutableLpPtr()) KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS, /// free only cached column and LP solution information FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN, /// free only cached row and LP solution information FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW, /// free only cached matrix and LP solution information FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX, /// free only cached LP solution information FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS }; MSKtask_t getLpPtr( int keepCached = KEEPCACHED_NONE ); //@{ /// Method to access MOSEK environment pointer MSKenv_t getEnvironmentPtr(); //@} /// return a vector of variable types (continous, binary, integer) const char* getCtype() const; /**@name Static instance counter methods */ /** MOSEK has a context which must be created prior to all other MOSEK calls. This method:
    • Increments by 1 the number of uses of the MOSEK environment.
    • Creates the MOSEK context when the number of uses is change to 1 from 0.
    */ static void incrementInstanceCounter(); /** MOSEK has a context which should be deleted after MOSEK calls. This method:
    • Decrements by 1 the number of uses of the MOSEK environment.
    • Deletes the MOSEK context when the number of uses is change to 0 from 1.
    */ static void decrementInstanceCounter(); /// Return the number of instances of instantiated objects using MOSEK services. static unsigned int getNumInstances(); //@} //@} /**@name Constructors and destructor */ //@{ /// Default Constructor /// optional argument mskenv can be used to reach in an initialized user environment /// OsiMsk assumes membership of mskenv, so it will be freed when the last instanciation of OsiMsk is deleted OsiMskSolverInterface(MSKenv_t mskenv = NULL); /// Clone virtual OsiSolverInterface * clone(bool copyData = true) const; /// Copy constructor OsiMskSolverInterface( const OsiMskSolverInterface& ); /// Assignment operator OsiMskSolverInterface& operator=( const OsiMskSolverInterface& rhs ); /// Destructor virtual ~OsiMskSolverInterface(); //@} protected: /**@name Protected methods */ //@{ /// Apply a row cut. Return true if cut was applied. virtual void applyRowCut( const OsiRowCut & rc ); /** Apply a column cut (bound adjustment). Return true if cut was applied. */ virtual void applyColCut( const OsiColCut & cc ); //@} private: /**@name Private static class functions */ //@{ /// switches MOSEK to prob type LP void switchToLP(); /// switches MOSEK to prob type MIP void switchToMIP(); /// resizes coltype_ vector to be able to store at least minsize elements void resizeColType( int minsize ); /// frees colsize_ vector void freeColType(); bool definedSolution(int solution) const; int solverUsed() const; //@} /**@name Private static class data */ //@{ /// MOSEK environment pointer static MSKenv_t env_ ; /// Number of live problem instances //static unsigned int numInstances_; //@} static unsigned int numInstances_; /**@name Private methods */ //@{ int Mskerr; int MSKsolverused_; double ObjOffset_; int InitialSolver; /// Get task Pointer for const methods public: MSKtask_t getMutableLpPtr() const; /// The real work of a copy constructor (used by copy and assignment) void gutsOfCopy( const OsiMskSolverInterface & source ); /// The real work of the constructor void gutsOfConstructor(); /// The real work of the destructor void gutsOfDestructor(); /// free cached column rim vectors void freeCachedColRim(); /// free cached row rim vectors void freeCachedRowRim(); /// free cached result vectors void freeCachedResults(); /// free cached matrices void freeCachedMatrix(); /// free all cached data (except specified entries, see getLpPtr()) void freeCachedData( int keepCached = KEEPCACHED_NONE ); /// free all allocated memory void freeAllMemory(); /**@name Private member data */ //@{ /// MOSEK model represented by this class instance mutable MSKtask_t task_; /// Hotstart information int *hotStartCStat_; int hotStartCStatSize_; int *hotStartRStat_; int hotStartRStatSize_; int hotStartMaxIteration_; /**@name Cached information derived from the MOSEK model */ //@{ /// Pointer to objective vector mutable double *obj_; /// Pointer to dense vector of variable lower bounds mutable double *collower_; /// Pointer to dense vector of variable lower bounds mutable double *colupper_; /// Pointer to dense vector of row sense indicators mutable char *rowsense_; /// Pointer to dense vector of row right-hand side values mutable double *rhs_; /// Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) mutable double *rowrange_; /// Pointer to dense vector of row lower bounds mutable double *rowlower_; /// Pointer to dense vector of row upper bounds mutable double *rowupper_; /// Pointer to primal solution vector mutable double *colsol_; /// Pointer to dual solution vector mutable double *rowsol_; /// Pointer to reduced cost vector mutable double *redcost_; /// Pointer to row activity (slack) vector mutable double *rowact_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByRow_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByCol_; //@} /**@name Additional information needed for storing MIP problems */ //@{ /// Pointer to dense vector of variable types (continous, binary, integer) char *coltype_; /// Size of allocated memory for coltype_ int coltypesize_; /// Stores whether MOSEK' prob type is currently set to MIP mutable bool probtypemip_; //@} }; //############################################################################# /** A function that tests the methods in the OsiMskSolverInterface class */ void OsiMskSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); #endif Osi-0.106.4/src/OsiMsk/osi-mosek.pc.in0000644000076600007660000000046511510106235015724 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: OsiMosek Description: COIN-OR Open Solver Interface for Mosek URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsiMsk @MSKLIB@ Cflags: -I${includedir} -I@MSKINCDIR@ Requires: osi Osi-0.106.4/src/OsiCpx/0000755000076600007660000000000012244064313013065 5ustar coincoinOsi-0.106.4/src/OsiCpx/osi-cplex-uninstalled.pc.in0000644000076600007660000000043611507670402020247 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src/OsiCpx Name: OsiCplex Description: COIN-OR Open Solver Interface for CPLEX URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: ${libdir}/libOsiCpx.la @CPXLIB@ Cflags: -I@abs_source_dir@/src/OsiCpx -I@CPXINCDIR@ Requires: osi Osi-0.106.4/src/OsiCpx/Makefile.am0000644000076600007660000000314011621722556015127 0ustar coincoin# Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1800 2011-08-14 10:37:34Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiCpx # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiCpx.la # List all source files for this library, including headers libOsiCpx_la_SOURCES = \ OsiCpxSolverInterface.cpp OsiCpxSolverInterface.hpp # This is for libtool (on Windows) libOsiCpx_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(CPXINCDIR)` \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiCpxSolverInterface.hpp Osi-0.106.4/src/OsiCpx/OsiCpxSolverInterface.hpp0000644000076600007660000010154012062577416020033 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for CPLEX // author: Tobias Pfender // Konrad-Zuse-Zentrum Berlin (Germany) // email: pfender@zib.de // date: 09/25/2000 // license: this file may be freely distributed under the terms of EPL // comments: please scan this file for '???' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2000, Tobias Pfender, International Business Machines // Corporation and others. All Rights Reserved. #ifndef OsiCpxSolverInterface_H #define OsiCpxSolverInterface_H #include "OsiSolverInterface.hpp" #include "CoinWarmStartBasis.hpp" #include "OsiColCut.hpp" #include "OsiRowCut.hpp" typedef struct cpxlp* CPXLPptr; typedef struct cpxenv* CPXENVptr; /** CPLEX Solver Interface Instantiation of OsiCpxSolverInterface for CPLEX */ class OsiCpxSolverInterface : virtual public OsiSolverInterface { friend void OsiCpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); public: //--------------------------------------------------------------------------- /**@name Solve methods */ //@{ /// Solve initial LP relaxation virtual void initialSolve(); /// Resolve an LP relaxation after problem modification virtual void resolve(); /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound(); //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. */ //@{ // Set an integer parameter bool setIntParam(OsiIntParam key, int value); // Set an double parameter bool setDblParam(OsiDblParam key, double value); // Set a string parameter bool setStrParam(OsiStrParam key, const std::string & value); // Get an integer parameter bool getIntParam(OsiIntParam key, int& value) const; // Get an double parameter bool getDblParam(OsiDblParam key, double& value) const; // Get a string parameter bool getStrParam(OsiStrParam key, std::string& value) const; // Set mipstart option (pass column solution to CPLEX before MIP start) void setMipStart(bool value) { domipstart = value; } // Get mipstart option value bool getMipStart() const { return domipstart; } //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there a numerical difficulties? virtual bool isAbandoned() const; /// Is optimality proven? virtual bool isProvenOptimal() const; /// Is primal infeasiblity proven? virtual bool isProvenPrimalInfeasible() const; /// Is dual infeasiblity proven? virtual bool isProvenDualInfeasible() const; /// Is the given primal objective limit reached? virtual bool isPrimalObjectiveLimitReached() const; /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const; //@} //--------------------------------------------------------------------------- /**@name WarmStart related methods */ //@{ /*! \brief Get an empty warm start object This routine returns an empty CoinWarmStartBasis object. Its purpose is to provide a way to give a client a warm start basis object of the appropriate type, which can resized and modified as desired. */ CoinWarmStart *getEmptyWarmStart () const; /// Get warmstarting information virtual CoinWarmStart* getWarmStart() const; /** Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. */ virtual bool setWarmStart(const CoinWarmStart* warmstart); //@} //--------------------------------------------------------------------------- /**@name Hotstart related methods (primarily used in strong branching).
    The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there.
    NOTE: between hotstarted optimizations only bound changes are allowed. */ //@{ /// Create a hotstart point of the optimization process virtual void markHotStart(); /// Optimize starting from the hotstart virtual void solveFromHotStart(); /// Delete the snapshot virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem information methods These methods call the solver's query routines to return information about the problem referred to by the current object. Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /**@name Methods related to querying the input data */ //@{ /// Get number of columns virtual int getNumCols() const; /// Get number of rows virtual int getNumRows() const; /// Get number of nonzero elements virtual int getNumElements() const; /// Get pointer to array[getNumCols()] of column lower bounds virtual const double * getColLower() const; /// Get pointer to array[getNumCols()] of column upper bounds virtual const double * getColUpper() const; /** Get pointer to array[getNumRows()] of row constraint senses.
    • 'L': <= constraint
    • 'E': = constraint
    • 'G': >= constraint
    • 'R': ranged constraint
    • 'N': free constraint
    */ virtual const char * getRowSense() const; /** Get pointer to array[getNumRows()] of rows right-hand sides
    • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
    • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'N' then rhs()[i] == 0.0
    */ virtual const double * getRightHandSide() const; /** Get pointer to array[getNumRows()] of row ranges.
    • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
    • if rowsense()[i] != 'R' then rowrange()[i] is 0.0
    */ virtual const double * getRowRange() const; /// Get pointer to array[getNumRows()] of row lower bounds virtual const double * getRowLower() const; /// Get pointer to array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const; /// Get pointer to array[getNumCols()] of objective function coefficients virtual const double * getObjCoefficients() const; /// Get objective function sense (1 for min (default), -1 for max) virtual double getObjSense() const; /// Return true if column is continuous virtual bool isContinuous(int colNumber) const; #if 0 /// Return true if column is binary virtual bool isBinary(int columnNumber) const; /** Return true if column is integer. Note: This function returns true if the the column is binary or a general integer. */ virtual bool isInteger(int columnNumber) const; /// Return true if column is general integer virtual bool isIntegerNonBinary(int columnNumber) const; /// Return true if column is binary and not fixed at either bound virtual bool isFreeBinary(int columnNumber) const; #endif /// Get pointer to row-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByRow() const; /// Get pointer to column-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByCol() const; /// Get solver's value for infinity virtual double getInfinity() const; //@} /**@name Methods related to querying the solution */ //@{ /// Get pointer to array[getNumCols()] of primal solution vector virtual const double * getColSolution() const; /// Get pointer to array[getNumRows()] of dual prices virtual const double * getRowPrice() const; /// Get a pointer to array[getNumCols()] of reduced costs virtual const double * getReducedCost() const; /** Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector */ virtual const double * getRowActivity() const; /// Get objective function value virtual double getObjValue() const; /** Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. */ virtual int getIterationCount() const; /** Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.) The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay = false) const; /** Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.) NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getPrimalRays(int maxNumRays) const; #if 0 /** Get vector of indices of solution which are integer variables presently at fractional values */ virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const; #endif //@} //@} //--------------------------------------------------------------------------- /**@name Problem modifying methods */ //@{ //------------------------------------------------------------------------- /**@name Changing bounds on variables and constraints */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff( int elementIndex, double elementValue ); /** Set a a set of objective function coefficients */ virtual void setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList); using OsiSolverInterface::setColLower ; /** Set a single column lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setColLower( int elementIndex, double elementValue ); using OsiSolverInterface::setColUpper ; /** Set a single column upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setColUpper( int elementIndex, double elementValue ); /** Set a single column lower and upper bound
    The default implementation just invokes setColLower() and setColUpper() */ virtual void setColBounds( int elementIndex, double lower, double upper ); /** Set the bounds on a number of columns simultaneously
    The default implementation just invokes setCollower() and setColupper() over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the variables */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set a single row lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setRowLower( int elementIndex, double elementValue ); /** Set a single row upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setRowUpper( int elementIndex, double elementValue ); /** Set a single row lower and upper bound
    The default implementation just invokes setRowLower() and setRowUpper() */ virtual void setRowBounds( int elementIndex, double lower, double upper ); /** Set the type of a single row
    */ virtual void setRowType(int index, char sense, double rightHandSide, double range); /** Set the bounds on a number of rows simultaneously
    The default implementation just invokes setRowLower() and setRowUpper() over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the constraints */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a number of rows simultaneously
    The default implementation just invokes setRowType() and over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose type changes @param senseList the new senses @param rhsList the new right hand sides @param rangeList the new ranges */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); //@} //------------------------------------------------------------------------- /**@name Integrality related changing methods */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index); /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index); /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); //@} //------------------------------------------------------------------------- /// Set objective function sense (1 for min (default), -1 for max,) virtual void setObjSense(double s); /** Set the primal solution column values colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double * colsol); /** Set dual solution vector rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice); //------------------------------------------------------------------------- /**@name Methods to expand a problem.
    Note that if a column is added then by default it will correspond to a continuous variable. */ //@{ using OsiSolverInterface::addCol ; /** */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj); using OsiSolverInterface::addCols ; /** */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); /** */ virtual void deleteCols(const int num, const int * colIndices); using OsiSolverInterface::addRow ; /** */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng); using OsiSolverInterface::addRows ; /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); /** */ virtual void deleteRows(const int num, const int * rowIndices); #if 0 // ??? implemented in OsiSolverInterface //----------------------------------------------------------------------- /** Apply a collection of cuts.
    Only cuts which have an effectiveness >= effectivenessLb are applied.
    • ReturnCode.numberIneffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
    • ReturnCode.numberInconsistent() -- number of invalid cuts
    • ReturnCode.numberInconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
    • ReturnCode.numberInfeasible() -- number of cuts that would make this integer model infeasible
    • ReturnCode.numberApplied() -- number of integer cuts which were applied to the integer model
    • cs.size() == numberIneffective() + numberInconsistent() + numberInconsistentWrtIntegerModel() + numberInfeasible() + nubmerApplied()
    */ virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); #endif //@} //@} //--------------------------------------------------------------------------- /**@name Methods to input a problem */ //@{ /** Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • rowub: all rows have upper bound infinity
    • rowlb: all rows have lower bound -infinity
    • obj: all variables have 0 objective coefficient
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub); /** Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • obj: all variables have 0 objective coefficient
    • rowsen: all rows are >=
    • rowrhs: all right hand sides are 0
    • rowrng: 0 for the ranged rows
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); using OsiSolverInterface::readMps ; /** Read an mps file from the given filename */ virtual int readMps(const char *filename, const char *extension = "mps"); /** Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants */ virtual void writeMps(const char *filename, const char *extension = "mps", double objSense=0.0) const; //@} /**@name Message handling */ //@{ /** Pass in a message handler It is the client's responsibility to destroy a message handler installed by this routine; it will not be destroyed when the solver interface is destroyed. */ void passInMessageHandler(CoinMessageHandler * handler); //@} //--------------------------------------------------------------------------- /**@name CPLEX specific public interfaces */ //@{ /** Get pointer to CPLEX model and free all specified cached data entries (combined with logical or-operator '|' ): */ enum keepCachedFlag { /// discard all cached data (default) KEEPCACHED_NONE = 0, /// column information: objective values, lower and upper bounds, variable types KEEPCACHED_COLUMN = 1, /// row information: right hand sides, ranges and senses, lower and upper bounds for row KEEPCACHED_ROW = 2, /// problem matrix: matrix ordered by column and by row KEEPCACHED_MATRIX = 4, /// LP solution: primal and dual solution, reduced costs, row activities KEEPCACHED_RESULTS = 8, /// only discard cached LP solution KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX, /// keep all cached data (similar to getMutableLpPtr()) KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS, /// free only cached column and LP solution information FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN, /// free only cached row and LP solution information FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW, /// free only cached matrix and LP solution information FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX, /// free only cached LP solution information FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS }; CPXLPptr getLpPtr( int keepCached = KEEPCACHED_NONE ); //@{ /// Method to access CPLEX environment pointer CPXENVptr getEnvironmentPtr(); //@} /// return a vector of variable types (continous, binary, integer) const char* getCtype() const; /**@name Constructors and destructor */ //@{ /// Default Constructor OsiCpxSolverInterface(); /// Clone virtual OsiSolverInterface * clone(bool copyData = true) const; /// Copy constructor OsiCpxSolverInterface( const OsiCpxSolverInterface& ); /// Assignment operator OsiCpxSolverInterface& operator=( const OsiCpxSolverInterface& rhs ); /// Destructor virtual ~OsiCpxSolverInterface(); /// Resets as if default constructor virtual void reset(); //@} /***************************************************************************/ /**@name OsiSimplexInterface methods Cplex adds a slack with coeff +1 in "<=" and "=" constraints, with coeff -1 in ">=", slack being non negative. We switch in order to get a "Clp tableau" where all the slacks have coefficient +1 in the original tableau. If a slack for ">=" is non basic, invB is not changed; column of the slack in the optimal tableau is flipped. If a slack for ">=" is basic, corresp. row of invB is flipped; whole row of the optimal tableau is flipped; then whole column for the slack in opt tableau is flipped. Ranged rows are not supported. It might work, but no garantee is given. Code implemented only for Cplex9.0 and higher, lower version number of Cplex will abort the code. */ //@{ /** Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none */ virtual int canDoSimplexInterface() const; using OsiSolverInterface::enableSimplexInterface ; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void enableSimplexInterface(int doingPrimal) {}; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void disableSimplexInterface() {}; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void enableFactorization() const {}; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void disableFactorization() const {}; ///Returns true if a basis is available virtual bool basisIsAvailable() const; /** Returns a basis status of the structural/artificial variables At present as warm start i.e 0: free, 1: basic, 2: upper, 3: lower */ virtual void getBasisStatus(int* cstat, int* rstat) const; ///Get a row of the tableau (slack part in slack if not NULL) virtual void getBInvARow(int row, double* z, double * slack=NULL) const; ///Get a row of the basis inverse virtual void getBInvRow(int row, double* z) const; ///Get a column of the tableau virtual void getBInvACol(int col, double* vec) const; ///Get a column of the basis inverse virtual void getBInvCol(int col, double* vec) const; /** Get indices of the pivot variable in each row (order of indices corresponds to the order of elements in a vector retured by getBInvACol() and getBInvCol()). */ virtual void getBasics(int* index) const; /// switches CPLEX to prob type LP void switchToLP(); /// switches CPLEX to prob type MIP void switchToMIP(); //@} /***************************************************************************/ protected: /**@name Protected methods */ //@{ /// Apply a row cut. Return true if cut was applied. virtual void applyRowCut( const OsiRowCut & rc ); /** Apply a column cut (bound adjustment). Return true if cut was applied. */ virtual void applyColCut( const OsiColCut & cc ); //@} private: /**@name Private static class functions */ //@{ /// resizes coltype_ vector to be able to store at least minsize elements void resizeColType( int minsize ); /// frees colsize_ vector void freeColType(); //@} /**@name Private methods */ //@{ /// Get LP Pointer for const methods CPXLPptr getMutableLpPtr() const; /// The real work of a copy constructor (used by copy and assignment) void gutsOfCopy( const OsiCpxSolverInterface & source ); /// The real work of the constructor void gutsOfConstructor(); /// The real work of the destructor void gutsOfDestructor(); /// free cached column rim vectors void freeCachedColRim(); /// free cached row rim vectors void freeCachedRowRim(); /// free cached result vectors void freeCachedResults(); /// free cached matrices void freeCachedMatrix(); /// free all cached data (except specified entries, see getLpPtr()) void freeCachedData( int keepCached = KEEPCACHED_NONE ); /// free all allocated memory void freeAllMemory(); //@} /**@name Private member data */ //@{ /// CPLEX environment used in this class instance mutable CPXENVptr env_; /// CPLEX model represented by this class instance mutable CPXLPptr lp_; /// Hotstart information int *hotStartCStat_; int hotStartCStatSize_; int *hotStartRStat_; int hotStartRStatSize_; int hotStartMaxIteration_; /**@name Cached information derived from the CPLEX model */ //@{ /// Pointer to objective vector mutable double *obj_; /// Pointer to dense vector of variable lower bounds mutable double *collower_; /// Pointer to dense vector of variable lower bounds mutable double *colupper_; /// Pointer to dense vector of row sense indicators mutable char *rowsense_; /// Pointer to dense vector of row right-hand side values mutable double *rhs_; /// Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) mutable double *rowrange_; /// Pointer to dense vector of row lower bounds mutable double *rowlower_; /// Pointer to dense vector of row upper bounds mutable double *rowupper_; /// Pointer to primal solution vector mutable double *colsol_; /// Pointer to dual solution vector mutable double *rowsol_; /// Pointer to reduced cost vector mutable double *redcost_; /// Pointer to row activity (slack) vector mutable double *rowact_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByRow_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByCol_; //@} /**@name Additional information needed for storing MIP problems */ //@{ /// Pointer to dense vector of variable types (continous, binary, integer) char *coltype_; /// Size of allocated memory for coltype_ int coltypesize_; /// Stores whether CPLEX' prob type is currently set to MIP mutable bool probtypemip_; /// Whether to pass a column solution to CPLEX before starting MIP solve (copymipstart) bool domipstart; /// Whether to disable use of advanced basis (if given) bool disableadvbasis; //@} }; //############################################################################# /** A function that tests the methods in the OsiCpxSolverInterface class. */ void OsiCpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); #endif Osi-0.106.4/src/OsiCpx/OsiCpxSolverInterface.cpp0000644000076600007660000034205512214116157020024 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for CPLEX // author: Tobias Pfender // Konrad-Zuse-Zentrum Berlin (Germany) // email: pfender@zib.de // date: 09/25/2000 // license: this file may be freely distributed under the terms of EPL // comments: please scan this file for '???' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2000, Tobias Pfender, International Business Machines // Corporation and others. All Rights Reserved. #include #include #include #include #include "CoinPragma.hpp" #include "OsiCpxSolverInterface.hpp" #include "cplex.h" // CPLEX 10.0 removed CPXERR_NO_INT_SOLN #if !defined(CPXERR_NO_INT_SOLN) #define CPXERR_NO_INT_SOLN CPXERR_NO_SOLN #endif // #define DEBUG 1 #ifdef DEBUG #define debugMessage printf #else #define debugMessage if( false ) printf #endif //############################################################################# // A couple of helper functions //############################################################################# inline void freeCacheDouble( double*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } inline void freeCacheChar( char*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } inline void freeCacheMatrix( CoinPackedMatrix*& ptr ) { if( ptr != NULL ) { delete ptr; ptr = NULL; } } static inline void checkCPXerror( int err, std::string cpxfuncname, std::string osimethod ) { if( err != 0 ) { char s[100]; sprintf( s, "%s returned error %d", cpxfuncname.c_str(), err ); #ifdef DEBUG std::cerr << "ERROR: " << s << " (" << osimethod << " in OsiCpxSolverInterface)" << std::endl; #endif throw CoinError( s, osimethod.c_str(), "OsiCpxSolverInterface" ); } } static bool incompletemessage = false; static void CPXPUBLIC OsiCpxMessageCallbackPrint(CoinMessageHandler* handler, const char* msg) { /* cplex adds the newlines into their message, while the coin message handler like to add its own newlines * we treat the cases where there is a newline in the beginning or no newline at the end separately * TODO a better way is to scan msg for newlines and to send each line to the handler separately */ if( msg[0] == '\n' ) { if (incompletemessage) { *handler << CoinMessageEol; incompletemessage = false; } else handler->message(0, "CPX", " ", ' ') << CoinMessageEol; ++msg; if(!*msg) return; } size_t len = strlen(msg); assert(len > 0); if( msg[len-1] == '\n') { (const_cast(msg))[len-1] = '\0'; if (incompletemessage) { *handler << msg << CoinMessageEol; incompletemessage = false; } else handler->message(0, "CPX", msg, ' ') << CoinMessageEol; } else { handler->message(0, "CPX", msg, ' '); incompletemessage = true; } } static void CPXPUBLIC OsiCpxMessageCallbackResultLog(void* handle, const char* msg) { if (!*msg) return; if (handle) { if( ((CoinMessageHandler*)handle)->logLevel() >= 1 ) OsiCpxMessageCallbackPrint((CoinMessageHandler*)handle, msg); } else { printf(msg); } } static void CPXPUBLIC OsiCpxMessageCallbackWarning(void* handle, const char* msg) { if (handle) { if( ((CoinMessageHandler*)handle)->logLevel() >= 0 ) OsiCpxMessageCallbackPrint((CoinMessageHandler*)handle, msg); } else { printf(msg); } } static void CPXPUBLIC OsiCpxMessageCallbackError(void* handle, const char* msg) { if (handle) { OsiCpxMessageCallbackPrint((CoinMessageHandler*)handle, msg); } else { fprintf(stderr, msg); } } void OsiCpxSolverInterface::switchToLP( void ) { debugMessage("OsiCpxSolverInterface::switchToLP()\n"); if( probtypemip_ ) { CPXLPptr lp = getMutableLpPtr(); #if CPX_VERSION >= 800 assert(CPXgetprobtype(env_,lp) == CPXPROB_MILP); #else assert(CPXgetprobtype(env_,lp) == CPXPROB_MIP); #endif int err = CPXchgprobtype( env_, lp, CPXPROB_LP ); checkCPXerror( err, "CPXchgprobtype", "switchToLP" ); probtypemip_ = false; } } void OsiCpxSolverInterface::switchToMIP( void ) { debugMessage("OsiCpxSolverInterface::switchToMIP()\n"); if( !probtypemip_ ) { CPXLPptr lp = getMutableLpPtr(); int nc = getNumCols(); int *cindarray = new int[nc]; assert(CPXgetprobtype(env_,lp) == CPXPROB_LP); assert(coltype_ != NULL); for( int i = 0; i < nc; ++i ) cindarray[i] = i; #if CPX_VERSION >= 800 int err = CPXchgprobtype( env_, lp, CPXPROB_MILP ); #else int err = CPXchgprobtype( env_, lp, CPXPROB_MIP ); #endif checkCPXerror( err, "CPXchgprobtype", "switchToMIP" ); err = CPXchgctype( env_, lp, nc, cindarray, coltype_ ); checkCPXerror( err, "CPXchgctype", "switchToMIP" ); delete[] cindarray; probtypemip_ = true; } } void OsiCpxSolverInterface::resizeColType( int minsize ) { debugMessage("OsiCpxSolverInterface::resizeColType()\n"); if( minsize > coltypesize_ ) { int newcoltypesize = 2*coltypesize_; if( minsize > newcoltypesize ) newcoltypesize = minsize; char *newcoltype = new char[newcoltypesize]; if( coltype_ != NULL ) { CoinDisjointCopyN( coltype_, coltypesize_, newcoltype ); delete[] coltype_; } coltype_ = newcoltype; coltypesize_ = newcoltypesize; } assert(minsize == 0 || coltype_ != NULL); assert(coltypesize_ >= minsize); } void OsiCpxSolverInterface::freeColType() { debugMessage("OsiCpxSolverInterface::freeColType()\n"); if( coltypesize_ > 0 ) { delete[] coltype_; coltype_ = NULL; coltypesize_ = 0; } assert(coltype_ == NULL); } //############################################################################# // Solve methods //############################################################################# void OsiCpxSolverInterface::initialSolve() { debugMessage("OsiCpxSolverInterface::initialSolve()\n"); switchToLP(); bool takeHint; OsiHintStrength strength; int algorithm = 0; getHintParam(OsiDoDualInInitial,takeHint,strength); if (strength!=OsiHintIgnore) algorithm = takeHint ? -1 : 1; int presolve = 1; getHintParam(OsiDoPresolveInInitial,takeHint,strength); if (strength!=OsiHintIgnore) presolve = takeHint ? 1 : 0; CPXLPptr lp = getLpPtr( OsiCpxSolverInterface::FREECACHED_RESULTS ); if (presolve) CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_ON ); else CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_OFF ); // if (messageHandler()->logLevel() == 0) // CPXsetintparam( env_, CPX_PARAM_SCRIND, CPX_OFF ); // else // CPXsetintparam( env_, CPX_PARAM_SCRIND, CPX_ON ); if (messageHandler()->logLevel() == 0) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 0 ); else if (messageHandler()->logLevel() == 1) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 1 ); else if (messageHandler()->logLevel() > 1) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 2 ); CPXsetintparam( env_, CPX_PARAM_ADVIND, !disableadvbasis ); double objoffset; double primalobjlimit; double dualobjlimit; getDblParam(OsiObjOffset, objoffset); getDblParam(OsiPrimalObjectiveLimit, primalobjlimit); getDblParam(OsiDualObjectiveLimit, dualobjlimit); if (getObjSense() == +1) { if (primalobjlimit < COIN_DBL_MAX) CPXsetdblparam(env_, CPX_PARAM_OBJLLIM, primalobjlimit + objoffset); if (dualobjlimit > -COIN_DBL_MAX) CPXsetdblparam(env_, CPX_PARAM_OBJULIM, dualobjlimit + objoffset); } else { if (primalobjlimit > -COIN_DBL_MAX) CPXsetdblparam(env_, CPX_PARAM_OBJULIM, primalobjlimit + objoffset); if (dualobjlimit < COIN_DBL_MAX) CPXsetdblparam(env_, CPX_PARAM_OBJLLIM, dualobjlimit + objoffset); } int term; switch( algorithm ) { default: case 0: term = CPXlpopt(env_, lp); #if CPX_VERSION >= 800 checkCPXerror( term, "CPXlpopt", "initialSolve" ); #endif break; case 1: term = CPXprimopt( env_, lp ); #if CPX_VERSION >= 800 checkCPXerror( term, "CPXprimopt", "initialSolve" ); #endif break; case -1: term = CPXdualopt( env_, lp ); #if CPX_VERSION >= 800 checkCPXerror( term, "CPXdualopt", "initialSolve" ); #endif break; } /* If the problem is found infeasible during presolve, resolve it to get a proper term code */ #if CPX_VERSION >= 800 int stat = CPXgetstat( env_, getMutableLpPtr() ); if (stat == CPX_STAT_INForUNBD && presolve) { CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_OFF ); switch( algorithm ) { default: case 0: term = CPXlpopt(env_, lp); checkCPXerror( term, "CPXlpopt", "initialSolve" ); break; case 1: term = CPXprimopt( env_, lp ); checkCPXerror( term, "CPXprimopt", "initialSolve" ); break; case -1: term = CPXdualopt( env_, lp ); checkCPXerror( term, "CPXdualopt", "initialSolve" ); break; } CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_ON ); } #else if (term == CPXERR_PRESLV_INForUNBD && presolve) { CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_OFF ); switch( algorithm ) { default: case 0: term = CPXlpopt(env_, lp); break; case 1: term = CPXprimopt( env_, lp ); break; case -1: term = CPXdualopt( env_, lp ); break; } CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_ON ); } #endif disableadvbasis = false; } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::resolve() { debugMessage("OsiCpxSolverInterface::resolve()\n"); switchToLP(); bool takeHint; OsiHintStrength strength; int algorithm = 0; getHintParam(OsiDoDualInResolve,takeHint,strength); if (strength!=OsiHintIgnore) algorithm = takeHint ? -1 : 1; int presolve = 0; getHintParam(OsiDoPresolveInResolve,takeHint,strength); if (strength!=OsiHintIgnore) presolve = takeHint ? 1 : 0; CPXLPptr lp = getLpPtr( OsiCpxSolverInterface::FREECACHED_RESULTS ); if (presolve) CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_ON ); else CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_OFF ); // if (messageHandler()->logLevel() == 0) // CPXsetintparam( env_, CPX_PARAM_SCRIND, CPX_OFF ); // else // CPXsetintparam( env_, CPX_PARAM_SCRIND, CPX_ON ); if (messageHandler()->logLevel() == 0) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 0 ); else if (messageHandler()->logLevel() == 1) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 1 ); else if (messageHandler()->logLevel() > 1) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 2 ); CPXsetintparam( env_, CPX_PARAM_ADVIND, !disableadvbasis ); int term; switch( algorithm ) { default: case 0: term = CPXlpopt(env_, lp); #if CPX_VERSION >= 800 checkCPXerror( term, "CPXlpopt", "resolve" ); #endif break; case 1: term = CPXprimopt( env_, lp ); #if CPX_VERSION >= 800 checkCPXerror( term, "CPXprimopt", "resolve" ); #endif break; case -1: term = CPXdualopt( env_, lp ); #if CPX_VERSION >= 800 checkCPXerror( term, "CPXdualopt", "resolve" ); #endif break; } /* If the problem is found infeasible during presolve, resolve it to get a proper term code */ #if CPX_VERSION >= 800 int stat = CPXgetstat( env_, getMutableLpPtr() ); if (stat == CPX_STAT_INForUNBD && presolve){ CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_OFF ); switch( algorithm ) { default: case 0: term = CPXlpopt(env_, lp); checkCPXerror( term, "CPXlpopt", "resolve" ); break; case 1: term = CPXprimopt( env_, lp ); checkCPXerror( term, "CPXprimopt", "resolve" ); break; case -1: term = CPXdualopt( env_, lp ); checkCPXerror( term, "CPXdualopt", "resolve" ); break; } CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_ON ); } #else if (term == CPXERR_PRESLV_INForUNBD && presolve){ CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_OFF ); switch( algorithm ) { default: case 0: term = CPXlpopt(env_, lp); checkCPXerror( term, "CPXlpopt", "resolve" ); break; case 1: term = CPXprimopt( env_, lp ); checkCPXerror( term, "CPXprimopt", "resolve" ); break; case -1: term = CPXdualopt( env_, lp ); checkCPXerror( term, "CPXdualopt", "resolve" ); break; } CPXsetintparam( env_, CPX_PARAM_PREIND, CPX_ON ); } #endif disableadvbasis = false; } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::branchAndBound() { int term; debugMessage("OsiCpxSolverInterface::branchAndBound()\n"); switchToMIP(); if( colsol_ != NULL && domipstart ) { int ncols = getNumCols(); int* ind = new int[ncols]; CoinIotaN(ind, ncols, 0); term = CPXcopymipstart(env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_ALL ), ncols, ind, colsol_); checkCPXerror(term, "CPXcopymipstart", "branchAndBound"); delete[] ind; CPXsetintparam( env_, CPX_PARAM_ADVIND, CPX_ON ); } else CPXsetintparam( env_, CPX_PARAM_ADVIND, CPX_OFF ); CPXLPptr lp = getLpPtr( OsiCpxSolverInterface::FREECACHED_RESULTS ); // if (messageHandler()->logLevel() == 0) // CPXsetintparam( env_, CPX_PARAM_SCRIND, CPX_OFF ); // else // CPXsetintparam( env_, CPX_PARAM_SCRIND, CPX_ON ); if (messageHandler()->logLevel() == 0) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 0 ); else if (messageHandler()->logLevel() == 1) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 1 ); else if (messageHandler()->logLevel() > 1) CPXsetintparam( env_, CPX_PARAM_SIMDISPLAY, 2 ); term = CPXmipopt( env_, lp ); checkCPXerror( term, "CPXmipopt", "branchAndBound" ); } //############################################################################# // Parameter related methods //############################################################################# bool OsiCpxSolverInterface::setIntParam(OsiIntParam key, int value) { debugMessage("OsiCpxSolverInterface::setIntParam(%d, %d)\n", key, value); bool retval = false; switch (key) { case OsiMaxNumIteration: retval = ( CPXsetintparam( env_, CPX_PARAM_ITLIM, value ) == 0 ); // ??? OsiMaxNumIteration == #Simplex-iterations ??? break; case OsiMaxNumIterationHotStart: if( value >= 0 ) { hotStartMaxIteration_ = value; retval = true; } else retval = false; break; case OsiNameDiscipline: retval = OsiSolverInterface::setIntParam(key,value); break; case OsiLastIntParam: retval = false; break; default: retval = false ; break ; } return retval; } //----------------------------------------------------------------------------- bool OsiCpxSolverInterface::setDblParam(OsiDblParam key, double value) { debugMessage("OsiCpxSolverInterface::setDblParam(%d, %g)\n", key, value); bool retval = false; switch (key) { case OsiDualTolerance: retval = ( CPXsetdblparam( env_, CPX_PARAM_EPOPT, value ) == 0 ); // ??? OsiDualTolerance == CPLEX Optimality tolerance ??? break; case OsiPrimalTolerance: retval = ( CPXsetdblparam( env_, CPX_PARAM_EPRHS, value ) == 0 ); // ??? OsiPrimalTolerance == CPLEX Feasibility tolerance ??? break; case OsiDualObjectiveLimit: case OsiPrimalObjectiveLimit: case OsiObjOffset: retval = OsiSolverInterface::setDblParam(key,value); break; case OsiLastDblParam: retval = false; break; default: retval = false ; break ; } return retval; } //----------------------------------------------------------------------------- bool OsiCpxSolverInterface::setStrParam(OsiStrParam key, const std::string & value) { debugMessage("OsiCpxSolverInterface::setStrParam(%d, %s)\n", key, value.c_str()); bool retval=false; switch (key) { case OsiProbName: OsiSolverInterface::setStrParam(key,value); return retval = true; case OsiSolverName: return false; case OsiLastStrParam: return false; default: return false ; } return false; } //----------------------------------------------------------------------------- bool OsiCpxSolverInterface::getIntParam(OsiIntParam key, int& value) const { debugMessage("OsiCpxSolverInterface::getIntParam(%d)\n", key); bool retval = false; switch (key) { case OsiMaxNumIteration: retval = ( CPXgetintparam( env_, CPX_PARAM_ITLIM, &value ) == 0 ); // ??? OsiMaxNumIteration == #Simplex-iterations ??? break; case OsiMaxNumIterationHotStart: value = hotStartMaxIteration_; retval = true; break; case OsiNameDiscipline: retval = OsiSolverInterface::getIntParam(key,value); break; case OsiLastIntParam: retval = false; break; default: retval = false ; break ; } return retval; } //----------------------------------------------------------------------------- bool OsiCpxSolverInterface::getDblParam(OsiDblParam key, double& value) const { debugMessage("OsiCpxSolverInterface::getDblParam(%d)\n", key); bool retval = false; switch (key) { case OsiDualTolerance: retval = ( CPXgetdblparam( env_, CPX_PARAM_EPOPT, &value ) == 0 ); // ??? OsiDualTolerance == CPLEX Optimality tolerance ??? break; case OsiPrimalTolerance: retval = ( CPXgetdblparam( env_, CPX_PARAM_EPRHS, &value ) == 0 ); // ??? OsiPrimalTolerance == CPLEX Feasibility tolerance ??? break; case OsiDualObjectiveLimit: case OsiPrimalObjectiveLimit: case OsiObjOffset: retval = OsiSolverInterface::getDblParam(key, value); break; case OsiLastDblParam: retval = false; break; default: retval = false ; break ; } return retval; } //----------------------------------------------------------------------------- bool OsiCpxSolverInterface::getStrParam(OsiStrParam key, std::string & value) const { debugMessage("OsiCpxSolverInterface::getStrParam(%d)\n", key); switch (key) { case OsiProbName: OsiSolverInterface::getStrParam(key, value); break; case OsiSolverName: value = "cplex"; break; case OsiLastStrParam: return false; default: return false ; } return true; } //############################################################################# // Methods returning info on how the solution process terminated //############################################################################# bool OsiCpxSolverInterface::isAbandoned() const { debugMessage("OsiCpxSolverInterface::isAbandoned()\n"); int stat = CPXgetstat( env_, getMutableLpPtr() ); #if CPX_VERSION >= 800 return (stat == 0 || stat == CPX_STAT_NUM_BEST || stat == CPX_STAT_ABORT_USER); #else return (stat == 0 || stat == CPX_NUM_BEST_FEAS || stat == CPX_NUM_BEST_INFEAS || stat == CPX_ABORT_FEAS || stat == CPX_ABORT_INFEAS || stat == CPX_ABORT_CROSSOVER); #endif } bool OsiCpxSolverInterface::isProvenOptimal() const { debugMessage("OsiCpxSolverInterface::isProvenOptimal()\n"); int stat = CPXgetstat( env_, getMutableLpPtr() ); #if CPX_VERSION >= 800 return ((probtypemip_ == false && (stat == CPX_STAT_OPTIMAL || stat == CPX_STAT_OPTIMAL_INFEAS)) || (probtypemip_ == true && (stat == CPXMIP_OPTIMAL || stat == CPXMIP_OPTIMAL_TOL))); #else return ((probtypemip_ == false && (stat == CPX_OPTIMAL || stat == CPX_OPTIMAL_INFEAS)) || (probtypemip_ == true && stat == CPXMIP_OPTIMAL)); #endif } bool OsiCpxSolverInterface::isProvenPrimalInfeasible() const { debugMessage("OsiCpxSolverInterface::isProvenPrimalInfeasible()\n"); int stat = CPXgetstat( env_, getMutableLpPtr() ); #if CPX_VERSION >= 800 // In CPLEX 8, the return code is with respect // to the original problem, regardless of the algorithm used to solve it // --tkr 7/31/03 return (stat == CPX_STAT_INFEASIBLE); // return (method == CPX_ALG_PRIMAL && stat == CPX_STAT_INFEASIBLE || // method == CPX_ALG_DUAL && stat == CPX_STAT_UNBOUNDED); #else int method = CPXgetmethod( env_, getMutableLpPtr() ); return ((method == CPX_ALG_PRIMAL && stat == CPX_INFEASIBLE) || (method == CPX_ALG_DUAL && stat == CPX_UNBOUNDED) || stat == CPX_ABORT_PRIM_INFEAS || stat == CPX_ABORT_PRIM_DUAL_INFEAS); #endif } bool OsiCpxSolverInterface::isProvenDualInfeasible() const { debugMessage("OsiCpxSolverInterface::isProvenDualInfeasible()\n"); int stat = CPXgetstat( env_, getMutableLpPtr() ); #if CPX_VERSION >= 800 // In CPLEX 8, the return code is with respect // to the original problem, regardless of the algorithm used to solve it // --tkr 7/31/03 return (stat == CPX_STAT_UNBOUNDED); //return (method == CPX_ALG_PRIMAL && stat == CPX_STAT_UNBOUNDED || // method == CPX_ALG_DUAL && stat == CPX_STAT_INFEASIBLE); #else int method = CPXgetmethod( env_, getMutableLpPtr() ); return ((method == CPX_ALG_PRIMAL && stat == CPX_UNBOUNDED) || (method == CPX_ALG_DUAL && stat == CPX_INFEASIBLE) || stat == CPX_ABORT_DUAL_INFEAS || stat == CPX_ABORT_PRIM_DUAL_INFEAS); #endif } bool OsiCpxSolverInterface::isPrimalObjectiveLimitReached() const { debugMessage("OsiCpxSolverInterface::isPrimalObjectiveLimitReached()\n"); int stat = CPXgetstat( env_, getMutableLpPtr() ); int method = CPXgetmethod( env_, getMutableLpPtr() ); #if CPX_VERSION >= 800 return method == CPX_ALG_PRIMAL && stat == CPX_STAT_ABORT_OBJ_LIM; #else return method == CPX_ALG_PRIMAL && stat == CPX_OBJ_LIM; #endif } bool OsiCpxSolverInterface::isDualObjectiveLimitReached() const { debugMessage("OsiCpxSolverInterface::isDualObjectiveLimitReached()\n"); int stat = CPXgetstat( env_, getMutableLpPtr() ); int method = CPXgetmethod( env_, getMutableLpPtr() ); #if CPX_VERSION >= 800 return method == CPX_ALG_DUAL && stat == CPX_STAT_ABORT_OBJ_LIM; #else return method == CPX_ALG_DUAL && stat == CPX_OBJ_LIM; #endif } bool OsiCpxSolverInterface::isIterationLimitReached() const { debugMessage("OsiCpxSolverInterface::isIterationLimitReached()\n"); int stat = CPXgetstat( env_, getMutableLpPtr() ); #if CPX_VERSION >= 800 return stat == CPX_STAT_ABORT_IT_LIM; #else return stat == CPX_IT_LIM_FEAS || stat == CPX_IT_LIM_INFEAS; #endif } //############################################################################# // WarmStart related methods //############################################################################# CoinWarmStart* OsiCpxSolverInterface::getEmptyWarmStart () const { return (dynamic_cast(new CoinWarmStartBasis())) ; } CoinWarmStart* OsiCpxSolverInterface::getWarmStart() const { debugMessage("OsiCpxSolverInterface::getWarmStart()\n"); if( probtypemip_ ) return getEmptyWarmStart(); CoinWarmStartBasis* ws = NULL; int numcols = getNumCols(); int numrows = getNumRows(); int *cstat = new int[numcols]; int *rstat = new int[numrows]; char* sense = new char[numrows]; int restat, i; restat = CPXgetsense(env_, getMutableLpPtr(), sense, 0, numrows-1); if( restat == 0 ) restat = CPXgetbase( env_, getMutableLpPtr(), cstat, rstat ); if( restat == 0 ) { ws = new CoinWarmStartBasis; ws->setSize( numcols, numrows ); for( i = 0; i < numrows; ++i ) { switch( rstat[i] ) { case CPX_BASIC: ws->setArtifStatus( i, CoinWarmStartBasis::basic ); break; case CPX_AT_LOWER: if(sense[i] == 'G') ws->setArtifStatus( i, CoinWarmStartBasis::atUpperBound ); else ws->setArtifStatus( i, CoinWarmStartBasis::atLowerBound ); break; case CPX_AT_UPPER: if(sense[i] == 'L') ws->setArtifStatus( i, CoinWarmStartBasis::atLowerBound ); else ws->setArtifStatus( i, CoinWarmStartBasis::atUpperBound ); break; default: // unknown row status delete ws; ws = NULL; goto TERMINATE; } } for( i = 0; i < numcols; ++i ) { switch( cstat[i] ) { case CPX_BASIC: ws->setStructStatus( i, CoinWarmStartBasis::basic ); break; case CPX_AT_LOWER: ws->setStructStatus( i, CoinWarmStartBasis::atLowerBound ); break; case CPX_AT_UPPER: ws->setStructStatus( i, CoinWarmStartBasis::atUpperBound ); break; case CPX_FREE_SUPER: ws->setStructStatus( i, CoinWarmStartBasis::isFree ); break; default: // unknown column status delete ws; ws = NULL; goto TERMINATE; } } } TERMINATE: delete[] cstat; delete[] rstat; delete[] sense; return ws; } //----------------------------------------------------------------------------- bool OsiCpxSolverInterface::setWarmStart(const CoinWarmStart* warmstart) { debugMessage("OsiCpxSolverInterface::setWarmStart(%p)\n", (void*)warmstart); const CoinWarmStartBasis* ws = dynamic_cast(warmstart); int numcols, numrows, i, restat; int *cstat, *rstat; bool retval = false; if( !ws ) return false; numcols = getNumCols(); numrows = getNumRows(); /* if too small warm start information is given, we take this as a sign to disable a warm start in the next LP solve */ if( ws->getNumStructural() < numcols || ws->getNumArtificial() < numrows ) { disableadvbasis = true; return false; } switchToLP(); cstat = new int[numcols]; rstat = new int[numrows]; for( i = 0; i < numrows; ++i ) { switch( ws->getArtifStatus( i ) ) { case CoinWarmStartBasis::basic: rstat[i] = CPX_BASIC; break; case CoinWarmStartBasis::atLowerBound: rstat[i] = CPX_AT_LOWER; break; case CoinWarmStartBasis::atUpperBound: rstat[i] = CPX_AT_UPPER; break; default: // unknown row status retval = false; goto TERMINATE; } } for( i = 0; i < numcols; ++i ) { switch( ws->getStructStatus( i ) ) { case CoinWarmStartBasis::basic: cstat[i] = CPX_BASIC; break; case CoinWarmStartBasis::atLowerBound: cstat[i] = CPX_AT_LOWER; break; case CoinWarmStartBasis::atUpperBound: cstat[i] = CPX_AT_UPPER; break; case CoinWarmStartBasis::isFree: cstat[i] = CPX_FREE_SUPER; break; default: // unknown row status retval = false; goto TERMINATE; } } // *FIXME* : can this be getMutableLpPtr() ? Does any cached data change by // *FIXME* : setting warmstart? Or at least wouldn't it be sufficient to // *FIXME* : clear the cached results but not the problem data? // -> is fixed by using FREECACHED_RESULTS; only cached solution will be discarded restat = CPXcopybase( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_RESULTS ), cstat, rstat ); retval = (restat == 0); TERMINATE: delete[] cstat; delete[] rstat; return retval; } //############################################################################# // Hotstart related methods (primarily used in strong branching) //############################################################################# void OsiCpxSolverInterface::markHotStart() { debugMessage("OsiCpxSolverInterface::markHotStart()\n"); int err; int numcols, numrows; assert(!probtypemip_); numcols = getNumCols(); numrows = getNumRows(); if( numcols > hotStartCStatSize_ ) { delete[] hotStartCStat_; hotStartCStatSize_ = static_cast( 1.2 * static_cast( numcols ) ); // get some extra space for future hot starts hotStartCStat_ = new int[hotStartCStatSize_]; } if( numrows > hotStartRStatSize_ ) { delete[] hotStartRStat_; hotStartRStatSize_ = static_cast( 1.2 * static_cast( numrows ) ); // get some extra space for future hot starts hotStartRStat_ = new int[hotStartRStatSize_]; } err = CPXgetbase( env_, getMutableLpPtr(), hotStartCStat_, hotStartRStat_ ); checkCPXerror( err, "CPXgetbase", "markHotStart" ); } void OsiCpxSolverInterface::solveFromHotStart() { debugMessage("OsiCpxSolverInterface::solveFromHotStart()\n"); int err; int maxiter; switchToLP(); assert( getNumCols() <= hotStartCStatSize_ ); assert( getNumRows() <= hotStartRStatSize_ ); err = CPXcopybase( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_RESULTS ), hotStartCStat_, hotStartRStat_ ); checkCPXerror( err, "CPXcopybase", "solveFromHotStart" ); err = CPXgetintparam( env_, CPX_PARAM_ITLIM, &maxiter ); checkCPXerror( err, "CPXgetintparam", "solveFromHotStart" ); err = CPXsetintparam( env_, CPX_PARAM_ITLIM, hotStartMaxIteration_ ); checkCPXerror( err, "CPXsetintparam", "solveFromHotStart" ); resolve(); err = CPXsetintparam( env_, CPX_PARAM_ITLIM, maxiter ); checkCPXerror( err, "CPXsetintparam", "solveFromHotStart" ); } void OsiCpxSolverInterface::unmarkHotStart() { debugMessage("OsiCpxSolverInterface::unmarkHotStart()\n"); // ??? be lazy with deallocating memory and do nothing here, deallocate memory in the destructor } //############################################################################# // Problem information methods (original data) //############################################################################# //------------------------------------------------------------------ // Get number of rows, columns, elements, ... //------------------------------------------------------------------ int OsiCpxSolverInterface::getNumCols() const { debugMessage("OsiCpxSolverInterface::getNumCols()\n"); return CPXgetnumcols( env_, getMutableLpPtr() ); } int OsiCpxSolverInterface::getNumRows() const { debugMessage("OsiCpxSolverInterface::getNumRows()\n"); return CPXgetnumrows( env_, getMutableLpPtr() ); } int OsiCpxSolverInterface::getNumElements() const { debugMessage("OsiCpxSolverInterface::getNumElements()\n"); return CPXgetnumnz( env_, getMutableLpPtr() ); } //------------------------------------------------------------------ // Get pointer to rim vectors //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getColLower() const { debugMessage("OsiCpxSolverInterface::getColLower()\n"); if( collower_ == NULL ) { int ncols = CPXgetnumcols( env_, getMutableLpPtr() ); if( ncols > 0 ) { collower_ = new double[ncols]; CPXgetlb( env_, getMutableLpPtr(), collower_, 0, ncols-1 ); } } return collower_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getColUpper() const { debugMessage("OsiCpxSolverInterface::getColUpper()\n"); if( colupper_ == NULL ) { int ncols = CPXgetnumcols( env_, getMutableLpPtr() ); if( ncols > 0 ) { colupper_ = new double[ncols]; CPXgetub( env_, getMutableLpPtr(), colupper_, 0, ncols-1 ); } } return colupper_; } //------------------------------------------------------------------ const char * OsiCpxSolverInterface::getRowSense() const { debugMessage("OsiCpxSolverInterface::getRowSense()\n"); if ( rowsense_==NULL ) { // rowsense is determined with rhs, so invoke rhs getRightHandSide(); assert( rowsense_!=NULL || getNumRows() == 0 ); } return rowsense_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getRightHandSide() const { debugMessage("OsiCpxSolverInterface::getRightHandSide()\n"); if ( rhs_==NULL ) { CPXLPptr lp = getMutableLpPtr(); int nrows = getNumRows(); if( nrows > 0 ) { rhs_ = new double[nrows]; CPXgetrhs( env_, lp, rhs_, 0, nrows-1 ); assert( rowrange_ == NULL ); rowrange_ = new double[nrows]; CPXgetrngval( env_, lp, rowrange_, 0, nrows-1 ); assert( rowsense_ == NULL ); rowsense_ = new char[nrows]; CPXgetsense( env_, lp, rowsense_, 0, nrows-1 ); double inf = getInfinity(); int i; for ( i = 0; i < nrows; ++i ) { if ( rowsense_[i] != 'R' ) rowrange_[i]=0.0; else { if ( rhs_[i] <= -inf ) { rowsense_[i] = 'N'; rowrange_[i] = 0.0; rhs_[i] = 0.0; } else { if( rowrange_[i] >= 0.0 ) rhs_[i] = rhs_[i] + rowrange_[i]; else rowrange_[i] = -rowrange_[i]; } } } } } return rhs_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getRowRange() const { debugMessage("OsiCpxSolverInterface::getRowRange()\n"); if ( rowrange_==NULL ) { // rowrange is determined with rhs, so invoke rhs getRightHandSide(); assert( rowrange_!=NULL || getNumRows() == 0 ); } return rowrange_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getRowLower() const { debugMessage("OsiCpxSolverInterface::getRowLower()\n"); if ( rowlower_ == NULL ) { int nrows = getNumRows(); const char *rowsense = getRowSense(); const double *rhs = getRightHandSide(); const double *rowrange = getRowRange(); if ( nrows > 0 ) { rowlower_ = new double[nrows]; double dum1; for ( int i = 0; i < nrows; i++ ) convertSenseToBound( rowsense[i], rhs[i], rowrange[i], rowlower_[i], dum1 ); } } return rowlower_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getRowUpper() const { debugMessage("OsiCpxSolverInterface::getRowUpper()\n"); if ( rowupper_ == NULL ) { int nrows = getNumRows(); const char *rowsense = getRowSense(); const double *rhs = getRightHandSide(); const double *rowrange = getRowRange(); if ( nrows > 0 ) { rowupper_ = new double[nrows]; double dum1; for ( int i = 0; i < nrows; i++ ) convertSenseToBound( rowsense[i], rhs[i], rowrange[i], dum1, rowupper_[i] ); } } return rowupper_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getObjCoefficients() const { debugMessage("OsiCpxSolverInterface::getObjCoefficients()\n"); if ( obj_==NULL ) { int ncols = CPXgetnumcols( env_, getMutableLpPtr() ); if( ncols > 0 ) { obj_ = new double[ncols]; int err = CPXgetobj( env_, getMutableLpPtr(), obj_, 0, ncols-1 ); checkCPXerror( err, "CPXgetobj", "getObjCoefficients" ); } } return obj_; } //------------------------------------------------------------------ double OsiCpxSolverInterface::getObjSense() const { debugMessage("OsiCpxSolverInterface::getObjSense()\n"); if( CPXgetobjsen( env_, getMutableLpPtr() ) == CPX_MIN ) return +1.0; else return -1.0; } //------------------------------------------------------------------ // Return information on integrality //------------------------------------------------------------------ bool OsiCpxSolverInterface::isContinuous( int colNumber ) const { debugMessage("OsiCpxSolverInterface::isContinuous(%d)\n", colNumber); return getCtype()[colNumber] == 'C'; } //------------------------------------------------------------------ // Row and column copies of the matrix ... //------------------------------------------------------------------ const CoinPackedMatrix * OsiCpxSolverInterface::getMatrixByRow() const { debugMessage("OsiCpxSolverInterface::getMatrixByRow()\n"); if ( matrixByRow_ == NULL ) { int nrows = getNumRows(); int ncols = getNumCols(); int nelems; int *starts = new int [nrows + 1]; int *len = new int [nrows]; int requiredSpace; CPXgetrows( env_, getMutableLpPtr(), &nelems, starts, NULL, NULL, 0, &requiredSpace, 0, nrows-1 ); assert( -requiredSpace == getNumElements() ); int *indices = new int [-requiredSpace]; double *elements = new double[-requiredSpace]; CPXgetrows( env_, getMutableLpPtr(), &nelems, starts, indices, elements, -requiredSpace, &requiredSpace, 0, nrows-1 ); assert( requiredSpace == 0 ); matrixByRow_ = new CoinPackedMatrix(); // Should be able to pass null for length of packed matrix, // assignMatrix does not seem to allow (even though documentation // say it is possible to do this). // For now compute the length. starts[nrows] = nelems; for ( int i = 0; i < nrows; ++i ) len[i]=starts[i+1] - starts[i]; matrixByRow_->assignMatrix( false /* not column ordered */, ncols, nrows, nelems, elements, indices, starts, len /*NULL*/); } return matrixByRow_; } //------------------------------------------------------------------ const CoinPackedMatrix * OsiCpxSolverInterface::getMatrixByCol() const { debugMessage("OsiCpxSolverInterface::getMatrixByCol()\n"); if ( matrixByCol_ == NULL ) { int nrows = getNumRows(); int ncols = getNumCols(); int nelems; int *starts = new int [ncols + 1]; int *len = new int [ncols]; int requiredSpace; CPXgetcols( env_, getMutableLpPtr(), &nelems, starts, NULL, NULL, 0, &requiredSpace, 0, ncols-1 ); assert( -requiredSpace == getNumElements() ); int *indices = new int [-requiredSpace]; double *elements = new double[-requiredSpace]; CPXgetcols( env_, getMutableLpPtr(), &nelems, starts, indices, elements, -requiredSpace, &requiredSpace, 0, ncols-1 ); assert( requiredSpace == 0); matrixByCol_ = new CoinPackedMatrix(); // Should be able to pass null for length of packed matrix, // assignMatrix does not seem to allow (even though documentation // say it is possible to do this). // For now compute the length. starts[ncols] = nelems; for ( int i = 0; i < ncols; i++ ) len[i]=starts[i+1] - starts[i]; matrixByCol_->assignMatrix( true /* column ordered */, nrows, ncols, nelems, elements, indices, starts, len /*NULL*/); assert( matrixByCol_->getNumCols()==ncols ); assert( matrixByCol_->getNumRows()==nrows ); } return matrixByCol_; } //------------------------------------------------------------------ // Get solver's value for infinity //------------------------------------------------------------------ double OsiCpxSolverInterface::getInfinity() const { debugMessage("OsiCpxSolverInterface::getInfinity()\n"); return CPX_INFBOUND; } //############################################################################# // Problem information methods (results) //############################################################################# // *FIXME*: what should be done if a certain vector doesn't exist??? const double * OsiCpxSolverInterface::getColSolution() const { debugMessage("OsiCpxSolverInterface::getColSolution()\n"); if( colsol_==NULL ) { CPXLPptr lp = getMutableLpPtr(); int ncols = CPXgetnumcols( env_, lp ); if( ncols > 0 ) { colsol_ = new double[ncols]; if( probtypemip_ ) { #if CPX_VERSION >= 1100 int solntype; CPXsolninfo(env_, lp, NULL, &solntype, NULL, NULL); if( solntype != CPX_NO_SOLN ) { int err = CPXgetmipx( env_, lp, colsol_, 0, ncols-1 ); checkCPXerror( err, "CPXgetmipx", "getColSolution" ); } else { CoinFillN( colsol_, ncols, 0.0 ); } #else int err = CPXgetmipx( env_, lp, colsol_, 0, ncols-1 ); if ( err == CPXERR_NO_INT_SOLN ) CoinFillN( colsol_, ncols, 0.0 ); else checkCPXerror( err, "CPXgetmipx", "getColSolution" ); #endif } else { int solntype; CPXsolninfo(env_, lp, NULL, &solntype, NULL, NULL); if( solntype != CPX_NO_SOLN ) { int err = CPXgetx( env_, lp, colsol_, 0, ncols-1 ); checkCPXerror( err, "CPXgetx", "getColSolution" ); } else { CoinFillN( colsol_, ncols, 0.0 ); } } } } return colsol_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getRowPrice() const { debugMessage("OsiCpxSolverInterface::getRowPrice()\n"); if( rowsol_==NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowsol_ = new double[nrows]; int solntype; /* check if a solution exists, if Cplex >= 11.0 */ #if CPX_VERSION >= 1100 CPXsolninfo(env_, getMutableLpPtr(), NULL, &solntype, NULL, NULL); #else solntype = CPX_BASIC_SOLN; #endif if( solntype != CPX_NO_SOLN ) { int err = CPXgetpi( env_, getMutableLpPtr(), rowsol_, 0, nrows-1 ); checkCPXerror( err, "CPXgetpi", "getRowPrice" ); } else { CoinFillN( rowsol_, nrows, 0.0 ); } } } return rowsol_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getReducedCost() const { debugMessage("OsiCpxSolverInterface::getReducedCost()\n"); if( redcost_==NULL ) { int ncols = CPXgetnumcols( env_, getMutableLpPtr() ); if( ncols > 0 ) { redcost_ = new double[ncols]; int solntype; /* check if a solution exists, if Cplex >= 11.0 */ #if CPX_VERSION >= 1100 CPXsolninfo(env_, getMutableLpPtr(), NULL, &solntype, NULL, NULL); #else solntype = CPX_BASIC_SOLN; #endif if( solntype != CPX_NO_SOLN ) { int err = CPXgetdj( env_, getMutableLpPtr(), redcost_, 0, ncols-1 ); checkCPXerror( err, "CPXgetdj", "getReducedCost" ); } else { CoinFillN( redcost_, ncols, 0.0 ); } } } return redcost_; } //------------------------------------------------------------------ const double * OsiCpxSolverInterface::getRowActivity() const { debugMessage("OsiCpxSolverInterface::getRowActivity()\n"); if( rowact_==NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowact_ = new double[nrows]; int solntype; if( probtypemip_ ) { /* check if a solution exists, if Cplex >= 11.0 */ #if CPX_VERSION >= 1100 CPXsolninfo(env_, getMutableLpPtr(), NULL, &solntype, NULL, NULL); if( solntype != CPX_NO_SOLN ) { double *rowslack = new double[nrows]; int err = CPXgetmipslack( env_, getMutableLpPtr(), rowslack, 0, nrows-1 ); checkCPXerror( err, "CPXgetmipslack", "getRowActivity" ); } else { CoinFillN( rowact_, nrows, 0.0 ); } #else double *rowslack = new double[nrows]; int err = CPXgetmipslack( env_, getMutableLpPtr(), rowslack, 0, nrows-1 ); if ( err == CPXERR_NO_SOLN || err == CPXERR_NO_INT_SOLN ) { CoinFillN( rowact_, nrows, 0.0 ); } else { checkCPXerror( err, "CPXgetmipslack", "getRowActivity" ); for( int r = 0; r < nrows; ++r ) rowact_[r] = getRightHandSide()[r] - rowslack[r]; } delete[] rowslack; #endif } else { CPXsolninfo(env_, getMutableLpPtr(), NULL, &solntype, NULL, NULL); if( solntype != CPX_NO_SOLN ) { int err = CPXgetax( env_, getMutableLpPtr(), rowact_, 0, nrows-1 ); checkCPXerror( err, "CPXgetax", "getRowActivity" ); } else { CoinFillN( rowact_, nrows, 0.0 ); } } } } return rowact_; } //------------------------------------------------------------------ double OsiCpxSolverInterface::getObjValue() const { debugMessage("OsiCpxSolverInterface::getObjValue()\n"); double objval = 0.0; int err; int solntype; CPXLPptr lp = getMutableLpPtr(); if( probtypemip_ ) { #if CPX_VERSION >= 1100 CPXsolninfo(env_, lp, NULL, &solntype, NULL, NULL); if( solntype != CPX_NO_SOLN ) { err = CPXgetmipobjval( env_, lp, &objval); checkCPXerror( err, "CPXgetmipobjval", "getObjValue" ); } else { // => return 0.0 as objective value (?? is this the correct behaviour ??) objval = 0.0; } #else err = CPXgetmipobjval( env_, lp, &objval); if( err == CPXERR_NO_INT_SOLN ) // => return 0.0 as objective value (?? is this the correct behaviour ??) objval = 0.0; else checkCPXerror( err, "CPXgetmipobjval", "getObjValue" ); #endif } else { CPXsolninfo(env_, lp, NULL, &solntype, NULL, NULL); if( solntype != CPX_NO_SOLN ) { err = CPXgetobjval( env_, lp, &objval ); checkCPXerror( err, "CPXgetobjval", "getObjValue" ); } else { // => return 0.0 as objective value (?? is this the correct behaviour ??) objval = 0.0; } } // Adjust objective function value by constant term in objective function double objOffset; getDblParam(OsiObjOffset,objOffset); objval -= objOffset; return objval; } //------------------------------------------------------------------ int OsiCpxSolverInterface::getIterationCount() const { debugMessage("OsiCpxSolverInterface::getIterationCount()\n"); // CPXgetitcnt prints an error if no solution exists, so check before, if Cplex >= 11.0 #if CPX_VERSION >= 1100 int solntype; CPXsolninfo(env_, getMutableLpPtr(), NULL, &solntype, NULL, NULL); if( solntype == CPX_NO_SOLN ) return 0; #endif if( probtypemip_ ) return CPXgetmipitcnt( env_, getMutableLpPtr() ); else return CPXgetitcnt( env_, getMutableLpPtr() ); } //------------------------------------------------------------------ std::vector OsiCpxSolverInterface::getDualRays(int maxNumRays, bool fullRay) const { debugMessage("OsiCpxSolverInterface::getDualRays(%d,%s)\n", maxNumRays, fullRay?"true":"false"); if (fullRay == true) { throw CoinError("Full dual rays not yet implemented.","getDualRays", "OsiCpxSolverInterface"); } OsiCpxSolverInterface solver(*this); const int numcols = getNumCols(); const int numrows = getNumRows(); int* index = new int[CoinMax(numcols,numrows)]; int i; for ( i = CoinMax(numcols,numrows)-1; i >= 0; --i) { index[i] = i; } double* obj = new double[CoinMax(numcols,2*numrows)]; CoinFillN(obj, numcols, 0.0); solver.setObjCoeffSet(index, index+numcols, obj); double* clb = new double[2*numrows]; double* cub = new double[2*numrows]; const double plusone = 1.0; const double minusone = -1.0; const char* sense = getRowSense(); const CoinPackedVectorBase** cols = new const CoinPackedVectorBase*[2*numrows]; int newcols = 0; for (i = 0; i < numrows; ++i) { switch (sense[i]) { case 'L': cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &minusone, false); break; case 'G': cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &plusone, false); break; case 'R': cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &minusone, false); cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &plusone, false); break; case 'N': break; } } CoinFillN(obj, newcols, 1.0); CoinFillN(clb, newcols, 0.0); CoinFillN(cub, newcols, getInfinity()); solver.addCols(newcols, cols, clb, cub, obj); delete[] index; delete[] cols; delete[] clb; delete[] cub; delete[] obj; solver.setObjSense(1.0); // minimize solver.initialSolve(); const double* solverpi = solver.getRowPrice(); double* pi = new double[numrows]; for ( i = numrows - 1; i >= 0; --i) { pi[i] = -solverpi[i]; } return std::vector(1, pi); } //------------------------------------------------------------------ std::vector OsiCpxSolverInterface::getPrimalRays(int maxNumRays) const { debugMessage("OsiCpxSolverInterface::getPrimalRays(%d)\n", maxNumRays); double *ray = new double[getNumCols()]; int err = CPXgetray(env_, getMutableLpPtr(), ray); checkCPXerror(err, "CPXgetray", "getPrimalRays"); return std::vector(1, ray); } //############################################################################# // Problem modifying methods (rim vectors) //############################################################################# void OsiCpxSolverInterface::setObjCoeff( int elementIndex, double elementValue ) { debugMessage("OsiCpxSolverInterface::setObjCoeff(%d, %g)\n", elementIndex, elementValue); // int err = CPXchgobj(env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_COLUMN ), 1, &elementIndex, &elementValue); int err = CPXchgobj(env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_PROBLEM ), 1, &elementIndex, &elementValue); checkCPXerror(err, "CPXchgobj", "setObjCoeff"); if(obj_ != NULL) { obj_[elementIndex] = elementValue; } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList) { debugMessage("OsiCpxSolverInterface::setObjCoeffSet(%p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)coeffList); const long int cnt = indexLast - indexFirst; // int err = CPXchgobj(env_, // getLpPtr(OsiCpxSolverInterface::FREECACHED_COLUMN), cnt, // const_cast(indexFirst), // const_cast(coeffList)); int err = CPXchgobj(env_, getLpPtr(OsiCpxSolverInterface::KEEPCACHED_PROBLEM), static_cast(cnt), const_cast(indexFirst), const_cast(coeffList)); checkCPXerror(err, "CPXchgobj", "setObjCoeffSet"); if (obj_ != NULL) { for (int i = 0; i < cnt; ++i) { obj_[indexFirst[i]] = coeffList[i]; } } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setColLower(int elementIndex, double elementValue) { debugMessage("OsiCpxSolverInterface::setColLower(%d, %g)\n", elementIndex, elementValue); char c = 'L'; // int err = CPXchgbds( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_COLUMN ), 1, &elementIndex, &c, &elementValue ); int err = CPXchgbds( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_PROBLEM ), 1, &elementIndex, &c, &elementValue ); checkCPXerror( err, "CPXchgbds", "setColLower" ); if(collower_ != NULL) { collower_[elementIndex] = elementValue; } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setColUpper(int elementIndex, double elementValue) { debugMessage("OsiCpxSolverInterface::setColUpper(%d, %g)\n", elementIndex, elementValue); char c = 'U'; // int err = CPXchgbds( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_COLUMN ), 1, &elementIndex, &c, &elementValue ); int err = CPXchgbds( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_PROBLEM ), 1, &elementIndex, &c, &elementValue ); checkCPXerror( err, "CPXchgbds", "setColUpper" ); if(colupper_ != NULL) { colupper_[elementIndex] = elementValue; } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setColBounds( int elementIndex, double lower, double upper ) { debugMessage("OsiCpxSolverInterface::setColBounds(%d, %g, %g)\n", elementIndex, lower, upper); char c[2] = { 'L', 'U' }; int ind[2]; double bd[2]; int err; ind[0] = elementIndex; ind[1] = elementIndex; bd[0] = lower; bd[1] = upper; // err = CPXchgbds( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_COLUMN ), 2, ind, c, bd ); err = CPXchgbds( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_PROBLEM ), 2, ind, c, bd ); checkCPXerror( err, "CPXchgbds", "setColBounds" ); if(collower_ != NULL) { collower_[elementIndex] = lower; } if(colupper_ != NULL) { colupper_[elementIndex] = upper; } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { debugMessage("OsiCpxSolverInterface::setColSetBounds(%p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)boundList); const long int cnt = indexLast - indexFirst; if (cnt <= 0) return; char* c = new char[2*cnt]; int* ind = new int[2*cnt]; for (int i = 0; i < cnt; ++i) { register const int j = 2 * i; c[j] = 'L'; c[j+1] = 'U'; const int colind = indexFirst[i]; ind[j] = colind; ind[j+1] = colind; if(collower_ != NULL) { collower_[colind] = boundList[2 * i]; } if(colupper_ != NULL) { colupper_[colind] = boundList[2 * i + 1]; } } // int err = CPXchgbds( env_, // getLpPtr(OsiCpxSolverInterface::FREECACHED_ROW ), // 2*cnt, ind, c, // const_cast(boundList) ); int err = CPXchgbds( env_, getLpPtr(OsiCpxSolverInterface::KEEPCACHED_PROBLEM), 2*static_cast(cnt), ind, c, const_cast(boundList) ); checkCPXerror( err, "CPXchgbds", "setColSetBounds" ); delete[] ind; delete[] c; // OsiSolverInterface::setColSetBounds( indexFirst, indexLast, boundList ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setRowLower( int i, double elementValue ) { debugMessage("OsiCpxSolverInterface::setRowLower(%d, %g)\n", i, elementValue); double rhs = getRightHandSide()[i]; double range = getRowRange()[i]; char sense = getRowSense()[i]; double lower = 0, upper = 0; convertSenseToBound( sense, rhs, range, lower, upper ); if( lower != elementValue ) { convertBoundToSense( elementValue, upper, sense, rhs, range ); setRowType( i, sense, rhs, range ); } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setRowUpper( int i, double elementValue ) { debugMessage("OsiCpxSolverInterface::setRowUpper(%d, %g)\n", i, elementValue); double rhs = getRightHandSide()[i]; double range = getRowRange()[i]; char sense = getRowSense()[i]; double lower = 0, upper = 0; convertSenseToBound( sense, rhs, range, lower, upper ); if( upper != elementValue ) { convertBoundToSense( lower, elementValue, sense, rhs, range ); setRowType( i, sense, rhs, range ); } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setRowBounds( int elementIndex, double lower, double upper ) { debugMessage("OsiCpxSolverInterface::setRowBounds(%d, %g, %g)\n", elementIndex, lower, upper); double rhs, range; char sense; convertBoundToSense( lower, upper, sense, rhs, range ); setRowType( elementIndex, sense, rhs, range ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setRowType(int i, char sense, double rightHandSide, double range) { debugMessage("OsiCpxSolverInterface::setRowType(%d, %c, %g, %g)\n", i, sense, rightHandSide, range); int err; // in CPLEX, ranged constraints are interpreted as rhs <= coeff*x <= rhs+range, which is different from Osi double cpxrhs = rightHandSide; if (sense == 'R') { assert( range >= 0.0 ); cpxrhs -= range; } if (sense == 'N') { sense = 'R'; cpxrhs = -getInfinity(); range = 2*getInfinity(); } /************** err = CPXchgsense( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_ROW ), 1, &i, &sense ); checkCPXerror( err, "CPXchgsense", "setRowType" ); err = CPXchgrhs( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_ROW ), 1, &i, &rightHandSide ); checkCPXerror( err, "CPXchgrhs", "setRowType" ); err = CPXchgrngval( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_ROW ), 1, &i, &range ); checkCPXerror( err, "CPXchgrngval", "setRowType" ); ***************/ err = CPXchgsense( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_PROBLEM ), 1, &i, &sense ); checkCPXerror( err, "CPXchgsense", "setRowType" ); if(rowsense_ != NULL) { rowsense_[i] = sense; } err = CPXchgrhs( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_PROBLEM ), 1, &i, &cpxrhs ); checkCPXerror( err, "CPXchgrhs", "setRowType" ); if(rhs_ != NULL) { rhs_[i] = rightHandSide; } err = CPXchgrngval( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_PROBLEM ), 1, &i, &range ); checkCPXerror( err, "CPXchgrngval", "setRowType" ); if(rowrange_ != NULL) { rowrange_[i] = range; } if (rowlower_ != NULL || rowupper_ != NULL) { double dummy; convertSenseToBound(sense, rightHandSide, range, rowlower_ ? rowlower_[i] : dummy, rowupper_ ? rowupper_[i] : dummy); } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { debugMessage("OsiCpxSolverInterface::setRowSetBounds(%p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)boundList); const long int cnt = indexLast - indexFirst; if (cnt <= 0) return; char* sense = new char[cnt]; double* rhs = new double[cnt]; double* range = new double[cnt]; for (int i = 0; i < cnt; ++i) { convertBoundToSense(boundList[2*i], boundList[2*i+1], sense[i], rhs[i], range[i]); } setRowSetTypes(indexFirst, indexLast, sense, rhs, range); delete[] range; delete[] rhs; delete[] sense; // OsiSolverInterface::setRowSetBounds( indexFirst, indexLast, boundList ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList) { debugMessage("OsiCpxSolverInterface::setRowSetTypes(%p, %p, %p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)senseList, (void*)rhsList, (void*)rangeList); const long int cnt = indexLast - indexFirst; if (cnt <= 0) return; char* sense = new char[cnt]; double* rhs = new double[cnt]; double* range = new double[cnt]; int* rangeind = new int[cnt]; int rangecnt = 0; for (int i = 0; i < cnt; ++i) { sense[i] = senseList[i]; rhs[i] = rhsList[i]; if (sense[i] == 'R') { assert(rangeList[i] >= 0.0); rhs[i] -= rangeList[i]; rangeind[rangecnt] = indexFirst[i]; range[rangecnt] = rangeList[i]; ++rangecnt; } if (sense[i] == 'N') { sense[i] = 'R'; rhs[i] = -getInfinity(); rangeind[rangecnt] = indexFirst[i]; range[rangecnt] = 2*getInfinity(); ++rangecnt; } } int err; /****************** err = CPXchgsense(env_, getLpPtr(OsiCpxSolverInterface::FREECACHED_ROW), cnt, const_cast(indexFirst), sense); checkCPXerror( err, "CPXchgsense", "setRowSetTypes" ); err = CPXchgrhs(env_, getLpPtr(OsiCpxSolverInterface::FREECACHED_ROW), cnt, const_cast(indexFirst), rhs); checkCPXerror( err, "CPXchgrhs", "setRowSetTypes" ); err = CPXchgrngval(env_, getLpPtr(OsiCpxSolverInterface::FREECACHED_ROW), rangecnt, rangeind, range); checkCPXerror( err, "CPXchgrngval", "setRowSetTypes" ); ********************/ err = CPXchgsense(env_, getLpPtr(OsiCpxSolverInterface::KEEPCACHED_ROW), static_cast(cnt), const_cast(indexFirst), sense); checkCPXerror( err, "CPXchgsense", "setRowSetTypes" ); err = CPXchgrhs(env_, getLpPtr(OsiCpxSolverInterface::FREECACHED_ROW), static_cast(cnt), const_cast(indexFirst), rhs); checkCPXerror( err, "CPXchgrhs", "setRowSetTypes" ); err = CPXchgrngval(env_, getLpPtr(OsiCpxSolverInterface::FREECACHED_ROW), rangecnt, rangeind, range); checkCPXerror( err, "CPXchgrngval", "setRowSetTypes" ); int j; if(rowsense_ != NULL) { for(j=0; j= getNumCols()); coltype_[index] = 'C'; if ( probtypemip_ ) { CPXLPptr lp = getMutableLpPtr(); int err; err = CPXchgctype( env_, lp, 1, &index, &coltype_[index] ); checkCPXerror( err, "CPXchgctype", "setContinuous" ); } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setInteger(int index) { debugMessage("OsiCpxSolverInterface::setInteger(%d)\n", index); assert(coltype_ != NULL); assert(coltypesize_ >= getNumCols()); if( getColLower()[index] == 0.0 && getColUpper()[index] == 1.0 ) coltype_[index] = 'B'; else coltype_[index] = 'I'; if ( probtypemip_ ) { CPXLPptr lp = getMutableLpPtr(); int err; err = CPXchgctype( env_, lp, 1, &index, &coltype_[index] ); checkCPXerror( err, "CPXchgctype", "setInteger" ); } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setContinuous(const int* indices, int len) { debugMessage("OsiCpxSolverInterface::setContinuous(%p, %d)\n", (void*)indices, len); for( int i = 0; i < len; ++i ) setContinuous(indices[i]); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setInteger(const int* indices, int len) { debugMessage("OsiCpxSolverInterface::setInteger(%p, %d)\n", (void*)indices, len); for( int i = 0; i < len; ++i ) setInteger(indices[i]); } //############################################################################# void OsiCpxSolverInterface::setObjSense(double s) { debugMessage("OsiCpxSolverInterface::setObjSense(%g)\n", s); if( s == +1.0 ) CPXchgobjsen( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_RESULTS ), CPX_MIN ); else CPXchgobjsen( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_RESULTS ), CPX_MAX ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setColSolution(const double * cs) { debugMessage("OsiCpxSolverInterface::setColSolution(%p)\n", (void*)cs); int nc = getNumCols(); if( cs == NULL ) freeCachedResults(); else if( nc > 0 ) { // If colsol isn't allocated, then allocate it if ( colsol_ == NULL ) colsol_ = new double[nc]; // Copy in new col solution. CoinDisjointCopyN( cs, nc, colsol_ ); // CPLEX < 7.0 doesn't support setting a col solution without a row solution // -> if a row solution exists or CPLEX version >= 7, then pass into CPLEX #if CPX_VERSION < 700 if ( rowsol_ != NULL ) #endif { int err = CPXcopystart( env_, getMutableLpPtr(), NULL, NULL, const_cast( colsol_ ), const_cast( rowsol_ ), NULL, NULL ); checkCPXerror( err, "CPXcopystart", "setColSolution" ); } } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::setRowPrice(const double * rs) { debugMessage("OsiCpxSolverInterface::setRowPrice(%p)\n", (void*)rs); int nr = getNumRows(); if( rs == NULL ) freeCachedResults(); else if( nr > 0 ) { // If rowsol isn't allocated, then allocate it if ( rowsol_ == NULL ) rowsol_ = new double[nr]; // Copy in new row solution. CoinDisjointCopyN( rs, nr, rowsol_ ); // if a col solution exists, then pass into CPLEX if ( colsol_ != NULL ) { int err = CPXcopystart( env_, getMutableLpPtr(), NULL, NULL, const_cast( colsol_ ), const_cast( rowsol_ ), NULL, NULL ); checkCPXerror( err, "CPXcopystart", "setRowPrice" ); } } } //############################################################################# // Problem modifying methods (matrix) //############################################################################# void OsiCpxSolverInterface::addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) { debugMessage("OsiCpxSolverInterface::addCol(%p, %g, %g, %g)\n", (void*)&vec, collb, colub, obj); int nc = getNumCols(); assert(coltypesize_ >= nc); resizeColType(nc + 1); coltype_[nc] = 'C'; int err; int cmatbeg[2] = {0, vec.getNumElements()}; err = CPXaddcols( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_ROW ), 1, vec.getNumElements(), const_cast(&obj), cmatbeg, const_cast(vec.getIndices()), const_cast(vec.getElements()), const_cast(&collb), const_cast(&colub), NULL ); checkCPXerror( err, "CPXaddcols", "addCol" ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj) { debugMessage("OsiCpxSolverInterface::addCols(%d, %p, %p, %p, %p)\n", numcols, (void*)cols, (void*)collb, (void*)colub, (void*)obj); int nc = getNumCols(); assert(coltypesize_ >= nc); resizeColType(nc + numcols); CoinFillN(&coltype_[nc], numcols, 'C'); int i; int nz = 0; for (i = 0; i < numcols; ++i) nz += cols[i]->getNumElements(); int* index = new int[nz]; double* elem = new double[nz]; int* start = new int[numcols+1]; nz = 0; start[0] = 0; for (i = 0; i < numcols; ++i) { const CoinPackedVectorBase* col = cols[i]; const int len = col->getNumElements(); CoinDisjointCopyN(col->getIndices(), len, index+nz); CoinDisjointCopyN(col->getElements(), len, elem+nz); nz += len; start[i+1] = nz; } int err = CPXaddcols(env_, getLpPtr(OsiCpxSolverInterface::KEEPCACHED_ROW), numcols, nz, const_cast(obj), start, index, elem, const_cast(collb), const_cast(colub), NULL ); checkCPXerror( err, "CPXaddcols", "addCols" ); delete[] start; delete[] elem; delete[] index; // int i; // for( i = 0; i < numcols; ++i ) // addCol( *(cols[i]), collb[i], colub[i], obj[i] ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::deleteCols(const int num, const int * columnIndices) { debugMessage("OsiCpxSolverInterface::deleteCols(%d, %p)\n", num, (void*)columnIndices); int ncols = getNumCols(); int *delstat = new int[ncols]; int i, err; CoinFillN(delstat, ncols, 0); for( i = 0; i < num; ++i ) delstat[columnIndices[i]] = 1; err = CPXdelsetcols( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_ROW ), delstat ); checkCPXerror( err, "CPXdelsetcols", "deleteCols" ); for( i = 0; i < ncols; ++i ) { assert(delstat[i] <= i); if( delstat[i] != -1 ) coltype_[delstat[i]] = coltype_[i]; } delete[] delstat; //--- //--- MVG: took from OsiClp for updating names //--- int nameDiscipline; getIntParam(OsiNameDiscipline,nameDiscipline) ; if (num && nameDiscipline) { // Very clumsy (and inefficient) - need to sort and then go backwards in ? chunks int * indices = CoinCopyOfArray(columnIndices,num); std::sort(indices,indices+num); int num2 = num; while (num2) { int next = indices[num2-1]; int firstDelete = num2-1; int i; for (i = num2-2; i>=0; --i) { if (indices[i]+1 == next) { --next; firstDelete = i; } else { break; } } OsiSolverInterface::deleteColNames(indices[firstDelete],num2-firstDelete); num2 = firstDelete; assert (num2>=0); } delete [] indices; } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub) { debugMessage("OsiCpxSolverInterface::addRow(%p, %g, %g)\n", (void*)&vec, rowlb, rowub); char sense; double rhs, range; convertBoundToSense( rowlb, rowub, sense, rhs, range ); addRow( vec, sense, rhs, range ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) { debugMessage("OsiCpxSolverInterface::addRow(%p, %c, %g, %g)\n", (void*)&vec, rowsen, rowrhs, rowrng); int err; int rmatbeg = 0; double rhs; double range; char sense = rowsen; switch( rowsen ) { case 'R': assert( rowrng >= 0.0 ); rhs = rowrhs - rowrng; range = rowrng; break; case 'N': sense = 'R'; rhs = -getInfinity(); range = 2*getInfinity(); break; default: rhs = rowrhs; range = 0.0; } err = CPXaddrows( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_COLUMN ), 0, 1, vec.getNumElements(), &rhs, &sense, &rmatbeg, const_cast(vec.getIndices()), const_cast(vec.getElements()), NULL, NULL ); checkCPXerror( err, "CPXaddrows", "addRow" ); if( sense == 'R' ) { int row = getNumRows() - 1; err = CPXchgrngval( env_, getLpPtr( OsiCpxSolverInterface::FREECACHED_ROW ), 1, &row, &range ); checkCPXerror( err, "CPXchgrngval", "addRow" ); } } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub) { debugMessage("OsiCpxSolverInterface::addRows(%d, %p, %p, %p)\n", numrows, (void*)rows, (void*)rowlb, (void*)rowub); int i; for( i = 0; i < numrows; ++i ) addRow( *(rows[i]), rowlb[i], rowub[i] ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng) { debugMessage("OsiCpxSolverInterface::addRows(%d, %p, %p, %p, %p)\n", numrows, (void*)rows, (void*)rowsen, (void*)rowrhs, (void*)rowrng); int i; for( i = 0; i < numrows; ++i ) addRow( *(rows[i]), rowsen[i], rowrhs[i], rowrng[i] ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::deleteRows(const int num, const int * rowIndices) { debugMessage("OsiCpxSolverInterface::deleteRows(%d, %p)\n", num, (void*)rowIndices); int nrows = getNumRows(); int *delstat = new int[nrows]; int i, err; CoinFillN( delstat, nrows, 0 ); for( i = 0; i < num; ++i ) delstat[rowIndices[i]] = 1; err = CPXdelsetrows( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_COLUMN ), delstat ); checkCPXerror( err, "CPXdelsetrows", "deleteRows" ); delete[] delstat; //--- //--- SV: took from OsiClp for updating names //--- int nameDiscipline; getIntParam(OsiNameDiscipline,nameDiscipline) ; if (num && nameDiscipline) { // Very clumsy (and inefficient) - need to sort and then go backwards in ? chunks int * indices = CoinCopyOfArray(rowIndices,num); std::sort(indices,indices+num); int num2=num; while (num2) { int next = indices[num2-1]; int firstDelete = num2-1; int i; for (i = num2-2; i>=0; --i) { if (indices[i]+1 == next) { --next; firstDelete = i; } else { break; } } OsiSolverInterface::deleteRowNames(indices[firstDelete],num2-firstDelete); num2 = firstDelete; assert(num2 >= 0); } delete [] indices; } } //############################################################################# // Methods to input a problem //############################################################################# void OsiCpxSolverInterface::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { debugMessage("OsiCpxSolverInterface::loadProblem(1)(%p, %p, %p, %p, %p, %p)\n", (void*)&matrix, (void*)collb, (void*)colub, (void*)obj, (void*)rowlb, (void*)rowub); const double inf = getInfinity(); int nrows = matrix.getNumRows(); char * rowSense = new char [nrows]; double * rowRhs = new double[nrows]; double * rowRange = new double[nrows]; int i; for ( i = nrows - 1; i >= 0; --i ) { const double lower = rowlb ? rowlb[i] : -inf; const double upper = rowub ? rowub[i] : inf; convertBoundToSense( lower, upper, rowSense[i], rowRhs[i], rowRange[i] ); } loadProblem( matrix, collb, colub, obj, rowSense, rowRhs, rowRange ); delete [] rowSense; delete [] rowRhs; delete [] rowRange; } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub ) { debugMessage("OsiCpxSolverInterface::assignProblem()\n"); loadProblem( *matrix, collb, colub, obj, rowlb, rowub ); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowlb; rowlb = 0; delete[] rowub; rowub = 0; } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { debugMessage("OsiCpxSolverInterface::loadProblem(2)(%p, %p, %p, %p, %p, %p, %p)\n", (void*)&matrix, (void*)collb, (void*)colub, (void*)obj, (void*)rowsen, (void*)rowrhs, (void*)rowrng); char *lclRowsen = NULL ; double *lclRowrhs = NULL ; int nc=matrix.getNumCols(); int nr=matrix.getNumRows(); if( nr == 0 && nc == 0 ) { // empty LP if (lp_ != NULL) { // kill old LP int objDirection = CPXgetobjsen( env_, getMutableLpPtr() ); int err = CPXfreeprob( env_, &lp_ ); checkCPXerror( err, "CPXfreeprob", "loadProblem" ); lp_ = NULL; freeAllMemory(); CPXchgobjsen(env_, getLpPtr(), objDirection); } return; } if (nr == 0) { int objDirection = CPXgetobjsen( env_, getMutableLpPtr() ); if (lp_ != NULL) { // kill old LP int err = CPXfreeprob( env_, &lp_ ); checkCPXerror( err, "CPXfreeprob", "loadProblem" ); lp_ = NULL; freeAllMemory(); } // getLpPtr() call will create new LP int err = CPXnewcols( env_, getLpPtr(), nc, obj, collb, colub, NULL, NULL); checkCPXerror( err, "CPXcopylp", "loadProblem" ); CPXchgobjsen(env_, getLpPtr(), objDirection); return; } if (rowsen == NULL) { lclRowsen = new char[nr] ; CoinFillN(lclRowsen,nr,'G') ; rowsen = lclRowsen ; } if (rowrhs == NULL) { lclRowrhs = new double[nr] ; CoinFillN(lclRowrhs,nr,0.0) ; rowrhs = lclRowrhs ; } int i; // Set column values to defaults if NULL pointer passed double * clb; double * cub; double * ob; double * rr = NULL; double * rhs; if ( collb!=NULL ) clb=const_cast(collb); else { clb = new double[nc]; CoinFillN(clb, nc, 0.0); } if ( colub!=NULL ) cub=const_cast(colub); else { cub = new double[nc]; CoinFillN(cub, nc, getInfinity()); } if ( obj!=NULL ) ob=const_cast(obj); else { ob = new double[nc]; CoinFillN(ob, nc, 0.0); } if ( rowrng != NULL ) { rhs = new double[nr]; rr = new double[nr]; for ( i=0; i= 0 ) { rhs[i] = rowrhs[i] - rowrng[i]; rr[i] = rowrng[i]; } else { rhs[i] = rowrhs[i]; rr[i] = -rowrng[i]; } } else { rhs[i] = rowrhs[i]; rr[i] = 0.0; } } } else rhs = const_cast(rowrhs); bool freeMatrixRequired = false; CoinPackedMatrix * m = NULL; if ( !matrix.isColOrdered() ) { m = new CoinPackedMatrix(); m->reverseOrderedCopyOf(matrix); freeMatrixRequired = true; } else m = const_cast(&matrix); assert( nc == m->getNumCols() ); assert( nr == m->getNumRows() ); assert( m->isColOrdered() ); int objDirection = CPXgetobjsen( env_, getMutableLpPtr() ); int err = CPXcopylp( env_, getLpPtr(), nc, nr, // Leave ObjSense alone(set to current value). objDirection, ob, rhs, const_cast(rowsen), const_cast(m->getVectorStarts()), const_cast(m->getVectorLengths()), const_cast(m->getIndices()), const_cast(m->getElements()), const_cast(clb), const_cast(cub), rr ); checkCPXerror( err, "CPXcopylp", "loadProblem" ); if ( collb == NULL ) delete[] clb; if ( colub == NULL ) delete[] cub; if ( obj == NULL ) delete[] ob; if ( rowrng != NULL ) { delete[] rr; delete[] rhs; } if ( freeMatrixRequired ) delete m; resizeColType(nc); CoinFillN(coltype_, nc, 'C'); if (lclRowsen != NULL) delete[] lclRowsen ; if (lclRowrhs != NULL) delete[] lclRowrhs ; } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng ) { debugMessage("OsiCpxSolverInterface::assignProblem()\n"); loadProblem( *matrix, collb, colub, obj, rowsen, rowrhs, rowrng ); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowsen; rowsen = 0; delete[] rowrhs; rowrhs = 0; delete[] rowrng; rowrng = 0; } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { debugMessage("OsiCpxSolverInterface::loadProblem(3)()\n"); const double inf = getInfinity(); char * rowSense = new char [numrows]; double * rowRhs = new double[numrows]; double * rowRange = new double[numrows]; for ( int i = numrows - 1; i >= 0; --i ) { const double lower = rowlb ? rowlb[i] : -inf; const double upper = rowub ? rowub[i] : inf; convertBoundToSense( lower, upper, rowSense[i], rowRhs[i], rowRange[i] ); } loadProblem(numcols, numrows, start, index, value, collb, colub, obj, rowSense, rowRhs, rowRange); delete [] rowSense; delete [] rowRhs; delete [] rowRange; } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { debugMessage("OsiCpxSolverInterface::loadProblem(4)(%d, %d, %p, %p, %p, %p, %p, %p, %p, %p, %p)\n", numcols, numrows, (void*)start, (void*)index, (void*)value, (void*)collb, (void*)colub, (void*)obj, (void*)rowsen, (void*)rowrhs, (void*)rowrng); const int nc = numcols; const int nr = numrows; if( nr == 0 && nc == 0 ) { // empty LP if (lp_ != NULL) { // kill old LP int objDirection = CPXgetobjsen( env_, getMutableLpPtr() ); int err = CPXfreeprob( env_, &lp_ ); checkCPXerror( err, "CPXfreeprob", "loadProblem" ); lp_ = NULL; freeAllMemory(); CPXchgobjsen(env_, getLpPtr(), objDirection); } return; } if (nr == 0) { int objDirection = CPXgetobjsen( env_, getMutableLpPtr() ); if (lp_ != NULL) { // kill old LP int err = CPXfreeprob( env_, &lp_ ); checkCPXerror( err, "CPXfreeprob", "loadProblem" ); lp_ = NULL; freeAllMemory(); } // getLpPtr() call will create new LP int err = CPXnewcols( env_, getLpPtr(), nc, obj, collb, colub, NULL, NULL); checkCPXerror( err, "CPXcopylp", "loadProblem" ); CPXchgobjsen(env_, getLpPtr(), objDirection); return; } char *lclRowsen = NULL ; double *lclRowrhs = NULL ; if (rowsen == NULL) { lclRowsen = new char[nr] ; CoinFillN(lclRowsen,nr,'G') ; rowsen = lclRowsen ; } if (rowrhs == NULL) { lclRowrhs = new double[nr] ; CoinFillN(lclRowrhs,nr,0.0) ; } int i; // Set column values to defaults if NULL pointer passed int * len = new int[nc]; double * clb = new double[nc]; double * cub = new double[nc]; double * ob = new double[nc]; double * rr = new double[nr]; double * rhs = new double[nr]; char * sen = new char[nr]; for (i = 0; i < nc; ++i) { len[i] = start[i+1] - start[i]; } if ( collb != NULL ) CoinDisjointCopyN(collb, nc, clb); else CoinFillN(clb, nc, 0.0); if ( colub!=NULL ) CoinDisjointCopyN(colub, nc, cub); else CoinFillN(cub, nc, getInfinity()); if ( obj!=NULL ) CoinDisjointCopyN(obj, nc, ob); else CoinFillN(ob, nc, 0.0); if ( rowrng != NULL ) { for ( i=0; i= 0 ) { rhs[i] = rowrhs[i] - rowrng[i]; rr[i] = rowrng[i]; } else { rhs[i] = rowrhs[i]; rr[i] = -rowrng[i]; } } else { rhs[i] = rowrhs[i]; rr[i] = 0.0; } } } else { CoinDisjointCopyN(rowrhs, nr, rhs); } CoinDisjointCopyN(rowsen, nr, sen); int objDirection = CPXgetobjsen( env_, getMutableLpPtr() ); int err = CPXcopylp( env_, getLpPtr(), nc, nr, // Leave ObjSense alone(set to current value). objDirection, ob, rhs, sen, const_cast(start), len, const_cast(index), const_cast(value), clb, cub, rr); checkCPXerror( err, "CPXcopylp", "loadProblem" ); delete[] len; delete[] clb; delete[] cub; delete[] ob; delete[] rr; delete[] rhs; delete[] sen; if (lclRowsen != NULL) delete[] lclRowsen ; if (lclRowrhs != NULL) delete[] lclRowrhs ; resizeColType(nc); CoinFillN(coltype_, nc, 'C'); } //----------------------------------------------------------------------------- // Read mps files //----------------------------------------------------------------------------- int OsiCpxSolverInterface::readMps( const char * filename, const char * extension ) { debugMessage("OsiCpxSolverInterface::readMps(%s, %s)\n", filename, extension); #if 0 std::string f(filename); std::string e(extension); std::string fullname = f + "." + e; int err = CPXreadcopyprob( env_, getLpPtr(), const_cast( fullname.c_str() ), NULL ); checkCPXerror( err, "CPXreadcopyprob", "readMps" ); #endif // just call base class method return OsiSolverInterface::readMps(filename,extension); } //----------------------------------------------------------------------------- // Write mps files //----------------------------------------------------------------------------- void OsiCpxSolverInterface::writeMps( const char * filename, const char * extension, double objSense ) const { debugMessage("OsiCpxSolverInterface::writeMps(%s, %s, %g)\n", filename, extension, objSense); // *FIXME* : this will not output ctype information to the MPS file char filetype[4] = "MPS"; std::string f(filename); std::string e(extension); std::string fullname = f + "." + e; int err = CPXwriteprob( env_, getMutableLpPtr(), const_cast( fullname.c_str() ), filetype ); checkCPXerror( err, "CPXwriteprob", "writeMps" ); } void OsiCpxSolverInterface::passInMessageHandler(CoinMessageHandler * handler) { int err; CPXCHANNELptr cpxresults; CPXCHANNELptr cpxwarning; CPXCHANNELptr cpxerror; CPXCHANNELptr cpxlog; err = CPXgetchannels(env_, &cpxresults, &cpxwarning, &cpxerror, &cpxlog); checkCPXerror( err, "CPXgetchannels", "gutsOfConstructor" ); err = CPXdelfuncdest(env_, cpxresults, messageHandler(), OsiCpxMessageCallbackResultLog); checkCPXerror( err, "CPXdelfuncdest", "gutsOfConstructor" ); err = CPXdelfuncdest(env_, cpxlog, messageHandler(), OsiCpxMessageCallbackResultLog); checkCPXerror( err, "CPXdelfuncdest", "gutsOfConstructor" ); err = CPXdelfuncdest(env_, cpxwarning, messageHandler(), OsiCpxMessageCallbackWarning); checkCPXerror( err, "CPXdelfuncdest", "gutsOfConstructor" ); err = CPXdelfuncdest(env_, cpxerror, messageHandler(), OsiCpxMessageCallbackError); checkCPXerror( err, "CPXdelfuncdest", "gutsOfConstructor" ); OsiSolverInterface::passInMessageHandler(handler); err = CPXaddfuncdest(env_, cpxresults, messageHandler(), OsiCpxMessageCallbackResultLog); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); err = CPXaddfuncdest(env_, cpxlog, messageHandler(), OsiCpxMessageCallbackResultLog); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); err = CPXaddfuncdest(env_, cpxwarning, messageHandler(), OsiCpxMessageCallbackWarning); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); err = CPXaddfuncdest(env_, cpxerror, messageHandler(), OsiCpxMessageCallbackError); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); } //############################################################################# // CPX specific public interfaces //############################################################################# CPXENVptr OsiCpxSolverInterface::getEnvironmentPtr() { assert( env_ != NULL ); return env_; } CPXLPptr OsiCpxSolverInterface::getLpPtr( int keepCached ) { freeCachedData( keepCached ); return getMutableLpPtr(); } //----------------------------------------------------------------------------- const char * OsiCpxSolverInterface::getCtype() const { debugMessage("OsiCpxSolverInterface::getCtype()\n"); return coltype_; } //############################################################################# // Constructors, destructors clone and assignment //############################################################################# //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiCpxSolverInterface::OsiCpxSolverInterface() : OsiSolverInterface(), env_(NULL), lp_(NULL), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(1000000), // ??? default iteration limit for strong branching is large obj_(NULL), collower_(NULL), colupper_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), rowlower_(NULL), rowupper_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), coltype_(NULL), coltypesize_(0), probtypemip_(false), domipstart(false), disableadvbasis(false) { debugMessage("OsiCpxSolverInterface::OsiCpxSolverInterface()\n"); gutsOfConstructor(); } //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiSolverInterface * OsiCpxSolverInterface::clone(bool copyData) const { debugMessage("OsiCpxSolverInterface::clone(%d)\n", copyData); return( new OsiCpxSolverInterface( *this ) ); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiCpxSolverInterface::OsiCpxSolverInterface( const OsiCpxSolverInterface & source ) : OsiSolverInterface(source), env_(NULL), lp_(NULL), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(source.hotStartMaxIteration_), obj_(NULL), collower_(NULL), colupper_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), rowlower_(NULL), rowupper_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), coltype_(NULL), coltypesize_(0), probtypemip_(false), domipstart(false), disableadvbasis(false) { debugMessage("OsiCpxSolverInterface::OsiCpxSolverInterface(%p)\n", (void*)&source); gutsOfConstructor(); gutsOfCopy( source ); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiCpxSolverInterface::~OsiCpxSolverInterface() { debugMessage("OsiCpxSolverInterface::~OsiCpxSolverInterface()\n"); gutsOfDestructor(); } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiCpxSolverInterface& OsiCpxSolverInterface::operator=( const OsiCpxSolverInterface& rhs ) { debugMessage("OsiCpxSolverInterface::operator=(%p)\n", (void*)&rhs); if (this != &rhs) { OsiSolverInterface::operator=( rhs ); gutsOfDestructor(); gutsOfConstructor(); if ( rhs.lp_ !=NULL ) gutsOfCopy( rhs ); } return *this; } //############################################################################# // Applying cuts //############################################################################# void OsiCpxSolverInterface::applyColCut( const OsiColCut & cc ) { debugMessage("OsiCpxSolverInterface::applyColCut(%p)\n", (void*)&cc); const double * cplexColLB = getColLower(); const double * cplexColUB = getColUpper(); const CoinPackedVector & lbs = cc.lbs(); const CoinPackedVector & ubs = cc.ubs(); int i; for( i = 0; i < lbs.getNumElements(); ++i ) if ( lbs.getElements()[i] > cplexColLB[lbs.getIndices()[i]] ) setColLower( lbs.getIndices()[i], lbs.getElements()[i] ); for( i = 0; i < ubs.getNumElements(); ++i ) if ( ubs.getElements()[i] < cplexColUB[ubs.getIndices()[i]] ) setColUpper( ubs.getIndices()[i], ubs.getElements()[i] ); } //----------------------------------------------------------------------------- void OsiCpxSolverInterface::applyRowCut( const OsiRowCut & rowCut ) { debugMessage("OsiCpxSolverInterface::applyRowCut(%p)\n", (void*)&rowCut); int err = 0; double rhs = 0.0; double rng = 0.0; char sns; double lb = rowCut.lb(); double ub = rowCut.ub(); if( lb <= -getInfinity() && ub >= getInfinity() ) // free constraint { rhs = -getInfinity(); rng = 2*getInfinity(); // CPLEX doesn't support free constraints sns = 'R'; // -> implement them as ranged rows with infinite bounds } else if( lb <= -getInfinity() ) // <= constraint { rhs = ub; sns = 'L'; } else if( ub >= getInfinity() ) // >= constraint { rhs = lb; sns = 'G'; } else if( ub == lb ) // = constraint { rhs = ub; sns = 'E'; } else // range constraint { rhs = lb; rng = ub - lb; sns = 'R'; } int rmatbeg = 0; err = CPXaddrows( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_COLUMN ), 0, 1, rowCut.row().getNumElements(), &rhs, &sns, &rmatbeg, const_cast( rowCut.row().getIndices() ), const_cast( rowCut.row().getElements() ), NULL, NULL ); checkCPXerror( err, "CPXaddrows", "applyRowCut" ); if( sns == 'R' ) { err = CPXchgcoef( env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_COLUMN ), CPXgetnumrows(env_, getLpPtr( OsiCpxSolverInterface::KEEPCACHED_COLUMN ))-1, -2, rng ); checkCPXerror( err, "CPXchgcoef", "applyRowCut" ); } } //############################################################################# // Private methods (non-static and static) and static data //############################################################################# //------------------------------------------------------------------- // Get pointer to CPXLPptr. // const methods should use getMutableLpPtr(). // non-const methods should use getLpPtr(). //------------------------------------------------------------------- CPXLPptr OsiCpxSolverInterface::getMutableLpPtr() const { if ( lp_ == NULL ) { int err; assert(env_ != NULL); #if 0 //char pn[] = "OSI_CPLEX"; lp_ = CPXcreateprob( env_, &err, pn ); #else std::string pn; getStrParam(OsiProbName,pn); lp_ = CPXcreateprob( env_, &err, const_cast(pn.c_str()) ); #endif checkCPXerror( err, "CPXcreateprob", "getMutableLpPtr" ); // err = CPXchgprobtype(env_,lp_,CPXPROB_LP); // checkCPXerror( err, "CPXchgprobtype", "getMutableLpPtr" ); assert( lp_ != NULL ); } return lp_; } //------------------------------------------------------------------- void OsiCpxSolverInterface::gutsOfCopy( const OsiCpxSolverInterface & source ) { // Set Objective Sense setObjSense(source.getObjSense()); // Set Rim and constraints const double* obj = source.getObjCoefficients(); const double* rhs = source.getRightHandSide(); const char* sense = source.getRowSense(); const CoinPackedMatrix * cols = source.getMatrixByCol(); const double* lb = source.getColLower(); const double* ub = source.getColUpper(); loadProblem(*cols,lb,ub,obj,sense,rhs,source.getRowRange()); // Set MIP information resizeColType(source.coltypesize_); CoinDisjointCopyN( source.coltype_, source.coltypesize_, coltype_ ); // Set Solution setColSolution(source.getColSolution()); setRowPrice(source.getRowPrice()); // Should also copy row and col names. #if 0 char** cname = new char*[numcols]; char* cnamestore = NULL; int surplus; err = CPXgetcolname( env_, source.lp_, cname, NULL, 0, &surplus, 0, numcols-1 ); if( err != CPXERR_NO_NAMES ) { cnamestore = new char[-surplus]; err = CPXgetcolname( env_, source.lp_, cname, cnamestore, -surplus, &surplus, 0, numcols-1 ); checkCPXerror( err, "CPXgetcolname", "gutsOfCopy" ); assert( surplus == 0 ); } else { delete [] cname; cname = NULL; } char** rname = new char*[numrows]; char* rnamestore = NULL; err = CPXgetrowname( env_, source.lp_, rname, NULL, 0, &surplus, 0, numrows-1 ); if( err != CPXERR_NO_NAMES ) { rnamestore = new char[-surplus]; err = CPXgetrowname( env_, source.lp_, rname, rnamestore, -surplus, &surplus, 0, numrows-1 ); checkCPXerror( err, "CPXgetrowname", "gutsOfCopy" ); assert( surplus == 0 ); } else { delete [] rname; rname = NULL; } err = CPXcopylpwnames( env_, getLpPtr(), numcols, numrows, objsen, const_cast(obj), const_cast(rhs), const_cast(sense), const_cast(cols->vectorStarts()), const_cast(cols->vectorLengths()), const_cast(cols->indices()), const_cast(cols->elements()), const_cast(lb), const_cast(ub), rng, cname, rname); checkCPXerror( err, "CPXcopylpwnames", "gutsOfCopy" ); if( rname != NULL ) { delete [] rnamestore; delete [] rname; } if( cname != NULL ) { delete [] cnamestore; delete [] cname; } delete [] rng; #endif } //------------------------------------------------------------------- void OsiCpxSolverInterface::gutsOfConstructor() { int err; #if CPX_VERSION >= 800 env_ = CPXopenCPLEX( &err ); #else env_ = CPXopenCPLEXdevelop( &err ); #endif checkCPXerror( err, "CPXopenCPLEXdevelop", "gutsOfConstructor" ); assert( env_ != NULL ); CPXCHANNELptr cpxresults; CPXCHANNELptr cpxwarning; CPXCHANNELptr cpxerror; CPXCHANNELptr cpxlog; err = CPXgetchannels(env_, &cpxresults, &cpxwarning, &cpxerror, &cpxlog); checkCPXerror( err, "CPXgetchannels", "gutsOfConstructor" ); err = CPXaddfuncdest(env_, cpxresults, messageHandler(), OsiCpxMessageCallbackResultLog); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); err = CPXaddfuncdest(env_, cpxlog, messageHandler(), OsiCpxMessageCallbackResultLog); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); err = CPXaddfuncdest(env_, cpxwarning, messageHandler(), OsiCpxMessageCallbackWarning); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); err = CPXaddfuncdest(env_, cpxerror, messageHandler(), OsiCpxMessageCallbackError); checkCPXerror( err, "CPXaddfuncdest", "gutsOfConstructor" ); /* turn off all output to screen */ err = CPXsetintparam( env_, CPX_PARAM_SCRIND, CPX_OFF ); checkCPXerror( err, "CPXsetintparam", "gutsOfConstructor" ); #if 0 // CPXcreateprob was moved to getLpPtr() method. lp_ = CPXcreateprob( env_, &err, "OSI_CPLEX" ); checkCPXerror( err, "CPXcreateprob", "gutsOfConstructor" ); // err = CPXchgprobtype(env_,lp_,CPXPROB_LP); // checkCPXerror( err, "CPXchgprobtype", "getMutableLpPtr" ); assert( lp_ != NULL ); #endif } //------------------------------------------------------------------- void OsiCpxSolverInterface::gutsOfDestructor() { if ( lp_ != NULL ) { int err = CPXfreeprob( env_, &lp_ ); checkCPXerror( err, "CPXfreeprob", "gutsOfDestructor" ); lp_=NULL; freeAllMemory(); } if ( env_ != NULL ) { int err = CPXcloseCPLEX( &env_ ); checkCPXerror( err, "CPXcloseCPLEX", "gutsOfDestructor" ); env_ = NULL; } assert( lp_==NULL ); assert( env_==NULL ); assert( obj_==NULL ); assert( collower_==NULL ); assert( colupper_==NULL ); assert( rowsense_==NULL ); assert( rhs_==NULL ); assert( rowrange_==NULL ); assert( rowlower_==NULL ); assert( rowupper_==NULL ); assert( colsol_==NULL ); assert( rowsol_==NULL ); assert( redcost_==NULL ); assert( rowact_==NULL ); assert( matrixByRow_==NULL ); assert( matrixByCol_==NULL ); assert( coltype_==NULL ); assert( coltypesize_==0 ); } //------------------------------------------------------------------- /// free cached vectors void OsiCpxSolverInterface::freeCachedColRim() { freeCacheDouble( obj_ ); freeCacheDouble( collower_ ); freeCacheDouble( colupper_ ); assert( obj_==NULL ); assert( collower_==NULL ); assert( colupper_==NULL ); } void OsiCpxSolverInterface::freeCachedRowRim() { freeCacheChar( rowsense_ ); freeCacheDouble( rhs_ ); freeCacheDouble( rowrange_ ); freeCacheDouble( rowlower_ ); freeCacheDouble( rowupper_ ); assert( rowsense_==NULL ); assert( rhs_==NULL ); assert( rowrange_==NULL ); assert( rowlower_==NULL ); assert( rowupper_==NULL ); } void OsiCpxSolverInterface::freeCachedMatrix() { freeCacheMatrix( matrixByRow_ ); freeCacheMatrix( matrixByCol_ ); assert( matrixByRow_==NULL ); assert( matrixByCol_==NULL ); } void OsiCpxSolverInterface::freeCachedResults() { freeCacheDouble( colsol_ ); freeCacheDouble( rowsol_ ); freeCacheDouble( redcost_ ); freeCacheDouble( rowact_ ); assert( colsol_==NULL ); assert( rowsol_==NULL ); assert( redcost_==NULL ); assert( rowact_==NULL ); } void OsiCpxSolverInterface::freeCachedData( int keepCached ) { if( !(keepCached & OsiCpxSolverInterface::KEEPCACHED_COLUMN) ) freeCachedColRim(); if( !(keepCached & OsiCpxSolverInterface::KEEPCACHED_ROW) ) freeCachedRowRim(); if( !(keepCached & OsiCpxSolverInterface::KEEPCACHED_MATRIX) ) freeCachedMatrix(); if( !(keepCached & OsiCpxSolverInterface::KEEPCACHED_RESULTS) ) freeCachedResults(); } void OsiCpxSolverInterface::freeAllMemory() { freeCachedData(); if( hotStartCStat_ != NULL ) delete[] hotStartCStat_; if( hotStartRStat_ != NULL ) delete[] hotStartRStat_; hotStartCStat_ = NULL; hotStartCStatSize_ = 0; hotStartRStat_ = NULL; hotStartRStatSize_ = 0; freeColType(); } //############################################################################# // Resets as if default constructor void OsiCpxSolverInterface::reset() { setInitialData(); // clear base class if (lp_ != NULL) { // kill old LP int err = CPXfreeprob( env_, &lp_ ); checkCPXerror( err, "CPXfreeprob", "loadProblem" ); lp_ = NULL; freeAllMemory(); } } #if CPX_VERSION >= 900 /**********************************************************************/ /* Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none */ int OsiCpxSolverInterface::canDoSimplexInterface() const { return 1; } /**********************************************************************/ bool OsiCpxSolverInterface::basisIsAvailable() const { CPXLPptr lp = getMutableLpPtr(); int solnmethod, solntype, pfeasind, dfeasind; int status = CPXsolninfo (env_, lp, &solnmethod, &solntype, &pfeasind, &dfeasind); if(status) { return false; } if(solntype == CPX_BASIC_SOLN) { return true; } return false; } /**********************************************************************/ /* CPLEX return codes: For cstat: CPX_AT_LOWER 0 : variable at lower bound CPX_BASIC 1 : variable is basic CPX_AT_UPPER 2 : variable at upper bound CPX_FREE_SUPER 3 : variable free and non-basic For rstat: Non ranged rows: CPX_AT_LOWER 0 : associated slack/surplus/artificial variable non-basic at value 0.0 CPX_BASIC 1 : associated slack/surplus/artificial variable basic Ranged rows: CPX_AT_LOWER 0 : associated slack/surplus/artificial variable non-basic at its lower bound CPX_BASIC 1 : associated slack/surplus/artificial variable basic CPX_AT_UPPER 2 : associated slack/surplus/artificial variable non-basic at upper bound Cplex adds a slack with coeff +1 in <= and =, with coeff -1 in >=, slack being non negative. We switch in order to get a "Clp tableau" where all the slacks have coeff +1. If a slack for >= is non basic, invB is not changed; column of the slack in opt tableau is flipped. If slack for >= is basic, corresp. row of invB is flipped; whole row of opt tableau is flipped; then whole column for the slack in opt tableau is flipped. */ /* Osi return codes: 0: free 1: basic 2: upper 3: lower */ void OsiCpxSolverInterface::getBasisStatus(int* cstat, int* rstat) const { CPXLPptr lp = getMutableLpPtr(); int status = CPXgetbase(env_, lp, cstat, rstat); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBasisStatus(): Unable to get base\n"); exit(1); } int ncol = getNumCols(); int nrow = getNumRows(); const int objsense = (int)getObjSense(); const double *dual = getRowPrice(); const double *row_act = getRowActivity(); const double *rowLower = getRowLower(); const double *rowUpper = getRowUpper(); char *sense = new char[nrow]; status = CPXgetsense(env_, lp, sense, 0, nrow-1); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBasisStatus(): Unable to get sense for the rows\n"); exit(1); } for(int i=0; i 0) { rstat[i] = 2; } } if(sense[i] == 'R') { if(rowUpper[i] > rowLower[i] + 1e-6) { if(row_act[i] < rowUpper[i] - 1e-6) { rstat[i] = 2; } } else { if(dual[i] > 0) { rstat[i] = 2; } } } if(sense[i] == 'G') { rstat[i] = 2; } break; case 1: break; case 2: if(sense[i] == 'E') { if(dual[i] < 0) { rstat[i] = 3; } } if(sense[i] == 'R') { if(rowUpper[i] > rowLower[i] + 1e-6) { if(row_act[i] > rowLower[i] + 1e-6) { rstat[i] = 3; } } else { if(dual[i] < 0) { rstat[i] = 3; } } } break; default: printf("### ERROR: OsiCpxSolverInterface::getBasisStatus(): unknown row status: %d\n", rstat[i]); break; } } } else { // objsense == -1 for(int i=0; i rowLower[i] + 1e-6) { if(row_act[i] < rowUpper[i] - 1e-6) { rstat[i] = 2; } } else { if(dual[i] < 0) { rstat[i] = 2; } } } if(sense[i] == 'G') { rstat[i] = 2; } break; case 1: break; case 2: if(sense[i] == 'E') { if(dual[i] > 0) { rstat[i] = 3; } } if(sense[i] == 'R') { if(rowUpper[i] > rowLower[i] + 1e-6) { if(row_act[i] > rowLower[i] + 1e-6) { rstat[i] = 3; } } else { if(dual[i] > 0) { rstat[i] = 3; } } } break; default: printf("### ERROR: OsiCpxSolverInterface::getBasisStatus(): unknown row status: %d\n", rstat[i]); break; } } } delete[] sense; } /**********************************************************************/ void OsiCpxSolverInterface::getBInvARow(int row, double* z, double * slack) const { CPXLPptr lp = getMutableLpPtr(); int nrow = getNumRows(); int ncol = getNumCols(); char *sense =new char[nrow]; int status = CPXgetsense(env_, lp, sense, 0, nrow-1); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBInvARow(): Unable to get senses for the rows\n"); exit(1); } status = CPXbinvarow(env_, lp, row, z); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBInvARow(): Unable to get row %d of the tableau\n", row); exit(1); } if(slack != NULL) { status = CPXbinvrow(env_, lp, row, slack); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBInvARow(): Unable to get row %d of B inverse\n", row); exit(1); } // slack contains now the row of BInv(cplex); // slack(cplex) is obtained by flipping in slack all entries for >= constr // slack(clp) is obtained by flipping the same entries in slack(cplex) // i.e. slack(clp) is the current slack. } if(sense[row] == 'G') { int *ind_bas = new int[nrow]; int ind_slack = ncol+row; getBasics(ind_bas); for(int i=0; i=ncol) { // binv row corresponds to a slack variable int Arow=ind_bas[row]-ncol; // Arow is the number of the row in the problem matrix which this slack belongs to char sense; status = CPXgetsense(env_, lp, &sense, Arow, Arow); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBInvRow(): Unable to get senses for row %d\n", Arow); exit(1); } if(sense == 'G') { // slack has coeff -1 in Cplex; thus row in binv must be flipped for(int j=0; j ncol && sense[ind_bas[i]-ncol] == 'G') vec[i] = -vec[i]; // slack for row is basic; whole row must be flipped delete[] sense; delete[] ind_bas; } /* getBInvACol */ /**********************************************************************/ void OsiCpxSolverInterface::getBInvCol(int col, double* vec) const { CPXLPptr lp = getMutableLpPtr(); int status = CPXbinvcol(env_, lp, col, vec); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBInvCol(): Unable to get column %d of the basis inverse\n", col); exit(1); } int nrow = getNumRows(); int ncol = getNumCols(); char *sense =new char[nrow]; status = CPXgetsense(env_, lp, sense, 0, nrow-1); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBInvCol(): Unable to get senses for the rows\n"); exit(1); } int *ind_bas = new int[nrow]; getBasics(ind_bas); for(int i=0; i ncol && sense[ind_bas[i]-ncol] == 'G') vec[i] = -vec[i]; // slack for row i is basic; whole row must be flipped delete[] sense; delete[] ind_bas; } /* getBInvCol */ /**********************************************************************/ void OsiCpxSolverInterface::getBasics(int* index) const { int ncol = getNumCols(); int nrow = getNumRows(); CPXLPptr lp = getMutableLpPtr(); double *cplex_trash = new double[nrow]; int status = CPXgetbhead(env_, lp, index, cplex_trash); if(status) { printf("### ERROR: OsiCpxSolverInterface::getBasics(): Unable to get basis head\n"); exit(1); } for(int i=0; i= 900 */ /**********************************************************************/ /* Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none */ int OsiCpxSolverInterface::canDoSimplexInterface() const { return 0; } /**********************************************************************/ bool OsiCpxSolverInterface::basisIsAvailable() const { printf("### ERROR: OsiCpxSolverInterface::basisIsAvailable(): Cplex version lower than 9.0\n"); exit(1); return false; } /**********************************************************************/ void OsiCpxSolverInterface::getBasisStatus(int* cstat, int* rstat) const { printf("### ERROR: OsiCpxSolverInterface::getBasisStatus(): Cplex version lower than 9.0\n"); exit(1); } /**********************************************************************/ void OsiCpxSolverInterface::getBInvARow(int row, double* z, double * slack) const { printf("### ERROR: OsiCpxSolverInterface::getBInvARow(): Cplex version lower than 9.0\n"); exit(1); } /* getBInvARow */ /**********************************************************************/ void OsiCpxSolverInterface::getBInvRow(int row, double* z) const { printf("### ERROR: OsiCpxSolverInterface::getBInvRow(): Cplex version lower than 9.0\n"); exit(1); } /* getBInvRow */ /**********************************************************************/ void OsiCpxSolverInterface::getBInvACol(int col, double* vec) const { printf("### ERROR: OsiCpxSolverInterface::getBInvACol(): Cplex version lower than 9.0\n"); exit(1); } /* getBInvACol */ /**********************************************************************/ void OsiCpxSolverInterface::getBInvCol(int col, double* vec) const { printf("### ERROR: OsiCpxSolverInterface::getBInvCol(): Cplex version lower than 9.0\n"); exit(1); } /* getBInvCol */ /**********************************************************************/ void OsiCpxSolverInterface::getBasics(int* index) const { printf("### ERROR: OsiCpxSolverInterface::getBasics(): Cplex version lower than 9.0\n"); exit(1); } /* getBasics */ #endif /* not CPX_VERSION >= 900 */ Osi-0.106.4/src/OsiCpx/Makefile.in0000644000076600007660000005432312240315110015127 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Andreas Waechter IBM 2006-04-13 srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/OsiCpx DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsiCpx_la_LIBADD = am_libOsiCpx_la_OBJECTS = OsiCpxSolverInterface.lo libOsiCpx_la_OBJECTS = $(am_libOsiCpx_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsiCpx_la_SOURCES) DIST_SOURCES = $(libOsiCpx_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiCpx # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiCpx.la # List all source files for this library, including headers libOsiCpx_la_SOURCES = \ OsiCpxSolverInterface.cpp OsiCpxSolverInterface.hpp # This is for libtool (on Windows) libOsiCpx_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(CPXINCDIR)` \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiCpxSolverInterface.hpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OsiCpx/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/OsiCpx/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsiCpx.la: $(libOsiCpx_la_OBJECTS) $(libOsiCpx_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsiCpx_la_LDFLAGS) $(libOsiCpx_la_OBJECTS) $(libOsiCpx_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiCpxSolverInterface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/OsiCpx/osi-cplex.pc.in0000644000076600007660000000046511510106235015721 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: OsiCplex Description: COIN-OR Open Solver Interface for CPLEX URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsiCpx @CPXLIB@ Cflags: -I${includedir} -I@CPXINCDIR@ Requires: osi Osi-0.106.4/src/OsiXpr/0000755000076600007660000000000012244064313013104 5ustar coincoinOsi-0.106.4/src/OsiXpr/OsiXprSolverInterface.cpp0000644000076600007660000022076311630504165020064 0ustar coincoin// copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). /* OPEN: have a look at the OPEN tags */ /* OPEN: read/set more controls ... */ #include #include #include #include "CoinPragma.hpp" #define __ANSIC_ #include #undef __ANSIC_ #include "OsiXprSolverInterface.hpp" #include "CoinHelperFunctions.hpp" #include "OsiCuts.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" #include "OsiRowCut.hpp" #include "CoinWarmStartBasis.hpp" #include "CoinMessage.hpp" //#define DEBUG static void XPRS_CC OsiXprMessageCallback(XPRSprob prob, void *vUserDat, const char *msg, int msgLen, int msgType) { if (vUserDat) { if (msgType < 0 ) { ((CoinMessageHandler*)vUserDat)->finish(); } else { /* CoinMessageHandler does not recognize that a "\0" string means that a newline should be printed. * So we let it print a space (followed by a newline). */ if (((CoinMessageHandler*)vUserDat)->logLevel() > 0) ((CoinMessageHandler*)vUserDat)->message(0, "XPRS", *msg ? msg : " ", ' ') << CoinMessageEol; } } else { if (msgType < 0) { fflush(stdout); } else { printf("%.*s\n", msgLen, msg); fflush(stdout); } } } static void reporterror(const char *fname, int iline, int ierr) { fprintf( stdout, "ERROR: %s in line %d error %d occured\n", fname, iline, ierr ); } #define XPRS_CHECKED(function, args) do { \ int _nReturn; \ if( (_nReturn = function args ) !=0 ) { \ reporterror (#function,__LINE__,_nReturn); \ } \ } while (0) //############################################################################# // Solve methods //############################################################################# void OsiXprSolverInterface::initialSolve() { freeSolution(); #if XPVERSION <= 20 if ( objsense_ == 1.0 ) { XPRS_CHECKED( XPRSminim, (prob_,"l") ); } else if ( objsense_ == -1.0 ) { XPRS_CHECKED( XPRSmaxim, (prob_,"l")); } #else XPRS_CHECKED( XPRSlpoptimize, (prob_, "l") ); #endif lastsolvewasmip = false; } //----------------------------------------------------------------------------- void OsiXprSolverInterface::resolve() { freeSolution(); #if XPVERSION <= 20 if ( objsense_ == 1.0 ) { XPRS_CHECKED( XPRSminim, (prob_,"dl") ); } else if ( objsense_ == -1.0 ) { XPRS_CHECKED( XPRSmaxim, (prob_,"dl") ) ; } #else XPRS_CHECKED( XPRSlpoptimize, (prob_, "dl") ); #endif lastsolvewasmip = false; } //----------------------------------------------------------------------------- void OsiXprSolverInterface::branchAndBound(){ int status; if( colsol_ != NULL && domipstart ) { XPRS_CHECKED( XPRSloadmipsol, (prob_, colsol_, &status) ); /* status = 0 .. accepted * = 1 .. infeasible * = 2 .. cutoff * = 3 .. LP reoptimization interrupted */ } freeSolution(); #if XPVERSION <= 20 /* XPRSglobal cannot be called if there is no LP relaxation available yet * -> solve LP relaxation first, if no LP solution available */ XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); if (status != XPRS_LP_OPTIMAL) initialSolve(); XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); if (status != XPRS_LP_OPTIMAL) { messageHandler()->message(0, "XPRS", "XPRESS failed to solve LP relaxation; cannot call XPRSglobal", ' ') << CoinMessageEol; return; } #else XPRS_CHECKED( XPRSmipoptimize, (prob_, "") ); #endif lastsolvewasmip = true; } //############################################################################# // Parameter related methods //############################################################################# bool OsiXprSolverInterface::setIntParam(OsiIntParam key, int value) { bool retval = false; switch (key) { case OsiMaxNumIteration: retval = XPRSsetintcontrol(prob_,XPRS_LPITERLIMIT, value) == 0; break; case OsiMaxNumIterationHotStart: retval = false; break; case OsiLastIntParam: retval = false; break; case OsiNameDiscipline: retval = false; break; } return retval; } //----------------------------------------------------------------------------- /* OPEN: more dbl parameters ... */ bool OsiXprSolverInterface::setDblParam(OsiDblParam key, double value) { bool retval = false; switch (key) { case OsiDualObjectiveLimit: retval = XPRSsetdblcontrol(prob_,XPRS_MIPABSCUTOFF, value) == 0; break; case OsiPrimalObjectiveLimit: retval = false; break; case OsiDualTolerance: retval = XPRSsetdblcontrol(prob_, XPRS_FEASTOL, value) == 0; break; case OsiPrimalTolerance: retval = XPRSsetdblcontrol(prob_, XPRS_FEASTOL, value) == 0; break; case OsiObjOffset: return OsiSolverInterface::setDblParam(key, value); case OsiLastDblParam: retval = false; break; } return retval; } //----------------------------------------------------------------------------- bool OsiXprSolverInterface::setStrParam(OsiStrParam key, const std::string & value) { bool retval=false; switch (key) { case OsiProbName: /* OPEN: what does this mean */ OsiSolverInterface::setStrParam(key,value); return retval = true; case OsiLastStrParam: return false; case OsiSolverName: return false; } return false; } //----------------------------------------------------------------------------- bool OsiXprSolverInterface::getIntParam(OsiIntParam key, int& value) const { bool retval = false; switch (key) { case OsiMaxNumIteration: /* OPEN: the return value was logically wrong */ retval = XPRSgetintcontrol(prob_,XPRS_LPITERLIMIT, &value) == 0; break; case OsiMaxNumIterationHotStart: retval = false; break; case OsiLastIntParam: retval = false; break; case OsiNameDiscipline: retval = false; break; } return retval; } //----------------------------------------------------------------------------- bool OsiXprSolverInterface::getDblParam(OsiDblParam key, double& value) const { bool retval = false; switch (key) { case OsiDualObjectiveLimit: retval = XPRSgetdblcontrol(prob_,XPRS_MIPABSCUTOFF, &value) == 0; break; case OsiPrimalObjectiveLimit: retval = false; break; case OsiDualTolerance: retval = XPRSgetdblcontrol(prob_, XPRS_FEASTOL, &value) == 0; break; case OsiPrimalTolerance: retval = XPRSgetdblcontrol(prob_, XPRS_FEASTOL, &value) == 0; break; case OsiObjOffset: retval = OsiSolverInterface::getDblParam(key, value); break; case OsiLastDblParam: retval = false; break; } return retval; } //----------------------------------------------------------------------------- bool OsiXprSolverInterface::getStrParam(OsiStrParam key, std::string & value) const { bool retval = false; switch (key) { case OsiProbName: OsiSolverInterface::getStrParam(key, value); retval = true; break; case OsiSolverName: value = "xpress"; retval = true; break; case OsiLastStrParam: retval = false; } return retval; } //############################################################################# // Methods returning info on how the solution process terminated //############################################################################# bool OsiXprSolverInterface::isAbandoned() const { int status, glstat; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_MIPSTATUS, &glstat) ); return status == XPRS_LP_UNFINISHED // LP unfinished || glstat == XPRS_MIP_NO_SOL_FOUND // global search incomplete -- no int sol || glstat == XPRS_MIP_SOLUTION; // global search incomplete -- int sol found } bool OsiXprSolverInterface::isProvenOptimal() const { int status, glstat; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_MIPSTATUS, &glstat) ); return status == XPRS_LP_OPTIMAL // LP optimal || status == XPRS_LP_CUTOFF // LP obj worse than cutoff || glstat == XPRS_MIP_OPTIMAL; // global search complete -- int found } bool OsiXprSolverInterface::isProvenPrimalInfeasible() const { int status; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); return status == XPRS_LP_INFEAS; // LP infeasible } bool OsiXprSolverInterface::isProvenDualInfeasible() const { int status; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); return status == XPRS_LP_UNBOUNDED; // LP Unbounded } bool OsiXprSolverInterface::isPrimalObjectiveLimitReached() const { /* OPEN: what does that mean */ return false; // N/A in XOSL } bool OsiXprSolverInterface::isDualObjectiveLimitReached() const { int status; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); return status == XPRS_LP_CUTOFF_IN_DUAL; // LP cut off in dual } bool OsiXprSolverInterface::isIterationLimitReached() const { int itrlim, itcnt; XPRS_CHECKED( XPRSgetintcontrol, (prob_,XPRS_LPITERLIMIT, &itrlim) ); XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_SIMPLEXITER, &itcnt) ); return itcnt >= itrlim; } //############################################################################# // WarmStart related methods //############################################################################# CoinWarmStart* OsiXprSolverInterface::getEmptyWarmStart () const { return (dynamic_cast(new CoinWarmStartBasis())); } CoinWarmStart* OsiXprSolverInterface::getWarmStart() const { int pstat, retstat; /* OPEN: what does this mean */ XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_PRESOLVESTATE, &pstat) ); if ( (pstat & 128) == 0 ) return NULL; CoinWarmStartBasis *ws = NULL; int numcols = getNumCols(); int numrows = getNumRows(); const double *lb = getColLower(); double infty = getInfinity(); int *rstatus = new int[numrows]; int *cstatus = new int[numcols]; retstat = XPRSgetbasis(prob_,rstatus, cstatus); if ( retstat == 0 ) { int i; ws = new CoinWarmStartBasis; ws->setSize( numcols, numrows ); for( i = 0; i < numrows; i++ ) { switch( rstatus[i] ) { case 0: ws->setArtifStatus(i, CoinWarmStartBasis::atLowerBound); break; case 1: ws->setArtifStatus(i, CoinWarmStartBasis::basic); break; case 2: ws->setArtifStatus(i, CoinWarmStartBasis::atUpperBound); break; case 3: ws->setArtifStatus(i, CoinWarmStartBasis::isFree); break; default: // unknown row status delete ws; ws = NULL; goto TERMINATE; } } for( i = 0; i < numcols; i++ ) { switch( cstatus[i] ) { case 0: if ( lb[i] <= -infty ) ws->setStructStatus(i, CoinWarmStartBasis::isFree); else ws->setStructStatus(i, CoinWarmStartBasis::atLowerBound); break; case 1: ws->setStructStatus( i, CoinWarmStartBasis::basic ); break; case 2: ws->setStructStatus( i, CoinWarmStartBasis::atUpperBound ); break; case 3: ws->setStructStatus(i, CoinWarmStartBasis::isFree); break; default: // unknown column status delete ws; ws = NULL; goto TERMINATE; } } } TERMINATE: delete[] cstatus; delete[] rstatus; return ws; } //----------------------------------------------------------------------------- bool OsiXprSolverInterface::setWarmStart(const CoinWarmStart* warmstart) { const CoinWarmStartBasis* ws = dynamic_cast(warmstart); if ( !ws ) return false; int numcols = ws->getNumStructural(); int numrows = ws->getNumArtificial(); if ( numcols != getNumCols() || numrows != getNumRows() ) return false; bool retval; int retstat; int *cstatus = new int[numcols]; int *rstatus = new int[numrows]; int i; for ( i = 0; i < numrows; i++ ) { switch( ws->getArtifStatus(i) ) { case CoinWarmStartBasis::atLowerBound: rstatus[i] = 0; break; case CoinWarmStartBasis::basic: rstatus[i] = 1; break; case CoinWarmStartBasis::atUpperBound: rstatus[i] = 2; break; default: // unknown row status retval = false; goto TERMINATE; } } for( i = 0; i < numcols; i++ ) { switch( ws->getStructStatus(i) ) { case CoinWarmStartBasis::atLowerBound: case CoinWarmStartBasis::isFree: cstatus[i] = 0; break; case CoinWarmStartBasis::basic: cstatus[i] = 1; break; case CoinWarmStartBasis::atUpperBound: cstatus[i] = 2; break; default: // unknown row status retval = false; goto TERMINATE; } } retstat = XPRSloadbasis(prob_,rstatus, cstatus); retval = (retstat == 0); TERMINATE: delete[] cstatus; delete[] rstatus; return retval; } //############################################################################# // Hotstart related methods (primarily used in strong branching) //############################################################################# void OsiXprSolverInterface::markHotStart() { // *FIXME* : do better... -LL OsiSolverInterface::markHotStart(); } void OsiXprSolverInterface::solveFromHotStart() { // *FIXME* : do better... -LL OsiSolverInterface::solveFromHotStart(); } void OsiXprSolverInterface::unmarkHotStart() { // *FIXME* : do better... -LL OsiSolverInterface::unmarkHotStart(); } //############################################################################# // Problem information methods (original data) //############################################################################# //------------------------------------------------------------------ // Get number of rows and columns //------------------------------------------------------------------ int OsiXprSolverInterface::getNumCols() const { if ( !isDataLoaded() ) return 0; int ncols; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_ORIGINALCOLS, &ncols) ); return ncols; } //----------------------------------------------------------------------------- int OsiXprSolverInterface::getNumRows() const { if ( !isDataLoaded() ) return 0; int nrows; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_ORIGINALROWS, &nrows) ); return nrows; } //----------------------------------------------------------------------------- int OsiXprSolverInterface::getNumElements() const { if ( !isDataLoaded() ) return 0; int retVal; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_ELEMS, &retVal) ); return retVal; } //------------------------------------------------------------------ // Get pointer to rim vectors //------------------------------------------------------------------ const double * OsiXprSolverInterface::getColLower() const { if ( collower_ == NULL ) { if ( isDataLoaded() ) { int ncols = getNumCols(); if ( ncols > 0 ) { collower_ = new double[ncols]; XPRS_CHECKED( XPRSgetlb, (prob_,collower_, 0, ncols - 1) ); } } } return collower_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getColUpper() const { if ( colupper_ == NULL ) { if ( isDataLoaded() ) { int ncols = getNumCols(); if ( ncols > 0 ) { colupper_ = new double[ncols]; XPRS_CHECKED( XPRSgetub, (prob_,colupper_, 0, ncols - 1) ); } } } return colupper_; } //----------------------------------------------------------------------------- const char * OsiXprSolverInterface::getRowSense() const { if ( rowsense_ == NULL ) { if ( isDataLoaded() ) { int nrows = getNumRows(); if ( nrows > 0 ) { rowsense_ = new char[nrows]; XPRS_CHECKED( XPRSgetrowtype, (prob_,rowsense_, 0, nrows - 1) ); } } } return rowsense_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getRightHandSide() const { if ( rhs_ == NULL ) { if ( isDataLoaded() ) { int nrows = getNumRows(); if ( nrows > 0 ) { rhs_ = new double[nrows]; XPRS_CHECKED( XPRSgetrhs, (prob_,rhs_, 0, nrows - 1) ); // Make sure free rows have rhs of zero const char * rs = getRowSense(); int nr = getNumRows(); int i; for ( i = 0; i < nr; i++ ) { if ( rs[i] == 'N' ) rhs_[i]=0.0; } } } } return rhs_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getRowRange() const { if ( rowrange_ == NULL ) { if ( isDataLoaded() ) { int nrows = getNumRows(); if ( nrows > 0 ) { rowrange_ = new double[nrows]; XPRS_CHECKED( XPRSgetrhsrange, (prob_,rowrange_, 0, nrows - 1) ); // Make sure non-R rows have range of 0.0 // XPRESS seems to set N and L rows to a range of Infinity const char * rs = getRowSense(); int nr = getNumRows(); int i; for ( i = 0; i < nr; i++ ) { if ( rs[i] != 'R' ) rowrange_[i] = 0.0; } } } } return rowrange_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getRowLower() const { if ( rowlower_ == NULL ) { int nrows = getNumRows(); const char *rowsense = getRowSense(); const double *rhs = getRightHandSide(); const double *rowrange = getRowRange(); if ( nrows > 0 ) { rowlower_ = new double[nrows]; double dum1; for ( int i = 0; i < nrows; i++ ) { convertSenseToBound(rowsense[i], rhs[i], rowrange[i], rowlower_[i], dum1); } } } return rowlower_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getRowUpper() const { if ( rowupper_ == NULL ) { int nrows = getNumRows(); const char *rowsense = getRowSense(); const double *rhs = getRightHandSide(); const double *rowrange = getRowRange(); if ( nrows > 0 ) { rowupper_ = new double[nrows]; double dum1; for ( int i = 0; i < nrows; i++ ) { convertSenseToBound(rowsense[i], rhs[i], rowrange[i], dum1, rowupper_[i]); } } } return rowupper_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getObjCoefficients() const { if ( objcoeffs_ == NULL ) { if ( isDataLoaded() ) { int ncols = getNumCols(); if ( ncols > 0 ) { objcoeffs_ = new double[ncols]; XPRS_CHECKED( XPRSgetobj, (prob_,objcoeffs_, 0, ncols - 1) ); } } } return objcoeffs_; } //----------------------------------------------------------------------------- double OsiXprSolverInterface::getObjSense() const { return objsense_; } //----------------------------------------------------------------------------- // Return information on integrality //----------------------------------------------------------------------------- bool OsiXprSolverInterface::isContinuous(int colNumber) const { getVarTypes(); //std::cerr <<"OsiXprSolverInterface::isContinuous " <colupper(); const double *collower = this->collower(); getVarTypes(); return isBinary(colNumber) && colupper[colNumber] != collower[colNumber]; } #endif //------------------------------------------------------------------ // Row and column copies of the matrix ... //------------------------------------------------------------------ const CoinPackedMatrix * OsiXprSolverInterface::getMatrixByRow() const { if ( matrixByRow_ == NULL ) { if ( isDataLoaded() ) { int nrows = getNumRows(); int ncols = getNumCols(); int nelems; XPRS_CHECKED( XPRSgetrows, (prob_,NULL, NULL, NULL, 0, &nelems, 0, nrows - 1) ); int *start = new int [nrows + 1]; int *length = new int [nrows]; int *index = new int [nelems]; double *element = new double[nelems]; XPRS_CHECKED( XPRSgetrows, (prob_,start, index, element, nelems, &nelems, 0, nrows - 1) ); std::adjacent_difference(start + 1, start + (nrows+1), length); matrixByRow_ = new CoinPackedMatrix(true,0,0); // (mjs) No gaps! // Gaps =><= presolve. matrixByRow_->assignMatrix(false /* not column ordered */, ncols, nrows, nelems, element, index, start, length); } else { matrixByRow_ = new CoinPackedMatrix(true,0,0); // (mjs) No gaps! matrixByRow_->reverseOrdering(); } } return matrixByRow_; } //----------------------------------------------------------------------------- const CoinPackedMatrix * OsiXprSolverInterface::getMatrixByCol() const { if ( matrixByCol_ == NULL ) { matrixByCol_ = new CoinPackedMatrix(*getMatrixByRow()); matrixByCol_->reverseOrdering(); } return matrixByCol_; } //------------------------------------------------------------------ // Get solver's value for infinity //------------------------------------------------------------------ double OsiXprSolverInterface::getInfinity() const { return XPRS_PLUSINFINITY; } //############################################################################# // Problem information methods (results) //############################################################################# const double * OsiXprSolverInterface::getColSolution() const { if ( colsol_ == NULL ) { if ( isDataLoaded() ) { int status; int nc = getNumCols(); if ( nc > 0 ) { colsol_ = new double[nc]; if( lastsolvewasmip ) { XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_MIPSTATUS, &status) ); if( status == XPRS_MIP_SOLUTION || status == XPRS_MIP_OPTIMAL ) XPRS_CHECKED( XPRSgetmipsol, (prob_,colsol_, NULL) ); else XPRS_CHECKED( XPRSgetlb, (prob_,colsol_, 0, nc-1) ); } else { XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); if( status == XPRS_LP_OPTIMAL ) XPRS_CHECKED( XPRSgetlpsol, (prob_,colsol_, NULL, NULL, NULL) ); else XPRS_CHECKED( XPRSgetlb, (prob_,colsol_, 0, nc-1) ); } } } } return colsol_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getRowPrice() const { if ( rowprice_ == NULL ) { if ( isDataLoaded() ) { int nr = getNumRows(); if ( nr > 0 ) { int status; rowprice_ = new double[nr]; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); if( status == XPRS_LP_OPTIMAL ) XPRS_CHECKED( XPRSgetlpsol, (prob_,NULL, NULL, rowprice_, NULL) ); else memset(rowprice_, 0, nr * sizeof(double)); } } } return rowprice_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getReducedCost() const { if ( colprice_ == NULL ) { if ( isDataLoaded() ) { int status; int nc = getNumCols(); colprice_ = new double[nc]; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); if( status == XPRS_LP_OPTIMAL ) XPRS_CHECKED( XPRSgetlpsol, (prob_,NULL, NULL,NULL, colprice_) ); else memset(colprice_, 0, nc * sizeof(double)); } } return colprice_; } //----------------------------------------------------------------------------- const double * OsiXprSolverInterface::getRowActivity() const { if( rowact_ == NULL ) { if ( isDataLoaded() ) { int nrows = getNumRows(); if( nrows > 0 ) { int status; int i; const double* rhs = getRightHandSide(); rowact_ = new double[nrows]; if( lastsolvewasmip ) { XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_MIPSTATUS, &status) ); if( status == XPRS_MIP_SOLUTION || status == XPRS_MIP_OPTIMAL ) { XPRS_CHECKED( XPRSgetmipsol, (prob_,NULL,rowact_) ); for ( i = 0; i < nrows; i++ ) rowact_[i] = rhs[i] - rowact_[i]; } else memset(rowact_, 0, nrows * sizeof(double)); } else { XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); if( status == XPRS_LP_OPTIMAL ) { XPRS_CHECKED( XPRSgetlpsol, (prob_,NULL, rowact_, NULL, NULL) ); for ( i = 0; i < nrows; i++ ) rowact_[i] = rhs[i] - rowact_[i]; } else memset(rowact_, 0, nrows * sizeof(double)); } #if 0 /* OPEN: why do we need the presolve state here ??? */ XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_PRESOLVESTATE, &status) ); if ( status == 7 ) { int i; XPRS_CHECKED( XPRSgetsol, (prob_,NULL, rowact_, NULL, NULL) ); for ( i = 0; i < nrows; i++ ) rowact_[i] = rhs[i] - rowact_[i]; } else { CoinFillN(rowact_, nrows, 0.0); } #endif } } } return rowact_; } //----------------------------------------------------------------------------- double OsiXprSolverInterface::getObjValue() const { double objvalue = 0; double objconstant = 0; if ( isDataLoaded() ) { int status; if( lastsolvewasmip ) { XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_MIPSTATUS, &status) ); if( status == XPRS_MIP_SOLUTION || status == XPRS_MIP_OPTIMAL ) XPRS_CHECKED( XPRSgetdblattrib, (prob_, XPRS_MIPOBJVAL, &objvalue) ); else objvalue = CoinPackedVector(getNumCols(), getObjCoefficients()).dotProduct(getColSolution()); } else { XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_LPSTATUS, &status) ); if( status == XPRS_LP_OPTIMAL ) XPRS_CHECKED( XPRSgetdblattrib, (prob_, XPRS_LPOBJVAL, &objvalue) ); else objvalue = CoinPackedVector(getNumCols(), getObjCoefficients()).dotProduct(getColSolution()); } OsiSolverInterface::getDblParam(OsiObjOffset, objconstant); // Constant offset is not saved with the xpress representation, // but it has to be returned from here anyway. } return objvalue - objconstant; } //----------------------------------------------------------------------------- int OsiXprSolverInterface::getIterationCount() const { int itcnt; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_SIMPLEXITER, &itcnt) ); return itcnt; } //----------------------------------------------------------------------------- std::vector OsiXprSolverInterface::getDualRays(int maxNumRays, bool fullRay) const { // *FIXME* : must write the method -LL throw CoinError("method is not yet written", "getDualRays", "OsiXprSolverInterface"); return std::vector(); } //----------------------------------------------------------------------------- std::vector OsiXprSolverInterface::getPrimalRays(int maxNumRays) const { #if 0 // *FIXME* : Still need to expand column into full ncols-length vector const int nrows = getNumRows(); int nrspar; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_SPAREROWS, &nrspar) ); int junb; int retcode; retcode = XPRSgetunbvec(prob_,&junb); if ( retcode != 0 ) return std::vector(0, (double *) NULL);; double *ray = new double[nrows]; if ( junb < nrows ) { // it's a slack int i; for ( i = 0; i < nrows; i++ ) ray[i] = 0.0; ray[junb] = 1.0; XPRS_CHECKED( XPRSftran, (prob_,ray) ); } else if ( junb >= nrows + nrspar && junb < nrows + nrspar + getNumCols() ){ // it's a structural variable int *mstart = new int[nrows]; int *mrowind = new int[nrows]; double *dmatval = new double[nrows]; int nelt; int jcol = junb - nrows - nrspar; XPRS_CHECKED( XPRSgetcols, (prob_,mstart, mrowind, dmatval, nrows, &nelt, jcol, jcol) ); /* Unpack into the zeroed array y */ int i, ielt; for ( i = 0; i < nrows; i++ ) ray[i] = 0.0; for ( ielt = 0; ielt < nelt; ielt++ ) ray[mrowind[ielt]] = dmatval[ielt]; XPRS_CHECKED( XPRSftran, (prob_,ray) ); delete [] mstart; delete [] mrowind; delete [] dmatval; } else { // it's an error retcode = 1; } if ( retcode == 0 ) return std::vector(1, ray); else { delete ray; return std::vector(0, (double *) NULL); } #endif // *FIXME* : must write the method -LL throw CoinError("method is not yet written", "getPrimalRays", "OsiXprSolverInterface"); return std::vector(); } //----------------------------------------------------------------------------- #if 0 OsiVectorInt OsiXprSolverInterface::getFractionalIndices(const double etol) const { OsiVectorInt retVal; int numInts = numintvars(); const double *sol = colsol(); getVarTypes(); OsiRelFltEq eq(etol); for ( int i = 0; i < numInts; i++ ) { double colSolElem = sol[ivarind_[i]]; double distanceFromInteger = colSolElem - floor(colSolElem + 0.5); if ( !eq( distanceFromInteger, 0.0 ) ) retVal.push_back(ivarind_[i]); } return retVal; } #endif //############################################################################# // Problem modifying methods (rim vectors) //############################################################################# void OsiXprSolverInterface::setObjCoeff( int elementIndex, double elementValue ) { if ( isDataLoaded() ) { XPRS_CHECKED( XPRSchgobj, (prob_,1, &elementIndex, &elementValue) ); freeCachedResults(); } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setColLower( int elementIndex, double elementValue ) { if ( isDataLoaded() ) { char boundType = 'L'; getVarTypes(); if ( vartype_ && vartype_[elementIndex] == 'B' && (elementValue != 0.0 && elementValue != 1.0) ) { char elementType = 'I'; XPRS_CHECKED( XPRSchgcoltype, (prob_,1, &elementIndex, &elementType) ); } XPRS_CHECKED( XPRSchgbounds, (prob_,1, &elementIndex, &boundType, &elementValue) ); freeCachedResults(); // delete [] collower_; // collower_ = NULL; } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setColUpper( int elementIndex, double elementValue ) { if ( isDataLoaded() ) { char boundType = 'U'; getVarTypes(); XPRS_CHECKED( XPRSchgbounds, (prob_,1, &elementIndex, &boundType, &elementValue) ); if ( vartype_ && vartype_[elementIndex] == 'B' && (elementValue != 0.0 && elementValue != 1.0) ) { char elementType = 'I'; XPRS_CHECKED( XPRSchgcoltype, (prob_,1, &elementIndex, &elementType) ); } freeCachedResults(); // delete [] colupper_; // colupper_ = NULL; } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setColBounds(const int elementIndex, double lower, double upper ) { if ( isDataLoaded() ) { char qbtype[2] = { 'L', 'U' }; int mindex[2]; double bnd[2]; getVarTypes(); mindex[0] = elementIndex; mindex[1] = elementIndex; bnd[0] = lower; bnd[1] = upper; XPRS_CHECKED( XPRSchgbounds, (prob_,2, mindex, qbtype, bnd) ); if ( vartype_ && vartype_[mindex[0]] == 'B' && !((lower == 0.0 && upper == 0.0) || (lower == 1.0 && upper == 1.0) || (lower == 0.0 && upper == 1.0)) ) { char elementType = 'I'; XPRS_CHECKED( XPRSchgcoltype, (prob_,1, &mindex[0], &elementType) ); } freeCachedResults(); // delete [] colupper_; // colupper_ = NULL; } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { OsiSolverInterface::setColSetBounds(indexFirst, indexLast, boundList); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setRowLower( int elementIndex, double elementValue ) { double rhs = getRightHandSide()[elementIndex]; double range = getRowRange()[elementIndex]; char sense = getRowSense()[elementIndex]; double lower = 0, upper = 0; convertSenseToBound(sense, rhs, range, lower, upper); if( lower != elementValue ) { convertBoundToSense(elementValue, upper, sense, rhs, range); setRowType(elementIndex, sense, rhs, range); // freeCachedResults(); --- invoked in setRowType() } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setRowUpper( int elementIndex, double elementValue ) { double rhs = getRightHandSide()[elementIndex]; double range = getRowRange()[elementIndex]; char sense = getRowSense()[elementIndex]; double lower = 0, upper = 0; convertSenseToBound( sense, rhs, range, lower, upper ); if( upper != elementValue ) { convertBoundToSense(lower, elementValue, sense, rhs, range); setRowType(elementIndex, sense, rhs, range); // freeCachedResults(); --- invoked in setRowType() } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setRowBounds( int elementIndex, double lower, double upper ) { double rhs, range; char sense; convertBoundToSense( lower, upper, sense, rhs, range ); setRowType( elementIndex, sense, rhs, range ); // freeCachedRowRim(); --- invoked in setRowType() } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setRowType(int index, char sense, double rightHandSide, double range) { if ( isDataLoaded() ) { int mindex[1] = {index}; char qrtype[1] = {sense}; double rhs[1] = {rightHandSide}; double rng[1] = {range}; XPRS_CHECKED( XPRSchgrowtype, (prob_,1, mindex, qrtype) ); XPRS_CHECKED( XPRSchgrhs, (prob_,1, mindex, rhs) ); // range is properly defined only for range-type rows, so we call XPRSchgrhsrange only for ranged rows if (sense == 'R') XPRS_CHECKED( XPRSchgrhsrange, (prob_,1, mindex, rng) ); freeCachedResults(); } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { OsiSolverInterface::setRowSetBounds(indexFirst, indexLast, boundList); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList) { OsiSolverInterface::setRowSetTypes(indexFirst, indexLast, senseList, rhsList, rangeList); } //############################################################################# void OsiXprSolverInterface::setContinuous(int index) { if ( isDataLoaded() ) { int pstat; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_PRESOLVESTATE, &pstat) ); if ( (pstat & 6) == 0 ) { // not presolved char qctype = 'C'; XPRS_CHECKED( XPRSchgcoltype, (prob_,1, &index, &qctype) ); freeCachedResults(); } } } void OsiXprSolverInterface::setInteger(int index) { if ( isDataLoaded() ) { int pstat; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_PRESOLVESTATE, &pstat) ); if ( (pstat & 6) == 0 ) { // not presolved char qctype; if ( getColLower()[index] == 0.0 && getColUpper()[index] == 1.0 ) qctype = 'B'; else qctype = 'I'; XPRS_CHECKED( XPRSchgcoltype, (prob_,1, &index, &qctype) ); freeCachedResults(); } } } void OsiXprSolverInterface::setContinuous(const int* indices, int len) { if ( isDataLoaded() ) { int pstat; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_PRESOLVESTATE, &pstat) ); if ( (pstat & 6) == 0 ) { // not presolved char *qctype = new char[len]; CoinFillN(qctype, len, 'C'); XPRS_CHECKED( XPRSchgcoltype, (prob_,len, const_cast(indices), qctype) ); freeCachedResults(); delete[] qctype; } } } void OsiXprSolverInterface::setInteger(const int* indices, int len) { if ( isDataLoaded() ) { int pstat; XPRS_CHECKED( XPRSgetintattrib, (prob_,XPRS_PRESOLVESTATE, &pstat) ); if ( (pstat & 6) == 0 ) { // not presolved char *qctype = new char[len]; const double* clb = getColLower(); const double* cub = getColUpper(); for ( int i = 0; i < len; i++ ) { if ( clb[indices[i]] == 0.0 && cub[indices[i]] == 1.0 ) qctype[i] = 'B'; else qctype[i] = 'I'; } XPRS_CHECKED( XPRSchgcoltype, (prob_,len, const_cast(indices), qctype) ); freeCachedResults(); delete[] qctype; } } } //############################################################################# void OsiXprSolverInterface::setObjSense(double s) { assert(s == 1.0 || s == -1.0); objsense_ = s; XPRS_CHECKED( XPRSchgobjsense, (prob_, (int)s) ); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setColSolution(const double *colsol) { freeSolution(); colsol_ = new double[getNumCols()]; for ( int i = 0; i < getNumCols(); i++ ) colsol_[i] = colsol[i]; } //----------------------------------------------------------------------------- void OsiXprSolverInterface::setRowPrice(const double *rowprice) { freeSolution(); rowprice_ = new double[getNumRows()]; for ( int i = 0; i < getNumRows(); i++ ) rowprice_[i] = rowprice[i]; } //############################################################################# // Problem modifying methods (matrix) //############################################################################# void OsiXprSolverInterface::addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) { if ( isDataLoaded() ) { freeCachedResults(); int mstart = 0; XPRS_CHECKED( XPRSaddcols, (prob_,1, vec.getNumElements(), const_cast(&obj), &mstart, const_cast(vec.getIndices()), const_cast(vec.getElements()), const_cast(&collb), const_cast(&colub)) ); } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj) { // freeCachedResults(); for( int i = 0; i < numcols; i++ ) addCol( *(cols[i]), collb[i], colub[i], obj[i] ); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::deleteCols(const int num, const int *columnIndices) { freeCachedResults(); XPRS_CHECKED( XPRSdelcols, (prob_,num, const_cast(columnIndices)) ); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub) { // freeCachedResults(); -- will be invoked char sense; double rhs, range; convertBoundToSense(rowlb, rowub, sense, rhs, range); addRow(vec, sense, rhs, range); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) { freeCachedResults(); int mstart[2] = {0, vec.getNumElements()}; XPRS_CHECKED( XPRSaddrows, (prob_,1, vec.getNumElements(), const_cast(&rowsen), const_cast(&rowrhs), const_cast(&rowrng), mstart, const_cast(vec.getIndices()), const_cast(vec.getElements())) ); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub) { // *FIXME* : must write the method -LL throw CoinError("method is not yet written", "addRows", "OsiXprSolverInterface"); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng) { // *FIXME* : must write the method -LL throw CoinError("method is not yet written", "addRows", "OsiXprSolverInterface"); } //----------------------------------------------------------------------------- void OsiXprSolverInterface::deleteRows(const int num, const int * rowIndices) { freeCachedResults(); XPRS_CHECKED( XPRSdelrows, (prob_,num, const_cast(rowIndices)) ); } //############################################################################# // Methods to input a problem //############################################################################# void OsiXprSolverInterface::loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub) { const double inf = getInfinity(); char * rowSense = new char [matrix.getNumRows()]; double * rowRhs = new double[matrix.getNumRows()]; double * rowRange = new double[matrix.getNumRows()]; int i; for ( i = matrix.getNumRows() - 1; i >= 0; --i) { double rlb; if ( rowlb!=NULL ) rlb = rowlb[i]; else rlb = -inf; double rub; if ( rowub!=NULL ) rub = rowub[i]; else rub = inf; convertBoundToSense(rlb,rub,rowSense[i],rowRhs[i],rowRange[i]); #if 0 if ( rlb==rub ) { rowSense[i]='E'; rowRhs[i] =rlb; rowRange[i]=0.0; continue; } if ( rlb<=-inf && rub>=inf ) { rowSense[i]='N'; rowRhs[i] =inf; rowRange[i]=0.0; continue; } if ( rlb<=-inf && !(rub>=inf) ) { rowSense[i]='L'; rowRhs[i] =rub; rowRange[i]=0.0; continue; } if ( !(rlb<=-inf) && rub>=inf ) { rowSense[i]='G'; rowRhs[i] =rlb; rowRange[i]=0.0; continue; } if ( !(rlb<=-inf) && !(rub>=inf) ) { rowSense[i]='R'; rowRhs[i] =rub; rowRange[i]=rub-rlb; continue; } #endif } loadProblem(matrix, collb, colub, obj, rowSense, rowRhs, rowRange ); delete [] rowSense; delete [] rowRhs; delete [] rowRange; } //----------------------------------------------------------------------------- void OsiXprSolverInterface::assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub) { loadProblem(*matrix, collb, colub, obj, rowlb, rowub); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowlb; rowlb = 0; delete[] rowub; rowub = 0; } //----------------------------------------------------------------------------- // #define OSIXPR_ADD_OBJ_ROW void OsiXprSolverInterface::loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng) { freeCachedResults(); int i; char* rsen; double* rrhs; // Set column values to defaults if NULL pointer passed int nc=matrix.getNumCols(); int nr=matrix.getNumRows(); double * clb; double * cub; double * ob; if ( collb!=NULL ) { clb=const_cast(collb); } else { clb = new double[nc]; for( i=0; i(colub); else { cub = new double[nc]; for( i=0; i(obj); else { ob = new double[nc]; for( i=0; i(rowsen); else { rsen = new char[nr]; for( i = 0; i < nr; ++i ) rsen[i] = 'G'; } if ( rowrhs != NULL ) rrhs = const_cast(rowrhs); else { rrhs = new double[nr]; for( i = 0; i < nr; ++i ) rrhs[i] = 0.0; } bool freeMatrixRequired = false; CoinPackedMatrix * m = NULL; if ( !matrix.isColOrdered() ) { m = new CoinPackedMatrix(true,0,0); // (mjs) No gaps! m->reverseOrderedCopyOf(matrix); freeMatrixRequired = true; } else { m = const_cast(&matrix); } // Generate a problem name char probName[256]; sprintf(probName, "Prob%i", osiSerial_); nc = m->getNumCols(); nr = m->getNumRows(); if ( getLogFilePtr()!=NULL ) { fprintf(getLogFilePtr(),"{\n"); fprintf(getLogFilePtr()," char rowsen[%d];\n",nr); for ( i=0; igetVectorStarts()[i]); fprintf(getLogFilePtr()," int vectorLengths[%d];\n",nc); for ( i=0; igetVectorLengths()[i]); fprintf(getLogFilePtr()," int indices[%d];\n",m->getVectorStarts()[nc]); for ( i=0; igetVectorStarts()[nc]; i++ ) fprintf(getLogFilePtr()," indices[%d]=%d;\n",i,m->getIndices()[i]); fprintf(getLogFilePtr()," double elements[%d];\n",m->getVectorStarts()[nc]); for ( i=0; igetVectorStarts()[nc]; i++ ) fprintf(getLogFilePtr()," elements[%d]=%f;\n",i,m->getElements()[i]); fprintf(getLogFilePtr(),"}\n"); } int iret = XPRSloadlp( prob_, probName, nc, nr, const_cast(rsen), const_cast(rrhs), const_cast(rowrng), ob, const_cast(m->getVectorStarts()), const_cast(m->getVectorLengths()), const_cast(m->getIndices()), const_cast(m->getElements()), clb, cub ); setStrParam(OsiProbName,probName); if ( iret != 0 ) XPRSgetintattrib(prob_,XPRS_ERRORCODE, &iret); assert( iret == 0 ); char pname[256]; // Problem names can be 200 chars in XPRESS 12 XPRS_CHECKED( XPRSgetprobname,(prob_,pname) ); xprProbname_ = pname; if ( collb==NULL ) delete[] clb; if ( colub==NULL ) delete[] cub; if ( obj ==NULL ) delete[] ob; if ( rowsen==NULL ) delete[] rsen; if ( rowrhs==NULL ) delete[] rrhs; if (freeMatrixRequired) { delete m; } } //----------------------------------------------------------------------------- void OsiXprSolverInterface::assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng) { loadProblem(*matrix, collb, colub, obj, rowsen, rowrhs, rowrng); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowsen; rowsen = 0; delete[] rowrhs; rowrhs = 0; delete[] rowrng; rowrng = 0; } //----------------------------------------------------------------------------- void OsiXprSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { const double inf = getInfinity(); char * rowSense = new char [numrows]; double * rowRhs = new double[numrows]; double * rowRange = new double[numrows]; for ( int i = numrows - 1; i >= 0; --i ) { const double lower = rowlb ? rowlb[i] : -inf; const double upper = rowub ? rowub[i] : inf; convertBoundToSense( lower, upper, rowSense[i], rowRhs[i], rowRange[i] ); } loadProblem(numcols, numrows, start, index, value, collb, colub, obj, rowSense, rowRhs, rowRange); delete [] rowSense; delete [] rowRhs; delete [] rowRange; } //----------------------------------------------------------------------------- void OsiXprSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { freeCachedResults(); int i; // Set column values to defaults if NULL pointer passed int nc = numcols; int nr = numrows; int * len = new int[nc+1]; double * clb; double * cub; double * ob; char* rsen; double* rrhs; std::adjacent_difference(start, start + (nc+1), len); if ( collb!=NULL ) { clb=const_cast(collb); } else { clb = new double[nc]; for( i=0; i(colub); else { cub = new double[nc]; for( i=0; i(obj); else { ob = new double[nc]; for( i=0; i(rowsen); else { rsen = new char[nr]; for( i = 0; i < nr; ++i ) rsen[i] = 'G'; } if ( rowrhs != NULL ) rrhs = const_cast(rowrhs); else { rrhs = new double[nr]; for( i = 0; i < nr; ++i ) rrhs[i] = 0.0; } // Generate a problem name char probName[256]; sprintf(probName, "Prob%i", osiSerial_); if ( getLogFilePtr()!=NULL ) { fprintf(getLogFilePtr(),"{\n"); fprintf(getLogFilePtr()," char rowsen[%d];\n",nr); for ( i=0; i(rsen), const_cast(rrhs), const_cast(rowrng), ob, const_cast(start), const_cast(len+1), const_cast(index), const_cast(value), clb, cub ); setStrParam(OsiProbName,probName); if ( iret != 0 ) XPRSgetintattrib(prob_,XPRS_ERRORCODE, &iret); assert( iret == 0 ); char pname[256]; // Problem names can be 200 chars in XPRESS 12 XPRS_CHECKED( XPRSgetprobname, (prob_,pname) ); xprProbname_ = pname; if ( collb == NULL ) delete[] clb; if ( colub == NULL ) delete[] cub; if ( obj == NULL ) delete[] ob; if ( rowsen== NULL ) delete[] rsen; if ( rowrhs== NULL ) delete[] rrhs; delete[] len; } //----------------------------------------------------------------------------- // Read mps files //----------------------------------------------------------------------------- int OsiXprSolverInterface::readMps(const char *filename, const char *extension) { #if 0 if (getLogFilePtr()!=NULL) { fprintf(getLogFilePtr(),"{\n"); fprintf(getLogFilePtr()," XPRSreadprob(prob_,\"%s\");\n",filename); fprintf(getLogFilePtr()," int namlen;\n"); fprintf(getLogFilePtr()," XPRSgetintcontrol(prob_,XPRS_NAMELENGTH,&namlen);\n"); fprintf(getLogFilePtr()," namlen *= 8;\n"); } // Read Mps file. // XPRESS generates its own file extensions, so we ignore any supplied. int iret = XPRSreadprob(prob_,filename); if ( iret != 0 ) XPRSgetintattrib(prob_,XPRS_ERRORCODE, &iret); assert( iret == 0 ); // Get length of Mps names int namlen; XPRSgetintattrib(prob_,XPRS_NAMELENGTH, &namlen); namlen *= 8; if (getLogFilePtr()!=NULL) { fprintf(getLogFilePtr()," char objRowName[%d],rowName[%d];\n",namlen,namlen); fprintf(getLogFilePtr()," XPRSgetstrcontrol(prob_,XPRS_MPSOBJNAME, objRowName);\n"); fprintf(getLogFilePtr()," int nr;\n"); fprintf(getLogFilePtr()," XPRSsetintcontrol(prob_,XPRS_ROWS, &nr);"); } // Allocate space to hold row names. char * objRowName = new char[namlen+1]; char * rowName = new char[namlen+1]; // Get name of objective row. // If "" returned, then first N row is objective row XPRSgetstrcontrol(prob_,XPRS_MPSOBJNAME,objRowName); // Get number of rows int nr; XPRSgetintattrib(prob_,XPRS_ROWS, &nr); if (getLogFilePtr()!=NULL) { fprintf(getLogFilePtr()," char rs[%d];\n",nr); fprintf(getLogFilePtr()," XPRSgetrowtype(prob_,rs, 0, %d);\n",nr-1); } // Get row sense. char * rs = new char[nr]; XPRSgetrowtype(prob_,rs, 0, nr - 1); // Loop once for each row looking for objective row int i; for ( i=0; i 0 && newnz > 0 ) { XPRS_CHECKED( XPRSsetintcontrol,(prob_,XPRS_EXTRAROWS, newrows) ); XPRS_CHECKED( XPRSsetintcontrol, (prob_,XPRS_EXTRAELEMS, newnz) ); } } //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiSolverInterface * OsiXprSolverInterface::clone(bool copyData) const { return (new OsiXprSolverInterface(*this)); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiXprSolverInterface:: OsiXprSolverInterface (const OsiXprSolverInterface & source) : OsiSolverInterface(source), prob_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), colupper_(NULL), collower_(NULL), rowupper_(NULL), rowlower_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), objcoeffs_(NULL), objsense_(source.objsense_), colsol_(NULL), rowsol_(NULL), rowact_(NULL), rowprice_(NULL), colprice_(NULL), ivarind_(NULL), ivartype_(NULL), vartype_(NULL), domipstart(false) { incrementInstanceCounter(); xprProbname_ = ""; gutsOfConstructor(); gutsOfCopy(source); // Other values remain NULL until requested } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiXprSolverInterface::~OsiXprSolverInterface () { gutsOfDestructor(); XPRSdestroyprob(prob_); decrementInstanceCounter(); } //------------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiXprSolverInterface & OsiXprSolverInterface::operator=(const OsiXprSolverInterface& rhs) { if ( this != &rhs ) { OsiSolverInterface::operator=(rhs); osiSerial_++; // even though numInstances_ doesn't change gutsOfDestructor(); gutsOfCopy(rhs); } return *this; } //############################################################################# // Applying cuts //############################################################################# void OsiXprSolverInterface::applyColCut( const OsiColCut & cc ) { const double *collower = getColLower(); const double *colupper = getColUpper(); const CoinPackedVector & lbs = cc.lbs(); const CoinPackedVector & ubs = cc.ubs(); int *index = new int [lbs.getNumElements() + ubs.getNumElements()]; char *btype = new char [lbs.getNumElements() + ubs.getNumElements()]; double *value = new double[lbs.getNumElements() + ubs.getNumElements()]; int i, nbds; for ( i = nbds = 0; i < lbs.getNumElements(); i++, nbds++ ) { index[nbds] = lbs.getIndices()[i]; btype[nbds] = 'L'; value[nbds] = (collower[index[nbds]] > lbs.getElements()[i]) ? collower[index[nbds]] : lbs.getElements()[i]; } for ( i = 0; i < ubs.getNumElements(); i++, nbds++ ) { index[nbds] = ubs.getIndices()[i]; btype[nbds] = 'U'; value[nbds] = (colupper[index[nbds]] < ubs.getElements()[i]) ? colupper[index[nbds]] : ubs.getElements()[i]; } if (getLogFilePtr()!=NULL) { fprintf(getLogFilePtr(),"{\n"); fprintf(getLogFilePtr()," int index[%d];\n",nbds); fprintf(getLogFilePtr()," char btype[%d];\n",nbds); fprintf(getLogFilePtr()," double value[%d];\n",nbds); for ( i=0; i(row.getIndices()), const_cast(row.getElements())); assert( rc == 0 ); freeCachedResults(); } //############################################################################# // Private methods //############################################################################# void OsiXprSolverInterface::gutsOfCopy( const OsiXprSolverInterface & source ) { if ( source.xprProbname_ != "" ) { // source has data std::ostringstream pname; pname << xprProbname_ << "#" << osiSerial_ <<'\0'; xprProbname_ = pname.str(); // sprintf(xprProbname_, "%s#%d", source.xprProbname_, osiSerial_); // std::cout << "Problem " << xprProbname_ << " copied to matrix "; XPRS_CHECKED( XPRScopyprob, ( prob_, source.prob_, xprProbname_.c_str() ) ); XPRS_CHECKED( XPRScopycontrols, ( prob_, source.prob_ ) ); /* if the callbacks are used, a XPRScopycallbacks needs to be added */ } } //------------------------------------------------------------------- void OsiXprSolverInterface::gutsOfConstructor() { XPRS_CHECKED( XPRScreateprob, (&prob_) ); XPRS_CHECKED( XPRSsetcbmessage, (prob_, OsiXprMessageCallback, messageHandler()) ); /* always create an empty problem to initialize all data structures * since the user had no chance to pass in his own message handler, we turn off the output for the following operation */ int outputlog; XPRS_CHECKED( XPRSgetintcontrol, (prob_, XPRS_OUTPUTLOG, &outputlog) ); XPRS_CHECKED( XPRSsetintcontrol, (prob_, XPRS_OUTPUTLOG, 0) ); int istart = 0; XPRS_CHECKED( XPRSloadlp, ( prob_, "empty", 0, 0, NULL, NULL, NULL, NULL, &istart, NULL, NULL, NULL, NULL, NULL) ); XPRS_CHECKED( XPRSchgobjsense, (prob_, (int)objsense_) ); XPRS_CHECKED( XPRSsetintcontrol, (prob_, XPRS_OUTPUTLOG, outputlog) ); //OPEN: only switched off for debugging //XPRS_CHECKED( XPRSsetlogfile, (prob_,"xpress.log") ); // **FIXME** (mjs) Integer problems require solution file or callback to save // optimal solution. The quick fix is to leave the default solutionfile setting, // but implementing a callback would be better. // XPRS_CHECKED( XPRSsetintcontrol, (prob_, XPRS_SOLUTIONFILE,0) ); // XPRS_CHECKED( XPRSsetintcontrol, ( prob_, XPRS_PRESOLVE, 0) ); lastsolvewasmip = false; } //------------------------------------------------------------------- void OsiXprSolverInterface::gutsOfDestructor() { freeCachedResults(); assert(matrixByRow_ == NULL); assert(matrixByCol_ == NULL); assert(colupper_ == NULL); assert(collower_ == NULL); assert(rowupper_ == NULL); assert(rowlower_ == NULL); assert(rowsense_ == NULL); assert(rhs_ == NULL); assert(rowrange_ == NULL); assert(objcoeffs_ == NULL); assert(colsol_ == NULL); assert(rowsol_ == NULL); assert(rowprice_ == NULL); assert(colprice_ == NULL); assert(rowact_ == NULL); assert(vartype_ == NULL); } //------------------------------------------------------------------- void OsiXprSolverInterface::freeSolution() { delete [] colsol_; colsol_ = NULL; delete [] rowsol_; rowsol_ = NULL; delete [] rowact_; rowact_ = NULL; delete [] rowprice_; rowprice_ = NULL; delete [] colprice_; colprice_ = NULL; } //------------------------------------------------------------------- void OsiXprSolverInterface::freeCachedResults() { delete matrixByRow_; matrixByRow_ = NULL; delete matrixByCol_; matrixByCol_ = NULL; delete [] colupper_; colupper_ = NULL; delete [] collower_; collower_ = NULL; delete [] rowupper_; rowupper_ = NULL; delete [] rowlower_; rowlower_ = NULL; delete [] rowsense_; rowsense_ = NULL; delete [] rhs_; rhs_ = NULL; delete [] rowrange_; rowrange_ = NULL; delete [] objcoeffs_; objcoeffs_ = NULL; freeSolution(); delete [] ivarind_; ivarind_ = NULL; delete [] ivartype_; ivartype_ = NULL; delete [] vartype_; vartype_ = NULL; } //------------------------------------------------------------------- // Set up lists of integer variables //------------------------------------------------------------------- int OsiXprSolverInterface::getNumIntVars() const { int nintvars = 0, nsets = 0; if ( isDataLoaded() ) { XPRS_CHECKED( XPRSgetglobal, (prob_,&nintvars, &nsets, NULL, NULL, NULL, NULL, NULL, NULL, NULL) ); } return nintvars; } void OsiXprSolverInterface::getVarTypes() const { int nintvars = getNumIntVars(); int nsets; int ncols = getNumCols(); if ( vartype_ == NULL && nintvars > 0 ) { if (getLogFilePtr()!=NULL) { fprintf(getLogFilePtr(),"{\n"); fprintf(getLogFilePtr()," int nintvars = %d;\n",nintvars); fprintf(getLogFilePtr()," int nsets;\n"); fprintf(getLogFilePtr()," char ivartype[%d];\n",nintvars); fprintf(getLogFilePtr()," char ivarind[%d];\n",nintvars); fprintf(getLogFilePtr(),"}\n"); } ivartype_ = new char[nintvars]; ivarind_ = new int[nintvars]; XPRS_CHECKED( XPRSgetglobal, (prob_,&nintvars, &nsets, ivartype_, ivarind_, NULL, NULL, NULL, NULL, NULL) ); // Currently, only binary and integer vars are supported. vartype_ = new char[ncols]; int i, j; for ( i = j = 0; j < ncols; j++ ) { if ( i < nintvars && j == ivarind_[i] ) { vartype_[j] = ivartype_[i]; i++; } else vartype_[j] = 'C'; } } } bool OsiXprSolverInterface::isDataLoaded() const { int istatus; XPRS_CHECKED( XPRSgetintattrib, ( prob_, XPRS_MIPSTATUS, &istatus ) ); istatus &= XPRS_MIP_NOT_LOADED; return istatus == 0; } //############################################################################# Osi-0.106.4/src/OsiXpr/Makefile.am0000644000076600007660000000327411621722556015156 0ustar coincoin# Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1800 2011-08-14 10:37:34Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiXpr # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiXpr.la # List all source files for this library, including headers libOsiXpr_la_SOURCES = \ OsiXprSolverInterface.cpp OsiXprSolverInterface.hpp # This is for libtool (on Windows) libOsiXpr_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. # "top_srcdir" refers to the basic directory for the main package that is # being compiled. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ -I`$(CYGPATH_W) $(XPRINCDIR)` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiXprSolverInterface.hpp Osi-0.106.4/src/OsiXpr/OsiXprSolverInterface.hpp0000644000076600007660000007356011575423733020103 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef OsiXprSolverInterface_H #define OsiXprSolverInterface_H #include #include #include "OsiSolverInterface.hpp" typedef struct xo_prob_struct* XPRSprob; //############################################################################# /** XPRESS-MP Solver Interface Instantiation of OsiSolverInterface for XPRESS-MP */ class OsiXprSolverInterface : virtual public OsiSolverInterface { friend void OsiXprSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); public: /**@name Solve methods */ //@{ /// Solve initial LP relaxation virtual void initialSolve(); /// Resolve an LP relaxation after problem modification virtual void resolve(); /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound(); //@} /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. */ //@{ // Set an integer parameter bool setIntParam(OsiIntParam key, int value); // Set an double parameter bool setDblParam(OsiDblParam key, double value); // Set a string parameter bool setStrParam(OsiStrParam key, const std::string & value); // Get an integer parameter bool getIntParam(OsiIntParam key, int& value) const; // Get an double parameter bool getDblParam(OsiDblParam key, double& value) const; // Get a string parameter bool getStrParam(OsiStrParam key, std::string& value) const; // Set mipstart option (pass column solution to XPRESS before MIP start) void setMipStart(bool value) { domipstart = value; } // Get mipstart option value bool getMipStart() const { return domipstart; } //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there a numerical difficulties? virtual bool isAbandoned() const; /// Is optimality proven? virtual bool isProvenOptimal() const; /// Is primal infeasiblity proven? virtual bool isProvenPrimalInfeasible() const; /// Is dual infeasiblity proven? virtual bool isProvenDualInfeasible() const; /// Is the given primal objective limit reached? virtual bool isPrimalObjectiveLimitReached() const; /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const; //@} //--------------------------------------------------------------------------- /**@name WarmStart related methods */ //@{ /// Get empty warm start object CoinWarmStart *getEmptyWarmStart () const; /// Get warmstarting information virtual CoinWarmStart* getWarmStart() const; /** Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. */ virtual bool setWarmStart(const CoinWarmStart* warmstart); //@} //--------------------------------------------------------------------------- /**@name Hotstart related methods (primarily used in strong branching).
    The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there.
    NOTE: between hotstarted optimizations only bound changes are allowed. */ //@{ /// Create a hotstart point of the optimization process virtual void markHotStart(); /// Optimize starting from the hotstart virtual void solveFromHotStart(); /// Delete the snapshot virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem information methods These methods call the solver's query routines to return information about the problem referred to by the current object. Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /**@name Methods related to querying the input data */ //@{ /// Get number of columns virtual int getNumCols() const; /// Get number of rows virtual int getNumRows() const; /// Get number of nonzero elements virtual int getNumElements() const; /// Get pointer to array[getNumCols()] of column lower bounds virtual const double * getColLower() const; /// Get pointer to array[getNumCols()] of column upper bounds virtual const double * getColUpper() const; /** Get pointer to array[getNumRows()] of row constraint senses.
    • 'L': <= constraint
    • 'E': = constraint
    • 'G': >= constraint
    • 'R': ranged constraint
    • 'N': free constraint
    */ virtual const char * getRowSense() const; /** Get pointer to array[getNumRows()] of rows right-hand sides
    • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
    • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'N' then rhs()[i] == 0.0
    */ virtual const double * getRightHandSide() const; /** Get pointer to array[getNumRows()] of row ranges.
    • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
    • if rowsense()[i] != 'R' then rowrange()[i] is 0.0
    */ virtual const double * getRowRange() const; /// Get pointer to array[getNumRows()] of row lower bounds virtual const double * getRowLower() const; /// Get pointer to array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const; /// Get pointer to array[getNumCols()] of objective function coefficients virtual const double * getObjCoefficients() const; /// Get objective function sense (1 for min (default), -1 for max) virtual double getObjSense() const; /// Return true if variable is continuous virtual bool isContinuous(int colIndex) const; #if 0 /// Return true if variable is binary virtual bool isBinary(int colIndex) const; /** Return true if column is integer. Note: This function returns true if the the column is binary or a general integer. */ virtual bool isInteger(int colIndex) const; /// Return true if variable is general integer virtual bool isIntegerNonBinary(int colIndex) const; /// Return true if variable is binary and not fixed at either bound virtual bool isFreeBinary(int colIndex) const; #endif /// Get pointer to row-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByRow() const; /// Get pointer to column-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByCol() const; /// Get solver's value for infinity virtual double getInfinity() const; //@} /**@name Methods related to querying the solution */ //@{ /// Get pointer to array[getNumCols()] of primal solution vector virtual const double * getColSolution() const; /// Get pointer to array[getNumRows()] of dual prices virtual const double * getRowPrice() const; /// Get a pointer to array[getNumCols()] of reduced costs virtual const double * getReducedCost() const; /** Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector */ virtual const double * getRowActivity() const; /// Get objective function value virtual double getObjValue() const; /** Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. */ virtual int getIterationCount() const; /** Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.) The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay=false) const; /** Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.) NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getPrimalRays(int maxNumRays) const; #if 0 /** Get vector of indices of solution which are integer variables presently at fractional values */ virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const; #endif //@} //@} //--------------------------------------------------------------------------- /**@name Problem modifying methods */ //@{ //------------------------------------------------------------------------- /**@name Changing bounds on variables and constraints */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff( int elementIndex, double elementValue ); /** Set a single column lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setColLower( int elementIndex, double elementValue ); /** Set a single column upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setColUpper( int elementIndex, double elementValue ); /** Set a single column lower and upper bound
    The default implementation just invokes setColLower() and setColUpper() */ virtual void setColBounds( int elementIndex, double lower, double upper ); /** Set the bounds on a number of columns simultaneously
    The default implementation just invokes setColLower() and setColUpper() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes @param boundList the new lower/upper bound pairs for the variables */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set a single row lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setRowLower( int elementIndex, double elementValue ); /** Set a single row upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setRowUpper( int elementIndex, double elementValue ); /** Set a single row lower and upper bound
    The default implementation just invokes setRowLower() and setRowUpper() */ virtual void setRowBounds( int elementIndex, double lower, double upper ); /** Set the type of a single row
    */ virtual void setRowType(int index, char sense, double rightHandSide, double range); /** Set the bounds on a number of rows simultaneously
    The default implementation just invokes setRowLower() and setRowUpper() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the constraints */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a number of rows simultaneously
    The default implementation just invokes setRowType() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the constraints whose any characteristics changes @param senseList the new senses @param rhsList the new right hand sides @param rangeList the new ranges */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); //@} //------------------------------------------------------------------------- /**@name Integrality related changing methods */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index); /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index); /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); //@} //------------------------------------------------------------------------- /// Set objective function sense (1 for min (default), -1 for max,) virtual void setObjSense(double s); /** Set the primal solution column values colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double * colsol); /** Set dual solution vector rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice); //------------------------------------------------------------------------- /**@name Methods to expand a problem.
    Note that if a column is added then by default it will correspond to a continuous variable. */ //@{ /** */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj); /** */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); /** */ virtual void deleteCols(const int num, const int * colIndices); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); /** */ virtual void deleteRows(const int num, const int * rowIndices); #if 0 //----------------------------------------------------------------------- /** Apply a collection of cuts.
    Only cuts which have an effectiveness >= effectivenessLb are applied.
    • ReturnCode.numberIneffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
    • ReturnCode.numberInconsistent() -- number of invalid cuts
    • ReturnCode.numberInconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
    • ReturnCode.numberInfeasible() -- number of cuts that would make this integer model infeasible
    • ReturnCode.numberApplied() -- number of integer cuts which were applied to the integer model
    • cs.size() == numberIneffective() + numberInconsistent() + numberInconsistentWrtIntegerModel() + numberInfeasible() + nubmerApplied()
    */ virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); //@} //@} #endif //--------------------------------------------------------------------------- /**@name Methods to input a problem */ //@{ /** Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • rowub: all rows have upper bound infinity
    • rowlb: all rows have lower bound -infinity
    • obj: all variables have 0 objective coefficient
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub); /** Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • obj: all variables have 0 objective coefficient
    • rowsen: all rows are >=
    • rowrhs: all right hand sides are 0
    • rowrng: 0 for the ranged rows
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Read an mps file from the given filename */ virtual int readMps(const char *filename, const char *extension = "mps"); /** Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants */ virtual void writeMps(const char *filename, const char *extension = "mps", double objSense=0.0) const; //@} /**@name Message handling */ //@{ /** Pass in a message handler It is the client's responsibility to destroy a message handler installed by this routine; it will not be destroyed when the solver interface is destroyed. */ void passInMessageHandler(CoinMessageHandler * handler); //@} //--------------------------------------------------------------------------- /**@name XPRESS specific public interfaces */ //@{ /**@name Static instance counter methods */ //@{ /** XPRESS has a context that must be created prior to all other XPRESS calls. This method:
    • Increments by 1 the number of uses of the XPRESS environment.
    • Creates the XPRESS context when the number of uses is changed to 1 from 0.
    */ static void incrementInstanceCounter(); /** XPRESS has a context that should be deleted after XPRESS calls. This method:
    • Decrements by 1 the number of uses of the XPRESS environment.
    • Deletes the XPRESS context when the number of uses is change to 0 from 1.
    */ static void decrementInstanceCounter(); /** Return the number of instances of instantiated objects using XPRESS services. */ static unsigned int getNumInstances(); /** Return a pointer to the XPRESS problem */ XPRSprob getLpPtr() { return prob_; } //@} /// Return XPRESS-MP Version number static int version(); /**@name Log File */ //@{ static int iXprCallCount_; /// Get logfile FILE * static FILE * getLogFilePtr(); /**Set logfile name. The logfile is an attempt to capture the calls to Xpress functions for debugging. */ static void setLogFileName( const char * filename ); //@} //@} /**@name Constructors and destructors */ //@{ /// Default Constructor OsiXprSolverInterface (int newrows = 50, int newnz = 100); /// Clone virtual OsiSolverInterface * clone(bool copyData = true) const; /// Copy constructor OsiXprSolverInterface (const OsiXprSolverInterface &); /// Assignment operator OsiXprSolverInterface & operator=(const OsiXprSolverInterface& rhs); /// Destructor virtual ~OsiXprSolverInterface (); //@} protected: /**@name Protected methods */ //@{ /// Apply a row cut. Return true if cut was applied. virtual void applyRowCut( const OsiRowCut & rc ); /** Apply a column cut (bound adjustment). Return true if cut was applied. */ virtual void applyColCut( const OsiColCut & cc ); //@} private: /**@name Private static class data */ //@{ /// Name of the logfile static const char * logFileName_; /// The FILE* to the logfile static FILE * logFilePtr_; /// Number of live problem instances static unsigned int numInstances_; /// Counts calls to incrementInstanceCounter() static unsigned int osiSerial_; //@} /**@name Private methods */ //@{ /// The real work of a copy constructor (used by copy and assignment) void gutsOfCopy( const OsiXprSolverInterface & source ); /// The real work of a constructor (used by construct and assignment) void gutsOfConstructor(); /// The real work of a destructor (used by copy and assignment) void gutsOfDestructor(); /// Destroy cached copy of solution data (whenever it changes) void freeSolution(); /** Destroy cached copies of problem and solution data (whenever they change) */ void freeCachedResults(); /// Number of integer variables in the problem int getNumIntVars() const; /**@name Methods to support for XPRESS-MP multiple matrix facility */ //@{ /// Build cached copy of variable types void getVarTypes() const; /** Save the current problem in XPRESS (if necessary) and make this problem current (restore if necessary). */ void activateMe() const; /** Save and restore are necessary if there is data associated with this problem. Also, queries to a problem with no data should respond sensibly; XPRESS query results are undefined. */ bool isDataLoaded() const; //@} //@} /**@name Private member data */ //@{ /**@name Data to support for XPRESS-MP multiple matrix facility */ //@{ mutable XPRSprob prob_; /// XPRESS problem name (should be unique for each saved problem) mutable std::string xprProbname_; //@} /**@name Cached copies of XPRESS-MP problem data */ //@{ /** Pointer to row-wise copy of problem matrix coefficients.
    Note that XPRESS keeps the objective row in the problem matrix, so row indices and counts are adjusted accordingly. */ mutable CoinPackedMatrix *matrixByRow_; mutable CoinPackedMatrix *matrixByCol_; /// Pointer to dense vector of structural variable upper bounds mutable double *colupper_; /// Pointer to dense vector of structural variable lower bounds mutable double *collower_; /// Pointer to dense vector of slack variable upper bounds mutable double *rowupper_; /// Pointer to dense vector of slack variable lower bounds mutable double *rowlower_; /// Pointer to dense vector of row sense indicators mutable char *rowsense_; /// Pointer to dense vector of row right-hand side values mutable double *rhs_; /** Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) */ mutable double *rowrange_; /// Pointer to dense vector of objective coefficients mutable double *objcoeffs_; /// Sense of objective (1 for min; -1 for max) mutable double objsense_; /// Pointer to dense vector of primal structural variable values mutable double *colsol_; /// Pointer to dense vector of primal slack variable values mutable double *rowsol_; /// Pointer to dense vector of primal slack variable values mutable double *rowact_; /// Pointer to dense vector of dual row variable values mutable double *rowprice_; /// Pointer to dense vector of dual column variable values mutable double *colprice_; /// Pointer to list of indices of XPRESS "global" variables mutable int *ivarind_; /** Pointer to list of global variable types:
    • 'B': binary variable
    • 'I': general integer variable (but might have 0-1 bounds)
    • 'P': partial integer variable (not currently supported)
    • 'S': sem-continuous variable (not currently supported)
    */ mutable char *ivartype_; /** Pointer to dense vector of variable types (as above, or 'C' for continuous) */ mutable char *vartype_; /** Indicates whether the last solve was for a MIP or an LP. */ mutable bool lastsolvewasmip; //@} //@} /// Whether to pass a column solution to XPRESS before starting MIP solve (loadmipsol) bool domipstart; }; //############################################################################# /** A function that tests the methods in the OsiXprSolverInterface class. */ void OsiXprSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); #endif Osi-0.106.4/src/OsiXpr/osi-xpress-uninstalled.pc.in0000644000076600007660000000044011507670402020472 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src/OsiXpr Name: OsiXpress Description: COIN-OR Open Solver Interface for Xpress URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: ${libdir}/libOsiXpr.la @XPRLIB@ Cflags: -I@abs_source_dir@/src/OsiXpr -I@XPRINCDIR@ Requires: osi Osi-0.106.4/src/OsiXpr/Makefile.in0000644000076600007660000005445712240315110015156 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Andreas Waechter IBM 2006-04-13 srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/OsiXpr DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsiXpr_la_LIBADD = am_libOsiXpr_la_OBJECTS = OsiXprSolverInterface.lo libOsiXpr_la_OBJECTS = $(am_libOsiXpr_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsiXpr_la_SOURCES) DIST_SOURCES = $(libOsiXpr_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiXpr # ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiXpr.la # List all source files for this library, including headers libOsiXpr_la_SOURCES = \ OsiXprSolverInterface.cpp OsiXprSolverInterface.hpp # This is for libtool (on Windows) libOsiXpr_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. # "top_srcdir" refers to the basic directory for the main package that is # being compiled. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ -I`$(CYGPATH_W) $(XPRINCDIR)` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiXprSolverInterface.hpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OsiXpr/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/OsiXpr/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsiXpr.la: $(libOsiXpr_la_OBJECTS) $(libOsiXpr_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsiXpr_la_LDFLAGS) $(libOsiXpr_la_OBJECTS) $(libOsiXpr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiXprSolverInterface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/OsiXpr/osi-xpress.pc.in0000644000076600007660000000046711510106235016153 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: OsiXpress Description: COIN-OR Open Solver Interface for Xpress URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsiXpr @XPRLIB@ Cflags: -I${includedir} -I@XPRINCDIR@ Requires: osi Osi-0.106.4/src/OsiGrb/0000755000076600007660000000000012244064313013045 5ustar coincoinOsi-0.106.4/src/OsiGrb/OsiGrbSolverInterface.cpp0000644000076600007660000035716512240440674017777 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for Gurobi // template: OSI Cplex Interface written by T. Achterberg // author: Stefan Vigerske // Humboldt University Berlin // license: this file may be freely distributed under the terms of EPL // comments: please scan this file for '???' and 'TODO' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2009 Humboldt University Berlin and others. // All Rights Reserved. // $Id: OsiGrbSolverInterface.cpp 1940 2013-11-12 14:57:00Z stefan $ #include #include #include #include #include "CoinPragma.hpp" #include "CoinError.hpp" #include "OsiConfig.h" #include "OsiGrbSolverInterface.hpp" #include "OsiCuts.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" #include "CoinWarmStartBasis.hpp" extern "C" { #include "gurobi_c.h" } /* A utility definition which allows for easy suppression of unused variable warnings from GCC. */ #ifndef UNUSED # if defined(__GNUC__) # define UNUSED __attribute__((unused)) # else # define UNUSED # endif #endif //#define DEBUG 1 #ifdef DEBUG #define debugMessage printf("line %4d: ", __LINE__) & printf #else #define debugMessage if( false ) printf #endif #define GUROBI_CALL(m, x) do \ { \ int _retcode; \ if( (_retcode = (x)) != 0 ) \ { \ char s[1001]; \ if (OsiGrbSolverInterface::globalenv_) \ { \ sprintf( s, "Error <%d> from GUROBI function call: ", _retcode ); \ strncat(s, GRBgeterrormsg(OsiGrbSolverInterface::globalenv_), 1000); \ } \ else \ sprintf( s, "Error <%d> from GUROBI function call (no license?).", _retcode ); \ debugMessage("%s:%d: %s", __FILE__, __LINE__, s); \ throw CoinError( s, m, "OsiGrbSolverInterface", __FILE__, __LINE__ ); \ } \ } \ while( false ) template struct CompileTimeAssert; template<> struct CompileTimeAssert {}; #if GRB_VERSION_MAJOR < 4 #define GRB_METHOD_DUAL GRB_LPMETHOD_DUAL #define GRB_METHOD_PRIMAL GRB_LPMETHOD_PRIMAL #define GRB_INT_PAR_METHOD GRB_INT_PAR_LPMETHOD #endif //############################################################################# // A couple of helper functions //############################################################################# inline void freeCacheDouble( double*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } inline void freeCacheChar( char*& ptr ) { if( ptr != NULL ) { delete [] ptr; ptr = NULL; } } inline void freeCacheMatrix( CoinPackedMatrix*& ptr ) { if( ptr != NULL ) { delete ptr; ptr = NULL; } } void OsiGrbSolverInterface::switchToLP( void ) { debugMessage("OsiGrbSolverInterface::switchToLP()\n"); if( probtypemip_ ) { GRBmodel* lp = getMutableLpPtr(); int nc = getNumCols(); char* contattr = new char[nc]; CoinFillN(contattr, nc, 'C'); GUROBI_CALL( "switchToLP", GRBsetcharattrarray(lp, GRB_CHAR_ATTR_VTYPE, 0, nc, contattr) ); delete[] contattr; probtypemip_ = false; } } void OsiGrbSolverInterface::switchToMIP( void ) { debugMessage("OsiGrbSolverInterface::switchToMIP()\n"); if( !probtypemip_ ) { GRBmodel* lp = getMutableLpPtr(); int nc = getNumCols(); assert(coltype_ != NULL); GUROBI_CALL( "switchToMIP", GRBsetcharattrarray(lp, GRB_CHAR_ATTR_VTYPE, 0, nc, coltype_) ); probtypemip_ = true; } } void OsiGrbSolverInterface::resizeColSpace( int minsize ) { debugMessage("OsiGrbSolverInterface::resizeColSpace()\n"); if( minsize > colspace_ ) { int newcolspace = 2*colspace_; if( minsize > newcolspace ) newcolspace = minsize; char* newcoltype = new char[newcolspace]; if( coltype_ != NULL ) { CoinDisjointCopyN( coltype_, colspace_, newcoltype ); delete[] coltype_; } coltype_ = newcoltype; if( colmap_O2G != NULL ) { int* newcolmap_O2G = new int[newcolspace]; CoinDisjointCopyN( colmap_O2G, colspace_, newcolmap_O2G ); delete[] colmap_O2G; colmap_O2G = newcolmap_O2G; } if( colmap_G2O != NULL ) { int* newcolmap_G2O = new int[newcolspace + auxcolspace]; CoinDisjointCopyN( colmap_G2O, colspace_ + auxcolspace, newcolmap_G2O ); delete[] colmap_G2O; colmap_G2O = newcolmap_G2O; } colspace_ = newcolspace; } assert(minsize == 0 || coltype_ != NULL); assert(colspace_ >= minsize); } void OsiGrbSolverInterface::freeColSpace() { debugMessage("OsiGrbSolverInterface::freeColSpace()\n"); if( colspace_ > 0 ) { delete[] coltype_; delete[] colmap_O2G; delete[] colmap_G2O; coltype_ = NULL; colmap_O2G = NULL; colmap_G2O = NULL; colspace_ = 0; auxcolspace = 0; } assert(coltype_ == NULL); assert(colmap_O2G == NULL); assert(colmap_G2O == NULL); } void OsiGrbSolverInterface::resizeAuxColSpace(int minsize) { debugMessage("OsiGrbSolverInterface::resizeAuxColSpace()\n"); if( minsize > auxcolspace ) { int newauxcolspace = 2*auxcolspace; if( minsize > newauxcolspace ) newauxcolspace = minsize; if( colmap_G2O != NULL ) { int* newcolmap_G2O = new int[colspace_ + newauxcolspace]; CoinDisjointCopyN( colmap_G2O, colspace_ + auxcolspace, newcolmap_G2O ); delete[] colmap_G2O; colmap_G2O = newcolmap_G2O; } auxcolspace = newauxcolspace; } } /// resizes auxcolind vector to current number of rows and inits values to -1 void OsiGrbSolverInterface::resizeAuxColIndSpace() { debugMessage("OsiGrbSolverInterface::resizeAuxColIndSpace()\n"); int numrows = getNumRows(); if( auxcolindspace < numrows ) { int newspace = 2*auxcolindspace; if( numrows > newspace ) newspace = numrows; int* newauxcolind = new int[newspace]; if( auxcolindspace > 0 ) CoinDisjointCopyN( auxcolind, auxcolindspace, newauxcolind ); for( int i = auxcolindspace; i < newspace; ++i ) newauxcolind[i] = -1; delete[] auxcolind; auxcolind = newauxcolind; auxcolindspace = newspace; } } //############################################################################# // Solve methods //############################################################################# void OsiGrbSolverInterface::initialSolve() { debugMessage("OsiGrbSolverInterface::initialSolve()\n"); bool takeHint; OsiHintStrength strength; int prevalgorithm = -1; switchToLP(); GRBmodel* lp = getLpPtr( OsiGrbSolverInterface::FREECACHED_RESULTS ); /* set whether dual or primal, if hint has been given */ getHintParam(OsiDoDualInInitial,takeHint,strength); if (strength != OsiHintIgnore) { GUROBI_CALL( "initialSolve", GRBgetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, &prevalgorithm) ); GUROBI_CALL( "initialSolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, takeHint ? GRB_METHOD_DUAL : GRB_METHOD_PRIMAL) ); } /* set whether presolve or not */ int presolve = GRB_PRESOLVE_AUTO; getHintParam(OsiDoPresolveInInitial,takeHint,strength); if (strength != OsiHintIgnore) presolve = takeHint ? GRB_PRESOLVE_AUTO : GRB_PRESOLVE_OFF; GUROBI_CALL( "initialSolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_PRESOLVE, presolve) ); /* set whether output or not */ GUROBI_CALL( "initialSolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_OUTPUTFLAG, (messageHandler()->logLevel() > 0)) ); /* optimize */ GUROBI_CALL( "initialSolve", GRBoptimize(lp) ); /* reoptimize without presolve if status unclear */ int stat; GUROBI_CALL( "initialSolve", GRBgetintattr(lp, GRB_INT_ATTR_STATUS, &stat) ); if (stat == GRB_INF_OR_UNBD && presolve != GRB_PRESOLVE_OFF) { GUROBI_CALL( "initialSolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_PRESOLVE, GRB_PRESOLVE_OFF) ); GUROBI_CALL( "initialSolve", GRBoptimize(lp) ); GUROBI_CALL( "initialSolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_PRESOLVE, presolve) ); } /* reset method parameter, if changed */ if( prevalgorithm != -1 ) GUROBI_CALL( "initialSolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, prevalgorithm) ); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::resolve() { debugMessage("OsiGrbSolverInterface::resolve()\n"); bool takeHint; OsiHintStrength strength; int prevalgorithm = -1; switchToLP(); GRBmodel* lp = getLpPtr( OsiGrbSolverInterface::FREECACHED_RESULTS ); /* set whether primal or dual */ getHintParam(OsiDoDualInResolve,takeHint,strength); if (strength != OsiHintIgnore) { GUROBI_CALL( "resolve", GRBgetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, &prevalgorithm) ); GUROBI_CALL( "resolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, takeHint ? GRB_METHOD_DUAL : GRB_METHOD_PRIMAL) ); } /* set whether presolve or not */ int presolve = GRB_PRESOLVE_OFF; getHintParam(OsiDoPresolveInResolve,takeHint,strength); if (strength != OsiHintIgnore) presolve = takeHint ? GRB_PRESOLVE_AUTO : GRB_PRESOLVE_OFF; GUROBI_CALL( "resolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_PRESOLVE, presolve) ); /* set whether output or not */ GUROBI_CALL( "resolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_OUTPUTFLAG, (messageHandler()->logLevel() > 0)) ); /* optimize */ GUROBI_CALL( "resolve", GRBoptimize(lp) ); /* reoptimize if status unclear */ int stat; GUROBI_CALL( "resolve", GRBgetintattr(lp, GRB_INT_ATTR_STATUS, &stat) ); if (stat == GRB_INF_OR_UNBD && presolve != GRB_PRESOLVE_OFF) { GUROBI_CALL( "resolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_PRESOLVE, GRB_PRESOLVE_OFF) ); GUROBI_CALL( "resolve", GRBoptimize(lp) ); GUROBI_CALL( "resolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_PRESOLVE, presolve) ); } /* reset method parameter, if changed */ if( prevalgorithm != -1 ) GUROBI_CALL( "initialSolve", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, prevalgorithm) ); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::branchAndBound() { debugMessage("OsiGrbSolverInterface::branchAndBound()\n"); switchToMIP(); if( colsol_ != NULL && domipstart ) { int* discridx = new int[getNumIntegers()]; double* discrval = new double[getNumIntegers()]; int j = 0; for( int i = 0; i < getNumCols() && j < getNumIntegers(); ++i ) { if( !isInteger(i) && !isBinary(i) ) continue; discridx[j] = i; discrval[j] = colsol_[i]; ++j; } assert(j == getNumIntegers()); GUROBI_CALL( "branchAndBound", GRBsetdblattrlist(getMutableLpPtr(), GRB_DBL_ATTR_START, getNumIntegers(), discridx, discrval) ); delete[] discridx; delete[] discrval; } GRBmodel* lp = getLpPtr( OsiGrbSolverInterface::FREECACHED_RESULTS ); GUROBI_CALL( "branchAndBound", GRBsetintparam(GRBgetenv(lp), GRB_INT_PAR_OUTPUTFLAG, (messageHandler()->logLevel() > 0)) ); GUROBI_CALL( "branchAndBound", GRBoptimize( lp ) ); } //############################################################################# // Parameter related methods //############################################################################# bool OsiGrbSolverInterface::setIntParam(OsiIntParam key, int value) { debugMessage("OsiGrbSolverInterface::setIntParam(%d, %d)\n", key, value); switch (key) { case OsiMaxNumIteration: if( GRBsetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_ITERATIONLIMIT, (double)value) != 0 ) { *messageHandler() << "Warning: Setting GUROBI iteration limit to" << value << "failed." << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; return false; } return true; case OsiMaxNumIterationHotStart: if( value >= 0 ) { hotStartMaxIteration_ = value; return true; } return false; case OsiNameDiscipline: if( value < 0 || value > 3 ) return false; nameDisc_ = value; return true; case OsiLastIntParam: default: return false; } } //----------------------------------------------------------------------------- bool OsiGrbSolverInterface::setDblParam(OsiDblParam key, double value) { debugMessage("OsiGrbSolverInterface::setDblParam(%d, %g)\n", key, value); switch (key) { // Gurobi does not have primal or dual objective limits // case OsiDualObjectiveLimit: // break; // case OsiPrimalObjectiveLimit: // break; case OsiDualTolerance: if( GRBsetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_OPTIMALITYTOL, value) != 0 ) { *messageHandler() << "Warning: Setting GUROBI dual (i.e., optimality) tolerance to" << value << "failed." << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; return false; } return true; case OsiPrimalTolerance: if( GRBsetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_FEASIBILITYTOL, value) != 0 ) { *messageHandler() << "Warning: Setting GUROBI primal (i.e., feasiblity) tolerance to" << value << "failed." << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; return false; } return true; case OsiObjOffset: return OsiSolverInterface::setDblParam(key,value); case OsiLastDblParam: default: return false; } } //----------------------------------------------------------------------------- bool OsiGrbSolverInterface::setStrParam(OsiStrParam key, const std::string & value) { debugMessage("OsiGrbSolverInterface::setStrParam(%d, %s)\n", key, value.c_str()); switch (key) { case OsiProbName: GUROBI_CALL( "setStrParam", GRBsetstrattr(getLpPtr(), GRB_STR_ATTR_MODELNAME, const_cast(value.c_str())) ); return true; case OsiSolverName: case OsiLastStrParam: default: return false; } } // Set a hint parameter bool OsiGrbSolverInterface::setHintParam(OsiHintParam key, bool yesNo, OsiHintStrength strength, void* otherInfo) { debugMessage("OsiGrbSolverInterface::setHintParam(%d, %d)\n", key, yesNo); if( key == OsiDoScale ) { GUROBI_CALL( "setHintParam", GRBsetintparam(GRBgetenv(getMutableLpPtr()), GRB_INT_PAR_SCALEFLAG, yesNo) ); OsiSolverInterface::setHintParam(key, yesNo, strength, otherInfo); return true; } return OsiSolverInterface::setHintParam(key, yesNo, strength, otherInfo); } //----------------------------------------------------------------------------- bool OsiGrbSolverInterface::getIntParam(OsiIntParam key, int& value) const { debugMessage("OsiGrbSolverInterface::getIntParam(%d)\n", key); switch (key) { case OsiMaxNumIteration: double dblval; GUROBI_CALL( "getIntParam", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getIntParam", GRBgetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_ITERATIONLIMIT, &dblval) ); value = (int) dblval; return true; case OsiMaxNumIterationHotStart: value = hotStartMaxIteration_; return true; case OsiNameDiscipline: value = nameDisc_; return true; case OsiLastIntParam: default: return false; } } //----------------------------------------------------------------------------- bool OsiGrbSolverInterface::getDblParam(OsiDblParam key, double& value) const { debugMessage("OsiGrbSolverInterface::getDblParam(%d)\n", key); GUROBI_CALL( "getDblParam", GRBupdatemodel(getMutableLpPtr()) ); switch (key) { // Gurobi does not have primal or dual objective limits // case OsiDualObjectiveLimit: // break; // case OsiPrimalObjectiveLimit: // break; case OsiDualTolerance: GUROBI_CALL( "getDblParam", GRBgetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_OPTIMALITYTOL, &value) ); return true; case OsiPrimalTolerance: GUROBI_CALL( "getDblParam", GRBgetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_FEASIBILITYTOL, &value) ); return true; case OsiObjOffset: return OsiSolverInterface::getDblParam(key, value); case OsiLastDblParam: default: return false; } } //----------------------------------------------------------------------------- bool OsiGrbSolverInterface::getStrParam(OsiStrParam key, std::string & value) const { debugMessage("OsiGrbSolverInterface::getStrParam(%d)\n", key); switch (key) { case OsiProbName: { char* name = NULL; GUROBI_CALL( "getStrParam", GRBgetstrattr(getMutableLpPtr(), GRB_STR_ATTR_MODELNAME, &name) ); assert(name != NULL); value = name; return true; } case OsiSolverName: value = "gurobi"; return true; case OsiLastStrParam: default: return false; } } // Get a hint parameter bool OsiGrbSolverInterface::getHintParam(OsiHintParam key, bool& yesNo, OsiHintStrength& strength, void*& otherInformation) const { debugMessage("OsiGrbSolverInterface::getHintParam[1](%d)\n", key); if( key == OsiDoScale ) { OsiSolverInterface::getHintParam(key, yesNo, strength, otherInformation); GUROBI_CALL( "getHintParam", GRBupdatemodel(getMutableLpPtr()) ); int value; GUROBI_CALL( "getHintParam", GRBgetintparam(GRBgetenv(getMutableLpPtr()), GRB_INT_PAR_SCALEFLAG, &value) ); yesNo = value; return true; } return OsiSolverInterface::getHintParam(key, yesNo, strength, otherInformation); } // Get a hint parameter bool OsiGrbSolverInterface::getHintParam(OsiHintParam key, bool& yesNo, OsiHintStrength& strength) const { debugMessage("OsiGrbSolverInterface::getHintParam[2](%d)\n", key); if( key == OsiDoScale ) { OsiSolverInterface::getHintParam(key, yesNo, strength); GUROBI_CALL( "getHintParam", GRBupdatemodel(getMutableLpPtr()) ); int value; GUROBI_CALL( "getHintParam", GRBgetintparam(GRBgetenv(getMutableLpPtr()), GRB_INT_PAR_SCALEFLAG, &value) ); yesNo = value; return true; } return OsiSolverInterface::getHintParam(key, yesNo, strength); } // Get a hint parameter bool OsiGrbSolverInterface::getHintParam(OsiHintParam key, bool& yesNo) const { debugMessage("OsiGrbSolverInterface::getHintParam[3](%d)\n", key); if( key == OsiDoScale ) { OsiSolverInterface::getHintParam(key, yesNo); GUROBI_CALL( "getHintParam", GRBupdatemodel(getMutableLpPtr()) ); int value; GUROBI_CALL( "getHintParam", GRBgetintparam(GRBgetenv(getMutableLpPtr()), GRB_INT_PAR_SCALEFLAG, &value) ); yesNo = value; return true; } return OsiSolverInterface::getHintParam(key, yesNo); } //############################################################################# // Methods returning info on how the solution process terminated //############################################################################# bool OsiGrbSolverInterface::isAbandoned() const { debugMessage("OsiGrbSolverInterface::isAbandoned()\n"); GUROBI_CALL( "isAbandoned", GRBupdatemodel(getMutableLpPtr()) ); int stat; GUROBI_CALL( "isAbandoned", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_STATUS, &stat) ); return ( stat == GRB_LOADED || stat == GRB_NUMERIC || stat == GRB_INTERRUPTED ); } bool OsiGrbSolverInterface::isProvenOptimal() const { debugMessage("OsiGrbSolverInterface::isProvenOptimal()\n"); GUROBI_CALL( "isProvenOptimal", GRBupdatemodel(getMutableLpPtr()) ); int stat; GUROBI_CALL( "isProvenOptimal", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_STATUS, &stat) ); return (stat == GRB_OPTIMAL); } bool OsiGrbSolverInterface::isProvenPrimalInfeasible() const { debugMessage("OsiGrbSolverInterface::isProvenPrimalInfeasible()\n"); GUROBI_CALL( "isProvenPrimalInfeasible", GRBupdatemodel(getMutableLpPtr()) ); int stat; GUROBI_CALL( "isProvenPrimalInfeasible", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_STATUS, &stat) ); return (stat == GRB_INFEASIBLE); } bool OsiGrbSolverInterface::isProvenDualInfeasible() const { debugMessage("OsiGrbSolverInterface::isProvenDualInfeasible()\n"); GUROBI_CALL( "isProvenDualInfeasible", GRBupdatemodel(getMutableLpPtr()) ); int stat; GUROBI_CALL( "isProvenDualInfeasible", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_STATUS, &stat) ); return (stat == GRB_UNBOUNDED); } bool OsiGrbSolverInterface::isPrimalObjectiveLimitReached() const { debugMessage("OsiGrbSolverInterface::isPrimalObjectiveLimitReached()\n"); return false; } bool OsiGrbSolverInterface::isDualObjectiveLimitReached() const { debugMessage("OsiGrbSolverInterface::isDualObjectiveLimitReached()\n"); return false; } bool OsiGrbSolverInterface::isIterationLimitReached() const { debugMessage("OsiGrbSolverInterface::isIterationLimitReached()\n"); GUROBI_CALL( "isIterationLimitReached", GRBupdatemodel(getMutableLpPtr()) ); int stat; GUROBI_CALL( "isIterationLimitReached", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_STATUS, &stat) ); return (stat == GRB_ITERATION_LIMIT); } //############################################################################# // WarmStart related methods //############################################################################# CoinWarmStart* OsiGrbSolverInterface::getEmptyWarmStart () const { return (dynamic_cast(new CoinWarmStartBasis())) ; } // below we assume that getBasisStatus uses the same values as the warm start enum, i.e. 0: free, 1: basic, 2: upper, 3: lower static CompileTimeAssert UNUSED change_In_Enum_CoinWarmStartBasis_Status_free_breaks_this_function; static CompileTimeAssert UNUSED change_In_Enum_CoinWarmStartBasis_Status_basic_breaks_this_function; static CompileTimeAssert UNUSED change_In_Enum_CoinWarmStartBasis_Status_upper_breaks_this_function; static CompileTimeAssert UNUSED change_In_Enum_CoinWarmStartBasis_Status_lower_breaks_this_function; CoinWarmStart* OsiGrbSolverInterface::getWarmStart() const { debugMessage("OsiGrbSolverInterface::getWarmStart()\n"); assert(!probtypemip_); if( !basisIsAvailable() ) return NULL; CoinWarmStartBasis* ws = NULL; int numcols = getNumCols(); int numrows = getNumRows(); int *cstat = new int[numcols]; int *rstat = new int[numrows]; int i; #if 1 getBasisStatus(cstat, rstat); ws = new CoinWarmStartBasis; ws->setSize( numcols, numrows ); for( i = 0; i < numrows; ++i ) ws->setArtifStatus( i, CoinWarmStartBasis::Status(rstat[i]) ); for( i = 0; i < numcols; ++i ) ws->setStructStatus( i, CoinWarmStartBasis::Status(cstat[i]) ); #else GUROBI_CALL( "getWarmStart", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getWarmStart", GRBgetintattrarray(getMutableLpPtr(), GRB_INT_ATTR_VBASIS, 0, numcols, cstat) ); GUROBI_CALL( "getWarmStart", GRBgetintattrarray(getMutableLpPtr(), GRB_INT_ATTR_CBASIS, 0, numrows, rstat) ); ws = new CoinWarmStartBasis; ws->setSize( numcols, numrows ); char sense; for( i = 0; i < numrows; ++i ) { switch( rstat[i] ) { case GRB_BASIC: ws->setArtifStatus( i, CoinWarmStartBasis::basic ); break; case GRB_NONBASIC_LOWER: case GRB_NONBASIC_UPPER: GUROBI_CALL( "getWarmStart", GRBgetcharattrelement(getMutableLpPtr(), GRB_CHAR_ATTR_SENSE, i, &sense) ); ws->setArtifStatus( i, (sense == '>' ? CoinWarmStartBasis::atUpperBound : CoinWarmStartBasis::atLowerBound) ); break; default: // unknown row status delete ws; delete[] rstat; delete[] cstat; return NULL; } } for( i = 0; i < numcols; ++i ) { switch( cstat[i] ) { case GRB_BASIC: ws->setStructStatus( i, CoinWarmStartBasis::basic ); break; case GRB_NONBASIC_LOWER: ws->setStructStatus( i, CoinWarmStartBasis::atLowerBound ); break; case GRB_NONBASIC_UPPER: ws->setStructStatus( i, CoinWarmStartBasis::atUpperBound ); break; case GRB_SUPERBASIC: ws->setStructStatus( i, CoinWarmStartBasis::isFree ); break; default: // unknown column status delete[] rstat; delete[] cstat; delete ws; return NULL; } } #endif delete[] cstat; delete[] rstat; return ws; } //----------------------------------------------------------------------------- bool OsiGrbSolverInterface::setWarmStart(const CoinWarmStart* warmstart) { debugMessage("OsiGrbSolverInterface::setWarmStart(%p)\n", (void*)warmstart); const CoinWarmStartBasis* ws = dynamic_cast(warmstart); int numcols, numrows, i, oi; int *stat; if( !ws ) return false; numcols = ws->getNumStructural(); numrows = ws->getNumArtificial(); if( numcols != getNumCols() || numrows != getNumRows() ) return false; switchToLP(); stat = new int[numcols + nauxcols > numrows ? numcols + nauxcols : numrows]; for( i = 0; i < numrows; ++i ) { switch( ws->getArtifStatus( i ) ) { case CoinWarmStartBasis::basic: stat[i] = GRB_BASIC; break; case CoinWarmStartBasis::atLowerBound: case CoinWarmStartBasis::atUpperBound: stat[i] = GRB_NONBASIC_LOWER; break; case CoinWarmStartBasis::isFree: stat[i] = GRB_SUPERBASIC; break; default: // unknown row status delete[] stat; return false; } } GUROBI_CALL( "setWarmStart", GRBsetintattrarray(getLpPtr(OsiGrbSolverInterface::FREECACHED_RESULTS), GRB_INT_ATTR_CBASIS, 0, numrows, stat) ); for( i = 0; i < numcols + nauxcols; ++i ) { oi = colmap_G2O ? colmap_G2O[i] : i; if( oi >= 0 ) { /* normal variable */ switch( ws->getStructStatus( oi ) ) { case CoinWarmStartBasis::basic: stat[i] = GRB_BASIC; break; case CoinWarmStartBasis::atLowerBound: stat[i] = GRB_NONBASIC_LOWER; break; case CoinWarmStartBasis::atUpperBound: stat[i] = GRB_NONBASIC_UPPER; break; case CoinWarmStartBasis::isFree: stat[i] = GRB_SUPERBASIC; break; default: // unknown col status delete[] stat; return false; } } else { /* auxiliary variable, derive status from status of corresponding ranged row */ switch( ws->getArtifStatus( -oi-1 ) ) { case CoinWarmStartBasis::basic: stat[i] = GRB_BASIC; break; case CoinWarmStartBasis::atLowerBound: stat[i] = GRB_NONBASIC_LOWER; break; case CoinWarmStartBasis::atUpperBound: stat[i] = GRB_NONBASIC_UPPER; break; case CoinWarmStartBasis::isFree: stat[i] = GRB_SUPERBASIC; break; default: // unknown col status delete[] stat; return false; } } } GUROBI_CALL( "setWarmStart", GRBsetintattrarray(getLpPtr(OsiGrbSolverInterface::FREECACHED_RESULTS), GRB_INT_ATTR_VBASIS, 0, numcols+nauxcols, stat) ); delete[] stat; return true; } //############################################################################# // Hotstart related methods (primarily used in strong branching) //############################################################################# void OsiGrbSolverInterface::markHotStart() { debugMessage("OsiGrbSolverInterface::markHotStart()\n"); int numcols, numrows; assert(!probtypemip_); numcols = getNumCols() + nauxcols; numrows = getNumRows(); if( numcols > hotStartCStatSize_ ) { delete[] hotStartCStat_; hotStartCStatSize_ = static_cast( 1.2 * static_cast( numcols + nauxcols ) ); // get some extra space for future hot starts hotStartCStat_ = new int[hotStartCStatSize_]; } if( numrows > hotStartRStatSize_ ) { delete[] hotStartRStat_; hotStartRStatSize_ = static_cast( 1.2 * static_cast( numrows ) ); // get some extra space for future hot starts hotStartRStat_ = new int[hotStartRStatSize_]; } GUROBI_CALL( "markHotStart", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "markHotStart", GRBgetintattrarray(getMutableLpPtr(), GRB_INT_ATTR_VBASIS, 0, numcols + nauxcols, hotStartCStat_) ); GUROBI_CALL( "markHotStart", GRBgetintattrarray(getMutableLpPtr(), GRB_INT_ATTR_CBASIS, 0, numrows, hotStartRStat_) ); } void OsiGrbSolverInterface::solveFromHotStart() { debugMessage("OsiGrbSolverInterface::solveFromHotStart()\n"); double maxiter; switchToLP(); assert( getNumCols() <= hotStartCStatSize_ ); assert( getNumRows() <= hotStartRStatSize_ ); GUROBI_CALL( "solveFromHotStart", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "solveFromHotStart", GRBsetintattrarray(getLpPtr(OsiGrbSolverInterface::FREECACHED_RESULTS), GRB_INT_ATTR_CBASIS, 0, getNumRows(), hotStartRStat_ ) ); GUROBI_CALL( "solveFromHotStart", GRBsetintattrarray(getLpPtr(OsiGrbSolverInterface::FREECACHED_RESULTS), GRB_INT_ATTR_VBASIS, 0, getNumCols() + nauxcols, hotStartCStat_ ) ); GUROBI_CALL( "solveFromHotStart", GRBgetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_ITERATIONLIMIT, &maxiter) ); GUROBI_CALL( "solveFromHotStart", GRBsetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_ITERATIONLIMIT, (double)hotStartMaxIteration_) ); resolve(); GUROBI_CALL( "solveFromHotStart", GRBsetdblparam(GRBgetenv(getMutableLpPtr()), GRB_DBL_PAR_ITERATIONLIMIT, maxiter) ); } void OsiGrbSolverInterface::unmarkHotStart() { debugMessage("OsiGrbSolverInterface::unmarkHotStart()\n"); // ??? be lazy with deallocating memory and do nothing here, deallocate memory in the destructor } //############################################################################# // Problem information methods (original data) //############################################################################# //------------------------------------------------------------------ // Get number of rows, columns, elements, ... //------------------------------------------------------------------ int OsiGrbSolverInterface::getNumCols() const { debugMessage("OsiGrbSolverInterface::getNumCols()\n"); int numcols; GUROBI_CALL( "getNumCols", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getNumCols", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_NUMVARS, &numcols) ); numcols -= nauxcols; return numcols; } int OsiGrbSolverInterface::getNumRows() const { debugMessage("OsiGrbSolverInterface::getNumRows()\n"); int numrows; GUROBI_CALL( "getNumRows", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getNumRows", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_NUMCONSTRS, &numrows) ); return numrows; } int OsiGrbSolverInterface::getNumElements() const { debugMessage("OsiGrbSolverInterface::getNumElements()\n"); int numnz; GUROBI_CALL( "getNumElements", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getNumElements", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_NUMNZS, &numnz) ); /* each auxiliary column contributes one nonzero element to exactly one row */ numnz -= nauxcols; return numnz; } //------------------------------------------------------------------ // Get pointer to rim vectors //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getColLower() const { debugMessage("OsiGrbSolverInterface::getColLower()\n"); if( collower_ == NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { collower_ = new double[ncols]; GUROBI_CALL( "getColLower", GRBupdatemodel(getMutableLpPtr()) ); if( nauxcols ) GUROBI_CALL( "getColLower", GRBgetdblattrlist(getMutableLpPtr(), GRB_DBL_ATTR_LB, ncols, colmap_O2G, collower_) ); else GUROBI_CALL( "getColLower", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_LB, 0, ncols, collower_) ); } } return collower_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getColUpper() const { debugMessage("OsiGrbSolverInterface::getColUpper()\n"); if( colupper_ == NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { colupper_ = new double[ncols]; GUROBI_CALL( "getColUpper", GRBupdatemodel(getMutableLpPtr()) ); if( nauxcols ) GUROBI_CALL( "getColUpper", GRBgetdblattrlist(getMutableLpPtr(), GRB_DBL_ATTR_UB, ncols, colmap_O2G, colupper_) ); else GUROBI_CALL( "getColUpper", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_UB, 0, ncols, colupper_) ); } } return colupper_; } //------------------------------------------------------------------ const char * OsiGrbSolverInterface::getRowSense() const { debugMessage("OsiGrbSolverInterface::getRowSense()\n"); if ( rowsense_==NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowsense_ = new char[nrows]; GUROBI_CALL( "getRowSense", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getRowSense", GRBgetcharattrarray(getMutableLpPtr(), GRB_CHAR_ATTR_SENSE, 0, nrows, rowsense_) ); for (int i = 0; i < nrows; ++i) { if( auxcolind && auxcolind[i] >= 0 ) { assert(rowsense_[i] == GRB_EQUAL); rowsense_[i] = 'R'; continue; } switch (rowsense_[i]) { case GRB_LESS_EQUAL: rowsense_[i] = 'L'; break; case GRB_GREATER_EQUAL: rowsense_[i] = 'G'; break; case GRB_EQUAL: rowsense_[i] = 'E'; break; } } } } return rowsense_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getRightHandSide() const { debugMessage("OsiGrbSolverInterface::getRightHandSide()\n"); if ( rhs_ == NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rhs_ = new double[nrows]; GUROBI_CALL( "getRightHandSide", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getRightHandSide", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_RHS, 0, nrows, rhs_) ); /* for ranged rows, we give the rhs of the aux. variable used to represent the range of this row as row rhs */ if( nauxcols ) for( int i = 0; i < nrows; ++i ) if( auxcolind[i] >= 0 ) GUROBI_CALL( "getRightHandSide", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_UB, auxcolind[i], &rhs_[i]) ); } } return rhs_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getRowRange() const { debugMessage("OsiGrbSolverInterface::getRowRange()\n"); if ( rowrange_==NULL ) { int nrows = getNumRows(); if (nrows > 0) rowrange_ = CoinCopyOfArrayOrZero((double*)NULL, nrows); if( nauxcols ) { double auxlb, auxub; for( int i = 0; i < nrows; ++i ) if( auxcolind[i] >= 0 ) { GUROBI_CALL( "getRowRange", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_LB, auxcolind[i], &auxlb) ); GUROBI_CALL( "getRowRange", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_UB, auxcolind[i], &auxub) ); rowrange_[i] = auxub - auxlb; } } } return rowrange_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getRowLower() const { debugMessage("OsiGrbSolverInterface::getRowLower()\n"); if ( rowlower_ == NULL ) { int nrows = getNumRows(); if ( nrows > 0 ) { const char* rowsense = getRowSense(); rowlower_ = new double[nrows]; double rhs; double dum1; for ( int i = 0; i < nrows; ++i ) { if( auxcolind && auxcolind[i] >= 0 ) { assert(rowsense[i] == 'R'); GUROBI_CALL( "getRowLower", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_LB, auxcolind[i], &rowlower_[i]) ); } else { GUROBI_CALL( "getRowLower", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_RHS, i, &rhs) ); convertSenseToBound( rowsense[i], rhs, 0.0, rowlower_[i], dum1 ); } } } } return rowlower_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getRowUpper() const { debugMessage("OsiGrbSolverInterface::getRowUpper()\n"); if ( rowupper_ == NULL ) { int nrows = getNumRows(); if ( nrows > 0 ) { const char* rowsense = getRowSense(); rowupper_ = new double[nrows]; double rhs; double dum1; for ( int i = 0; i < nrows; ++i ) { if( auxcolind && auxcolind[i] >= 0 ) { assert(rowsense[i] == 'R'); GUROBI_CALL( "getRowUpper", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_UB, auxcolind[i], &rowupper_[i]) ); } else { GUROBI_CALL( "getRowUpper", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_RHS, i, &rhs) ); convertSenseToBound( rowsense[i], rhs, 0.0, dum1, rowupper_[i] ); } } } } return rowupper_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getObjCoefficients() const { debugMessage("OsiGrbSolverInterface::getObjCoefficients()\n"); if ( obj_==NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { obj_ = new double[ncols]; GUROBI_CALL( "getObjCoefficients", GRBupdatemodel(getMutableLpPtr()) ); if( nauxcols ) GUROBI_CALL( "getObjCoefficients", GRBgetdblattrlist(getMutableLpPtr(), GRB_DBL_ATTR_OBJ, ncols, colmap_O2G, obj_) ); else GUROBI_CALL( "getObjCoefficients", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_OBJ, 0, ncols, obj_) ); } } return obj_; } //------------------------------------------------------------------ double OsiGrbSolverInterface::getObjSense() const { debugMessage("OsiGrbSolverInterface::getObjSense()\n"); int sense; GUROBI_CALL( "getObjSense", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getObjSense", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_MODELSENSE, &sense) ); return (double)sense; } //------------------------------------------------------------------ // Return information on integrality //------------------------------------------------------------------ bool OsiGrbSolverInterface::isContinuous( int colNumber ) const { debugMessage("OsiGrbSolverInterface::isContinuous(%d)\n", colNumber); return getCtype()[colNumber] == 'C'; } //------------------------------------------------------------------ // Row and column copies of the matrix ... //------------------------------------------------------------------ const CoinPackedMatrix * OsiGrbSolverInterface::getMatrixByRow() const { debugMessage("OsiGrbSolverInterface::getMatrixByRow()\n"); if ( matrixByRow_ == NULL ) { int nrows = getNumRows(); int ncols = getNumCols(); if ( nrows == 0 ) { matrixByRow_ = new CoinPackedMatrix(); matrixByRow_->setDimensions(0, ncols); return matrixByRow_; } int nelems; int *starts = new int [nrows + 1]; int *len = new int [nrows]; GUROBI_CALL( "getMatrixByRow", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getMatrixByRow", GRBgetconstrs(getMutableLpPtr(), &nelems, NULL, NULL, NULL, 0, nrows) ); assert( nelems == getNumElements() + nauxcols ); int *indices = new int [nelems]; double *elements = new double[nelems]; GUROBI_CALL( "getMatrixByRow", GRBgetconstrs(getMutableLpPtr(), &nelems, starts, indices, elements, 0, nrows) ); matrixByRow_ = new CoinPackedMatrix(); // Should be able to pass null for length of packed matrix, // assignMatrix does not seem to allow (even though documentation say it is possible to do this). // For now compute the length. starts[nrows] = nelems; for ( int i = 0; i < nrows; ++i ) len[i] = starts[i+1] - starts[i]; matrixByRow_->assignMatrix( false /* not column ordered */, ncols + nauxcols, nrows, nelems, elements, indices, starts, len); if( nauxcols ) { // delete auxiliary columns from matrix int* auxcols = new int[nauxcols]; int j = 0; for( int i = 0; i < ncols + nauxcols; ++i ) if( colmap_G2O[i] < 0 ) auxcols[j++] = i; assert(j == nauxcols); matrixByRow_->deleteCols(nauxcols, auxcols); delete[] auxcols; assert(matrixByRow_->getNumElements() == getNumElements()); assert(matrixByRow_->getMinorDim() <= ncols); } } return matrixByRow_; } //------------------------------------------------------------------ const CoinPackedMatrix * OsiGrbSolverInterface::getMatrixByCol() const { debugMessage("OsiGrbSolverInterface::getMatrixByCol()\n"); if ( matrixByCol_ == NULL ) { int nrows = getNumRows(); int ncols = getNumCols(); matrixByCol_ = new CoinPackedMatrix(); if ( ncols > 0 ) { int nelems; int *starts = new int [ncols + nauxcols + 1]; int *len = new int [ncols + nauxcols]; GUROBI_CALL( "getMatrixByCol", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getMatrixByCol", GRBgetvars(getMutableLpPtr(), &nelems, NULL, NULL, NULL, 0, ncols + nauxcols) ); int *indices = new int [nelems]; double *elements = new double[nelems]; GUROBI_CALL( "getMatrixByCol", GRBgetvars(getMutableLpPtr(), &nelems, starts, indices, elements, 0, ncols + nauxcols) ); // Should be able to pass null for length of packed matrix, // assignMatrix does not seem to allow (even though documentation say it is possible to do this). // For now compute the length. starts[ncols + nauxcols] = nelems; for ( int i = 0; i < ncols + nauxcols; i++ ) len[i] = starts[i+1] - starts[i]; matrixByCol_->assignMatrix( true /* column ordered */, nrows, ncols + nauxcols, nelems, elements, indices, starts, len); assert( matrixByCol_->getNumCols() == ncols + nauxcols ); assert( matrixByCol_->getNumRows() == nrows ); if( nauxcols ) { // delete auxiliary columns from matrix int* auxcols = new int[nauxcols]; int j = 0; for( int i = 0; i < ncols + nauxcols; ++i ) if( colmap_G2O[i] < 0 ) auxcols[j++] = i; assert(j == nauxcols); matrixByCol_->deleteCols(nauxcols, auxcols); delete[] auxcols; assert(matrixByCol_->getNumElements() == getNumElements()); assert(matrixByCol_->getMajorDim() <= ncols); assert(matrixByCol_->getMinorDim() <= nrows); } } else matrixByCol_->setDimensions(nrows, ncols); } return matrixByCol_; } //------------------------------------------------------------------ // Get solver's value for infinity //------------------------------------------------------------------ double OsiGrbSolverInterface::getInfinity() const { debugMessage("OsiGrbSolverInterface::getInfinity()\n"); return GRB_INFINITY; } //############################################################################# // Problem information methods (results) //############################################################################# // *FIXME*: what should be done if a certain vector doesn't exist??? const double * OsiGrbSolverInterface::getColSolution() const { debugMessage("OsiGrbSolverInterface::getColSolution()\n"); if( colsol_ == NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { colsol_ = new double[ncols]; GUROBI_CALL( "getColSolution", GRBupdatemodel(getMutableLpPtr()) ); if ( GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_X, 0, colsol_) == 0 ) { // if a solution is available, get it if( nauxcols ) GUROBI_CALL( "getColSolution", GRBgetdblattrlist(getMutableLpPtr(), GRB_DBL_ATTR_X, ncols, colmap_O2G, colsol_) ); else GUROBI_CALL( "getColSolution", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_X, 0, ncols, colsol_) ); } else { *messageHandler() << "Warning: OsiGrbSolverInterface::getColSolution() called, but no solution available! Returning lower bounds, but they may be at -infinity. Be aware!" << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; if( nauxcols ) GUROBI_CALL( "getColSolution", GRBgetdblattrlist(getMutableLpPtr(), GRB_DBL_ATTR_LB, ncols, colmap_O2G, colsol_) ); else GUROBI_CALL( "getColSolution", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_LB, 0, ncols, colsol_) ); } } } return colsol_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getRowPrice() const { debugMessage("OsiGrbSolverInterface::getRowPrice()\n"); if( rowsol_==NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowsol_ = new double[nrows]; GUROBI_CALL( "getRowPrice", GRBupdatemodel(getMutableLpPtr()) ); if ( GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_PI, 0, rowsol_) == 0 ) { GUROBI_CALL( "getRowPrice", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_PI, 0, nrows, rowsol_) ); } else { *messageHandler() << "Warning: OsiGrbSolverInterface::getRowPrice() called, but no solution available! Returning 0.0. Be aware!" << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; CoinZeroN(rowsol_, nrows); } //??? what is the dual value for a ranged row? } } return rowsol_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getReducedCost() const { debugMessage("OsiGrbSolverInterface::getReducedCost()\n"); if( redcost_==NULL ) { int ncols = getNumCols(); if( ncols > 0 ) { redcost_ = new double[ncols]; GUROBI_CALL( "getReducedCost", GRBupdatemodel(getMutableLpPtr()) ); if ( GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_RC, 0, redcost_) == 0 ) { // if reduced costs are available, get them if( nauxcols ) GUROBI_CALL( "getReducedCost", GRBgetdblattrlist(getMutableLpPtr(), GRB_DBL_ATTR_RC, ncols, colmap_O2G, redcost_) ); else GUROBI_CALL( "getReducedCost", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_RC, 0, ncols, redcost_) ); } else { *messageHandler() << "Warning: OsiGrbSolverInterface::getReducedCost() called, but no solution available! Returning 0.0. Be aware!" << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; CoinZeroN(redcost_, ncols); } } } return redcost_; } //------------------------------------------------------------------ const double * OsiGrbSolverInterface::getRowActivity() const { debugMessage("OsiGrbSolverInterface::getRowActivity()\n"); if( rowact_==NULL ) { int nrows = getNumRows(); if( nrows > 0 ) { rowact_ = new double[nrows]; GUROBI_CALL( "getRowActivity", GRBupdatemodel(getMutableLpPtr()) ); if ( GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_SLACK, 0, rowact_) == 0 ) { GUROBI_CALL( "getRowActivity", GRBgetdblattrarray(getMutableLpPtr(), GRB_DBL_ATTR_SLACK, 0, nrows, rowact_) ); for( int r = 0; r < nrows; ++r ) { if( nauxcols && auxcolind[r] >= 0 ) { GUROBI_CALL( "getRowActivity", GRBgetdblattrelement(getMutableLpPtr(), GRB_DBL_ATTR_X, auxcolind[r], &rowact_[r]) ); } else rowact_[r] = getRightHandSide()[r] - rowact_[r]; } } else { *messageHandler() << "Warning: OsiGrbSolverInterface::getRowActivity() called, but no solution available! Returning 0.0. Be aware!" << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; CoinZeroN(rowact_, nrows); } } } return rowact_; } //------------------------------------------------------------------ double OsiGrbSolverInterface::getObjValue() const { debugMessage("OsiGrbSolverInterface::getObjValue()\n"); double objval = 0.0; GUROBI_CALL( "getObjValue", GRBupdatemodel(getMutableLpPtr()) ); if( GRBgetdblattr(getMutableLpPtr(), GRB_DBL_ATTR_OBJVAL, &objval) == 0 ) { // Adjust objective function value by constant term in objective function double objOffset; getDblParam(OsiObjOffset,objOffset); objval = objval - objOffset; } else { *messageHandler() << "Warning: OsiGrbSolverInterface::getObjValue() called, but probably no solution available! Returning 0.0. Be aware!" << CoinMessageEol; if (OsiGrbSolverInterface::globalenv_) *messageHandler() << "\t GUROBI error message: " << GRBgeterrormsg(OsiGrbSolverInterface::globalenv_) << CoinMessageEol; } return objval; } //------------------------------------------------------------------ int OsiGrbSolverInterface::getIterationCount() const { debugMessage("OsiGrbSolverInterface::getIterationCount()\n"); double itercnt; GUROBI_CALL( "getIterationCount", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "getIterationCount", GRBgetdblattr(getMutableLpPtr(), GRB_DBL_ATTR_ITERCOUNT, &itercnt) ); return (int)itercnt; } //------------------------------------------------------------------ std::vector OsiGrbSolverInterface::getDualRays(int maxNumRays, bool fullRay) const { debugMessage("OsiGrbSolverInterface::getDualRays(%d,%s)\n", maxNumRays, fullRay?"true":"false"); if (fullRay == true) { throw CoinError("Full dual rays not yet implemented.","getDualRays", "OsiGrbSolverInterface"); } OsiGrbSolverInterface solver(*this); const int numcols = getNumCols(); const int numrows = getNumRows(); int* index = new int[CoinMax(numcols,numrows)]; int i; for ( i = CoinMax(numcols,numrows)-1; i >= 0; --i) { index[i] = i; } double* obj = new double[CoinMax(numcols,2*numrows)]; CoinFillN(obj, numcols, 0.0); solver.setObjCoeffSet(index, index+numcols, obj); double* clb = new double[2*numrows]; double* cub = new double[2*numrows]; const double plusone = 1.0; const double minusone = -1.0; const char* sense = getRowSense(); const CoinPackedVectorBase** cols = new const CoinPackedVectorBase*[numrows]; int newcols = 0; for (i = 0; i < numrows; ++i) { switch (sense[i]) { case 'L': cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &minusone, false); break; case 'G': cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &plusone, false); break; case 'R': cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &minusone, false); cols[newcols++] = new CoinShallowPackedVector(1, &index[i], &plusone, false); break; case 'N': case 'E': break; } } CoinFillN(obj, newcols, 1.0); CoinFillN(clb, newcols, 0.0); CoinFillN(cub, newcols, getInfinity()); solver.addCols(newcols, cols, clb, cub, obj); delete[] index; delete[] cols; delete[] clb; delete[] cub; delete[] obj; solver.setObjSense(1.0); // minimize solver.initialSolve(); const double* solverpi = solver.getRowPrice(); double* pi = new double[numrows]; for ( i = numrows - 1; i >= 0; --i) { pi[i] = -solverpi[i]; } return std::vector(1, pi); } //------------------------------------------------------------------ std::vector OsiGrbSolverInterface::getPrimalRays(int maxNumRays) const { debugMessage("OsiGrbSolverInterface::getPrimalRays(%d)\n", maxNumRays); return std::vector(); } //############################################################################# // Problem modifying methods (rim vectors) //############################################################################# void OsiGrbSolverInterface::setObjCoeff( int elementIndex, double elementValue ) { debugMessage("OsiGrbSolverInterface::setObjCoeff(%d, %g)\n", elementIndex, elementValue); GUROBI_CALL( "setObjCoeff", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_OBJ, nauxcols ? colmap_O2G[elementIndex] : elementIndex, elementValue) ); if(obj_ != NULL) obj_[elementIndex] = elementValue; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList) { debugMessage("OsiGrbSolverInterface::setObjCoeffSet(%p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)coeffList); const int cnt = (int)(indexLast - indexFirst); if( cnt == 0 ) return; if( cnt == 1 ) { setObjCoeff(*indexFirst, *coeffList); return; } assert(cnt > 1); if( nauxcols ) { int* indices = new int[cnt]; for( int i = 0; i < cnt; ++i ) indices[i] = colmap_O2G[indexFirst[i]]; GUROBI_CALL( "setObjCoeffSet", GRBsetdblattrlist(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_OBJ, cnt, indices, const_cast(coeffList)) ); delete[] indices; } else { GUROBI_CALL( "setObjCoeffSet", GRBsetdblattrlist(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_OBJ, cnt, const_cast(indexFirst), const_cast(coeffList)) ); } if (obj_ != NULL) for (int i = 0; i < cnt; ++i) obj_[indexFirst[i]] = coeffList[i]; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setColLower(int elementIndex, double elementValue) { debugMessage("OsiGrbSolverInterface::setColLower(%d, %g)\n", elementIndex, elementValue); GUROBI_CALL( "setColLower", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_LB, nauxcols ? colmap_O2G[elementIndex] : elementIndex, elementValue) ); if(collower_ != NULL) collower_[elementIndex] = elementValue; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setColUpper(int elementIndex, double elementValue) { debugMessage("OsiGrbSolverInterface::setColUpper(%d, %g)\n", elementIndex, elementValue); GUROBI_CALL( "setColUpper", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_UB, nauxcols ? colmap_O2G[elementIndex] : elementIndex, elementValue) ); if(colupper_ != NULL) colupper_[elementIndex] = elementValue; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setColBounds( int elementIndex, double lower, double upper ) { debugMessage("OsiGrbSolverInterface::setColBounds(%d, %g, %g)\n", elementIndex, lower, upper); setColLower(elementIndex, lower); setColUpper(elementIndex, upper); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { debugMessage("OsiGrbSolverInterface::setColSetBounds(%p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)boundList); const int cnt = (int)(indexLast - indexFirst); if (cnt == 0) return; if (cnt == 1) { setColLower(*indexFirst, boundList[0]); setColUpper(*indexFirst, boundList[1]); return; } assert(cnt > 1); double* lbList = new double[cnt]; double* ubList = new double[cnt]; int* indices = nauxcols ? new int[cnt] : NULL; for (int i = 0; i < cnt; ++i) { lbList[i] = boundList[2*i]; ubList[i] = boundList[2*i+1]; if( indices ) indices[i] = colmap_O2G[indexFirst[i]]; if(collower_ != NULL) collower_[indexFirst[i]] = boundList[2*i]; if(colupper_ != NULL) colupper_[indexFirst[i]] = boundList[2*i+1]; } GUROBI_CALL( "setColSetBounds", GRBsetdblattrlist(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_LB, cnt, indices ? indices : const_cast(indexFirst), lbList) ); GUROBI_CALL( "setColSetBounds", GRBsetdblattrlist(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_UB, cnt, indices ? indices : const_cast(indexFirst), ubList) ); delete[] lbList; delete[] ubList; delete[] indices; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setRowLower( int i, double elementValue ) { debugMessage("OsiGrbSolverInterface::setRowLower(%d, %g)\n", i, elementValue); double rhs = getRightHandSide()[i]; double range = getRowRange()[i]; char sense = getRowSense()[i]; double lower = 0, upper = 0; convertSenseToBound( sense, rhs, range, lower, upper ); if( lower != elementValue ) { convertBoundToSense( elementValue, upper, sense, rhs, range ); setRowType( i, sense, rhs, range ); } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setRowUpper( int i, double elementValue ) { debugMessage("OsiGrbSolverInterface::setRowUpper(%d, %g)\n", i, elementValue); double rhs = getRightHandSide()[i]; double range = getRowRange()[i]; char sense = getRowSense()[i]; double lower = 0, upper = 0; convertSenseToBound( sense, rhs, range, lower, upper ); if( upper != elementValue ) { convertBoundToSense( lower, elementValue, sense, rhs, range ); setRowType( i, sense, rhs, range ); } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setRowBounds( int elementIndex, double lower, double upper ) { debugMessage("OsiGrbSolverInterface::setRowBounds(%d, %g, %g)\n", elementIndex, lower, upper); double rhs, range; char sense; convertBoundToSense( lower, upper, sense, rhs, range ); setRowType( elementIndex, sense, rhs, range ); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setRowType(int i, char sense, double rightHandSide, double range) { debugMessage("OsiGrbSolverInterface::setRowType(%d, %c, %g, %g)\n", i, sense, rightHandSide, range); GUROBI_CALL( "setRowType", GRBupdatemodel(getMutableLpPtr()) ); if( nauxcols && auxcolind[i] >= 0 ) { // so far, row i is a ranged row switch (sense) { case 'R': // row i was ranged row and remains a ranged row assert(range > 0); GUROBI_CALL( "setRowType", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_LB, auxcolind[i], rightHandSide - range) ); GUROBI_CALL( "setRowType", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_UB, auxcolind[i], rightHandSide ) ); break; case 'N': case 'L': case 'G': case 'E': convertToNormalRow(i, sense, rightHandSide); break; default: std::cerr << "Unknown row sense: " << sense << std::endl; exit(-1); } } else if (sense == 'R') { convertToRangedRow(i, rightHandSide, range); } else { char grbsense; switch (sense) { case 'N': grbsense = GRB_LESS_EQUAL; rightHandSide = getInfinity(); break; case 'L': grbsense = GRB_LESS_EQUAL; break; case 'G': grbsense = GRB_GREATER_EQUAL; break; case 'E': grbsense = GRB_EQUAL; break; default: std::cerr << "Unknown row sense: " << sense << std::endl; exit(-1); } GUROBI_CALL( "setRowType", GRBsetcharattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_CHAR_ATTR_SENSE, i, grbsense ) ); GUROBI_CALL( "setRowType", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_RHS, i, rightHandSide) ); } if(rowsense_ != NULL) rowsense_[i] = sense; if(rhs_ != NULL) rhs_[i] = rightHandSide; if (rowlower_ != NULL || rowupper_ != NULL) { double dummy; convertSenseToBound(sense, rightHandSide, range, rowlower_ ? rowlower_[i] : dummy, rowupper_ ? rowupper_[i] : dummy); } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { debugMessage("OsiGrbSolverInterface::setRowSetBounds(%p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)boundList); const long int cnt = indexLast - indexFirst; if (cnt <= 0) return; char* sense = new char[cnt]; double* rhs = new double[cnt]; double* range = new double[cnt]; for (int i = 0; i < cnt; ++i) convertBoundToSense(boundList[2*i], boundList[2*i+1], sense[i], rhs[i], range[i]); setRowSetTypes(indexFirst, indexLast, sense, rhs, range); delete[] range; delete[] rhs; delete[] sense; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList) { debugMessage("OsiGrbSolverInterface::setRowSetTypes(%p, %p, %p, %p, %p)\n", (void*)indexFirst, (void*)indexLast, (void*)senseList, (void*)rhsList, (void*)rangeList); const int cnt = (int)(indexLast - indexFirst); if (cnt == 0) return; if (cnt == 1) { setRowType(*indexFirst, *senseList, *rhsList, *rangeList); return; } assert(cnt > 0); GUROBI_CALL( "setRowSetTypes", GRBupdatemodel(getMutableLpPtr()) ); char* grbsense = new char[cnt]; double* rhs = new double[cnt]; for (int i = 0; i < cnt; ++i) { rhs[i] = rhsList[i]; if( nauxcols && auxcolind[indexFirst[i]] >= 0 ) { // so far, row is a ranged row switch (senseList[i]) { case 'R': // row i was ranged row and remains a ranged row assert(rangeList[i] > 0); GUROBI_CALL( "setRowSetTypes", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_LB, auxcolind[indexFirst[i]], rhsList[i] - rangeList[i]) ); GUROBI_CALL( "setRowSetTypes", GRBsetdblattrelement(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), GRB_DBL_ATTR_UB, auxcolind[indexFirst[i]], rhsList[i] ) ); grbsense[i] = GRB_EQUAL; rhs[i] = 0.0; break; case 'N': convertToNormalRow(indexFirst[i], senseList[i], rhsList[i]); grbsense[i] = GRB_LESS_EQUAL; rhs[i] = getInfinity(); break; case 'L': convertToNormalRow(indexFirst[i], senseList[i], rhsList[i]); grbsense[i] = GRB_LESS_EQUAL; break; case 'G': convertToNormalRow(indexFirst[i], senseList[i], rhsList[i]); grbsense[i] = GRB_GREATER_EQUAL; break; case 'E': convertToNormalRow(indexFirst[i], senseList[i], rhsList[i]); grbsense[i] = GRB_EQUAL; break; default: std::cerr << "Unknown row sense: " << senseList[i] << std::endl; exit(-1); } } else if (senseList[i] == 'R') { convertToRangedRow(indexFirst[i], rhsList[i], rangeList[i]); grbsense[i] = GRB_EQUAL; rhs[i] = 0.0; } else { switch (senseList[i]) { case 'N': grbsense[i] = GRB_LESS_EQUAL; rhs[i] = getInfinity(); break; case 'L': grbsense[i] = GRB_LESS_EQUAL; break; case 'G': grbsense[i] = GRB_GREATER_EQUAL; break; case 'E': grbsense[i] = GRB_EQUAL; break; default: std::cerr << "Unknown row sense: " << senseList[i] << std::endl; exit(-1); } } if(rowsense_ != NULL) rowsense_[indexFirst[i]] = senseList[i]; if(rhs_ != NULL) rhs_[indexFirst[i]] = senseList[i] == 'N' ? getInfinity() : rhsList[i]; } GUROBI_CALL( "setRowSetTypes", GRBsetcharattrlist(getLpPtr(OsiGrbSolverInterface::KEEPCACHED_ROW), GRB_CHAR_ATTR_SENSE, cnt, const_cast(indexFirst), grbsense) ); GUROBI_CALL( "setRowSetTypes", GRBsetdblattrlist(getLpPtr(OsiGrbSolverInterface::KEEPCACHED_ROW), GRB_DBL_ATTR_RHS, cnt, const_cast(indexFirst), rhs) ); delete[] rhs; delete[] grbsense; } //############################################################################# void OsiGrbSolverInterface::setContinuous(int index) { debugMessage("OsiGrbSolverInterface::setContinuous(%d)\n", index); assert(coltype_ != NULL); assert(colspace_ >= getNumCols()); coltype_[index] = GRB_CONTINUOUS; if ( probtypemip_ ) { GUROBI_CALL( "setContinuous", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "setContinuous", GRBsetcharattrelement(getMutableLpPtr(), GRB_CHAR_ATTR_VTYPE, nauxcols ? colmap_O2G[index] : index, GRB_CONTINUOUS) ); } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setInteger(int index) { debugMessage("OsiGrbSolverInterface::setInteger(%d)\n", index); assert(coltype_ != NULL); assert(colspace_ >= getNumCols()); if( getColLower()[index] == 0.0 && getColUpper()[index] == 1.0 ) coltype_[index] = GRB_BINARY; else coltype_[index] = GRB_INTEGER; if ( probtypemip_ ) { GUROBI_CALL( "setInteger", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "setInteger", GRBsetcharattrelement(getMutableLpPtr(), GRB_CHAR_ATTR_VTYPE, nauxcols ? colmap_O2G[index] : index, coltype_[index]) ); } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setContinuous(const int* indices, int len) { debugMessage("OsiGrbSolverInterface::setContinuous(%p, %d)\n", (void*)indices, len); for( int i = 0; i < len; ++i ) setContinuous(indices[i]); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setInteger(const int* indices, int len) { debugMessage("OsiGrbSolverInterface::setInteger(%p, %d)\n", (void*)indices, len); for( int i = 0; i < len; ++i ) setInteger(indices[i]); } //############################################################################# void OsiGrbSolverInterface::setRowName(int ndx, std::string name) { debugMessage("OsiGrbSolverInterface::setRowName\n"); if (ndx < 0 || ndx >= getNumRows()) return; int nameDiscipline ; getIntParam(OsiNameDiscipline, nameDiscipline); if (nameDiscipline == 0) return; OsiSolverInterface::setRowName(ndx, name); GUROBI_CALL( "setRowName", GRBsetstrattrelement(getLpPtr(), GRB_STR_ATTR_CONSTRNAME, ndx, const_cast(name.c_str())) ); } void OsiGrbSolverInterface::setColName(int ndx, std::string name) { debugMessage("OsiGrbSolverInterface::setColName\n"); if (ndx < 0 || ndx >= getNumCols()) return; int nameDiscipline ; getIntParam(OsiNameDiscipline, nameDiscipline); if (nameDiscipline == 0) return; OsiSolverInterface::setColName(ndx, name); GUROBI_CALL( "setColName", GRBsetstrattrelement(getLpPtr(), GRB_STR_ATTR_VARNAME, nauxcols ? colmap_O2G[ndx] : ndx, const_cast(name.c_str())) ); } //############################################################################# void OsiGrbSolverInterface::setObjSense(double s) { debugMessage("OsiGrbSolverInterface::setObjSense(%g)\n", s); GUROBI_CALL( "setObjSense", GRBsetintattr(getLpPtr( OsiGrbSolverInterface::FREECACHED_RESULTS ), GRB_INT_ATTR_MODELSENSE, (int)s) ); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setColSolution(const double * cs) { debugMessage("OsiGrbSolverInterface::setColSolution(%p)\n", (void*)cs); int nc = getNumCols(); if( cs == NULL ) freeCachedResults(); else if( nc > 0 ) { // If colsol isn't allocated, then allocate it if ( colsol_ == NULL ) colsol_ = new double[nc]; // Copy in new col solution. CoinDisjointCopyN( cs, nc, colsol_ ); //*messageHandler() << "OsiGrb::setColSolution: Gurobi does not allow setting the column solution. Command is ignored." << CoinMessageEol; } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::setRowPrice(const double * rs) { debugMessage("OsiGrbSolverInterface::setRowPrice(%p)\n", (void*)rs); int nr = getNumRows(); if( rs == NULL ) freeCachedResults(); else if( nr > 0 ) { // If rowsol isn't allocated, then allocate it if ( rowsol_ == NULL ) rowsol_ = new double[nr]; // Copy in new row solution. CoinDisjointCopyN( rs, nr, rowsol_ ); *messageHandler() << "OsiGrb::setRowPrice: Gurobi does not allow setting the row price. Command is ignored." << CoinMessageEol; } } //############################################################################# // Problem modifying methods (matrix) //############################################################################# void OsiGrbSolverInterface::addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) { debugMessage("OsiGrbSolverInterface::addCol(%p, %g, %g, %g)\n", (void*)&vec, collb, colub, obj); int nc = getNumCols(); assert(colspace_ >= nc); resizeColSpace(nc + 1); coltype_[nc] = GRB_CONTINUOUS; GUROBI_CALL( "addCol", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "addCol", GRBaddvar(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_ROW ), vec.getNumElements(), const_cast(vec.getIndices()), const_cast(vec.getElements()), obj, collb, colub, coltype_[nc], NULL) ); if( nauxcols ) { colmap_O2G[nc] = nc + nauxcols; colmap_G2O[nc + nauxcols] = nc; } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj) { debugMessage("OsiGrbSolverInterface::addCols(%d, %p, %p, %p, %p)\n", numcols, (void*)cols, (void*)collb, (void*)colub, (void*)obj); int nc = getNumCols(); assert(colspace_ >= nc); resizeColSpace(nc + numcols); CoinFillN(&coltype_[nc], numcols, GRB_CONTINUOUS); int i; int nz = 0; for (i = 0; i < numcols; ++i) nz += cols[i]->getNumElements(); int* index = new int[nz]; double* elem = new double[nz]; int* start = new int[numcols+1]; nz = 0; start[0] = 0; for (i = 0; i < numcols; ++i) { const CoinPackedVectorBase* col = cols[i]; const int len = col->getNumElements(); CoinDisjointCopyN(col->getIndices(), len, index+nz); CoinDisjointCopyN(col->getElements(), len, elem+nz); nz += len; start[i+1] = nz; } GUROBI_CALL( "addCols", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "addCols", GRBaddvars(getLpPtr(OsiGrbSolverInterface::KEEPCACHED_ROW), numcols, nz, start, index, elem, const_cast(obj), const_cast(collb), const_cast(colub), NULL, NULL) ); delete[] start; delete[] elem; delete[] index; if( nauxcols ) for( i = 0; i < numcols; ++i ) { colmap_O2G[nc+i] = nc+i + nauxcols; colmap_G2O[nc+i + nauxcols] = nc+i; } } static int intcompare(const void* p1, const void* p2) { return (*(const int*)p1) - (*(const int*)p2); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::deleteCols(const int num, const int * columnIndices) { debugMessage("OsiGrbSolverInterface::deleteCols(%d, %p)\n", num, (void*)columnIndices); if( num == 0 ) return; GUROBI_CALL( "deleteCols", GRBupdatemodel(getMutableLpPtr()) ); int* ind = NULL; if( nauxcols ) { int nc = getNumCols(); ind = new int[num]; // translate into gurobi indices and sort for( int i = 0; i < num; ++i ) ind[i] = colmap_O2G[columnIndices[i]]; qsort((void*)ind, num, sizeof(int), intcompare); // delete indices in gurobi GUROBI_CALL( "deleteCols", GRBdelvars(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_ROW ), num, ind) ); nc -= num; // update colmap_G2O and auxcolind int offset = 0; int j = 0; for( int i = ind[0]; i < nc + nauxcols; ++i ) { if( j < num && i == ind[j] ) { // variable i has been deleted, increase offset by 1 assert(colmap_G2O[i] >= 0); ++offset; while( j < num && i == ind[j] ) ++j; } // variable from position i+offset has moved to position i if( colmap_G2O[i+offset] >= 0 ) { // if variable at (hithero) position i+offset was a regular variable, then it is now stored at position i // substract offset since variable indices also changed in Osi colmap_G2O[i] = colmap_G2O[i+offset] - offset; assert(colmap_G2O[i] >= 0); // update also colmap_O2G colmap_O2G[colmap_G2O[i]] = i; } else { // if variable at (hithero) position i+offset was an auxiliary variable, then the corresponding row index is now stored at position i int rngrowidx = -colmap_G2O[i+offset]-1; assert(auxcolind[rngrowidx] == i+offset); colmap_G2O[i] = colmap_G2O[i+offset]; // update also auxcolind to point to position i now auxcolind[rngrowidx] = i; } } } else { GUROBI_CALL( "deleteCols", GRBdelvars(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_ROW ), num, const_cast(columnIndices)) ); } #ifndef NDEBUG if( nauxcols ) { int nc = getNumCols(); int nr = getNumRows(); for( int i = 0; i < nc + nauxcols; ++i ) { assert(i >= nc || colmap_G2O[colmap_O2G[i]] == i); assert(colmap_G2O[i] < 0 || colmap_O2G[colmap_G2O[i]] == i); assert(colmap_G2O[i] >= 0 || -colmap_G2O[i]-1 < nr); assert(colmap_G2O[i] >= 0 || auxcolind[-colmap_G2O[i]-1] == i); } } #endif if (coltype_) { delete[] coltype_; coltype_ = NULL; } if( !getColNames().empty() ) { if( ind == NULL ) ind = new int[num]; memcpy(ind, columnIndices, num * sizeof(int)); qsort((void*)ind, num, sizeof(int), intcompare); for( int i = num-1; i >= 0; --i ) deleteColNames(ind[i], 1); } delete[] ind; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub) { debugMessage("OsiGrbSolverInterface::addRow(%p, %g, %g)\n", (void*)&vec, rowlb, rowub); char sense; double rhs, range; convertBoundToSense( rowlb, rowub, sense, rhs, range ); addRow( vec, sense, rhs, range ); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) { debugMessage("OsiGrbSolverInterface::addRow(%p, %c, %g, %g)\n", (void*)&vec, rowsen, rowrhs, rowrng); char grbsense; double rhs = rowrhs; switch( rowsen ) { case 'R': /* ranged rows are added as equality rows first, and then an auxiliary variable is added */ assert(rowrng > 0.0); grbsense = GRB_EQUAL; rhs = 0.0; break; case 'N': grbsense = GRB_LESS_EQUAL; rhs = getInfinity(); break; case 'L': grbsense = GRB_LESS_EQUAL; break; case 'G': grbsense = GRB_GREATER_EQUAL; break; case 'E': grbsense = GRB_EQUAL; break; default: std::cerr << "Unknown row sense: " << rowsen << std::endl; exit(-1); } GUROBI_CALL( "addRow", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "addRow", GRBaddconstr(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_COLUMN ), vec.getNumElements(), const_cast(vec.getIndices()), const_cast(vec.getElements()), grbsense, rhs, NULL) ); if( rowsen == 'R' ) convertToRangedRow(getNumRows()-1, rowrhs, rowrng); else if( nauxcols ) resizeAuxColIndSpace(); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub) { debugMessage("OsiGrbSolverInterface::addRows(%d, %p, %p, %p)\n", numrows, (void*)rows, (void*)rowlb, (void*)rowub); int i; int nz = 0; for (i = 0; i < numrows; ++i) nz += rows[i]->getNumElements(); int* index = new int[nz]; double* elem = new double[nz]; int* start = new int[numrows+1]; char* grbsense = new char[numrows]; double* rhs = new double[numrows]; double range; bool haverangedrows = false; nz = 0; start[0] = 0; for (i = 0; i < numrows; ++i) { const CoinPackedVectorBase* row = rows[i]; const int len = row->getNumElements(); CoinDisjointCopyN(row->getIndices(), len, index+nz); CoinDisjointCopyN(row->getElements(), len, elem+nz); nz += len; start[i+1] = nz; convertBoundToSense( rowlb[i], rowub[i], grbsense[i], rhs[i], range ); if (range || grbsense[i] == 'R') { grbsense[i] = 'E'; rhs[i] = 0.0; haverangedrows = true; } switch (grbsense[i]) { case 'N': grbsense[i] = GRB_LESS_EQUAL; rhs[i] = getInfinity(); break; case 'L': grbsense[i] = GRB_LESS_EQUAL; break; case 'G': grbsense[i] = GRB_GREATER_EQUAL; break; case 'E': grbsense[i] = GRB_EQUAL; break; } } GUROBI_CALL( "addRows", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "addRows", GRBaddconstrs(getLpPtr(OsiGrbSolverInterface::KEEPCACHED_ROW), numrows, nz, start, index, elem, grbsense, rhs, NULL) ); delete[] start; delete[] elem; delete[] index; delete[] grbsense; delete[] rhs; if( haverangedrows ) { int nr = getNumRows() - numrows; for( i = 0; i < numrows; ++i ) if( rowlb[i] > getInfinity() && rowub[i] < getInfinity() && rowub[i] - rowlb[i] > 0.0 ) convertToRangedRow(nr + i, rowub[i], rowub[i] - rowlb[i]); } else if( nauxcols ) resizeAuxColIndSpace(); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng) { debugMessage("OsiGrbSolverInterface::addRows(%d, %p, %p, %p, %p)\n", numrows, (void*)rows, (void*)rowsen, (void*)rowrhs, (void*)rowrng); int i; int nz = 0; for (i = 0; i < numrows; ++i) nz += rows[i]->getNumElements(); int* index = new int[nz]; double* elem = new double[nz]; int* start = new int[numrows+1]; char* grbsense = new char[numrows]; double* rhs = new double[numrows]; bool haverangedrows = false; nz = 0; start[0] = 0; for (i = 0; i < numrows; ++i) { const CoinPackedVectorBase* row = rows[i]; const int len = row->getNumElements(); CoinDisjointCopyN(row->getIndices(), len, index+nz); CoinDisjointCopyN(row->getElements(), len, elem+nz); nz += len; start[i+1] = nz; rhs[i] = rowrhs[i]; switch (rowsen[i]) { case 'R': assert(rowrng[i] > 0.0); grbsense[i] = GRB_EQUAL; rhs[i] = 0.0; haverangedrows = true; break; case 'N': grbsense[i] = GRB_LESS_EQUAL; rhs[i] = getInfinity(); break; case 'L': grbsense[i] = GRB_LESS_EQUAL; break; case 'G': grbsense[i] = GRB_GREATER_EQUAL; break; case 'E': grbsense[i] = GRB_EQUAL; break; } } GUROBI_CALL( "addRows", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "addRows", GRBaddconstrs(getLpPtr(OsiGrbSolverInterface::KEEPCACHED_ROW), numrows, nz, start, index, elem, grbsense, rhs, NULL) ); delete[] start; delete[] elem; delete[] index; delete[] grbsense; delete[] rhs; if( haverangedrows ) { int nr = getNumRows() - numrows; for( i = 0; i < numrows; ++i ) if( rowsen[i] == 'R' ) convertToRangedRow(nr + i, rowrhs[i], rowrng[i]); } else if( nauxcols ) resizeAuxColIndSpace(); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::deleteRows(const int num, const int * rowIndices) { debugMessage("OsiGrbSolverInterface::deleteRows(%d, %p)\n", num, (void*)rowIndices); if( nauxcols ) { // check if a ranged row should be deleted; if so, then convert it into a normal row first for( int i = 0; i < num; ++i ) { if( auxcolind[rowIndices[i]] >= 0 ) convertToNormalRow(rowIndices[i], 'E', 0.0); } } GUROBI_CALL( "deleteRows", GRBdelconstrs(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_COLUMN ), num, const_cast(rowIndices)) ); if( nauxcols == 0 && getRowNames().empty() ) return; int* ind = CoinCopyOfArray(rowIndices, num); qsort((void*)ind, num, sizeof(int), intcompare); if( nauxcols ) { int nr = getNumRows(); int offset = 0; int j = 0; for( int i = 0; i < nr; ++i ) { if( j < num && i == ind[j] ) { ++offset; while( j < num && i == ind[j] ) ++j; } auxcolind[i] = auxcolind[i + offset]; if( auxcolind[i] >= 0 ) colmap_G2O[auxcolind[i]] = - i - 1; } } #ifndef NDEBUG if( nauxcols ) { int nc = getNumCols(); int nr = getNumRows(); for( int i = 0; i < nc + nauxcols; ++i ) { assert(i >= nc || colmap_G2O[colmap_O2G[i]] == i); assert(colmap_G2O[i] < 0 || colmap_O2G[colmap_G2O[i]] == i); assert(colmap_G2O[i] >= 0 || -colmap_G2O[i]-1 < nr); assert(colmap_G2O[i] >= 0 || auxcolind[-colmap_G2O[i]-1] == i); } } #endif if( !getRowNames().empty() ) for( int i = num-1; i >=0; --i ) deleteRowNames(ind[i], 1); delete[] ind; } //############################################################################# // Methods to input a problem //############################################################################# void OsiGrbSolverInterface::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { debugMessage("OsiGrbSolverInterface::loadProblem(1)(%p, %p, %p, %p, %p, %p)\n", (void*)&matrix, (void*)collb, (void*)colub, (void*)obj, (void*)rowlb, (void*)rowub); const double inf = getInfinity(); int nrows = matrix.getNumRows(); char * rowSense = new char [nrows]; double * rowRhs = new double[nrows]; double * rowRange = new double[nrows]; int i; for ( i = nrows - 1; i >= 0; --i ) { const double lower = rowlb ? rowlb[i] : -inf; const double upper = rowub ? rowub[i] : inf; convertBoundToSense( lower, upper, rowSense[i], rowRhs[i], rowRange[i] ); } loadProblem( matrix, collb, colub, obj, rowSense, rowRhs, rowRange ); delete [] rowSense; delete [] rowRhs; delete [] rowRange; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub ) { debugMessage("OsiGrbSolverInterface::assignProblem()\n"); loadProblem( *matrix, collb, colub, obj, rowlb, rowub ); delete matrix; matrix = 0; delete[] collb; collb = 0; delete[] colub; colub = 0; delete[] obj; obj = 0; delete[] rowlb; rowlb = 0; delete[] rowub; rowub = 0; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::loadProblem( const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { debugMessage("OsiGrbSolverInterface::loadProblem(2)(%p, %p, %p, %p, %p, %p, %p)\n", (void*)&matrix, (void*)collb, (void*)colub, (void*)obj, (void*)rowsen, (void*)rowrhs, (void*)rowrng); int nc = matrix.getNumCols(); int nr = matrix.getNumRows(); int i; char* myrowsen = new char[nr]; double* myrowrhs = new double[nr]; bool haverangedrows = false; for ( i = 0; i < nr; ++i ) { if (rowrhs) myrowrhs[i] = rowrhs[i]; else myrowrhs[i] = 0.0; if (rowsen) switch (rowsen[i]) { case 'R': assert( rowrng && rowrng[i] > 0.0 ); myrowsen[i] = GRB_EQUAL; myrowrhs[i] = 0.0; haverangedrows = true; break; case 'N': myrowsen[i] = GRB_LESS_EQUAL; myrowrhs[i] = getInfinity(); break; case 'L': myrowsen[i] = GRB_LESS_EQUAL; break; case 'G': myrowsen[i] = GRB_GREATER_EQUAL; break; case 'E': myrowsen[i] = GRB_EQUAL; break; } else myrowsen[i] = 'G'; } // Set column values to defaults if NULL pointer passed double * clb; double * cub; double * ob; if ( collb != NULL ) clb = const_cast(collb); else { clb = new double[nc]; CoinFillN(clb, nc, 0.0); } if ( colub!=NULL ) cub = const_cast(colub); else { cub = new double[nc]; CoinFillN(cub, nc, getInfinity()); } if ( obj!=NULL ) ob = const_cast(obj); else { ob = new double[nc]; CoinFillN(ob, nc, 0.0); } bool freeMatrixRequired = false; CoinPackedMatrix * m = NULL; if( !matrix.isColOrdered() ) { m = new CoinPackedMatrix(); m->reverseOrderedCopyOf(matrix); freeMatrixRequired = true; } else m = const_cast(&matrix); // up to GUROBI 2.0.1, GUROBI may give an "Index is out of range" error if the constraint matrix has uninitalized "gaps" #if (GRB_VERSION_MAJOR < 2) || (GRB_VERSION_MAJOR == 2 && GRB_VERSION_MINOR == 0 && GRB_VERSION_TECHNICAL <= 1) if ( m->hasGaps() ) { if( freeMatrixRequired ) { m->removeGaps(); } else { m = new CoinPackedMatrix(matrix); if( m->hasGaps() ) m->removeGaps(); freeMatrixRequired = true; } } #endif assert( nc == m->getNumCols() ); assert( nr == m->getNumRows() ); assert( m->isColOrdered() ); int modelsense; GUROBI_CALL( "loadProblem", GRBupdatemodel(getMutableLpPtr()) ); GUROBI_CALL( "loadProblem", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_MODELSENSE, &modelsense) ); std::string pn; getStrParam(OsiProbName, pn); gutsOfDestructor(); // kill old LP, if any GUROBI_CALL( "loadProblem", GRBloadmodel(getEnvironmentPtr(), &lp_, const_cast(pn.c_str()), nc, nr, modelsense, 0.0, ob, const_cast(myrowsen), myrowrhs, const_cast(m->getVectorStarts()), const_cast(m->getVectorLengths()), const_cast(m->getIndices()), const_cast(m->getElements()), const_cast(clb), const_cast(cub), NULL, NULL, NULL) ); // GUROBI up to version 2.0.1 may return a scaled LP after GRBoptimize when requesting it via GRBgetvars #if (GRB_VERSION_MAJOR < 2) || (GRB_VERSION_MAJOR == 2 && GRB_VERSION_MINOR == 0 && GRB_VERSION_TECHNICAL <= 1) setHintParam(OsiDoScale, false); #endif delete[] myrowsen; delete[] myrowrhs; if ( collb == NULL ) delete[] clb; if ( colub == NULL ) delete[] cub; if ( obj == NULL ) delete[] ob; if ( freeMatrixRequired ) delete m; resizeColSpace(nc); CoinFillN(coltype_, nc, GRB_CONTINUOUS); if( haverangedrows ) { assert(rowrhs); assert(rowrng); assert(rowsen); for ( i = 0; i < nr; ++i ) if( rowsen[i] == 'R' ) convertToRangedRow(i, rowrhs[i], rowrng[i]); } } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::assignProblem( CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng ) { debugMessage("OsiGrbSolverInterface::assignProblem()\n"); loadProblem( *matrix, collb, colub, obj, rowsen, rowrhs, rowrng ); delete matrix; matrix = NULL; delete[] collb; collb = NULL; delete[] colub; colub = NULL; delete[] obj; obj = NULL; delete[] rowsen; rowsen = NULL; delete[] rowrhs; rowrhs = NULL; delete[] rowrng; rowrng = NULL; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub ) { debugMessage("OsiGrbSolverInterface::loadProblem(3)()\n"); const double inf = getInfinity(); char * rowSense = new char [numrows]; double * rowRhs = new double[numrows]; double * rowRange = new double[numrows]; for ( int i = numrows - 1; i >= 0; --i ) { const double lower = rowlb ? rowlb[i] : -inf; const double upper = rowub ? rowub[i] : inf; convertBoundToSense( lower, upper, rowSense[i], rowRhs[i], rowRange[i] ); } loadProblem(numcols, numrows, start, index, value, collb, colub, obj, rowSense, rowRhs, rowRange); delete [] rowSense; delete [] rowRhs; delete [] rowRange; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng ) { debugMessage("OsiGrbSolverInterface::loadProblem(4)(%d, %d, %p, %p, %p, %p, %p, %p, %p, %p, %p)\n", numcols, numrows, (void*)start, (void*)index, (void*)value, (void*)collb, (void*)colub, (void*)obj, (void*)rowsen, (void*)rowrhs, (void*)rowrng); int nc = numcols; int nr = numrows; int i; char* myrowsen = new char[nr]; double* myrowrhs = new double[nr]; bool haverangedrows = false; for ( i=0; i 0.0); myrowsen[i] = GRB_EQUAL; myrowrhs[i] = 0.0; haverangedrows = true; break; case 'N': myrowsen[i] = GRB_LESS_EQUAL; myrowrhs[i] = getInfinity(); break; case 'L': myrowsen[i] = GRB_LESS_EQUAL; break; case 'G': myrowsen[i] = GRB_GREATER_EQUAL; break; case 'E': myrowsen[i] = GRB_EQUAL; break; } else myrowsen[i] = 'G'; } // Set column values to defaults if NULL pointer passed double * clb; double * cub; double * ob; if ( collb != NULL ) clb = const_cast(collb); else { clb = new double[nc]; CoinFillN(clb, nc, 0.0); } if ( colub!=NULL ) cub = const_cast(colub); else { cub = new double[nc]; CoinFillN(cub, nc, getInfinity()); } if ( obj!=NULL ) ob = const_cast(obj); else { ob = new double[nc]; CoinFillN(ob, nc, 0.0); } int* len = new int[nc]; for (i = 0; i < nc; ++i) len[i] = start[i+1] - start[i]; GUROBI_CALL( "loadProblem", GRBupdatemodel(getMutableLpPtr()) ); int modelsense; GUROBI_CALL( "loadProblem", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_MODELSENSE, &modelsense) ); std::string pn; getStrParam(OsiProbName, pn); gutsOfDestructor(); // kill old LP, if any GUROBI_CALL( "loadProblem", GRBloadmodel(getEnvironmentPtr(), &lp_, const_cast(pn.c_str()), nc, nr, modelsense, 0.0, ob, myrowsen, myrowrhs, const_cast(start), len, const_cast(index), const_cast(value), const_cast(clb), const_cast(cub), NULL, NULL, NULL) ); // GUROBI up to version 2.0.1 may return a scaled LP after GRBoptimize when requesting it via GRBgetvars #if (GRB_VERSION_MAJOR < 2) || (GRB_VERSION_MAJOR == 2 && GRB_VERSION_MINOR == 0 && GRB_VERSION_TECHNICAL <= 1) setHintParam(OsiDoScale, false); #endif delete[] myrowsen; delete[] myrowrhs; if ( collb == NULL ) delete[] clb; if ( colub == NULL ) delete[] cub; if ( obj == NULL ) delete[] ob; delete[] len; resizeColSpace(nc); CoinFillN(coltype_, nc, GRB_CONTINUOUS); if( haverangedrows ) { assert(rowrhs); assert(rowrng); assert(rowsen); for ( i = 0; i < nr; ++i ) if( rowsen[i] == 'R' ) convertToRangedRow(i, rowrhs[i], rowrng[i]); } } //----------------------------------------------------------------------------- // Read mps files //----------------------------------------------------------------------------- int OsiGrbSolverInterface::readMps( const char * filename, const char * extension ) { debugMessage("OsiGrbSolverInterface::readMps(%s, %s)\n", filename, extension); // just call base class method return OsiSolverInterface::readMps(filename,extension); } //----------------------------------------------------------------------------- // Write mps files //----------------------------------------------------------------------------- void OsiGrbSolverInterface::writeMps( const char * filename, const char * extension, double objSense ) const { debugMessage("OsiGrbSolverInterface::writeMps(%s, %s, %g)\n", filename, extension, objSense); std::string f(filename); std::string e(extension); std::string fullname = f + "." + e; //TODO give row and column names? writeMpsNative(fullname.c_str(), NULL, NULL); // do not call Gurobi's MPS writer, because // 1. it only writes mps if the extension is mps // 2. the instance in Gurobi may have extra columns due to reformulated ranged rows, that may be confusing // GUROBI_CALL( "writeMps", GRBwrite(getMutableLpPtr(), const_cast(fullname.c_str())) ); } //############################################################################# // CPX specific public interfaces //############################################################################# GRBenv* OsiGrbSolverInterface::getEnvironmentPtr() const { assert( localenv_ != NULL || globalenv_ != NULL ); return localenv_ ? localenv_ : globalenv_; } GRBmodel* OsiGrbSolverInterface::getLpPtr( int keepCached ) { freeCachedData( keepCached ); return getMutableLpPtr(); } /// Return whether the current Gurobi environment runs in demo mode. bool OsiGrbSolverInterface::isDemoLicense() const { debugMessage("OsiGrbSolverInterface::isDemoLicense()\n"); GRBenv* env = getEnvironmentPtr(); GRBmodel* testlp; // a Gurobi demo license allows to solve only models with up to 500 variables // thus, let's try to create and solve a model with 1000 variables GUROBI_CALL( "isDemoLicense", GRBnewmodel(env, &testlp, "licensetest", 1000, NULL, NULL, NULL, NULL, NULL) ); // GUROBI_CALL( "resolve", GRBsetintparam(GRBgetenv(testlp), GRB_INT_PAR_PRESOLVE, presolve) ); int rc = GRBoptimize(testlp); if(rc == GRB_ERROR_SIZE_LIMIT_EXCEEDED) return true; GUROBI_CALL( "isDemoLicense", rc ); GRBfreemodel(testlp); return false; } //----------------------------------------------------------------------------- const char * OsiGrbSolverInterface::getCtype() const { debugMessage("OsiGrbSolverInterface::getCtype()\n"); return coltype_; } //############################################################################# // Static instance counter methods //############################################################################# void OsiGrbSolverInterface::incrementInstanceCounter() { if ( numInstances_ == 0 && !globalenv_) { GUROBI_CALL( "incrementInstanceCounter", GRBloadenv( &globalenv_, NULL ) ); assert( globalenv_ != NULL ); globalenv_is_ours = true; } numInstances_++; } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::decrementInstanceCounter() { assert( numInstances_ != 0 ); assert( globalenv_ != NULL ); numInstances_--; if ( numInstances_ == 0 && globalenv_is_ours) { GRBfreeenv( globalenv_ ); globalenv_ = NULL; } } //----------------------------------------------------------------------------- unsigned int OsiGrbSolverInterface::getNumInstances() { return numInstances_; } void OsiGrbSolverInterface::setEnvironment(GRBenv* globalenv) { if (numInstances_) { assert(globalenv_); throw CoinError("Cannot set global GUROBI environment, since some OsiGrb instance is still using it.", "setEnvironment", "OsiGrbSolverInterface", __FILE__, __LINE__); } assert(!globalenv_ || !globalenv_is_ours); globalenv_ = globalenv; globalenv_is_ours = false; } //############################################################################# // Constructors, destructors clone and assignment //############################################################################# //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- OsiGrbSolverInterface::OsiGrbSolverInterface(bool use_local_env) : OsiSolverInterface(), localenv_(NULL), lp_(NULL), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(1000000), // ??? default iteration limit for strong branching is large nameDisc_(0), obj_(NULL), collower_(NULL), colupper_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), rowlower_(NULL), rowupper_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), probtypemip_(false), domipstart(false), colspace_(0), coltype_(NULL), nauxcols(0), auxcolspace(0), colmap_O2G(NULL), colmap_G2O(NULL), auxcolindspace(0), auxcolind(NULL) { debugMessage("OsiGrbSolverInterface::OsiGrbSolverInterface()\n"); if (use_local_env) { GUROBI_CALL( "OsiGrbSolverInterface", GRBloadenv( &localenv_, NULL ) ); assert( localenv_ != NULL ); } else incrementInstanceCounter(); gutsOfConstructor(); // change Osi default to Gurobi default setHintParam(OsiDoDualInInitial,true,OsiHintTry); } OsiGrbSolverInterface::OsiGrbSolverInterface(GRBenv* localgrbenv) : OsiSolverInterface(), localenv_(localgrbenv), lp_(NULL), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(1000000), // ??? default iteration limit for strong branching is large nameDisc_(0), obj_(NULL), collower_(NULL), colupper_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), rowlower_(NULL), rowupper_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), probtypemip_(false), domipstart(false), colspace_(0), coltype_(NULL), nauxcols(0), auxcolspace(0), colmap_O2G(NULL), colmap_G2O(NULL), auxcolindspace(0), auxcolind(NULL) { debugMessage("OsiGrbSolverInterface::OsiGrbSolverInterface()\n"); if (localenv_ == NULL) { // if user called this constructor with NULL pointer, we assume that he meant that a local environment should be created GUROBI_CALL( "OsiGrbSolverInterface", GRBloadenv( &localenv_, NULL ) ); assert( localenv_ != NULL ); } gutsOfConstructor(); // change Osi default to Gurobi default setHintParam(OsiDoDualInInitial,true,OsiHintTry); } //---------------------------------------------------------------- // Clone //---------------------------------------------------------------- OsiSolverInterface * OsiGrbSolverInterface::clone(bool copyData) const { debugMessage("OsiGrbSolverInterface::clone(%d)\n", copyData); return( new OsiGrbSolverInterface( *this ) ); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- OsiGrbSolverInterface::OsiGrbSolverInterface( const OsiGrbSolverInterface & source ) : OsiSolverInterface(source), localenv_(NULL), lp_(NULL), hotStartCStat_(NULL), hotStartCStatSize_(0), hotStartRStat_(NULL), hotStartRStatSize_(0), hotStartMaxIteration_(source.hotStartMaxIteration_), nameDisc_(source.nameDisc_), obj_(NULL), collower_(NULL), colupper_(NULL), rowsense_(NULL), rhs_(NULL), rowrange_(NULL), rowlower_(NULL), rowupper_(NULL), colsol_(NULL), rowsol_(NULL), redcost_(NULL), rowact_(NULL), matrixByRow_(NULL), matrixByCol_(NULL), probtypemip_(false), domipstart(false), colspace_(0), coltype_(NULL), nauxcols(0), auxcolspace(0), colmap_O2G(NULL), colmap_G2O(NULL), auxcolindspace(0), auxcolind(NULL) { debugMessage("OsiGrbSolverInterface::OsiGrbSolverInterface(%p)\n", (void*)&source); if (source.localenv_) { GUROBI_CALL( "OsiGrbSolverInterface", GRBloadenv( &localenv_, NULL ) ); assert( localenv_ != NULL ); } else incrementInstanceCounter(); gutsOfConstructor(); gutsOfCopy( source ); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- OsiGrbSolverInterface::~OsiGrbSolverInterface() { debugMessage("OsiGrbSolverInterface::~OsiGrbSolverInterface()\n"); gutsOfDestructor(); if (localenv_) { GRBfreeenv( localenv_ ); } else decrementInstanceCounter(); } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- OsiGrbSolverInterface& OsiGrbSolverInterface::operator=( const OsiGrbSolverInterface& rhs ) { debugMessage("OsiGrbSolverInterface::operator=(%p)\n", (void*)&rhs); if (this != &rhs) { OsiSolverInterface::operator=( rhs ); gutsOfDestructor(); gutsOfConstructor(); if ( rhs.lp_ !=NULL ) gutsOfCopy( rhs ); } return *this; } //############################################################################# // Applying cuts //############################################################################# OsiSolverInterface::ApplyCutsReturnCode OsiGrbSolverInterface::applyCuts(const OsiCuts & cs, double effectivenessLb) { debugMessage("OsiGrbSolverInterface::applyCuts(%p)\n", (void*)&cs); OsiSolverInterface::ApplyCutsReturnCode retVal; int i; // Loop once for each column cut for ( i = 0; i < cs.sizeColCuts(); i ++ ) { if ( cs.colCut(i).effectiveness() < effectivenessLb ) { retVal.incrementIneffective(); continue; } if ( !cs.colCut(i).consistent() ) { retVal.incrementInternallyInconsistent(); continue; } if ( !cs.colCut(i).consistent(*this) ) { retVal.incrementExternallyInconsistent(); continue; } if ( cs.colCut(i).infeasible(*this) ) { retVal.incrementInfeasible(); continue; } applyColCut( cs.colCut(i) ); retVal.incrementApplied(); } // Loop once for each row cut int nToApply = 0; size_t space = 0; for ( i = 0; i < cs.sizeRowCuts(); i ++ ) { if ( cs.rowCut(i).effectiveness() < effectivenessLb ) { retVal.incrementIneffective(); continue; } if ( !cs.rowCut(i).consistent() ) { retVal.incrementInternallyInconsistent(); continue; } if ( !cs.rowCut(i).consistent(*this) ) { retVal.incrementExternallyInconsistent(); continue; } if ( cs.rowCut(i).infeasible(*this) ) { retVal.incrementInfeasible(); continue; } nToApply++; space += cs.rowCut(i).row().getNumElements(); retVal.incrementApplied(); } int base_row = getNumRows(); int base_col = getNumCols() + nauxcols; //now apply row cuts jointly int* start = new int[nToApply + 1]; int* indices = new int[space]; double* values = new double[space]; double* lower = new double[nToApply]; double* upper = new double[nToApply]; int cur = 0; int r = 0; int nTrulyRanged = nToApply; for ( i = 0; i < cs.sizeRowCuts(); i ++ ) { if ( cs.rowCut(i).effectiveness() < effectivenessLb ) { continue; } if ( !cs.rowCut(i).consistent() ) { continue; } if ( !cs.rowCut(i).consistent(*this) ) { continue; } if ( cs.rowCut(i).infeasible(*this) ) { continue; } start[r] = cur; const OsiRowCut & rowCut = cs.rowCut(i); lower[r] = rowCut.lb(); upper[r] = rowCut.ub(); std::cerr << "range " << lower[r] << " - " << upper[r] << std::endl; if( lower[r] <= -getInfinity() ) { lower[r] = -GRB_INFINITY; nTrulyRanged--; } else if (upper[r] >= getInfinity() ) { upper[r] = GRB_INFINITY; nTrulyRanged--; } for (int k = 0; k < rowCut.row().getNumElements(); k++) { values[cur + k] = rowCut.row().getElements()[k]; indices[cur + k] = rowCut.row().getIndices()[k]; } r++; cur += rowCut.row().getNumElements(); } start[nToApply] = cur; int nPrevVars = getNumCols(); GUROBI_CALL( "applyRowCuts", GRBaddrangeconstrs( getLpPtr( OsiGrbSolverInterface::KEEPCACHED_COLUMN ), nToApply, static_cast(space), start, indices, values, lower, upper, NULL) ); GUROBI_CALL( "applyRowCuts", GRBupdatemodel(getMutableLpPtr()) ); // store correspondence between ranged rows and new variables added by Gurobi int nNewVars = getNumCols() - nPrevVars; if (nNewVars != nTrulyRanged) { std::cerr << "ERROR in applying cuts for Gurobi: " << __FILE__ << " : " << "line " << __LINE__ << " . Exiting" << std::endl; exit(-1); } if (nTrulyRanged > 0) { if( nauxcols == 0 ) { // this is the first ranged row assert(colmap_O2G == NULL); assert(colmap_G2O == NULL); assert(colspace_ >= getNumCols()); auxcolspace = nTrulyRanged; colmap_G2O = new int[colspace_ + auxcolspace]; CoinIotaN(colmap_G2O, colspace_ + auxcolspace, 0); colmap_O2G = CoinCopyOfArray(colmap_G2O, colspace_); } else { assert(colmap_O2G != NULL); assert(colmap_G2O != NULL); resizeAuxColSpace( nauxcols + nTrulyRanged); } nauxcols += nTrulyRanged; resizeAuxColIndSpace(); int next = 0; for (int k = 0; k < nToApply; k++) { if (lower[k] > -GRB_INFINITY && upper[k] < GRB_INFINITY) { auxcolind[base_row + next] = base_col + next; colmap_G2O[auxcolind[base_row + next]] = - (base_row + next) - 1; next++; } } } delete[] start; delete[] indices; delete[] values; delete[] lower; delete[] upper; return retVal; } void OsiGrbSolverInterface::applyColCut( const OsiColCut & cc ) { debugMessage("OsiGrbSolverInterface::applyColCut(%p)\n", (void*)&cc); const double * gurobiColLB = getColLower(); const double * gurobiColUB = getColUpper(); const CoinPackedVector & lbs = cc.lbs(); const CoinPackedVector & ubs = cc.ubs(); int i; for( i = 0; i < lbs.getNumElements(); ++i ) if ( lbs.getElements()[i] > gurobiColLB[lbs.getIndices()[i]] ) setColLower( lbs.getIndices()[i], lbs.getElements()[i] ); for( i = 0; i < ubs.getNumElements(); ++i ) if ( ubs.getElements()[i] < gurobiColUB[ubs.getIndices()[i]] ) setColUpper( ubs.getIndices()[i], ubs.getElements()[i] ); } //----------------------------------------------------------------------------- void OsiGrbSolverInterface::applyRowCut( const OsiRowCut & rowCut ) { debugMessage("OsiGrbSolverInterface::applyRowCut(%p)\n", (void*)&rowCut); double rhs = 0.0; char sns; double lb = rowCut.lb(); double ub = rowCut.ub(); bool isrange = false; if( lb <= -getInfinity() && ub >= getInfinity() ) // free constraint { rhs = getInfinity(); sns = GRB_LESS_EQUAL; } else if( lb <= -getInfinity() ) // <= constraint { rhs = ub; sns = GRB_LESS_EQUAL; } else if( ub >= getInfinity() ) // >= constraint { rhs = lb; sns = GRB_GREATER_EQUAL; } else if( ub == lb ) // = constraint { rhs = ub; sns = GRB_EQUAL; } else // range constraint { rhs = 0.0; sns = GRB_EQUAL; isrange = true; } GUROBI_CALL( "applyRowCut", GRBaddconstr( getLpPtr( OsiGrbSolverInterface::KEEPCACHED_COLUMN ), rowCut.row().getNumElements(), const_cast( rowCut.row().getIndices() ), const_cast( rowCut.row().getElements() ), sns, rhs, NULL) ); if( isrange ) { convertToRangedRow(getNumRows()-1, ub, ub - lb); } else if( nauxcols ) resizeAuxColIndSpace(); } //############################################################################# // Private methods (non-static and static) and static data //############################################################################# //------------------------------------------------------------------ // Static data //------------------------------------------------------------------ GRBenv* OsiGrbSolverInterface::globalenv_ = NULL; bool OsiGrbSolverInterface::globalenv_is_ours = true; unsigned int OsiGrbSolverInterface::numInstances_ = 0; //------------------------------------------------------------------- // Get pointer to GRBmodel*. // const methods should use getMutableLpPtr(). // non-const methods should use getLpPtr(). //------------------------------------------------------------------- GRBmodel* OsiGrbSolverInterface::getMutableLpPtr() const { if ( lp_ == NULL ) { assert(getEnvironmentPtr() != NULL); GUROBI_CALL( "getMutableLpPtr", GRBnewmodel(getEnvironmentPtr(), &lp_, "OsiGrb_problem", 0, NULL, NULL, NULL, NULL, NULL) ); assert( lp_ != NULL ); // GUROBI up to version 2.0.1 may return a scaled LP after GRBoptimize when requesting it via GRBgetvars #if (GRB_VERSION_MAJOR < 2) || (GRB_VERSION_MAJOR == 2 && GRB_VERSION_MINOR == 0 && GRB_VERSION_TECHNICAL <= 1) GUROBI_CALL( "getMutableLpPtr", GRBsetintparam(GRBgetenv(lp_), GRB_INT_PAR_SCALEFLAG, 0) ); #endif } return lp_; } //------------------------------------------------------------------- void OsiGrbSolverInterface::gutsOfCopy( const OsiGrbSolverInterface & source ) { // Set Rim and constraints const double* obj = source.getObjCoefficients(); const double* rhs = source.getRightHandSide(); const char* sense = source.getRowSense(); const CoinPackedMatrix * cols = source.getMatrixByCol(); const double* lb = source.getColLower(); const double* ub = source.getColUpper(); loadProblem(*cols,lb,ub,obj,sense,rhs,source.getRowRange()); // Set Objective Sense setObjSense(source.getObjSense()); // Set Objective Constant double dblParam; source.getDblParam(OsiObjOffset,dblParam) ; setDblParam(OsiObjOffset,dblParam) ; // Set MIP information resizeColSpace(source.colspace_); CoinDisjointCopyN( source.coltype_, source.colspace_, coltype_ ); // Set Problem name std::string strParam; source.getStrParam(OsiProbName,strParam) ; setStrParam(OsiProbName,strParam) ; // Set Solution - not supported by Gurobi // setColSolution(source.getColSolution()); // setRowPrice(source.getRowPrice()); } //------------------------------------------------------------------- void OsiGrbSolverInterface::gutsOfConstructor() { } //------------------------------------------------------------------- void OsiGrbSolverInterface::gutsOfDestructor() { debugMessage("OsiGrbSolverInterface::gutsOfDestructor()\n"); if ( lp_ != NULL ) { GUROBI_CALL( "gutsOfDestructor", GRBfreemodel(lp_) ); lp_ = NULL; freeAllMemory(); } assert( lp_==NULL ); assert( obj_==NULL ); assert( collower_==NULL ); assert( colupper_==NULL ); assert( rowsense_==NULL ); assert( rhs_==NULL ); assert( rowrange_==NULL ); assert( rowlower_==NULL ); assert( rowupper_==NULL ); assert( colsol_==NULL ); assert( rowsol_==NULL ); assert( redcost_==NULL ); assert( rowact_==NULL ); assert( matrixByRow_==NULL ); assert( matrixByCol_==NULL ); assert( coltype_==NULL ); assert( colspace_==0 ); assert( auxcolspace == 0); assert( auxcolindspace == 0 ); } //------------------------------------------------------------------- /// free cached vectors void OsiGrbSolverInterface::freeCachedColRim() { freeCacheDouble( obj_ ); freeCacheDouble( collower_ ); freeCacheDouble( colupper_ ); assert( obj_==NULL ); assert( collower_==NULL ); assert( colupper_==NULL ); } void OsiGrbSolverInterface::freeCachedRowRim() { freeCacheChar( rowsense_ ); freeCacheDouble( rhs_ ); freeCacheDouble( rowrange_ ); freeCacheDouble( rowlower_ ); freeCacheDouble( rowupper_ ); assert( rowsense_==NULL ); assert( rhs_==NULL ); assert( rowrange_==NULL ); assert( rowlower_==NULL ); assert( rowupper_==NULL ); } void OsiGrbSolverInterface::freeCachedMatrix() { freeCacheMatrix( matrixByRow_ ); freeCacheMatrix( matrixByCol_ ); assert( matrixByRow_==NULL ); assert( matrixByCol_==NULL ); } void OsiGrbSolverInterface::freeCachedResults() { freeCacheDouble( colsol_ ); freeCacheDouble( rowsol_ ); freeCacheDouble( redcost_ ); freeCacheDouble( rowact_ ); assert( colsol_==NULL ); assert( rowsol_==NULL ); assert( redcost_==NULL ); assert( rowact_==NULL ); } void OsiGrbSolverInterface::freeCachedData( int keepCached ) { if( !(keepCached & OsiGrbSolverInterface::KEEPCACHED_COLUMN) ) freeCachedColRim(); if( !(keepCached & OsiGrbSolverInterface::KEEPCACHED_ROW) ) freeCachedRowRim(); if( !(keepCached & OsiGrbSolverInterface::KEEPCACHED_MATRIX) ) freeCachedMatrix(); if( !(keepCached & OsiGrbSolverInterface::KEEPCACHED_RESULTS) ) freeCachedResults(); } void OsiGrbSolverInterface::freeAllMemory() { freeCachedData(); if( hotStartCStat_ != NULL ) delete[] hotStartCStat_; if( hotStartRStat_ != NULL ) delete[] hotStartRStat_; hotStartCStat_ = NULL; hotStartCStatSize_ = 0; hotStartRStat_ = NULL; hotStartRStatSize_ = 0; freeColSpace(); delete[] auxcolind; auxcolind = NULL; auxcolindspace = 0; } /// converts a normal row into a ranged row by adding an auxiliary variable void OsiGrbSolverInterface::convertToRangedRow(int rowidx, double rhs, double range) { debugMessage("OsiGrbSolverInterface::convertToRangedRow()\n"); assert(rowidx >= 0); assert(rowidx < getNumRows()); assert(rhs > -getInfinity()); assert(rhs < getInfinity()); assert(range > 0.0); assert(range < getInfinity()); if( nauxcols == 0 ) { // row rowidx is the first ranged row assert(colmap_O2G == NULL); assert(colmap_G2O == NULL); assert(colspace_ >= getNumCols()); auxcolspace = 1; colmap_G2O = new int[colspace_ + auxcolspace]; CoinIotaN(colmap_G2O, colspace_ + auxcolspace, 0); colmap_O2G = CoinCopyOfArray(colmap_G2O, colspace_); } else { assert(colmap_O2G != NULL); assert(colmap_G2O != NULL); resizeAuxColSpace( nauxcols + 1); } resizeAuxColIndSpace(); assert(auxcolind[rowidx] == -1); /* not a ranged row yet */ GUROBI_CALL( "convertToRangedRow", GRBupdatemodel(getMutableLpPtr()) ); double minusone = -1.0; GUROBI_CALL( "convertToRangedRow", GRBaddvar(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_PROBLEM ), 1, &rowidx, &minusone, 0.0, rhs-range, rhs, GRB_CONTINUOUS, NULL) ); auxcolind[rowidx] = getNumCols() + nauxcols - 1; colmap_G2O[auxcolind[rowidx]] = -rowidx - 1; ++nauxcols; #ifndef NDEBUG if( nauxcols ) { int nc = getNumCols(); int nr = getNumRows(); for( int i = 0; i < nc + nauxcols; ++i ) { assert(i >= nc || colmap_G2O[colmap_O2G[i]] == i); assert(colmap_G2O[i] < 0 || colmap_O2G[colmap_G2O[i]] == i); assert(colmap_G2O[i] >= 0 || -colmap_G2O[i]-1 < nr); assert(colmap_G2O[i] >= 0 || auxcolind[-colmap_G2O[i]-1] == i); } } #endif } /// converts a ranged row into a normal row by removing its auxiliary variable void OsiGrbSolverInterface::convertToNormalRow(int rowidx, char sense, double rhs) { debugMessage("OsiGrbSolverInterface::convertToNormalRow()\n"); assert(rowidx >= 0); assert(rowidx < getNumRows()); int auxvar = auxcolind[rowidx]; assert(nauxcols); assert(auxvar >= 0); assert(colmap_G2O[auxvar] == -rowidx - 1); GUROBI_CALL( "convertToNormalRow", GRBupdatemodel(getMutableLpPtr()) ); /* row rowidx should be an ordinary equality row with rhs == 0 now */ GUROBI_CALL( "convertToNormalRow", GRBdelvars(getLpPtr( OsiGrbSolverInterface::KEEPCACHED_ROW ), 1, &auxcolind[rowidx]) ); auxcolind[rowidx] = -1; if( nauxcols > 1 ) { int nc = getNumCols(); for(int i = auxvar; i < nc; ++i) { if( colmap_O2G[i] > auxvar ) --colmap_O2G[i]; colmap_G2O[i] = colmap_G2O[i+1]; } for(int i = nc; i < nc + nauxcols; ++i) colmap_G2O[i] = colmap_G2O[i+1]; int nr = getNumRows(); for(int i = 0; i < nr; ++i) if( auxcolind[i] > auxvar ) --auxcolind[i]; --nauxcols; } else { // no ranged rows left delete[] colmap_O2G; delete[] colmap_G2O; delete[] auxcolind; auxcolspace = 0; auxcolindspace = 0; nauxcols = 0; } setRowType(rowidx, sense, rhs, 0.0); #ifndef NDEBUG if( nauxcols ) { int nc = getNumCols(); int nr = getNumRows(); for( int i = 0; i < nc + nauxcols; ++i ) { assert(i >= nc || colmap_G2O[colmap_O2G[i]] == i); assert(colmap_G2O[i] < 0 || colmap_O2G[colmap_G2O[i]] == i); assert(colmap_G2O[i] >= 0 || -colmap_G2O[i]-1 < nr); assert(colmap_G2O[i] >= 0 || auxcolind[-colmap_G2O[i]-1] == i); } } #endif } //############################################################################# // Resets as if default constructor void OsiGrbSolverInterface::reset() { setInitialData(); // clear base class gutsOfDestructor(); } /**********************************************************************/ /* Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none */ int OsiGrbSolverInterface::canDoSimplexInterface() const { return 0; } /**********************************************************************/ bool OsiGrbSolverInterface::basisIsAvailable() const { if (getNumCols() == 0) return true; GUROBI_CALL( "basisIsAvailable", GRBupdatemodel(getMutableLpPtr()) ); int status; GUROBI_CALL( "basisIsAvailable", GRBgetintattr(getMutableLpPtr(), GRB_INT_ATTR_STATUS, &status) ); if (status == GRB_LOADED || status == GRB_INFEASIBLE || status == GRB_INF_OR_UNBD || status == GRB_UNBOUNDED) return false; int dum; return GRBgetintattrelement(getMutableLpPtr(), GRB_INT_ATTR_VBASIS, 0, &dum) == 0; } /* Osi return codes: 0: free 1: basic 2: upper 3: lower */ void OsiGrbSolverInterface::getBasisStatus(int* cstat, int* rstat) const { int numcols = getNumCols(); int numrows = getNumRows(); GUROBI_CALL( "getBasisStatus", GRBupdatemodel(getMutableLpPtr()) ); if( nauxcols ) GUROBI_CALL( "getBasisStatus", GRBgetintattrlist(getMutableLpPtr(), GRB_INT_ATTR_VBASIS, numcols, colmap_O2G, cstat) ); else GUROBI_CALL( "getBasisStatus", GRBgetintattrarray(getMutableLpPtr(), GRB_INT_ATTR_VBASIS, 0, numcols, cstat) ); for (int i = 0; i < numcols; ++i) switch (cstat[i]) { case GRB_BASIC: cstat[i] = 1; break; case GRB_NONBASIC_LOWER: cstat[i] = 3; break; case GRB_NONBASIC_UPPER: cstat[i] = 2; break; case GRB_SUPERBASIC: cstat[i] = 0; break; } GUROBI_CALL( "getBasisStatus", GRBgetintattrarray(getMutableLpPtr(), GRB_INT_ATTR_CBASIS, 0, numrows, rstat) ); char sense; for (int i = 0; i < numrows; ++i) { if( nauxcols && auxcolind[i] >= 0 ) { /* if the row is a ranged row, then we take the basis status from the corresponding auxiliary column is this correct??? */ int auxcolstat; GUROBI_CALL( "getBasisStatus", GRBgetintattrelement(getMutableLpPtr(), GRB_INT_ATTR_VBASIS, auxcolind[i], &auxcolstat) ); switch( auxcolstat ) { case GRB_BASIC: rstat[i] = 1; break; case GRB_NONBASIC_LOWER: rstat[i] = 3; break; case GRB_NONBASIC_UPPER: rstat[i] = 2; break; case GRB_SUPERBASIC: rstat[i] = 0; break; } } else { switch (rstat[i]) { case GRB_SUPERBASIC: rstat[i] = 0; break; case GRB_BASIC: rstat[i] = 1; break; case GRB_NONBASIC_LOWER: case GRB_NONBASIC_UPPER: GUROBI_CALL( "getBasisStatus", GRBgetcharattrelement(getMutableLpPtr(), GRB_CHAR_ATTR_SENSE, i, &sense) ); rstat[i] = (sense == '>' ? 2 : 3); break; } } } } Osi-0.106.4/src/OsiGrb/osi-gurobi-uninstalled.pc.in0000644000076600007660000000044011507670402020376 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src/OsiGrb Name: OsiGurobi Description: COIN-OR Open Solver Interface for Gurobi URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: ${libdir}/libOsiGrb.la @GRBLIB@ Cflags: -I@abs_source_dir@/src/OsiGrb -I@GRBINCDIR@ Requires: osi Osi-0.106.4/src/OsiGrb/Makefile.am0000644000076600007660000000302412101340333015067 0ustar coincoin# Copyright (C) 2009 Stefan Vigerske and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1881 2013-01-28 00:05:47Z stefan $ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiGrb ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiGrb.la # List all source files for this library, including headers libOsiGrb_la_SOURCES = OsiGrbSolverInterface.cpp OsiGrbSolverInterface.hpp # This is for libtool (on Windows) libOsiGrb_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ -I`$(CYGPATH_W) $(GRBINCDIR)` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiGrbSolverInterface.hpp Osi-0.106.4/src/OsiGrb/osi-gurobi.pc.in0000644000076600007660000000046711510106235016057 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: OsiGurobi Description: COIN-OR Open Solver Interface for Gurobi URL: https://projects.coin-or.org/Osi Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lOsiGrb @GRBLIB@ Cflags: -I${includedir} -I@GRBINCDIR@ Requires: osi Osi-0.106.4/src/OsiGrb/Makefile.in0000644000076600007660000005420612240315110015107 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2009 Stefan Vigerske and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/OsiGrb DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libOsiGrb_la_LIBADD = am_libOsiGrb_la_OBJECTS = OsiGrbSolverInterface.lo libOsiGrb_la_OBJECTS = $(am_libOsiGrb_la_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libOsiGrb_la_SOURCES) DIST_SOURCES = $(libOsiGrb_la_SOURCES) includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # libOsiGrb ######################################################################## # Name of the library compiled in this directory. lib_LTLIBRARIES = libOsiGrb.la # List all source files for this library, including headers libOsiGrb_la_SOURCES = OsiGrbSolverInterface.cpp OsiGrbSolverInterface.hpp # This is for libtool (on Windows) libOsiGrb_la_LDFLAGS = $(LT_LDFLAGS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(srcdir)/../Osi` \ -I`$(CYGPATH_W) $(GRBINCDIR)` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi ######################################################################## # Headers that need to be installed # ######################################################################## # Here list all the header files that are required by a user of the library, # and that therefore should be installed in 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = OsiGrbSolverInterface.hpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OsiGrb/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/OsiGrb/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libOsiGrb.la: $(libOsiGrb_la_OBJECTS) $(libOsiGrb_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libOsiGrb_la_LDFLAGS) $(libOsiGrb_la_OBJECTS) $(libOsiGrb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiGrbSolverInterface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includecoinHEADERS: $(includecoin_HEADERS) @$(NORMAL_INSTALL) test -z "$(includecoindir)" || $(mkdir_p) "$(DESTDIR)$(includecoindir)" @list='$(includecoin_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includecoinHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includecoindir)/$$f'"; \ $(includecoinHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includecoindir)/$$f"; \ done uninstall-includecoinHEADERS: @$(NORMAL_UNINSTALL) @list='$(includecoin_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includecoindir)/$$f'"; \ rm -f "$(DESTDIR)$(includecoindir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includecoinHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/src/OsiGrb/OsiGrbSolverInterface.hpp0000644000076600007660000010167111664213777020004 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for Gurobi // template: OSI Cplex Interface written by T. Achterberg // author: Stefan Vigerske // Humboldt University Berlin // date: 09/02/2009 // license: this file may be freely distributed under the terms of EPL // comments: please scan this file for '???' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2009 Humboldt University Berlin and others. // All Rights Reserved. // $Id: OsiGrbSolverInterface.hpp 1830 2011-11-26 16:46:55Z stefan $ #ifndef OsiGrbSolverInterface_H #define OsiGrbSolverInterface_H #include #include "OsiSolverInterface.hpp" typedef struct _GRBmodel GRBmodel; typedef struct _GRBenv GRBenv; /** Gurobi Solver Interface Instantiation of OsiGrbSolverInterface for Gurobi */ class OsiGrbSolverInterface : virtual public OsiSolverInterface { friend void OsiGrbSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); public: //--------------------------------------------------------------------------- /**@name Solve methods */ //@{ /// Solve initial LP relaxation virtual void initialSolve(); /// Resolve an LP relaxation after problem modification virtual void resolve(); /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound(); //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. */ //@{ // Set an integer parameter bool setIntParam(OsiIntParam key, int value); // Set an double parameter bool setDblParam(OsiDblParam key, double value); // Set a string parameter bool setStrParam(OsiStrParam key, const std::string & value); // Set a hint parameter bool setHintParam(OsiHintParam key, bool yesNo = true, OsiHintStrength strength = OsiHintTry, void* = NULL); // Get an integer parameter bool getIntParam(OsiIntParam key, int& value) const; // Get an double parameter bool getDblParam(OsiDblParam key, double& value) const; // Get a string parameter bool getStrParam(OsiStrParam key, std::string& value) const; // Get a hint parameter bool getHintParam(OsiHintParam key, bool& yesNo, OsiHintStrength& strength, void*& otherInformation) const; // Get a hint parameter bool getHintParam(OsiHintParam key, bool& yesNo, OsiHintStrength& strength) const; // Get a hint parameter bool getHintParam(OsiHintParam key, bool& yesNo) const; // Set mipstart option (pass column solution to CPLEX before MIP start) void setMipStart(bool value) { domipstart = value; } // Get mipstart option value bool getMipStart() const { return domipstart; } //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there a numerical difficulties? virtual bool isAbandoned() const; /// Is optimality proven? virtual bool isProvenOptimal() const; /// Is primal infeasiblity proven? virtual bool isProvenPrimalInfeasible() const; /// Is dual infeasiblity proven? virtual bool isProvenDualInfeasible() const; /// Is the given primal objective limit reached? virtual bool isPrimalObjectiveLimitReached() const; /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const; //@} //--------------------------------------------------------------------------- /**@name WarmStart related methods */ //@{ /*! \brief Get an empty warm start object This routine returns an empty CoinWarmStartBasis object. Its purpose is to provide a way to give a client a warm start basis object of the appropriate type, which can resized and modified as desired. */ CoinWarmStart* getEmptyWarmStart() const; /// Get warmstarting information virtual CoinWarmStart* getWarmStart() const; /** Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. */ virtual bool setWarmStart(const CoinWarmStart* warmstart); //@} //--------------------------------------------------------------------------- /**@name Hotstart related methods (primarily used in strong branching).
    The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there.
    NOTE: between hotstarted optimizations only bound changes are allowed. */ //@{ /// Create a hotstart point of the optimization process virtual void markHotStart(); /// Optimize starting from the hotstart virtual void solveFromHotStart(); /// Delete the snapshot virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem information methods These methods call the solver's query routines to return information about the problem referred to by the current object. Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /**@name Methods related to querying the input data */ //@{ /// Get number of columns virtual int getNumCols() const; /// Get number of rows virtual int getNumRows() const; /// Get number of nonzero elements virtual int getNumElements() const; /// Get pointer to array[getNumCols()] of column lower bounds virtual const double * getColLower() const; /// Get pointer to array[getNumCols()] of column upper bounds virtual const double * getColUpper() const; /** Get pointer to array[getNumRows()] of row constraint senses.
    • 'L': <= constraint
    • 'E': = constraint
    • 'G': >= constraint
    • 'R': ranged constraint
    • 'N': free constraint
    */ virtual const char * getRowSense() const; /** Get pointer to array[getNumRows()] of rows right-hand sides
    • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
    • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'N' then rhs()[i] == 0.0
    */ virtual const double * getRightHandSide() const; /** Get pointer to array[getNumRows()] of row ranges.
    • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
    • if rowsense()[i] != 'R' then rowrange()[i] is 0.0
    */ virtual const double * getRowRange() const; /// Get pointer to array[getNumRows()] of row lower bounds virtual const double * getRowLower() const; /// Get pointer to array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const; /// Get pointer to array[getNumCols()] of objective function coefficients virtual const double * getObjCoefficients() const; /// Get objective function sense (1 for min (default), -1 for max) virtual double getObjSense() const; /// Return true if column is continuous virtual bool isContinuous(int colNumber) const; /// Get pointer to row-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByRow() const; /// Get pointer to column-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByCol() const; /// Get solver's value for infinity virtual double getInfinity() const; //@} /**@name Methods related to querying the solution */ //@{ /// Get pointer to array[getNumCols()] of primal solution vector virtual const double * getColSolution() const; /// Get pointer to array[getNumRows()] of dual prices virtual const double * getRowPrice() const; /// Get a pointer to array[getNumCols()] of reduced costs virtual const double * getReducedCost() const; /** Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector */ virtual const double * getRowActivity() const; /// Get objective function value virtual double getObjValue() const; /** Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. */ virtual int getIterationCount() const; /** Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.) The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay=false) const; /** Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.) NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getPrimalRays(int maxNumRays) const; //@} //@} //--------------------------------------------------------------------------- /**@name Problem modifying methods */ //@{ //------------------------------------------------------------------------- /**@name Changing bounds on variables and constraints */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff(int elementIndex, double elementValue); /** Set a a set of objective function coefficients */ virtual void setObjCoeffSet(const int* indexFirst, const int* indexLast, const double* coeffList); using OsiSolverInterface::setColLower; /** Set a single column lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setColLower(int elementIndex, double elementValue); using OsiSolverInterface::setColUpper; /** Set a single column upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setColUpper(int elementIndex, double elementValue); /** Set a single column lower and upper bound
    The default implementation just invokes setColLower() and setColUpper() */ virtual void setColBounds(int elementIndex, double lower, double upper); /** Set the bounds on a number of columns simultaneously
    The default implementation just invokes setCollower() and setColupper() over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the variables */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set a single row lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setRowLower(int elementIndex, double elementValue); /** Set a single row upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setRowUpper(int elementIndex, double elementValue); /** Set a single row lower and upper bound
    The default implementation just invokes setRowLower() and setRowUpper() */ virtual void setRowBounds(int elementIndex, double lower, double upper); /** Set the type of a single row
    */ virtual void setRowType(int index, char sense, double rightHandSide, double range); /** Set the bounds on a number of rows simultaneously
    The default implementation just invokes setRowLower() and setRowUpper() over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the constraints */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a number of rows simultaneously
    The default implementation just invokes setRowType() and over and over again. @param [indexfirst,indexLast] contains the indices of the constraints whose type changes @param senseList the new senses @param rhsList the new right hand sides @param rangeList the new ranges */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); //@} //------------------------------------------------------------------------- /**@name Integrality related changing methods */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index); /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index); /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); //@} //------------------------------------------------------------------------- /**@name Naming methods */ //@{ /*! \brief Set a row name */ virtual void setRowName(int ndx, std::string name) ; /*! \brief Set a column name */ virtual void setColName(int ndx, std::string name) ; //@} //------------------------------------------------------------------------- /// Set objective function sense (1 for min (default), -1 for max,) virtual void setObjSense(double s); /** Set the primal solution column values colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double * colsol); /** Set dual solution vector rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice); //------------------------------------------------------------------------- /**@name Methods to expand a problem.
    Note that if a column is added then by default it will correspond to a continuous variable. */ //@{ using OsiSolverInterface::addCol; /** */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj); using OsiSolverInterface::addCols; /** */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); /** */ virtual void deleteCols(const int num, const int * colIndices); using OsiSolverInterface::addRow; /** */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng); using OsiSolverInterface::addRows; /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); /** */ virtual void deleteRows(const int num, const int * rowIndices); //@} //@} //--------------------------------------------------------------------------- /**@name Methods to input a problem */ //@{ /** Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • rowub: all rows have upper bound infinity
    • rowlb: all rows have lower bound -infinity
    • obj: all variables have 0 objective coefficient
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub); /** Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • obj: all variables have 0 objective coefficient
    • rowsen: all rows are >=
    • rowrhs: all right hand sides are 0
    • rowrng: 0 for the ranged rows
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); using OsiSolverInterface::readMps; /** Read an mps file from the given filename */ virtual int readMps(const char *filename, const char *extension = "mps"); /** Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants */ virtual void writeMps(const char *filename, const char *extension = "mps", double objSense=0.0) const; //@} //--------------------------------------------------------------------------- /**@name Gurobi specific public interfaces */ //@{ /** Get pointer to Gurobi model and free all specified cached data entries (combined with logical or-operator '|' ): */ enum keepCachedFlag { /// discard all cached data (default) KEEPCACHED_NONE = 0, /// column information: objective values, lower and upper bounds, variable types KEEPCACHED_COLUMN = 1, /// row information: right hand sides, ranges and senses, lower and upper bounds for row KEEPCACHED_ROW = 2, /// problem matrix: matrix ordered by column and by row KEEPCACHED_MATRIX = 4, /// LP solution: primal and dual solution, reduced costs, row activities KEEPCACHED_RESULTS = 8, /// only discard cached LP solution KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX, /// keep all cached data (similar to getMutableLpPtr()) KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS, /// free only cached column and LP solution information FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN, /// free only cached row and LP solution information FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW, /// free only cached matrix and LP solution information FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX, /// free only cached LP solution information FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS }; GRBmodel* getLpPtr(int keepCached = KEEPCACHED_NONE); //@{ /// Method to access Gurobi environment pointer GRBenv* getEnvironmentPtr() const; /// Return whether the current Gurobi environment runs in demo mode. bool isDemoLicense() const; //@} /// return a vector of variable types (continous, binary, integer) const char* getCtype() const; /**@name Static instance counter methods */ /** Gurobi has a context which must be created prior to all other Gurobi calls. This method:
    • Increments by 1 the number of uses of the Gurobi environment.
    • Creates the Gurobi context when the number of uses is change to 1 from 0.
    */ static void incrementInstanceCounter(); /** Gurobi has a context which should be deleted after Gurobi calls. This method:
    • Decrements by 1 the number of uses of the Gurobi environment.
    • Deletes the Gurobi context when the number of uses is change to 0 from 1.
    */ static void decrementInstanceCounter(); /// sets the global gurobi environment to a user given one static void setEnvironment(GRBenv* globalenv); /// Return the number of instances of instantiated objects using Gurobi services. static unsigned int getNumInstances(); //@} //@} /**@name Constructors and destructor */ //@{ /// Default Constructor OsiGrbSolverInterface(bool use_local_env = false); /// Constructor that takes a gurobi environment and assumes membership OsiGrbSolverInterface(GRBenv* localgrbenv); /// Clone virtual OsiSolverInterface * clone(bool copyData = true) const; /// Copy constructor OsiGrbSolverInterface(const OsiGrbSolverInterface&); /// Assignment operator OsiGrbSolverInterface& operator=(const OsiGrbSolverInterface& rhs); /// Destructor virtual ~OsiGrbSolverInterface(); /// Resets as if default constructor virtual void reset(); //@} /***************************************************************************/ /**@name OsiSimplexInterface methods Gurobi adds a slack with coeff +1 in "<=" and "=" constraints, with coeff -1 in ">=", slack being non negative. We switch in order to get a "Clp tableau" where all the slacks have coefficient +1 in the original tableau. If a slack for ">=" is non basic, invB is not changed; column of the slack in the optimal tableau is flipped. If a slack for ">=" is basic, corresp. row of invB is flipped; whole row of the optimal tableau is flipped; then whole column for the slack in opt tableau is flipped. Ranged rows are not supported. It might work, but no garantee is given. */ //@{ /** Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none */ virtual int canDoSimplexInterface() const; using OsiSolverInterface::enableSimplexInterface; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void enableSimplexInterface(int doingPrimal) { } ; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void disableSimplexInterface() { } ; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void enableFactorization() const { } ; /** Useless function, defined only for compatibility with OsiSimplexInterface */ virtual void disableFactorization() const { } ; ///Returns true if a basis is available virtual bool basisIsAvailable() const; /** Returns a basis status of the structural/artificial variables At present as warm start i.e 0: free, 1: basic, 2: upper, 3: lower */ virtual void getBasisStatus(int* cstat, int* rstat) const; // ///Get a row of the tableau (slack part in slack if not NULL) // virtual void getBInvARow(int row, double* z, double * slack=NULL) const; // // ///Get a row of the basis inverse // virtual void getBInvRow(int row, double* z) const; // // ///Get a column of the tableau // virtual void getBInvACol(int col, double* vec) const; // // ///Get a column of the basis inverse // virtual void getBInvCol(int col, double* vec) const; // // /** Get indices of the pivot variable in each row // (order of indices corresponds to the // order of elements in a vector retured by getBInvACol() and // getBInvCol()). // */ // virtual void getBasics(int* index) const; /// switches Gurobi to prob type LP void switchToLP(); /// switches Gurobi to prob type MIP void switchToMIP(); //@} /***************************************************************************/ /***************************************************************************/ /** Apply a collection of cuts. Only cuts which have an effectiveness >= effectivenessLb are applied.
    • ReturnCode.getNumineffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
    • ReturnCode.getNuminconsistent() -- number of invalid cuts
    • ReturnCode.getNuminconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
    • ReturnCode.getNuminfeasible() -- number of cuts that would make this integer model infeasible
    • ReturnCode.getNumApplied() -- number of integer cuts which were applied to the integer model
    • cs.size() == getNumineffective() + getNuminconsistent() + getNuminconsistentWrtIntegerModel() + getNuminfeasible() + getNumApplied()
    */ virtual OsiSolverInterface::ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); protected: /**@name Protected methods */ //@{ /// Apply a row cut. Return true if cut was applied. virtual void applyRowCut(const OsiRowCut & rc); /** Apply a column cut (bound adjustment). Return true if cut was applied. */ virtual void applyColCut(const OsiColCut & cc); //@} private: /**@name Private static class functions */ //@{ /// resizes coltype_, colmap_O2G, colmap_G2O vectors to be able to store at least minsize elements void resizeColSpace(int minsize); /// frees colsize_ vector void freeColSpace(); /// resizes colmap_G2O vector to be able to store at least minsize (auxiliary) elements void resizeAuxColSpace(int minsize); /// resizes auxcolind vector to current number of rows and inits values to -1 void resizeAuxColIndSpace(); //@} /**@name Private static class data */ //@{ /// Gurobi environment pointer static GRBenv* globalenv_; /// whether OsiGrb has created the global environment (and thus should free it) static bool globalenv_is_ours; /// Number of instances using the global Gurobi environment static unsigned int numInstances_; //@} /**@name Private methods */ //@{ /// Get LP Pointer for const methods GRBmodel* getMutableLpPtr() const; /// The real work of a copy constructor (used by copy and assignment) void gutsOfCopy(const OsiGrbSolverInterface & source); /// The real work of the constructor void gutsOfConstructor(); /// The real work of the destructor void gutsOfDestructor(); /// free cached column rim vectors void freeCachedColRim(); /// free cached row rim vectors void freeCachedRowRim(); /// free cached result vectors void freeCachedResults(); /// free cached matrices void freeCachedMatrix(); /// free all cached data (except specified entries, see getLpPtr()) void freeCachedData(int keepCached = KEEPCACHED_NONE); /// free all allocated memory void freeAllMemory(); /// converts a normal row into a ranged row by adding an auxiliary variable void convertToRangedRow(int rowidx, double rhs, double range); /// converts a ranged row into a normal row by removing its auxiliary variable void convertToNormalRow(int rowidx, char sense, double rhs); //@} /**@name Private member data */ //@{ /// Gurobi environment used only by this class instance mutable GRBenv* localenv_; /// Gurobi model represented by this class instance mutable GRBmodel* lp_; /// Hotstart information int *hotStartCStat_; int hotStartCStatSize_; int *hotStartRStat_; int hotStartRStatSize_; int hotStartMaxIteration_; /// OSI name discipline int nameDisc_; /**@name Cached information derived from the Gurobi model */ //@{ /// Pointer to objective vector mutable double *obj_; /// Pointer to dense vector of variable lower bounds mutable double *collower_; /// Pointer to dense vector of variable lower bounds mutable double *colupper_; /// Pointer to dense vector of row sense indicators mutable char *rowsense_; /// Pointer to dense vector of row right-hand side values mutable double *rhs_; /// Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) mutable double *rowrange_; /// Pointer to dense vector of row lower bounds mutable double *rowlower_; /// Pointer to dense vector of row upper bounds mutable double *rowupper_; /// Pointer to primal solution vector mutable double *colsol_; /// Pointer to dual solution vector mutable double *rowsol_; /// Pointer to reduced cost vector mutable double *redcost_; /// Pointer to row activity (slack) vector mutable double *rowact_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByRow_; /// Pointer to row-wise copy of problem matrix coefficients. mutable CoinPackedMatrix *matrixByCol_; //@} /**@name Additional information needed for storing MIP problems and handling ranged rows */ //@{ /// Stores whether we currently see the problem as a MIP mutable bool probtypemip_; /// Whether to pass a column solution to CPLEX before starting MIP solve (copymipstart) bool domipstart; /// Size of allocated memory for coltype_, colmap_O2G, and (with offset auxcolspace) colmap_G2O. int colspace_; /// Pointer to dense vector of variable types (continous, binary, integer) char *coltype_; /// Number of auxiliary columns in Gurobi model for handling of ranged rows int nauxcols; /// Size of allocated memory for colmap_G2O that exceeds colspace_ int auxcolspace; /// Maps variable indices from Osi to Gurobi /// Is NULL if there are no ranged rows! (assume identity mapping then) int* colmap_O2G; /// Maps variable indices from Gurobi to Osi /// A negative value indicates that a variable is an auxiliary variable that was added to handle a ranged row /// -colmap_G2O[i]-1 gives the index of the ranged row in this case /// Is NULL if there are no ranged rows! (assume identity mapping then) int* colmap_G2O; /// Current length of auxcolind array. int auxcolindspace; /// Gives for each row the index of the corresponding auxiliary variable, if it is a ranged row. /// Otherwise, gives -1. /// Is NULL if there are no ranged rows! (assume -1 for each row then) int* auxcolind; //@} }; //############################################################################# /** A function that tests the methods in the OsiGrbSolverInterface class. */ void OsiGrbSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); #endif Osi-0.106.4/depcomp0000755000076600007660000003710011405216166012452 0ustar coincoin#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: Osi-0.106.4/CHANGELOG0000644000076600007660000001056212244006221012301 0ustar coincoin11/18/2013 OsiMsk - changed MIP optimizer to Mosek's own conic MIP optimizer, if Mosek version >= 7 09/11/2013 OsiCpx - fixed getIterationCount() for MIPs (use CPXgetmipitcnt instead of CPXgetitcnt) 08/30/2013 OsiGrb - fixed bug in getObjectiveCoefficients and getBasisStatus for LPs without ranged rows 08/23/2013 OsiGrb - fixed bug in deleting row or column names when deleting several rows/columns at once 04/02/2013 OsiMsk - update to work with Mosek 7, too (contributed by Erling D. Andersen) 02/02/2013 OsiUnitTest - replace macro for asserting a condition and collecting its outcome by a function to improve compilation speed (contributed by Victor Zverovich) 29/11/2012 OsiMsk - added getRescode() to get result code of last MSK_optimize call 21/11/2012 OsiCpx - calling setWarmStart with a too small basis now disables the use of an advanced basis for the next LP solve 20/11/2012 OsiGlpk, OsiCpx - workaround problem in Glpk with empty problem name (patch by Bertrand Le Cun) - not using CPXsolninfo for MIPs with CPLEX < 11.0 anymore 25/07/2012 OsiGrb - fix mipstart option in OsiGrb: pass only values for discrete variables to Gurobi 26/11/2011 OsiGrb - add implementation of OsiGrb::applyCuts that batches the row cuts before transfering them to Gurobi 12/11/2011 OsiSpx - add resolve with cleared basis if solve fails with exception (which may be due to a singular startbasis), needs SoPlex >= 1.5.0.7 03/09/2011 OsiMsk - fix bug in one loadProblem method when NULL was passed as row range array 30/07/2011 Osi - fix writing LP files with names: the objective name was not copied, leading to a segfault in CoinLpIO 30/07/2011 OsiSpx, OsiGlpk - allow NULLs for row* arguments in some loadProblem call 28/07/2011 OsiSpx - invert dual ray in getDualRays to match Osi definition when testing infeasibility proof 12/07/2011 MSVisualStudio - updated MSVC++ v10 project files to catch up with buildsystem changes 25/06/2011 Osi - add generic implementations of is{Primal,Dual}ObjectiveLimitReached 25/06/2011 OsiCommonTest - add unittest command line parameter -onerror to specify behaviour in case of a failing test 23/06/2011 OsiMsk - add isLicenseError() to check whether last solve was abandoned due to a mosek licensing issue 22/06/2011 OsiCpx - fix handling of primal/dual objective limit so it correctly takes objoffset into account - preserve objective sense also when empty model is loaded - make sure getWarmStart returns proper atlower/atupper status for inequalities 13/06/2011 OsiCommonTest, unittest - removed now redundant counting of unittest failures, so test functions now return void 03/06/2011 OsiMsk - fix caching flags (bitwise negation is ~, not !) - free all cached data when loading problem - fix getDualRay and getPrimalRay so they should return a ray now - fixed various further issues in unittest, so OsiMsk passes it now 15/05/2011 OsiXpr - added option (mipstart) to pass column solution as initial solution to a MIP solve 30/04/2011 OsiCpx, OsiGrb - added option (mipstart) to pass column solution as initial solution to a MIP solve 29/04/2011 OsiMsk - fix loss of Mosek task when copying OsiMsk 25/04/2011 OsiSpx - add methods to set/get/check timelimit - fix bug in solve methods where cached result vectors where not cleared - fix setWarmStart to swap status for slack variables as in getWarmStart - fix caching flags (bitwise negation is ~, not !) - redirect set/get name discipline to base class - fix primal/dual objective limit: take objoffset into account, correct check if limit changed after solve - getColSolution and getObjValue now return lower bound and value in lower bound before solve 01/04/2011 OsiGlpk - if initial basis is invalid or singular in initialSolve or resolve, construct advanced basis and try again 31/03/2011 OsiGrb - fixed handling of free variables in setWarmStart 30/03/2011 OsiGrb - fixed memory leak in loadProblem 21/03/2011 OsiCommonTest, unittest - add classes TestOutcome{s} to collect outcome of unittests - add macros to simplify asserts and exception catching and storing results as TestOutcome - change general and OsiGlpk tests to use new macros - return number of unexpected errors as return code of unittest - add parameter -verbosity to unittest to specify amount of output of unittests - a bit cleanup 21/03/2011 started CHANGELOG Osi-0.106.4/MSVisualStudio/0000755000076600007660000000000012244064313013764 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/0000755000076600007660000000000012244064313014372 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/Osi.sln0000644000076600007660000001435512131314077015652 0ustar coincoinMicrosoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOsi", "libOsi\libOsi.vcxproj", "{7D98E2CB-876E-4F75-9F71-77D3FE87E149}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCoinUtils", "..\..\..\CoinUtils\MSVisualStudio\v10\libCoinUtils\libCoinUtils.vcxproj", "{C4867F15-438D-4FF8-8388-62FBAAA9786C}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesBasic", "OsiExamplesBasic\OsiExamplesBasic.vcxproj", "{B874A948-B5F4-4501-9735-BD9586C5216D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesBuild", "OsiExamplesBuild\OsiExamplesBuild.vcxproj", "{1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesParameters", "OsiExamplesParameters\OsiExamplesParameters.vcxproj", "{C0F44D7F-B535-44DC-9125-515E813A1753}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesQuery", "OsiExamplesQuery\OsiExamplesQuery.vcxproj", "{E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesSpecific", "OsiExamplesSpecific\OsiExamplesSpecific.vcxproj", "{B5A702D5-C5F7-40EE-99E0-A500AE91528A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOsiCommonTest", "libOsiCommonTest\libOsiCommonTest.vcxproj", "{109D6E6F-6D91-460F-86AE-DF27400E09A9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiUnitTest", "OsiUnitTest\OsiUnitTest.vcxproj", "{0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|Win32.ActiveCfg = Debug|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|Win32.Build.0 = Debug|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|x64.ActiveCfg = Debug|x64 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|x64.Build.0 = Debug|x64 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|Win32.ActiveCfg = Release|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|Win32.Build.0 = Release|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|x64.ActiveCfg = Release|x64 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|x64.Build.0 = Release|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|Win32.ActiveCfg = Debug|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|Win32.Build.0 = Debug|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|x64.ActiveCfg = Debug|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|x64.Build.0 = Debug|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|Win32.ActiveCfg = Release|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|Win32.Build.0 = Release|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|x64.ActiveCfg = Release|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|x64.Build.0 = Release|x64 {B349E853-2E2B-468E-8853-184ACD948678}.Debug|Win32.ActiveCfg = Debug|Win32 {B349E853-2E2B-468E-8853-184ACD948678}.Debug|x64.ActiveCfg = Debug|Win32 {B349E853-2E2B-468E-8853-184ACD948678}.Release|Win32.ActiveCfg = Release|Win32 {B349E853-2E2B-468E-8853-184ACD948678}.Release|x64.ActiveCfg = Release|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Debug|Win32.ActiveCfg = Debug|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Debug|x64.ActiveCfg = Debug|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Release|Win32.ActiveCfg = Release|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Release|x64.ActiveCfg = Release|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Debug|Win32.ActiveCfg = Debug|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Debug|x64.ActiveCfg = Debug|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Release|Win32.ActiveCfg = Release|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Release|x64.ActiveCfg = Release|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Debug|Win32.ActiveCfg = Debug|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Debug|x64.ActiveCfg = Debug|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Release|Win32.ActiveCfg = Release|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Release|x64.ActiveCfg = Release|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Debug|Win32.ActiveCfg = Debug|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Debug|x64.ActiveCfg = Debug|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Release|Win32.ActiveCfg = Release|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Release|x64.ActiveCfg = Release|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Debug|Win32.ActiveCfg = Debug|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Debug|x64.ActiveCfg = Debug|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Release|Win32.ActiveCfg = Release|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Release|x64.ActiveCfg = Release|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|Win32.ActiveCfg = Debug|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|Win32.Build.0 = Debug|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|x64.ActiveCfg = Debug|x64 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|x64.Build.0 = Debug|x64 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|Win32.ActiveCfg = Release|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|Win32.Build.0 = Release|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|x64.ActiveCfg = Release|x64 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|x64.Build.0 = Release|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|Win32.ActiveCfg = Debug|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|Win32.Build.0 = Debug|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|x64.ActiveCfg = Debug|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|x64.Build.0 = Debug|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|Win32.ActiveCfg = Release|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|Win32.Build.0 = Release|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|x64.ActiveCfg = Release|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal Osi-0.106.4/MSVisualStudio/v10/OsiExamplesParameters/0000755000076600007660000000000012244064313020647 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/OsiExamplesParameters/OsiExamplesParameters.vcxproj0000644000076600007660000001473712106746674026573 0ustar coincoin Debug Win32 Release Win32 {C0F44D7F-B535-44DC-9125-515E813A1753} Win32Proj Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\Osi\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Level3 EditAndContinue $(OutDir)OsiExamplesParameters.exe true $(OutDir)OsiExamplesParameters.pdb Console false MachineX86 ..\..\..\..\Osi\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase $(OutDir)OsiExamplesParameters.exe true Console true true false MachineX86 {c4867f15-438d-4ff8-8388-62fbaaa9786c} false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false Osi-0.106.4/MSVisualStudio/v10/OsiExamplesSpecific/0000755000076600007660000000000012244064313020271 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/OsiExamplesSpecific/OsiExamplesSpecific.vcxproj0000644000076600007660000001472712106746674025636 0ustar coincoin Debug Win32 Release Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A} Win32Proj Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\Osi\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Level3 EditAndContinue $(OutDir)OsiExamplesSpecific.exe true $(OutDir)OsiExamplesSpecific.pdb Console false MachineX86 ..\..\..\..\Osi\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase $(OutDir)OsiExamplesSpecific.exe true Console true true false MachineX86 {c4867f15-438d-4ff8-8388-62fbaaa9786c} false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false Osi-0.106.4/MSVisualStudio/v10/OsiUnitTest/0000755000076600007660000000000012244064313016624 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/OsiUnitTest/OsiUnitTest.vcxproj0000644000076600007660000003027112106746674022514 0ustar coincoin Debug Win32 Debug x64 Release Win32 Release x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C} OsiUnitTest Application Unicode false false Application Unicode false Application Unicode false false Application Unicode false <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;COIN_MSVS;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level3 ProgramDatabase $(OutDir);%(AdditionalLibraryDirectories) true true MachineX86 libCoinUtils.lib;libOsi.lib;libOsiCommonTest.lib;%(AdditionalDependencies) false X64 Disabled ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;COIN_MSVS;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level3 ProgramDatabase $(OutDir);%(AdditionalLibraryDirectories) true true MachineX64 libCoinUtils.lib;libOsi.lib;libOsiCommonTest.lib;%(AdditionalDependencies) false ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;COIN_MSVS;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase $(OutDir);%(AdditionalLibraryDirectories) true MachineX86 libCoinUtils.lib;libOsi.lib;libOsiCommonTest.lib;%(AdditionalDependencies) false X64 ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;COIN_MSVS;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase $(OutDir);%(AdditionalLibraryDirectories) true MachineX64 libCoinUtils.lib;libOsi.lib;libOsiCommonTest.lib;%(AdditionalDependencies) false {c4867f15-438d-4ff8-8388-62fbaaa9786c} false {109d6e6f-6d91-460f-86ae-df27400e09a9} false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false Osi-0.106.4/MSVisualStudio/v10/OsiExamplesBuild/0000755000076600007660000000000012244064313017603 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/OsiExamplesBuild/OsiExamplesBuild.vcxproj0000644000076600007660000001471312106746674024455 0ustar coincoin Debug Win32 Release Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4} Win32Proj Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset Disabled ..\..\..\..\Osi\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Level3 EditAndContinue $(OutDir)OsiExamplesBuild.exe true $(OutDir)OsiExamplesBuild.pdb Console false MachineX86 ..\..\..\..\Osi\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase $(OutDir)OsiExamplesBuild.exe true Console true true false MachineX86 {c4867f15-438d-4ff8-8388-62fbaaa9786c} false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false Osi-0.106.4/MSVisualStudio/v10/libOsi/0000755000076600007660000000000012244064313015613 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/libOsi/libOsi.vcxproj0000644000076600007660000002571212131314077020460 0ustar coincoin Debug Win32 Debug x64 Release Win32 Release x64 {7D98E2CB-876E-4F75-9F71-77D3FE87E149} StaticLibrary StaticLibrary StaticLibrary StaticLibrary <_ProjectFileVersion>10.0.30319.1 AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;%(AdditionalIncludeDirectories) OSI_BUILD;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) true EnableFastChecks _DEBUG;%(PreprocessorDefinitions) 0x0409 true X64 ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;%(AdditionalIncludeDirectories) OSI_BUILD;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) true EnableFastChecks Level3 true ProgramDatabase _DEBUG;%(PreprocessorDefinitions) 0x0409 true ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;%(AdditionalIncludeDirectories) OSI_BUILD;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) true true NDEBUG;%(PreprocessorDefinitions) 0x0409 true X64 Default ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;%(AdditionalIncludeDirectories) OSI_BUILD;WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) true NDEBUG;%(PreprocessorDefinitions) 0x0409 true Osi-0.106.4/MSVisualStudio/v10/libOsiCommonTest/0000755000076600007660000000000012244064313017624 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/libOsiCommonTest/libOsiCommonTest.vcxproj0000644000076600007660000002364412131314077024504 0ustar coincoin Debug Win32 Debug x64 Release Win32 Release x64 {109D6E6F-6D91-460F-86AE-DF27400E09A9} libOsiCommonTest StaticLibrary false StaticLibrary StaticLibrary false StaticLibrary <_ProjectFileVersion>10.0.30319.1 AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;WIN32;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level3 ProgramDatabase %(AdditionalLibraryDirectories) X64 ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level3 ProgramDatabase %(AdditionalLibraryDirectories) ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;WIN32;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase %(AdditionalLibraryDirectories) X64 ..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;..\..\..\..\Osi\src\Osi;..\..\..\..\Osi\src\OsiCommonTest;%(AdditionalIncludeDirectories) OSI_BUILD;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase %(AdditionalLibraryDirectories) {c4867f15-438d-4ff8-8388-62fbaaa9786c} false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false Osi-0.106.4/MSVisualStudio/v10/OsiExamplesBasic/0000755000076600007660000000000012244064313017565 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/OsiExamplesBasic/OsiExamplesBasic.vcxproj0000644000076600007660000001474312106746674024424 0ustar coincoin Debug Win32 Release Win32 {B874A948-B5F4-4501-9735-BD9586C5216D} OsiExamplesBasic Win32Proj Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset Disabled ..\..\..\src\OsiClp;..\..\..\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Level3 EditAndContinue $(OutDir)OsiExamplesBasic.exe true $(OutDir)OsiExamplesBasic.pdb Console false MachineX86 ..\..\..\src\OsiClp;..\..\..\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase $(OutDir)OsiExamplesBasic.exe true Console true true false MachineX86 {c4867f15-438d-4ff8-8388-62fbaaa9786c} false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false Osi-0.106.4/MSVisualStudio/v10/OsiExamplesQuery/0000755000076600007660000000000012244064313017651 5ustar coincoinOsi-0.106.4/MSVisualStudio/v10/OsiExamplesQuery/OsiExamplesQuery.vcxproj0000644000076600007660000001476112106746674024574 0ustar coincoin Debug Win32 Release Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C} OsiExamplesQuery Win32Proj Application MultiByte Application MultiByte <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset Disabled ..\..\..\src\OsiClp;..\..\..\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Level3 EditAndContinue $(OutDir)OsiExamplesQuery.exe true $(OutDir)OsiExamplesQuery.pdb Console false MachineX86 ..\..\..\..\Osi\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase $(OutDir)OsiExamplesQuery.exe true Console true true false MachineX86 {c4867f15-438d-4ff8-8388-62fbaaa9786c} false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false Osi-0.106.4/MSVisualStudio/v9/0000755000076600007660000000000012244064313014322 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/Osi.sln0000644000076600007660000002106312131314077015574 0ustar coincoinMicrosoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOsi", "libOsi\libOsi.vcproj", "{7D98E2CB-876E-4F75-9F71-77D3FE87E149}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCoinUtils", "..\..\..\CoinUtils\MSVisualStudio\v9\libCoinUtils\libCoinUtils.vcproj", "{C4867F15-438D-4FF8-8388-62FBAAA9786C}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesBasic", "OsiExamplesBasic\OsiExamplesBasic.vcproj", "{B874A948-B5F4-4501-9735-BD9586C5216D}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesBuild", "OsiExamplesBuild\OsiExamplesBuild.vcproj", "{1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesParameters", "OsiExamplesParameters\OsiExamplesParameters.vcproj", "{C0F44D7F-B535-44DC-9125-515E813A1753}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesQuery", "OsiExamplesQuery\OsiExamplesQuery.vcproj", "{E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiExamplesSpecific", "OsiExamplesSpecific\OsiExamplesSpecific.vcproj", "{B5A702D5-C5F7-40EE-99E0-A500AE91528A}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOsiCommonTest", "libOsiCommonTest\libOsiCommonTest.vcproj", "{109D6E6F-6D91-460F-86AE-DF27400E09A9}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OsiUnitTest", "OsiUnitTest\OsiUnitTest.vcproj", "{0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}" ProjectSection(ProjectDependencies) = postProject {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {109D6E6F-6D91-460F-86AE-DF27400E09A9} = {109D6E6F-6D91-460F-86AE-DF27400E09A9} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|Win32.ActiveCfg = Debug|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|Win32.Build.0 = Debug|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|x64.ActiveCfg = Debug|x64 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Debug|x64.Build.0 = Debug|x64 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|Win32.ActiveCfg = Release|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|Win32.Build.0 = Release|Win32 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|x64.ActiveCfg = Release|x64 {7D98E2CB-876E-4F75-9F71-77D3FE87E149}.Release|x64.Build.0 = Release|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|Win32.ActiveCfg = Debug|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|Win32.Build.0 = Debug|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|x64.ActiveCfg = Debug|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Debug|x64.Build.0 = Debug|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|Win32.ActiveCfg = Release|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|Win32.Build.0 = Release|Win32 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|x64.ActiveCfg = Release|x64 {C4867F15-438D-4FF8-8388-62FBAAA9786C}.Release|x64.Build.0 = Release|x64 {B349E853-2E2B-468E-8853-184ACD948678}.Debug|Win32.ActiveCfg = Debug|Win32 {B349E853-2E2B-468E-8853-184ACD948678}.Debug|x64.ActiveCfg = Debug|Win32 {B349E853-2E2B-468E-8853-184ACD948678}.Release|Win32.ActiveCfg = Release|Win32 {B349E853-2E2B-468E-8853-184ACD948678}.Release|Win32.Build.0 = Release|Win32 {B349E853-2E2B-468E-8853-184ACD948678}.Release|x64.ActiveCfg = Release|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Debug|Win32.ActiveCfg = Debug|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Debug|x64.ActiveCfg = Debug|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Release|Win32.ActiveCfg = Release|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Release|Win32.Build.0 = Release|Win32 {B874A948-B5F4-4501-9735-BD9586C5216D}.Release|x64.ActiveCfg = Release|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Debug|Win32.ActiveCfg = Debug|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Debug|x64.ActiveCfg = Debug|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Release|Win32.ActiveCfg = Release|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Release|Win32.Build.0 = Release|Win32 {1864FDC9-F116-4EB0-9B3F-6FD11E0307B4}.Release|x64.ActiveCfg = Release|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Debug|Win32.ActiveCfg = Debug|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Debug|x64.ActiveCfg = Debug|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Release|Win32.ActiveCfg = Release|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Release|Win32.Build.0 = Release|Win32 {C0F44D7F-B535-44DC-9125-515E813A1753}.Release|x64.ActiveCfg = Release|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Debug|Win32.ActiveCfg = Debug|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Debug|x64.ActiveCfg = Debug|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Release|Win32.ActiveCfg = Release|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Release|Win32.Build.0 = Release|Win32 {E54AF10F-FCBB-4A09-AAB7-2C83CF91BD2C}.Release|x64.ActiveCfg = Release|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Debug|Win32.ActiveCfg = Debug|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Debug|x64.ActiveCfg = Debug|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Release|Win32.ActiveCfg = Release|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Release|Win32.Build.0 = Release|Win32 {B5A702D5-C5F7-40EE-99E0-A500AE91528A}.Release|x64.ActiveCfg = Release|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|Win32.ActiveCfg = Debug|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|Win32.Build.0 = Debug|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|x64.ActiveCfg = Debug|x64 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Debug|x64.Build.0 = Debug|x64 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|Win32.ActiveCfg = Release|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|Win32.Build.0 = Release|Win32 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|x64.ActiveCfg = Release|x64 {109D6E6F-6D91-460F-86AE-DF27400E09A9}.Release|x64.Build.0 = Release|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|Win32.ActiveCfg = Debug|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|Win32.Build.0 = Debug|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|x64.ActiveCfg = Debug|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Debug|x64.Build.0 = Debug|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|Win32.ActiveCfg = Release|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|Win32.Build.0 = Release|Win32 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|x64.ActiveCfg = Release|x64 {0DCD21B9-FCBD-4B2A-B1DE-65FA359C904C}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal Osi-0.106.4/MSVisualStudio/v9/OsiExamplesParameters/0000755000076600007660000000000012244064313020577 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/OsiExamplesParameters/OsiExamplesParameters.vcproj0000644000076600007660000001047511122615267026314 0ustar coincoin Osi-0.106.4/MSVisualStudio/v9/OsiExamplesSpecific/0000755000076600007660000000000012244064313020221 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/OsiExamplesSpecific/OsiExamplesSpecific.vcproj0000644000076600007660000001046311122615267025355 0ustar coincoin Osi-0.106.4/MSVisualStudio/v9/OsiUnitTest/0000755000076600007660000000000012244064313016554 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/OsiUnitTest/OsiUnitTest.vcproj0000644000076600007660000001732111475606620022247 0ustar coincoin Osi-0.106.4/MSVisualStudio/v9/OsiExamplesBuild/0000755000076600007660000000000012244064313017533 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/OsiExamplesBuild/OsiExamplesBuild.vcproj0000644000076600007660000001044411122615267024200 0ustar coincoin Osi-0.106.4/MSVisualStudio/v9/libOsi/0000755000076600007660000000000012244064313015543 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/libOsi/libOsi.vcproj0000644000076600007660000002331511562355715020230 0ustar coincoin Osi-0.106.4/MSVisualStudio/v9/libOsiCommonTest/0000755000076600007660000000000012244064313017554 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/libOsiCommonTest/libOsiCommonTest.vcproj0000644000076600007660000001635211475326621024252 0ustar coincoin Osi-0.106.4/MSVisualStudio/v9/OsiExamplesBasic/0000755000076600007660000000000012244064313017515 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/OsiExamplesBasic/OsiExamplesBasic.vcproj0000644000076600007660000001045311122615267024144 0ustar coincoin Osi-0.106.4/MSVisualStudio/v9/OsiExamplesQuery/0000755000076600007660000000000012244064313017601 5ustar coincoinOsi-0.106.4/MSVisualStudio/v9/OsiExamplesQuery/OsiExamplesQuery.vcproj0000644000076600007660000001047111122615267024314 0ustar coincoin Osi-0.106.4/Makefile.in0000644000076600007660000010700412240315110013126 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Andreas Waechter IBM 2006-04-13 # Copyright (C) 2006, 2007 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Andreas Waechter IBM 2006-04-13 ######################################################################## # Documentation installation # ######################################################################## srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @COIN_HAS_CPX_TRUE@am__append_1 = src/OsiCpx @COIN_HAS_CPX_TRUE@am__append_2 = osi-cplex.pc @COIN_HAS_GLPK_TRUE@am__append_3 = src/OsiGlpk @COIN_HAS_GLPK_TRUE@am__append_4 = osi-glpk.pc @COIN_HAS_MSK_TRUE@am__append_5 = src/OsiMsk @COIN_HAS_MSK_TRUE@am__append_6 = osi-mosek.pc @COIN_HAS_XPR_TRUE@am__append_7 = src/OsiXpr @COIN_HAS_XPR_TRUE@am__append_8 = osi-xpress.pc @COIN_HAS_GRB_TRUE@am__append_9 = src/OsiGrb @COIN_HAS_GRB_TRUE@am__append_10 = osi-gurobi.pc @COIN_HAS_SOPLEX_TRUE@am__append_11 = src/OsiSpx @COIN_HAS_SOPLEX_TRUE@am__append_12 = osi-soplex.pc # We don't want to compile the test subdirectory, unless the test target is # specified. But we need to list it as subdirectory to make sure that it is # included in the tarball @ALWAYS_FALSE@am__append_13 = test DIST_COMMON = README $(am__configure_deps) \ $(srcdir)/BuildTools/Makemain.inc $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/osi-uninstalled.pc.in \ $(srcdir)/osi-unittests-uninstalled.pc.in \ $(srcdir)/osi-unittests.pc.in $(srcdir)/osi.pc.in \ $(top_srcdir)/configure $(top_srcdir)/doxydoc/doxygen.conf.in \ $(top_srcdir)/examples/Makefile.in \ $(top_srcdir)/src/OsiCpx/osi-cplex-uninstalled.pc.in \ $(top_srcdir)/src/OsiCpx/osi-cplex.pc.in \ $(top_srcdir)/src/OsiGlpk/osi-glpk-uninstalled.pc.in \ $(top_srcdir)/src/OsiGlpk/osi-glpk.pc.in \ $(top_srcdir)/src/OsiGrb/osi-gurobi-uninstalled.pc.in \ $(top_srcdir)/src/OsiGrb/osi-gurobi.pc.in \ $(top_srcdir)/src/OsiMsk/osi-mosek-uninstalled.pc.in \ $(top_srcdir)/src/OsiMsk/osi-mosek.pc.in \ $(top_srcdir)/src/OsiSpx/osi-soplex-uninstalled.pc.in \ $(top_srcdir)/src/OsiSpx/osi-soplex.pc.in \ $(top_srcdir)/src/OsiXpr/osi-xpress-uninstalled.pc.in \ $(top_srcdir)/src/OsiXpr/osi-xpress.pc.in AUTHORS config.guess \ config.sub depcomp install-sh ltmain.sh missing @HAVE_EXTERNALS_TRUE@am__append_14 = Dependencies @HAVE_EXTERNALS_TRUE@am__append_15 = .Dependencies-stamp subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = examples/Makefile osi.pc osi-uninstalled.pc \ osi-unittests.pc osi-unittests-uninstalled.pc osi-cplex.pc \ osi-cplex-uninstalled.pc osi-glpk.pc osi-glpk-uninstalled.pc \ osi-gurobi.pc osi-gurobi-uninstalled.pc osi-mosek.pc \ osi-mosek-uninstalled.pc osi-xpress.pc \ osi-xpress-uninstalled.pc osi-soplex.pc \ osi-soplex-uninstalled.pc doxydoc/doxygen.conf SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgconfiglibdir)" pkgconfiglibDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfiglib_DATA) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = src/Osi src/OsiCommonTest src/OsiCpx src/OsiGlpk \ src/OsiMsk src/OsiXpr src/OsiGrb src/OsiSpx test DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign ######################################################################## # Subdirectories and installation of .pc files # ######################################################################## pkgconfiglibdir = $(libdir)/pkgconfig pkgconfiglib_DATA = osi.pc osi-unittests.pc $(am__append_2) \ $(am__append_4) $(am__append_6) $(am__append_8) \ $(am__append_10) $(am__append_12) SUBDIRS = src/Osi src/OsiCommonTest $(am__append_1) $(am__append_3) \ $(am__append_5) $(am__append_7) $(am__append_9) \ $(am__append_11) $(am__append_13) ######################################################################## # Additional files to be included in tarball # ######################################################################## # Here we need include all files that are not mentioned in other Makefiles EXTRA_DIST = examples/basic2.cpp examples/basic.cpp examples/build.cpp \ examples/Makefile.in examples/parameters.cpp \ examples/query.cpp examples/README examples/specific.cpp \ $(am__append_14) ######################################################################## # Installation of the addlibs file # ######################################################################## addlibsdir = $(DESTDIR)$(datadir)/coin/doc/Osi ######################################################################## # Maintainer Stuff # ######################################################################## CLEANFILES = # Files that are generated and should be cleaned with make distclean DISTCLEANFILES = $(am__append_15) $(VPATH_DISTCLEANFILES) DocFiles = README AUTHORS LICENSE DocInstallDir = $(datadir)/coin/doc/$(PACKAGE_NAME) all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/BuildTools/Makemain.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) examples/Makefile: $(top_builddir)/config.status $(top_srcdir)/examples/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi.pc: $(top_builddir)/config.status $(srcdir)/osi.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/osi-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-unittests.pc: $(top_builddir)/config.status $(srcdir)/osi-unittests.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-unittests-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/osi-unittests-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-cplex.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiCpx/osi-cplex.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-cplex-uninstalled.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiCpx/osi-cplex-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-glpk.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiGlpk/osi-glpk.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-glpk-uninstalled.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiGlpk/osi-glpk-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-gurobi.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiGrb/osi-gurobi.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-gurobi-uninstalled.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiGrb/osi-gurobi-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-mosek.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiMsk/osi-mosek.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-mosek-uninstalled.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiMsk/osi-mosek-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-xpress.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiXpr/osi-xpress.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-xpress-uninstalled.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiXpr/osi-xpress-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-soplex.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiSpx/osi-soplex.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ osi-soplex-uninstalled.pc: $(top_builddir)/config.status $(top_srcdir)/src/OsiSpx/osi-soplex-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ doxydoc/doxygen.conf: $(top_builddir)/config.status $(top_srcdir)/doxydoc/doxygen.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-pkgconfiglibDATA: $(pkgconfiglib_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfiglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfiglibdir)" @list='$(pkgconfiglib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfiglibDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfiglibdir)/$$f'"; \ $(pkgconfiglibDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfiglibdir)/$$f"; \ done uninstall-pkgconfiglibDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfiglib_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfiglibdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfiglibdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. $(distdir)/BuildTools $(distdir)/doxydoc $(distdir)/examples $(distdir)/src/OsiCpx $(distdir)/src/OsiGlpk $(distdir)/src/OsiGrb $(distdir)/src/OsiMsk $(distdir)/src/OsiSpx $(distdir)/src/OsiXpr @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfiglibdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-local distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-pkgconfiglibDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-exec-local install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-local \ uninstall-pkgconfiglibDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-local \ clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-libtool distclean-local \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-exec install-exec-am \ install-exec-local install-info install-info-am install-man \ install-pkgconfiglibDATA install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-hook uninstall-info-am \ uninstall-local uninstall-pkgconfiglibDATA ######################################################################## # Extra Targets # ######################################################################## test: all cd test; $(MAKE) test unitTest: test # Doxygen documentation doxydoc: doxygen doxydoc/doxygen.conf clean-doxydoc: ( cd doxydoc ; rm -rf html *.log *.tag ) clean-local: clean-doxydoc if test -r test/Makefile; then cd test; $(MAKE) clean; fi distclean-local: if test -r test/Makefile; then cd test; $(MAKE) distclean; fi install-exec-local: install-doc uninstall-local: uninstall-doc .PHONY: test unitTest doxydoc install-data-hook: @$(mkdir_p) "$(addlibsdir)" @COIN_HAS_PKGCONFIG_TRUE@ PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ \ @COIN_HAS_PKGCONFIG_TRUE@ $(PKG_CONFIG) --libs osi > $(addlibsdir)/osi_addlibs.txt @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libOsi.lib @OSILIB_LIBS_INSTALLED@" > $(addlibsdir)/osi_addlibs.txt @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lOsi @OSILIB_LIBS_INSTALLED@ > $(addlibsdir)/osi_addlibs.txt uninstall-hook: rm -f $(addlibsdir)/osi_addlibs.txt install-doc: $(DocFiles) test -z "$(DocInstallDir)" || $(mkdir_p) "$(DESTDIR)$(DocInstallDir)" for file in $(DocFiles); do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ if test -f "$$dir$$file"; then $(INSTALL_DATA) "$$dir$$file" "$(DESTDIR)$(DocInstallDir)/$$file"; fi; \ done uninstall-doc: for file in $(DocFiles); do \ rm -f "$(DESTDIR)$(DocInstallDir)/$$file"; \ done ######################################################################## # Maintainer Stuff # ######################################################################## # Make sure acinclude is using most recent coin.m4 @MAINTAINER_MODE_TRUE@$(srcdir)/acinclude.m4: $(BUILDTOOLSDIR)/coin.m4 @MAINTAINER_MODE_TRUE@ cat $(LIBTOOLM4) $< > $@ # Make sure the autotools scripts are up to date @MAINTAINER_MODE_TRUE@$(AUX_DIR)/install-sh: $(BUILDTOOLSDIR)/install-sh @MAINTAINER_MODE_TRUE@ cp $< $@ @MAINTAINER_MODE_TRUE@$(AUX_DIR)/missing: $(BUILDTOOLSDIR)/missing @MAINTAINER_MODE_TRUE@ cp $< $@ @MAINTAINER_MODE_TRUE@$(AUX_DIR)/config.guess: $(BUILDTOOLSDIR)/config.guess @MAINTAINER_MODE_TRUE@ cp $< $@ @MAINTAINER_MODE_TRUE@$(AUX_DIR)/config.sub: $(BUILDTOOLSDIR)/config.sub @MAINTAINER_MODE_TRUE@ cp $< $@ @MAINTAINER_MODE_TRUE@$(AUX_DIR)/depcomp: $(BUILDTOOLSDIR)/depcomp @MAINTAINER_MODE_TRUE@ cp $< $@ @MAINTAINER_MODE_TRUE@$(AUX_DIR)/ltmain.sh: $(BUILDTOOLSDIR)/ltmain.sh @MAINTAINER_MODE_TRUE@ cp $< $@ # Take care of updating externals (if Dependencies file exists) @HAVE_EXTERNALS_TRUE@@MAINTAINER_MODE_TRUE@$(top_builddir)/Makefile: .Dependencies-stamp @HAVE_EXTERNALS_TRUE@@MAINTAINER_MODE_TRUE@.Dependencies-stamp: $(srcdir)/Dependencies @HAVE_EXTERNALS_TRUE@@MAINTAINER_MODE_TRUE@ cd $(srcdir); BuildTools/set_externals Dependencies @HAVE_EXTERNALS_TRUE@@MAINTAINER_MODE_TRUE@ touch .Dependencies-stamp @HAVE_EXTERNALS_TRUE@@MAINTAINER_MODE_TRUE@update-externals: .Dependencies-stamp @HAVE_EXTERNALS_TRUE@@MAINTAINER_MODE_TRUE@ cd $(srcdir); svn update .PHONY: install-doc uninstall-doc update-externals # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/ltmain.sh0000755000076600007660000057753011405216166012740 0ustar coincoin# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built fi build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` else compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` fi ;; * ) compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: Osi-0.106.4/missing0000755000076600007660000002540611405216166012502 0ustar coincoin#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: Osi-0.106.4/README0000644000076600007660000000571211507173764011772 0ustar coincoinOPEN SOLVER INTERFACE LIBRARY README ============================= In this README, 1. 'coin-Osi' is the full path to the directory in which you have dowloaded Osi. 2. 'build' is the full path to the directory used for the installation of Osi. It might be coin-Osi or some other directory of your choosing. OVERVIEW ======== Welcome to the COIN-OR Open Solver Interface Library (Osi). Osi is distributed under the Eclipse Public License Version 1.0 and is freely redistributable. All source code and documentation is copyright by International Business Machines Corporation and (many) others. This README file may be distributed freely. The COIN-OR Open Solver Interface Library is a collection of solver interfaces (SIs) that provide a common interface --- the OSI API --- for all the supported solvers. Each SI is in a separate directory. The authors of each SI are listed in the AUTHORS file in the subdirectory. The names of maintainers and contributors to the base OsiSolverInterface code are listed in the AUTHORS file in this (Osi) directory. For more information, see the Osi Trac page (see below). OSI TRAC PAGE ============= https://projects.coin-or.org/Osi INSTALLATION ============ If you have downloaded the Osi package in the local directory coin-Osi, please see the INSTALL file in coin-Osi (the parent directory of this directory, unless you've changed the default Coin package directory structure) for instructions on how to install the entire package. If you have obtained Osi by downloading some other package, Osi will be installed as part of the installation of that package. See the INSTALL file in the main directory of the package (again, the parent directory of this directory). SUPPORT ======= 1. Authors See the AUTHORS file. 2. Project Managers The main project managers are Lou Hafer, lou@cs.sfu.ca Matt Saltzmann, mjs@clemson.edu Lots of others help out. 3. Mailing List Casual discussion of Osi can usually be found in the coin-discuss mailing list. Serious discussion occurs in the coin-osi-devel mailing list. To subscribe to either, go to http://list.coin-or.org/mailman/listinfo and follow the links. 4. Bug Reports Bug reports should be reported by creating a ticket at https://projects.coin-or.org/Osi/newticket You will need to create a login id. We apologise for the hassle, but it's the only way to avoid spammers. The more you can tell us about the bug (version of Osi, compiler version, operating system, etc.) the better the chance that we can duplicate your bug and fix it. It's helpful if you leave a valid email address, in case we need to contact you for more information. You can also report bugs on the mailing lists, but you're at the mercy of the memory of the developers. Once that email gets filed, well, out of sight, out of mind. 5. Requests for Enhancements As for bugs, please create a ticket. Or, join the coin-osi-devel list and lobby directly. Osi-0.106.4/test/0000755000076600007660000000000012244064313012050 5ustar coincoinOsi-0.106.4/test/OsiGlpkSolverInterfaceTest.cpp0000644000076600007660000012162011612344643020007 0ustar coincoin// Copyright (C) 2002, International Business Machines // Corporation and others. All Rights Reserved. // Copyright (C) 2004 University of Pittsburgh // University of Pittsburgh coding done by Brady Hunsaker // This file is licensed under the terms of Eclipse Public License (EPL). // OsiGlpkSolverInterfaceTest.cpp adapted from OsiClpSolverInterfaceTest.cpp // on 2004/10/16 // Check for ??? to see tests that aren't working correctly. // Also note that OsiPresolve doesn't appear to work with OsiGlpk. This // needs to be examined. #include "CoinPragma.hpp" #include "OsiConfig.h" //#include //#include //#include //#include #include "OsiUnitTests.hpp" #include "OsiGlpkSolverInterface.hpp" #include "OsiRowCut.hpp" #include "OsiCuts.hpp" #include "CoinFloatEqual.hpp" // Added so windows build with dsp files works, // when not building with glpk. #ifdef COIN_HAS_GLPK void OsiGlpkSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir) { // Test default constructor { OsiGlpkSolverInterface m; OSIUNITTEST_ASSERT_ERROR(m.obj_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.collower_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colupper_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.ctype_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowlower_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowupper_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colsol_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsol_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByCol_ == NULL, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getApplicationData() == NULL, {}, "glpk", "default constructor"); int i=2346; m.setApplicationData(&i); OSIUNITTEST_ASSERT_ERROR(*((int *)(m.getApplicationData())) == i, {}, "glpk", "default constructor"); } { CoinRelFltEq eq; OsiGlpkSolverInterface m; std::string fn = mpsDir+"exmip1"; m.readMps(fn.c_str(),"mps"); { OsiGlpkSolverInterface im; OSIUNITTEST_ASSERT_ERROR(im.getNumCols() == 0, {}, "glpk", "default constructor"); OSIUNITTEST_ASSERT_ERROR(im.getModelPtr() != NULL, {}, "glpk", "default constructor"); // Test reset im.reset(); OSIUNITTEST_ASSERT_ERROR(m.obj_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.collower_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.colupper_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.ctype_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.rowlower_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.rowupper_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.colsol_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.rowsol_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.matrixByCol_ == NULL, {}, "glpk", "reset"); OSIUNITTEST_ASSERT_ERROR(m.getApplicationData() == NULL, {}, "glpk", "reset"); } // Test copy constructor and assignment operator { OsiGlpkSolverInterface lhs; { OsiGlpkSolverInterface im(m); OsiGlpkSolverInterface imC1(im); OSIUNITTEST_ASSERT_ERROR(imC1.getModelPtr() != im.getModelPtr(), {}, "glpk", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumCols() == im.getNumCols(), {}, "glpk", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumRows() == im.getNumRows(), {}, "glpk", "copy constructor"); OsiGlpkSolverInterface imC2(im); OSIUNITTEST_ASSERT_ERROR(imC2.getModelPtr() != im.getModelPtr(), {}, "glpk", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumCols() == im.getNumCols(), {}, "glpk", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumRows() == im.getNumRows(), {}, "glpk", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getModelPtr() != imC2.getModelPtr(), {}, "glpk", "copy constructor"); lhs = imC2; } // Test that lhs has correct values even though rhs has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.getModelPtr() != m.getModelPtr(), {}, "glpk", "assignment operator"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumCols() == m.getNumCols(), {}, "glpk", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumRows() == m.getNumRows(), {}, "glpk", "copy constructor"); } // Test clone { OsiGlpkSolverInterface glpkSi(m); OsiSolverInterface * siPtr = &glpkSi; OsiSolverInterface * siClone = siPtr->clone(); OsiGlpkSolverInterface * glpkClone = dynamic_cast(siClone); OSIUNITTEST_ASSERT_ERROR(glpkClone != NULL, {}, "glpk", "clone"); OSIUNITTEST_ASSERT_ERROR(glpkClone->getModelPtr() != glpkSi.getModelPtr(), {}, "glpk", "clone"); OSIUNITTEST_ASSERT_ERROR(glpkClone->getNumRows() == glpkSi.getNumRows(), {}, "glpk", "clone"); OSIUNITTEST_ASSERT_ERROR(glpkClone->getNumCols() == glpkSi.getNumCols(), {}, "glpk", "clone"); delete siClone; } // test infinity { OsiGlpkSolverInterface si; OSIUNITTEST_ASSERT_ERROR(si.getInfinity() == COIN_DBL_MAX, {}, "glpk", "infinity"); } #if 0 // ??? These index error 'throw's aren't in OsiGlpk // Test some catches { OsiGlpkSolverInterface solver; try { solver.setObjCoeff(0,0.0); } catch (CoinError e) { std::cout<<"Correct throw"<getMajorDim() == 5, return, "glpk", "getMatrixByRow: major dim"); OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "glpk", "getMatrixByRow: num elements"); CoinRelFltEq eq; const double * ev = smP->getElements(); // GLPK returns each row in reverse order. This is consistent with // the sparse matrix format but is not what most solvers do. That's // why this section is different. OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4], 3.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3], 1.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1],-1.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0],-1.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 2.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 1.1), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], 2.8), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9],-1.2), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 5.6), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "glpk", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 1.9), {}, "glpk", "getMatrixByRow: elements"); const CoinBigIndex * mi = smP->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "glpk", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "glpk", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "glpk", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "glpk", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "glpk", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "glpk", "getMatrixByRow: vector starts"); const int * ei = smP->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 0, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 1, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 4, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 7, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 1, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 2, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 2, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 5, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 3, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 6, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 0, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "glpk", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 7, {}, "glpk", "getMatrixByRow: indices"); } // Test adding several cuts { OsiGlpkSolverInterface fim; std::string fn = mpsDir+"exmip1"; fim.readMps(fn.c_str(),"mps"); // exmip1.mps has 2 integer variables with index 2 & 3 fim.initialSolve(); OsiRowCut cuts[3]; // Generate one ineffective cut plus two trivial cuts int c; int nc = fim.getNumCols(); int *inx = new int[nc]; for (c=0;cgetMajorDim() == 8, return, "glpk", "getMatrixByCol: major dim"); OSIUNITTEST_ASSERT_ERROR(smP->getMinorDim() == 5, return, "glpk", "getMatrixByCol: minor dim"); OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "glpk", "getMatrixByCol: number of elements"); OSIUNITTEST_ASSERT_ERROR(smP->getSizeVectorStarts() == 9, return, "glpk", "getMatrixByCol: vector starts size"); CoinRelFltEq eq; const double * ev = smP->getElements(); // Unlike row-ordered matrices, GLPK does column-ordered the "normal" way OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 5.6), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2], 1.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3], 2.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4], 1.1), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 1.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6],-2.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 2.8), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8],-1.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 1.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], 1.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11],-1.2), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12],-1.0), {}, "glpk", "getMatrixByCol: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "glpk", "getMatrixByCol: elements"); const CoinBigIndex * mi = smP->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 2, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 4, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 6, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 8, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 10, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[6] == 11, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[7] == 12, {}, "glpk", "getMatrixByCol: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[8] == 14, {}, "glpk", "getMatrixByCol: vector starts"); const int * ei = smP->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 4, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 0, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 1, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 1, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 2, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 0, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 3, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 0, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 4, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 2, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 3, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 0, {}, "glpk", "getMatrixByCol: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 4, {}, "glpk", "getMatrixByCol: indices"); } //-------------- // Test rowsense, rhs, rowrange, matrixByRow { OsiGlpkSolverInterface lhs; { #if 0 // FIXME ??? these won't work because the copy constructor changes the values in m OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "glpk", "???"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "glpk", "???"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "glpk", "???"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "glpk", "???"); #endif OsiGlpkSolverInterface siC1(m); OSIUNITTEST_ASSERT_WARNING(siC1.rowrange_ == NULL, {}, "glpk", "row range"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsense_ == NULL, {}, "glpk", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1.rhs_ == NULL, {}, "glpk", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1.matrixByRow_ == NULL, {}, "glpk", "matrix by row"); const char * siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "glpk", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "glpk", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "glpk", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "glpk", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "glpk", "row sense"); const double * siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "glpk", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "glpk", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "glpk", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "glpk", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "glpk", "right hand side"); const double * siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "glpk", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "glpk", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "glpk", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "glpk", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "glpk", "row range"); const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "glpk", "matrix by row"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim() == 5, return, "glpk", "matrix by row: major dim"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "glpk", "matrix by row: num elements"); const double * ev = siC1mbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4], 3.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3], 1.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1],-1.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0],-1.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 2.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 1.1), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], 2.8), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9],-1.2), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 5.6), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "glpk", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 1.9), {}, "glpk", "matrix by row: elements"); const CoinBigIndex * mi = siC1mbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "glpk", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "glpk", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "glpk", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "glpk", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "glpk", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "glpk", "matrix by row: vector starts"); const int * ei = siC1mbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 0, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 1, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 4, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 7, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 1, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 2, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 2, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 5, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 3, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 6, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 0, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 7, {}, "glpk", "matrix by row: indices"); OSIUNITTEST_ASSERT_WARNING(siC1rs == siC1.getRowSense(), {}, "glpk", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1rhs == siC1.getRightHandSide(), {}, "glpk", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1rr == siC1.getRowRange(), {}, "glpk", "row range"); // Change glpk Model by adding free row OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb( COIN_DBL_MAX); OsiCuts cuts; cuts.insert(rc); siC1.applyCuts(cuts); // Since model was changed, test that cached data is now freed. OSIUNITTEST_ASSERT_ERROR(siC1.rowrange_ == NULL, {}, "glpk", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsense_ == NULL, {}, "glpk", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rhs_ == NULL, {}, "glpk", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByRow_ == NULL, {}, "glpk", "free cached data after adding row"); siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "glpk", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "glpk", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "glpk", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "glpk", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "glpk", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[5] == 'N', {}, "glpk", "row sense after adding row"); siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "glpk", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "glpk", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "glpk", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "glpk", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "glpk", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[5],0.0), {}, "glpk", "right hand side after adding row"); siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "glpk", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "glpk", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "glpk", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "glpk", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "glpk", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[5],0.0), {}, "glpk", "row range after adding row"); lhs = siC1; } // Test that lhs has correct values even though siC1 has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.rowrange_ == NULL, {}, "glpk", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsense_ == NULL, {}, "glpk", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rhs_ == NULL, {}, "glpk", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByRow_ == NULL, {}, "glpk", "freed origin after assignment"); const char * lhsrs = lhs.getRowSense(); OSIUNITTEST_ASSERT_ERROR(lhsrs[0] == 'G', {}, "glpk", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[1] == 'L', {}, "glpk", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[2] == 'E', {}, "glpk", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[3] == 'R', {}, "glpk", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[4] == 'R', {}, "glpk", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[5] == 'N', {}, "glpk", "row sense after assignment"); const double * lhsrhs = lhs.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[0],2.5), {}, "glpk", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[1],2.1), {}, "glpk", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[2],4.0), {}, "glpk", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[3],5.0), {}, "glpk", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[4],15.), {}, "glpk", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[5],0.0), {}, "glpk", "right hand side after assignment"); const double *lhsrr = lhs.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[0],0.0), {}, "glpk", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[1],0.0), {}, "glpk", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[2],0.0), {}, "glpk", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[3],5.0-1.8), {}, "glpk", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[4],15.0-3.0), {}, "glpk", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[5],0.0), {}, "glpk", "row range after assignment"); const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, return, "glpk", "matrix by row after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim() == 6, return, "glpk", "matrix by row after assignment: major dim"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "glpk", "matrix by row after assignment: num elements"); const double * ev = lhsmbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4], 3.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3], 1.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1],-1.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0],-1.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 2.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 1.1), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], 2.8), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9],-1.2), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 5.6), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "glpk", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 1.9), {}, "glpk", "matrix by row after assignment: elements"); const CoinBigIndex * mi = lhsmbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "glpk", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "glpk", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "glpk", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "glpk", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "glpk", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "glpk", "matrix by row after assignment: vector starts"); const int * ei = lhsmbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 0, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 1, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 4, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 7, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 1, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 2, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 2, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 5, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 3, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 6, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 0, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "glpk", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 7, {}, "glpk", "matrix by row after assignment: indices"); } } // Test add/delete columns { OsiGlpkSolverInterface m; std::string fn = mpsDir+"p0033"; m.readMps(fn.c_str(),"mps"); double inf = m.getInfinity(); CoinPackedVector c0; c0.insert(0, 4); c0.insert(1, 1); m.addCol(c0, 0, inf, 3); m.initialSolve(); double objValue = m.getObjValue(); CoinRelFltEq eq(1.0e-2); OSIUNITTEST_ASSERT_ERROR(eq(objValue,2520.57), {}, "glpk", "add/delete columns: first optimal value"); // Try deleting first column that's nonbasic at lower bound (0). int * d = new int[1]; CoinWarmStartBasis *cwsb = dynamic_cast(m.getWarmStart()) ; OSIUNITTEST_ASSERT_ERROR(cwsb != NULL, {}, "glpk", "add/delete columns: have warm start basis"); CoinWarmStartBasis::Status stati ; int iCol ; for (iCol = 0 ; iCol < cwsb->getNumStructural() ; iCol++) { stati = cwsb->getStructStatus(iCol) ; if (stati == CoinWarmStartBasis::atLowerBound) break ; } d[0]=iCol; m.deleteCols(1,d); delete [] d; delete cwsb; d=NULL; m.resolve(); objValue = m.getObjValue(); OSIUNITTEST_ASSERT_ERROR(eq(objValue,2520.57), {}, "glpk", "add/delete columns: optimal value after deleting nonbasic column"); // Try deleting column we added. If basic, go to initialSolve as deleting // basic variable trashes basis required for warm start. iCol = m.getNumCols()-1; cwsb = dynamic_cast(m.getWarmStart()) ; stati = cwsb->getStructStatus(iCol) ; delete cwsb; m.deleteCols(1,&iCol); if (stati == CoinWarmStartBasis::basic) { m.initialSolve() ; } else { m.resolve(); } objValue = m.getObjValue(); OSIUNITTEST_ASSERT_ERROR(eq(objValue,2520.57), {}, "glpk", "add/delete columns: optimal value after deleting added column"); } #if 0 // ??? Simplex routines not adapted to OsiGlpk yet // Solve an lp by hand { OsiGlpkSolverInterface m; std::string fn = mpsDir+"p0033"; m.readMps(fn.c_str(),"mps"); m.setObjSense(-1.0); m.getModelPtr()->messageHandler()->setLogLevel(4); m.initialSolve(); m.getModelPtr()->factorization()->maximumPivots(5); m.setObjSense(1.0); // enable special mode m.enableSimplexInterface(true); // we happen to know that variables are 0-1 and rows are L int numberIterations=0; int numberColumns = m.getNumCols(); int numberRows = m.getNumRows(); double * fakeCost = new double[numberColumns]; double * duals = new double [numberRows]; double * djs = new double [numberColumns]; const double * solution = m.getColSolution(); memcpy(fakeCost,m.getObjCoefficients(),numberColumns*sizeof(double)); while (1) { const double * dj; const double * dual; if ((numberIterations&1)==0) { // use given ones dj = m.getReducedCost(); dual = m.getRowPrice(); } else { // create dj = djs; dual = duals; m.getReducedGradient(djs,duals,fakeCost); } int i; int colIn=9999; int direction=1; double best=1.0e-6; // find most negative reduced cost // Should check basic - but should be okay on this problem for (i=0;ibest) { direction=-1; best=value; colIn=-i-1; } } for (i=0;ibest&&solution[i]>1.0-1.0e-6) { direction=-1; best=value; colIn=i; } } if (colIn==9999) break; // should be optimal int colOut; int outStatus; double theta; OSIUNITTEST_ASSERT_ERROR(m.primalPivotResult(colIn,direction,colOut,outStatus,theta,NULL) == 0, {}, "glpk", "simplex routines"); printf("out %d, direction %d theta %g\n", colOut,outStatus,theta); numberIterations++; } delete [] fakeCost; delete [] duals; delete [] djs; // exit special mode m.disableSimplexInterface(); m.getModelPtr()->messageHandler()->setLogLevel(4); m.resolve(); OSIUNITTEST_ASSERT_ERROR(m.getIterationCount() == 0, {}, "glpk", "simplex routines"); m.setObjSense(-1.0); m.initialSolve(); } // Solve an lp when interface is on { OsiGlpkSolverInterface m; std::string fn = mpsDir+"p0033"; m.readMps(fn.c_str(),"mps"); // enable special mode m.setHintParam(OsiDoScale,false,OsiHintDo); m.setHintParam(OsiDoPresolveInInitial,false,OsiHintDo); m.setHintParam(OsiDoDualInInitial,false,OsiHintDo); m.setHintParam(OsiDoPresolveInResolve,false,OsiHintDo); m.setHintParam(OsiDoDualInResolve,false,OsiHintDo); m.enableSimplexInterface(true); m.initialSolve(); } // Check tableau stuff when simplex interface is on { OsiGlpkSolverInterface m; /* Wolsey : Page 130 max 4x1 - x2 7x1 - 2x2 <= 14 x2 <= 3 2x1 - 2x2 <= 3 x1 in Z+, x2 >= 0 */ double inf_ = m.getInfinity(); int n_cols = 2; int n_rows = 3; double obj[2] = {-4.0, 1.0}; double collb[2] = {0.0, 0.0}; double colub[2] = {inf_, inf_}; double rowlb[3] = {-inf_, -inf_, -inf_}; double rowub[3] = {14.0, 3.0, 3.0}; int rowIndices[5] = {0, 2, 0, 1, 2}; int colIndices[5] = {0, 0, 1, 1, 1}; double elements[5] = {7.0, 2.0, -2.0, 1.0, -2.0}; CoinPackedMatrix M(true, rowIndices, colIndices, elements, 5); m.loadProblem(M, collb, colub, obj, rowlb, rowub); m.enableSimplexInterface(true); m.initialSolve(); //check that the tableau matches wolsey (B-1 A) // slacks in second part of binvA double * binvA = (double*) malloc((n_cols+n_rows) * sizeof(double)); printf("B-1 A"); for(int i = 0; i < n_rows; i++){ m.getBInvARow(i, binvA,binvA+n_cols); printf("\nrow: %d -> ",i); for(int j=0; j < n_cols+n_rows; j++){ printf("%g, ", binvA[j]); } } printf("\n"); m.disableSimplexInterface(); free(binvA); } #endif /* Read in exmip1 and solve it with verbose output setting. */ { OsiGlpkSolverInterface osi ; std::cout << "Boosting verbosity.\n" ; osi.setHintParam(OsiDoReducePrint,false,OsiForceDo) ; std::string exmpsfile = mpsDir+"exmip1" ; std::string probname ; std::cout << "Reading mps file \"" << exmpsfile << "\"\n" ; osi.readMps(exmpsfile.c_str(), "mps") ; OSIUNITTEST_ASSERT_ERROR(osi.getStrParam(OsiProbName,probname), {}, "glpk", "get problem name"); std::cout << "Solving " << probname << " ... \n" ; osi.initialSolve() ; double val = osi.getObjValue() ; std::cout << "And the answer is " << val << ".\n" ; OSIUNITTEST_ASSERT_ERROR(fabs(val - 3.23) < 0.01, {}, "glpk", "solve exmip1"); } // Do common solverInterface testing { OsiGlpkSolverInterface m; OsiSolverInterfaceCommonUnitTest(&m, mpsDir,netlibDir); } } #endif Osi-0.106.4/test/unitTest.cpp0000644000076600007660000003042311575423733014410 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // Test individual classes or groups of classes // This file is licensed under the terms of Eclipse Public License (EPL). // $Id: unitTest.cpp 1744 2011-06-13 15:08:11Z stefan $ #include "CoinPragma.hpp" #include "OsiConfig.h" #include #include "OsiUnitTests.hpp" #include "OsiSolverInterface.hpp" #include "OsiTestSolverInterface.hpp" using namespace OsiUnitTest; /* Currently the Osi unit test is configured to exercise only the external solvers. The Osi interfaces for Coin solvers have been moved out to the project's repository and each has its own private Osi unit test. This unit test will include as many external solvers as are available. If none of them are available, the OsiTestSolver (currently a clone of Vol) will be used. If any other solver is available, its presence will disable use of the test solver. You can disable it manually by undefining USETESTSOLVER. You may want to use the Osi unit test to compare two or more Coin solvers. In particular, OsiSolverInterfaceMpsUnitTest, which runs the Netlib problem set, is set up for exactly this sort of comparison. To take advantage of it, you'll need to edit this file and Makefile in order to get it to work. */ #define USETESTSOLVER /* Some convenient undef's, to make it easy to isolate a particular solver. Uncomment to disable a solver that's included in the build. Leave them commented if you're happy with running the unitTest for all solvers in the build. */ // #undef COIN_HAS_XPR // #undef COIN_HAS_CPX // #undef COIN_HAS_GLPK // #undef COIN_HAS_MSK // #undef COIN_HAS_GRB // #undef COIN_HAS_SOPLEX #ifdef COIN_HAS_XPR #include "OsiXprSolverInterface.hpp" #ifdef USETESTSOLVER #undef USETESTSOLVER #endif #endif #ifdef COIN_HAS_CPX #include "OsiCpxSolverInterface.hpp" #undef USETESTSOLVER #ifdef USETESTSOLVER #undef USETESTSOLVER #endif #endif #ifdef COIN_HAS_GLPK #include "OsiGlpkSolverInterface.hpp" #ifdef USETESTSOLVER #undef USETESTSOLVER #endif #endif #ifdef COIN_HAS_MSK #include "OsiMskSolverInterface.hpp" #ifdef USETESTSOLVER #undef USETESTSOLVER #endif #endif #ifdef COIN_HAS_GRB #include "OsiGrbSolverInterface.hpp" #ifdef USETESTSOLVER #undef USETESTSOLVER #endif #endif #ifdef COIN_HAS_SOPLEX #include "OsiSpxSolverInterface.hpp" #ifdef USETESTSOLVER #undef USETESTSOLVER #endif #endif #ifdef USETESTSOLVER #include "OsiTestSolverInterface.hpp" #endif //---------------------------------------------------------------- // to see parameter list, call unitTest -usage //---------------------------------------------------------------- int main (int argc, const char *argv[]) { /* Start off with various bits of initialisation that don't really belong anywhere else. First off, synchronise C++ stream i/o with C stdio. This makes debugging output a bit more comprehensible. It still suffers from interleave of cout (stdout) and cerr (stderr), but -nobuf deals with that. */ std::ios::sync_with_stdio() ; /* Suppress an popup window that Windows shows in response to a crash. See note at head of file. */ WindowsErrorPopupBlocker(); /* Might as well make use of this convenient Xpress feature. */ #ifdef COIN_HAS_XPR OsiXprSolverInterface::setLogFileName("xprCallTrace.txt"); #endif /* Process command line parameters. */ std::map parms ; if (processParameters(argc,argv,parms) == false) return 1; std::string mpsDir = parms["-mpsDir"] ; std::string netlibDir = parms["-netlibDir"] ; /* Test Osi{Row,Col}Cut routines. */ #ifdef COIN_HAS_XPR { OsiXprSolverInterface xprSi; testingMessage( "Testing OsiRowCut with OsiXprSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutUnitTest(&xprSi,mpsDir), {}, xprSi, "rowcut unittest"); } { OsiXprSolverInterface xprSi; testingMessage( "Testing OsiColCut with OsiXprSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiColCutUnitTest(&xprSi,mpsDir), {}, xprSi, "colcut unittest"); } { OsiXprSolverInterface xprSi; testingMessage( "Testing OsiRowCutDebugger with OsiXprSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutDebuggerUnitTest(&xprSi,mpsDir), {}, xprSi, "rowcut debugger unittest"); } #endif #ifdef COIN_HAS_CPX { OsiCpxSolverInterface cpxSi; testingMessage( "Testing OsiRowCut with OsiCpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutUnitTest(&cpxSi,mpsDir), {}, cpxSi, "rowcut unittest"); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing OsiColCut with OsiCpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiColCutUnitTest(&cpxSi,mpsDir), {}, cpxSi, "colcut unittest"); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing OsiRowCutDebugger with OsiCpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutDebuggerUnitTest(&cpxSi,mpsDir), {}, cpxSi, "rowcut debugger unittest"); } #endif #ifdef USETESTSOLVER { OsiTestSolverInterface testSi; testingMessage( "Testing OsiRowCut with OsiTestSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutUnitTest(&testSi,mpsDir), {}, testSi, "rowcut unittest"); } { OsiTestSolverInterface testSi; testingMessage( "Testing OsiColCut with OsiTestSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiColCutUnitTest(&testSi,mpsDir), {}, testSi, "colcut unittest"); } #endif #ifdef COIN_HAS_GLPK { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing OsiRowCut with OsiGlpkSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutUnitTest(&glpkSi,mpsDir), {}, glpkSi, "rowcut unittest"); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing OsiColCut with OsiGlpkSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiColCutUnitTest(&glpkSi,mpsDir), {}, glpkSi, "colcut unittest"); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing OsiRowCutDebugger with OsiGlpkSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutDebuggerUnitTest(&glpkSi,mpsDir), {}, glpkSi, "rowcut debugger unittest"); } #endif #ifdef COIN_HAS_MSK { OsiMskSolverInterface MskSi; testingMessage( "Testing OsiRowCut with OsiMskSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutUnitTest(&MskSi,mpsDir), {}, MskSi, "rowcut unittest"); } { OsiMskSolverInterface MskSi; testingMessage( "Testing OsiColCut with OsiMskSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiColCutUnitTest(&MskSi,mpsDir), {}, MskSi, "colcut unittest"); } { OsiMskSolverInterface MskSi; testingMessage( "Testing OsiRowCutDebugger with OsiMskSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutDebuggerUnitTest(&MskSi,mpsDir), {}, MskSi, "rowcut debugger unittest"); } #endif #ifdef COIN_HAS_GRB { OsiGrbSolverInterface grbSi; testingMessage( "Testing OsiRowCut with OsiGrbSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutUnitTest(&grbSi,mpsDir), {}, grbSi, "rowcut unittest"); } { OsiGrbSolverInterface grbSi; testingMessage( "Testing OsiColCut with OsiGrbSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiColCutUnitTest(&grbSi,mpsDir), {}, grbSi, "colcut unittest"); } { OsiGrbSolverInterface grbSi; testingMessage( "Testing OsiRowCutDebugger with OsiGrbSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutDebuggerUnitTest(&grbSi,mpsDir), {}, grbSi, "rowcut debugger unittest"); } #endif #ifdef COIN_HAS_SOPLEX { OsiSpxSolverInterface spxSi; testingMessage( "Testing OsiRowCut with OsiSpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutUnitTest(&spxSi,mpsDir), {}, spxSi, "rowcut unittest"); } { OsiSpxSolverInterface spxSi; testingMessage( "Testing OsiColCut with OsiSpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiColCutUnitTest(&spxSi,mpsDir), {}, spxSi, "colcut unittest"); } { OsiSpxSolverInterface spxSi; testingMessage( "Testing OsiRowCutDebugger with OsiSpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiRowCutDebuggerUnitTest(&spxSi,mpsDir), {}, spxSi, "rowcut debugger unittest"); } #endif testingMessage( "Testing OsiCuts\n" ); OSIUNITTEST_CATCH_ERROR(OsiCutsUnitTest(), {}, "osi", "osicuts unittest"); /* Testing OsiCuts only? A useful option when doing memory access and leak checks. Keeps the run time to something reasonable. */ if (parms.find("-cutsOnly") != parms.end()) { testingMessage( "Stopping after OsiCuts tests.\n" ); return 0; } /* Run the OsiXXX class test for each solver. It's up to the solver implementor to decide whether or not to run OsiSolverInterfaceCommonUnitTest. Arguably this should be required. */ #ifdef COIN_HAS_XPR testingMessage( "Testing OsiXprSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiXprSolverInterfaceUnitTest(mpsDir,netlibDir), {}, "xpress", "osixpr unittest"); #endif #ifdef COIN_HAS_CPX testingMessage( "Testing OsiCpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiCpxSolverInterfaceUnitTest(mpsDir,netlibDir), {}, "cplex", "osicpx unittest"); #endif #ifdef USETESTSOLVER testingMessage( "Testing OsiTestSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiTestSolverInterfaceUnitTest(mpsDir,netlibDir), {}, "vol", "ositestsolver unittest"); #endif #ifdef COIN_HAS_GLPK testingMessage( "Testing OsiGlpkSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiGlpkSolverInterfaceUnitTest(mpsDir,netlibDir), {}, "glpk", "osiglpk unittest"); #endif #ifdef COIN_HAS_MSK testingMessage( "Testing OsiMskSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiMskSolverInterfaceUnitTest(mpsDir,netlibDir), {}, "mosek", "osimsk unittest"); #endif #ifdef COIN_HAS_GRB testingMessage( "Testing OsiGrbSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiGrbSolverInterfaceUnitTest(mpsDir,netlibDir), {}, "gurobi", "osigrb unittest"); #endif #ifdef COIN_HAS_SOPLEX testingMessage( "Testing OsiSpxSolverInterface\n" ); OSIUNITTEST_CATCH_ERROR(OsiSpxSolverInterfaceUnitTest(mpsDir,netlibDir), {}, "soplex", "osispx unittest"); #endif /* Each solver has run its specialised unit test. Check now to see if we need to run through the Netlib problems. */ if (parms.find("-testOsiSolverInterface") != parms.end()) { // Create vector of solver interfaces std::vector vecSi; # if COIN_HAS_XPR OsiSolverInterface * xprSi = new OsiXprSolverInterface; vecSi.push_back(xprSi); # endif # if COIN_HAS_CPX OsiSolverInterface * cpxSi = new OsiCpxSolverInterface; vecSi.push_back(cpxSi); # endif # if COIN_HAS_GLPK OsiSolverInterface * glpkSi = new OsiGlpkSolverInterface; glpkSi->setHintParam(OsiDoPresolveInInitial,true,OsiHintTry) ; glpkSi->setHintParam(OsiDoReducePrint,true,OsiHintDo) ; vecSi.push_back(glpkSi); # endif # if COIN_HAS_MSK OsiSolverInterface * MskSi = new OsiMskSolverInterface; vecSi.push_back(MskSi); # endif # if COIN_HAS_GRB OsiSolverInterface * grbSi = new OsiGrbSolverInterface; vecSi.push_back(grbSi); # endif # if COIN_HAS_SOPLEX OsiSolverInterface * spxSi = new OsiSpxSolverInterface; vecSi.push_back(spxSi); # endif # ifdef USETESTSOLVER /* The test solver is normally Vol, which can't do any of the netlib problems. So let's not try. */ { std::string solverName ; OsiSolverInterface * testSi = new OsiTestSolverInterface; testSi->getStrParam(OsiSolverName,solverName) ; if (solverName != "vol") { vecSi.push_back(testSi); } else { testingMessage("Test solver vol cannot do Netlib. Skipping.\n") ; } } # endif if (vecSi.size() > 0) { testingMessage( "Testing OsiSolverInterface on Netlib problems.\n" ); OSIUNITTEST_CATCH_ERROR(OsiSolverInterfaceMpsUnitTest(vecSi,netlibDir), {}, "osi", "netlib unittest"); } unsigned int i; for (i=0; i nerrors_expected) std::cerr << "Tests completed with " << nerrors - nerrors_expected << " unexpected errors." << std::endl ; else std::cerr << "All tests completed successfully\n"; return nerrors - nerrors_expected; } Osi-0.106.4/test/OsiTestSolver.cpp0000644000076600007660000004334112101340333015335 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This file is licensed under the terms of Eclipse Public License (EPL). #include #include #include #include #include #include "OsiTestSolver.hpp" //############################################################################# /// Usage: v=w; where w is a VOL_dvector VOL_dvector& VOL_dvector::operator=(const VOL_dvector& w) { if (this == &w) return *this; delete[] v; const int wsz = w.size(); if (wsz == 0) { v = 0; sz = 0; } else { v = new double[sz = wsz]; for (int i = sz - 1; i >= 0; --i) v[i] = w[i]; } return *this; } /// Usage v=w; where w is a double. It copies w in every entry of v VOL_dvector& VOL_dvector::operator=(const double w) { for (int i = sz - 1; i >= 0; --i) v[i] = w; return *this; } //############################################################################# /// Usage: v=w; where w is a VOL_ivector VOL_ivector& VOL_ivector::operator=(const VOL_ivector& w) { if (this == &w) return *this; delete[] v; const int wsz = w.size(); if (wsz == 0) { v = 0; sz = 0; } else { v = new int[sz = wsz]; for (int i = sz - 1; i >= 0; --i) v[i] = w[i]; } return *this; } /// Usage v=w; where w is an int. It copies w in every entry of v VOL_ivector& VOL_ivector::operator=(const int w) { for (int i = sz - 1; i >= 0; --i) v[i] = w; return *this; } //############################################################################ /// find maximum absolute value of the primal violations void VOL_primal::find_max_viol(const VOL_dvector& dual_lb, const VOL_dvector& dual_ub) { const int nc = v.size(); viol = 0; for ( int i = 0; i < nc; ++i ) { if ( (v[i] > 0.0 && dual_ub[i] != 0.0) || (v[i] < 0.0 && dual_lb[i] != 0.0) ) viol = VolMax(viol, VolAbs(v[i])); } } //############################################################################ /// Dual step. It takes a step in the direction v // lcost is a member of VOL_dual void VOL_dual::step(const double target, const double lambda, const VOL_dvector& dual_lb, const VOL_dvector& dual_ub, const VOL_dvector& v) { const int nc = u.size(); int i; double viol = 0.0; for (i = 0; i < nc; ++i) { if (( v[i] > 0.0 && u[i] < dual_ub[i] ) || ( v[i] < 0.0 && u[i] > dual_lb[i] )) { viol += v[i] * v[i]; } } const double stp = viol == 0.0 ? 0.0 : (target - lcost) / viol * lambda; for (i = 0; i < nc; ++i) { if (( v[i] > 0.0 && u[i] < dual_ub[i] ) || ( v[i] < 0.0 && u[i] > dual_lb[i] )) { u[i] += stp * v[i]; if (u[i] < dual_lb[i]) u[i] = dual_lb[i]; else if (u[i] > dual_ub[i]) u[i] = dual_ub[i]; } } } /// ascent = inner product(v, u - last_u) double VOL_dual::ascent(const VOL_dvector& v, const VOL_dvector& last_u) const { const int nc = u.size(); int i; double asc = 0.0; for (i = 0; i < nc; ++i) asc += v[i] * (u[i] - last_u[i]); return asc; } /** compute xrc. This is (c - u A) * ( xstar - x ). This is just miscellaneous information, it is not used in the algorithm. */ void VOL_dual::compute_xrc(const VOL_dvector& xstar, const VOL_dvector& x, const VOL_dvector& rc) { const int nc = x.size(); xrc = 0; for (int i = 0; i < nc; ++i) { xrc += rc[i] * (xstar[i] - x[i]); } } //############################################################################ /** Computing inner products. It computes v * ( alpha v + (1-alpha) h), v * h, v * v, h * h. Here v is the subgradient direction, and h is the conjugate direction. */ VOL_vh::VOL_vh(const double alpha, const VOL_dvector& dual_lb, const VOL_dvector& dual_ub, const VOL_dvector& v, const VOL_dvector& vstar, const VOL_dvector& u) : hh(0), norm(0), vh(0), asc(0) { int i; const int nc = vstar.size(); double vv; for (i = 0; i < nc; ++i) { const double vi = v[i]; const double vsi = vstar[i]; vv = alpha * vi + (1.0 - alpha) * vsi; if (u[i] == 0.0 && dual_lb[i] == 0.0 && vv <= 0.0) continue; if (u[i] == 0.0 && dual_ub[i] == 0.0 && vv >= 0.0) continue; asc += vi * vv; vh += vi * vsi; norm += vi * vi; hh += vsi * vsi; } } //############################################################################ /** Computes indicators for printing. They are v2=vstar * vstar, asc= v*v, vu= vstar * u, vabs = sum( abs(vstar[i]))/m, v2= sum( vstar[i]^2) / m. */ VOL_indc::VOL_indc(const VOL_dvector& dual_lb, const VOL_dvector& dual_ub, const VOL_primal& primal, const VOL_primal& pstar, const VOL_dual& dual) { v2 = vu = vabs = asc = 0.0; const VOL_dvector v = primal.v; const VOL_dvector vstar = pstar.v; const VOL_dvector u = dual.u; int i; const int nc = vstar.size(); for (i = 0; i < nc; ++i) { if (u[i] == 0.0 && dual_lb[i] == 0.0 && vstar[i] <= 0.0) continue; if (u[i] == 0.0 && dual_ub[i] == 0.0 && vstar[i] >= 0.0) continue; v2 += vstar[i] * vstar[i]; asc += v[i] * v[i]; vu -= vstar[i] * u[i]; vabs += VolAbs(vstar[i]); } v2 = sqrt(v2) / nc; vabs /= nc; } //############################################################################ // reading parameters that control the algorithm void VOL_problem::read_params(const char* filename) { char s[100]; FILE* infile = fopen(filename, "r"); if (!infile) { printf("Failure to open file: %s\n", filename); abort(); } while (fgets(s, 100, infile)) { const size_t len = strlen(s) - 1; if (s[len] == '\n') s[len] = 0; std::string ss(s); if (ss.find("temp_dualfile") == 0) { size_t i = ss.find("="); size_t i1 = ss.length()-i-1; std::string sss = ss.substr(i+1,i1); parm.temp_dualfile = new char[sss.length() + 1]; memcpy(parm.temp_dualfile, sss.c_str(), sss.length()); parm.temp_dualfile[sss.length()] = 0; } else if (ss.find("ubinit") == 0) { size_t i = ss.find("="); parm.ubinit = atof(&s[i+1]); } else if (ss.find("printflag") == 0) { size_t i = ss.find("="); parm.printflag = atoi(&s[i+1]); } else if (ss.find("printinvl") == 0) { size_t i = ss.find("="); parm.printinvl = atoi(&s[i+1]); } else if (ss.find("maxsgriters") == 0) { size_t i = ss.find("="); parm.maxsgriters = atoi(&s[i+1]); } else if (ss.find("heurinvl") == 0) { size_t i = ss.find("="); parm.heurinvl = atoi(&s[i+1]); } else if (ss.find("greentestinvl") == 0) { size_t i = ss.find("="); parm.greentestinvl = atoi(&s[i+1]); } else if (ss.find("yellowtestinvl") == 0) { size_t i = ss.find("="); parm.yellowtestinvl = atoi(&s[i+1]); } else if (ss.find("redtestinvl") == 0) { size_t i = ss.find("="); parm.redtestinvl = atoi(&s[i+1]); } else if (ss.find("lambdainit") == 0) { size_t i = ss.find("="); parm.lambdainit = atof(&s[i+1]); } else if (ss.find("alphainit") == 0) { size_t i = ss.find("="); parm.alphainit = atof(&s[i+1]); } else if (ss.find("alphamin") == 0) { size_t i = ss.find("="); parm.alphamin = atof(&s[i+1]); } else if (ss.find("alphafactor") == 0) { size_t i = ss.find("="); parm.alphafactor = atof(&s[i+1]); } else if (ss.find("alphaint") == 0) { size_t i = ss.find("="); parm.alphaint = atoi(&s[i+1]); } else if (ss.find("primal_abs_precision") == 0) { size_t i = ss.find("="); parm.primal_abs_precision = atof(&s[i+1]); // } else if (ss.find("primal_rel_precision") == 0) { // size_t i = ss.find("="); // parm.primal_rel_precision = atof(&s[i+1]); } else if (ss.find("gap_abs_precision") == 0) { size_t i = ss.find("="); parm.gap_abs_precision = atof(&s[i+1]); } else if (ss.find("gap_rel_precision") == 0) { size_t i = ss.find("="); parm.gap_rel_precision = atof(&s[i+1]); } else if (ss.find("ascent_check_invl") == 0) { size_t i = ss.find("="); parm.ascent_check_invl = atoi(&s[i+1]); } else if (ss.find("minimum_rel_ascent") == 0) { size_t i = ss.find("="); parm.minimum_rel_ascent = atoi(&s[i+1]); } else if (ss.find("granularity") == 0) { size_t i = ss.find("="); parm.granularity = atof(&s[i+1]); } } fclose(infile); } //############################################################################# void VOL_problem::set_default_parm() { parm.lambdainit = 0.1; parm.alphainit = 0.01; parm.alphamin = 0.001; parm.alphafactor = 0.5; parm.ubinit = COIN_DBL_MAX; parm.primal_abs_precision = 0.02; // parm.primal_rel_precision = 0.01; parm.gap_abs_precision = 0.0; parm.gap_rel_precision = 0.001; parm.granularity = 0.0; parm.minimum_rel_ascent = 0.0001; parm.ascent_first_check = 500; parm.ascent_check_invl = 100; parm.maxsgriters = 2000; parm.printflag = 3; parm.printinvl = 50; parm.heurinvl = 100000000; parm.greentestinvl = 1; parm.yellowtestinvl = 2; parm.redtestinvl = 10; parm.alphaint = 80; parm.temp_dualfile = 0; } //############################################################################# VOL_problem::VOL_problem() : alpha_(-1), lambda_(-1), iter_(0), value(-1), psize(-1), dsize(-1) { set_default_parm(); } // VOL_problem::VOL_problem(const char *filename) : alpha_(-1), lambda_(-1), iter_(0), value(-1), psize(-1), dsize(-1) { set_default_parm(); read_params(filename); } //###################################################################### VOL_problem::~VOL_problem() { delete[] parm.temp_dualfile; } //###################################################################### /// print information about the current iteration void VOL_problem::print_info(const int iter, const VOL_primal& primal, const VOL_primal& pstar, const VOL_dual& dual) { VOL_indc indc(dual_lb, dual_ub, primal, pstar, dual); printf("%i. L=%f P=%f vu=%f infeas=%f\n asc=%f vmax=%f P-vu=%f xrc =%f\n", iter, dual.lcost, pstar.value, indc.vu, indc.v2, indc.asc, pstar.viol, pstar.value - indc.vu, dual.xrc); } //###################################################################### /// this is the Volume Algorithm int VOL_problem::solve(VOL_user_hooks& hooks, const bool use_preset_dual) { if (initialize(use_preset_dual) < 0) // initialize several parameters return -1; double best_ub = parm.ubinit; // upper bound int retval = 0; VOL_dvector rc(psize); // reduced costs VOL_dual dual(dsize); // dual vector dual.u = dsol; VOL_primal primal(psize, dsize); // primal vector retval = hooks.compute_rc(dual.u, rc); // compute reduced costs if (retval < 0) return -1; // solve relaxed problem retval = hooks.solve_subproblem(dual.u, rc, dual.lcost, primal.x, primal.v, primal.value); if (retval < 0) return -1; // set target for the lagrangian value double target = readjust_target(-COIN_DBL_MAX/2, dual.lcost); // find primal violation primal.find_max_viol(dual_lb, dual_ub); // this may be left out for speed VOL_primal pstar(primal); // set pstar=primal pstar.find_max_viol(dual_lb, dual_ub); // set violation of pstar dual.compute_xrc(pstar.x, primal.x, rc); // compute xrc // VOL_dual dstar(dual); // dstar is the best dual solution so far VOL_dual dlast(dual); // set dlast=dual iter_ = 0; if (parm.printflag) print_info(iter_, primal, pstar, dual); VOL_swing swing; VOL_alpha_factor alpha_factor; double * lcost_sequence = new double[parm.ascent_check_invl]; const int ascent_first_check = VolMax(parm.ascent_first_check, parm.ascent_check_invl); for (iter_ = 1; iter_ <= parm.maxsgriters; ++iter_) { // main iteration dlast = dual; // take a dual step dual.step(target, lambda_, dual_lb, dual_ub, pstar.v); // compute reduced costs retval = hooks.compute_rc(dual.u, rc); if (retval < 0) break; // solve relaxed problem retval = hooks.solve_subproblem(dual.u, rc, dual.lcost, primal.x, primal.v, primal.value); if (retval < 0) break; // set the violation of primal primal.find_max_viol(dual_lb, dual_ub); // this may be left out for speed dual.compute_xrc(pstar.x, primal.x, rc); // compute xrc if (dual.lcost > dstar.lcost) { dstar = dual; // update dstar } // check if target should be updated target = readjust_target(target, dstar.lcost); // compute inner product between the new subgradient and the // last direction. This to decide among green, yellow, red const double ascent = dual.ascent(primal.v, dlast.u); // green, yellow, red swing.cond(dlast, dual.lcost, ascent, iter_); // change lambda if needed lambda_ *= swing.lfactor(parm, lambda_, iter_); if (iter_ % parm.alphaint == 0) { // change alpha if needed const double fact = alpha_factor.factor(parm, dstar.lcost, alpha_); if (fact != 1.0 && (parm.printflag & 2)) { printf(" ------------decreasing alpha to %f\n", alpha_*fact); } alpha_ *= fact; } // convex combination with new primal vector pstar.cc(power_heur(primal, pstar, dual), primal); pstar.find_max_viol(dual_lb, dual_ub); // find maximum violation of pstar if (swing.rd) dual = dstar; // if there is no improvement reset dual=dstar if ((iter_ % parm.printinvl == 0) && parm.printflag) { // printing iteration information print_info(iter_, primal, pstar, dual); swing.print(); } if (iter_ % parm.heurinvl == 0) { // run primal heuristic double ub = COIN_DBL_MAX; retval = hooks.heuristics(*this, pstar.x, ub); if (retval < 0) break; if (ub < best_ub) best_ub = ub; } // save dual solution every 500 iterations if (iter_ % 500 == 0 && parm.temp_dualfile != 0) { FILE* outfile = fopen(parm.temp_dualfile, "w"); const VOL_dvector& u = dstar.u; const int m = u.size(); for (int i = 0; i < m; ++i) { fprintf(outfile, "%i %f\n", i+1, u[i]); } fclose(outfile); } // test terminating criteria const bool primal_feas = (pstar.viol < parm.primal_abs_precision); //const double gap = VolAbs(pstar.value - dstar.lcost); const double gap = pstar.value - dstar.lcost; const bool small_gap = VolAbs(dstar.lcost) < 0.0001 ? (gap < parm.gap_abs_precision) : ( (gap < parm.gap_abs_precision) || (gap/VolAbs(dstar.lcost) < parm.gap_rel_precision) ); // test optimality if (primal_feas && small_gap){ if (parm.printflag) printf(" small lp gap \n"); break; } // test proving integer optimality if (best_ub - dstar.lcost < parm.granularity){ if (parm.printflag) printf(" small ip gap \n"); break; } // test for non-improvement const int k = iter_ % parm.ascent_check_invl; if (iter_ > ascent_first_check) { if (dstar.lcost - lcost_sequence[k] < VolAbs(lcost_sequence[k]) * parm.minimum_rel_ascent){ if (parm.printflag) printf(" small improvement \n"); break; } } lcost_sequence[k] = dstar.lcost; } delete[] lcost_sequence; if (parm.printflag) print_info(iter_, primal, pstar, dual); // set solution to return value = dstar.lcost; psol = pstar.x; dsol = dstar.u; viol = pstar.v; return retval; } /// A function to initialize a few variables int VOL_problem::initialize(const bool use_preset_dual) { // setting bounds for dual variables if (dual_lb.size() > 0) { if (dual_lb.size() != dsize) { printf("size inconsistent (dual_lb)\n"); return -1; } } else { // fill it with -infinity dual_lb.allocate(dsize); dual_lb = - COIN_DBL_MAX; } if (dual_ub.size() > 0) { if (dual_ub.size() != dsize) { printf("size inconsistent (dual_ub)\n"); return -1; } } else { // fill it with infinity dual_ub.allocate(dsize); dual_ub = COIN_DBL_MAX; } // setting initial values for parameters alpha_ = parm.alphainit; lambda_ = parm.lambdainit; // check if there is an initial dual solution if (use_preset_dual) { if (dsol.size() != dsize) { printf("size inconsistent (dsol)\n"); return -1; } } else { dsol.clear(); dsol.allocate(dsize); dsol = 0.0; } return 0; } /// Here we increase the target once we get within 5% of it double VOL_problem::readjust_target(const double oldtarget, const double lcost) const { double target = oldtarget; if (lcost >= target - VolAbs(target) * 0.05) { if (VolAbs(lcost) < 10.0) { target = 10.0; } else { target += 0.025 * VolAbs(target); target = VolMax(target, lcost + 0.05 * VolAbs(lcost)); } if (target != oldtarget && (parm.printflag & 2)) { printf(" **** readjusting target!!! new target = %f *****\n", target); } } return target; } /** Here we decide the value of alpha_fb to be used in the convex combination. More details of this are in doc.ps IN: alpha, primal, pstar, dual OUT: pstar = alpha_fb * pstar + (1 - alpha_fb) * primal */ double VOL_problem::power_heur(const VOL_primal& primal, const VOL_primal& pstar, const VOL_dual& dual) const { const double alpha = alpha_; VOL_vh prod(alpha, dual_lb, dual_ub, primal.v, pstar.v, dual.u); double a_asc = (alpha * prod.norm - prod.vh) / (prod.norm - prod.vh); double alpha_fb; if (prod.norm + prod.hh - 2.0 * prod.vh > 0.0) alpha_fb = (prod.hh - prod.vh) / (prod.norm + prod.hh - 2.0 * prod.vh); else alpha_fb = alpha; if (alpha_fb > alpha) alpha_fb = alpha; if (alpha_fb < a_asc) alpha_fb = a_asc; if (alpha_fb > 1.0) alpha_fb = alpha; if (alpha_fb < 0.0) alpha_fb = alpha / 10.0; return alpha_fb; } Osi-0.106.4/test/OsiSpxSolverInterfaceTest.cpp0000644000076600007660000006650211612344643017673 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for SOPLEX // author: Tobias Pfender // Konrad-Zuse-Zentrum Berlin (Germany) // license: this file may be freely distributed under the terms of EPL // date: 01/17/2002 //----------------------------------------------------------------------------- // Copyright (C) 2002, Tobias Pfender, International Business Machines // Corporation and others. All Rights Reserved. // // Last edit: $Id: OsiSpxSolverInterfaceTest.cpp 1781 2011-07-22 19:04:03Z stefan $ #include "CoinPragma.hpp" #include "OsiConfig.h" // Added so windows build with dsp files works, // when not building with soplex. #ifdef COIN_HAS_SOPLEX #include "OsiSpxSolverInterface.hpp" #include "OsiUnitTests.hpp" #include "OsiRowCut.hpp" #include "OsiCuts.hpp" #include "CoinFloatEqual.hpp" #include "CoinPackedMatrix.hpp" //#include // to check for value of infinity #include "soplex.h" void OsiSpxSolverInterfaceUnitTest( const std::string & mpsDir, const std::string & netlibDir ) { // Test default constructor { OsiSpxSolverInterface m; OSIUNITTEST_ASSERT_ERROR(m.soplex_ != NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 0, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colsol_ == NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsol_ == NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByCol_ == NULL, {}, "SoPlex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getApplicationData() == NULL, {}, "SoPlex", "default constructor"); int i=2346; m.setApplicationData(&i); OSIUNITTEST_ASSERT_ERROR(*((int *)(m.getApplicationData())) == i, {}, "SoPlex", "set application data"); } { CoinRelFltEq eq; OsiSpxSolverInterface m; std::string fn = mpsDir+"exmip1"; m.readMps(fn.c_str(),"mps"); // int ad = 13579; // m.setApplicationData(&ad); // OSIUNITTEST_ASSERT_ERROR(*((int *)(m.getApplicationData())) == ad, {}, "SoPlex", "set application data"); { const CoinPackedMatrix * colCopy = m.getMatrixByCol(); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumCols() == 8, {}, "SoPlex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMajorDim() == 8, {}, "SoPlex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumRows() == 5, {}, "SoPlex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMinorDim() == 5, {}, "SoPlex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getVectorLengths()[7] == 2, {}, "SoPlex", "exmip1 matrix"); CoinPackedMatrix revColCopy; revColCopy.reverseOrderedCopyOf(*colCopy); CoinPackedMatrix rev2ColCopy; rev2ColCopy.reverseOrderedCopyOf(revColCopy); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumCols() == 8, {}, "SoPlex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMajorDim() == 8, {}, "SoPlex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumRows() == 5, {}, "SoPlex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMinorDim() == 5, {}, "SoPlex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getVectorLengths()[7] == 2, {}, "SoPlex", "twice reverse matrix copy"); } // Test copy constructor and assignment operator { OsiSpxSolverInterface lhs; { OsiSpxSolverInterface im(m); OsiSpxSolverInterface imC1(im); OsiSpxSolverInterface imC2(im); lhs = imC2; } // Test that lhs has correct values even though rhs has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.getNumCols() == m.getNumCols(), {}, "SoPlex", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumRows() == m.getNumRows(), {}, "SoPlex", "copy constructor"); } // Test clone { OsiSpxSolverInterface soplexSi(m); OsiSolverInterface * siPtr = &soplexSi; OsiSolverInterface * siClone = siPtr->clone(); OsiSpxSolverInterface * soplexClone = dynamic_cast(siClone); OSIUNITTEST_ASSERT_ERROR(soplexClone != NULL, {}, "SoPlex", "clone"); OSIUNITTEST_ASSERT_ERROR(soplexClone->getNumRows() == soplexSi.getNumRows(), {}, "SoPlex", "clone"); OSIUNITTEST_ASSERT_ERROR(soplexClone->getNumCols() == m.getNumCols(), {}, "SoPlex", "clone"); delete siClone; } // test infinity { OsiSpxSolverInterface si; OSIUNITTEST_ASSERT_ERROR(si.getInfinity() == soplex::infinity, {}, "SoPlex", "value for infinity"); } { OsiSpxSolverInterface soplexSi(m); int nc = soplexSi.getNumCols(); int nr = soplexSi.getNumRows(); const double * cl = soplexSi.getColLower(); const double * cu = soplexSi.getColUpper(); const double * rl = soplexSi.getRowLower(); const double * ru = soplexSi.getRowUpper(); OSIUNITTEST_ASSERT_ERROR(nc == 8, return, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(nr == 5, return, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[1],4.1), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[2],1.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[0],2.5), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[4],3.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[1],2.1), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[4],15.), {}, "SoPlex", "read and copy exmip1"); double newCs[8] = {1., 2., 3., 4., 5., 6., 7., 8.}; soplexSi.setColSolution(newCs); const double * cs = soplexSi.getColSolution(); OSIUNITTEST_ASSERT_ERROR(eq(cs[0],1.0), {}, "SoPlex", "set col solution"); OSIUNITTEST_ASSERT_ERROR(eq(cs[7],8.0), {}, "SoPlex", "set col solution"); { OsiSpxSolverInterface solnSi(soplexSi); const double * cs = solnSi.getColSolution(); OSIUNITTEST_ASSERT_ERROR(eq(cs[0],1.0), {}, "SoPlex", "set col solution and copy"); OSIUNITTEST_ASSERT_ERROR(eq(cs[7],8.0), {}, "SoPlex", "set col solution and copy"); } OSIUNITTEST_ASSERT_ERROR(!eq(cl[3],1.2345), {}, "SoPlex", "set col lower"); soplexSi.setColLower( 3, 1.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cl[3],1.2345), {}, "SoPlex", "set col lower"); OSIUNITTEST_ASSERT_ERROR(!eq(cu[4],10.2345), {}, "SoPlex", "set col upper"); soplexSi.setColUpper( 4, 10.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cu[4],10.2345), {}, "SoPlex", "set col upper"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[0], 1.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[1], 0.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[2], 0.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[3], 0.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[4], 2.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[5], 0.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[6], 0.0), {}, "SoPlex", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(soplexSi.getObjCoefficients()[7],-1.0), {}, "SoPlex", "read and copy exmip1"); } // Test getMatrixByRow method { const OsiSpxSolverInterface si(m); const CoinPackedMatrix * smP = si.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim() == 5, return, "SoPlex", "getMatrixByRow: major dim"); OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "SoPlex", "getMatrixByRow: num elements"); CoinRelFltEq eq; const double * ev = smP->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[0], 3.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[1], 1.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[2], -2.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[3], -1.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[4], -1.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[5], 2.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[6], 1.1), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[7], 1.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[8], 1.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[9], 2.8), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], -1.2), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "SoPlex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "SoPlex", "getMatrixByRow: elements"); const int * mi = smP->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "SoPlex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "SoPlex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "SoPlex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "SoPlex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "SoPlex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "SoPlex", "getMatrixByRow: vector starts"); const int * ei = smP->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "SoPlex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "SoPlex", "getMatrixByRow: indices"); } //-------------- // Test rowsense, rhs, rowrange, getMatrixByRow { OsiSpxSolverInterface lhs; { OsiSpxSolverInterface siC1(m); OSIUNITTEST_ASSERT_WARNING(siC1.rowrange_ == NULL, {}, "SoPlex", "row range"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsense_ == NULL, {}, "SoPlex", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1.rhs_ == NULL, {}, "SoPlex", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1.matrixByRow_ == NULL, {}, "SoPlex", "matrix by row"); OSIUNITTEST_ASSERT_WARNING(siC1.colsol_ == NULL, {}, "SoPlex", "col solution"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsol_ == NULL, {}, "SoPlex", "row solution"); const char * siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "SoPlex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "SoPlex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "SoPlex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "SoPlex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "SoPlex", "row sense"); const double * siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "SoPlex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "SoPlex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "SoPlex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "SoPlex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "SoPlex", "right hand side"); const double * siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "SoPlex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "SoPlex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "SoPlex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "SoPlex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "SoPlex", "row range"); const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "SoPlex", "matrix by row"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim() == 5, return, "SoPlex", "matrix by row: major dim"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "SoPlex", "matrix by row: num elements"); const double * ev = siC1mbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "SoPlex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "SoPlex", "matrix by row: elements"); const CoinBigIndex * mi = siC1mbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "SoPlex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "SoPlex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "SoPlex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "SoPlex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "SoPlex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "SoPlex", "matrix by row: vector starts"); const int * ei = siC1mbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "SoPlex", "matrix by row: indices"); OSIUNITTEST_ASSERT_WARNING(siC1rs == siC1.getRowSense(), {}, "SoPlex", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1rhs == siC1.getRightHandSide(), {}, "SoPlex", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1rr == siC1.getRowRange(), {}, "SoPlex", "row range"); // Change SOPLEX Model by adding free row OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb( COIN_DBL_MAX); OsiCuts cuts; cuts.insert(rc); siC1.applyCuts(cuts); // Since model was changed, test that cached data is now freed. OSIUNITTEST_ASSERT_ERROR(siC1.rowrange_ == NULL, {}, "SoPlex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsense_ == NULL, {}, "SoPlex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rhs_ == NULL, {}, "SoPlex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByRow_ == NULL, {}, "SoPlex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByCol_ == NULL, {}, "SoPlex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.colsol_ == NULL, {}, "SoPlex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsol_ == NULL, {}, "SoPlex", "free cached data after adding row"); siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "SoPlex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "SoPlex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "SoPlex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "SoPlex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "SoPlex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[5] == 'N', {}, "SoPlex", "row sense after adding row"); siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "SoPlex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "SoPlex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "SoPlex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "SoPlex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "SoPlex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[5],0.0), {}, "SoPlex", "right hand side after adding row"); siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "SoPlex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "SoPlex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "SoPlex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "SoPlex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "SoPlex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[5],0.0), {}, "SoPlex", "row range after adding row"); lhs = siC1; } // Test that lhs has correct values even though siC1 has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.rowrange_ == NULL, {}, "SoPlex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsense_ == NULL, {}, "SoPlex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rhs_ == NULL, {}, "SoPlex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByRow_ == NULL, {}, "SoPlex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByCol_ == NULL, {}, "SoPlex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.colsol_ == NULL, {}, "SoPlex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsol_ == NULL, {}, "SoPlex", "freed origin after assignment"); const char * lhsrs = lhs.getRowSense(); OSIUNITTEST_ASSERT_ERROR(lhsrs[0] == 'G', {}, "SoPlex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[1] == 'L', {}, "SoPlex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[2] == 'E', {}, "SoPlex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[3] == 'R', {}, "SoPlex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[4] == 'R', {}, "SoPlex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[5] == 'N', {}, "SoPlex", "row sense after assignment"); const double * lhsrhs = lhs.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[0],2.5), {}, "SoPlex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[1],2.1), {}, "SoPlex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[2],4.0), {}, "SoPlex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[3],5.0), {}, "SoPlex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[4],15.), {}, "SoPlex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[5],0.0), {}, "SoPlex", "right hand side after assignment"); const double *lhsrr = lhs.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[0],0.0), {}, "SoPlex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[1],0.0), {}, "SoPlex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[2],0.0), {}, "SoPlex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[3],5.0-1.8), {}, "SoPlex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[4],15.0-3.0), {}, "SoPlex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[5],0.0), {}, "SoPlex", "row range after assignment"); const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, {}, "SoPlex", "matrix by row after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim() == 6, return, "SoPlex", "matrix by row after assignment: major dim"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "SoPlex", "matrix by row after assignment: num elements"); const double * ev = lhsmbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "SoPlex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "SoPlex", "matrix by row after assignment: elements"); const CoinBigIndex * mi = lhsmbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "SoPlex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "SoPlex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "SoPlex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "SoPlex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "SoPlex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "SoPlex", "matrix by row after assignment: vector starts"); const int * ei = lhsmbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "SoPlex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "SoPlex", "matrix by row after assignment: indices"); } //-------------- } // Do common solverInterface testing by calling the // base class testing method. { OsiSpxSolverInterface m; OsiSolverInterfaceCommonUnitTest(&m, mpsDir,netlibDir); } } #endif Osi-0.106.4/test/OsiTestSolverInterfaceIO.cpp0000644000076600007660000003067011536304054017422 0ustar coincoin// Copyright (C) 2001, International Business Machines // Corporation and others. All Rights Reserved. // This file is licensed under the terms of Eclipse Public License (EPL). // this is a copy of OsiVolSolverInterface (trunk rev. 1466) renamed to OsiTestSolverInterface #include "CoinPragma.hpp" #include #include #include "CoinHelperFunctions.hpp" #include "CoinMpsIO.hpp" #include "OsiTestSolverInterface.hpp" //############################################################################# void OsiTestSolverInterface::initFromRlbRub(const int rownum, const double* rowlb, const double* rowub) { if (maxNumrows_ > 0) { rowRimAllocator_(); if (rowub) { CoinDisjointCopyN(rowub, rownum, rowupper_); } else { CoinFillN(rowupper_, rownum, getInfinity()); } if (rowlb) { CoinDisjointCopyN(rowlb, rownum, rowlower_); } else { CoinFillN(rowlower_, rownum, -getInfinity()); } // Set the initial dual solution CoinFillN(rowprice_, rownum, 0.0); convertBoundsToSenses_(); } } //############################################################################# void OsiTestSolverInterface::initFromRhsSenseRange(const int rownum, const char* rowsen, const double* rowrhs, const double* rowrng) { if (maxNumrows_ > 0) { rowRimAllocator_(); if (rowsen) { CoinDisjointCopyN(rowsen, rownum, rowsense_); } else { CoinFillN(rowsense_, rownum, 'G'); } if (rowrhs) { CoinDisjointCopyN(rowrhs, rownum, rhs_); } else { CoinFillN(rhs_, rownum, 0.0); } if (rowrng) { CoinDisjointCopyN(rowrng, rownum, rowrange_); } else { CoinFillN(rowrange_, rownum, 0.0); } // Set the initial dual solution CoinFillN(rowprice_, rownum, 0.0); convertSensesToBounds_(); } } //############################################################################# void OsiTestSolverInterface::initFromClbCubObj(const int colnum, const double* collb, const double* colub, const double* obj) { if (maxNumcols_ > 0) { colRimAllocator_(); if (colub) { CoinDisjointCopyN(colub, colnum, colupper_); } else { CoinFillN(colupper_, colnum, getInfinity()); } if (collb) { CoinDisjointCopyN(collb, colnum, collower_); } else { CoinFillN(collower_, colnum, 0.0); } CoinFillN(continuous_,colnum,true); if (obj) { CoinDisjointCopyN(obj, colnum, objcoeffs_); } else { CoinFillN(objcoeffs_, colnum, 0.0); } int c; for ( c=0; c((1+colMatrix_.getExtraGap()) * colMatrix_.getMinorDim()); } else { rowMatrix_.setExtraGap(matrix.getExtraGap()); rowMatrix_.setExtraMajor(matrix.getExtraMajor()); rowMatrix_ = matrix; rowMatrixCurrent_ = true; colMatrixCurrent_ = false; maxNumcols_ = static_cast((1+rowMatrix_.getExtraGap()) * rowMatrix_.getMinorDim()); maxNumrows_ = rowMatrix_.getMaxMajorDim(); } initFromRlbRub(rownum, rowlb, rowub); initFromClbCubObj(colnum, collb, colub, obj); } //----------------------------------------------------------------------- void OsiTestSolverInterface::assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub) { gutsOfDestructor_(); const int rownum = matrix->getNumRows(); const int colnum = matrix->getNumCols(); maxNumcols_ = colnum; maxNumrows_ = rownum; if (matrix->isColOrdered()) { colMatrix_.swap(*matrix); colMatrixCurrent_ = true; rowMatrixCurrent_ = false; } else { rowMatrix_.swap(*matrix); rowMatrixCurrent_ = true; colMatrixCurrent_ = false; } delete matrix; matrix = 0; rowupper_ = rowub; rowub = 0; rowlower_ = rowlb; rowlb = 0; colupper_ = colub; colub = 0; collower_ = collb; collb = 0; objcoeffs_ = obj; obj = 0; if (maxNumrows_ > 0) { if (!rowupper_) { rowupper_ = new double[maxNumrows_]; CoinFillN(rowupper_, rownum, getInfinity()); } if (!rowlower_) { rowlower_ = new double[maxNumrows_]; CoinFillN(rowlower_, rownum, -getInfinity()); } rowsense_ = new char[maxNumrows_]; rhs_ = new double[maxNumrows_]; rowrange_ = new double[maxNumrows_]; rowprice_ = new double[maxNumrows_]; lhs_ = new double[maxNumrows_]; // Set the initial dual solution CoinFillN(rowprice_, rownum, 0.0); convertBoundsToSenses_(); } if (maxNumcols_ > 0) { if (!colupper_) { colupper_ = new double[maxNumcols_]; CoinFillN(colupper_, colnum, getInfinity()); } if (!collower_) { collower_ = new double[maxNumcols_]; CoinFillN(collower_, colnum, -getInfinity()); } if (!objcoeffs_) { objcoeffs_ = new double[maxNumcols_]; CoinFillN(objcoeffs_, colnum, -getInfinity()); } colsol_ = new double[maxNumcols_]; int c; for ( c=0; c((1+colMatrix_.getExtraGap()) * colMatrix_.getMinorDim()); } else { rowMatrix_ = matrix; rowMatrixCurrent_ = true; colMatrixCurrent_ = false; maxNumcols_ = static_cast((1+rowMatrix_.getExtraGap()) * rowMatrix_.getMinorDim()); maxNumrows_ = rowMatrix_.getMaxMajorDim(); } initFromRhsSenseRange(rownum, rowsen, rowrhs, rowrng); initFromClbCubObj(colnum, collb, colub, obj); } //----------------------------------------------------------------------- void OsiTestSolverInterface::assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng) { gutsOfDestructor_(); const int rownum = matrix->getNumRows(); const int colnum = matrix->getNumCols(); maxNumcols_ = colnum; maxNumrows_ = rownum; if (matrix->isColOrdered()) { colMatrix_.swap(*matrix); colMatrixCurrent_ = true; rowMatrixCurrent_ = false; } else { rowMatrix_.swap(*matrix); rowMatrixCurrent_ = true; colMatrixCurrent_ = false; } delete matrix; matrix = 0; rowsense_ = rowsen; rowsen = 0; rhs_ = rowrhs; rowrhs = 0; rowrange_ = rowrng; rowrng = 0; colupper_ = colub; colub = 0; collower_ = collb; collb = 0; objcoeffs_ = obj; obj = 0; if (maxNumrows_ > 0) { if (!rowsense_) { rowsense_ = new char[maxNumrows_]; CoinFillN(rowsense_, rownum, 'G'); } if (!rhs_) { rhs_ = new double[maxNumrows_]; CoinFillN(rhs_, rownum, 0.0); } if (!rowrange_) { rowrange_ = new double[maxNumrows_]; CoinFillN(rowrange_, rownum, 0.0); } rowlower_ = new double[maxNumrows_]; rowupper_ = new double[maxNumrows_]; rowprice_ = new double[maxNumrows_]; lhs_ = new double[maxNumrows_]; // Set the initial dual solution CoinFillN(rowprice_, rownum, 0.0); convertSensesToBounds_(); } if (maxNumcols_ > 0) { if (!colupper_) { colupper_ = new double[maxNumcols_]; CoinFillN(colupper_, colnum, getInfinity()); } if (!collower_) { collower_ = new double[maxNumcols_]; CoinFillN(collower_, colnum, -getInfinity()); } if (!objcoeffs_) { objcoeffs_ = new double[maxNumcols_]; CoinFillN(objcoeffs_, colnum, -getInfinity()); } colsol_ = new double[maxNumcols_]; int c; for ( c=0; c((1+colMatrix_.getExtraGap()) * colMatrix_.getMinorDim()); initFromRlbRub(numrows, rowlb, rowub); initFromClbCubObj(numcols, collb, colub, obj); } //----------------------------------------------------------------------- void OsiTestSolverInterface::loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng) { gutsOfDestructor_(); colMatrix_.copyOf(true, numrows, numcols, start[numcols], value, index, start, 0); colMatrixCurrent_ = true; rowMatrixCurrent_ = false; maxNumcols_ = colMatrix_.getMaxMajorDim(); maxNumrows_ = static_cast((1+colMatrix_.getExtraGap()) * colMatrix_.getMinorDim()); initFromRhsSenseRange(numrows, rowsen, rowrhs, rowrng); initFromClbCubObj(numcols, collb, colub, obj); } //----------------------------------------------------------------------- int OsiTestSolverInterface::readMps(const char *filename, const char *extension) { CoinMpsIO reader; reader.setInfinity(getInfinity()); int retVal = reader.readMps(filename, extension); if (retVal == 0) { loadProblem(*reader.getMatrixByCol(), reader.getColLower(),reader.getColUpper(), reader.getObjCoefficients(), reader.getRowLower(),reader.getRowUpper()); int nc = getNumCols(); assert (continuous_); CoinFillN(continuous_, nc, true); } return retVal; } //----------------------------------------------------------------------- void OsiTestSolverInterface::writeMps(const char *filename, const char *extension, double /*objSense*/) const { CoinMpsIO writer; writer.setMpsData(*getMatrixByCol(), getInfinity(), getColLower(), getColUpper(), getObjCoefficients(), reinterpret_cast (NULL) /*integrality*/, getRowLower(), getRowUpper(), reinterpret_cast (NULL) /*colnam*/, reinterpret_cast (NULL) /*rownam*/); std::string fname = filename; if (extension) { if (extension[0] != '\0' && extension[0] != '.') fname += "." ; } fname += extension; writer.writeMps(fname.c_str()); } Osi-0.106.4/test/Makefile.am0000644000076600007660000000745211621722556014124 0ustar coincoin# Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: Makefile.am 1800 2011-08-14 10:37:34Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # unitTest for Coin # ######################################################################## noinst_PROGRAMS = unitTest unitTest_SOURCES = unitTest.cpp \ OsiTestSolver.cpp \ OsiTestSolverInterface.cpp \ OsiTestSolverInterfaceIO.cpp \ OsiTestSolverInterfaceTest.cpp # List libraries of COIN projects unitTest_LDADD = ../src/OsiCommonTest/libOsiCommonTests.la unitTest_DEPENDENCIES = ../src/OsiCommonTest/libOsiCommonTests.la # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows AM_CPPFLAGS = \ -I`$(CYGPATH_W) $(srcdir)/../src/Osi` \ -I`$(CYGPATH_W) $(srcdir)/../src/OsiCommonTest` \ $(COINUTILS_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi # Depending of what solvers are available, we add the corresponding files, # libraries and include dirs if COIN_HAS_CPX unitTest_SOURCES += OsiCpxSolverInterfaceTest.cpp AM_CPPFLAGS += -I`$(CYGPATH_W) $(CPXINCDIR)` \ -I`$(CYGPATH_W) $(srcdir)/../src/OsiCpx` unitTest_LDADD += ../src/OsiCpx/libOsiCpx.la unitTest_DEPENDENCIES += ../src/OsiCpx/libOsiCpx.la LIBS += $(CPXLIB) endif if COIN_HAS_GLPK unitTest_SOURCES += OsiGlpkSolverInterfaceTest.cpp AM_CPPFLAGS += $(GLPK_CFLAGS) \ -I`$(CYGPATH_W) $(srcdir)/../src/OsiGlpk` unitTest_LDADD += ../src/OsiGlpk/libOsiGlpk.la unitTest_DEPENDENCIES += ../src/OsiGlpk/libOsiGlpk.la LIBS += $(GLPK_LIBS) endif if COIN_HAS_MSK unitTest_SOURCES += OsiMskSolverInterfaceTest.cpp AM_CPPFLAGS += -I`$(CYGPATH_W) $(MSKINCDIR)` \ -I`$(CYGPATH_W) $(srcdir)/../src/OsiMsk` unitTest_LDADD += ../src/OsiMsk/libOsiMsk.la unitTest_DEPENDENCIES += ../src/OsiMsk/libOsiMsk.la LIBS += $(MSKLIB) endif if COIN_HAS_XPR unitTest_SOURCES += OsiXprSolverInterfaceTest.cpp AM_CPPFLAGS += -I`$(CYGPATH_W) $(XPRINCDIR)` \ -I`$(CYGPATH_W) $(srcdir)/../src/OsiXpr` unitTest_LDADD += ../src/OsiXpr/libOsiXpr.la unitTest_DEPENDENCIES += ../src/OsiXpr/libOsiXpr.la LIBS += $(XPRLIB) endif if COIN_HAS_GRB unitTest_SOURCES += OsiGrbSolverInterfaceTest.cpp AM_CPPFLAGS += -I`$(CYGPATH_W) $(GRBINCDIR)` \ -I`$(CYGPATH_W) $(srcdir)/../src/OsiGrb` unitTest_LDADD += ../src/OsiGrb/libOsiGrb.la unitTest_DEPENDENCIES += ../src/OsiGrb/libOsiGrb.la LIBS += $(GRBLIB) endif if COIN_HAS_SOPLEX unitTest_SOURCES += OsiSpxSolverInterfaceTest.cpp AM_CPPFLAGS += $(SOPLEX_CFLAGS) \ -I`$(CYGPATH_W) $(srcdir)/../src/OsiSpx` unitTest_LDADD += ../src/OsiSpx/libOsiSpx.la unitTest_DEPENDENCIES += ../src/OsiSpx/libOsiSpx.la LIBS += $(SOPLEX_LIBS) endif unitTest_LDADD += ../src/Osi/libOsi.la $(OSILIB_LIBS) unitTest_DEPENDENCIES += ../src/Osi/libOsi.la $(OSILIB_DEPENDENCIES) unittestflags = if COIN_HAS_SAMPLE unittestflags += -mpsDir=`$(CYGPATH_W) $(SAMPLE_DATA)` endif if COIN_HAS_NETLIB unittestflags += -netlibDir=`$(CYGPATH_W) $(NETLIB_DATA)` -testOsiSolverInterface endif test: unitTest$(EXEEXT) ./unitTest$(EXEEXT) $(unittestflags) .PHONY: test ######################################################################## # Cleaning stuff # ######################################################################## # Here we list everything that is not generated by the compiler, e.g., # output files of a program DISTCLEANFILES = *.mps *.mps.gz *.lp test2out *.out.gz *.out Osi-0.106.4/test/OsiCpxSolverInterfaceTest.cpp0000644000076600007660000006520311612344643017650 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for CPLEX // author: Tobias Pfender // Konrad-Zuse-Zentrum Berlin (Germany) // date: 09/25/2000 // license: this file may be freely distributed under the terms of EPL // comments: please scan this file for '???' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2000, Tobias Pfender, International Business Machines // Corporation and others. All Rights Reserved. #include "CoinPragma.hpp" #include "OsiConfig.h" //#include //#include #include "OsiUnitTests.hpp" #include "OsiCpxSolverInterface.hpp" #include "OsiCuts.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" // Added so build windows build with dsp files works, // when not building with cplex. #ifdef COIN_HAS_CPX #include "cplex.h" void OsiCpxSolverInterfaceUnitTest( const std::string & mpsDir, const std::string & netlibDir ) { // Test default constructor { OsiCpxSolverInterface m; OSIUNITTEST_ASSERT_ERROR(m.obj_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.collower_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colupper_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.coltype_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.coltypesize_ == 0, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowlower_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowupper_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colsol_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsol_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByCol_ == NULL, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 0, {}, "cplex", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getApplicationData() == NULL, {}, "cplex", "default constructor"); int i=2346; m.setApplicationData(&i); OSIUNITTEST_ASSERT_ERROR(*((int *)(m.getApplicationData())) == i, {}, "cplex", "default constructor"); } { CoinRelFltEq eq; OsiCpxSolverInterface m; std::string fn = mpsDir+"exmip1"; m.readMps(fn.c_str(),"mps"); { OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 8, {}, "cplex", "exmip1 read"); const CoinPackedMatrix * colCopy = m.getMatrixByCol(); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumCols() == 8, {}, "cplex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMajorDim() == 8, {}, "cplex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumRows() == 5, {}, "cplex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMinorDim() == 5, {}, "cplex", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getVectorLengths()[7] == 2, {}, "cplex", "exmip1 matrix"); CoinPackedMatrix revColCopy; revColCopy.reverseOrderedCopyOf(*colCopy); CoinPackedMatrix rev2ColCopy; rev2ColCopy.reverseOrderedCopyOf(revColCopy); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumCols() == 8, {}, "cplex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMajorDim() == 8, {}, "cplex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumRows() == 5, {}, "cplex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMinorDim() == 5, {}, "cplex", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getVectorLengths()[7] == 2, {}, "cplex", "twice reverse matrix copy"); } // Test copy constructor and assignment operator { OsiCpxSolverInterface lhs; { OsiCpxSolverInterface im(m); OsiCpxSolverInterface imC1(im); OSIUNITTEST_ASSERT_ERROR(imC1.lp_ != im.lp_, {}, "cplex", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumCols() == im.getNumCols(), {}, "cplex", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumRows() == im.getNumRows(), {}, "cplex", "copy constructor"); OsiCpxSolverInterface imC2(im); OSIUNITTEST_ASSERT_ERROR(imC2.lp_ != im.lp_, {}, "cplex", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumCols() == im.getNumCols(), {}, "cplex", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumRows() == im.getNumRows(), {}, "cplex", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.lp_ != imC2.lp_, {}, "cplex", "copy constructor"); lhs = imC2; } // Test that lhs has correct values even though rhs has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.lp_ != m.lp_, {}, "cplex", "assignment operator"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumCols() == m.getNumCols(), {}, "cplex", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumRows() == m.getNumRows(), {}, "cplex", "copy constructor"); } // Test clone { OsiCpxSolverInterface cplexSi(m); OsiSolverInterface * siPtr = &cplexSi; OsiSolverInterface * siClone = siPtr->clone(); OsiCpxSolverInterface * cplexClone = dynamic_cast(siClone); OSIUNITTEST_ASSERT_ERROR(cplexClone != NULL, {}, "cplex", "clone"); OSIUNITTEST_ASSERT_ERROR(cplexClone->lp_ != cplexSi.lp_, {}, "cplex", "clone"); OSIUNITTEST_ASSERT_ERROR(cplexClone->getNumRows() == cplexSi.getNumRows(), {}, "cplex", "clone"); OSIUNITTEST_ASSERT_ERROR(cplexClone->getNumCols() == m.getNumCols(), {}, "cplex", "clone"); delete siClone; } // test infinity { OsiCpxSolverInterface si; OSIUNITTEST_ASSERT_ERROR(si.getInfinity() == CPX_INFBOUND, {}, "cplex", "value for infinity"); } // Test getMatrixByRow method { const OsiCpxSolverInterface si(m); const CoinPackedMatrix * smP = si.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim() == 5, return, "cplex", "getMatrixByRow: major dim"); OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "cplex", "getMatrixByRow: num elements"); CoinRelFltEq eq; const double * ev = smP->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[0], 3.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[1], 1.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[2], -2.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[3], -1.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[4], -1.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[5], 2.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[6], 1.1), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[7], 1.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[8], 1.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[9], 2.8), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], -1.2), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "cplex", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "cplex", "getMatrixByRow: elements"); const int * mi = smP->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "cplex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "cplex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "cplex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "cplex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "cplex", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "cplex", "getMatrixByRow: vector starts"); const int * ei = smP->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "cplex", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "cplex", "getMatrixByRow: indices"); } //-------------- // Test rowsense, rhs, rowrange, getMatrixByRow { OsiCpxSolverInterface lhs; { OsiCpxSolverInterface siC1(m); OSIUNITTEST_ASSERT_WARNING(siC1.obj_ == NULL, {}, "cplex", "objective"); OSIUNITTEST_ASSERT_WARNING(siC1.collower_ == NULL, {}, "cplex", "col lower"); OSIUNITTEST_ASSERT_WARNING(siC1.colupper_ == NULL, {}, "cplex", "col upper"); OSIUNITTEST_ASSERT_WARNING(siC1.rowrange_ == NULL, {}, "cplex", "row range"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsense_ == NULL, {}, "cplex", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1.rowlower_ == NULL, {}, "cplex", "row lower"); OSIUNITTEST_ASSERT_WARNING(siC1.rowupper_ == NULL, {}, "cplex", "row upper"); OSIUNITTEST_ASSERT_WARNING(siC1.rhs_ == NULL, {}, "cplex", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1.matrixByRow_ == NULL, {}, "cplex", "matrix by row"); OSIUNITTEST_ASSERT_WARNING(siC1.colsol_ != NULL, {}, "cplex", "col solution"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsol_ != NULL, {}, "cplex", "row solution"); const char * siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "cplex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "cplex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "cplex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "cplex", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "cplex", "row sense"); const double * siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "cplex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "cplex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "cplex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "cplex", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "cplex", "right hand side"); const double * siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "cplex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "cplex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "cplex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "cplex", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "cplex", "row range"); const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "cplex", "matrix by row"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim() == 5, return, "cplex", "matrix by row: major dim"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "cplex", "matrix by row: num elements"); const double * ev = siC1mbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "cplex", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "cplex", "matrix by row: elements"); const CoinBigIndex * mi = siC1mbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "cplex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "cplex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "cplex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "cplex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "cplex", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "cplex", "matrix by row: vector starts"); const int * ei = siC1mbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "cplex", "matrix by row: indices"); OSIUNITTEST_ASSERT_WARNING(siC1rs == siC1.getRowSense(), {}, "cplex", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1rhs == siC1.getRightHandSide(), {}, "cplex", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1rr == siC1.getRowRange(), {}, "cplex", "row range"); // Change CPLEX Model by adding free row OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb( COIN_DBL_MAX); OsiCuts cuts; cuts.insert(rc); siC1.applyCuts(cuts); // Since model was changed, test that cached data is now freed. OSIUNITTEST_ASSERT_ERROR(siC1.obj_ == NULL, {}, "cplex", "objective"); OSIUNITTEST_ASSERT_ERROR(siC1.collower_ == NULL, {}, "cplex", "col lower"); OSIUNITTEST_ASSERT_ERROR(siC1.colupper_ == NULL, {}, "cplex", "col upper"); OSIUNITTEST_ASSERT_ERROR(siC1.rowrange_ == NULL, {}, "cplex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsense_ == NULL, {}, "cplex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowlower_ == NULL, {}, "cplex", "row lower"); OSIUNITTEST_ASSERT_ERROR(siC1.rowupper_ == NULL, {}, "cplex", "row upper"); OSIUNITTEST_ASSERT_ERROR(siC1.rhs_ == NULL, {}, "cplex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByRow_ == NULL, {}, "cplex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByCol_ == NULL, {}, "cplex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.colsol_ == NULL, {}, "cplex", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsol_ == NULL, {}, "cplex", "free cached data after adding row"); siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "cplex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "cplex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "cplex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "cplex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "cplex", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[5] == 'N', {}, "cplex", "row sense after adding row"); siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "cplex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "cplex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "cplex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "cplex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "cplex", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[5],0.0), {}, "cplex", "right hand side after adding row"); siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "cplex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "cplex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "cplex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "cplex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "cplex", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[5],0.0), {}, "cplex", "row range after adding row"); lhs = siC1; } // Test that lhs has correct values even though siC1 has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.obj_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.collower_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.colupper_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowrange_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsense_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowlower_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowupper_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rhs_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByRow_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByCol_ == NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.colsol_ != NULL, {}, "cplex", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsol_ != NULL, {}, "cplex", "freed origin after assignment"); const char * lhsrs = lhs.getRowSense(); OSIUNITTEST_ASSERT_ERROR(lhsrs[0] == 'G', {}, "cplex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[1] == 'L', {}, "cplex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[2] == 'E', {}, "cplex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[3] == 'R', {}, "cplex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[4] == 'R', {}, "cplex", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[5] == 'N', {}, "cplex", "row sense after assignment"); const double * lhsrhs = lhs.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[0],2.5), {}, "cplex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[1],2.1), {}, "cplex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[2],4.0), {}, "cplex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[3],5.0), {}, "cplex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[4],15.), {}, "cplex", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[5],0.0), {}, "cplex", "right hand side after assignment"); const double *lhsrr = lhs.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[0],0.0), {}, "cplex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[1],0.0), {}, "cplex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[2],0.0), {}, "cplex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[3],5.0-1.8), {}, "cplex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[4],15.0-3.0), {}, "cplex", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[5],0.0), {}, "cplex", "row range after assignment"); const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, {}, "cplex", "matrix by row after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim() == 6, return, "cplex", "matrix by row after assignment: major dim"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "cplex", "matrix by row after assignment: num elements"); const double * ev = lhsmbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "cplex", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "cplex", "matrix by row after assignment: elements"); const CoinBigIndex * mi = lhsmbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "cplex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "cplex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "cplex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "cplex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "cplex", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "cplex", "matrix by row after assignment: vector starts"); const int * ei = lhsmbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "cplex", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "cplex", "matrix by row after assignment: indices"); } } // Do common solverInterface testing by calling the // base class testing method. { OsiCpxSolverInterface m; OsiSolverInterfaceCommonUnitTest(&m, mpsDir, netlibDir); } } #endif Osi-0.106.4/test/OsiMskSolverInterfaceTest.cpp0000644000076600007660000007302311612351731017643 0ustar coincoin/* Unit test for OsiMsk. This file is licensed under the terms of Eclipse Public License (EPL). */ #include "CoinPragma.hpp" #include "OsiConfig.h" //#include //#include #include "OsiUnitTests.hpp" #include "OsiMskSolverInterface.hpp" #include "OsiCuts.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" // Added so build windows build with dsp files works, // when not building with gurobi. #ifdef COIN_HAS_MSK #include "mosek.h" //-------------------------------------------------------------------------- void OsiMskSolverInterfaceUnitTest( const std::string & mpsDir, const std::string & netlibDir ) { unsigned int numInstancesStart = OsiMskSolverInterface::getNumInstances(); // Test default constructor { OsiMskSolverInterface m; OSIUNITTEST_ASSERT_ERROR(m.obj_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.collower_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colupper_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.coltype_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.coltypesize_ == 0, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowlower_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowupper_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colsol_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsol_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByCol_ == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 0, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getApplicationData() == NULL, {}, "mosek", "default constructor"); OSIUNITTEST_ASSERT_ERROR(OsiMskSolverInterface::getNumInstances() == numInstancesStart+1, {}, "mosek", "number of instances during first test"); int i=2346; m.setApplicationData(&i); OSIUNITTEST_ASSERT_ERROR(*((int *)(m.getApplicationData())) == i, {}, "mosek", "default constructor"); } OSIUNITTEST_ASSERT_ERROR(OsiMskSolverInterface::getNumInstances() == numInstancesStart, {}, "mosek", "number of instances after first test"); { CoinRelFltEq eq; OsiMskSolverInterface m; OSIUNITTEST_ASSERT_ERROR(OsiMskSolverInterface::getNumInstances() == numInstancesStart+1, {}, "mosek", "number of instances"); std::string fn = mpsDir+"exmip1"; m.readMps(fn.c_str(),"mps"); { OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 8, {}, "mosek", "exmip1 read"); const CoinPackedMatrix * colCopy = m.getMatrixByCol(); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumCols() == 8, {}, "mosek", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMajorDim() == 8, {}, "mosek", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumRows() == 5, {}, "mosek", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMinorDim() == 5, {}, "mosek", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getVectorLengths()[7] == 2, {}, "mosek", "exmip1 matrix"); CoinPackedMatrix revColCopy; revColCopy.reverseOrderedCopyOf(*colCopy); CoinPackedMatrix rev2ColCopy; rev2ColCopy.reverseOrderedCopyOf(revColCopy); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumCols() == 8, {}, "mosek", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMajorDim() == 8, {}, "mosek", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumRows() == 5, {}, "mosek", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMinorDim() == 5, {}, "mosek", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getVectorLengths()[7] == 2, {}, "mosek", "twice reverse matrix copy"); } // Test copy constructor and assignment operator { OsiMskSolverInterface lhs; { OsiMskSolverInterface im(m); OsiMskSolverInterface imC1(im); OSIUNITTEST_ASSERT_ERROR(imC1.getNumCols() == im.getNumCols(), {}, "mosek", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumRows() == im.getNumRows(), {}, "mosek", "copy constructor"); OsiMskSolverInterface imC2(im); OSIUNITTEST_ASSERT_ERROR(imC2.getNumCols() == im.getNumCols(), {}, "mosek", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumRows() == im.getNumRows(), {}, "mosek", "copy constructor"); lhs = imC2; } // Test that lhs has correct values even though rhs has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.getNumCols() == m.getNumCols(), {}, "mosek", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumRows() == m.getNumRows(), {}, "mosek", "copy constructor"); } // Test clone { OsiMskSolverInterface mosekSi(m); OsiSolverInterface * siPtr = &mosekSi; OsiSolverInterface * siClone = siPtr->clone(); OsiMskSolverInterface * mosekClone = dynamic_cast(siClone); OSIUNITTEST_ASSERT_ERROR(mosekClone != NULL, {}, "mosek", "clone"); OSIUNITTEST_ASSERT_ERROR(mosekClone->getNumRows() == mosekSi.getNumRows(), {}, "mosek", "clone"); OSIUNITTEST_ASSERT_ERROR(mosekClone->getNumCols() == m.getNumCols(), {}, "mosek", "clone"); delete siClone; } // test infinity { OsiMskSolverInterface si; OSIUNITTEST_ASSERT_ERROR(si.getInfinity() == MSK_INFINITY, {}, "mosek", "value for infinity"); } { OsiMskSolverInterface mosekSi(m); int nc = mosekSi.getNumCols(); int nr = mosekSi.getNumRows(); const double * cl = mosekSi.getColLower(); const double * cu = mosekSi.getColUpper(); const double * rl = mosekSi.getRowLower(); const double * ru = mosekSi.getRowUpper(); OSIUNITTEST_ASSERT_ERROR(nc == 8, return, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(nr == 5, return, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[1],4.1), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[2],1.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[0],2.5), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[4],3.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[1],2.1), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[4],15.), {}, "mosek", "read and copy exmip1"); double newCs[8] = {1., 2., 3., 4., 5., 6., 7., 8.}; mosekSi.setColSolution(newCs); const double * cs = mosekSi.getColSolution(); OSIUNITTEST_ASSERT_ERROR(eq(cs[0],1.0), {}, "mosek", "set col solution"); OSIUNITTEST_ASSERT_ERROR(eq(cs[7],8.0), {}, "mosek", "set col solution"); { OsiMskSolverInterface solnSi(mosekSi); const double * cs = solnSi.getColSolution(); OSIUNITTEST_ASSERT_ERROR(eq(cs[0],1.0), {}, "mosek", "set col solution and copy"); OSIUNITTEST_ASSERT_ERROR(eq(cs[7],8.0), {}, "mosek", "set col solution and copy"); } OSIUNITTEST_ASSERT_ERROR(!eq(cl[3],1.2345), {}, "mosek", "set col lower"); mosekSi.setColLower( 3, 1.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cl[3],1.2345), {}, "mosek", "set col lower"); OSIUNITTEST_ASSERT_ERROR(!eq(cu[4],10.2345), {}, "mosek", "set col upper"); mosekSi.setColUpper( 4, 10.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cu[4],10.2345), {}, "mosek", "set col upper"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[0], 1.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[1], 0.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[2], 0.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[3], 0.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[4], 2.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[5], 0.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[6], 0.0), {}, "mosek", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(mosekSi.getObjCoefficients()[7],-1.0), {}, "mosek", "read and copy exmip1"); } // Test getMatrixByRow method { const OsiMskSolverInterface si(m); const CoinPackedMatrix * smP = si.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim() == 5, return, "mosek", "getMatrixByRow: major dim"); OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "mosek", "getMatrixByRow: num elements"); CoinRelFltEq eq; const double * ev = smP->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[0], 3.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[1], 1.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[2], -2.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[3], -1.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[4], -1.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[5], 2.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[6], 1.1), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[7], 1.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[8], 1.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[9], 2.8), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], -1.2), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "mosek", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "mosek", "getMatrixByRow: elements"); const int * mi = smP->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "mosek", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "mosek", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "mosek", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "mosek", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "mosek", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "mosek", "getMatrixByRow: vector starts"); const int * ei = smP->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "mosek", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "mosek", "getMatrixByRow: indices"); } //-------------- // Test rowsense, rhs, rowrange, getMatrixByRow { OsiMskSolverInterface lhs; { OsiMskSolverInterface siC1(m); OSIUNITTEST_ASSERT_WARNING(siC1.obj_ == NULL, {}, "mosek", "objective"); OSIUNITTEST_ASSERT_WARNING(siC1.collower_ == NULL, {}, "mosek", "col lower"); OSIUNITTEST_ASSERT_WARNING(siC1.colupper_ == NULL, {}, "mosek", "col upper"); OSIUNITTEST_ASSERT_WARNING(siC1.rowrange_ == NULL, {}, "mosek", "row range"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsense_ == NULL, {}, "mosek", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1.rowlower_ == NULL, {}, "mosek", "row lower"); OSIUNITTEST_ASSERT_WARNING(siC1.rowupper_ == NULL, {}, "mosek", "row upper"); OSIUNITTEST_ASSERT_WARNING(siC1.rhs_ == NULL, {}, "mosek", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1.matrixByRow_ == NULL, {}, "mosek", "matrix by row"); OSIUNITTEST_ASSERT_WARNING(siC1.colsol_ == NULL, {}, "mosek", "col solution"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsol_ == NULL, {}, "mosek", "row solution"); const char * siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "mosek", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "mosek", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "mosek", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "mosek", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "mosek", "row sense"); const double * siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "mosek", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "mosek", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "mosek", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "mosek", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "mosek", "right hand side"); const double * siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "mosek", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "mosek", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "mosek", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "mosek", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "mosek", "row range"); const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "mosek", "matrix by row"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim() == 5, return, "mosek", "matrix by row: major dim"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "mosek", "matrix by row: num elements"); const double * ev = siC1mbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "mosek", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "mosek", "matrix by row: elements"); const CoinBigIndex * mi = siC1mbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "mosek", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "mosek", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "mosek", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "mosek", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "mosek", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "mosek", "matrix by row: vector starts"); const int * ei = siC1mbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "mosek", "matrix by row: indices"); OSIUNITTEST_ASSERT_WARNING(siC1rs == siC1.getRowSense(), {}, "mosek", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1rhs == siC1.getRightHandSide(), {}, "mosek", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1rr == siC1.getRowRange(), {}, "mosek", "row range"); // Change MOSEK Model by adding free row OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb( COIN_DBL_MAX); OsiCuts cuts; cuts.insert(rc); siC1.applyCuts(cuts); // Since model was changed, test that cached data is now freed. OSIUNITTEST_ASSERT_ERROR(siC1.obj_ == NULL, {}, "mosek", "objective"); OSIUNITTEST_ASSERT_ERROR(siC1.collower_ == NULL, {}, "mosek", "col lower"); OSIUNITTEST_ASSERT_ERROR(siC1.colupper_ == NULL, {}, "mosek", "col upper"); OSIUNITTEST_ASSERT_ERROR(siC1.rowrange_ == NULL, {}, "mosek", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsense_ == NULL, {}, "mosek", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowlower_ == NULL, {}, "mosek", "row lower"); OSIUNITTEST_ASSERT_ERROR(siC1.rowupper_ == NULL, {}, "mosek", "row upper"); OSIUNITTEST_ASSERT_ERROR(siC1.rhs_ == NULL, {}, "mosek", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByRow_ == NULL, {}, "mosek", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByCol_ == NULL, {}, "mosek", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.colsol_ == NULL, {}, "mosek", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsol_ == NULL, {}, "mosek", "free cached data after adding row"); siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "mosek", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "mosek", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "mosek", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "mosek", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "mosek", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[5] == 'N', {}, "mosek", "row sense after adding row"); siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "mosek", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "mosek", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "mosek", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "mosek", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "mosek", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[5],0.0), {}, "mosek", "right hand side after adding row"); siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "mosek", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "mosek", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "mosek", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "mosek", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "mosek", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[5],0.0), {}, "mosek", "row range after adding row"); lhs = siC1; } // Test that lhs has correct values even though siC1 has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.obj_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.collower_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.colupper_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowrange_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsense_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowlower_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowupper_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rhs_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByRow_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByCol_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.colsol_ == NULL, {}, "mosek", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsol_ == NULL, {}, "mosek", "freed origin after assignment"); const char * lhsrs = lhs.getRowSense(); OSIUNITTEST_ASSERT_ERROR(lhsrs[0] == 'G', {}, "mosek", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[1] == 'L', {}, "mosek", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[2] == 'E', {}, "mosek", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[3] == 'R', {}, "mosek", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[4] == 'R', {}, "mosek", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[5] == 'N', {}, "mosek", "row sense after assignment"); const double * lhsrhs = lhs.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[0],2.5), {}, "mosek", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[1],2.1), {}, "mosek", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[2],4.0), {}, "mosek", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[3],5.0), {}, "mosek", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[4],15.), {}, "mosek", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[5],0.0), {}, "mosek", "right hand side after assignment"); const double *lhsrr = lhs.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[0],0.0), {}, "mosek", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[1],0.0), {}, "mosek", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[2],0.0), {}, "mosek", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[3],5.0-1.8), {}, "mosek", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[4],15.0-3.0), {}, "mosek", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[5],0.0), {}, "mosek", "row range after assignment"); const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, {}, "mosek", "matrix by row after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim() == 6, return, "mosek", "matrix by row after assignment: major dim"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "mosek", "matrix by row after assignment: num elements"); const double * ev = lhsmbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "mosek", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "mosek", "matrix by row after assignment: elements"); const CoinBigIndex * mi = lhsmbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "mosek", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "mosek", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "mosek", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "mosek", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "mosek", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "mosek", "matrix by row after assignment: vector starts"); const int * ei = lhsmbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "mosek", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "mosek", "matrix by row after assignment: indices"); } OSIUNITTEST_ASSERT_ERROR(OsiMskSolverInterface::getNumInstances() == numInstancesStart+1, {}, "mosek", "number of instances"); } OSIUNITTEST_ASSERT_ERROR(OsiMskSolverInterface::getNumInstances() == numInstancesStart, {}, "mosek", "number of instances at finish"); // Do common solverInterface testing by calling the // base class testing method. { OsiMskSolverInterface m; OsiSolverInterfaceCommonUnitTest(&m, mpsDir, netlibDir); } } #endif Osi-0.106.4/test/Makefile.in0000644000076600007660000006147212240315110014115 0ustar coincoin# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 International Business Machines and others. # All Rights Reserved. # This file is distributed under the Eclipse Public License. # Author: Andreas Waechter IBM 2006-04-13 srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = unitTest$(EXEEXT) # Depending of what solvers are available, we add the corresponding files, # libraries and include dirs @COIN_HAS_CPX_TRUE@am__append_1 = OsiCpxSolverInterfaceTest.cpp @COIN_HAS_CPX_TRUE@am__append_2 = -I`$(CYGPATH_W) $(CPXINCDIR)` \ @COIN_HAS_CPX_TRUE@ -I`$(CYGPATH_W) $(srcdir)/../src/OsiCpx` @COIN_HAS_CPX_TRUE@am__append_3 = ../src/OsiCpx/libOsiCpx.la @COIN_HAS_CPX_TRUE@am__append_4 = ../src/OsiCpx/libOsiCpx.la @COIN_HAS_CPX_TRUE@am__append_5 = $(CPXLIB) @COIN_HAS_GLPK_TRUE@am__append_6 = OsiGlpkSolverInterfaceTest.cpp @COIN_HAS_GLPK_TRUE@am__append_7 = $(GLPK_CFLAGS) \ @COIN_HAS_GLPK_TRUE@ -I`$(CYGPATH_W) $(srcdir)/../src/OsiGlpk` @COIN_HAS_GLPK_TRUE@am__append_8 = ../src/OsiGlpk/libOsiGlpk.la @COIN_HAS_GLPK_TRUE@am__append_9 = ../src/OsiGlpk/libOsiGlpk.la @COIN_HAS_GLPK_TRUE@am__append_10 = $(GLPK_LIBS) @COIN_HAS_MSK_TRUE@am__append_11 = OsiMskSolverInterfaceTest.cpp @COIN_HAS_MSK_TRUE@am__append_12 = -I`$(CYGPATH_W) $(MSKINCDIR)` \ @COIN_HAS_MSK_TRUE@ -I`$(CYGPATH_W) $(srcdir)/../src/OsiMsk` @COIN_HAS_MSK_TRUE@am__append_13 = ../src/OsiMsk/libOsiMsk.la @COIN_HAS_MSK_TRUE@am__append_14 = ../src/OsiMsk/libOsiMsk.la @COIN_HAS_MSK_TRUE@am__append_15 = $(MSKLIB) @COIN_HAS_XPR_TRUE@am__append_16 = OsiXprSolverInterfaceTest.cpp @COIN_HAS_XPR_TRUE@am__append_17 = -I`$(CYGPATH_W) $(XPRINCDIR)` \ @COIN_HAS_XPR_TRUE@ -I`$(CYGPATH_W) $(srcdir)/../src/OsiXpr` @COIN_HAS_XPR_TRUE@am__append_18 = ../src/OsiXpr/libOsiXpr.la @COIN_HAS_XPR_TRUE@am__append_19 = ../src/OsiXpr/libOsiXpr.la @COIN_HAS_XPR_TRUE@am__append_20 = $(XPRLIB) @COIN_HAS_GRB_TRUE@am__append_21 = OsiGrbSolverInterfaceTest.cpp @COIN_HAS_GRB_TRUE@am__append_22 = -I`$(CYGPATH_W) $(GRBINCDIR)` \ @COIN_HAS_GRB_TRUE@ -I`$(CYGPATH_W) $(srcdir)/../src/OsiGrb` @COIN_HAS_GRB_TRUE@am__append_23 = ../src/OsiGrb/libOsiGrb.la @COIN_HAS_GRB_TRUE@am__append_24 = ../src/OsiGrb/libOsiGrb.la @COIN_HAS_GRB_TRUE@am__append_25 = $(GRBLIB) @COIN_HAS_SOPLEX_TRUE@am__append_26 = OsiSpxSolverInterfaceTest.cpp @COIN_HAS_SOPLEX_TRUE@am__append_27 = $(SOPLEX_CFLAGS) \ @COIN_HAS_SOPLEX_TRUE@ -I`$(CYGPATH_W) $(srcdir)/../src/OsiSpx` @COIN_HAS_SOPLEX_TRUE@am__append_28 = ../src/OsiSpx/libOsiSpx.la @COIN_HAS_SOPLEX_TRUE@am__append_29 = ../src/OsiSpx/libOsiSpx.la @COIN_HAS_SOPLEX_TRUE@am__append_30 = $(SOPLEX_LIBS) @COIN_HAS_SAMPLE_TRUE@am__append_31 = -mpsDir=`$(CYGPATH_W) $(SAMPLE_DATA)` @COIN_HAS_NETLIB_TRUE@am__append_32 = -netlibDir=`$(CYGPATH_W) $(NETLIB_DATA)` -testOsiSolverInterface subdir = test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/Osi/config.h \ $(top_builddir)/src/Osi/config_osi.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am__unitTest_SOURCES_DIST = unitTest.cpp OsiTestSolver.cpp \ OsiTestSolverInterface.cpp OsiTestSolverInterfaceIO.cpp \ OsiTestSolverInterfaceTest.cpp OsiCpxSolverInterfaceTest.cpp \ OsiGlpkSolverInterfaceTest.cpp OsiMskSolverInterfaceTest.cpp \ OsiXprSolverInterfaceTest.cpp OsiGrbSolverInterfaceTest.cpp \ OsiSpxSolverInterfaceTest.cpp @COIN_HAS_CPX_TRUE@am__objects_1 = \ @COIN_HAS_CPX_TRUE@ OsiCpxSolverInterfaceTest.$(OBJEXT) @COIN_HAS_GLPK_TRUE@am__objects_2 = \ @COIN_HAS_GLPK_TRUE@ OsiGlpkSolverInterfaceTest.$(OBJEXT) @COIN_HAS_MSK_TRUE@am__objects_3 = \ @COIN_HAS_MSK_TRUE@ OsiMskSolverInterfaceTest.$(OBJEXT) @COIN_HAS_XPR_TRUE@am__objects_4 = \ @COIN_HAS_XPR_TRUE@ OsiXprSolverInterfaceTest.$(OBJEXT) @COIN_HAS_GRB_TRUE@am__objects_5 = \ @COIN_HAS_GRB_TRUE@ OsiGrbSolverInterfaceTest.$(OBJEXT) @COIN_HAS_SOPLEX_TRUE@am__objects_6 = \ @COIN_HAS_SOPLEX_TRUE@ OsiSpxSolverInterfaceTest.$(OBJEXT) am_unitTest_OBJECTS = unitTest.$(OBJEXT) OsiTestSolver.$(OBJEXT) \ OsiTestSolverInterface.$(OBJEXT) \ OsiTestSolverInterfaceIO.$(OBJEXT) \ OsiTestSolverInterfaceTest.$(OBJEXT) $(am__objects_1) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) unitTest_OBJECTS = $(am_unitTest_OBJECTS) @COIN_HAS_CPX_TRUE@am__DEPENDENCIES_1 = ../src/OsiCpx/libOsiCpx.la @COIN_HAS_GLPK_TRUE@am__DEPENDENCIES_2 = ../src/OsiGlpk/libOsiGlpk.la @COIN_HAS_MSK_TRUE@am__DEPENDENCIES_3 = ../src/OsiMsk/libOsiMsk.la @COIN_HAS_XPR_TRUE@am__DEPENDENCIES_4 = ../src/OsiXpr/libOsiXpr.la @COIN_HAS_GRB_TRUE@am__DEPENDENCIES_5 = ../src/OsiGrb/libOsiGrb.la @COIN_HAS_SOPLEX_TRUE@am__DEPENDENCIES_6 = ../src/OsiSpx/libOsiSpx.la am__DEPENDENCIES_7 = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(unitTest_SOURCES) DIST_SOURCES = $(am__unitTest_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSBUILDDIR = @ABSBUILDDIR@ ACLOCAL = @ACLOCAL@ ADD_CFLAGS = @ADD_CFLAGS@ ADD_CXXFLAGS = @ADD_CXXFLAGS@ ALWAYS_FALSE_FALSE = @ALWAYS_FALSE_FALSE@ ALWAYS_FALSE_TRUE = @ALWAYS_FALSE_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AUX_DIR = @AUX_DIR@ AWK = @AWK@ BUILDTOOLSDIR = @BUILDTOOLSDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDEFS = @CDEFS@ CFLAGS = @CFLAGS@ COINUTILS_CFLAGS = @COINUTILS_CFLAGS@ COINUTILS_CFLAGS_INSTALLED = @COINUTILS_CFLAGS_INSTALLED@ COINUTILS_DATA = @COINUTILS_DATA@ COINUTILS_DATA_INSTALLED = @COINUTILS_DATA_INSTALLED@ COINUTILS_DEPENDENCIES = @COINUTILS_DEPENDENCIES@ COINUTILS_LIBS = @COINUTILS_LIBS@ COINUTILS_LIBS_INSTALLED = @COINUTILS_LIBS_INSTALLED@ COIN_CC_IS_CL_FALSE = @COIN_CC_IS_CL_FALSE@ COIN_CC_IS_CL_TRUE = @COIN_CC_IS_CL_TRUE@ COIN_CXX_IS_CL_FALSE = @COIN_CXX_IS_CL_FALSE@ COIN_CXX_IS_CL_TRUE = @COIN_CXX_IS_CL_TRUE@ COIN_HAS_COINUTILS_FALSE = @COIN_HAS_COINUTILS_FALSE@ COIN_HAS_COINUTILS_TRUE = @COIN_HAS_COINUTILS_TRUE@ COIN_HAS_CPX_FALSE = @COIN_HAS_CPX_FALSE@ COIN_HAS_CPX_TRUE = @COIN_HAS_CPX_TRUE@ COIN_HAS_GLPK_FALSE = @COIN_HAS_GLPK_FALSE@ COIN_HAS_GLPK_TRUE = @COIN_HAS_GLPK_TRUE@ COIN_HAS_GRB_FALSE = @COIN_HAS_GRB_FALSE@ COIN_HAS_GRB_TRUE = @COIN_HAS_GRB_TRUE@ COIN_HAS_MSK_FALSE = @COIN_HAS_MSK_FALSE@ COIN_HAS_MSK_TRUE = @COIN_HAS_MSK_TRUE@ COIN_HAS_NETLIB_FALSE = @COIN_HAS_NETLIB_FALSE@ COIN_HAS_NETLIB_TRUE = @COIN_HAS_NETLIB_TRUE@ COIN_HAS_PKGCONFIG_FALSE = @COIN_HAS_PKGCONFIG_FALSE@ COIN_HAS_PKGCONFIG_TRUE = @COIN_HAS_PKGCONFIG_TRUE@ COIN_HAS_SAMPLE_FALSE = @COIN_HAS_SAMPLE_FALSE@ COIN_HAS_SAMPLE_TRUE = @COIN_HAS_SAMPLE_TRUE@ COIN_HAS_SOPLEX_FALSE = @COIN_HAS_SOPLEX_FALSE@ COIN_HAS_SOPLEX_TRUE = @COIN_HAS_SOPLEX_TRUE@ COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@ COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@ COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPXINCDIR = @CPXINCDIR@ CPXLIB = @CPXLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEFS = @CXXDEFS@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBG_CFLAGS = @DBG_CFLAGS@ DBG_CXXFLAGS = @DBG_CXXFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPENDENCY_LINKING_FALSE = @DEPENDENCY_LINKING_FALSE@ DEPENDENCY_LINKING_TRUE = @DEPENDENCY_LINKING_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GLPK_CFLAGS = @GLPK_CFLAGS@ GLPK_CFLAGS_INSTALLED = @GLPK_CFLAGS_INSTALLED@ GLPK_DATA = @GLPK_DATA@ GLPK_DATA_INSTALLED = @GLPK_DATA_INSTALLED@ GLPK_DEPENDENCIES = @GLPK_DEPENDENCIES@ GLPK_LIBS = @GLPK_LIBS@ GLPK_LIBS_INSTALLED = @GLPK_LIBS_INSTALLED@ GRBINCDIR = @GRBINCDIR@ GRBLIB = @GRBLIB@ HAVE_EXTERNALS_FALSE = @HAVE_EXTERNALS_FALSE@ HAVE_EXTERNALS_TRUE = @HAVE_EXTERNALS_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBEXT = @LIBEXT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ $(am__append_5) $(am__append_10) $(am__append_15) \ $(am__append_20) $(am__append_25) $(am__append_30) LIBTOOL = @LIBTOOL@ LIBTOOLM4 = @LIBTOOLM4@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_LDFLAGS = @LT_LDFLAGS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MPICC = @MPICC@ MPICXX = @MPICXX@ MSKINCDIR = @MSKINCDIR@ MSKLIB = @MSKLIB@ NETLIB_CFLAGS = @NETLIB_CFLAGS@ NETLIB_CFLAGS_INSTALLED = @NETLIB_CFLAGS_INSTALLED@ NETLIB_DATA = @NETLIB_DATA@ NETLIB_DATA_INSTALLED = @NETLIB_DATA_INSTALLED@ NETLIB_DEPENDENCIES = @NETLIB_DEPENDENCIES@ NETLIB_LIBS = @NETLIB_LIBS@ NETLIB_LIBS_INSTALLED = @NETLIB_LIBS_INSTALLED@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSIGLPKLIB_CFLAGS = @OSIGLPKLIB_CFLAGS@ OSIGLPKLIB_CFLAGS_INSTALLED = @OSIGLPKLIB_CFLAGS_INSTALLED@ OSIGLPKLIB_DEPENDENCIES = @OSIGLPKLIB_DEPENDENCIES@ OSIGLPKLIB_LIBS = @OSIGLPKLIB_LIBS@ OSIGLPKLIB_LIBS_INSTALLED = @OSIGLPKLIB_LIBS_INSTALLED@ OSIGLPKLIB_PCLIBS = @OSIGLPKLIB_PCLIBS@ OSIGLPKLIB_PCREQUIRES = @OSIGLPKLIB_PCREQUIRES@ OSILIB_CFLAGS = @OSILIB_CFLAGS@ OSILIB_CFLAGS_INSTALLED = @OSILIB_CFLAGS_INSTALLED@ OSILIB_DEPENDENCIES = @OSILIB_DEPENDENCIES@ OSILIB_LIBS = @OSILIB_LIBS@ OSILIB_LIBS_INSTALLED = @OSILIB_LIBS_INSTALLED@ OSILIB_PCLIBS = @OSILIB_PCLIBS@ OSILIB_PCREQUIRES = @OSILIB_PCREQUIRES@ OSISPXLIB_CFLAGS = @OSISPXLIB_CFLAGS@ OSISPXLIB_CFLAGS_INSTALLED = @OSISPXLIB_CFLAGS_INSTALLED@ OSISPXLIB_DEPENDENCIES = @OSISPXLIB_DEPENDENCIES@ OSISPXLIB_LIBS = @OSISPXLIB_LIBS@ OSISPXLIB_LIBS_INSTALLED = @OSISPXLIB_LIBS_INSTALLED@ OSISPXLIB_PCLIBS = @OSISPXLIB_PCLIBS@ OSISPXLIB_PCREQUIRES = @OSISPXLIB_PCREQUIRES@ OSI_EXAMPLES_SOLVER_CFLAGS = @OSI_EXAMPLES_SOLVER_CFLAGS@ OSI_EXAMPLES_SOLVER_LIBS = @OSI_EXAMPLES_SOLVER_LIBS@ OSI_EXAMPLES_SOLVER_NAME = @OSI_EXAMPLES_SOLVER_NAME@ OSI_EXAMPLES_SOLVER_PCNAME = @OSI_EXAMPLES_SOLVER_PCNAME@ OSI_SVN_REV = @OSI_SVN_REV@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPATH_FLAGS = @RPATH_FLAGS@ SAMPLE_CFLAGS = @SAMPLE_CFLAGS@ SAMPLE_CFLAGS_INSTALLED = @SAMPLE_CFLAGS_INSTALLED@ SAMPLE_DATA = @SAMPLE_DATA@ SAMPLE_DATA_INSTALLED = @SAMPLE_DATA_INSTALLED@ SAMPLE_DEPENDENCIES = @SAMPLE_DEPENDENCIES@ SAMPLE_LIBS = @SAMPLE_LIBS@ SAMPLE_LIBS_INSTALLED = @SAMPLE_LIBS_INSTALLED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPLEX_CFLAGS = @SOPLEX_CFLAGS@ SOPLEX_CFLAGS_INSTALLED = @SOPLEX_CFLAGS_INSTALLED@ SOPLEX_DATA = @SOPLEX_DATA@ SOPLEX_DATA_INSTALLED = @SOPLEX_DATA_INSTALLED@ SOPLEX_DEPENDENCIES = @SOPLEX_DEPENDENCIES@ SOPLEX_LIBS = @SOPLEX_LIBS@ SOPLEX_LIBS_INSTALLED = @SOPLEX_LIBS_INSTALLED@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ XPRINCDIR = @XPRINCDIR@ XPRLIB = @XPRLIB@ abs_bin_dir = @abs_bin_dir@ abs_include_dir = @abs_include_dir@ abs_lib_dir = @abs_lib_dir@ abs_source_dir = @abs_source_dir@ ac_c_preproc_warn_flag = @ac_c_preproc_warn_flag@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_PKG_CONFIG = @ac_ct_PKG_CONFIG@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_cxx_preproc_warn_flag = @ac_cxx_preproc_warn_flag@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ coin_doxy_excludes = @coin_doxy_excludes@ coin_doxy_logname = @coin_doxy_logname@ coin_doxy_tagfiles = @coin_doxy_tagfiles@ coin_doxy_tagname = @coin_doxy_tagname@ coin_doxy_usedot = @coin_doxy_usedot@ coin_have_doxygen = @coin_have_doxygen@ datadir = @datadir@ exec_prefix = @exec_prefix@ have_autoconf = @have_autoconf@ have_automake = @have_automake@ have_svn = @have_svn@ have_svnversion = @have_svnversion@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sol_cc_compiler = @sol_cc_compiler@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign unitTest_SOURCES = unitTest.cpp OsiTestSolver.cpp \ OsiTestSolverInterface.cpp OsiTestSolverInterfaceIO.cpp \ OsiTestSolverInterfaceTest.cpp $(am__append_1) $(am__append_6) \ $(am__append_11) $(am__append_16) $(am__append_21) \ $(am__append_26) # List libraries of COIN projects unitTest_LDADD = ../src/OsiCommonTest/libOsiCommonTests.la \ $(am__append_3) $(am__append_8) $(am__append_13) \ $(am__append_18) $(am__append_23) $(am__append_28) \ ../src/Osi/libOsi.la $(OSILIB_LIBS) unitTest_DEPENDENCIES = ../src/OsiCommonTest/libOsiCommonTests.la \ $(am__append_4) $(am__append_9) $(am__append_14) \ $(am__append_19) $(am__append_24) $(am__append_29) \ ../src/Osi/libOsi.la $(OSILIB_DEPENDENCIES) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../src/Osi` -I`$(CYGPATH_W) \ $(srcdir)/../src/OsiCommonTest` $(COINUTILS_CFLAGS) \ $(am__append_2) $(am__append_7) $(am__append_12) \ $(am__append_17) $(am__append_22) $(am__append_27) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Osi unittestflags = $(am__append_31) $(am__append_32) ######################################################################## # Cleaning stuff # ######################################################################## # Here we list everything that is not generated by the compiler, e.g., # output files of a program DISTCLEANFILES = *.mps *.mps.gz *.lp test2out *.out.gz *.out all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done unitTest$(EXEEXT): $(unitTest_OBJECTS) $(unitTest_DEPENDENCIES) @rm -f unitTest$(EXEEXT) $(CXXLINK) $(unitTest_LDFLAGS) $(unitTest_OBJECTS) $(unitTest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiCpxSolverInterfaceTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiGlpkSolverInterfaceTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiGrbSolverInterfaceTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiMskSolverInterfaceTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiSpxSolverInterfaceTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiTestSolver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiTestSolverInterface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiTestSolverInterfaceIO.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiTestSolverInterfaceTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiXprSolverInterfaceTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unitTest.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am test: unitTest$(EXEEXT) ./unitTest$(EXEEXT) $(unittestflags) .PHONY: test # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Osi-0.106.4/test/OsiTestSolver.hpp0000644000076600007660000005247412244006221015354 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This file is licensed under the terms of Eclipse Public License (EPL). // this is a copy of VolVolume (stable/1.1 rev. 233) #ifndef __OSITESTSOLVER_HPP__ #define __OSITESTSOLVER_HPP__ #include #include #include #include #include #include "CoinFinite.hpp" #ifndef VOL_DEBUG // When VOL_DEBUG is 1, we check vector indices #define VOL_DEBUG 0 #endif template static inline T VolMax(register const T x, register const T y) { return ((x) > (y)) ? (x) : (y); } template static inline T VolAbs(register const T x) { return ((x) > 0) ? (x) : -(x); } //############################################################################ #if defined(VOL_DEBUG) && (VOL_DEBUG != 0) #define VOL_TEST_INDEX(i, size) \ { \ if ((i) < 0 || (i) >= (size)) { \ printf("bad VOL_?vector index\n"); \ abort(); \ } \ } #define VOL_TEST_SIZE(size) \ { \ if (s <= 0) { \ printf("bad VOL_?vector size\n"); \ abort(); \ } \ } #else #define VOL_TEST_INDEX(i, size) #define VOL_TEST_SIZE(size) #endif //############################################################################ class VOL_dvector; class VOL_ivector; class VOL_primal; class VOL_dual; class VOL_swing; class VOL_alpha_factor; class VOL_vh; class VOL_indc; class VOL_user_hooks; class VOL_problem; //############################################################################ /** This class contains the parameters controlling the Volume Algorithm */ struct VOL_parms { /** initial value of lambda */ double lambdainit; /** initial value of alpha */ double alphainit; /** minimum value for alpha */ double alphamin; /** when little progress is being done, we multiply alpha by alphafactor */ double alphafactor; /** initial upper bound of the value of an integer solution */ double ubinit; /** accept if max abs viol is less than this */ double primal_abs_precision; /** accept if abs gap is less than this */ double gap_abs_precision; /** accept if rel gap is less than this */ double gap_rel_precision; /** terminate if best_ub - lcost < granularity */ double granularity; /** terminate if the relative increase in lcost through ascent_check_invl steps is less than this */ double minimum_rel_ascent; /** when to check for sufficient relative ascent the first time */ int ascent_first_check; /** through how many iterations does the relative ascent have to reach a minimum */ int ascent_check_invl; /** maximum number of iterations */ int maxsgriters; /** controls the level of printing. The flag should the the 'OR'-d value of the following options:
    • 0 - print nothing
    • 1 - print iteration information
    • 2 - add lambda information
    • 4 - add number of Red, Yellow, Green iterations
    Default: 3 */ int printflag; /** controls how often do we print */ int printinvl; /** controls how often we run the primal heuristic */ int heurinvl; /** how many consecutive green iterations are allowed before changing lambda */ int greentestinvl; /** how many consecutive yellow iterations are allowed before changing lambda */ int yellowtestinvl; /** how many consecutive red iterations are allowed before changing lambda */ int redtestinvl; /** number of iterations before we check if alpha should be decreased */ int alphaint; /** name of file for saving dual solution */ char* temp_dualfile; }; //############################################################################ /** vector of doubles. It is used for most vector operations. Note: If VOL_DEBUG is #defined to be 1 then each time an entry is accessed in the vector the index of the entry is tested for nonnegativity and for being less than the size of the vector. It's good to turn this on while debugging, but in final runs it should be turned off (beause of the performance hit). */ class VOL_dvector { public: /** The array holding the vector */ double* v; /** The size of the vector */ int sz; public: /** Construct a vector of size s. The content of the vector is undefined. */ VOL_dvector(const int s) { VOL_TEST_SIZE(s); v = new double[sz = s]; } /** Default constructor creates a vector of size 0. */ VOL_dvector() : v(0), sz(0) {} /** Copy constructor makes a replica of x. */ VOL_dvector(const VOL_dvector& x) : v(0), sz(0) { sz = x.sz; if (sz > 0) { v = new double[sz]; std::copy(x.v, x.v + sz, v); } } /** The destructor deletes the data array. */ ~VOL_dvector() { delete[] v; } /** Return the size of the vector. */ inline int size() const {return sz;} /** Return a reference to the i-th entry. */ inline double& operator[](const int i) { VOL_TEST_INDEX(i, sz); return v[i]; } /** Return the i-th entry. */ inline double operator[](const int i) const { VOL_TEST_INDEX(i, sz); return v[i]; } /** Delete the content of the vector and replace it with a vector of length 0. */ inline void clear() { delete[] v; v = 0; sz = 0; } /** Convex combination. Replace the current vector v with v = (1-gamma) v + gamma w. */ inline void cc(const double gamma, const VOL_dvector& w) { if (sz != w.sz) { printf("bad VOL_dvector sizes\n"); abort(); } double * p_v = v - 1; const double * p_w = w.v - 1; const double * const p_e = v + sz; const double one_gamma = 1.0 - gamma; while ( ++p_v != p_e ){ *p_v = one_gamma * (*p_v) + gamma * (*++p_w); } } /** delete the current vector and allocate space for a vector of size s. */ inline void allocate(const int s) { VOL_TEST_SIZE(s); delete[] v; v = new double[sz = s]; } /** swaps the vector with w. */ inline void swap(VOL_dvector& w) { std::swap(v, w.v); std::swap(sz, w.sz); } /** Copy w into the vector. */ VOL_dvector& operator=(const VOL_dvector& w); /** Replace every entry in the vector with w. */ VOL_dvector& operator=(const double w); }; //----------------------------------------------------------------------------- /** vector of ints. It's used to store indices, it has similar functions as VOL_dvector. Note: If VOL_DEBUG is #defined to be 1 then each time an entry is accessed in the vector the index of the entry is tested for nonnegativity and for being less than the size of the vector. It's good to turn this on while debugging, but in final runs it should be turned off (beause of the performance hit). */ class VOL_ivector { public: /** The array holding the vector. */ int* v; /** The size of the vector. */ int sz; public: /** Construct a vector of size s. The content of the vector is undefined. */ VOL_ivector(const int s) { VOL_TEST_SIZE(s); v = new int[sz = s]; } /** Default constructor creates a vector of size 0. */ VOL_ivector() : v(0), sz(0) {} /** Copy constructor makes a replica of x. */ VOL_ivector(const VOL_ivector& x) { sz = x.sz; if (sz > 0) { v = new int[sz]; std::copy(x.v, x.v + sz, v); } } /** The destructor deletes the data array. */ ~VOL_ivector(){ delete [] v; } /** Return the size of the vector. */ inline int size() const { return sz; } /** Return a reference to the i-th entry. */ inline int& operator[](const int i) { VOL_TEST_INDEX(i, sz); return v[i]; } /** Return the i-th entry. */ inline int operator[](const int i) const { VOL_TEST_INDEX(i, sz); return v[i]; } /** Delete the content of the vector and replace it with a vector of length 0. */ inline void clear() { delete[] v; v = 0; sz = 0; } /** delete the current vector and allocate space for a vector of size s. */ inline void allocate(const int s) { VOL_TEST_SIZE(s); delete[] v; v = new int[sz = s]; } /** swaps the vector with w. */ inline void swap(VOL_ivector& w) { std::swap(v, w.v); std::swap(sz, w.sz); } /** Copy w into the vector. */ VOL_ivector& operator=(const VOL_ivector& v); /** Replace every entry in the vector with w. */ VOL_ivector& operator=(const int w); }; //############################################################################ // A class describing a primal solution. This class is used only internally class VOL_primal { public: // objective value of this primal solution double value; // the largest of the v[i]'s double viol; // primal solution VOL_dvector x; // v=b-Ax, for the relaxed constraints VOL_dvector v; VOL_primal(const int psize, const int dsize) : x(psize), v(dsize) {} VOL_primal(const VOL_primal& primal) : value(primal.value), viol(primal.viol), x(primal.x), v(primal.v) {} ~VOL_primal() {} inline VOL_primal& operator=(const VOL_primal& p) { if (this == &p) return *this; value = p.value; viol = p.viol; x = p.x; v = p.v; return *this; } // convex combination. data members in this will be overwritten // convex combination between two primal solutions // x <-- alpha x + (1 - alpha) p.x // v <-- alpha v + (1 - alpha) p.v inline void cc(const double alpha, const VOL_primal& p) { value = alpha * p.value + (1.0 - alpha) * value; x.cc(alpha, p.x); v.cc(alpha, p.v); } // find maximum of v[i] void find_max_viol(const VOL_dvector& dual_lb, const VOL_dvector& dual_ub); }; //----------------------------------------------------------------------------- // A class describing a dual solution. This class is used only internally class VOL_dual { public: // lagrangian value double lcost; // reduced costs * (pstar-primal) double xrc; // this information is only printed // dual vector VOL_dvector u; VOL_dual(const int dsize) : u(dsize) { u = 0.0;} VOL_dual(const VOL_dual& dual) : lcost(dual.lcost), xrc(dual.xrc), u(dual.u) {} ~VOL_dual() {} inline VOL_dual& operator=(const VOL_dual& p) { if (this == &p) return *this; lcost = p.lcost; xrc = p.xrc; u = p.u; return *this; } // dual step void step(const double target, const double lambda, const VOL_dvector& dual_lb, const VOL_dvector& dual_ub, const VOL_dvector& v); double ascent(const VOL_dvector& v, const VOL_dvector& last_u) const; void compute_xrc(const VOL_dvector& pstarx, const VOL_dvector& primalx, const VOL_dvector& rc); }; //############################################################################ /* here we check whether an iteration is green, yellow or red. Also according to this information we decide whether lambda should be changed */ class VOL_swing { private: VOL_swing(const VOL_swing&); VOL_swing& operator=(const VOL_swing&); public: enum condition {green, yellow, red} lastswing; int lastgreeniter, lastyellowiter, lastrediter; int ngs, nrs, nys; int rd; VOL_swing() { lastgreeniter = lastyellowiter = lastrediter = 0; ngs = nrs = nys = 0; } ~VOL_swing(){} inline void cond(const VOL_dual& dual, const double lcost, const double ascent, const int iter) { double eps = 1.e-3; if (ascent > 0.0 && lcost > dual.lcost + eps) { lastswing = green; lastgreeniter = iter; ++ngs; rd = 0; } else { if (ascent <= 0 && lcost > dual.lcost) { lastswing = yellow; lastyellowiter = iter; ++nys; rd = 0; } else { lastswing = red; lastrediter = iter; ++nrs; rd = 1; } } } inline double lfactor(const VOL_parms& parm, const double lambda, const int iter) { double lambdafactor = 1.0; double eps = 5.e-4; int cons; switch (lastswing) { case green: cons = iter - VolMax(lastyellowiter, lastrediter); if (parm.printflag & 4) printf(" G: Consecutive Gs = %3d\n\n", cons); if (cons >= parm.greentestinvl && lambda < 2.0) { lastgreeniter = lastyellowiter = lastrediter = iter; lambdafactor = 2.0; if (parm.printflag & 2) printf("\n ---- increasing lamda to %g ----\n\n", lambda * lambdafactor); } break; case yellow: cons = iter - VolMax(lastgreeniter, lastrediter); if (parm.printflag & 4) printf(" Y: Consecutive Ys = %3d\n\n", cons); if (cons >= parm.yellowtestinvl) { lastgreeniter = lastyellowiter = lastrediter = iter; lambdafactor = 1.1; if (parm.printflag & 2) printf("\n **** increasing lamda to %g *****\n\n", lambda * lambdafactor); } break; case red: cons = iter - VolMax(lastgreeniter, lastyellowiter); if (parm.printflag & 4) printf(" R: Consecutive Rs = %3d\n\n", cons); if (cons >= parm.redtestinvl && lambda > eps) { lastgreeniter = lastyellowiter = lastrediter = iter; lambdafactor = 0.67; if (parm.printflag & 2) printf("\n **** decreasing lamda to %g *****\n\n", lambda * lambdafactor); } break; } return lambdafactor; } inline void print() { printf("**** G= %i, Y= %i, R= %i ****\n", ngs, nys, nrs); ngs = nrs = nys = 0; } }; //############################################################################ /* alpha should be decreased if after some number of iterations the objective has increased less that 1% */ class VOL_alpha_factor { private: VOL_alpha_factor(const VOL_alpha_factor&); VOL_alpha_factor& operator=(const VOL_alpha_factor&); public: double lastvalue; VOL_alpha_factor() {lastvalue = -COIN_DBL_MAX;} ~VOL_alpha_factor() {} inline double factor(const VOL_parms& parm, const double lcost, const double alpha) { if (alpha < parm.alphamin) return 1.0; register const double ll = VolAbs(lcost); const double x = ll > 10 ? (lcost-lastvalue)/ll : (lcost-lastvalue); lastvalue = lcost; return (x <= 0.01) ? parm.alphafactor : 1.0; } }; //############################################################################ /* here we compute the norm of the conjugate direction -hh-, the norm of the subgradient -norm-, the inner product between the subgradient and the last conjugate direction -vh-, and the inner product between the new conjugate direction and the subgradient */ class VOL_vh { private: VOL_vh(const VOL_vh&); VOL_vh& operator=(const VOL_vh&); public: double hh; double norm; double vh; double asc; VOL_vh(const double alpha, const VOL_dvector& dual_lb, const VOL_dvector& dual_ub, const VOL_dvector& v, const VOL_dvector& vstar, const VOL_dvector& u); ~VOL_vh(){} }; //############################################################################ /* here we compute different parameter to be printed. v2 is the square of the norm of the subgradient. vu is the inner product between the dual variables and the subgradient. vabs is the maximum absolute value of the violations of pstar. asc is the inner product between the conjugate direction and the subgradient */ class VOL_indc { private: VOL_indc(const VOL_indc&); VOL_indc& operator=(const VOL_indc&); public: double v2; double vu; double vabs; double asc; public: VOL_indc(const VOL_dvector& dual_lb, const VOL_dvector& dual_ub, const VOL_primal& primal, const VOL_primal& pstar, const VOL_dual& dual); ~VOL_indc() {} }; //############################################################################# /** The user hooks should be overridden by the user to provide the problem specific routines for the volume algorithm. The user should derive a class ... for all hooks: return value of -1 means that volume should quit */ class VOL_user_hooks { public: virtual ~VOL_user_hooks() {} public: // for all hooks: return value of -1 means that volume should quit /** compute reduced costs @param u (IN) the dual variables @param rc (OUT) the reduced cost with respect to the dual values */ virtual int compute_rc(const VOL_dvector& u, VOL_dvector& rc) = 0; /** Solve the subproblem for the subgradient step. @param dual (IN) the dual variables @param rc (IN) the reduced cost with respect to the dual values @param lcost (OUT) the lagrangean cost with respect to the dual values @param x (OUT) the primal result of solving the subproblem @param v (OUT) b-Ax for the relaxed constraints @param pcost (OUT) the primal objective value of x */ virtual int solve_subproblem(const VOL_dvector& dual, const VOL_dvector& rc, double& lcost, VOL_dvector& x, VOL_dvector& v, double& pcost) = 0; /** Starting from the primal vector x, run a heuristic to produce an integer solution @param x (IN) the primal vector @param heur_val (OUT) the value of the integer solution (return COIN_DBL_MAX here if no feas sol was found */ virtual int heuristics(const VOL_problem& p, const VOL_dvector& x, double& heur_val) = 0; }; //############################################################################# /** This class holds every data for the Volume Algorithm and its solve method must be invoked to solve the problem. The INPUT fields must be filled out completely before solve is invoked. dsol have to be filled out if and only if the last argument to solve is true. */ class VOL_problem { private: VOL_problem(const VOL_problem&); VOL_problem& operator=(const VOL_problem&); void set_default_parm(); // ############ INPUT fields ######################## public: /**@name Constructors and destructor */ //@{ /** Default constructor. */ VOL_problem(); /** Create a a VOL_problem object and read in the parameters from filename. */ VOL_problem(const char *filename); /** Destruct the object. */ ~VOL_problem(); //@} /**@name Method to solve the problem. */ //@{ /** Solve the problem using the hooks. Any information needed in the hooks must be stored in the structure user_data points to. */ int solve(VOL_user_hooks& hooks, const bool use_preset_dual = false); //@} private: /**@name Internal data (may be inquired for) */ //@{ /** value of alpha */ double alpha_; /** value of lambda */ double lambda_; // This union is here for padding (so that data members would be // double-aligned on x86 CPU union { /** iteration number */ int iter_; double __pad0; }; //@} public: /**@name External data (containing the result after solve) */ //@{ /** final lagrangian value (OUTPUT) */ double value; /** final dual solution (INPUT/OUTPUT) */ VOL_dvector dsol; /** final primal solution (OUTPUT) */ VOL_dvector psol; /** violations (b-Ax) for the relaxed constraints */ VOL_dvector viol; //@} /**@name External data (may be changed by the user before calling solve) */ //@{ /** The parameters controlling the Volume Algorithm (INPUT) */ VOL_parms parm; /** length of primal solution (INPUT) */ int psize; /** length of dual solution (INPUT) */ int dsize; /** lower bounds for the duals (if 0 length, then filled with -inf) (INPUT) */ VOL_dvector dual_lb; /** upper bounds for the duals (if 0 length, then filled with +inf) (INPUT) */ VOL_dvector dual_ub; //@} public: /**@name Methods returning final data */ //@{ /** returns the iteration number */ int iter() const { return iter_; } /** returns the value of alpha */ double alpha() const { return alpha_; } /** returns the value of lambda */ double lambda() const { return lambda_; } //@} private: /**@name Private methods used internally */ //@{ /** Read in the parameters from the file filename. */ void read_params(const char* filename); /** initializes duals, bounds for the duals, alpha, lambda */ int initialize(const bool use_preset_dual); /** print volume info every parm.printinvl iterations */ void print_info(const int iter, const VOL_primal& primal, const VOL_primal& pstar, const VOL_dual& dual); /** Checks if lcost is close to the target, if so it increases the target. Close means that we got within 5% of the target. */ double readjust_target(const double oldtarget, const double lcost) const; /** Here we decide the value of alpha1 to be used in the convex combination. The new pstar will be computed as
    pstar = alpha1 * pstar + (1 - alpha1) * primal
    More details of this are in doc.ps.
    IN: alpha, primal, pstar, dual
    @return alpha1 */ double power_heur(const VOL_primal& primal, const VOL_primal& pstar, const VOL_dual& dual) const; //@} }; #endif Osi-0.106.4/test/OsiXprSolverInterfaceTest.cpp0000644000076600007660000006431211612354477017675 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This file is licensed under the terms of Eclipse Public License (EPL). #include "CoinPragma.hpp" #include "OsiConfig.h" //#include #include "OsiUnitTests.hpp" #include "OsiXprSolverInterface.hpp" #include "OsiCuts.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" // Added so build windows build with dsp files works, // when not building with xpress. #ifdef COIN_HAS_XPR #define __ANSIC_ #include #undef __ANSIC_ //----------------------------------------------------------------------- // Test XPRESS-MP solution methods. void OsiXprSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir) { unsigned int numInstancesStart = OsiXprSolverInterface::getNumInstances(); // Test default constructor { OsiXprSolverInterface m; OSIUNITTEST_ASSERT_ERROR(m.xprProbname_ == "", {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.collower_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colupper_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.vartype_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowlower_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowupper_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowprice_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colsol_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsol_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByCol_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.ivarind_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.ivartype_ == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 0, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getApplicationData() == NULL, {}, "xpress", "default constructor"); OSIUNITTEST_ASSERT_ERROR(OsiXprSolverInterface::getNumInstances() == numInstancesStart+1, {}, "xpress", "number of instances during first test"); int i=2346; m.setApplicationData(&i); OSIUNITTEST_ASSERT_ERROR(*((int *)(m.getApplicationData())) == i, {}, "xpress", "default constructor"); } OSIUNITTEST_ASSERT_ERROR(OsiXprSolverInterface::getNumInstances() == numInstancesStart, {}, "xpress", "number of instances after first test"); { CoinRelFltEq eq; OsiXprSolverInterface m; OSIUNITTEST_ASSERT_ERROR(OsiXprSolverInterface::getNumInstances() == numInstancesStart+1, {}, "xpress", "number of instances"); std::string fn = mpsDir+"exmip1"; m.readMps(fn.c_str()); // This assert fails on windows because fn is mixed case and xprProbname_is uppercase. //OSIUNITTEST_ASSERT_ERROR( m.xprProbname_ == fn, {}, "xpress", "exmip1 problem name" ); // Test copy constructor and assignment operator { OsiXprSolverInterface lhs; { OsiXprSolverInterface im(m); OsiXprSolverInterface imC1(im); OSIUNITTEST_ASSERT_ERROR(imC1.getNumCols() == im.getNumCols(), {}, "xpress", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumRows() == im.getNumRows(), {}, "xpress", "copy constructor"); OsiXprSolverInterface imC2(im); OSIUNITTEST_ASSERT_ERROR(imC2.getNumCols() == im.getNumCols(), {}, "xpress", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumRows() == im.getNumRows(), {}, "xpress", "copy constructor"); lhs = imC2; } // Test that lhs has correct values even though rhs has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.getNumCols() == m.getNumCols(), {}, "xpress", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumRows() == m.getNumRows(), {}, "xpress", "copy constructor"); } // Test clone { OsiXprSolverInterface xpressSi(m); OsiSolverInterface * siPtr = &xpressSi; OsiSolverInterface * siClone = siPtr->clone(); OsiXprSolverInterface * xpressClone = dynamic_cast(siClone); OSIUNITTEST_ASSERT_ERROR(xpressClone != NULL, {}, "xpress", "clone"); OSIUNITTEST_ASSERT_ERROR(xpressClone->getNumRows() == xpressSi.getNumRows(), {}, "xpress", "clone"); OSIUNITTEST_ASSERT_ERROR(xpressClone->getNumCols() == m.getNumCols(), {}, "xpress", "clone"); delete siClone; } // Test infinity { OsiXprSolverInterface si; OSIUNITTEST_ASSERT_ERROR(si.getInfinity() == XPRS_PLUSINFINITY, {}, "xpress", "value for infinity"); } { OsiXprSolverInterface xpressSi(m); int nc = xpressSi.getNumCols(); int nr = xpressSi.getNumRows(); const double * cl = xpressSi.getColLower(); const double * cu = xpressSi.getColUpper(); const double * rl = xpressSi.getRowLower(); const double * ru = xpressSi.getRowUpper(); OSIUNITTEST_ASSERT_ERROR(nc == 8, return, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(nr == 5, return, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[1],4.1), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[2],1.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[0],2.5), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[4],3.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[1],2.1), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[4],15.), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(!eq(cl[3],1.2345), {}, "xpress", "set col lower"); xpressSi.setColLower( 3, 1.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cl[3],1.2345), {}, "xpress", "set col lower"); OSIUNITTEST_ASSERT_ERROR(!eq(cu[4],10.2345), {}, "xpress", "set col upper"); xpressSi.setColUpper( 4, 10.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cu[4],10.2345), {}, "xpress", "set col upper"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[0], 1.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[1], 0.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[2], 0.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[3], 0.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[4], 2.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[5], 0.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[6], 0.0), {}, "xpress", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(xpressSi.getObjCoefficients()[7],-1.0), {}, "xpress", "read and copy exmip1"); } // Test getMatrixByRow method { const OsiXprSolverInterface si(m); const CoinPackedMatrix * smP = si.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim() == 5, return, "xpress", "getMatrixByRow: major dim"); OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "xpress", "getMatrixByRow: num elements"); CoinRelFltEq eq; const double * ev = smP->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[0], 3.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[1], 1.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[2], -2.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[3], -1.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[4], -1.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[5], 2.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[6], 1.1), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[7], 1.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[8], 1.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[9], 2.8), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], -1.2), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "xpress", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "xpress", "getMatrixByRow: elements"); const int * mi = smP->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "xpress", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "xpress", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "xpress", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "xpress", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "xpress", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "xpress", "getMatrixByRow: vector starts"); const int * ei = smP->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "xpress", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "xpress", "getMatrixByRow: indices"); } //-------------- // Test rowsense, rhs, rowrange, getMatrixByRow { OsiXprSolverInterface lhs; { OsiXprSolverInterface siC1(m); OSIUNITTEST_ASSERT_WARNING(siC1.rowrange_ == NULL, {}, "xpress", "row range"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsense_ == NULL, {}, "xpress", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1.rhs_ == NULL, {}, "xpress", "right hand side"); assert( m.rowrange_==NULL ); assert( m.rowsense_==NULL ); assert( m.rhs_==NULL ); const char * siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "xpress", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "xpress", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "xpress", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "xpress", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "xpress", "row sense"); const double * siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "xpress", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "xpress", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "xpress", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "xpress", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "xpress", "right hand side"); const double * siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "xpress", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "xpress", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "xpress", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "xpress", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "xpress", "row range"); const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "xpress", "matrix by row"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim() == 5, return, "xpress", "matrix by row: major dim"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "xpress", "matrix by row: num elements"); const double * ev = siC1mbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "xpress", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "xpress", "matrix by row: elements"); const CoinBigIndex * mi = siC1mbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "xpress", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "xpress", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "xpress", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "xpress", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "xpress", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "xpress", "matrix by row: vector starts"); const int * ei = siC1mbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "xpress", "matrix by row: indices"); OSIUNITTEST_ASSERT_WARNING(siC1rs == siC1.getRowSense(), {}, "xpress", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1rhs == siC1.getRightHandSide(), {}, "xpress", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1rr == siC1.getRowRange(), {}, "xpress", "row range"); // Change XPRESS Model by adding free row OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb( COIN_DBL_MAX); OsiCuts cuts; cuts.insert(rc); siC1.applyCuts(cuts); // Since model was changed, test that cached data is now freed. OSIUNITTEST_ASSERT_ERROR(siC1.rowrange_ == NULL, {}, "xpress", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsense_ == NULL, {}, "xpress", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rhs_ == NULL, {}, "xpress", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByRow_ == NULL, {}, "xpress", "free cached data after adding row"); siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "xpress", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "xpress", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "xpress", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "xpress", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "xpress", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[5] == 'N', {}, "xpress", "row sense after adding row"); siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "xpress", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "xpress", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "xpress", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "xpress", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "xpress", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[5],0.0), {}, "xpress", "right hand side after adding row"); siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "xpress", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "xpress", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "xpress", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "xpress", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "xpress", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[5],0.0), {}, "xpress", "row range after adding row"); lhs = siC1; } // Test that lhs has correct values even though siC1 has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.rowrange_ == NULL, {}, "xpress", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsense_ == NULL, {}, "xpress", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rhs_ == NULL, {}, "xpress", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByRow_ == NULL, {}, "xpress", "freed origin after assignment"); const char * lhsrs = lhs.getRowSense(); OSIUNITTEST_ASSERT_ERROR(lhsrs[0] == 'G', {}, "xpress", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[1] == 'L', {}, "xpress", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[2] == 'E', {}, "xpress", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[3] == 'R', {}, "xpress", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[4] == 'R', {}, "xpress", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[5] == 'N', {}, "xpress", "row sense after assignment"); const double * lhsrhs = lhs.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[0],2.5), {}, "xpress", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[1],2.1), {}, "xpress", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[2],4.0), {}, "xpress", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[3],5.0), {}, "xpress", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[4],15.), {}, "xpress", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[5],0.0), {}, "xpress", "right hand side after assignment"); const double *lhsrr = lhs.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[0],0.0), {}, "xpress", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[1],0.0), {}, "xpress", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[2],0.0), {}, "xpress", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[3],5.0-1.8), {}, "xpress", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[4],15.0-3.0), {}, "xpress", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[5],0.0), {}, "xpress", "row range after assignment"); const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, {}, "xpress", "matrix by row after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim() == 6, return, "xpress", "matrix by row after assignment: major dim"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "xpress", "matrix by row after assignment: num elements"); const double * ev = lhsmbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "xpress", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "xpress", "matrix by row after assignment: elements"); const CoinBigIndex * mi = lhsmbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "xpress", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "xpress", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "xpress", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "xpress", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "xpress", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "xpress", "matrix by row after assignment: vector starts"); const int * ei = lhsmbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "xpress", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "xpress", "matrix by row after assignment: indices"); } OSIUNITTEST_ASSERT_ERROR(OsiXprSolverInterface::getNumInstances() == numInstancesStart+1, {}, "xpress", "number of instances"); } OSIUNITTEST_ASSERT_ERROR(OsiXprSolverInterface::getNumInstances() == numInstancesStart, {}, "xpress", "number of instances at finish"); // Do common solverInterface testing by calling the // base class testing method. { OsiXprSolverInterface m; OsiSolverInterfaceCommonUnitTest(&m, mpsDir, netlibDir); } } #endif Osi-0.106.4/test/OsiTestSolverInterface.cpp0000644000076600007660000011402711510425067017171 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This file is licensed under the terms of Eclipse Public License (EPL). // this is a copy of OsiVolSolverInterface (trunk rev. 1466) renamed to OsiTestSolverInterface #include "CoinPragma.hpp" #include #include #include #include #include "CoinHelperFunctions.hpp" #include "CoinWarmStartDual.hpp" #include "OsiTestSolverInterface.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" //####################################################################### // Private helper methods //####################################################################### void OsiTestSolverInterface::updateRowMatrix_() const { if (! rowMatrixCurrent_) { rowMatrix_.reverseOrderedCopyOf(colMatrix_); rowMatrixCurrent_ = true; } } void OsiTestSolverInterface::updateColMatrix_() const { if (! colMatrixCurrent_) { colMatrix_.reverseOrderedCopyOf(rowMatrix_); colMatrixCurrent_ = true; } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::checkData_() const { int i; for (i = getNumRows() - 1; i >= 0; --i) { if (rowlower_[i] > -1.0e20 && rowupper_[i] < 1.0e20 && rowlower_[i] != rowupper_[i]) throw CoinError("Volume algorithm is unable to handle ranged rows", "checkData_", "OsiTestSolverInterface"); } for (i = getNumCols() - 1; i >= 0; --i) { if (collower_[i] < -1.0e20 || colupper_[i] > 1.0e20) throw CoinError("Volume algorithm is unable to handle infinite bounds", "checkData_", "OsiTestSolverInterface"); } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::compute_rc_(const double* u, double* rc) const { if (isZeroOneMinusOne_) { rowMatrixOneMinusOne_->timesMajor(u, rc); } else { rowMatrix_.transposeTimes(u, rc); } const int psize = getNumCols(); std::transform(rc, rc+psize, objcoeffs_, rc, std::minus()); std::transform(rc, rc+psize, rc, std::negate()); } //############################################################################# bool OsiTestSolverInterface::test_zero_one_minusone_(const CoinPackedMatrix& m) const { const int vecnum = m.getMajorDim(); const double* elem = m.getElements(); const int* start = m.getVectorStarts(); const int* length = m.getVectorLengths(); int i, j; for (i = 0; i < vecnum; ++i) { for (j = start[i] + length[i] - 1; j >= start[i]; --j) { const double val = elem[j]; if (val != 1.0 && val != 0.0 && val != -1.0) { return false; } } } return true; } //----------------------------------------------------------------------------- OsiTestSolverInterface::OsiVolMatrixOneMinusOne_:: OsiVolMatrixOneMinusOne_(const CoinPackedMatrix& m) { const int major = m.getMajorDim(); const double* elem = m.getElements(); const int* ind = m.getIndices(); const int* start = m.getVectorStarts(); const int* length = m.getVectorLengths(); majorDim_ = major; minorDim_ = m.getMinorDim(); plusSize_ = 0; minusSize_ = 0; int i, j; for (i = 0; i < major; ++i) { for (j = start[i] + length[i] - 1; j >= start[i]; --j) { const double val = elem[j]; if (val == 1.0) { ++plusSize_; } else if (val == -1.0) { ++minusSize_; } } } if (plusSize_ > 0) { plusInd_ = new int[plusSize_]; } if (minusSize_ > 0) { minusInd_ = new int[minusSize_]; } plusStart_ = new int[major]; plusLength_ = new int[major]; minusStart_ = new int[major]; minusLength_ = new int[major]; plusSize_ = 0; minusSize_ = 0; for (i = 0; i < major; ++i) { plusStart_[i] = plusSize_; minusStart_[i] = minusSize_; const int last = start[i] + length[i]; for (j = start[i]; j < last; ++j) { const double val = elem[j]; if (val == 1.0) { plusInd_[plusSize_++] = ind[j]; } else if (val == -1.0) { minusInd_[minusSize_++] = ind[j]; } } plusLength_[i] = plusSize_ - plusStart_[i]; minusLength_[i] = minusSize_ - minusStart_[i]; } if (plusSize_ == 0) { delete[] plusStart_; plusStart_ = NULL; delete[] plusLength_; plusLength_ = NULL; } if (minusSize_ == 0) { delete[] minusStart_; minusStart_ = NULL; delete[] minusLength_; minusLength_ = NULL; } } //----------------------------------------------------------------------------- OsiTestSolverInterface::OsiVolMatrixOneMinusOne_:: ~OsiVolMatrixOneMinusOne_() { if (plusSize_ > 0) { delete[] plusInd_; plusInd_ = NULL; delete[] plusStart_; plusStart_ = NULL; delete[] plusLength_; plusLength_ = NULL; } if (minusSize_ > 0) { delete[] minusInd_; minusInd_ = NULL; delete[] minusStart_; minusStart_ = NULL; delete[] minusLength_; minusLength_ = NULL; } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::OsiVolMatrixOneMinusOne_:: timesMajor(const double* x, double* y) const { memset(y, 0, minorDim_ * sizeof(double)); int i; if (plusSize_ > 0 && minusSize_ > 0) { for (i = majorDim_ - 1; i >= 0; --i) { const double x_i = x[i]; if (x_i != 0.0) { const int* vecInd = plusInd_ + plusStart_[i]; int j; for ( j = plusLength_[i] - 1; j >= 0; --j) y[vecInd[j]] += x_i; vecInd = minusInd_ + minusStart_[i]; for ( j = minusLength_[i] - 1; j >= 0; --j) y[vecInd[j]] -= x_i; } } return; } if (plusSize_ > 0) { for (i = majorDim_ - 1; i >= 0; --i) { const double x_i = x[i]; if (x_i != 0.0) { const int* vecInd = plusInd_ + plusStart_[i]; for (int j = plusLength_[i] - 1; j >= 0; --j) y[vecInd[j]] += x_i; } } return; } if (minusSize_ > 0) { for (i = majorDim_ - 1; i >= 0; --i) { const double x_i = x[i]; if (x_i != 0.0) { const int* vecInd = minusInd_ + minusStart_[i]; for (int j = minusLength_[i] - 1; j >= 0; --j) y[vecInd[j]] -= x_i; } } return; } } //############################################################################# void OsiTestSolverInterface::gutsOfDestructor_() { rowMatrix_.clear(); colMatrix_.clear(); rowMatrixCurrent_ = true; colMatrixCurrent_ = true; delete[] colupper_; colupper_ = 0; delete[] collower_; collower_ = 0; delete[] continuous_; continuous_ = 0; delete[] rowupper_; rowupper_ = 0; delete[] rowlower_; rowlower_ = 0; delete[] rowsense_; rowsense_ = 0; delete[] rhs_; rhs_ = 0; delete[] rowrange_; rowrange_ = 0; delete[] objcoeffs_; objcoeffs_ = 0; delete[] colsol_; colsol_ = 0; delete[] rowprice_; rowprice_ = 0; delete[] rowpriceHotStart_; rowpriceHotStart_ = 0; delete[] rc_; rc_ = 0; delete[] lhs_; lhs_ = 0; lagrangeanCost_ = 0.0; maxNumrows_ = 0; maxNumcols_ = 0; } //############################################################################# void OsiTestSolverInterface::rowRimAllocator_() { rowupper_ = new double[maxNumrows_]; rowlower_ = new double[maxNumrows_]; rowsense_ = new char[maxNumrows_]; rhs_ = new double[maxNumrows_]; rowrange_ = new double[maxNumrows_]; rowprice_ = new double[maxNumrows_]; lhs_ = new double[maxNumrows_]; } //----------------------------------------------------------------------------- void OsiTestSolverInterface::colRimAllocator_() { colupper_ = new double[maxNumcols_]; collower_ = new double[maxNumcols_]; continuous_ = new bool[maxNumcols_]; objcoeffs_ = new double[maxNumcols_]; colsol_ = new double[maxNumcols_]; rc_ = new double[maxNumcols_]; } //----------------------------------------------------------------------------- void OsiTestSolverInterface::rowRimResize_(const int newSize) { if (newSize > maxNumrows_) { double* rub = rowupper_; double* rlb = rowlower_; char* sense = rowsense_; double* right = rhs_; double* range = rowrange_; double* dual = rowprice_; double* left = lhs_; maxNumrows_ = CoinMax(1000, (newSize * 5) / 4); rowRimAllocator_(); const int rownum = getNumRows(); CoinDisjointCopyN(rub , rownum, rowupper_); CoinDisjointCopyN(rlb , rownum, rowlower_); CoinDisjointCopyN(sense, rownum, rowsense_); CoinDisjointCopyN(right, rownum, rhs_); CoinDisjointCopyN(range, rownum, rowrange_); CoinDisjointCopyN(dual , rownum, rowprice_); CoinDisjointCopyN(left , rownum, lhs_); delete[] rub; delete[] rlb; delete[] sense; delete[] right; delete[] range; delete[] dual; delete[] left; } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::colRimResize_(const int newSize) { if (newSize > maxNumcols_) { double* cub = colupper_; double* clb = collower_; bool* cont = continuous_; double* obj = objcoeffs_; double* sol = colsol_; double* rc = rc_; maxNumcols_ = CoinMax(1000, (newSize * 5) / 4); colRimAllocator_(); const int colnum = getNumCols(); CoinDisjointCopyN(cub , colnum, colupper_); CoinDisjointCopyN(clb , colnum, collower_); CoinDisjointCopyN(cont, colnum, continuous_); CoinDisjointCopyN(obj , colnum, objcoeffs_); CoinDisjointCopyN(sol , colnum, colsol_); CoinDisjointCopyN(rc , colnum, rc_); delete[] cub; delete[] clb; delete[] cont; delete[] obj; delete[] sol; delete[] rc; } } //############################################################################# void OsiTestSolverInterface::convertBoundsToSenses_() { for (int i = getNumRows() - 1; i >= 0; --i ) { convertBoundToSense(rowlower_[i], rowupper_[i], rowsense_[i], rhs_[i], rowrange_[i]); } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::convertSensesToBounds_() { for (int i = getNumRows() - 1; i >= 0; --i) { convertSenseToBound(rowsense_[i], rhs_[i], rowrange_[i], rowlower_[i], rowupper_[i]); } } //############################################################################# // Here are the routines implementing the virtual methods inherited from // VOL_user_hooks. //############################################################################# int OsiTestSolverInterface::compute_rc(const VOL_dvector& u, VOL_dvector& rc) { compute_rc_(u.v, rc.v); return 0; } //----------------------------------------------------------------------- int OsiTestSolverInterface::solve_subproblem(const VOL_dvector& dual, const VOL_dvector& rc, double& lcost, VOL_dvector& x, VOL_dvector& v, double& pcost) { int i; const int psize = x.size(); for (i = 0; i < psize; ++i) { x[i] = (rc[i] >= 0.0) ? collower_[i] : colupper_[i]; } const int dsize = v.size(); lcost = (std::inner_product(rhs_, rhs_ + dsize, dual.v, 0.0) + std::inner_product(x.v, x.v + psize, rc.v, 0.0) ); if (isZeroOneMinusOne_) { colMatrixOneMinusOne_->timesMajor(x.v, v.v); } else { colMatrix_.times(x.v, v.v); } std::transform(v.v, v.v+dsize, rhs_, v.v, std::minus()); std::transform(v.v, v.v+dsize, v.v, std::negate()); pcost = std::inner_product(x.v, x.v + psize, objcoeffs_, 0.0); return 0; } //############################################################################# // Solve methods //############################################################################# void OsiTestSolverInterface::initialSolve() { // set every entry to 0.0 in the dual solution CoinFillN(rowprice_, getNumRows(), 0.0); resolve(); } //----------------------------------------------------------------------------- void OsiTestSolverInterface::resolve() { int i; checkData_(); // Only one of these can do any work updateRowMatrix_(); updateColMatrix_(); const int dsize = getNumRows(); const int psize = getNumCols(); // Negate the objective coefficients if necessary if (objsense_ < 0) { std::transform(objcoeffs_, objcoeffs_+psize, objcoeffs_, std::negate()); } // Set the lb/ub on the duals volprob_.dual_lb.allocate(dsize); volprob_.dual_ub.allocate(dsize); double * dlb = volprob_.dual_lb.v; double * dub = volprob_.dual_ub.v; for (i = 0; i < dsize; ++i) { dlb[i] = rowupper_[i] < getInfinity() ? -1.0e31 : 0.0; dub[i] = rowlower_[i] > -getInfinity() ? 1.0e31 : 0.0; } volprob_.dsize = dsize; volprob_.psize = psize; // Set the dual starting point VOL_dvector& dsol = volprob_.dsol; dsol.allocate(dsize); std::transform(rowprice_, rowprice_+dsize, dsol.v, std::bind2nd(std::multiplies(), objsense_)); // adjust the dual vector (if necessary) to be sure it's feasible double * dv = dsol.v; for (i = 0; i < dsize; ++i) { if (dv[i] < dlb[i]) { dv[i] = dlb[i]; } else if (dv[i] > dub[i]) { dv[i] = dub[i]; } } // If requested, check whether the matrix contains anything but 0/1/-1 #if 0 isZeroOneMinusOne_ = false; #else isZeroOneMinusOne_ = test_zero_one_minusone_(colMatrix_); if (isZeroOneMinusOne_) { colMatrixOneMinusOne_ = new OsiVolMatrixOneMinusOne_(colMatrix_); rowMatrixOneMinusOne_ = new OsiVolMatrixOneMinusOne_(rowMatrix_); } #endif volprob_.solve(*this, true); // extract the solution // the lower bound on the objective value lagrangeanCost_ = objsense_ * volprob_.value; // the primal solution CoinDisjointCopyN(volprob_.psol.v, psize, colsol_); // Reset the objective coefficients if necessary if (objsense_ < 0) { std::transform(objcoeffs_, objcoeffs_ + psize, objcoeffs_, std::negate()); // also, multiply the dual solution by -1 std::transform(volprob_.dsol.v, volprob_.dsol.v+dsize, rowprice_, std::negate()); } else { // now we just have to copy the dual CoinDisjointCopyN(volprob_.dsol.v, dsize, rowprice_); } // Compute the reduced costs compute_rc_(rowprice_, rc_); // Compute the left hand side (row activity levels) if (isZeroOneMinusOne_) { colMatrixOneMinusOne_->timesMajor(colsol_, lhs_); } else { colMatrix_.times(colsol_, lhs_); } if (isZeroOneMinusOne_) { delete colMatrixOneMinusOne_; colMatrixOneMinusOne_ = NULL; delete rowMatrixOneMinusOne_; rowMatrixOneMinusOne_ = NULL; } } //############################################################################# // Parameter related methods //############################################################################# bool OsiTestSolverInterface::setIntParam(OsiIntParam key, int value) { switch (key) { case OsiMaxNumIteration: if (value < 0) return false; volprob_.parm.maxsgriters = value; break; case OsiMaxNumIterationHotStart: if (value < 0) return false; OsiSolverInterface::setIntParam(key, value); break; case OsiLastIntParam: return false; default: return false; } return true; } //----------------------------------------------------------------------------- bool OsiTestSolverInterface::setDblParam(OsiDblParam key, double value) { switch (key) { case OsiDualObjectiveLimit: volprob_.parm.ubinit = value; break; case OsiPrimalObjectiveLimit: // not applicable return false; case OsiDualTolerance: // only ~0 is applicable, so accept only 1e-50 ... return (value == 1e-50); case OsiPrimalTolerance: if (value < 1e-04 || value > 1e-1) return false; volprob_.parm.primal_abs_precision = value; break; case OsiObjOffset: return OsiSolverInterface::setDblParam(key, value); case OsiLastDblParam: return false; default: return false; } return true; } //----------------------------------------------------------------------------- bool OsiTestSolverInterface::setStrParam(OsiStrParam key, const std::string & value) { bool retval=false; switch (key) { case OsiSolverName: return false; case OsiProbName: OsiSolverInterface::setStrParam(key,value); return retval = true; case OsiLastStrParam: return false; default: return false; } return false; } //----------------------------------------------------------------------------- bool OsiTestSolverInterface::getIntParam(OsiIntParam key, int& value) const { switch (key) { case OsiMaxNumIteration: value = volprob_.parm.maxsgriters; break; case OsiMaxNumIterationHotStart: OsiSolverInterface::getIntParam(key, value); break; case OsiLastIntParam: return false; default: return false; } return true; } //----------------------------------------------------------------------------- bool OsiTestSolverInterface::getDblParam(OsiDblParam key, double& value) const { switch (key) { case OsiDualObjectiveLimit: value = volprob_.parm.ubinit; break; case OsiPrimalObjectiveLimit: // not applicable return false; case OsiDualTolerance: // not applicable, but must return almost 0 value = 1e-50; break; case OsiPrimalTolerance: value = volprob_.parm.primal_abs_precision; break; case OsiObjOffset: OsiSolverInterface::getDblParam(key, value); break; case OsiLastDblParam: return false; default: return false; } return true; } //----------------------------------------------------------------------------- bool OsiTestSolverInterface::getStrParam(OsiStrParam key, std::string & value) const { switch (key) { case OsiProbName: OsiSolverInterface::getStrParam(key, value); return true; case OsiSolverName: value = "vol"; return true; case OsiLastStrParam: return false; default: return false; } return false; } //############################################################################# // Methods returning info on how the solution process terminated //############################################################################# bool OsiTestSolverInterface::isAbandoned() const { // *THINK*: see the *THINK* in isProvenOptimal() return false; } bool OsiTestSolverInterface::isProvenOptimal() const { // if exited before reaching the iteration limit it is declared optimal // *THINK*: Granted, it can exit because the dual value is not improving. // *THINK*: Should that be "abandoned"? But then it'll be abandoned way too // *THINK*: frequently... return (! isDualObjectiveLimitReached() && volprob_.iter() < volprob_.parm.maxsgriters); } bool OsiTestSolverInterface::isProvenPrimalInfeasible() const { // LL: *FIXME* : at the moment the volume can't detect primal infeasibility. // LL: *FIXME* : The dual will go to infinity. return false; } bool OsiTestSolverInterface::isProvenDualInfeasible() const { // LL: *FIXME* : at the moment the volume assumes dual feasibility... return false; } bool OsiTestSolverInterface::isPrimalObjectiveLimitReached() const { // The volume algorithm doesn't know anything about the primal; only the // dual is monotone return false; } bool OsiTestSolverInterface::isDualObjectiveLimitReached() const { return volprob_.parm.ubinit - volprob_.value < volprob_.parm.granularity; } bool OsiTestSolverInterface::isIterationLimitReached() const { return volprob_.iter() >= volprob_.parm.maxsgriters; } //############################################################################# // WarmStart related methods //############################################################################# CoinWarmStart* OsiTestSolverInterface::getEmptyWarmStart () const { return (dynamic_cast(new CoinWarmStartDual())) ; } CoinWarmStart* OsiTestSolverInterface::getWarmStart() const { return new CoinWarmStartDual(getNumRows(), rowprice_); } //----------------------------------------------------------------------------- bool OsiTestSolverInterface::setWarmStart(const CoinWarmStart* warmstart) { const CoinWarmStartDual* ws = dynamic_cast(warmstart); if (! ws) return false; const int ws_size = ws->size(); if (ws_size != getNumRows() && ws_size != 0) { throw CoinError("wrong dual warmstart size", "setWarmStart", "OsiTestSolverInterface"); } CoinDisjointCopyN(ws->dual(), ws_size, rowprice_); return true; } //############################################################################# // HotStart related methods //############################################################################# void OsiTestSolverInterface::markHotStart() { delete[] rowpriceHotStart_; rowpriceHotStart_ = new double[getNumRows()]; CoinDisjointCopyN(rowprice_, getNumRows(), rowpriceHotStart_); } void OsiTestSolverInterface::solveFromHotStart() { int itlimOrig = volprob_.parm.maxsgriters; getIntParam(OsiMaxNumIterationHotStart, volprob_.parm.maxsgriters); CoinDisjointCopyN(rowpriceHotStart_, getNumRows(), rowprice_); resolve(); volprob_.parm.maxsgriters = itlimOrig; } void OsiTestSolverInterface::unmarkHotStart() { delete[] rowpriceHotStart_; rowpriceHotStart_ = NULL; } //############################################################################# // Problem information methods (original data) //############################################################################# bool OsiTestSolverInterface::isContinuous(int colNumber) const { assert( continuous_!=NULL ); if ( continuous_[colNumber] ) return true; return false; } //----------------------------------------------------------------------------- const CoinPackedMatrix * OsiTestSolverInterface::getMatrixByRow() const { updateRowMatrix_(); return &rowMatrix_; } //----------------------------------------------------------------------- const CoinPackedMatrix * OsiTestSolverInterface::getMatrixByCol() const { updateColMatrix_(); return &colMatrix_; } //############################################################################# // Problem information methods (results) //############################################################################# std::vector OsiTestSolverInterface::getDualRays(int /*maxNumRays*/, bool /*fullRay*/) const { // *FIXME* : must write the method -LL throw CoinError("method is not yet written", "getDualRays", "OsiTestSolverInterface"); return std::vector(); } //------------------------------------------------------------------ std::vector OsiTestSolverInterface::getPrimalRays(int /*maxNumRays*/) const { // *FIXME* : must write the method -LL throw CoinError("method is not yet written", "getPrimalRays", "OsiTestSolverInterface"); return std::vector(); } //############################################################################# // Problem modifying methods (rim vectors) //############################################################################# //----------------------------------------------------------------------------- void OsiTestSolverInterface::setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { while (indexFirst < indexLast) { const int ind = *indexFirst; collower_[ind] = boundList[0]; colupper_[ind] = boundList[1]; ++indexFirst; boundList += 2; } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList) { if (indexLast - indexFirst < getNumRows() / 3) { while (indexFirst < indexLast) { setRowBounds(*indexFirst, boundList[0], boundList[1]); ++indexFirst; boundList += 2; } } else { // it's better to convert everything at once while (indexFirst < indexLast) { const int ind = *indexFirst; rowlower_[ind] = boundList[0]; rowupper_[ind] = boundList[1]; ++indexFirst; boundList += 2; } convertBoundsToSenses_(); } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList) { if (indexLast - indexFirst < getNumRows() / 3) { while (indexFirst < indexLast) { setRowType(*indexFirst++, *senseList++, *rhsList++, *rangeList++); } } else { // it's better to convert everything at once while (indexFirst < indexLast) { const int ind = *indexFirst++; rowsense_[ind] = *senseList++; rhs_[ind] = *rhsList++; rowrange_[ind] = *rangeList++; } convertSensesToBounds_(); } } //############################################################################# void OsiTestSolverInterface::setContinuous(int index) { assert(continuous_ != NULL); if (index < 0 || index > getNumCols()) { throw CoinError("Index out of bound.", "setContinuous", "OsiTestSolverInterface"); } continuous_[index] = true; } //----------------------------------------------------------------------- void OsiTestSolverInterface::setInteger(int index) { assert(continuous_ != NULL); if (index < 0 || index > getNumCols()) { throw CoinError("Index out of bound.", "setContinuous", "OsiTestSolverInterface"); } continuous_[index] = false; } //----------------------------------------------------------------------- void OsiTestSolverInterface::setContinuous(const int* indices, int len) { assert(continuous_ != NULL); const int colnum = getNumCols(); int i; for (i = len - 1; i >= 0; --i) { if (indices[i] < 0 || indices[i] > colnum) { throw CoinError("Index out of bound.", "setContinuous", "OsiTestSolverInterface"); } } for (i = len - 1; i >= 0; --i) { continuous_[indices[i]] = true; } } //----------------------------------------------------------------------- void OsiTestSolverInterface::setInteger(const int* indices, int len) { assert(continuous_ != NULL); const int colnum = getNumCols(); int i; for (i = len - 1; i >= 0; --i) { if (indices[i] < 0 || indices[i] > colnum) { throw CoinError("Index out of bound.", "setContinuous", "OsiTestSolverInterface"); } } for (i = len - 1; i >= 0; --i) { continuous_[indices[i]] = false; } } //############################################################################# void OsiTestSolverInterface::setColSolution(const double *colsol) { CoinDisjointCopyN(colsol, getNumCols(), colsol_); // Compute the left hand side (row activity levels) if (isZeroOneMinusOne_) { colMatrixOneMinusOne_->timesMajor(colsol_, lhs_); } else { colMatrix_.times(colsol_, lhs_); } } //----------------------------------------------------------------------- void OsiTestSolverInterface::setRowPrice(const double *rowprice) { CoinDisjointCopyN(rowprice, getNumRows(), rowprice_); compute_rc_(rowprice_, rc_); } //############################################################################# // Problem modifying methods (matrix) //############################################################################# void OsiTestSolverInterface::addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj) { const int colnum = getNumCols(); colRimResize_(colnum + 1); collower_[colnum] = collb; colupper_[colnum] = colub; objcoeffs_[colnum] = obj; continuous_[colnum] = true; colsol_[colnum] = fabs(collb) 0) { const int colnum = getNumCols(); colRimResize_(colnum + numcols); CoinDisjointCopyN(collb, numcols, collower_ + colnum); CoinDisjointCopyN(colub, numcols, colupper_ + colnum); CoinDisjointCopyN(obj, numcols, objcoeffs_ + colnum); CoinFillN(continuous_ + colnum, numcols, true); int c; for ( c=0; c 0) { int * delPos = new int[num]; CoinDisjointCopyN(columnIndices, num, delPos); std::sort(delPos, delPos + num); const int delNum = static_cast(std::unique(delPos, delPos + num) - delPos); const int colnum = getNumCols(); CoinDeleteEntriesFromArray(collower_, collower_ + colnum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(colupper_, colupper_ + colnum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(objcoeffs_, objcoeffs_ + colnum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(continuous_, continuous_ + colnum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(colsol_, colsol_ + colnum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(rc_, rc_ + colnum, delPos, delPos + delNum); updateColMatrix_(); colMatrix_.deleteCols(delNum, delPos); rowMatrixCurrent_ = false; } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub) { const int rownum = getNumRows(); rowRimResize_(rownum + 1); rowlower_[rownum] = rowlb; rowupper_[rownum] = rowub; convertBoundToSense(rowlb, rowub, rowsense_[rownum], rhs_[rownum], rowrange_[rownum]); rowprice_[rownum] = 0.0; lhs_[rownum] = 0.0; updateRowMatrix_(); rowMatrix_.appendRow(vec); colMatrixCurrent_ = false; } //----------------------------------------------------------------------------- void OsiTestSolverInterface::addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng) { const int rownum = getNumRows(); rowRimResize_(rownum + 1); rowsense_[rownum] = rowsen; rhs_[rownum] = rowrhs; rowrange_[rownum] = rowrng; convertSenseToBound(rowsen, rowrhs, rowrng, rowlower_[rownum], rowupper_[rownum]); rowprice_[rownum] = 0.0; lhs_[rownum] = 0.0; updateRowMatrix_(); rowMatrix_.appendRow(vec); colMatrixCurrent_ = false; } //----------------------------------------------------------------------------- void OsiTestSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub) { if (numrows > 0) { const int rownum = getNumRows(); rowRimResize_(rownum + numrows); CoinDisjointCopyN(rowlb, numrows, rowlower_ + rownum); CoinDisjointCopyN(rowub, numrows, rowupper_ + rownum); for (int i = rownum + numrows - 1; i >= rownum; --i) { convertBoundToSense(rowlower_[i], rowupper_[i], rowsense_[i], rhs_[i], rowrange_[i]); } CoinFillN(rowprice_ + rownum, numrows, 0.0); CoinFillN(lhs_ + rownum, numrows, 0.0); updateRowMatrix_(); rowMatrix_.appendRows(numrows, rows); colMatrixCurrent_ = false; } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng) { if (numrows > 0) { const int rownum = getNumRows(); rowRimResize_(rownum + numrows); CoinDisjointCopyN(rowsen, numrows, rowsense_ + rownum); CoinDisjointCopyN(rowrhs, numrows, rhs_ + rownum); CoinDisjointCopyN(rowrng, numrows, rowrange_ + rownum); for (int i = rownum + numrows - 1; i >= rownum; --i) { convertSenseToBound(rowsense_[i], rhs_[i], rowrange_[i], rowlower_[i], rowupper_[i]); } CoinFillN(rowprice_ + rownum, numrows, 0.0); CoinFillN(lhs_ + rownum, numrows, 0.0); updateRowMatrix_(); rowMatrix_.appendRows(numrows, rows); colMatrixCurrent_ = false; } } //----------------------------------------------------------------------------- void OsiTestSolverInterface::deleteRows(const int num, const int * rowIndices) { if (num > 0) { int * delPos = new int[num]; CoinDisjointCopyN(rowIndices, num, delPos); std::sort(delPos, delPos + num); const int delNum = static_cast(std::unique(delPos, delPos + num) - delPos); const int rownum = getNumRows(); CoinDeleteEntriesFromArray(rowlower_, rowlower_ + rownum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(rowupper_, rowupper_ + rownum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(rowsense_, rowsense_ + rownum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(rowrange_, rowrange_ + rownum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(rhs_, rhs_ + rownum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(rowprice_, rowprice_ + rownum, delPos, delPos + delNum); CoinDeleteEntriesFromArray(lhs_, lhs_ + rownum, delPos, delPos + delNum); updateRowMatrix_(); rowMatrix_.deleteRows(delNum, delPos); colMatrixCurrent_ = false; delete[] delPos; } } //############################################################################# // Constructors, destructors clone and assignment //############################################################################# OsiTestSolverInterface::OsiTestSolverInterface () : rowMatrixCurrent_(true), rowMatrix_(), colMatrixCurrent_(true), colMatrix_(), isZeroOneMinusOne_(false), colupper_(0), collower_(0), continuous_(0), rowupper_(0), rowlower_(0), rowsense_(0), rhs_(0), rowrange_(0), objcoeffs_(0), objsense_(1.0), colsol_(0), rowprice_(0), rc_(0), lhs_(0), lagrangeanCost_(0.0), rowpriceHotStart_(0), maxNumrows_(0), maxNumcols_(0), volprob_() { volprob_.parm.granularity = 0.0; } //----------------------------------------------------------------------- OsiSolverInterface * OsiTestSolverInterface::clone(bool copyData) const { return copyData ? new OsiTestSolverInterface(*this) : new OsiTestSolverInterface(); } //----------------------------------------------------------------------- OsiTestSolverInterface::OsiTestSolverInterface(const OsiTestSolverInterface& x) : OsiSolverInterface(x), rowMatrixCurrent_(true), rowMatrix_(), colMatrixCurrent_(true), colMatrix_(), isZeroOneMinusOne_(false), colupper_(0), collower_(0), continuous_(0), rowupper_(0), rowlower_(0), rowsense_(0), rhs_(0), rowrange_(0), objcoeffs_(0), objsense_(1.0), colsol_(0), rowprice_(0), rc_(0), lhs_(0), lagrangeanCost_(0.0), rowpriceHotStart_(0), maxNumrows_(0), maxNumcols_(0), volprob_() { operator=(x); volprob_.parm.granularity = 0.0; } //----------------------------------------------------------------------- OsiTestSolverInterface& OsiTestSolverInterface::operator=(const OsiTestSolverInterface& rhs) { if (&rhs == this) return *this; OsiSolverInterface::operator=(rhs); gutsOfDestructor_(); rowMatrixCurrent_ = rhs.rowMatrixCurrent_; if (rowMatrixCurrent_) rowMatrix_ = rhs.rowMatrix_; colMatrixCurrent_ = rhs.colMatrixCurrent_; if (colMatrixCurrent_) colMatrix_ = rhs.colMatrix_; if (rhs.maxNumrows_) { maxNumrows_ = rhs.maxNumrows_; rowRimAllocator_(); const int rownum = getNumRows(); CoinDisjointCopyN(rhs.rowupper_, rownum, rowupper_); CoinDisjointCopyN(rhs.rowlower_, rownum, rowlower_); CoinDisjointCopyN(rhs.rowsense_, rownum, rowsense_); CoinDisjointCopyN(rhs.rhs_, rownum, rhs_); CoinDisjointCopyN(rhs.rowrange_, rownum, rowrange_); CoinDisjointCopyN(rhs.rowprice_, rownum, rowprice_); CoinDisjointCopyN(rhs.lhs_, rownum, lhs_); } if (rhs.maxNumcols_) { maxNumcols_ = rhs.maxNumcols_; colRimAllocator_(); const int colnum = getNumCols(); CoinDisjointCopyN(rhs.colupper_, colnum, colupper_); CoinDisjointCopyN(rhs.collower_, colnum, collower_); CoinDisjointCopyN(rhs.continuous_, colnum, continuous_); CoinDisjointCopyN(rhs.objcoeffs_, colnum, objcoeffs_); CoinDisjointCopyN(rhs.colsol_, colnum, colsol_); CoinDisjointCopyN(rhs.rc_, colnum, rc_); } volprob_.parm.granularity = 0.0; return *this; } //----------------------------------------------------------------------- OsiTestSolverInterface::~OsiTestSolverInterface () { gutsOfDestructor_(); } //############################################################################# // Applying cuts //############################################################################# void OsiTestSolverInterface::applyRowCut(const OsiRowCut& rc) { const int rownum = getNumRows(); const double lb = rc.lb(); const double ub = rc.ub(); rowRimResize_(rownum + 1); rowprice_[rownum] = 0.0; rowlower_[rownum] = lb; rowupper_[rownum] = ub; convertBoundToSense(lb, ub, rowsense_[rownum], rhs_[rownum], rowrange_[rownum]); updateRowMatrix_(); rowMatrix_.appendRow(rc.row()); colMatrixCurrent_ = false; } //----------------------------------------------------------------------- void OsiTestSolverInterface::applyColCut(const OsiColCut& cc) { int i; const double* lb_elem = cc.lbs().getElements(); const int* lb_ind = cc.lbs().getIndices(); for (i = cc.lbs().getNumElements() - 1; i >= 0; --i) { collower_[lb_ind[i]] = CoinMax(collower_[lb_ind[i]], lb_elem[i]); } const double* ub_elem = cc.ubs().getElements(); const int* ub_ind = cc.ubs().getIndices(); for (i = cc.ubs().getNumElements() - 1; i >= 0; --i) { colupper_[ub_ind[i]] = CoinMin(colupper_[ub_ind[i]], ub_elem[i]); } } //############################################################################# Osi-0.106.4/test/OsiTestSolverInterface.hpp0000644000076600007660000010172111575423733017204 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This file is licensed under the terms of Eclipse Public License (EPL). // this is a copy of OsiVolSolverInterface (trunk rev. 1466) renamed to OsiTestSolverInterface #ifndef OsiTestSolverInterface_H #define OsiTestSolverInterface_H #include #include "OsiTestSolver.hpp" #include "CoinPackedMatrix.hpp" #include "OsiSolverInterface.hpp" static const double OsiTestInfinity = 1.0e31; //############################################################################# /** Vol(ume) Solver Interface Instantiation of OsiTestSolverInterface for the Volume Algorithm */ class OsiTestSolverInterface : virtual public OsiSolverInterface, public VOL_user_hooks { friend void OsiTestSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); private: class OsiVolMatrixOneMinusOne_ { int majorDim_; int minorDim_; int plusSize_; int * plusInd_; int * plusStart_; int * plusLength_; int minusSize_; int * minusInd_; int * minusStart_; int * minusLength_; public: OsiVolMatrixOneMinusOne_(const CoinPackedMatrix& m); ~OsiVolMatrixOneMinusOne_(); void timesMajor(const double* x, double* y) const; }; public: //--------------------------------------------------------------------------- /**@name Solve methods */ //@{ /// Solve initial LP relaxation virtual void initialSolve(); /// Resolve an LP relaxation after problem modification virtual void resolve(); /// Invoke solver's built-in enumeration algorithm virtual void branchAndBound() { throw CoinError("Sorry, the Volume Algorithm doesn't implement B&B", "branchAndBound", "OsiTestSolverInterface"); } //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. */ //@{ // Set an integer parameter bool setIntParam(OsiIntParam key, int value); // Set an double parameter bool setDblParam(OsiDblParam key, double value); // Set a string parameter bool setStrParam(OsiStrParam key, const std::string & value); // Get an integer parameter bool getIntParam(OsiIntParam key, int& value) const; // Get an double parameter bool getDblParam(OsiDblParam key, double& value) const; // Get a string parameter bool getStrParam(OsiStrParam key, std::string& value) const; //@} //--------------------------------------------------------------------------- ///@name Methods returning info on how the solution process terminated //@{ /// Are there a numerical difficulties? virtual bool isAbandoned() const; /// Is optimality proven? virtual bool isProvenOptimal() const; /// Is primal infeasiblity proven? virtual bool isProvenPrimalInfeasible() const; /// Is dual infeasiblity proven? virtual bool isProvenDualInfeasible() const; /// Is the given primal objective limit reached? virtual bool isPrimalObjectiveLimitReached() const; /// Is the given dual objective limit reached? virtual bool isDualObjectiveLimitReached() const; /// Iteration limit reached? virtual bool isIterationLimitReached() const; //@} //--------------------------------------------------------------------------- /**@name WarmStart related methods */ //@{ /*! \brief Get an empty warm start object This routine returns an empty warm start object. Its purpose is to provide a way to give a client a warm start object of the appropriate type, which can resized and modified as desired. */ virtual CoinWarmStart *getEmptyWarmStart () const ; /// Get warmstarting information virtual CoinWarmStart* getWarmStart() const; /** Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. */ virtual bool setWarmStart(const CoinWarmStart* warmstart); //@} //--------------------------------------------------------------------------- /**@name Hotstart related methods (primarily used in strong branching).
    The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there.
    NOTE: between hotstarted optimizations only bound changes are allowed. */ //@{ /// Create a hotstart point of the optimization process virtual void markHotStart(); /// Optimize starting from the hotstart virtual void solveFromHotStart(); /// Delete the snapshot virtual void unmarkHotStart(); //@} //--------------------------------------------------------------------------- /**@name Problem information methods These methods call the solver's query routines to return information about the problem referred to by the current object. Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors. Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called. */ //@{ /**@name Methods related to querying the input data */ //@{ /// Get number of columns virtual int getNumCols() const { return rowMatrixCurrent_? rowMatrix_.getNumCols() : colMatrix_.getNumCols(); } /// Get number of rows virtual int getNumRows() const { return rowMatrixCurrent_? rowMatrix_.getNumRows() : colMatrix_.getNumRows(); } /// Get number of nonzero elements virtual int getNumElements() const { return rowMatrixCurrent_? rowMatrix_.getNumElements() : colMatrix_.getNumElements(); } /// Get pointer to array[getNumCols()] of column lower bounds virtual const double * getColLower() const { return collower_; } /// Get pointer to array[getNumCols()] of column upper bounds virtual const double * getColUpper() const { return colupper_; } /** Get pointer to array[getNumRows()] of row constraint senses.
    • 'L' <= constraint
    • 'E' = constraint
    • 'G' >= constraint
    • 'R' ranged constraint
    • 'N' free constraint
    */ virtual const char * getRowSense() const { return rowsense_; } /** Get pointer to array[getNumRows()] of rows right-hand sides
    • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
    • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
    • if rowsense()[i] == 'N' then rhs()[i] == 0.0
    */ virtual const double * getRightHandSide() const { return rhs_; } /** Get pointer to array[getNumRows()] of row ranges.
    • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
    • if rowsense()[i] != 'R' then rowrange()[i] is undefined
    */ virtual const double * getRowRange() const { return rowrange_; } /// Get pointer to array[getNumRows()] of row lower bounds virtual const double * getRowLower() const { return rowlower_; } /// Get pointer to array[getNumRows()] of row upper bounds virtual const double * getRowUpper() const { return rowupper_; } /// Get pointer to array[getNumCols()] of objective function coefficients virtual const double * getObjCoefficients() const { return objcoeffs_; } /// Get objective function sense (1 for min (default), -1 for max) virtual double getObjSense() const { return objsense_; } /// Return true if column is continuous virtual bool isContinuous(int colNumber) const; #if 0 /// Return true if column is binary virtual bool isBinary(int colNumber) const; /** Return true if column is integer. Note: This function returns true if the the column is binary or a general integer. */ virtual bool isInteger(int colNumber) const; /// Return true if column is general integer virtual bool isIntegerNonBinary(int colNumber) const; /// Return true if column is binary and not fixed at either bound virtual bool isFreeBinary(int colNumber) const; #endif /// Get pointer to row-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByRow() const; /// Get pointer to column-wise copy of matrix virtual const CoinPackedMatrix * getMatrixByCol() const; /// Get solver's value for infinity virtual double getInfinity() const { return OsiTestInfinity; } //@} /**@name Methods related to querying the solution */ //@{ /// Get pointer to array[getNumCols()] of primal solution vector virtual const double * getColSolution() const { return colsol_; } /// Get pointer to array[getNumRows()] of dual prices virtual const double * getRowPrice() const { return rowprice_; } /// Get a pointer to array[getNumCols()] of reduced costs virtual const double * getReducedCost() const { return rc_; } /** Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector */ virtual const double * getRowActivity() const { return lhs_; } /// Get objective function value virtual double getObjValue() const { #if 1 // This does not pass unitTest if getObjValue is called before solve return lagrangeanCost_; #else return OsiSolverInterface::getObjValue(); #endif } /** Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. */ virtual int getIterationCount() const { return volprob_.iter(); } /** Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.) The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If \c fullRay is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception. NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getDualRays(int maxNumRays, bool fullRay = false) const; /** Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.) NOTE for implementers of solver interfaces:
    The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].
    NOTE for users of solver interfaces:
    It is the user's responsibility to free the double pointers in the vector using delete[]. */ virtual std::vector getPrimalRays(int maxNumRays) const; #if 0 /** Get indices of solution vector which are integer variables presently at fractional values */ virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const; #endif //@} //@} //--------------------------------------------------------------------------- /**@name Problem modifying methods */ //@{ //------------------------------------------------------------------------- /**@name Changing bounds on variables and constraints */ //@{ /** Set an objective function coefficient */ virtual void setObjCoeff( int elementIndex, double elementValue ) { objcoeffs_[elementIndex] = elementValue; } using OsiSolverInterface::setColLower ; /** Set a single column lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setColLower( int elementIndex, double elementValue ) { collower_[elementIndex] = elementValue; } using OsiSolverInterface::setColUpper ; /** Set a single column upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setColUpper( int elementIndex, double elementValue ) { colupper_[elementIndex] = elementValue; } /** Set a single column lower and upper bound */ virtual void setColBounds( int elementIndex, double lower, double upper ) { collower_[elementIndex] = lower; colupper_[elementIndex] = upper; } /** Set the bounds on a number of columns simultaneously
    The default implementation just invokes setColLower() and setColUpper() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes @param boundList the new lower/upper bound pairs for the variables */ virtual void setColSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set a single row lower bound
    Use -COIN_DBL_MAX for -infinity. */ virtual void setRowLower( int elementIndex, double elementValue ) { rowlower_[elementIndex] = elementValue; convertBoundToSense(elementValue, rowupper_[elementIndex], rowsense_[elementIndex], rhs_[elementIndex], rowrange_[elementIndex]); } /** Set a single row upper bound
    Use COIN_DBL_MAX for infinity. */ virtual void setRowUpper( int elementIndex, double elementValue ) { rowupper_[elementIndex] = elementValue; convertBoundToSense(rowlower_[elementIndex], elementValue, rowsense_[elementIndex], rhs_[elementIndex], rowrange_[elementIndex]); } /** Set a single row lower and upper bound */ virtual void setRowBounds( int elementIndex, double lower, double upper ) { rowlower_[elementIndex] = lower; rowupper_[elementIndex] = upper; convertBoundToSense(lower, upper, rowsense_[elementIndex], rhs_[elementIndex], rowrange_[elementIndex]); } /** Set the type of a single row
    */ virtual void setRowType(int index, char sense, double rightHandSide, double range) { rowsense_[index] = sense; rhs_[index] = rightHandSide; rowrange_[index] = range; convertSenseToBound(sense, rightHandSide, range, rowlower_[index], rowupper_[index]); } /** Set the bounds on a number of rows simultaneously
    The default implementation just invokes setRowLower() and setRowUpper() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the constraints whose either bound changes @param boundList the new lower/upper bound pairs for the constraints */ virtual void setRowSetBounds(const int* indexFirst, const int* indexLast, const double* boundList); /** Set the type of a number of rows simultaneously
    The default implementation just invokes setRowType() over and over again. @param indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the constraints whose any characteristics changes @param senseList the new senses @param rhsList the new right hand sides @param rangeList the new ranges */ virtual void setRowSetTypes(const int* indexFirst, const int* indexLast, const char* senseList, const double* rhsList, const double* rangeList); //@} //------------------------------------------------------------------------- /**@name Integrality related changing methods */ //@{ /** Set the index-th variable to be a continuous variable */ virtual void setContinuous(int index); /** Set the index-th variable to be an integer variable */ virtual void setInteger(int index); /** Set the variables listed in indices (which is of length len) to be continuous variables */ virtual void setContinuous(const int* indices, int len); /** Set the variables listed in indices (which is of length len) to be integer variables */ virtual void setInteger(const int* indices, int len); //@} //------------------------------------------------------------------------- /// Set objective function sense (1 for min (default), -1 for max,) virtual void setObjSense(double s ) { objsense_ = s < 0 ? -1.0 : 1.0; } /** Set the primal solution column values colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setColSolution(const double * colsol); /** Set dual solution vector rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. */ virtual void setRowPrice(const double * rowprice); //------------------------------------------------------------------------- /**@name Methods to expand a problem.
    Note that if a column is added then by default it will correspond to a continuous variable. */ //@{ using OsiSolverInterface::addCol ; /** */ virtual void addCol(const CoinPackedVectorBase& vec, const double collb, const double colub, const double obj); using OsiSolverInterface::addCols ; /** */ virtual void addCols(const int numcols, const CoinPackedVectorBase * const * cols, const double* collb, const double* colub, const double* obj); #if 0 /** */ virtual void addCols(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj); #endif /** */ virtual void deleteCols(const int num, const int * colIndices); using OsiSolverInterface::addRow ; /** */ virtual void addRow(const CoinPackedVectorBase& vec, const double rowlb, const double rowub); /** */ virtual void addRow(const CoinPackedVectorBase& vec, const char rowsen, const double rowrhs, const double rowrng); using OsiSolverInterface::addRows ; /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const double* rowlb, const double* rowub); /** */ virtual void addRows(const int numrows, const CoinPackedVectorBase * const * rows, const char* rowsen, const double* rowrhs, const double* rowrng); #if 0 /** */ virtual void addRows(const CoinPackedMatrix& matrix, const double* rowlb, const double* rowub); /** */ virtual void addRows(const CoinPackedMatrix& matrix, const char* rowsen, const double* rowrhs, const double* rowrng); #endif /** */ virtual void deleteRows(const int num, const int * rowIndices); //----------------------------------------------------------------------- #if 0 /** Apply a collection of cuts.
    Only cuts which have an effectiveness >= effectivenessLb are applied.
    • ReturnCode.numberIneffective() -- number of cuts which were not applied because they had an effectiveness < effectivenessLb
    • ReturnCode.numberInconsistent() -- number of invalid cuts
    • ReturnCode.numberInconsistentWrtIntegerModel() -- number of cuts that are invalid with respect to this integer model
    • ReturnCode.numberInfeasible() -- number of cuts that would make this integer model infeasible
    • ReturnCode.numberApplied() -- number of integer cuts which were applied to the integer model
    • cs.size() == numberIneffective() + numberInconsistent() + numberInconsistentWrtIntegerModel() + numberInfeasible() + nubmerApplied()
    */ virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs, double effectivenessLb = 0.0); #endif //@} //@} //--------------------------------------------------------------------------- protected: /**@name Helper methods for problem input */ void initFromRlbRub(const int rownum, const double* rowlb, const double* rowub); void initFromRhsSenseRange(const int rownum, const char* rowsen, const double* rowrhs, const double* rowrng); void initFromClbCubObj(const int colnum, const double* collb, const double* colub, const double* obj); public: /**@name Methods to input a problem */ //@{ /** Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • rowub: all rows have upper bound infinity
    • rowlb: all rows have lower bound -infinity
    • obj: all variables have 0 objective coefficient
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, double*& rowlb, double*& rowub); /** Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
    • colub: all columns have upper bound infinity
    • collb: all columns have lower bound 0
    • obj: all variables have 0 objective coefficient
    • rowsen: all rows are >=
    • rowrhs: all right hand sides are 0
    • rowrng: 0 for the ranged rows
    */ virtual void loadProblem(const CoinPackedMatrix& matrix, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); /** Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). For default values see the previous method.
    WARNING: The arguments passed to this method will be freed using the C++ delete and delete[] functions. */ virtual void assignProblem(CoinPackedMatrix*& matrix, double*& collb, double*& colub, double*& obj, char*& rowsen, double*& rowrhs, double*& rowrng); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const double* rowlb, const double* rowub); /** Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). */ virtual void loadProblem(const int numcols, const int numrows, const int* start, const int* index, const double* value, const double* collb, const double* colub, const double* obj, const char* rowsen, const double* rowrhs, const double* rowrng); using OsiSolverInterface::readMps ; /** Read an mps file from the given filename */ virtual int readMps(const char *filename, const char *extension = "mps"); /** Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants */ virtual void writeMps(const char *filename, const char *extension = "mps", double objSense=0.0) const; //@} //--------------------------------------------------------------------------- /**@name OSL specific public interfaces */ //@{ /// Get pointer to Vol model VOL_problem* volprob() { return &volprob_; } //@} //--------------------------------------------------------------------------- /**@name Constructors and destructors */ //@{ /// Default Constructor OsiTestSolverInterface (); /// Clone virtual OsiSolverInterface * clone(bool copyData = true) const; /// Copy constructor OsiTestSolverInterface (const OsiTestSolverInterface &); /// Assignment operator OsiTestSolverInterface & operator=(const OsiTestSolverInterface& rhs); /// Destructor virtual ~OsiTestSolverInterface (); //@} //--------------------------------------------------------------------------- protected: ///@name Protected methods //@{ /** Apply a row cut (append to constraint matrix). */ virtual void applyRowCut(const OsiRowCut& rc); /** Apply a column cut (adjust one or more bounds). */ virtual void applyColCut(const OsiColCut& cc); //@} //--------------------------------------------------------------------------- private: /**@name Methods of VOL_user_hooks */ //@{ /// compute reduced costs virtual int compute_rc(const VOL_dvector& u, VOL_dvector& rc); /// Solve the subproblem for the subgradient step. virtual int solve_subproblem(const VOL_dvector& dual, const VOL_dvector& rc, double& lcost, VOL_dvector& x, VOL_dvector& v, double& pcost); /** Starting from the primal vector x, run a heuristic to produce an integer solution. This is not done in LP solving. */ virtual int heuristics(const VOL_problem& /*p*/, const VOL_dvector& /*x*/, double& heur_val) { heur_val = COIN_DBL_MAX; return 0; } //@} //--------------------------------------------------------------------------- private: /**@name Private helper methods */ //@{ /** Update the row ordered matrix from the column ordered one */ void updateRowMatrix_() const; /** Update the column ordered matrix from the row ordered one */ void updateColMatrix_() const; /** Test whether the Volume Algorithm can be applied to the given problem. */ void checkData_() const; /** Compute the reduced costs (rc) with respect to the dual values given in u. */ void compute_rc_(const double* u, double* rc) const; /** A method deleting every member data */ void gutsOfDestructor_(); /** A method allocating sufficient space for the rim vectors corresponding to the rows. */ void rowRimAllocator_(); /** A method allocating sufficient space for the rim vectors corresponding to the columns. */ void colRimAllocator_(); /** Reallocate the rim arrays corresponding to the rows. */ void rowRimResize_(const int newSize); /** Reallocate the rim arrays corresponding to the columns. */ void colRimResize_(const int newSize); /** For each row convert LB/UB style row constraints to sense/rhs style. */ void convertBoundsToSenses_(); /** For each row convert sense/rhs style row constraints to LB/UB style. */ void convertSensesToBounds_(); /** test whether the given matrix is 0/1/-1 entries only. */ bool test_zero_one_minusone_(const CoinPackedMatrix& m) const; //@} //--------------------------------------------------------------------------- private: //--------------------------------------------------------------------------- /**@name The problem matrix in row and column ordered forms
    Note that at least one of the matrices is always current. */ //@{ /// A flag indicating whether the row ordered matrix is up-to-date mutable bool rowMatrixCurrent_; /// The problem matrix in a row ordered form mutable CoinPackedMatrix rowMatrix_; /// A flag indicating whether the column ordered matrix is up-to-date mutable bool colMatrixCurrent_; /// The problem matrix in a column ordered form mutable CoinPackedMatrix colMatrix_; //@} //--------------------------------------------------------------------------- /**@name Data members used when 0/1/-1 matrix is detected */ //@{ /// An indicator whether the matrix is 0/1/-1 bool isZeroOneMinusOne_; /// The row ordered matrix without the elements OsiVolMatrixOneMinusOne_* rowMatrixOneMinusOne_; /// The column ordered matrix without the elements OsiVolMatrixOneMinusOne_* colMatrixOneMinusOne_; //@} //--------------------------------------------------------------------------- /**@name The rim vectors */ //@{ /// Pointer to dense vector of structural variable upper bounds double *colupper_; /// Pointer to dense vector of structural variable lower bounds double *collower_; /// Pointer to dense vector of bool to indicate if column is continuous bool *continuous_; /// Pointer to dense vector of slack variable upper bounds double *rowupper_; /// Pointer to dense vector of slack variable lower bounds double *rowlower_; /// Pointer to dense vector of row sense indicators char *rowsense_; /// Pointer to dense vector of row right-hand side values double *rhs_; /** Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows). */ double *rowrange_; /// Pointer to dense vector of objective coefficients double *objcoeffs_; //@} //--------------------------------------------------------------------------- /// Sense of objective (1 for min; -1 for max) double objsense_; //--------------------------------------------------------------------------- /**@name The solution */ //@{ /// Pointer to dense vector of primal structural variable values double *colsol_; /// Pointer to dense vector of dual row variable values double *rowprice_; /// Pointer to dense vector of reduced costs double *rc_; /// Pointer to dense vector of left hand sides (row activity levels) double *lhs_; /// The Lagrangean cost, a lower bound on the objective value double lagrangeanCost_; //@} //--------------------------------------------------------------------------- /** An array to store the hotstart information between solveHotStart() calls */ double *rowpriceHotStart_; /// allocated size of the row related rim vectors int maxNumrows_; /// allocated size of the column related rim vectors int maxNumcols_; /// The volume solver VOL_problem volprob_; }; /** A function that tests the methods in the OsiTestSolverInterface class. */ void OsiTestSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir); #endif Osi-0.106.4/test/OsiGrbSolverInterfaceTest.cpp0000644000076600007660000007440412101340333017615 0ustar coincoin//----------------------------------------------------------------------------- // name: OSI Interface for GUROBI // template: OSI Cplex Interface written by T. Achterberg // author: Stefan Vigerske // Humboldt University Berlin // license: this file may be freely distributed under the terms of EPL // comments: please scan this file for '???' and 'TODO' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2009 Humboldt University Berlin and others. // Corporation and others. All Rights Reserved. #include "CoinPragma.hpp" #include "OsiConfig.h" //#include //#include #include "OsiUnitTests.hpp" #include "OsiGrbSolverInterface.hpp" #include "OsiCuts.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "CoinPackedMatrix.hpp" // Added so build windows build with dsp files works, // when not building with gurobi. #ifdef COIN_HAS_GRB #include "gurobi_c.h" //-------------------------------------------------------------------------- void OsiGrbSolverInterfaceUnitTest( const std::string & mpsDir, const std::string & netlibDir ) { // Test default constructor { OsiGrbSolverInterface m; OSIUNITTEST_ASSERT_ERROR(m.obj_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.collower_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colupper_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.coltype_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colspace_ == 0, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsense_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rhs_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowrange_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowlower_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowupper_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.colsol_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.rowsol_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByRow_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.matrixByCol_ == NULL, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 0, {}, "gurobi", "default constructor"); OSIUNITTEST_ASSERT_ERROR(m.getApplicationData() == NULL, {}, "gurobi", "default constructor"); int i=2346; m.setApplicationData(&i); OSIUNITTEST_ASSERT_ERROR(*((int *)(m.getApplicationData())) == i, {}, "gurobi", "default constructor"); } { CoinRelFltEq eq; OsiGrbSolverInterface m; std::string fn = mpsDir+"exmip1"; m.readMps(fn.c_str(),"mps"); { OSIUNITTEST_ASSERT_ERROR(m.getNumCols() == 8, {}, "gurobi", "exmip1 read"); const CoinPackedMatrix * colCopy = m.getMatrixByCol(); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumCols() == 8, {}, "gurobi", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMajorDim() == 8, {}, "gurobi", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getNumRows() == 5, {}, "gurobi", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getMinorDim() == 5, {}, "gurobi", "exmip1 matrix"); OSIUNITTEST_ASSERT_ERROR(colCopy->getVectorLengths()[7] == 2, {}, "gurobi", "exmip1 matrix"); CoinPackedMatrix revColCopy; revColCopy.reverseOrderedCopyOf(*colCopy); CoinPackedMatrix rev2ColCopy; rev2ColCopy.reverseOrderedCopyOf(revColCopy); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumCols() == 8, {}, "gurobi", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMajorDim() == 8, {}, "gurobi", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getNumRows() == 5, {}, "gurobi", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getMinorDim() == 5, {}, "gurobi", "twice reverse matrix copy"); OSIUNITTEST_ASSERT_ERROR(rev2ColCopy.getVectorLengths()[7] == 2, {}, "gurobi", "twice reverse matrix copy"); } // Test copy constructor and assignment operator { OsiGrbSolverInterface lhs; { OsiGrbSolverInterface im(m); OsiGrbSolverInterface imC1(im); OSIUNITTEST_ASSERT_ERROR(imC1.lp_ != im.lp_, {}, "gurobi", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumCols() == im.getNumCols(), {}, "gurobi", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.getNumRows() == im.getNumRows(), {}, "gurobi", "copy constructor"); OsiGrbSolverInterface imC2(im); OSIUNITTEST_ASSERT_ERROR(imC2.lp_ != im.lp_, {}, "gurobi", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumCols() == im.getNumCols(), {}, "gurobi", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC2.getNumRows() == im.getNumRows(), {}, "gurobi", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(imC1.lp_ != imC2.lp_, {}, "gurobi", "copy constructor"); lhs = imC2; } // Test that lhs has correct values even though rhs has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.lp_ != m.lp_, {}, "gurobi", "assignment operator"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumCols() == m.getNumCols(), {}, "gurobi", "copy constructor"); OSIUNITTEST_ASSERT_ERROR(lhs.getNumRows() == m.getNumRows(), {}, "gurobi", "copy constructor"); } // Test clone { OsiGrbSolverInterface gurobiSi(m); OsiSolverInterface * siPtr = &gurobiSi; OsiSolverInterface * siClone = siPtr->clone(); OsiGrbSolverInterface * gurobiClone = dynamic_cast(siClone); OSIUNITTEST_ASSERT_ERROR(gurobiClone != NULL, {}, "gurobi", "clone"); OSIUNITTEST_ASSERT_ERROR(gurobiClone->lp_ != gurobiSi.lp_, {}, "gurobi", "clone"); OSIUNITTEST_ASSERT_ERROR(gurobiClone->getNumRows() == gurobiSi.getNumRows(), {}, "gurobi", "clone"); OSIUNITTEST_ASSERT_ERROR(gurobiClone->getNumCols() == m.getNumCols(), {}, "gurobi", "clone"); delete siClone; } // test infinity { OsiGrbSolverInterface si; OSIUNITTEST_ASSERT_ERROR(si.getInfinity() == GRB_INFINITY, {}, "gurobi", "value for infinity"); } { OsiGrbSolverInterface gurobiSi(m); int nc = gurobiSi.getNumCols(); int nr = gurobiSi.getNumRows(); const double * cl = gurobiSi.getColLower(); const double * cu = gurobiSi.getColUpper(); const double * rl = gurobiSi.getRowLower(); const double * ru = gurobiSi.getRowUpper(); OSIUNITTEST_ASSERT_ERROR(nc == 8, return, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(nr == 5, return, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[1],4.1), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(cu[2],1.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[0],2.5), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(rl[4],3.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[1],2.1), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(ru[4],15.), {}, "gurobi", "read and copy exmip1"); double newCs[8] = {1., 2., 3., 4., 5., 6., 7., 8.}; gurobiSi.setColSolution(newCs); const double * cs = gurobiSi.getColSolution(); OSIUNITTEST_ASSERT_ERROR(eq(cs[0],1.0), {}, "gurobi", "set col solution"); OSIUNITTEST_ASSERT_ERROR(eq(cs[7],8.0), {}, "gurobi", "set col solution"); #if 0 // TODO set and copy of solutions not supported by OsiGrb currently { OsiGrbSolverInterface solnSi(gurobiSi); const double * cs = solnSi.getColSolution(); OSIUNITTEST_ASSERT_ERROR(eq(cs[0],1.0), {}, "gurobi", "set col solution and copy"); OSIUNITTEST_ASSERT_ERROR(eq(cs[7],8.0), {}, "gurobi", "set col solution and copy"); } #endif OSIUNITTEST_ASSERT_ERROR(!eq(cl[3],1.2345), {}, "gurobi", "set col lower"); gurobiSi.setColLower( 3, 1.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cl[3],1.2345), {}, "gurobi", "set col lower"); OSIUNITTEST_ASSERT_ERROR(!eq(cu[4],10.2345), {}, "gurobi", "set col upper"); gurobiSi.setColUpper( 4, 10.2345 ); OSIUNITTEST_ASSERT_ERROR( eq(cu[4],10.2345), {}, "gurobi", "set col upper"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[0], 1.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[1], 0.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[2], 0.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[3], 0.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[4], 2.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[5], 0.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[6], 0.0), {}, "gurobi", "read and copy exmip1"); OSIUNITTEST_ASSERT_ERROR(eq(gurobiSi.getObjCoefficients()[7],-1.0), {}, "gurobi", "read and copy exmip1"); } // Test getMatrixByRow method { const OsiGrbSolverInterface si(m); const CoinPackedMatrix * smP = si.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim() == 5, return, "gurobi", "getMatrixByRow: major dim"); OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "gurobi", "getMatrixByRow: num elements"); CoinRelFltEq eq; const double * ev = smP->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[0], 3.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[1], 1.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[2], -2.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[3], -1.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[4], -1.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[5], 2.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[6], 1.1), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[7], 1.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[8], 1.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[9], 2.8), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10], -1.2), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "gurobi", "getMatrixByRow: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "gurobi", "getMatrixByRow: elements"); const int * mi = smP->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "gurobi", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "gurobi", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "gurobi", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "gurobi", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "gurobi", "getMatrixByRow: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "gurobi", "getMatrixByRow: vector starts"); const int * ei = smP->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "gurobi", "getMatrixByRow: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "gurobi", "getMatrixByRow: indices"); } //-------------- // Test rowsense, rhs, rowrange, getMatrixByRow { OsiGrbSolverInterface lhs; { OsiGrbSolverInterface siC1(m); OSIUNITTEST_ASSERT_WARNING(siC1.obj_ == NULL, {}, "gurobi", "objective"); OSIUNITTEST_ASSERT_WARNING(siC1.collower_ == NULL, {}, "gurobi", "col lower"); OSIUNITTEST_ASSERT_WARNING(siC1.colupper_ == NULL, {}, "gurobi", "col upper"); OSIUNITTEST_ASSERT_WARNING(siC1.rowrange_ == NULL, {}, "gurobi", "row range"); OSIUNITTEST_ASSERT_WARNING(siC1.rowsense_ == NULL, {}, "gurobi", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1.rowlower_ == NULL, {}, "gurobi", "row lower"); OSIUNITTEST_ASSERT_WARNING(siC1.rowupper_ == NULL, {}, "gurobi", "row upper"); OSIUNITTEST_ASSERT_WARNING(siC1.rhs_ == NULL, {}, "gurobi", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1.matrixByRow_ == NULL, {}, "gurobi", "matrix by row"); //TODO OSIUNITTEST_ASSERT_WARNING(siC1.colsol_ != NULL, {}, "gurobi", "col solution"); //TODO OSIUNITTEST_ASSERT_WARNING(siC1.rowsol_ != NULL, {}, "gurobi", "row solution"); const char * siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "gurobi", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "gurobi", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "gurobi", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "gurobi", "row sense"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "gurobi", "row sense"); const double * siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "gurobi", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "gurobi", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "gurobi", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "gurobi", "right hand side"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "gurobi", "right hand side"); const double * siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "gurobi", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "gurobi", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "gurobi", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "gurobi", "row range"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "gurobi", "row range"); const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "gurobi", "matrix by row"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim() == 5, return, "gurobi", "matrix by row: major dim"); OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "gurobi", "matrix by row: num elements"); const double * ev = siC1mbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "gurobi", "matrix by row: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "gurobi", "matrix by row: elements"); const CoinBigIndex * mi = siC1mbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "gurobi", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "gurobi", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "gurobi", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "gurobi", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "gurobi", "matrix by row: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "gurobi", "matrix by row: vector starts"); const int * ei = siC1mbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "gurobi", "matrix by row: indices"); OSIUNITTEST_ASSERT_WARNING(siC1rs == siC1.getRowSense(), {}, "gurobi", "row sense"); OSIUNITTEST_ASSERT_WARNING(siC1rhs == siC1.getRightHandSide(), {}, "gurobi", "right hand side"); OSIUNITTEST_ASSERT_WARNING(siC1rr == siC1.getRowRange(), {}, "gurobi", "row range"); #if 0 // TODO: free rows not really supported by OsiGrb // Change GUROBI Model by adding free row OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb( COIN_DBL_MAX); OsiCuts cuts; cuts.insert(rc); siC1.applyCuts(cuts); // Since model was changed, test that cached data is now freed. OSIUNITTEST_ASSERT_ERROR(siC1.obj_ == NULL, {}, "gurobi", "objective"); OSIUNITTEST_ASSERT_ERROR(siC1.collower_ == NULL, {}, "gurobi", "col lower"); OSIUNITTEST_ASSERT_ERROR(siC1.colupper_ == NULL, {}, "gurobi", "col upper"); OSIUNITTEST_ASSERT_ERROR(siC1.rowrange_ == NULL, {}, "gurobi", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsense_ == NULL, {}, "gurobi", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowlower_ == NULL, {}, "gurobi", "row lower"); OSIUNITTEST_ASSERT_ERROR(siC1.rowupper_ == NULL, {}, "gurobi", "row upper"); OSIUNITTEST_ASSERT_ERROR(siC1.rhs_ == NULL, {}, "gurobi", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByRow_ == NULL, {}, "gurobi", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.matrixByCol_ == NULL, {}, "gurobi", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.colsol_ == NULL, {}, "gurobi", "free cached data after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1.rowsol_ == NULL, {}, "gurobi", "free cached data after adding row"); siC1rs = siC1.getRowSense(); OSIUNITTEST_ASSERT_ERROR(siC1rs[0] == 'G', {}, "gurobi", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[1] == 'L', {}, "gurobi", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[2] == 'E', {}, "gurobi", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[3] == 'R', {}, "gurobi", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[4] == 'R', {}, "gurobi", "row sense after adding row"); OSIUNITTEST_ASSERT_ERROR(siC1rs[5] == 'N', {}, "gurobi", "row sense after adding row"); siC1rhs = siC1.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[0],2.5), {}, "gurobi", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[1],2.1), {}, "gurobi", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[2],4.0), {}, "gurobi", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[3],5.0), {}, "gurobi", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[4],15.), {}, "gurobi", "right hand side after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rhs[5],0.0), {}, "gurobi", "right hand side after adding row"); siC1rr = siC1.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[0],0.0), {}, "gurobi", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[1],0.0), {}, "gurobi", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[2],0.0), {}, "gurobi", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[3],5.0-1.8), {}, "gurobi", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[4],15.0-3.0), {}, "gurobi", "row range after adding row"); OSIUNITTEST_ASSERT_ERROR(eq(siC1rr[5],0.0), {}, "gurobi", "row range after adding row"); #endif lhs = siC1; } // Test that lhs has correct values even though siC1 has gone out of scope OSIUNITTEST_ASSERT_ERROR(lhs.obj_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.collower_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.colupper_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowrange_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowsense_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowlower_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rowupper_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.rhs_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByRow_ == NULL, {}, "gurobi", "freed origin after assignment"); OSIUNITTEST_ASSERT_ERROR(lhs.matrixByCol_ == NULL, {}, "gurobi", "freed origin after assignment"); //TODO OSIUNITTEST_ASSERT_ERROR(lhs.colsol_ != NULL, {}, "gurobi", "freed origin after assignment"); //TODO OSIUNITTEST_ASSERT_ERROR(lhs.rowsol_ != NULL, {}, "gurobi", "freed origin after assignment"); #if 0 // TODO: free rows not really supported by OsiGrb const char * lhsrs = lhs.getRowSense(); OSIUNITTEST_ASSERT_ERROR(lhsrs[0] == 'G', {}, "gurobi", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[1] == 'L', {}, "gurobi", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[2] == 'E', {}, "gurobi", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[3] == 'R', {}, "gurobi", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[4] == 'R', {}, "gurobi", "row sense after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsrs[5] == 'N', {}, "gurobi", "row sense after assignment"); const double * lhsrhs = lhs.getRightHandSide(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[0],2.5), {}, "gurobi", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[1],2.1), {}, "gurobi", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[2],4.0), {}, "gurobi", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[3],5.0), {}, "gurobi", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[4],15.), {}, "gurobi", "right hand side after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrhs[5],0.0), {}, "gurobi", "right hand side after assignment"); const double *lhsrr = lhs.getRowRange(); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[0],0.0), {}, "gurobi", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[1],0.0), {}, "gurobi", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[2],0.0), {}, "gurobi", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[3],5.0-1.8), {}, "gurobi", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[4],15.0-3.0), {}, "gurobi", "row range after assignment"); OSIUNITTEST_ASSERT_ERROR(eq(lhsrr[5],0.0), {}, "gurobi", "row range after assignment"); const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow(); OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, {}, "gurobi", "matrix by row after assignment"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim() == 6, return, "gurobi", "matrix by row after assignment: major dim"); OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "gurobi", "matrix by row after assignment: num elements"); const double * ev = lhsmbr->getElements(); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 0], 3.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 1], 1.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 2],-2.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 3],-1.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 4],-1.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 5], 2.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 6], 1.1), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 7], 1.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 8], 1.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[ 9], 2.8), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[10],-1.2), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[11], 5.6), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[12], 1.0), {}, "gurobi", "matrix by row after assignment: elements"); OSIUNITTEST_ASSERT_ERROR(eq(ev[13], 1.9), {}, "gurobi", "matrix by row after assignment: elements"); const CoinBigIndex * mi = lhsmbr->getVectorStarts(); OSIUNITTEST_ASSERT_ERROR(mi[0] == 0, {}, "gurobi", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[1] == 5, {}, "gurobi", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[2] == 7, {}, "gurobi", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[3] == 9, {}, "gurobi", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[4] == 11, {}, "gurobi", "matrix by row after assignment: vector starts"); OSIUNITTEST_ASSERT_ERROR(mi[5] == 14, {}, "gurobi", "matrix by row after assignment: vector starts"); const int * ei = lhsmbr->getIndices(); OSIUNITTEST_ASSERT_ERROR(ei[ 0] == 0, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 1] == 1, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 2] == 3, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 3] == 4, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 4] == 7, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 5] == 1, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 6] == 2, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 7] == 2, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 8] == 5, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[ 9] == 3, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[10] == 6, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[11] == 0, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[12] == 4, {}, "gurobi", "matrix by row after assignment: indices"); OSIUNITTEST_ASSERT_ERROR(ei[13] == 7, {}, "gurobi", "matrix by row after assignment: indices"); #endif } } // Do common solverInterface testing by calling the // base class testing method. { OsiGrbSolverInterface m; OsiSolverInterfaceCommonUnitTest(&m, mpsDir, netlibDir); } } #endif Osi-0.106.4/test/OsiTestSolverInterfaceTest.cpp0000644000076600007660000000120311575423733020031 0ustar coincoin// Copyright (C) 2000, International Business Machines // Corporation and others. All Rights Reserved. // This file is licensed under the terms of Eclipse Public License (EPL). #include "OsiTestSolverInterface.hpp" #include "OsiUnitTests.hpp" //############################################################################# //-------------------------------------------------------------------------- void OsiTestSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir) { // Do common solverInterface testing { OsiTestSolverInterface m; OsiSolverInterfaceCommonUnitTest(&m, mpsDir, netlibDir); } } Osi-0.106.4/configure0000755000076600007660000337312512244016312013012 0ustar coincoin#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for Osi 0.106.4. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # # # Copyright 2006 International Business Machines and others. # All Rights Reserved. # This file is part of the open source package Coin which is distributed # under the Eclipse Public License. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='Osi' PACKAGE_TARNAME='osi' PACKAGE_VERSION='0.106.4' PACKAGE_STRING='Osi 0.106.4' PACKAGE_BUGREPORT='osi@list.coin-or.org' ac_unique_file="src/Osi/OsiAuxInfo.cpp" ac_default_prefix=`pwd` # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os ALWAYS_FALSE_TRUE ALWAYS_FALSE_FALSE have_svnversion OSI_SVN_REV CDEFS ADD_CFLAGS DBG_CFLAGS OPT_CFLAGS sol_cc_compiler CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT COIN_CC_IS_CL_TRUE COIN_CC_IS_CL_FALSE MPICC CXXDEFS ADD_CXXFLAGS DBG_CXXFLAGS OPT_CXXFLAGS CXX CXXFLAGS ac_ct_CXX COIN_CXX_IS_CL_TRUE COIN_CXX_IS_CL_FALSE MPICXX EGREP LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBTOOLM4 have_autoconf have_automake have_svn BUILDTOOLSDIR AUX_DIR abs_source_dir abs_lib_dir abs_include_dir abs_bin_dir HAVE_EXTERNALS_TRUE HAVE_EXTERNALS_FALSE host host_cpu host_vendor host_os ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ac_c_preproc_warn_flag ac_cxx_preproc_warn_flag RPATH_FLAGS DEPENDENCY_LINKING_TRUE DEPENDENCY_LINKING_FALSE LT_LDFLAGS PKG_CONFIG ac_ct_PKG_CONFIG COIN_HAS_PKGCONFIG_TRUE COIN_HAS_PKGCONFIG_FALSE COIN_PKG_CONFIG_PATH COIN_PKG_CONFIG_PATH_UNINSTALLED COINUTILS_LIBS COINUTILS_CFLAGS COINUTILS_DATA COINUTILS_DEPENDENCIES COINUTILS_LIBS_INSTALLED COINUTILS_CFLAGS_INSTALLED COINUTILS_DATA_INSTALLED OSILIB_CFLAGS OSILIB_LIBS OSILIB_PCLIBS OSILIB_PCREQUIRES OSILIB_DEPENDENCIES OSILIB_CFLAGS_INSTALLED OSILIB_LIBS_INSTALLED COIN_HAS_COINUTILS_TRUE COIN_HAS_COINUTILS_FALSE GLPK_LIBS GLPK_CFLAGS GLPK_DATA GLPK_DEPENDENCIES GLPK_LIBS_INSTALLED GLPK_CFLAGS_INSTALLED GLPK_DATA_INSTALLED OSIGLPKLIB_CFLAGS OSIGLPKLIB_LIBS OSIGLPKLIB_PCLIBS OSIGLPKLIB_PCREQUIRES OSIGLPKLIB_DEPENDENCIES OSIGLPKLIB_CFLAGS_INSTALLED OSIGLPKLIB_LIBS_INSTALLED COIN_HAS_GLPK_TRUE COIN_HAS_GLPK_FALSE SOPLEX_LIBS SOPLEX_CFLAGS SOPLEX_DATA SOPLEX_DEPENDENCIES SOPLEX_LIBS_INSTALLED SOPLEX_CFLAGS_INSTALLED SOPLEX_DATA_INSTALLED OSISPXLIB_CFLAGS OSISPXLIB_LIBS OSISPXLIB_PCLIBS OSISPXLIB_PCREQUIRES OSISPXLIB_DEPENDENCIES OSISPXLIB_CFLAGS_INSTALLED OSISPXLIB_LIBS_INSTALLED COIN_HAS_SOPLEX_TRUE COIN_HAS_SOPLEX_FALSE SAMPLE_LIBS SAMPLE_CFLAGS SAMPLE_DATA SAMPLE_DEPENDENCIES SAMPLE_LIBS_INSTALLED SAMPLE_CFLAGS_INSTALLED SAMPLE_DATA_INSTALLED COIN_HAS_SAMPLE_TRUE COIN_HAS_SAMPLE_FALSE NETLIB_LIBS NETLIB_CFLAGS NETLIB_DATA NETLIB_DEPENDENCIES NETLIB_LIBS_INSTALLED NETLIB_CFLAGS_INSTALLED NETLIB_DATA_INSTALLED COIN_HAS_NETLIB_TRUE COIN_HAS_NETLIB_FALSE CPXINCDIR CPXLIB COIN_HAS_CPX_TRUE COIN_HAS_CPX_FALSE MSKINCDIR MSKLIB COIN_HAS_MSK_TRUE COIN_HAS_MSK_FALSE XPRINCDIR XPRLIB COIN_HAS_XPR_TRUE COIN_HAS_XPR_FALSE GRBINCDIR GRBLIB COIN_HAS_GRB_TRUE COIN_HAS_GRB_FALSE OSI_EXAMPLES_SOLVER_NAME OSI_EXAMPLES_SOLVER_CFLAGS OSI_EXAMPLES_SOLVER_LIBS OSI_EXAMPLES_SOLVER_PCNAME coin_have_doxygen coin_doxy_usedot coin_doxy_tagname coin_doxy_logname coin_doxy_tagfiles coin_doxy_excludes LIBEXT VPATH_DISTCLEANFILES ABSBUILDDIR LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CDEFS_set=${CDEFS+set} ac_env_CDEFS_value=$CDEFS ac_cv_env_CDEFS_set=${CDEFS+set} ac_cv_env_CDEFS_value=$CDEFS ac_env_ADD_CFLAGS_set=${ADD_CFLAGS+set} ac_env_ADD_CFLAGS_value=$ADD_CFLAGS ac_cv_env_ADD_CFLAGS_set=${ADD_CFLAGS+set} ac_cv_env_ADD_CFLAGS_value=$ADD_CFLAGS ac_env_DBG_CFLAGS_set=${DBG_CFLAGS+set} ac_env_DBG_CFLAGS_value=$DBG_CFLAGS ac_cv_env_DBG_CFLAGS_set=${DBG_CFLAGS+set} ac_cv_env_DBG_CFLAGS_value=$DBG_CFLAGS ac_env_OPT_CFLAGS_set=${OPT_CFLAGS+set} ac_env_OPT_CFLAGS_value=$OPT_CFLAGS ac_cv_env_OPT_CFLAGS_set=${OPT_CFLAGS+set} ac_cv_env_OPT_CFLAGS_value=$OPT_CFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_MPICC_set=${MPICC+set} ac_env_MPICC_value=$MPICC ac_cv_env_MPICC_set=${MPICC+set} ac_cv_env_MPICC_value=$MPICC ac_env_CXXDEFS_set=${CXXDEFS+set} ac_env_CXXDEFS_value=$CXXDEFS ac_cv_env_CXXDEFS_set=${CXXDEFS+set} ac_cv_env_CXXDEFS_value=$CXXDEFS ac_env_ADD_CXXFLAGS_set=${ADD_CXXFLAGS+set} ac_env_ADD_CXXFLAGS_value=$ADD_CXXFLAGS ac_cv_env_ADD_CXXFLAGS_set=${ADD_CXXFLAGS+set} ac_cv_env_ADD_CXXFLAGS_value=$ADD_CXXFLAGS ac_env_DBG_CXXFLAGS_set=${DBG_CXXFLAGS+set} ac_env_DBG_CXXFLAGS_value=$DBG_CXXFLAGS ac_cv_env_DBG_CXXFLAGS_set=${DBG_CXXFLAGS+set} ac_cv_env_DBG_CXXFLAGS_value=$DBG_CXXFLAGS ac_env_OPT_CXXFLAGS_set=${OPT_CXXFLAGS+set} ac_env_OPT_CXXFLAGS_value=$OPT_CXXFLAGS ac_cv_env_OPT_CXXFLAGS_set=${OPT_CXXFLAGS+set} ac_cv_env_OPT_CXXFLAGS_value=$OPT_CXXFLAGS ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_MPICXX_set=${MPICXX+set} ac_env_MPICXX_value=$MPICXX ac_cv_env_MPICXX_set=${MPICXX+set} ac_cv_env_MPICXX_value=$MPICXX ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} ac_env_PKG_CONFIG_value=$PKG_CONFIG ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Osi 0.106.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Osi 0.106.4:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug compile all projects with debug options tests (implies --disable-shared) --enable-debug-osi compile project Osi with debug compiler flags --enable-msvc Prefer (i)cl/ifort/link over GNU on MinGW/Cygwin. --enable-static[=PKGS] build static libraries [default=no] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-pkg-config disable use of pkg-config (if available) --disable-interpackage-dependencies disables deduction of Makefile dependencies from package linker flags --disable-cplex-libcheck skip the link check at configuration time --disable-mosek-libcheck skip the link check at configuration time --disable-xpress-libcheck skip the link check at configuration time --disable-gurobi-libcheck skip the link check at configuration time Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-osi-verbosity specify the debug verbosity level for project Osi --with-osi-checklevel specify the sanity check level for project Osi --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-coin-instdir prefix of installation directory for precompiled COIN packages --with-coinutils-lib linker flags for using package CoinUtils --with-coinutils-incdir directory with header files for using package CoinUtils --with-coinutils-datadir directory with data files for using package CoinUtils --with-glpk-lib linker flags for using package Glpk --with-glpk-incdir directory with header files for using package Glpk --with-glpk-datadir directory with data files for using package Glpk --with-soplex-lib linker flags for using package SoPlex --with-soplex-incdir directory with header files for using package SoPlex --with-soplex-datadir directory with data files for using package SoPlex --with-sample-lib linker flags for using package Sample --with-sample-incdir directory with header files for using package Sample --with-sample-datadir directory with data files for using package Sample --with-netlib-lib linker flags for using package Netlib --with-netlib-incdir directory with header files for using package Netlib --with-netlib-datadir directory with data files for using package Netlib --with-cplex-incdir specify the header file directory for library Cplex --with-cplex-lib specify the flags used to link with the library Cplex --with-mosek-incdir specify the header file directory for library Mosek --with-mosek-lib specify the flags used to link with the library Mosek --with-xpress-incdir specify the header file directory for library Xpress --with-xpress-lib specify the flags used to link with the library Xpress --with-gurobi-incdir specify the header file directory for library Gurobi --with-gurobi-lib specify the flags used to link with the library Gurobi --with-dot use dot (from graphviz) when creating documentation with doxygen if available; --without-dot to disable Some influential environment variables: CDEFS Additional -D flags to be used when compiling C code. ADD_CFLAGS Additional C compiler options DBG_CFLAGS Debug C compiler options OPT_CFLAGS Optimize C compiler options CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory MPICC C MPI Compiler CXXDEFS Additional -D flags to be used when compiling C++ code. ADD_CXXFLAGS Additional C++ compiler options DBG_CXXFLAGS Debug C++ compiler options OPT_CXXFLAGS Optimize C++ compiler options CXX C++ compiler command CXXFLAGS C++ compiler flags MPICXX C++ MPI Compiler CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags PKG_CONFIG path to pkg-config utility Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Osi configure 0.106.4 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Copyright 2006 International Business Machines and others. All Rights Reserved. This file is part of the open source package Coin which is distributed under the Eclipse Public License. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Osi $as_me 0.106.4, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # List one file in the package so that the configure script can test # whether the package is actually there # Where should everything be installed by default? Here, we want it # to be installed directly in 'bin', 'lib', 'include' subdirectories # of the directory where configure is run. The default would be # /usr/local. ############################################################################# # Standard build tool stuff # ############################################################################# # Get the system type ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # A bit of initial setup # As backup, we make sure we don't loose an FLIBS if it has been set # by the user save_FLIBS="$FLIBS" # A useful makefile conditional that is always false if false; then ALWAYS_FALSE_TRUE= ALWAYS_FALSE_FALSE='#' else ALWAYS_FALSE_TRUE='#' ALWAYS_FALSE_FALSE= fi # We set the following variable so that we know later in AC_COIN_FINALIZE # that we are in a project main directory coin_projectdir=yes # Set the project's version numbers cat >>confdefs.h <<_ACEOF #define OSI_VERSION "$PACKAGE_VERSION" _ACEOF coin_majorver=`echo $PACKAGE_VERSION | sed -n -e 's/^\([0-9]*\).*/\1/gp'` coin_minorver=`echo $PACKAGE_VERSION | sed -n -e 's/^[0-9]*\.\([0-9]*\).*/\1/gp'` coin_releasever=`echo $PACKAGE_VERSION | sed -n -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/gp'` if test "x$coin_majorver" = x ; then coin_majorver=9999 ; fi if test "x$coin_minorver" = x ; then coin_minorver=9999 ; fi if test "x$coin_releasever" = x ; then coin_releasever=9999 ; fi cat >>confdefs.h <<_ACEOF #define OSI_VERSION_MAJOR $coin_majorver _ACEOF cat >>confdefs.h <<_ACEOF #define OSI_VERSION_MINOR $coin_minorver _ACEOF cat >>confdefs.h <<_ACEOF #define OSI_VERSION_RELEASE $coin_releasever _ACEOF # We use the following variable to have a string with the upper case # version of the project name COIN_PRJCT=OSI # Set the project's SVN revision number. The complicated sed expression # (made worse by quadrigraphs) ensures that things like 4123:4168MS end up # as a single number. # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_have_svnversion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_svnversion"; then ac_cv_prog_have_svnversion="$have_svnversion" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_svnversion="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_have_svnversion" && ac_cv_prog_have_svnversion="no" fi fi have_svnversion=$ac_cv_prog_have_svnversion if test -n "$have_svnversion"; then echo "$as_me:$LINENO: result: $have_svnversion" >&5 echo "${ECHO_T}$have_svnversion" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$have_svnversion" = xyes; then svn_rev_tmp=`LANG=en_EN svnversion $srcdir 2>/dev/null` if test "x$svn_rev_tmp" != xexported -a "x$svn_rev_tmp" != x -a "x$svn_rev_tmp" != "xUnversioned directory"; then OSI_SVN_REV=`echo $svn_rev_tmp | sed -n -e 's/^[0-9]*://' -e 's/\([0-9]\)[^0-9]*$/\1/p'` cat >>confdefs.h <<_ACEOF #define OSI_SVN_REV $OSI_SVN_REV _ACEOF fi fi # Capture libtool library version, if given. coin_libversion=12:4:11 # Check if user wants to produce debugging code echo "$as_me:$LINENO: checking whether we want to compile in debug mode" >&5 echo $ECHO_N "checking whether we want to compile in debug mode... $ECHO_C" >&6 # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" case "${enableval}" in yes) coin_debug_compile=true if test "${enable_shared+set}" = set; then :; else enable_shared=no fi ;; no) coin_debug_compile=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5 echo "$as_me: error: bad value ${enableval} for --enable-debug" >&2;} { (exit 1); exit 1; }; } ;; esac else coin_debug_compile=false fi; # Check whether --enable-debug-osi or --disable-debug-osi was given. if test "${enable_debug_osi+set}" = set; then enableval="$enable_debug_osi" case "${enableval}" in yes) coin_debug_compile=true ;; no) coin_debug_compile=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug-osi" >&5 echo "$as_me: error: bad value ${enableval} for --enable-debug-osi" >&2;} { (exit 1); exit 1; }; } ;; esac else : fi; # m4_ifvaln([Osi], if test $coin_debug_compile = true; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Check whether --with-osi-verbosity or --without-osi-verbosity was given. if test "${with_osi_verbosity+set}" = set; then withval="$with_osi_verbosity" if test "$withval" = yes; then withval=1 fi coin_osi_verbosity=$withval else coin_osi_verbosity=0 fi; cat >>confdefs.h <<_ACEOF #define COIN_OSI_VERBOSITY $coin_osi_verbosity _ACEOF # Check whether --with-osi-checklevel or --without-osi-checklevel was given. if test "${with_osi_checklevel+set}" = set; then withval="$with_osi_checklevel" if test "$withval" = yes; then withval=1 fi coin_osi_checklevel=$withval else coin_osi_checklevel=0 fi; cat >>confdefs.h <<_ACEOF #define COIN_OSI_CHECKLEVEL $coin_osi_checklevel _ACEOF # m4_ifvaln([Osi], # Get the name of the C++ compiler and appropriate compiler options # for backward compatibility # Check whether --enable-doscompile or --disable-doscompile was given. if test "${enable_doscompile+set}" = set; then enableval="$enable_doscompile" enable_doscompile=$enableval else enable_doscompile=no fi; # Check whether --enable-msvc or --disable-msvc was given. if test "${enable_msvc+set}" = set; then enableval="$enable_msvc" enable_msvc=$enableval else enable_msvc=no if test "$enable_doscompile" = msvc ; then enable_msvc=yes elif test "$enable_doscompile" != no ; then { { echo "$as_me:$LINENO: error: --enable-doscompile=$enable_doscompile not supported anymore." >&5 echo "$as_me: error: --enable-doscompile=$enable_doscompile not supported anymore." >&2;} { (exit 1); exit 1; }; } fi fi; if test "$enable_msvc" = MD; then enable_shared=yes enable_msvc=yes fi if test "$enable_msvc" = yes; then case $build in *-cygwin* | *-mingw*) ;; *) { { echo "$as_me:$LINENO: error: --enable-msvc option makes sense only under Cygwin or MinGW" >&5 echo "$as_me: error: --enable-msvc option makes sense only under Cygwin or MinGW" >&2;} { (exit 1); exit 1; }; } ;; esac fi case $build in *-mingw*) if test "${LD+set}" = set; then :; else LD=link fi ;; esac if test $enable_msvc = yes ; then if test "x${LD+set}" = xset; then :; else LD=link fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # For consistency, we set the C compiler to the same value of the C++ # compiler, if the C++ is set, but the C compiler isn't (only for CXX=cl) if test x"$CXX" != x; then case "$CXX" in clang* ) ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) if test x"$CC" = x; then CC="$CXX" { echo "$as_me:$LINENO: WARNING: C++ compiler name provided as $CXX, but CC is unset. Setting CC to $CXX" >&5 echo "$as_me: WARNING: C++ compiler name provided as $CXX, but CC is unset. Setting CC to $CXX" >&2;} fi ;; esac fi coin_has_cc=yes save_cflags="$CFLAGS" # For *-*-solaris*, promote Studio/Workshop cc compiler to front of list. # Depending on the user's PATH, when Studio/Workshop cc is not present we may # find /usr/ucb/cc, which is almost certainly not a good choice for the C # compiler. In this case, put cc after gcc. case $build in *-cygwin* | *-mingw*) if test "$enable_msvc" = yes ; then comps="icl cl gcc" else comps="gcc icl cl" fi ;; *-*-solaris*) # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_sol_cc_compiler+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$sol_cc_compiler"; then ac_cv_prog_sol_cc_compiler="$sol_cc_compiler" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_sol_cc_compiler="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_sol_cc_compiler shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set sol_cc_compiler to just the basename; use the full file name. shift ac_cv_prog_sol_cc_compiler="$as_dir/$ac_word${1+' '}$@" fi fi fi fi sol_cc_compiler=$ac_cv_prog_sol_cc_compiler if test -n "$sol_cc_compiler"; then echo "$as_me:$LINENO: result: $sol_cc_compiler" >&5 echo "${ECHO_T}$sol_cc_compiler" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$sol_cc_compiler" = "cc" ; then comps="cc xlc gcc pgcc icc" else comps="xlc gcc pgcc icc cc" fi ;; *-linux-gnu*) comps="gcc cc pgcc icc xlc" ;; *-linux-*) comps="xlc gcc cc pgcc icc" ;; *) comps="xlc_r xlc cc gcc pgcc icc" ;; esac # We delete the cached value, since the test might not have been # performed with our choice of compilers earlier $as_unset ac_cv_prog_CC || test "${ac_cv_prog_CC+set}" != set || { ac_cv_prog_CC=; export ac_cv_prog_CC; } # AC_MSG_NOTICE([C compiler candidates: $comps]) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $comps do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in $comps do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -z "$CC" ; then { { echo "$as_me:$LINENO: error: Failed to find a C compiler!" >&5 echo "$as_me: error: Failed to find a C compiler!" >&2;} { (exit 1); exit 1; }; } fi # Autoconf incorrectly concludes that cl recognises -g. It doesn't. case "$CC" in clang* ) ;; cl* | */cl* | CL* | */CL* ) if test "$ac_cv_prog_cc_g" = yes ; then ac_cv_prog_cc_g=no { echo "$as_me:$LINENO: Overruling autoconf; cl does not recognise -g." >&5 echo "$as_me: Overruling autoconf; cl does not recognise -g." >&6;} fi ;; * ) if test x"$CYGPATH_W" = x ; then CYGPATH_W=echo fi ;; esac CFLAGS="$save_cflags" # add automake conditional so we can recognize cl compiler in makefile coin_cc_is_cl=false case "$CC" in clang* ) ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) coin_cc_is_cl=true ;; esac if test $coin_cc_is_cl = true; then COIN_CC_IS_CL_TRUE= COIN_CC_IS_CL_FALSE='#' else COIN_CC_IS_CL_TRUE='#' COIN_CC_IS_CL_FALSE= fi # Check if a project specific CFLAGS variable has been set if test x$COIN_PRJCT != x; then eval coin_tmp=\${${COIN_PRJCT}_CFLAGS+set} if test x$coin_tmp = xset; then eval CFLAGS=\${${COIN_PRJCT}_CFLAGS} fi fi if test x"$CFLAGS" = x; then coin_add_cflags= coin_opt_cflags= coin_dbg_cflags= coin_warn_cflags= if test "$GCC" = "yes"; then case "$CC" in icc* | */icc*) ;; *) coin_opt_cflags="-O3" coin_add_cflags="-pipe" coin_dbg_cflags="-g -O0" coin_warn_cflags="-Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Wno-unknown-pragmas -Wno-long-long" case $build in *-darwin*) ;; *) coin_warn_cflags="-pedantic-errors $coin_warn_cflags" ;; esac esac fi if test -z "$coin_opt_cflags"; then case $build in *-cygwin* | *-mingw*) case "$CC" in clang* ) ;; cl* | */cl* | CL* | */CL*) if test "$coin_disable_shared" = yes || test "$enable_shared" = yes ; then coin_opt_cflags='-MD -O2' coin_dbg_cflags='-MDd' else coin_opt_cflags='-MT -O2' coin_dbg_cflags='-MTd' fi coin_add_cflags='-nologo -wd4996 -D_CRT_SECURE_NO_DEPRECATE' ;; icl* | */icl* | ICL* | */ICL*) if test "$coin_disable_shared" = yes || test "$enable_shared" = yes ; then coin_opt_cflags='-MD -Ox' coin_dbg_cflags='-MDd -debug' else coin_opt_cflags='-MT -Ox' coin_dbg_cflags='-MTd -debug' fi coin_add_cflags='-nologo -D_CRT_SECURE_NO_DEPRECATE' ;; esac ;; *-linux-*) case "$CC" in icc* | */icc*) coin_opt_cflags="-O3 -ip -mp1" coin_add_cflags="" coin_dbg_cflags="-g" # Check if -i_dynamic is necessary (for new glibc library) CFLAGS= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 coin_add_cflags="-i_dynamic $coin_add_cflags" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ;; pgcc* | */pgcc*) coin_opt_cflags="-fast" coin_add_cflags="-Kieee -pc 64" coin_dbg_cflags="-g" ;; esac ;; *-ibm-*) case "$CC" in xlc* | */xlc* | mpxlc* | */mpxlc*) coin_opt_cflags="-O -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1" coin_add_cflags="-bmaxdata:0x80000000 -qsuppress=1500-036 -qsuppress=1500-029" coin_dbg_cflags="-g" ;; esac ;; *-hp-*) coin_opt_cflags="-O" coin_add_cflags="-Ae" coin_dbg_cflags="-g" ;; *-*-solaris*) coin_opt_cflags="-xO4" coin_dbg_cflags="-g" ;; *-sgi-*) coin_opt_cflags="-O -OPT:Olimit=0" coin_dbg_cflags="-g" ;; esac fi if test "$ac_cv_prog_cc_g" = yes && test -z "$coin_dbg_cflags" ; then coin_dbg_cflags="-g" fi if test -z "$coin_opt_cflags"; then # Try if -O option works if nothing else is set CFLAGS="-O" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then coin_opt_cflags="-O" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # if PM doesn't want the warning messages, take them out if test x"$coin_skip_warn_cflags" = xyes; then coin_warn_cflags= fi if test x${DBG_CFLAGS+set} != xset; then DBG_CFLAGS="$coin_dbg_cflags $coin_add_cflags $coin_warn_cflags" fi if test x${OPT_CFLAGS+set} != xset; then OPT_CFLAGS="$coin_opt_cflags $coin_add_cflags -DNDEBUG $coin_warn_cflags" fi DBG_CFLAGS="$DBG_CFLAGS $ADD_CFLAGS $CDEFS" OPT_CFLAGS="$OPT_CFLAGS $ADD_CFLAGS $CDEFS" if test "$coin_debug_compile" = "true"; then CFLAGS="$DBG_CFLAGS" else CFLAGS="$OPT_CFLAGS" fi else CFLAGS="$CFLAGS $ADD_CFLAGS $CDEFS" if test x${DBG_CFLAGS+set} != xset; then DBG_CFLAGS="$CFLAGS" fi if test x${OPT_CFLAGS+set} != xset; then OPT_CFLAGS="$CFLAGS" fi fi # add -DPROJECT_BUILD to signal compiler preprocessor which config header file to include if test x$COIN_PRJCT != x; then CFLAGS="$CFLAGS -D${COIN_PRJCT}_BUILD" fi # Try if CFLAGS works save_CFLAGS="$CFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS= fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$CFLAGS"; then { echo "$as_me:$LINENO: WARNING: The value CFLAGS=\"$save_CFLAGS\" do not work. I will now just try '-O', but you might want to set CFLAGS manually." >&5 echo "$as_me: WARNING: The value CFLAGS=\"$save_CFLAGS\" do not work. I will now just try '-O', but you might want to set CFLAGS manually." >&2;} CFLAGS='-O' cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS= fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$CFLAGS"; then { echo "$as_me:$LINENO: WARNING: This value for CFLAGS does not work. I will continue with empty CFLAGS, but you might want to set CFLAGS manually." >&5 echo "$as_me: WARNING: This value for CFLAGS does not work. I will continue with empty CFLAGS, but you might want to set CFLAGS manually." >&2;} fi fi { echo "$as_me:$LINENO: C compiler options are: $CFLAGS" >&5 echo "$as_me: C compiler options are: $CFLAGS" >&6;} if test x"$MPICC" = x; then :; else { echo "$as_me:$LINENO: Will use MPI C compiler $MPICC" >&5 echo "$as_me: Will use MPI C compiler $MPICC" >&6;} CC="$MPICC" fi # Correct the LD variable if we are using the MS or Intel-windows compiler case "$CC" in clang* ) ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) case $build in *-mingw*) if test "${LD+set}" = set; then :; else LD=link fi ;; esac if test $enable_msvc = yes ; then if test "x${LD+set}" = xset; then :; else LD=link fi fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #Let's try if that overcomes configuration problem with VC++ 6.0 ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu coin_has_cxx=yes save_cxxflags="$CXXFLAGS" # For *-*-solaris*, promote Studio/Workshop compiler to front of list. case $build in *-cygwin* | *-mingw*) if test "$enable_msvc" = yes ; then comps="icl cl g++" else comps="g++ icl cl" fi ;; *-*-solaris*) comps="CC xlC_r aCC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;; *-darwin*) comps="g++ c++ CC" ;; *-linux-gnu*) comps="g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC xlC_r aCC CC" ;; *) comps="xlC_r aCC CC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;; esac # We delete the cached value, since the test might not have been # performed with our choice of compilers earlier $as_unset ac_cv_prog_CXX || test "${ac_cv_prog_CXX+set}" != set || { ac_cv_prog_CXX=; export ac_cv_prog_CXX; } # AC_MSG_NOTICE([C++ compiler candidates: $comps]) ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC $comps do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC $comps do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #AC_PROG_CXX sets CXX to g++ if it cannot find a working C++ compiler #thus, we test here whether $CXX is actually working ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking whether C++ compiler $CXX works" >&5 echo $ECHO_N "checking whether C++ compiler $CXX works... $ECHO_C" >&6; cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: failed to find a C++ compiler or C++ compiler $CXX does not work" >&5 echo "$as_me: error: failed to find a C++ compiler or C++ compiler $CXX does not work" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu coin_cxx_is_cl=false # It seems that we need to cleanup something here for the Windows case "$CXX" in clang* ) ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) sed -e 's/^void exit (int);//' confdefs.h >> confdefs.hh mv confdefs.hh confdefs.h coin_cxx_is_cl=true ;; esac # add automake conditional so we can recognize cl compiler in makefile if test $coin_cxx_is_cl = true; then COIN_CXX_IS_CL_TRUE= COIN_CXX_IS_CL_FALSE='#' else COIN_CXX_IS_CL_TRUE='#' COIN_CXX_IS_CL_FALSE= fi # Autoconf incorrectly concludes that cl recognises -g. It doesn't. case "$CXX" in clang* ) ;; cl* | */cl* | CL* | */CL* ) if test "$ac_cv_prog_cxx_g" = yes ; then ac_cv_prog_cxx_g=no { echo "$as_me:$LINENO: Overruling autoconf; cl does not recognise -g." >&5 echo "$as_me: Overruling autoconf; cl does not recognise -g." >&6;} fi ;; * ) if test x"$CYGPATH_W" = x ; then CYGPATH_W=echo fi ;; esac CXXFLAGS="$save_cxxflags" # Check if a project specific CXXFLAGS variable has been set if test x$COIN_PRJCT != x; then eval coin_tmp=\${${COIN_PRJCT}_CXXFLAGS+set} if test x$coin_tmp = xset; then eval CXXFLAGS=\${${COIN_PRJCT}_CXXFLAGS} fi fi if test x"$CXXFLAGS" = x; then # ToDo decide whether we want -DNDEBUG for optimization coin_add_cxxflags= coin_opt_cxxflags= coin_dbg_cxxflags= coin_warn_cxxflags= if test "$GXX" = "yes"; then case "$CXX" in icpc* | */icpc*) ;; *) # ToDo decide about unroll-loops coin_opt_cxxflags="-O3" coin_add_cxxflags="-pipe" coin_dbg_cxxflags="-g -O0" coin_warn_cxxflags="-Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long" case $build in *-darwin*) ;; *) coin_warn_cxxflags="-pedantic-errors $coin_warn_cxxflags" ;; esac esac fi # Note that we do not need to cover GCC in the following tests. if test -z "$coin_opt_cxxflags"; then case $build in *-cygwin* | *-mingw*) case "$CXX" in clang* ) ;; cl* | */cl* | CL* | */CL*) # The MT and MTd options are mutually exclusive if test "$coin_disable_shared" = yes || test "$enable_shared" = yes ; then coin_opt_cxxflags='-MD -O2' coin_dbg_cxxflags='-MDd' else coin_opt_cxxflags='-MT -O2' coin_dbg_cxxflags='-MTd' fi coin_add_cxxflags='-nologo -EHsc -GR -wd4996 -D_CRT_SECURE_NO_DEPRECATE' ;; icl* | */icl* | ICL* | */ICL*) # The MT and MTd options are mutually exclusive if test "$coin_disable_shared" = yes || test "$enable_shared" = yes ; then coin_opt_cxxflags='-MD -Ox' coin_dbg_cxxflags='-MDd -debug' else coin_opt_cxxflags='-MT -Ox' coin_dbg_cxxflags='-MTd -debug' fi coin_add_cxxflags='-nologo -EHsc -GR -D_CRT_SECURE_NO_DEPRECATE' ;; esac ;; *-linux-*) case "$CXX" in icpc* | */icpc*) coin_opt_cxxflags="-O3 -ip -mp1" coin_add_cxxflags="" coin_dbg_cxxflags="-g" # Check if -i_dynamic is necessary (for new glibc library) CXXFLAGS= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 coin_add_cxxflags="-i_dynamic $coin_add_cxxflags" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ;; pgCC* | */pgCC*) coin_opt_cxxflags="-fast" coin_add_cxxflags="-Kieee -pc 64" coin_dbg_cxxflags="-g" ;; esac ;; *-ibm-*) case "$CXX" in xlC* | */xlC* | mpxlC* | */mpxlC*) coin_opt_cxxflags="-O -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1" coin_add_cxxflags="-bmaxdata:0x80000000 -qrtti=dyna -qsuppress=1500-036 -qsuppress=1500-029 -qsourcetype=c++" coin_dbg_cxxflags="-g" ;; esac ;; *-hp-*) case "$CXX" in aCC* | */aCC* ) coin_opt_cxxflags="-O" coin_add_cxxflags="-AA" coin_dbg_cxxflags="-g" ;; esac ;; *-*-solaris*) coin_opt_cxxflags="-O4" coin_dbg_cxxflags="-g" ;; esac fi # Generic flag settings. If these don't work, add a case above. if test "$ac_cv_prog_cxx_g" = yes && test -z "$coin_dbg_cxxflags" ; then coin_dbg_cxxflags="-g" fi if test -z "$coin_opt_cxxflags"; then # Try if -O option works if nothing else is set CXXFLAGS=-O cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then coin_opt_cxxflags="-O" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # if PM doesn't want the warning messages, take them out if test x"$coin_skip_warn_cxxflags" = xyes; then coin_warn_cxxflags= fi # Do final setup of flags based on values determined above. if test x${DBG_CXXFLAGS+set} != xset; then DBG_CXXFLAGS="$coin_dbg_cxxflags $coin_add_cxxflags $coin_warn_cxxflags" fi if test x${OPT_CXXFLAGS+set} != xset; then OPT_CXXFLAGS="$coin_opt_cxxflags $coin_add_cxxflags -DNDEBUG $coin_warn_cxxflags" fi DBG_CXXFLAGS="$DBG_CXXFLAGS $ADD_CXXFLAGS $CXXDEFS" OPT_CXXFLAGS="$OPT_CXXFLAGS $ADD_CXXFLAGS $CXXDEFS" if test "$coin_debug_compile" = "true"; then CXXFLAGS="$DBG_CXXFLAGS" else CXXFLAGS="$OPT_CXXFLAGS" fi # Handle the case where CXXFLAGS was set externally. else CXXFLAGS="$CXXFLAGS $ADD_CXXFLAGS $CXXDEFS" if test x${DBG_CXXFLAGS+set} != xset; then DBG_CXXFLAGS="$CXXFLAGS" fi if test x${OPT_CXXFLAGS+set} != xset; then OPT_CXXFLAGS="$CXXFLAGS" fi fi # add -DPROJECT_BUILD to signal compiler preprocessor which config header file to include if test x$COIN_PRJCT != x; then CXXFLAGS="$CXXFLAGS -D${COIN_PRJCT}_BUILD" fi # Try if CXXFLAGS works save_CXXFLAGS="$CXXFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS= fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$CXXFLAGS"; then { echo "$as_me:$LINENO: WARNING: The flags CXXFLAGS=\"$save_CXXFLAGS\" do not work. I will now just try '-O', but you might want to set CXXFLAGS manually." >&5 echo "$as_me: WARNING: The flags CXXFLAGS=\"$save_CXXFLAGS\" do not work. I will now just try '-O', but you might want to set CXXFLAGS manually." >&2;} CXXFLAGS='-O' cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i=0; i++; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS= fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$CXXFLAGS"; then { echo "$as_me:$LINENO: WARNING: This value for CXXFLAGS does not work. I will continue with empty CXXFLAGS, but you might want to set CXXFLAGS manually." >&5 echo "$as_me: WARNING: This value for CXXFLAGS does not work. I will continue with empty CXXFLAGS, but you might want to set CXXFLAGS manually." >&2;} fi fi { echo "$as_me:$LINENO: C++ compiler options are: $CXXFLAGS" >&5 echo "$as_me: C++ compiler options are: $CXXFLAGS" >&6;} if test x"$MPICXX" = x; then :; else { echo "$as_me:$LINENO: Will use MPI C++ compiler $MPICXX" >&5 echo "$as_me: Will use MPI C++ compiler $MPICXX" >&6;} CXX="$MPICXX" fi # correct the LD variable in a mingw build with MS or intel compiler case "$CXX" in clang* ) ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) case $build in *-mingw*) if test "${LD+set}" = set; then :; else LD=link fi ;; esac if test $enable_msvc = yes ; then if test "x${LD+set}" = xset; then :; else LD=link fi fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Initialize automake and libtool { # START coin_disable_shared=no # Test if force_shared has been set if test "x" = xforce_shared; then if test x$enable_shared = xno; then { { echo "$as_me:$LINENO: error: Shared libraries are disabled by user, but this is not feasible with the given options" >&5 echo "$as_me: error: Shared libraries are disabled by user, but this is not feasible with the given options" >&2;} { (exit 1); exit 1; }; } fi enable_shared=yes; else # On Cygwin and AIX, building DLLs doesn't work case $build in *-cygwin* | *-mingw*) coin_disable_shared=yes if test x"$enable_shared" = xyes; then case "$CXX" in clang* ) { echo "$as_me:$LINENO: WARNING: DLL building not supported. I'm disabling your choice." >&5 echo "$as_me: WARNING: DLL building not supported. I'm disabling your choice." >&2;} ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) { echo "$as_me:$LINENO: DLL building not supported, but will build with -MD(d) instead of -MT(d)." >&5 echo "$as_me: DLL building not supported, but will build with -MD(d) instead of -MT(d)." >&6;} ;; *) { echo "$as_me:$LINENO: WARNING: DLL building not supported. I'm disabling your choice." >&5 echo "$as_me: WARNING: DLL building not supported. I'm disabling your choice." >&2;} ;; esac fi ;; *-aix*) coin_disable_shared=yes platform=AIX if test x"$enable_shared" = xyes; then { echo "$as_me:$LINENO: WARNING: Shared objects are not supported. I'm disabling your choice." >&5 echo "$as_me: WARNING: Shared objects are not supported. I'm disabling your choice." >&2;} fi ;; esac fi if test x"$coin_disable_shared" = xyes; then if test x"$enable_shared" = xyes; then : else # we don't disable shared, because it was not selected anyway coin_disable_shared=no fi enable_shared=no fi # By default, we only want the shared objects to be compiled # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi; # Initialize automake echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # AC_MSG_NOTICE([Beginning automake initialisation.]) # Stuff for automake # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='osi' VERSION='0.106.4' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE coin_have_externals=no if test "$enable_maintainer_mode" = yes; then # If maintainer mode is chosen, we make sure that the correct versions # of the tools are used, and that we know where libtool.m4 is (to # recreate acinclude.m4) LIBTOOLM4= # Normally, $HOME AUTOTOOLS_DFLT=$HOME echo "$as_me:$LINENO: checking whether we are using the correct autotools" >&5 echo $ECHO_N "checking whether we are using the correct autotools... $ECHO_C" >&6 if test "${ac_cv_use_correct_autotools+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_use_correct_autotools=check fi echo "$as_me:$LINENO: result: $ac_cv_use_correct_autotools" >&5 echo "${ECHO_T}$ac_cv_use_correct_autotools" >&6 if test $ac_cv_use_correct_autotools = check; then ac_cv_use_correct_autotools=yes # Check if we have autoconf # Extract the first word of "autoconf", so it can be a program name with args. set dummy autoconf; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_have_autoconf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_autoconf"; then ac_cv_prog_have_autoconf="$have_autoconf" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_autoconf="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_have_autoconf" && ac_cv_prog_have_autoconf="no" fi fi have_autoconf=$ac_cv_prog_have_autoconf if test -n "$have_autoconf"; then echo "$as_me:$LINENO: result: $have_autoconf" >&5 echo "${ECHO_T}$have_autoconf" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test $have_autoconf = no; then { { echo "$as_me:$LINENO: error: You specified you want to use maintainer mode, but I cannot find autoconf in your path." >&5 echo "$as_me: error: You specified you want to use maintainer mode, but I cannot find autoconf in your path." >&2;} { (exit 1); exit 1; }; } fi # Check whether autoconf is the correct version correct_version='2.59' grep_version=`echo $correct_version | sed -e 's/\\./\\\\\\./g'` echo "$as_me:$LINENO: checking whether we are using the correct version ($correct_version) of autoconf" >&5 echo $ECHO_N "checking whether we are using the correct version ($correct_version) of autoconf... $ECHO_C" >&6 autoconf --version > confauto.out 2>&1 if $EGREP $grep_version confauto.out >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else rm -f confauto.out echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: You don't have the correct version of autoconf as the first one in your path." >&5 echo "$as_me: error: You don't have the correct version of autoconf as the first one in your path." >&2;} { (exit 1); exit 1; }; } fi rm -f confauto.out # Check if the executable autoconf is picked up from the correct location echo "$as_me:$LINENO: checking whether autoconf is coming from the correct location" >&5 echo $ECHO_N "checking whether autoconf is coming from the correct location... $ECHO_C" >&6 autoconf_dir=`which autoconf | sed -e 's=/autoconf=='` autoconf_dir=`cd $autoconf_dir; pwd` if test x$AUTOTOOLS_DIR = x; then want_dir=$AUTOTOOLS_DFLT/bin else want_dir=$AUTOTOOLS_DIR/bin fi if test $autoconf_dir = `cd $want_dir; pwd`; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else rm -f confauto.out echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: The autoconf executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin." >&5 echo "$as_me: error: The autoconf executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin." >&2;} { (exit 1); exit 1; }; } fi # Check if we have automake # Extract the first word of "automake", so it can be a program name with args. set dummy automake; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_have_automake+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_automake"; then ac_cv_prog_have_automake="$have_automake" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_automake="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_have_automake" && ac_cv_prog_have_automake="no" fi fi have_automake=$ac_cv_prog_have_automake if test -n "$have_automake"; then echo "$as_me:$LINENO: result: $have_automake" >&5 echo "${ECHO_T}$have_automake" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test $have_automake = no; then { { echo "$as_me:$LINENO: error: You specified you want to use maintainer mode, but I cannot find automake in your path." >&5 echo "$as_me: error: You specified you want to use maintainer mode, but I cannot find automake in your path." >&2;} { (exit 1); exit 1; }; } fi # Check whether automake is the correct version correct_version='1.9.6' grep_version=`echo $correct_version | sed -e 's/\\./\\\\\\./g'` echo "$as_me:$LINENO: checking whether we are using the correct version ($correct_version) of automake" >&5 echo $ECHO_N "checking whether we are using the correct version ($correct_version) of automake... $ECHO_C" >&6 automake --version > confauto.out 2>&1 if $EGREP $grep_version confauto.out >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else rm -f confauto.out echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: You don't have the correct version of automake as the first one in your path." >&5 echo "$as_me: error: You don't have the correct version of automake as the first one in your path." >&2;} { (exit 1); exit 1; }; } fi rm -f confauto.out # Check if the executable automake is picked up from the correct location echo "$as_me:$LINENO: checking whether automake is coming from the correct location" >&5 echo $ECHO_N "checking whether automake is coming from the correct location... $ECHO_C" >&6 automake_dir=`which automake | sed -e 's=/automake=='` automake_dir=`cd $automake_dir; pwd` if test x$AUTOTOOLS_DIR = x; then want_dir=$AUTOTOOLS_DFLT/bin else want_dir=$AUTOTOOLS_DIR/bin fi if test $automake_dir = `cd $want_dir; pwd`; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else rm -f confauto.out echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: The automake executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin." >&5 echo "$as_me: error: The automake executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin." >&2;} { (exit 1); exit 1; }; } fi # Check if this is the correct version of libtool (with escaped dots) if test x$AUTOTOOLS_DIR = x; then want_dir=$AUTOTOOLS_DFLT/share else want_dir=$AUTOTOOLS_DIR/share fi correct_version='1.5.22' grep_version=`echo $correct_version | sed -e 's/\\./\\\\\\./g'` if test -r $want_dir/libtool/ltmain.sh; then have_ltmain=yes : else have_ltmain=no : fi echo "$as_me:$LINENO: checking whether we are using the correct version ($correct_version) of libtool." >&5 echo $ECHO_N "checking whether we are using the correct version ($correct_version) of libtool.... $ECHO_C" >&6 if test $have_ltmain = yes; then if $EGREP $grep_version $want_dir/libtool/ltmain.sh >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: You don't have the correct version of libtool." >&5 echo "$as_me: error: You don't have the correct version of libtool." >&2;} { (exit 1); exit 1; }; } fi else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: I cannot find the ltmain.sh file." >&5 echo "$as_me: error: I cannot find the ltmain.sh file." >&2;} { (exit 1); exit 1; }; } fi fi # Check if we can find the libtool file if test x$AUTOTOOLS_DIR = x; then want_dir=$AUTOTOOLS_DFLT/share else want_dir=$AUTOTOOLS_DIR/share fi if test -r $want_dir/aclocal/libtool.m4; then LIBTOOLM4="$want_dir/aclocal/libtool.m4" : else { { echo "$as_me:$LINENO: error: I cannot find the libtool.m4 file." >&5 echo "$as_me: error: I cannot find the libtool.m4 file." >&2;} { (exit 1); exit 1; }; } : fi # Check if we have an Dependencies file if test -r $srcdir/Dependencies; then coin_have_externals=yes fi # Check if subversion is installed and understands https # Extract the first word of "svn", so it can be a program name with args. set dummy svn; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_have_svn+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_svn"; then ac_cv_prog_have_svn="$have_svn" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_svn="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_have_svn" && ac_cv_prog_have_svn="no" fi fi have_svn=$ac_cv_prog_have_svn if test -n "$have_svn"; then echo "$as_me:$LINENO: result: $have_svn" >&5 echo "${ECHO_T}$have_svn" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x$have_svn = xyes; then echo "$as_me:$LINENO: checking whether svn understands https" >&5 echo $ECHO_N "checking whether svn understands https... $ECHO_C" >&6 if test "${ac_cv_svn_understands_https+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else svn --version > confauto.out 2>&1 if $EGREP https confauto.out >/dev/null 2>&1; then ac_cv_svn_understands_https=yes else ac_cv_svn_understands_https=no have_svn=no ac_cv_prog_have_svn=no fi rm -f confauto.out fi echo "$as_me:$LINENO: result: $ac_cv_svn_understands_https" >&5 echo "${ECHO_T}$ac_cv_svn_understands_https" >&6 fi # Find the location of the BuildTools directory BUILDTOOLSDIR= if test -r $srcdir/BuildTools/coin.m4; then BUILDTOOLSDIR=$srcdir/BuildTools else if test -r $srcdir/../BuildTools/coin.m4; then BUILDTOOLSDIR=$srcdir/../BuildTools else if test -r $srcdir/../../BuildTools/coin.m4; then BUILDTOOLSDIR=$srcdir/../../BuildTools else { { echo "$as_me:$LINENO: error: Cannot find the BuildTools directory" >&5 echo "$as_me: error: Cannot find the BuildTools directory" >&2;} { (exit better disable maintainer mode.); exit better disable maintainer mode.; }; } fi fi fi # for running automake by make, we need to have Makemain.inc available at the place where it usually can be found during run_autotools if test "$BUILDTOOLSDIR" != "$srcdir/BuildTools" ; then $LN_S `cd $BUILDTOOLSDIR; pwd` "$srcdir/BuildTools" fi # The following variable is set to the name of the directory where # the autotool scripts are located AUX_DIR=$ac_aux_dir fi # helpful variable for the base directory of this package abs_source_dir=`cd $srcdir; pwd` # Stuff for example Makefiles if test x$prefix = xNONE; then full_prefix=$ac_default_prefix else full_prefix=$prefix fi full_prefix=`cd $full_prefix ; pwd` abs_lib_dir=$full_prefix/lib abs_include_dir=$full_prefix/include abs_bin_dir=$full_prefix/bin if test $coin_have_externals = yes && test x$have_svn = xyes; then HAVE_EXTERNALS_TRUE= HAVE_EXTERNALS_FALSE='#' else HAVE_EXTERNALS_TRUE='#' HAVE_EXTERNALS_FALSE= fi # AC_MSG_NOTICE([End automake initialisation.]) LIBTOOL= if test -f ../libtool; then coin_config_dir=.. LIBTOOL='$(SHELL) $(top_builddir)/../libtool' fi if test "x$LIBTOOL" = x; then if test -f ../../libtool; then coin_config_dir=../.. LIBTOOL='$(SHELL) $(top_builddir)/../../libtool' fi fi if test "x$LIBTOOL" = x; then # AC_MSG_NOTICE([Creating libtool script (calling COIN_PROG_LIBTOOL).]) # Stuff for libtool # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 5873 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to osi@list.coin-or.org ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:7007:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8074: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8078: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8342: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8346: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8446: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8450: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13235: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13239: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13339: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13343: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14909: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14913: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15013: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15017: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17220: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17224: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17488: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17492: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17592: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:17596: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion # No longer needed now that CPPFLAGS is correctly set -- lh, 061214 -- # AC_REQUIRE([AC_COIN_DLFCN_H]) # NEW: If libtool exists in the directory higher up, we use that one # instead of creating a new one # It turns out that the code for AC_PROG_LIBTOOL is somehow AC_REQUIRED # out in front of this macro body. You'll notice that LIBTOOL is already # defined here. We'll have to count on this macro not being called if libtool # already exists, or at least move the libtool fixes outside the conditional. # AC_MSG_NOTICE([Entering coin_prog_libtool, LIBTOOL = "$LIBTOOL".]) # This test is therefore removed. -- lh, 061214 -- # if test "x$LIBTOOL" = x; then # AC_MSG_NOTICE([Calling PROG_LIBTOOL.]) # AC_MSG_NOTICE([Finished PROG_LIBTOOL.]) { echo "$as_me:$LINENO: Build is \"$build\"." >&5 echo "$as_me: Build is \"$build\"." >&6;} mydos2unix='| dos2unix' case $build in *-mingw*) CYGPATH_W=echo mydos2unix= ;; esac case $build in # Here we need to check if -m32 is specified. If so, we need to correct # sys_lib_search_path_spec *-cygwin* | *-mingw*) case "$CXX" in clang* ) # we assume that libtool patches for CLANG are the same as for GNU compiler - correct??? { echo "$as_me:$LINENO: Applying patches to libtool for CLANG compiler" >&5 echo "$as_me: Applying patches to libtool for CLANG compiler" >&6;} sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \ -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \ -e 's|libext="lib"|libext="a"|' \ libtool > conftest.bla ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) { echo "$as_me:$LINENO: Applying patches to libtool for cl compiler" >&5 echo "$as_me: Applying patches to libtool for cl compiler" >&6;} sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \ -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \ -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \ -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \ -e 's%lib /OUT:%lib -OUT:%' \ -e "s%cygpath -w%$CYGPATH_W%" \ -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\$(lib -nologo -list \\$('"$CYGPATH_W \$1"') '"$mydos2unix"' | xargs echo); echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$('"$CYGPATH_W \$1"'); done%' \ -e 's%$AR t "$f_ex_an_ar_oldlib"%lib -nologo -list \$('"$CYGPATH_W \$1"') '"$mydos2unix"'%' \ -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \ -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \ -e 's%old_archive_cmds="lib -OUT:\\$oldlib\\$oldobjs\\$old_deplibs"%old_archive_cmds="if test -r \\$oldlib; then bla=\\"\\$oldlib\\"; else bla=; fi; lib -OUT:\\$oldlib \\\\\\$bla\\$oldobjs\\$old_deplibs"%' \ libtool > conftest.bla ;; *) { echo "$as_me:$LINENO: Applying patches to libtool for GNU compiler" >&5 echo "$as_me: Applying patches to libtool for GNU compiler" >&6;} sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \ -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \ -e 's|libext="lib"|libext="a"|' \ libtool > conftest.bla ;; esac mv conftest.bla libtool chmod 755 libtool ;; *x86_64-*) if test "$GCC" = yes && (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm32' >& /dev/null); then { echo "$as_me:$LINENO: Applying patches to libtool for 32bit compilation" >&5 echo "$as_me: Applying patches to libtool for 32bit compilation" >&6;} sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="/lib /usr/lib"|' libtool > conftest.bla mv conftest.bla libtool chmod 755 libtool fi ;; *-solaris*) if test "$GCC" = yes && \ (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm64' >/dev/null 2>&1) ; then hdwisa=`isainfo | sed -e 's/\([^ ]*\) .*$/\1/'` if `$EGREP 'sys_lib_search_path_spec=' libtool | $EGREP -v $hdwisa >/dev/null 2>&1` ; then { echo "$as_me:$LINENO: Applying patches to libtool for 64-bit GCC compilation" >&5 echo "$as_me: Applying patches to libtool for 64-bit GCC compilation" >&6;} fixlibtmp=`$CC -m64 -print-search-dirs | $EGREP '^libraries:'` fixlibtmp=`echo $fixlibtmp | sed -e 's/libraries: =//' -e 's/:/ /g'` if `echo "$fixlibtmp" | $EGREP -v $hdwisa >/dev/null 2>&1` ; then # AC_MSG_NOTICE(Compensating for broken gcc) for lib in $fixlibtmp ; do if test -d "${lib}${hdwisa}" ; then syslibpath64="$syslibpath64 ${lib}${hdwisa}/" fi done syslibpath64="${syslibpath64} ${fixlibtmp}" else syslibpath64="$fixlibtmp" fi sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="'"$syslibpath64"'"|' libtool > conftest.bla mv conftest.bla libtool chmod 755 libtool fi # AC_MSG_NOTICE(Result is ) # $EGREP 'sys_lib_search_path_spec=' libtool fi ;; # Cygwin. Ah, cygwin. Too big and ugly to inline; see the macro. *-darwin*) { echo "$as_me:$LINENO: Applying patches to libtool for Darwin" >&5 echo "$as_me: Applying patches to libtool for Darwin" >&6;} sed -e 's/verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"/verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"/' \ -e 's/ -dynamiclib / -dynamiclib -single_module /g' \ libtool > conftest.bla mv conftest.bla libtool chmod 755 libtool ;; esac # This fi matches the commented `if test "x$LIBTOOL" = x;' up at the head of # the macro. -- lh, 061214 -- # fi # AC_MSG_NOTICE([End libtool initialisation.]) # AC_MSG_NOTICE([Finished COIN_PROG_LIBTOOL.]) # set RPATH_FLAGS to the compiler link flags required to hardcode location # of the shared objects RPATH_FLAGS= if test $enable_shared = yes; then case $build in *-linux-*) if test "$GXX" = "yes"; then RPATH_FLAGS= for dir in $abs_lib_dir; do RPATH_FLAGS="$RPATH_FLAGS -Wl,--rpath -Wl,$dir" done fi ;; *-darwin*) RPATH_FLAGS=nothing ;; *-ibm-*) case "$CXX" in xlC* | */xlC* | mpxlC* | */mpxlC*) RPATH_FLAGS=nothing ;; esac ;; *-hp-*) RPATH_FLAGS=nothing ;; *-mingw32) RPATH_FLAGS=nothing ;; *-*-solaris*) RPATH_FLAGS= for dir in $abs_lib_dir; do RPATH_FLAGS="$RPATH_FLAGS -R$dir" done esac if test "$RPATH_FLAGS" = ""; then { echo "$as_me:$LINENO: WARNING: Could not automatically determine how to tell the linker about automatic inclusion of the path for shared libraries. The test examples might not work if you link against shared objects. You will need to set the LD_LIBRARY_PATH, DYLP_LIBRARY_PATH, or LIBDIR variable manually." >&5 echo "$as_me: WARNING: Could not automatically determine how to tell the linker about automatic inclusion of the path for shared libraries. The test examples might not work if you link against shared objects. You will need to set the LD_LIBRARY_PATH, DYLP_LIBRARY_PATH, or LIBDIR variable manually." >&2;} fi if test "$RPATH_FLAGS" = "nothing"; then RPATH_FLAGS= fi fi else { echo "$as_me:$LINENO: Using libtool script in directory $coin_config_dir" >&5 echo "$as_me: Using libtool script in directory $coin_config_dir" >&6;} # get all missing information from the config.log file # output variables and defines as_save_IFS=$IFS IFS=' ' for oneline in `cat $coin_config_dir/config.status`; do case "$oneline" in # First some automake conditionals s,@am__fastdep* | s,@AR@* | s,@CPP@* | s,@CPPFLAGS@* | s,@CXXCPP@* | \ s,@RANLIB@* | s,@STRIP@* | s,@ac_ct_AR@* | s,@ac_ct_RANLIB@* | \ s,@ac_ct_STRIP@* | s,@host* | s,@LN_S@* | s,@RPATH_FLAGS@* | \ s,@ac_c_preproc_warn_flag@* | s,@ac_cxx_preproc_warn_flag@* ) command=`echo $oneline | sed -e 's/^s,@//' -e 's/@,/="/' -e 's/,;t t/"/'` # echo "$command" eval "$command" ;; s,@DEFS@* ) command=`echo $oneline | sed -e 's/^s,@DEFS@,/defsline="/' -e 's/,;t t/"/'` # echo "$command" eval "$command" ;; esac done IFS=$as_save_IFS # And some defines (assuming here that the packages base dir # doesn't have a config.h file for word in $defsline; do # echo word $word case $word in -DHAVE_[A-Z_]*_H=1 | -DSTDC_HEADERS=1 ) i=`echo $word | sed -e 's/-D/#define /' -e 's/=/ /'` # echo dd $i echo $i >>confdefs.h ;; esac done fi # AC_MSG_NOTICE([End of INIT_AUTO_TOOLS.]) # Check whether --enable-dependency-linking or --disable-dependency-linking was given. if test "${enable_dependency_linking+set}" = set; then enableval="$enable_dependency_linking" dependency_linking="$enableval" else dependency_linking=no fi; # ToDo # For now, don't use the -no-undefined flag, since the Makefiles are # not yet set up that way. But we need to fix this, when we want # to comile DLLs under Windows. if test "$dependency_linking" = yes ; then LT_LDFLAGS="-no-undefined" else LT_LDFLAGS= fi if test "$dependency_linking" = yes; then DEPENDENCY_LINKING_TRUE= DEPENDENCY_LINKING_FALSE='#' else DEPENDENCY_LINKING_TRUE='#' DEPENDENCY_LINKING_FALSE= fi # Check if we want to set the library version echo "$as_me:$LINENO: checking if library version is set" >&5 echo $ECHO_N "checking if library version is set... $ECHO_C" >&6 if test x"$coin_libversion" != x; then LT_LDFLAGS="$LT_LDFLAGS -version-info $coin_libversion" echo "$as_me:$LINENO: result: $coin_libversion" >&5 echo "${ECHO_T}$coin_libversion" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi #END } ############################################################################# # COIN-OR components # ############################################################################# # Check whether --enable-pkg-config or --disable-pkg-config was given. if test "${enable_pkg_config+set}" = set; then enableval="$enable_pkg_config" use_pkgconfig="$enableval" else if test x$coin_cc_is_cl = xtrue; then use_pkgconfig=no else use_pkgconfig=yes fi fi; if test $use_pkgconfig = yes ; then if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_PKG_CONFIG"; then ac_ct_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_PKG_CONFIG"; then ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG if test -n "$ac_ct_PKG_CONFIG"; then echo "$as_me:$LINENO: result: $ac_ct_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_ct_PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi PKG_CONFIG=$ac_ct_PKG_CONFIG else PKG_CONFIG="$ac_cv_prog_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.16.0 echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 PKG_CONFIG="" fi fi # check if pkg-config supports the short-errors flag if test -n "$PKG_CONFIG" && \ $PKG_CONFIG --atleast-pkgconfig-version 0.20; then pkg_short_errors=" --short-errors " else pkg_short_errors="" fi fi if test -n "$PKG_CONFIG"; then COIN_HAS_PKGCONFIG_TRUE= COIN_HAS_PKGCONFIG_FALSE='#' else COIN_HAS_PKGCONFIG_TRUE='#' COIN_HAS_PKGCONFIG_FALSE= fi # assemble pkg-config search path for installed projects COIN_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" # let's assume that when installing into $prefix, then the user may have installed some other coin projects there before, so it's worth to have a look into there # best would actually to use ${libdir}, since .pc files get installed into ${libdir}/pkgconfig, # unfortunately, ${libdir} expands to ${exec_prefix}/lib and ${exec_prefix} to ${prefix}... if test "x${prefix}" = xNONE ; then COIN_PKG_CONFIG_PATH="${ac_default_prefix}/lib64/pkgconfig:${ac_default_prefix}/lib/pkgconfig:${ac_default_prefix}/share/pkgconfig:${COIN_PKG_CONFIG_PATH}" else COIN_PKG_CONFIG_PATH="${prefix}/lib64/pkgconfig:${prefix}/lib/pkgconfig:${prefix}/share/pkgconfig:${COIN_PKG_CONFIG_PATH}" fi # Check whether --with-coin-instdir or --without-coin-instdir was given. if test "${with_coin_instdir+set}" = set; then withval="$with_coin_instdir" if test -d "$withval"; then : ; else { { echo "$as_me:$LINENO: error: argument for --with-coin-instdir not a directory" >&5 echo "$as_me: error: argument for --with-coin-instdir not a directory" >&2;} { (exit 1); exit 1; }; } fi COIN_PKG_CONFIG_PATH="$withval/lib/pkgconfig:$withval/share/pkgconfig:${COIN_PKG_CONFIG_PATH}" fi; # assemble additional pkg-config search paths for uninstalled projects if test x$coin_projectdir = xyes ; then # if we are in a project setup, then in a classic setup, we want to find uninstalled projects # their (relative) location is written to coin_subdirs.txt by the configure in the project base directory # unfortunately, if the user set prefix, then we do not know where the project base directory is located # but it is likely to be either .. (if we are a usual coin project) or ../.. (if we are a unusual coin project like ThirdParty or Data) COIN_PKG_CONFIG_PATH_UNINSTALLED= if test -f ../coin_subdirs.txt ; then for i in `cat ../coin_subdirs.txt` ; do if test -d ../$i ; then COIN_PKG_CONFIG_PATH_UNINSTALLED="`cd ../$i; pwd`:${COIN_PKG_CONFIG_PATH_UNINSTALLED}" fi if test -d ../$i/pkgconfig ; then COIN_PKG_CONFIG_PATH_UNINSTALLED="`cd ../$i/pkgconfig; pwd`:${COIN_PKG_CONFIG_PATH_UNINSTALLED}" fi done fi if test -f ../../coin_subdirs.txt ; then for i in `cat ../../coin_subdirs.txt` ; do if test -d ../../$i ; then COIN_PKG_CONFIG_PATH_UNINSTALLED="`cd ../../$i; pwd`:${COIN_PKG_CONFIG_PATH_UNINSTALLED}" fi if test -d ../../$i/pkgconfig ; then COIN_PKG_CONFIG_PATH_UNINSTALLED="`cd ../../$i/pkgconfig; pwd`:${COIN_PKG_CONFIG_PATH_UNINSTALLED}" fi done fi fi if test -n "$PKG_CONFIG" && test x$coin_cc_is_cl = xtrue; then { echo "$as_me:$LINENO: WARNING: Using pkg-config together with MS or Intel Compiler on Windows is not support by example Makefiles. Consider using --disable-pkg-config." >&5 echo "$as_me: WARNING: Using pkg-config together with MS or Intel Compiler on Windows is not support by example Makefiles. Consider using --disable-pkg-config." >&2;} fi echo "$as_me:$LINENO: checking for COIN-OR package CoinUtils" >&5 echo $ECHO_N "checking for COIN-OR package CoinUtils... $ECHO_C" >&6 coin_has_coinutils=notGiven # check if user wants to skip package in any case if test x"$COIN_SKIP_PROJECTS" != x; then for dir in $COIN_SKIP_PROJECTS; do if test $dir = "CoinUtils"; then coin_has_coinutils=skipping fi done fi if test "$coin_has_coinutils" != skipping; then # Check whether --with-m4_tolower(CoinUtils) or --without-m4_tolower(CoinUtils) was given. if test "${with_coinutils+set}" = set; then withval="$with_coinutils" if test "$withval" = no ; then coin_has_coinutils=skipping fi fi; fi COINUTILS_LIBS= COINUTILS_CFLAGS= COINUTILS_DATA= COINUTILS_DEPENDENCIES= COINUTILS_PCLIBS= COINUTILS_PCREQUIRES= COINUTILS_DATA= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_coinutils != skipping; then # Check whether --with-m4_tolower(CoinUtils)-lib or --without-m4_tolower(CoinUtils)-lib was given. if test "${with_coinutils_lib+set}" = set; then withval="$with_coinutils_lib" if test "$withval" = no ; then coin_has_coinutils=skipping else coin_has_coinutils=yes COINUTILS_LIBS="$withval" COINUTILS_PCLIBS="$withval" OSILIB_PCLIBS="$withval $OSILIB_PCLIBS" OSILIB_LIBS="$withval $OSILIB_LIBS" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then COINUTILS_LIBS_INSTALLED="$withval" OSILIB_LIBS_INSTALLED="$withval $OSILIB_LIBS_INSTALLED" fi fi fi; fi if test $coin_has_coinutils != skipping; then # Check whether --with-m4_tolower(CoinUtils)-incdir or --without-m4_tolower(CoinUtils)-incdir was given. if test "${with_coinutils_incdir+set}" = set; then withval="$with_coinutils_incdir" if test "$withval" = no ; then coin_has_coinutils=skipping else coin_has_coinutils=yes COINUTILS_CFLAGS="-I`${CYGPATH_W} $withval`" OSILIB_CFLAGS="-I`${CYGPATH_W} $withval` $OSILIB_CFLAGS" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then COINUTILS_CFLAGS_INSTALLED="$COINUTILS_CFLAGS" OSILIB_CFLAGS_INSTALLED="$COINUTILS_CFLAGS $OSILIB_CFLAGS_INSTALLED" fi fi fi; fi if test $coin_has_coinutils != skipping; then # Check whether --with-m4_tolower(CoinUtils)-datadir or --without-m4_tolower(CoinUtils)-datadir was given. if test "${with_coinutils_datadir+set}" = set; then withval="$with_coinutils_datadir" if test "$withval" = no ; then coin_has_coinutils=skipping else coin_has_coinutils=yes COINUTILS_DATA="$withval" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then COINUTILS_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_coinutils = notGiven; then if test -n "$PKG_CONFIG" ; then # set search path for pkg-config # need to export variable to be sure that the following pkg-config gets these values coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH:$COIN_PKG_CONFIG_PATH_UNINSTALLED" export PKG_CONFIG_PATH # let pkg-config do it's magic if test -n "$PKG_CONFIG" ; then if $PKG_CONFIG --exists "coinutils"; then COINUTILS_VERSIONS=`$PKG_CONFIG --modversion "coinutils" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "coinutils" 2>/dev/null` # pkg-config cannot handle spaces, so CYGPATH_W cannot be put into .pc files # thus, we modify the cflags extracted from pkg-config by putting CYGPATH_W behind -I's # but only do this if is not trivial if test "$CYGPATH_W" != "echo" ; then # need to put into brackets since otherwise autoconf replaces the brackets in the sed command cflags=`echo $cflags | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi COINUTILS_CFLAGS="$cflags" COINUTILS_LIBS=`$PKG_CONFIG --libs "coinutils" 2>/dev/null` COINUTILS_DATA=`$PKG_CONFIG --variable=datadir "coinutils" 2>/dev/null` coin_has_coinutils=yes echo "$as_me:$LINENO: result: yes: $COINUTILS_VERSIONS" >&5 echo "${ECHO_T}yes: $COINUTILS_VERSIONS" >&6 # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl) if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then COINUTILS_LIBS=`echo " $COINUTILS_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi COINUTILS_PCREQUIRES="coinutils" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in OsiLib OSILIB_PCREQUIRES="coinutils $OSILIB_PCREQUIRES" OSILIB_CFLAGS="$COINUTILS_CFLAGS $OSILIB_CFLAGS" OSILIB_LIBS="$COINUTILS_LIBS $OSILIB_LIBS" else COINUTILS_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "coinutils"` coin_has_coinutils=notGiven echo "$as_me:$LINENO: result: not given: $COINUTILS_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $COINUTILS_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module CoinUtils without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module CoinUtils without pkg-config\"" >&2;} { (exit 1); exit 1; }; } fi # reset PKG_CONFIG_PATH variable PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" export PKG_CONFIG_PATH else echo "$as_me:$LINENO: result: skipped check via pkg-config, redirect to fallback" >&5 echo "${ECHO_T}skipped check via pkg-config, redirect to fallback" >&6 echo "$as_me:$LINENO: checking for COIN-OR package CoinUtils (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package CoinUtils (fallback)... $ECHO_C" >&6 coin_has_coinutils=notGiven COINUTILS_LIBS= COINUTILS_LIBS_INSTALLED= COINUTILS_CFLAGS= COINUTILS_CFLAGS_INSTALLED= COINUTILS_DATA= COINUTILS_DATA_INSTALLED= COINUTILS_PCLIBS= COINUTILS_PCREQUIRES= # initial list of dependencies is "coinutils", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="coinutils" # we first expand the list of projects to process by adding all dependencies just behind the project which depends on it # further, we collect the list of corresponding .pc files, but do this in reverse order, because we need this order afterwards # the latter we also do with .pc files corresponding to the installed projects, which will be needed to setup Makefiles for examples # also, we setup the DATA variable allproj="" allpcfiles="" allpcifiles="" while test "x$projtoprocess" != x ; do for proj in $projtoprocess ; do # if $proj is available and configured, then a project-uninstalled.pc file should have been created, so search for it pcfile="" save_IFS="$IFS" IFS=":" for dir in $COIN_PKG_CONFIG_PATH_UNINSTALLED ; do # the base directory configure should have setup coin_subdirs.txt in a way that it does not contain projects that should be skipped, so we do not need to test this here again if test -r "$dir/${proj}-uninstalled.pc" ; then pcfile="$dir/$proj-uninstalled.pc" if test -r "$dir/${proj}.pc" ; then pcifile="$dir/${proj}.pc" else { echo "$as_me:$LINENO: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&5 echo "$as_me: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&2;} pcifile= fi break fi done IFS="$save_IFS" if test "x$pcfile" != x ; then # read dependencies from $pcfile and filter it projrequires=`sed -n -e 's/Requires://gp' "$pcfile" | sed -e 's/<\{0,1\}>\{0,1\}=[ ]\{0,\}[^ ]\{1,\}//g'` # add projrequires to the front of the list of projects that have to be processed next # at the same time, remove $proj from this list projtoprocess=`echo $projtoprocess | sed -e "s/$proj/$projrequires/"` # read DATA from $pcfile, if _DATA is still empty if test "x$COINUTILS_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` COINUTILS_DATA="$projdatadir" fi allproj="$allproj $proj" allpcfiles="$pcfile:$allpcfiles" else echo "$as_me:$LINENO: result: no, dependency $proj not available" >&5 echo "${ECHO_T}no, dependency $proj not available" >&6 allproj=fail break 2 fi if test "x$pcifile" != x ; then allpcifiles="$pcifile:$allpcifiles" # read DATA_INSTALLED from $pcifile, if _DATA_INSTALLED is still empty if test "x$COINUTILS_DATA_INSTALLED" = x ; then projdatadir= pcifilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcifile` eval `sh -c "$pcifilemod"` if test "${CYGPATH_W}" != "echo"; then projdatadir="\`\$(CYGPATH_W) ${projdatadir} | sed -e 's/\\\\\\\\/\\\\\\\\\\\\\\\\/g'\`" fi COINUTILS_DATA_INSTALLED="$projdatadir" fi fi break done # remove spaces on begin of $projtoprocess projtoprocess=`echo $projtoprocess | sed -e 's/^ *//'` done if test "$allproj" != fail ; then # now go through the list of .pc files and assemble compiler and linker flags # important is here to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcfiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi COINUTILS_CFLAGS="$projcflags $COINUTILS_CFLAGS" # set LIBS variable COINUTILS_LIBS="$projlibs $COINUTILS_LIBS" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # now go through the list of .pc files for installed projects and assemble compiler and linker flags # important is here again to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcifiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi COINUTILS_CFLAGS_INSTALLED="$projcflags $COINUTILS_CFLAGS_INSTALLED" # set LIBS variable COINUTILS_LIBS_INSTALLED="$projlibs $COINUTILS_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_coinutils=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_COINUTILS 1 _ACEOF # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl), # for the LIBS_INSTALLED, we replace everything of the form "/somepath/" by "`$(CYGPATH_W) /somepath/`", # everything of the form "-lname" by "libname.lib", and # everything of the form "-Lpath" by "-libpath:`$(CYGPATH_W) path` if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then COINUTILS_LIBS=`echo " $COINUTILS_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` COINUTILS_LIBS_INSTALLED=`echo " $COINUTILS_LIBS_INSTALLED" | sed -e 's/ \(\/[^ ]*\/\)/ \`$(CYGPATH_W) \1\`/g' -e 's/ -l\([^ ]*\)/ lib\1.lib/g' -e 's/ -L\([^ ]*\)/ -libpath:\`$(CYGPATH_W) \1\`/g'` fi COINUTILS_PCREQUIRES="coinutils" OSILIB_PCREQUIRES="coinutils $OSILIB_PCREQUIRES" OSILIB_CFLAGS="$COINUTILS_CFLAGS $OSILIB_CFLAGS" OSILIB_LIBS="$COINUTILS_LIBS $OSILIB_LIBS" OSILIB_CFLAGS_INSTALLED="$COINUTILS_CFLAGS_INSTALLED $OSILIB_CFLAGS_INSTALLED" OSILIB_LIBS_INSTALLED="$COINUTILS_LIBS_INSTALLED $OSILIB_LIBS_INSTALLED" fi if test $coin_has_coinutils != notGiven && test $coin_has_coinutils != skipping; then COIN_HAS_COINUTILS_TRUE= COIN_HAS_COINUTILS_FALSE='#' else COIN_HAS_COINUTILS_TRUE='#' COIN_HAS_COINUTILS_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_coinutils" >&5 echo "${ECHO_T}$coin_has_coinutils" >&6 fi if test $coin_has_coinutils != skipping && test $coin_has_coinutils != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_COINUTILS 1 _ACEOF # Check whether --enable-interpackage-dependencies or --disable-interpackage-dependencies was given. if test "${enable_interpackage_dependencies+set}" = set; then enableval="$enable_interpackage_dependencies" else enable_interpackage_dependencies=yes fi; if test $enable_interpackage_dependencies = yes ; then # construct dependencies variables from LIBS variables # we add an extra space in LIBS so we can substitute out everything starting with " -" # remove everything of the form -framework xxx as used on Mac and mkl* and libiomp5* and wsock32.lib as used on Windows # then remove everything of the form -xxx # also remove everything of the form `xxx`yyy (may have been added for cygwin/cl) COINUTILS_DEPENDENCIES=`echo " $COINUTILS_LIBS" | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` OSILIB_DEPENDENCIES=`echo " $OSILIB_LIBS " | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` fi if test 1 = 0 ; then #change this test to enable a bit of debugging output if test -n "$COINUTILS_CFLAGS" ; then { echo "$as_me:$LINENO: CoinUtils CFLAGS are $COINUTILS_CFLAGS" >&5 echo "$as_me: CoinUtils CFLAGS are $COINUTILS_CFLAGS" >&6;} fi if test -n "$COINUTILS_LIBS" ; then { echo "$as_me:$LINENO: CoinUtils LIBS are $COINUTILS_LIBS" >&5 echo "$as_me: CoinUtils LIBS are $COINUTILS_LIBS" >&6;} fi if test -n "$COINUTILS_DEPENDENCIES" ; then { echo "$as_me:$LINENO: CoinUtils DEPENDENCIES are $COINUTILS_DEPENDENCIES" >&5 echo "$as_me: CoinUtils DEPENDENCIES are $COINUTILS_DEPENDENCIES" >&6;} fi if test -n "$COINUTILS_DATA" ; then { echo "$as_me:$LINENO: CoinUtils DATA is $COINUTILS_DATA" >&5 echo "$as_me: CoinUtils DATA is $COINUTILS_DATA" >&6;} fi if test -n "$COINUTILS_PCLIBS" ; then { echo "$as_me:$LINENO: CoinUtils PCLIBS are $COINUTILS_PCLIBS" >&5 echo "$as_me: CoinUtils PCLIBS are $COINUTILS_PCLIBS" >&6;} fi if test -n "$COINUTILS_PCREQUIRES" ; then { echo "$as_me:$LINENO: CoinUtils PCREQUIRES are $COINUTILS_PCREQUIRES" >&5 echo "$as_me: CoinUtils PCREQUIRES are $COINUTILS_PCREQUIRES" >&6;} fi { echo "$as_me:$LINENO: OsiLib CFLAGS are $OSILIB_CFLAGS" >&5 echo "$as_me: OsiLib CFLAGS are $OSILIB_CFLAGS" >&6;} { echo "$as_me:$LINENO: OsiLib LIBS are $OSILIB_LIBS" >&5 echo "$as_me: OsiLib LIBS are $OSILIB_LIBS" >&6;} { echo "$as_me:$LINENO: OsiLib DEPENDENCIES are $OSILIB_DEPENDENCIES" >&5 echo "$as_me: OsiLib DEPENDENCIES are $OSILIB_DEPENDENCIES" >&6;} fi fi # Define the Makefile conditional if test $coin_has_coinutils != notGiven && test $coin_has_coinutils != skipping; then COIN_HAS_COINUTILS_TRUE= COIN_HAS_COINUTILS_FALSE='#' else COIN_HAS_COINUTILS_TRUE='#' COIN_HAS_COINUTILS_FALSE= fi if test $coin_has_coinutils != yes ; then { { echo "$as_me:$LINENO: error: Required package CoinUtils not available." >&5 echo "$as_me: error: Required package CoinUtils not available." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for COIN-OR package Glpk" >&5 echo $ECHO_N "checking for COIN-OR package Glpk... $ECHO_C" >&6 coin_has_glpk=notGiven # check if user wants to skip package in any case if test x"$COIN_SKIP_PROJECTS" != x; then for dir in $COIN_SKIP_PROJECTS; do if test $dir = "Glpk"; then coin_has_glpk=skipping fi done fi if test "$coin_has_glpk" != skipping; then # Check whether --with-m4_tolower(Glpk) or --without-m4_tolower(Glpk) was given. if test "${with_glpk+set}" = set; then withval="$with_glpk" if test "$withval" = no ; then coin_has_glpk=skipping fi fi; fi GLPK_LIBS= GLPK_CFLAGS= GLPK_DATA= GLPK_DEPENDENCIES= GLPK_PCLIBS= GLPK_PCREQUIRES= GLPK_DATA= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_glpk != skipping; then # Check whether --with-m4_tolower(Glpk)-lib or --without-m4_tolower(Glpk)-lib was given. if test "${with_glpk_lib+set}" = set; then withval="$with_glpk_lib" if test "$withval" = no ; then coin_has_glpk=skipping else coin_has_glpk=yes GLPK_LIBS="$withval" GLPK_PCLIBS="$withval" OSIGLPKLIB_PCLIBS="$withval $OSIGLPKLIB_PCLIBS" OSIGLPKLIB_LIBS="$withval $OSIGLPKLIB_LIBS" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then GLPK_LIBS_INSTALLED="$withval" OSIGLPKLIB_LIBS_INSTALLED="$withval $OSIGLPKLIB_LIBS_INSTALLED" fi fi fi; fi if test $coin_has_glpk != skipping; then # Check whether --with-m4_tolower(Glpk)-incdir or --without-m4_tolower(Glpk)-incdir was given. if test "${with_glpk_incdir+set}" = set; then withval="$with_glpk_incdir" if test "$withval" = no ; then coin_has_glpk=skipping else coin_has_glpk=yes GLPK_CFLAGS="-I`${CYGPATH_W} $withval`" OSIGLPKLIB_CFLAGS="-I`${CYGPATH_W} $withval` $OSIGLPKLIB_CFLAGS" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then GLPK_CFLAGS_INSTALLED="$GLPK_CFLAGS" OSIGLPKLIB_CFLAGS_INSTALLED="$GLPK_CFLAGS $OSIGLPKLIB_CFLAGS_INSTALLED" fi fi fi; fi if test $coin_has_glpk != skipping; then # Check whether --with-m4_tolower(Glpk)-datadir or --without-m4_tolower(Glpk)-datadir was given. if test "${with_glpk_datadir+set}" = set; then withval="$with_glpk_datadir" if test "$withval" = no ; then coin_has_glpk=skipping else coin_has_glpk=yes GLPK_DATA="$withval" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then GLPK_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_glpk = notGiven; then if test -n "$PKG_CONFIG" ; then # set search path for pkg-config # need to export variable to be sure that the following pkg-config gets these values coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH:$COIN_PKG_CONFIG_PATH_UNINSTALLED" export PKG_CONFIG_PATH # let pkg-config do it's magic if test -n "$PKG_CONFIG" ; then if $PKG_CONFIG --exists "coinglpk"; then GLPK_VERSIONS=`$PKG_CONFIG --modversion "coinglpk" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "coinglpk" 2>/dev/null` # pkg-config cannot handle spaces, so CYGPATH_W cannot be put into .pc files # thus, we modify the cflags extracted from pkg-config by putting CYGPATH_W behind -I's # but only do this if is not trivial if test "$CYGPATH_W" != "echo" ; then # need to put into brackets since otherwise autoconf replaces the brackets in the sed command cflags=`echo $cflags | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi GLPK_CFLAGS="$cflags" GLPK_LIBS=`$PKG_CONFIG --libs "coinglpk" 2>/dev/null` GLPK_DATA=`$PKG_CONFIG --variable=datadir "coinglpk" 2>/dev/null` coin_has_glpk=yes echo "$as_me:$LINENO: result: yes: $GLPK_VERSIONS" >&5 echo "${ECHO_T}yes: $GLPK_VERSIONS" >&6 # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl) if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then GLPK_LIBS=`echo " $GLPK_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi GLPK_PCREQUIRES="coinglpk" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in OsiGlpkLib OSIGLPKLIB_PCREQUIRES="coinglpk $OSIGLPKLIB_PCREQUIRES" OSIGLPKLIB_CFLAGS="$GLPK_CFLAGS $OSIGLPKLIB_CFLAGS" OSIGLPKLIB_LIBS="$GLPK_LIBS $OSIGLPKLIB_LIBS" else GLPK_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "coinglpk"` coin_has_glpk=notGiven echo "$as_me:$LINENO: result: not given: $GLPK_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $GLPK_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module Glpk without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module Glpk without pkg-config\"" >&2;} { (exit 1); exit 1; }; } fi # reset PKG_CONFIG_PATH variable PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" export PKG_CONFIG_PATH else echo "$as_me:$LINENO: result: skipped check via pkg-config, redirect to fallback" >&5 echo "${ECHO_T}skipped check via pkg-config, redirect to fallback" >&6 echo "$as_me:$LINENO: checking for COIN-OR package Glpk (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package Glpk (fallback)... $ECHO_C" >&6 coin_has_glpk=notGiven GLPK_LIBS= GLPK_LIBS_INSTALLED= GLPK_CFLAGS= GLPK_CFLAGS_INSTALLED= GLPK_DATA= GLPK_DATA_INSTALLED= GLPK_PCLIBS= GLPK_PCREQUIRES= # initial list of dependencies is "coinglpk", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="coinglpk" # we first expand the list of projects to process by adding all dependencies just behind the project which depends on it # further, we collect the list of corresponding .pc files, but do this in reverse order, because we need this order afterwards # the latter we also do with .pc files corresponding to the installed projects, which will be needed to setup Makefiles for examples # also, we setup the DATA variable allproj="" allpcfiles="" allpcifiles="" while test "x$projtoprocess" != x ; do for proj in $projtoprocess ; do # if $proj is available and configured, then a project-uninstalled.pc file should have been created, so search for it pcfile="" save_IFS="$IFS" IFS=":" for dir in $COIN_PKG_CONFIG_PATH_UNINSTALLED ; do # the base directory configure should have setup coin_subdirs.txt in a way that it does not contain projects that should be skipped, so we do not need to test this here again if test -r "$dir/${proj}-uninstalled.pc" ; then pcfile="$dir/$proj-uninstalled.pc" if test -r "$dir/${proj}.pc" ; then pcifile="$dir/${proj}.pc" else { echo "$as_me:$LINENO: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&5 echo "$as_me: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&2;} pcifile= fi break fi done IFS="$save_IFS" if test "x$pcfile" != x ; then # read dependencies from $pcfile and filter it projrequires=`sed -n -e 's/Requires://gp' "$pcfile" | sed -e 's/<\{0,1\}>\{0,1\}=[ ]\{0,\}[^ ]\{1,\}//g'` # add projrequires to the front of the list of projects that have to be processed next # at the same time, remove $proj from this list projtoprocess=`echo $projtoprocess | sed -e "s/$proj/$projrequires/"` # read DATA from $pcfile, if _DATA is still empty if test "x$GLPK_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` GLPK_DATA="$projdatadir" fi allproj="$allproj $proj" allpcfiles="$pcfile:$allpcfiles" else echo "$as_me:$LINENO: result: no, dependency $proj not available" >&5 echo "${ECHO_T}no, dependency $proj not available" >&6 allproj=fail break 2 fi if test "x$pcifile" != x ; then allpcifiles="$pcifile:$allpcifiles" # read DATA_INSTALLED from $pcifile, if _DATA_INSTALLED is still empty if test "x$GLPK_DATA_INSTALLED" = x ; then projdatadir= pcifilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcifile` eval `sh -c "$pcifilemod"` if test "${CYGPATH_W}" != "echo"; then projdatadir="\`\$(CYGPATH_W) ${projdatadir} | sed -e 's/\\\\\\\\/\\\\\\\\\\\\\\\\/g'\`" fi GLPK_DATA_INSTALLED="$projdatadir" fi fi break done # remove spaces on begin of $projtoprocess projtoprocess=`echo $projtoprocess | sed -e 's/^ *//'` done if test "$allproj" != fail ; then # now go through the list of .pc files and assemble compiler and linker flags # important is here to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcfiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi GLPK_CFLAGS="$projcflags $GLPK_CFLAGS" # set LIBS variable GLPK_LIBS="$projlibs $GLPK_LIBS" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # now go through the list of .pc files for installed projects and assemble compiler and linker flags # important is here again to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcifiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi GLPK_CFLAGS_INSTALLED="$projcflags $GLPK_CFLAGS_INSTALLED" # set LIBS variable GLPK_LIBS_INSTALLED="$projlibs $GLPK_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_glpk=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_GLPK 1 _ACEOF # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl), # for the LIBS_INSTALLED, we replace everything of the form "/somepath/" by "`$(CYGPATH_W) /somepath/`", # everything of the form "-lname" by "libname.lib", and # everything of the form "-Lpath" by "-libpath:`$(CYGPATH_W) path` if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then GLPK_LIBS=`echo " $GLPK_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` GLPK_LIBS_INSTALLED=`echo " $GLPK_LIBS_INSTALLED" | sed -e 's/ \(\/[^ ]*\/\)/ \`$(CYGPATH_W) \1\`/g' -e 's/ -l\([^ ]*\)/ lib\1.lib/g' -e 's/ -L\([^ ]*\)/ -libpath:\`$(CYGPATH_W) \1\`/g'` fi GLPK_PCREQUIRES="coinglpk" OSIGLPKLIB_PCREQUIRES="coinglpk $OSIGLPKLIB_PCREQUIRES" OSIGLPKLIB_CFLAGS="$GLPK_CFLAGS $OSIGLPKLIB_CFLAGS" OSIGLPKLIB_LIBS="$GLPK_LIBS $OSIGLPKLIB_LIBS" OSIGLPKLIB_CFLAGS_INSTALLED="$GLPK_CFLAGS_INSTALLED $OSIGLPKLIB_CFLAGS_INSTALLED" OSIGLPKLIB_LIBS_INSTALLED="$GLPK_LIBS_INSTALLED $OSIGLPKLIB_LIBS_INSTALLED" fi if test $coin_has_glpk != notGiven && test $coin_has_glpk != skipping; then COIN_HAS_GLPK_TRUE= COIN_HAS_GLPK_FALSE='#' else COIN_HAS_GLPK_TRUE='#' COIN_HAS_GLPK_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_glpk" >&5 echo "${ECHO_T}$coin_has_glpk" >&6 fi if test $coin_has_glpk != skipping && test $coin_has_glpk != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_GLPK 1 _ACEOF # Check whether --enable-interpackage-dependencies or --disable-interpackage-dependencies was given. if test "${enable_interpackage_dependencies+set}" = set; then enableval="$enable_interpackage_dependencies" else enable_interpackage_dependencies=yes fi; if test $enable_interpackage_dependencies = yes ; then # construct dependencies variables from LIBS variables # we add an extra space in LIBS so we can substitute out everything starting with " -" # remove everything of the form -framework xxx as used on Mac and mkl* and libiomp5* and wsock32.lib as used on Windows # then remove everything of the form -xxx # also remove everything of the form `xxx`yyy (may have been added for cygwin/cl) GLPK_DEPENDENCIES=`echo " $GLPK_LIBS" | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` OSIGLPKLIB_DEPENDENCIES=`echo " $OSIGLPKLIB_LIBS " | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` fi if test 1 = 0 ; then #change this test to enable a bit of debugging output if test -n "$GLPK_CFLAGS" ; then { echo "$as_me:$LINENO: Glpk CFLAGS are $GLPK_CFLAGS" >&5 echo "$as_me: Glpk CFLAGS are $GLPK_CFLAGS" >&6;} fi if test -n "$GLPK_LIBS" ; then { echo "$as_me:$LINENO: Glpk LIBS are $GLPK_LIBS" >&5 echo "$as_me: Glpk LIBS are $GLPK_LIBS" >&6;} fi if test -n "$GLPK_DEPENDENCIES" ; then { echo "$as_me:$LINENO: Glpk DEPENDENCIES are $GLPK_DEPENDENCIES" >&5 echo "$as_me: Glpk DEPENDENCIES are $GLPK_DEPENDENCIES" >&6;} fi if test -n "$GLPK_DATA" ; then { echo "$as_me:$LINENO: Glpk DATA is $GLPK_DATA" >&5 echo "$as_me: Glpk DATA is $GLPK_DATA" >&6;} fi if test -n "$GLPK_PCLIBS" ; then { echo "$as_me:$LINENO: Glpk PCLIBS are $GLPK_PCLIBS" >&5 echo "$as_me: Glpk PCLIBS are $GLPK_PCLIBS" >&6;} fi if test -n "$GLPK_PCREQUIRES" ; then { echo "$as_me:$LINENO: Glpk PCREQUIRES are $GLPK_PCREQUIRES" >&5 echo "$as_me: Glpk PCREQUIRES are $GLPK_PCREQUIRES" >&6;} fi { echo "$as_me:$LINENO: OsiGlpkLib CFLAGS are $OSIGLPKLIB_CFLAGS" >&5 echo "$as_me: OsiGlpkLib CFLAGS are $OSIGLPKLIB_CFLAGS" >&6;} { echo "$as_me:$LINENO: OsiGlpkLib LIBS are $OSIGLPKLIB_LIBS" >&5 echo "$as_me: OsiGlpkLib LIBS are $OSIGLPKLIB_LIBS" >&6;} { echo "$as_me:$LINENO: OsiGlpkLib DEPENDENCIES are $OSIGLPKLIB_DEPENDENCIES" >&5 echo "$as_me: OsiGlpkLib DEPENDENCIES are $OSIGLPKLIB_DEPENDENCIES" >&6;} fi fi # Define the Makefile conditional if test $coin_has_glpk != notGiven && test $coin_has_glpk != skipping; then COIN_HAS_GLPK_TRUE= COIN_HAS_GLPK_FALSE='#' else COIN_HAS_GLPK_TRUE='#' COIN_HAS_GLPK_FALSE= fi echo "$as_me:$LINENO: checking for COIN-OR package SoPlex" >&5 echo $ECHO_N "checking for COIN-OR package SoPlex... $ECHO_C" >&6 coin_has_soplex=notGiven # check if user wants to skip package in any case if test x"$COIN_SKIP_PROJECTS" != x; then for dir in $COIN_SKIP_PROJECTS; do if test $dir = "SoPlex"; then coin_has_soplex=skipping fi done fi if test "$coin_has_soplex" != skipping; then # Check whether --with-m4_tolower(SoPlex) or --without-m4_tolower(SoPlex) was given. if test "${with_soplex+set}" = set; then withval="$with_soplex" if test "$withval" = no ; then coin_has_soplex=skipping fi fi; fi SOPLEX_LIBS= SOPLEX_CFLAGS= SOPLEX_DATA= SOPLEX_DEPENDENCIES= SOPLEX_PCLIBS= SOPLEX_PCREQUIRES= SOPLEX_DATA= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_soplex != skipping; then # Check whether --with-m4_tolower(SoPlex)-lib or --without-m4_tolower(SoPlex)-lib was given. if test "${with_soplex_lib+set}" = set; then withval="$with_soplex_lib" if test "$withval" = no ; then coin_has_soplex=skipping else coin_has_soplex=yes SOPLEX_LIBS="$withval" SOPLEX_PCLIBS="$withval" OSISPXLIB_PCLIBS="$withval $OSISPXLIB_PCLIBS" OSISPXLIB_LIBS="$withval $OSISPXLIB_LIBS" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then SOPLEX_LIBS_INSTALLED="$withval" OSISPXLIB_LIBS_INSTALLED="$withval $OSISPXLIB_LIBS_INSTALLED" fi fi fi; fi if test $coin_has_soplex != skipping; then # Check whether --with-m4_tolower(SoPlex)-incdir or --without-m4_tolower(SoPlex)-incdir was given. if test "${with_soplex_incdir+set}" = set; then withval="$with_soplex_incdir" if test "$withval" = no ; then coin_has_soplex=skipping else coin_has_soplex=yes SOPLEX_CFLAGS="-I`${CYGPATH_W} $withval`" OSISPXLIB_CFLAGS="-I`${CYGPATH_W} $withval` $OSISPXLIB_CFLAGS" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then SOPLEX_CFLAGS_INSTALLED="$SOPLEX_CFLAGS" OSISPXLIB_CFLAGS_INSTALLED="$SOPLEX_CFLAGS $OSISPXLIB_CFLAGS_INSTALLED" fi fi fi; fi if test $coin_has_soplex != skipping; then # Check whether --with-m4_tolower(SoPlex)-datadir or --without-m4_tolower(SoPlex)-datadir was given. if test "${with_soplex_datadir+set}" = set; then withval="$with_soplex_datadir" if test "$withval" = no ; then coin_has_soplex=skipping else coin_has_soplex=yes SOPLEX_DATA="$withval" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then SOPLEX_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_soplex = notGiven; then if test -n "$PKG_CONFIG" ; then # set search path for pkg-config # need to export variable to be sure that the following pkg-config gets these values coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH:$COIN_PKG_CONFIG_PATH_UNINSTALLED" export PKG_CONFIG_PATH # let pkg-config do it's magic if test -n "$PKG_CONFIG" ; then if $PKG_CONFIG --exists "coinsoplex"; then SOPLEX_VERSIONS=`$PKG_CONFIG --modversion "coinsoplex" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "coinsoplex" 2>/dev/null` # pkg-config cannot handle spaces, so CYGPATH_W cannot be put into .pc files # thus, we modify the cflags extracted from pkg-config by putting CYGPATH_W behind -I's # but only do this if is not trivial if test "$CYGPATH_W" != "echo" ; then # need to put into brackets since otherwise autoconf replaces the brackets in the sed command cflags=`echo $cflags | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi SOPLEX_CFLAGS="$cflags" SOPLEX_LIBS=`$PKG_CONFIG --libs "coinsoplex" 2>/dev/null` SOPLEX_DATA=`$PKG_CONFIG --variable=datadir "coinsoplex" 2>/dev/null` coin_has_soplex=yes echo "$as_me:$LINENO: result: yes: $SOPLEX_VERSIONS" >&5 echo "${ECHO_T}yes: $SOPLEX_VERSIONS" >&6 # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl) if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then SOPLEX_LIBS=`echo " $SOPLEX_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi SOPLEX_PCREQUIRES="coinsoplex" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in OsiSpxLib OSISPXLIB_PCREQUIRES="coinsoplex $OSISPXLIB_PCREQUIRES" OSISPXLIB_CFLAGS="$SOPLEX_CFLAGS $OSISPXLIB_CFLAGS" OSISPXLIB_LIBS="$SOPLEX_LIBS $OSISPXLIB_LIBS" else SOPLEX_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "coinsoplex"` coin_has_soplex=notGiven echo "$as_me:$LINENO: result: not given: $SOPLEX_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $SOPLEX_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module SoPlex without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module SoPlex without pkg-config\"" >&2;} { (exit 1); exit 1; }; } fi # reset PKG_CONFIG_PATH variable PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" export PKG_CONFIG_PATH else echo "$as_me:$LINENO: result: skipped check via pkg-config, redirect to fallback" >&5 echo "${ECHO_T}skipped check via pkg-config, redirect to fallback" >&6 echo "$as_me:$LINENO: checking for COIN-OR package SoPlex (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package SoPlex (fallback)... $ECHO_C" >&6 coin_has_soplex=notGiven SOPLEX_LIBS= SOPLEX_LIBS_INSTALLED= SOPLEX_CFLAGS= SOPLEX_CFLAGS_INSTALLED= SOPLEX_DATA= SOPLEX_DATA_INSTALLED= SOPLEX_PCLIBS= SOPLEX_PCREQUIRES= # initial list of dependencies is "coinsoplex", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="coinsoplex" # we first expand the list of projects to process by adding all dependencies just behind the project which depends on it # further, we collect the list of corresponding .pc files, but do this in reverse order, because we need this order afterwards # the latter we also do with .pc files corresponding to the installed projects, which will be needed to setup Makefiles for examples # also, we setup the DATA variable allproj="" allpcfiles="" allpcifiles="" while test "x$projtoprocess" != x ; do for proj in $projtoprocess ; do # if $proj is available and configured, then a project-uninstalled.pc file should have been created, so search for it pcfile="" save_IFS="$IFS" IFS=":" for dir in $COIN_PKG_CONFIG_PATH_UNINSTALLED ; do # the base directory configure should have setup coin_subdirs.txt in a way that it does not contain projects that should be skipped, so we do not need to test this here again if test -r "$dir/${proj}-uninstalled.pc" ; then pcfile="$dir/$proj-uninstalled.pc" if test -r "$dir/${proj}.pc" ; then pcifile="$dir/${proj}.pc" else { echo "$as_me:$LINENO: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&5 echo "$as_me: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&2;} pcifile= fi break fi done IFS="$save_IFS" if test "x$pcfile" != x ; then # read dependencies from $pcfile and filter it projrequires=`sed -n -e 's/Requires://gp' "$pcfile" | sed -e 's/<\{0,1\}>\{0,1\}=[ ]\{0,\}[^ ]\{1,\}//g'` # add projrequires to the front of the list of projects that have to be processed next # at the same time, remove $proj from this list projtoprocess=`echo $projtoprocess | sed -e "s/$proj/$projrequires/"` # read DATA from $pcfile, if _DATA is still empty if test "x$SOPLEX_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` SOPLEX_DATA="$projdatadir" fi allproj="$allproj $proj" allpcfiles="$pcfile:$allpcfiles" else echo "$as_me:$LINENO: result: no, dependency $proj not available" >&5 echo "${ECHO_T}no, dependency $proj not available" >&6 allproj=fail break 2 fi if test "x$pcifile" != x ; then allpcifiles="$pcifile:$allpcifiles" # read DATA_INSTALLED from $pcifile, if _DATA_INSTALLED is still empty if test "x$SOPLEX_DATA_INSTALLED" = x ; then projdatadir= pcifilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcifile` eval `sh -c "$pcifilemod"` if test "${CYGPATH_W}" != "echo"; then projdatadir="\`\$(CYGPATH_W) ${projdatadir} | sed -e 's/\\\\\\\\/\\\\\\\\\\\\\\\\/g'\`" fi SOPLEX_DATA_INSTALLED="$projdatadir" fi fi break done # remove spaces on begin of $projtoprocess projtoprocess=`echo $projtoprocess | sed -e 's/^ *//'` done if test "$allproj" != fail ; then # now go through the list of .pc files and assemble compiler and linker flags # important is here to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcfiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi SOPLEX_CFLAGS="$projcflags $SOPLEX_CFLAGS" # set LIBS variable SOPLEX_LIBS="$projlibs $SOPLEX_LIBS" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # now go through the list of .pc files for installed projects and assemble compiler and linker flags # important is here again to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcifiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi SOPLEX_CFLAGS_INSTALLED="$projcflags $SOPLEX_CFLAGS_INSTALLED" # set LIBS variable SOPLEX_LIBS_INSTALLED="$projlibs $SOPLEX_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_soplex=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_SOPLEX 1 _ACEOF # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl), # for the LIBS_INSTALLED, we replace everything of the form "/somepath/" by "`$(CYGPATH_W) /somepath/`", # everything of the form "-lname" by "libname.lib", and # everything of the form "-Lpath" by "-libpath:`$(CYGPATH_W) path` if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then SOPLEX_LIBS=`echo " $SOPLEX_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` SOPLEX_LIBS_INSTALLED=`echo " $SOPLEX_LIBS_INSTALLED" | sed -e 's/ \(\/[^ ]*\/\)/ \`$(CYGPATH_W) \1\`/g' -e 's/ -l\([^ ]*\)/ lib\1.lib/g' -e 's/ -L\([^ ]*\)/ -libpath:\`$(CYGPATH_W) \1\`/g'` fi SOPLEX_PCREQUIRES="coinsoplex" OSISPXLIB_PCREQUIRES="coinsoplex $OSISPXLIB_PCREQUIRES" OSISPXLIB_CFLAGS="$SOPLEX_CFLAGS $OSISPXLIB_CFLAGS" OSISPXLIB_LIBS="$SOPLEX_LIBS $OSISPXLIB_LIBS" OSISPXLIB_CFLAGS_INSTALLED="$SOPLEX_CFLAGS_INSTALLED $OSISPXLIB_CFLAGS_INSTALLED" OSISPXLIB_LIBS_INSTALLED="$SOPLEX_LIBS_INSTALLED $OSISPXLIB_LIBS_INSTALLED" fi if test $coin_has_soplex != notGiven && test $coin_has_soplex != skipping; then COIN_HAS_SOPLEX_TRUE= COIN_HAS_SOPLEX_FALSE='#' else COIN_HAS_SOPLEX_TRUE='#' COIN_HAS_SOPLEX_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_soplex" >&5 echo "${ECHO_T}$coin_has_soplex" >&6 fi if test $coin_has_soplex != skipping && test $coin_has_soplex != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_SOPLEX 1 _ACEOF # Check whether --enable-interpackage-dependencies or --disable-interpackage-dependencies was given. if test "${enable_interpackage_dependencies+set}" = set; then enableval="$enable_interpackage_dependencies" else enable_interpackage_dependencies=yes fi; if test $enable_interpackage_dependencies = yes ; then # construct dependencies variables from LIBS variables # we add an extra space in LIBS so we can substitute out everything starting with " -" # remove everything of the form -framework xxx as used on Mac and mkl* and libiomp5* and wsock32.lib as used on Windows # then remove everything of the form -xxx # also remove everything of the form `xxx`yyy (may have been added for cygwin/cl) SOPLEX_DEPENDENCIES=`echo " $SOPLEX_LIBS" | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` OSISPXLIB_DEPENDENCIES=`echo " $OSISPXLIB_LIBS " | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` fi if test 1 = 0 ; then #change this test to enable a bit of debugging output if test -n "$SOPLEX_CFLAGS" ; then { echo "$as_me:$LINENO: SoPlex CFLAGS are $SOPLEX_CFLAGS" >&5 echo "$as_me: SoPlex CFLAGS are $SOPLEX_CFLAGS" >&6;} fi if test -n "$SOPLEX_LIBS" ; then { echo "$as_me:$LINENO: SoPlex LIBS are $SOPLEX_LIBS" >&5 echo "$as_me: SoPlex LIBS are $SOPLEX_LIBS" >&6;} fi if test -n "$SOPLEX_DEPENDENCIES" ; then { echo "$as_me:$LINENO: SoPlex DEPENDENCIES are $SOPLEX_DEPENDENCIES" >&5 echo "$as_me: SoPlex DEPENDENCIES are $SOPLEX_DEPENDENCIES" >&6;} fi if test -n "$SOPLEX_DATA" ; then { echo "$as_me:$LINENO: SoPlex DATA is $SOPLEX_DATA" >&5 echo "$as_me: SoPlex DATA is $SOPLEX_DATA" >&6;} fi if test -n "$SOPLEX_PCLIBS" ; then { echo "$as_me:$LINENO: SoPlex PCLIBS are $SOPLEX_PCLIBS" >&5 echo "$as_me: SoPlex PCLIBS are $SOPLEX_PCLIBS" >&6;} fi if test -n "$SOPLEX_PCREQUIRES" ; then { echo "$as_me:$LINENO: SoPlex PCREQUIRES are $SOPLEX_PCREQUIRES" >&5 echo "$as_me: SoPlex PCREQUIRES are $SOPLEX_PCREQUIRES" >&6;} fi { echo "$as_me:$LINENO: OsiSpxLib CFLAGS are $OSISPXLIB_CFLAGS" >&5 echo "$as_me: OsiSpxLib CFLAGS are $OSISPXLIB_CFLAGS" >&6;} { echo "$as_me:$LINENO: OsiSpxLib LIBS are $OSISPXLIB_LIBS" >&5 echo "$as_me: OsiSpxLib LIBS are $OSISPXLIB_LIBS" >&6;} { echo "$as_me:$LINENO: OsiSpxLib DEPENDENCIES are $OSISPXLIB_DEPENDENCIES" >&5 echo "$as_me: OsiSpxLib DEPENDENCIES are $OSISPXLIB_DEPENDENCIES" >&6;} fi fi # Define the Makefile conditional if test $coin_has_soplex != notGiven && test $coin_has_soplex != skipping; then COIN_HAS_SOPLEX_TRUE= COIN_HAS_SOPLEX_FALSE='#' else COIN_HAS_SOPLEX_TRUE='#' COIN_HAS_SOPLEX_FALSE= fi echo "$as_me:$LINENO: checking for COIN-OR package Sample" >&5 echo $ECHO_N "checking for COIN-OR package Sample... $ECHO_C" >&6 coin_has_sample=notGiven # check if user wants to skip package in any case if test x"$COIN_SKIP_PROJECTS" != x; then for dir in $COIN_SKIP_PROJECTS; do if test $dir = "Sample"; then coin_has_sample=skipping fi done fi if test "$coin_has_sample" != skipping; then # Check whether --with-m4_tolower(Sample) or --without-m4_tolower(Sample) was given. if test "${with_sample+set}" = set; then withval="$with_sample" if test "$withval" = no ; then coin_has_sample=skipping fi fi; fi SAMPLE_LIBS= SAMPLE_CFLAGS= SAMPLE_DATA= SAMPLE_DEPENDENCIES= SAMPLE_PCLIBS= SAMPLE_PCREQUIRES= SAMPLE_DATA= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_sample != skipping; then # Check whether --with-m4_tolower(Sample)-lib or --without-m4_tolower(Sample)-lib was given. if test "${with_sample_lib+set}" = set; then withval="$with_sample_lib" if test "$withval" = no ; then coin_has_sample=skipping else coin_has_sample=yes SAMPLE_LIBS="$withval" SAMPLE_PCLIBS="$withval" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then SAMPLE_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_sample != skipping; then # Check whether --with-m4_tolower(Sample)-incdir or --without-m4_tolower(Sample)-incdir was given. if test "${with_sample_incdir+set}" = set; then withval="$with_sample_incdir" if test "$withval" = no ; then coin_has_sample=skipping else coin_has_sample=yes SAMPLE_CFLAGS="-I`${CYGPATH_W} $withval`" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then SAMPLE_CFLAGS_INSTALLED="$SAMPLE_CFLAGS" fi fi fi; fi if test $coin_has_sample != skipping; then # Check whether --with-m4_tolower(Sample)-datadir or --without-m4_tolower(Sample)-datadir was given. if test "${with_sample_datadir+set}" = set; then withval="$with_sample_datadir" if test "$withval" = no ; then coin_has_sample=skipping else coin_has_sample=yes SAMPLE_DATA="$withval" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then SAMPLE_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_sample = notGiven; then if test -n "$PKG_CONFIG" ; then # set search path for pkg-config # need to export variable to be sure that the following pkg-config gets these values coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH:$COIN_PKG_CONFIG_PATH_UNINSTALLED" export PKG_CONFIG_PATH # let pkg-config do it's magic if test -n "$PKG_CONFIG" ; then if $PKG_CONFIG --exists "coindatasample"; then SAMPLE_VERSIONS=`$PKG_CONFIG --modversion "coindatasample" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "coindatasample" 2>/dev/null` # pkg-config cannot handle spaces, so CYGPATH_W cannot be put into .pc files # thus, we modify the cflags extracted from pkg-config by putting CYGPATH_W behind -I's # but only do this if is not trivial if test "$CYGPATH_W" != "echo" ; then # need to put into brackets since otherwise autoconf replaces the brackets in the sed command cflags=`echo $cflags | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi SAMPLE_CFLAGS="$cflags" SAMPLE_LIBS=`$PKG_CONFIG --libs "coindatasample" 2>/dev/null` SAMPLE_DATA=`$PKG_CONFIG --variable=datadir "coindatasample" 2>/dev/null` coin_has_sample=yes echo "$as_me:$LINENO: result: yes: $SAMPLE_VERSIONS" >&5 echo "${ECHO_T}yes: $SAMPLE_VERSIONS" >&6 # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl) if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then SAMPLE_LIBS=`echo " $SAMPLE_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi SAMPLE_PCREQUIRES="coindatasample" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else SAMPLE_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "coindatasample"` coin_has_sample=notGiven echo "$as_me:$LINENO: result: not given: $SAMPLE_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $SAMPLE_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module Sample without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module Sample without pkg-config\"" >&2;} { (exit 1); exit 1; }; } fi # reset PKG_CONFIG_PATH variable PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" export PKG_CONFIG_PATH else echo "$as_me:$LINENO: result: skipped check via pkg-config, redirect to fallback" >&5 echo "${ECHO_T}skipped check via pkg-config, redirect to fallback" >&6 echo "$as_me:$LINENO: checking for COIN-OR package Sample (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package Sample (fallback)... $ECHO_C" >&6 coin_has_sample=notGiven SAMPLE_LIBS= SAMPLE_LIBS_INSTALLED= SAMPLE_CFLAGS= SAMPLE_CFLAGS_INSTALLED= SAMPLE_DATA= SAMPLE_DATA_INSTALLED= SAMPLE_PCLIBS= SAMPLE_PCREQUIRES= # initial list of dependencies is "coindatasample", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="coindatasample" # we first expand the list of projects to process by adding all dependencies just behind the project which depends on it # further, we collect the list of corresponding .pc files, but do this in reverse order, because we need this order afterwards # the latter we also do with .pc files corresponding to the installed projects, which will be needed to setup Makefiles for examples # also, we setup the DATA variable allproj="" allpcfiles="" allpcifiles="" while test "x$projtoprocess" != x ; do for proj in $projtoprocess ; do # if $proj is available and configured, then a project-uninstalled.pc file should have been created, so search for it pcfile="" save_IFS="$IFS" IFS=":" for dir in $COIN_PKG_CONFIG_PATH_UNINSTALLED ; do # the base directory configure should have setup coin_subdirs.txt in a way that it does not contain projects that should be skipped, so we do not need to test this here again if test -r "$dir/${proj}-uninstalled.pc" ; then pcfile="$dir/$proj-uninstalled.pc" if test -r "$dir/${proj}.pc" ; then pcifile="$dir/${proj}.pc" else { echo "$as_me:$LINENO: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&5 echo "$as_me: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&2;} pcifile= fi break fi done IFS="$save_IFS" if test "x$pcfile" != x ; then # read dependencies from $pcfile and filter it projrequires=`sed -n -e 's/Requires://gp' "$pcfile" | sed -e 's/<\{0,1\}>\{0,1\}=[ ]\{0,\}[^ ]\{1,\}//g'` # add projrequires to the front of the list of projects that have to be processed next # at the same time, remove $proj from this list projtoprocess=`echo $projtoprocess | sed -e "s/$proj/$projrequires/"` # read DATA from $pcfile, if _DATA is still empty if test "x$SAMPLE_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` SAMPLE_DATA="$projdatadir" fi allproj="$allproj $proj" allpcfiles="$pcfile:$allpcfiles" else echo "$as_me:$LINENO: result: no, dependency $proj not available" >&5 echo "${ECHO_T}no, dependency $proj not available" >&6 allproj=fail break 2 fi if test "x$pcifile" != x ; then allpcifiles="$pcifile:$allpcifiles" # read DATA_INSTALLED from $pcifile, if _DATA_INSTALLED is still empty if test "x$SAMPLE_DATA_INSTALLED" = x ; then projdatadir= pcifilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcifile` eval `sh -c "$pcifilemod"` if test "${CYGPATH_W}" != "echo"; then projdatadir="\`\$(CYGPATH_W) ${projdatadir} | sed -e 's/\\\\\\\\/\\\\\\\\\\\\\\\\/g'\`" fi SAMPLE_DATA_INSTALLED="$projdatadir" fi fi break done # remove spaces on begin of $projtoprocess projtoprocess=`echo $projtoprocess | sed -e 's/^ *//'` done if test "$allproj" != fail ; then # now go through the list of .pc files and assemble compiler and linker flags # important is here to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcfiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi SAMPLE_CFLAGS="$projcflags $SAMPLE_CFLAGS" # set LIBS variable SAMPLE_LIBS="$projlibs $SAMPLE_LIBS" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # now go through the list of .pc files for installed projects and assemble compiler and linker flags # important is here again to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcifiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi SAMPLE_CFLAGS_INSTALLED="$projcflags $SAMPLE_CFLAGS_INSTALLED" # set LIBS variable SAMPLE_LIBS_INSTALLED="$projlibs $SAMPLE_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_sample=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_SAMPLE 1 _ACEOF # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl), # for the LIBS_INSTALLED, we replace everything of the form "/somepath/" by "`$(CYGPATH_W) /somepath/`", # everything of the form "-lname" by "libname.lib", and # everything of the form "-Lpath" by "-libpath:`$(CYGPATH_W) path` if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then SAMPLE_LIBS=`echo " $SAMPLE_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` SAMPLE_LIBS_INSTALLED=`echo " $SAMPLE_LIBS_INSTALLED" | sed -e 's/ \(\/[^ ]*\/\)/ \`$(CYGPATH_W) \1\`/g' -e 's/ -l\([^ ]*\)/ lib\1.lib/g' -e 's/ -L\([^ ]*\)/ -libpath:\`$(CYGPATH_W) \1\`/g'` fi SAMPLE_PCREQUIRES="coindatasample" fi if test $coin_has_sample != notGiven && test $coin_has_sample != skipping; then COIN_HAS_SAMPLE_TRUE= COIN_HAS_SAMPLE_FALSE='#' else COIN_HAS_SAMPLE_TRUE='#' COIN_HAS_SAMPLE_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_sample" >&5 echo "${ECHO_T}$coin_has_sample" >&6 fi if test $coin_has_sample != skipping && test $coin_has_sample != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_SAMPLE 1 _ACEOF # Check whether --enable-interpackage-dependencies or --disable-interpackage-dependencies was given. if test "${enable_interpackage_dependencies+set}" = set; then enableval="$enable_interpackage_dependencies" else enable_interpackage_dependencies=yes fi; if test $enable_interpackage_dependencies = yes ; then # construct dependencies variables from LIBS variables # we add an extra space in LIBS so we can substitute out everything starting with " -" # remove everything of the form -framework xxx as used on Mac and mkl* and libiomp5* and wsock32.lib as used on Windows # then remove everything of the form -xxx # also remove everything of the form `xxx`yyy (may have been added for cygwin/cl) SAMPLE_DEPENDENCIES=`echo " $SAMPLE_LIBS" | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` fi if test 1 = 0 ; then #change this test to enable a bit of debugging output if test -n "$SAMPLE_CFLAGS" ; then { echo "$as_me:$LINENO: Sample CFLAGS are $SAMPLE_CFLAGS" >&5 echo "$as_me: Sample CFLAGS are $SAMPLE_CFLAGS" >&6;} fi if test -n "$SAMPLE_LIBS" ; then { echo "$as_me:$LINENO: Sample LIBS are $SAMPLE_LIBS" >&5 echo "$as_me: Sample LIBS are $SAMPLE_LIBS" >&6;} fi if test -n "$SAMPLE_DEPENDENCIES" ; then { echo "$as_me:$LINENO: Sample DEPENDENCIES are $SAMPLE_DEPENDENCIES" >&5 echo "$as_me: Sample DEPENDENCIES are $SAMPLE_DEPENDENCIES" >&6;} fi if test -n "$SAMPLE_DATA" ; then { echo "$as_me:$LINENO: Sample DATA is $SAMPLE_DATA" >&5 echo "$as_me: Sample DATA is $SAMPLE_DATA" >&6;} fi if test -n "$SAMPLE_PCLIBS" ; then { echo "$as_me:$LINENO: Sample PCLIBS are $SAMPLE_PCLIBS" >&5 echo "$as_me: Sample PCLIBS are $SAMPLE_PCLIBS" >&6;} fi if test -n "$SAMPLE_PCREQUIRES" ; then { echo "$as_me:$LINENO: Sample PCREQUIRES are $SAMPLE_PCREQUIRES" >&5 echo "$as_me: Sample PCREQUIRES are $SAMPLE_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_sample != notGiven && test $coin_has_sample != skipping; then COIN_HAS_SAMPLE_TRUE= COIN_HAS_SAMPLE_FALSE='#' else COIN_HAS_SAMPLE_TRUE='#' COIN_HAS_SAMPLE_FALSE= fi echo "$as_me:$LINENO: checking for COIN-OR package Netlib" >&5 echo $ECHO_N "checking for COIN-OR package Netlib... $ECHO_C" >&6 coin_has_netlib=notGiven # check if user wants to skip package in any case if test x"$COIN_SKIP_PROJECTS" != x; then for dir in $COIN_SKIP_PROJECTS; do if test $dir = "Netlib"; then coin_has_netlib=skipping fi done fi if test "$coin_has_netlib" != skipping; then # Check whether --with-m4_tolower(Netlib) or --without-m4_tolower(Netlib) was given. if test "${with_netlib+set}" = set; then withval="$with_netlib" if test "$withval" = no ; then coin_has_netlib=skipping fi fi; fi NETLIB_LIBS= NETLIB_CFLAGS= NETLIB_DATA= NETLIB_DEPENDENCIES= NETLIB_PCLIBS= NETLIB_PCREQUIRES= NETLIB_DATA= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_netlib != skipping; then # Check whether --with-m4_tolower(Netlib)-lib or --without-m4_tolower(Netlib)-lib was given. if test "${with_netlib_lib+set}" = set; then withval="$with_netlib_lib" if test "$withval" = no ; then coin_has_netlib=skipping else coin_has_netlib=yes NETLIB_LIBS="$withval" NETLIB_PCLIBS="$withval" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then NETLIB_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_netlib != skipping; then # Check whether --with-m4_tolower(Netlib)-incdir or --without-m4_tolower(Netlib)-incdir was given. if test "${with_netlib_incdir+set}" = set; then withval="$with_netlib_incdir" if test "$withval" = no ; then coin_has_netlib=skipping else coin_has_netlib=yes NETLIB_CFLAGS="-I`${CYGPATH_W} $withval`" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then NETLIB_CFLAGS_INSTALLED="$NETLIB_CFLAGS" fi fi fi; fi if test $coin_has_netlib != skipping; then # Check whether --with-m4_tolower(Netlib)-datadir or --without-m4_tolower(Netlib)-datadir was given. if test "${with_netlib_datadir+set}" = set; then withval="$with_netlib_datadir" if test "$withval" = no ; then coin_has_netlib=skipping else coin_has_netlib=yes NETLIB_DATA="$withval" # if project flags are given by user and we build without pkg-config, then we need to setup the _INSTALLED variables if test -z "$PKG_CONFIG" ; then NETLIB_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_netlib = notGiven; then if test -n "$PKG_CONFIG" ; then # set search path for pkg-config # need to export variable to be sure that the following pkg-config gets these values coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH:$COIN_PKG_CONFIG_PATH_UNINSTALLED" export PKG_CONFIG_PATH # let pkg-config do it's magic if test -n "$PKG_CONFIG" ; then if $PKG_CONFIG --exists "coindatanetlib"; then NETLIB_VERSIONS=`$PKG_CONFIG --modversion "coindatanetlib" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "coindatanetlib" 2>/dev/null` # pkg-config cannot handle spaces, so CYGPATH_W cannot be put into .pc files # thus, we modify the cflags extracted from pkg-config by putting CYGPATH_W behind -I's # but only do this if is not trivial if test "$CYGPATH_W" != "echo" ; then # need to put into brackets since otherwise autoconf replaces the brackets in the sed command cflags=`echo $cflags | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi NETLIB_CFLAGS="$cflags" NETLIB_LIBS=`$PKG_CONFIG --libs "coindatanetlib" 2>/dev/null` NETLIB_DATA=`$PKG_CONFIG --variable=datadir "coindatanetlib" 2>/dev/null` coin_has_netlib=yes echo "$as_me:$LINENO: result: yes: $NETLIB_VERSIONS" >&5 echo "${ECHO_T}yes: $NETLIB_VERSIONS" >&6 # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl) if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then NETLIB_LIBS=`echo " $NETLIB_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi NETLIB_PCREQUIRES="coindatanetlib" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else NETLIB_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "coindatanetlib"` coin_has_netlib=notGiven echo "$as_me:$LINENO: result: not given: $NETLIB_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $NETLIB_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module Netlib without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module Netlib without pkg-config\"" >&2;} { (exit 1); exit 1; }; } fi # reset PKG_CONFIG_PATH variable PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" export PKG_CONFIG_PATH else echo "$as_me:$LINENO: result: skipped check via pkg-config, redirect to fallback" >&5 echo "${ECHO_T}skipped check via pkg-config, redirect to fallback" >&6 echo "$as_me:$LINENO: checking for COIN-OR package Netlib (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package Netlib (fallback)... $ECHO_C" >&6 coin_has_netlib=notGiven NETLIB_LIBS= NETLIB_LIBS_INSTALLED= NETLIB_CFLAGS= NETLIB_CFLAGS_INSTALLED= NETLIB_DATA= NETLIB_DATA_INSTALLED= NETLIB_PCLIBS= NETLIB_PCREQUIRES= # initial list of dependencies is "coindatanetlib", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="coindatanetlib" # we first expand the list of projects to process by adding all dependencies just behind the project which depends on it # further, we collect the list of corresponding .pc files, but do this in reverse order, because we need this order afterwards # the latter we also do with .pc files corresponding to the installed projects, which will be needed to setup Makefiles for examples # also, we setup the DATA variable allproj="" allpcfiles="" allpcifiles="" while test "x$projtoprocess" != x ; do for proj in $projtoprocess ; do # if $proj is available and configured, then a project-uninstalled.pc file should have been created, so search for it pcfile="" save_IFS="$IFS" IFS=":" for dir in $COIN_PKG_CONFIG_PATH_UNINSTALLED ; do # the base directory configure should have setup coin_subdirs.txt in a way that it does not contain projects that should be skipped, so we do not need to test this here again if test -r "$dir/${proj}-uninstalled.pc" ; then pcfile="$dir/$proj-uninstalled.pc" if test -r "$dir/${proj}.pc" ; then pcifile="$dir/${proj}.pc" else { echo "$as_me:$LINENO: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&5 echo "$as_me: WARNING: Found $pcfile, but $dir/${proj}.pc is not available. This may break Makefile's of examples." >&2;} pcifile= fi break fi done IFS="$save_IFS" if test "x$pcfile" != x ; then # read dependencies from $pcfile and filter it projrequires=`sed -n -e 's/Requires://gp' "$pcfile" | sed -e 's/<\{0,1\}>\{0,1\}=[ ]\{0,\}[^ ]\{1,\}//g'` # add projrequires to the front of the list of projects that have to be processed next # at the same time, remove $proj from this list projtoprocess=`echo $projtoprocess | sed -e "s/$proj/$projrequires/"` # read DATA from $pcfile, if _DATA is still empty if test "x$NETLIB_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` NETLIB_DATA="$projdatadir" fi allproj="$allproj $proj" allpcfiles="$pcfile:$allpcfiles" else echo "$as_me:$LINENO: result: no, dependency $proj not available" >&5 echo "${ECHO_T}no, dependency $proj not available" >&6 allproj=fail break 2 fi if test "x$pcifile" != x ; then allpcifiles="$pcifile:$allpcifiles" # read DATA_INSTALLED from $pcifile, if _DATA_INSTALLED is still empty if test "x$NETLIB_DATA_INSTALLED" = x ; then projdatadir= pcifilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcifile` eval `sh -c "$pcifilemod"` if test "${CYGPATH_W}" != "echo"; then projdatadir="\`\$(CYGPATH_W) ${projdatadir} | sed -e 's/\\\\\\\\/\\\\\\\\\\\\\\\\/g'\`" fi NETLIB_DATA_INSTALLED="$projdatadir" fi fi break done # remove spaces on begin of $projtoprocess projtoprocess=`echo $projtoprocess | sed -e 's/^ *//'` done if test "$allproj" != fail ; then # now go through the list of .pc files and assemble compiler and linker flags # important is here to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcfiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi NETLIB_CFLAGS="$projcflags $NETLIB_CFLAGS" # set LIBS variable NETLIB_LIBS="$projlibs $NETLIB_LIBS" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # now go through the list of .pc files for installed projects and assemble compiler and linker flags # important is here again to obey the reverse order that has been setup before, # since then libraries that are required by several others should be after these other libraries pcfilesprocessed="" save_IFS="$IFS" IFS=":" for pcfile in $allpcifiles ; do # if $pcfile has been processed already, skip this round if test "x$pcfilesprocessed" != x ; then for pcfiledone in $pcfilesprocessed ; do if test "$pcfiledone" = "$pcfile" ; then continue 2 fi done fi # modify .pc file to a shell script that prints shell commands for setting the compiler and library flags: # replace "Libs:" by "echo projlibs=" # replace "Cflags:" by "echo projcflags=" # remove every line starting with : pcfilemod=`sed -e 's/Libs:\(.*\)$/echo projlibs=\\\\"\1\\\\"/g' -e 's/Cflags:\(.*\)/echo projcflags=\\\\"\1\\\\"/g' -e '/^[a-zA-Z]*:/d' $pcfile` # set projcflags and projlibs variables by running $pcfilemod # under mingw, the current IFS seem to make the : in the paths of the gfortran libs go away, so we temporarily set IFS back to its default projcflags= projlibs= IFS="$save_IFS" eval `sh -c "$pcfilemod"` IFS=":" # add CYGPATH_W cludge into include flags and set CFLAGS variable if test "${CYGPATH_W}" != "echo"; then projcflags=`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'` fi NETLIB_CFLAGS_INSTALLED="$projcflags $NETLIB_CFLAGS_INSTALLED" # set LIBS variable NETLIB_LIBS_INSTALLED="$projlibs $NETLIB_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_netlib=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_NETLIB 1 _ACEOF # adjust linker flags for (i)cl compiler # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl), # for the LIBS_INSTALLED, we replace everything of the form "/somepath/" by "`$(CYGPATH_W) /somepath/`", # everything of the form "-lname" by "libname.lib", and # everything of the form "-Lpath" by "-libpath:`$(CYGPATH_W) path` if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then NETLIB_LIBS=`echo " $NETLIB_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` NETLIB_LIBS_INSTALLED=`echo " $NETLIB_LIBS_INSTALLED" | sed -e 's/ \(\/[^ ]*\/\)/ \`$(CYGPATH_W) \1\`/g' -e 's/ -l\([^ ]*\)/ lib\1.lib/g' -e 's/ -L\([^ ]*\)/ -libpath:\`$(CYGPATH_W) \1\`/g'` fi NETLIB_PCREQUIRES="coindatanetlib" fi if test $coin_has_netlib != notGiven && test $coin_has_netlib != skipping; then COIN_HAS_NETLIB_TRUE= COIN_HAS_NETLIB_FALSE='#' else COIN_HAS_NETLIB_TRUE='#' COIN_HAS_NETLIB_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_netlib" >&5 echo "${ECHO_T}$coin_has_netlib" >&6 fi if test $coin_has_netlib != skipping && test $coin_has_netlib != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_NETLIB 1 _ACEOF # Check whether --enable-interpackage-dependencies or --disable-interpackage-dependencies was given. if test "${enable_interpackage_dependencies+set}" = set; then enableval="$enable_interpackage_dependencies" else enable_interpackage_dependencies=yes fi; if test $enable_interpackage_dependencies = yes ; then # construct dependencies variables from LIBS variables # we add an extra space in LIBS so we can substitute out everything starting with " -" # remove everything of the form -framework xxx as used on Mac and mkl* and libiomp5* and wsock32.lib as used on Windows # then remove everything of the form -xxx # also remove everything of the form `xxx`yyy (may have been added for cygwin/cl) NETLIB_DEPENDENCIES=`echo " $NETLIB_LIBS" | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` fi if test 1 = 0 ; then #change this test to enable a bit of debugging output if test -n "$NETLIB_CFLAGS" ; then { echo "$as_me:$LINENO: Netlib CFLAGS are $NETLIB_CFLAGS" >&5 echo "$as_me: Netlib CFLAGS are $NETLIB_CFLAGS" >&6;} fi if test -n "$NETLIB_LIBS" ; then { echo "$as_me:$LINENO: Netlib LIBS are $NETLIB_LIBS" >&5 echo "$as_me: Netlib LIBS are $NETLIB_LIBS" >&6;} fi if test -n "$NETLIB_DEPENDENCIES" ; then { echo "$as_me:$LINENO: Netlib DEPENDENCIES are $NETLIB_DEPENDENCIES" >&5 echo "$as_me: Netlib DEPENDENCIES are $NETLIB_DEPENDENCIES" >&6;} fi if test -n "$NETLIB_DATA" ; then { echo "$as_me:$LINENO: Netlib DATA is $NETLIB_DATA" >&5 echo "$as_me: Netlib DATA is $NETLIB_DATA" >&6;} fi if test -n "$NETLIB_PCLIBS" ; then { echo "$as_me:$LINENO: Netlib PCLIBS are $NETLIB_PCLIBS" >&5 echo "$as_me: Netlib PCLIBS are $NETLIB_PCLIBS" >&6;} fi if test -n "$NETLIB_PCREQUIRES" ; then { echo "$as_me:$LINENO: Netlib PCREQUIRES are $NETLIB_PCREQUIRES" >&5 echo "$as_me: Netlib PCREQUIRES are $NETLIB_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_netlib != notGiven && test $coin_has_netlib != skipping; then COIN_HAS_NETLIB_TRUE= COIN_HAS_NETLIB_FALSE='#' else COIN_HAS_NETLIB_TRUE='#' COIN_HAS_NETLIB_FALSE= fi ############################################################################# # Third party solvers # ############################################################################# # Check which third party solvers are available. Cplex detection has been # tested on a semi-regular basis, and Mosek detection most likely works. For # the rest, it's anyone's guess. -- lh, 080529 -- # fixed detection of Mosek and Xpress -- stefan, 091003 (linux32, gcc) -- echo "$as_me:$LINENO: checking if user provides library for Cplex" >&5 echo $ECHO_N "checking if user provides library for Cplex... $ECHO_C" >&6 # Check for header file directory # Check whether --with-cplex-incdir or --without-cplex-incdir was given. if test "${with_cplex_incdir+set}" = set; then withval="$with_cplex_incdir" CPXINCDIR=`cd $withval; pwd` fi; # Check for library directory # Check whether --with-cplex-lib or --without-cplex-lib was given. if test "${with_cplex_lib+set}" = set; then withval="$with_cplex_lib" CPXLIB=$withval fi; # Switch to disable library check if requested # Check whether --enable-cplex-libcheck or --disable-cplex-libcheck was given. if test "${enable_cplex_libcheck+set}" = set; then enableval="$enable_cplex_libcheck" cplex_libcheck=$enableval else cplex_libcheck=yes fi; # At this point, if we're going to use the library, both LBRYINCDIR and # LBRYLIB must be defined and not empty. if test x"$CPXINCDIR" != x || test x"$CPXLIB" != x; then if test x"$CPXINCDIR" = x || test x"$CPXLIB" = x; then { { echo "$as_me:$LINENO: error: You need to specify both an include directory and link flags to use library Cplex. Use --with-cplex-incdir of environment variable $CPXINCDIR to specify the include directory. Use --with-cplex-lib or environment variable $CPXLIB to specify link flags." >&5 echo "$as_me: error: You need to specify both an include directory and link flags to use library Cplex. Use --with-cplex-incdir of environment variable $CPXINCDIR to specify the include directory. Use --with-cplex-lib or environment variable $CPXLIB to specify link flags." >&2;} { (exit 1); exit 1; }; } fi coin_has_cpx=true echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else coin_has_cpx=false echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # If we have instructions for use, consider header and link checks. if test $coin_has_cpx = true; then # If argument 3 (file) is given, check for the file. Typically this will be a # header file, but that's not assumed. if test -r $CPXINCDIR/cplex.h; then : else { { echo "$as_me:$LINENO: error: Cannot find file cplex.h in $CPXINCDIR" >&5 echo "$as_me: error: Cannot find file cplex.h in $CPXINCDIR" >&2;} { (exit 1); exit 1; }; } : fi # Now see if we can link the function. There are arguments for and against # assuming argument 3 is a header file declaring the function. A correct # function declaration is the main argument in favour. Having to cope with # possible dependencies or other oddities are the main arguments against. # Force the use of C as the best single choice amongst C++, C, and Fortran. # Obviously, this has limits. if test x"$cplex_libcheck" != xno; then coin_save_LIBS="$LIBS" LIBS="$CPXLIB " coin_CPX_link=no ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for fnm in CPXgetstat ; do echo "$as_me:$LINENO: checking whether symbol $fnm is available with CPX" >&5 echo $ECHO_N "checking whether symbol $fnm is available with CPX... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $fnm() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 coin_CPX_link=yes break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$coin_save_LIBS" if test x"$coin_CPX_link" != xyes ; then { { echo "$as_me:$LINENO: error: Cannot find symbol(s) CPXgetstat with CPX" >&5 echo "$as_me: error: Cannot find symbol(s) CPXgetstat with CPX" >&2;} { (exit 1); exit 1; }; } fi fi # If we make it this far, we've verified the file and linked the function. Add # the necessary link flags to _{PC}LIBS and define the preprocessor symbol # COIN_HAS_LBRY. cat >>confdefs.h <<\_ACEOF #define COIN_HAS_CPX 1 _ACEOF fi # Arrange for configure to substitute LBRYINCDIR and LBRYLIB and create the # automake conditional. These actions must occur unconditionally. if test $coin_has_cpx = true; then COIN_HAS_CPX_TRUE= COIN_HAS_CPX_FALSE='#' else COIN_HAS_CPX_TRUE='#' COIN_HAS_CPX_FALSE= fi echo "$as_me:$LINENO: checking if user provides library for Mosek" >&5 echo $ECHO_N "checking if user provides library for Mosek... $ECHO_C" >&6 # Check for header file directory # Check whether --with-mosek-incdir or --without-mosek-incdir was given. if test "${with_mosek_incdir+set}" = set; then withval="$with_mosek_incdir" MSKINCDIR=`cd $withval; pwd` fi; # Check for library directory # Check whether --with-mosek-lib or --without-mosek-lib was given. if test "${with_mosek_lib+set}" = set; then withval="$with_mosek_lib" MSKLIB=$withval fi; # Switch to disable library check if requested # Check whether --enable-mosek-libcheck or --disable-mosek-libcheck was given. if test "${enable_mosek_libcheck+set}" = set; then enableval="$enable_mosek_libcheck" mosek_libcheck=$enableval else mosek_libcheck=yes fi; # At this point, if we're going to use the library, both LBRYINCDIR and # LBRYLIB must be defined and not empty. if test x"$MSKINCDIR" != x || test x"$MSKLIB" != x; then if test x"$MSKINCDIR" = x || test x"$MSKLIB" = x; then { { echo "$as_me:$LINENO: error: You need to specify both an include directory and link flags to use library Mosek. Use --with-mosek-incdir of environment variable $MSKINCDIR to specify the include directory. Use --with-mosek-lib or environment variable $MSKLIB to specify link flags." >&5 echo "$as_me: error: You need to specify both an include directory and link flags to use library Mosek. Use --with-mosek-incdir of environment variable $MSKINCDIR to specify the include directory. Use --with-mosek-lib or environment variable $MSKLIB to specify link flags." >&2;} { (exit 1); exit 1; }; } fi coin_has_msk=true echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else coin_has_msk=false echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # If we have instructions for use, consider header and link checks. if test $coin_has_msk = true; then # If argument 3 (file) is given, check for the file. Typically this will be a # header file, but that's not assumed. if test -r $MSKINCDIR/mosek.h; then : else { { echo "$as_me:$LINENO: error: Cannot find file mosek.h in $MSKINCDIR" >&5 echo "$as_me: error: Cannot find file mosek.h in $MSKINCDIR" >&2;} { (exit 1); exit 1; }; } : fi # Now see if we can link the function. There are arguments for and against # assuming argument 3 is a header file declaring the function. A correct # function declaration is the main argument in favour. Having to cope with # possible dependencies or other oddities are the main arguments against. # Force the use of C as the best single choice amongst C++, C, and Fortran. # Obviously, this has limits. if test x"$mosek_libcheck" != xno; then coin_save_LIBS="$LIBS" LIBS="$MSKLIB " coin_MSK_link=no ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for fnm in MSK_makeenv ; do echo "$as_me:$LINENO: checking whether symbol $fnm is available with MSK" >&5 echo $ECHO_N "checking whether symbol $fnm is available with MSK... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $fnm() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 coin_MSK_link=yes break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$coin_save_LIBS" if test x"$coin_MSK_link" != xyes ; then { { echo "$as_me:$LINENO: error: Cannot find symbol(s) MSK_makeenv with MSK" >&5 echo "$as_me: error: Cannot find symbol(s) MSK_makeenv with MSK" >&2;} { (exit 1); exit 1; }; } fi fi # If we make it this far, we've verified the file and linked the function. Add # the necessary link flags to _{PC}LIBS and define the preprocessor symbol # COIN_HAS_LBRY. cat >>confdefs.h <<\_ACEOF #define COIN_HAS_MSK 1 _ACEOF fi # Arrange for configure to substitute LBRYINCDIR and LBRYLIB and create the # automake conditional. These actions must occur unconditionally. if test $coin_has_msk = true; then COIN_HAS_MSK_TRUE= COIN_HAS_MSK_FALSE='#' else COIN_HAS_MSK_TRUE='#' COIN_HAS_MSK_FALSE= fi echo "$as_me:$LINENO: checking if user provides library for Xpress" >&5 echo $ECHO_N "checking if user provides library for Xpress... $ECHO_C" >&6 # Check for header file directory # Check whether --with-xpress-incdir or --without-xpress-incdir was given. if test "${with_xpress_incdir+set}" = set; then withval="$with_xpress_incdir" XPRINCDIR=`cd $withval; pwd` fi; # Check for library directory # Check whether --with-xpress-lib or --without-xpress-lib was given. if test "${with_xpress_lib+set}" = set; then withval="$with_xpress_lib" XPRLIB=$withval fi; # Switch to disable library check if requested # Check whether --enable-xpress-libcheck or --disable-xpress-libcheck was given. if test "${enable_xpress_libcheck+set}" = set; then enableval="$enable_xpress_libcheck" xpress_libcheck=$enableval else xpress_libcheck=yes fi; # At this point, if we're going to use the library, both LBRYINCDIR and # LBRYLIB must be defined and not empty. if test x"$XPRINCDIR" != x || test x"$XPRLIB" != x; then if test x"$XPRINCDIR" = x || test x"$XPRLIB" = x; then { { echo "$as_me:$LINENO: error: You need to specify both an include directory and link flags to use library Xpress. Use --with-xpress-incdir of environment variable $XPRINCDIR to specify the include directory. Use --with-xpress-lib or environment variable $XPRLIB to specify link flags." >&5 echo "$as_me: error: You need to specify both an include directory and link flags to use library Xpress. Use --with-xpress-incdir of environment variable $XPRINCDIR to specify the include directory. Use --with-xpress-lib or environment variable $XPRLIB to specify link flags." >&2;} { (exit 1); exit 1; }; } fi coin_has_xpr=true echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else coin_has_xpr=false echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # If we have instructions for use, consider header and link checks. if test $coin_has_xpr = true; then # If argument 3 (file) is given, check for the file. Typically this will be a # header file, but that's not assumed. if test -r $XPRINCDIR/xprs.h; then : else { { echo "$as_me:$LINENO: error: Cannot find file xprs.h in $XPRINCDIR" >&5 echo "$as_me: error: Cannot find file xprs.h in $XPRINCDIR" >&2;} { (exit 1); exit 1; }; } : fi # Now see if we can link the function. There are arguments for and against # assuming argument 3 is a header file declaring the function. A correct # function declaration is the main argument in favour. Having to cope with # possible dependencies or other oddities are the main arguments against. # Force the use of C as the best single choice amongst C++, C, and Fortran. # Obviously, this has limits. if test x"$xpress_libcheck" != xno; then coin_save_LIBS="$LIBS" LIBS="$XPRLIB " coin_XPR_link=no ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for fnm in XPRSinit ; do echo "$as_me:$LINENO: checking whether symbol $fnm is available with XPR" >&5 echo $ECHO_N "checking whether symbol $fnm is available with XPR... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $fnm() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 coin_XPR_link=yes break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$coin_save_LIBS" if test x"$coin_XPR_link" != xyes ; then { { echo "$as_me:$LINENO: error: Cannot find symbol(s) XPRSinit with XPR" >&5 echo "$as_me: error: Cannot find symbol(s) XPRSinit with XPR" >&2;} { (exit 1); exit 1; }; } fi fi # If we make it this far, we've verified the file and linked the function. Add # the necessary link flags to _{PC}LIBS and define the preprocessor symbol # COIN_HAS_LBRY. cat >>confdefs.h <<\_ACEOF #define COIN_HAS_XPR 1 _ACEOF fi # Arrange for configure to substitute LBRYINCDIR and LBRYLIB and create the # automake conditional. These actions must occur unconditionally. if test $coin_has_xpr = true; then COIN_HAS_XPR_TRUE= COIN_HAS_XPR_FALSE='#' else COIN_HAS_XPR_TRUE='#' COIN_HAS_XPR_FALSE= fi echo "$as_me:$LINENO: checking if user provides library for Gurobi" >&5 echo $ECHO_N "checking if user provides library for Gurobi... $ECHO_C" >&6 # Check for header file directory # Check whether --with-gurobi-incdir or --without-gurobi-incdir was given. if test "${with_gurobi_incdir+set}" = set; then withval="$with_gurobi_incdir" GRBINCDIR=`cd $withval; pwd` fi; # Check for library directory # Check whether --with-gurobi-lib or --without-gurobi-lib was given. if test "${with_gurobi_lib+set}" = set; then withval="$with_gurobi_lib" GRBLIB=$withval fi; # Switch to disable library check if requested # Check whether --enable-gurobi-libcheck or --disable-gurobi-libcheck was given. if test "${enable_gurobi_libcheck+set}" = set; then enableval="$enable_gurobi_libcheck" gurobi_libcheck=$enableval else gurobi_libcheck=yes fi; # At this point, if we're going to use the library, both LBRYINCDIR and # LBRYLIB must be defined and not empty. if test x"$GRBINCDIR" != x || test x"$GRBLIB" != x; then if test x"$GRBINCDIR" = x || test x"$GRBLIB" = x; then { { echo "$as_me:$LINENO: error: You need to specify both an include directory and link flags to use library Gurobi. Use --with-gurobi-incdir of environment variable $GRBINCDIR to specify the include directory. Use --with-gurobi-lib or environment variable $GRBLIB to specify link flags." >&5 echo "$as_me: error: You need to specify both an include directory and link flags to use library Gurobi. Use --with-gurobi-incdir of environment variable $GRBINCDIR to specify the include directory. Use --with-gurobi-lib or environment variable $GRBLIB to specify link flags." >&2;} { (exit 1); exit 1; }; } fi coin_has_grb=true echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else coin_has_grb=false echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # If we have instructions for use, consider header and link checks. if test $coin_has_grb = true; then # If argument 3 (file) is given, check for the file. Typically this will be a # header file, but that's not assumed. if test -r $GRBINCDIR/gurobi_c.h; then : else { { echo "$as_me:$LINENO: error: Cannot find file gurobi_c.h in $GRBINCDIR" >&5 echo "$as_me: error: Cannot find file gurobi_c.h in $GRBINCDIR" >&2;} { (exit 1); exit 1; }; } : fi # Now see if we can link the function. There are arguments for and against # assuming argument 3 is a header file declaring the function. A correct # function declaration is the main argument in favour. Having to cope with # possible dependencies or other oddities are the main arguments against. # Force the use of C as the best single choice amongst C++, C, and Fortran. # Obviously, this has limits. if test x"$gurobi_libcheck" != xno; then coin_save_LIBS="$LIBS" LIBS="$GRBLIB " coin_GRB_link=no ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for fnm in GRBloadenv ; do echo "$as_me:$LINENO: checking whether symbol $fnm is available with GRB" >&5 echo $ECHO_N "checking whether symbol $fnm is available with GRB... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $fnm() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 coin_GRB_link=yes break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$coin_save_LIBS" if test x"$coin_GRB_link" != xyes ; then { { echo "$as_me:$LINENO: error: Cannot find symbol(s) GRBloadenv with GRB" >&5 echo "$as_me: error: Cannot find symbol(s) GRBloadenv with GRB" >&2;} { (exit 1); exit 1; }; } fi fi # If we make it this far, we've verified the file and linked the function. Add # the necessary link flags to _{PC}LIBS and define the preprocessor symbol # COIN_HAS_LBRY. cat >>confdefs.h <<\_ACEOF #define COIN_HAS_GRB 1 _ACEOF fi # Arrange for configure to substitute LBRYINCDIR and LBRYLIB and create the # automake conditional. These actions must occur unconditionally. if test $coin_has_grb = true; then COIN_HAS_GRB_TRUE= COIN_HAS_GRB_FALSE='#' else COIN_HAS_GRB_TRUE='#' COIN_HAS_GRB_FALSE= fi ############################################################################# # Examples solver # ############################################################################# # choose a solver interface that can be used in the examples if test $coin_has_glpk = yes ; then OSI_EXAMPLES_SOLVER_NAME=OsiGlpkSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="$GLPK_CFLAGS" OSI_EXAMPLES_SOLVER_LIBS="-lOsiGlpk $GLPK_LIBS_INSTALLED" OSI_EXAMPLES_SOLVER_PCNAME=osi-glpk elif test $coin_has_cpx = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiCpxSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$CPXINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiCpx $CPXLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-cplex elif test $coin_has_grb = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiGrbSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$GRBINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiGrb $GRBLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-gurobi elif test $coin_has_msk = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiMskSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$MSKINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiMsk $MSKLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-mosek elif test $coin_has_xpr = true ; then OSI_EXAMPLES_SOLVER_NAME=OsiXprSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="-I$XPRINCDIR" OSI_EXAMPLES_SOLVER_LIBS="-lOsiXpr $XPRLIB" OSI_EXAMPLES_SOLVER_PCNAME=osi-xpress elif test $coin_has_soplex = yes ; then OSI_EXAMPLES_SOLVER_NAME=OsiSpxSolverInterface OSI_EXAMPLES_SOLVER_CFLAGS="$SOPLEX_CFLAGS" OSI_EXAMPLES_SOLVER_LIBS="-lOsiSpx $SOPLEX_LIBS_INSTALLED" OSI_EXAMPLES_SOLVER_PCNAME=osi-soplex else { echo "$as_me:$LINENO: WARNING: No solver available, examples will not work." >&5 echo "$as_me: WARNING: No solver available, examples will not work." >&2;} fi # adjust linker flags for (i)cl compiler if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ; then OSI_EXAMPLES_SOLVER_LIBS=`echo " $OSI_EXAMPLES_SOLVER_LIBS" | sed -e 's/ -l\([^ ]*\)/ lib\1.lib/g' -e 's/ -L\([^ ]*\)/ -libpath:\`$(CYGPATH_W) \1\`/g'` fi ############################################################################# # Configuration options for individual OSIs # ############################################################################# # If any of the tests performed in this section actually require the presence # of the solver (file presence, link checks, etc.) be sure to guard the call. # We assume that GLPK is not too old cat >>confdefs.h <<\_ACEOF #define GLPK_HAS_INTOPT 1 _ACEOF ############################################################################# # Check for doxygen # ############################################################################# { echo "$as_me:$LINENO: configuring doxygen documentation options" >&5 echo "$as_me: configuring doxygen documentation options" >&6;} # Check to see if doxygen is available. # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_coin_have_doxygen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$coin_have_doxygen"; then ac_cv_prog_coin_have_doxygen="$coin_have_doxygen" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_coin_have_doxygen="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_coin_have_doxygen" && ac_cv_prog_coin_have_doxygen="no" fi fi coin_have_doxygen=$ac_cv_prog_coin_have_doxygen if test -n "$coin_have_doxygen"; then echo "$as_me:$LINENO: result: $coin_have_doxygen" >&5 echo "${ECHO_T}$coin_have_doxygen" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Look for the dot tool from the graphviz package, unless the user has # disabled it. # Check whether --with-dot or --without-dot was given. if test "${with_dot+set}" = set; then withval="$with_dot" else withval=yes fi; if test x"$withval" = xno ; then coin_doxy_usedot=NO echo "$as_me:$LINENO: checking for dot " >&5 echo $ECHO_N "checking for dot ... $ECHO_C" >&6 echo "$as_me:$LINENO: result: disabled" >&5 echo "${ECHO_T}disabled" >&6 else # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_coin_doxy_usedot+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$coin_doxy_usedot"; then ac_cv_prog_coin_doxy_usedot="$coin_doxy_usedot" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_coin_doxy_usedot="YES" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_coin_doxy_usedot" && ac_cv_prog_coin_doxy_usedot="NO" fi fi coin_doxy_usedot=$ac_cv_prog_coin_doxy_usedot if test -n "$coin_doxy_usedot"; then echo "$as_me:$LINENO: result: $coin_doxy_usedot" >&5 echo "${ECHO_T}$coin_doxy_usedot" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi # Generate a tag file name and a log file name coin_doxy_tagname=doxydoc/${PACKAGE}_doxy.tag coin_doxy_logname=doxydoc/${PACKAGE}_doxy.log # Process the list of project names and massage them into possible doxygen # doc'n directories. Prefer 1) classic external, source processed using # a project-specific doxygen.conf, we use the tag file; 2) classic # external, source processed using package doxygen.conf; 3) installed # doxydoc. Alternatives 1) and 2) are only possible if the directory will be # configured, which we can't know unless this is the package base configure, # since coin_subdirs is only set there. Hence it's sufficient to check for # membership. If we use a tag file from a classic external, exclude the # source from doxygen processing when doxygen runs in the base directory. coin_doxy_tagfiles= coin_doxy_excludes= tmp="CoinUtils" for proj in $tmp ; do lc_proj=`echo $proj | tr [A-Z] [a-z]` echo "$as_me:$LINENO: checking for doxygen doc'n for $proj " >&5 echo $ECHO_N "checking for doxygen doc'n for $proj ... $ECHO_C" >&6 doxytag=${lc_proj}_doxy.tag doxyfound=no for chkProj in $coin_subdirs ; do if test "$chkProj" = "$proj" ; then # proj will be configured, hence doxydoc present in build tree doxysrcdir="${srcdir}/${proj}" # AC_MSG_NOTICE([Considering $doxysrcdir (base)]) if test -d "$doxysrcdir" ; then # with a doxydoc directory? doxydir="$doxysrcdir/doxydoc" # AC_MSG_NOTICE([Considering $doxydir (base)]) # AC_MSG_NOTICE([Subdirs: $coin_subdirs)]) if test -d "$doxydir" ; then # use tag file; don't process source eval doxydir="`pwd`/${proj}/doxydoc" coin_doxy_tagfiles="$coin_doxy_tagfiles $doxydir/$doxytag=$doxydir/html" echo "$as_me:$LINENO: result: $doxydir (tag)" >&5 echo "${ECHO_T}$doxydir (tag)" >&6 coin_doxy_excludes="$coin_doxy_excludes */${proj}" else # will process the source -- nothing further to be done here echo "$as_me:$LINENO: result: $doxysrcdir (src)" >&5 echo "${ECHO_T}$doxysrcdir (src)" >&6 fi doxyfound=yes fi fi done # Not built, fall back to installed tag file if test $doxyfound = no ; then eval doxydir="${datadir}/coin/doc/${proj}/doxydoc" # AC_MSG_NOTICE([Considering $doxydir (install)]) # AC_MSG_NOTICE([Subdirs: $coin_subdirs)]) coin_doxy_tagfiles="$coin_doxy_tagfiles $doxydir/$doxytag=$doxydir/html" echo "$as_me:$LINENO: result: $doxydir (tag)" >&5 echo "${ECHO_T}$doxydir (tag)" >&6 fi done ############################################################################# # System header # ############################################################################# ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #if test x"" = x; then # hdr="#include " #else # hdr="" #fi #AC_CHECK_HEADERS([cmath],[],[],[$hdr]) for ac_header in cmath do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to osi@list.coin-or.org ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_header_cmath" != "yes"; then #if test x"" = x; then # hdr="#include " #else # hdr="" #fi #AC_CHECK_HEADERS([math.h],[],[],[$hdr]) for ac_header in math.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to osi@list.coin-or.org ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #if test x"" = x; then # hdr="#include " #else # hdr="" #fi #AC_CHECK_HEADERS([cfloat],[],[],[$hdr]) for ac_header in cfloat do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to osi@list.coin-or.org ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_header_cfloat" != "yes"; then #if test x"" = x; then # hdr="#include " #else # hdr="" #fi #AC_CHECK_HEADERS([float.h],[],[],[$hdr]) for ac_header in float.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to osi@list.coin-or.org ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #if test x"" = x; then # hdr="#include " #else # hdr="" #fi #AC_CHECK_HEADERS([cieeefp],[],[],[$hdr]) for ac_header in cieeefp do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to osi@list.coin-or.org ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_header_cieeefp" != "yes"; then #if test x"" = x; then # hdr="#include " #else # hdr="" #fi #AC_CHECK_HEADERS([ieeefp.h],[],[],[$hdr]) for ac_header in ieeefp.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to osi@list.coin-or.org ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ############################################################################## # Finishing up by writing all the output # ############################################################################## # Here list all the files that configure should create (except for the # configuration header file) ac_config_files="$ac_config_files Makefile examples/Makefile src/Osi/Makefile src/OsiCpx/Makefile src/OsiGlpk/Makefile src/OsiMsk/Makefile src/OsiXpr/Makefile src/OsiGrb/Makefile src/OsiSpx/Makefile src/OsiCommonTest/Makefile test/Makefile osi.pc osi-uninstalled.pc osi-unittests.pc osi-unittests-uninstalled.pc" if test $coin_has_cpx = true ; then ac_config_files="$ac_config_files osi-cplex.pc:src/OsiCpx/osi-cplex.pc.in osi-cplex-uninstalled.pc:src/OsiCpx/osi-cplex-uninstalled.pc.in" fi if test $coin_has_glpk = yes ; then ac_config_files="$ac_config_files osi-glpk.pc:src/OsiGlpk/osi-glpk.pc.in osi-glpk-uninstalled.pc:src/OsiGlpk/osi-glpk-uninstalled.pc.in" fi if test $coin_has_grb = true ; then ac_config_files="$ac_config_files osi-gurobi.pc:src/OsiGrb/osi-gurobi.pc.in osi-gurobi-uninstalled.pc:src/OsiGrb/osi-gurobi-uninstalled.pc.in" fi if test $coin_has_msk = true ; then ac_config_files="$ac_config_files osi-mosek.pc:src/OsiMsk/osi-mosek.pc.in osi-mosek-uninstalled.pc:src/OsiMsk/osi-mosek-uninstalled.pc.in" fi if test $coin_has_xpr = true ; then ac_config_files="$ac_config_files osi-xpress.pc:src/OsiXpr/osi-xpress.pc.in osi-xpress-uninstalled.pc:src/OsiXpr/osi-xpress-uninstalled.pc.in" fi if test $coin_has_soplex = yes ; then ac_config_files="$ac_config_files osi-soplex.pc:src/OsiSpx/osi-soplex.pc.in osi-soplex-uninstalled.pc:src/OsiSpx/osi-soplex-uninstalled.pc.in" fi ac_config_files="$ac_config_files doxydoc/doxygen.conf" # Here put the location and name of the configuration header file ac_config_headers="$ac_config_headers src/Osi/config.h src/Osi/config_osi.h" # Finally, we let configure write all the output... echo "$as_me:$LINENO: checking which command should be used to link input files" >&5 echo $ECHO_N "checking which command should be used to link input files... $ECHO_C" >&6 coin_link_input_cmd="$LN_S" case "$CC" in clang* ) ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) coin_link_input_cmd=cp ;; esac echo "$as_me:$LINENO: result: $coin_link_input_cmd" >&5 echo "${ECHO_T}$coin_link_input_cmd" >&6 if test x$coin_skip_ac_output != xyes; then # library extension case "$CC" in clang* ) LIBEXT=a ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) LIBEXT=lib ;; *) LIBEXT=a ;; esac # Define VPATH_DISTCLEANFILES to be everything that needs to be # cleaned for distclean in a vpath configuration VPATH_DISTCLEANFILES="$coin_vpath_link_files" # Take out subdirectories if their configuration concluded that they # don't need to be compiled if test x"$coin_ac_skip_subdirs" != x; then new_subdirs= for i in $subdirs; do skipme=no for j in $coin_ac_skip_subdirs; do if test $i = $j; then skipme=yes; fi done if test $skipme = no; then new_subdirs="$new_subdirs $i" fi done subdirs="$new_subdirs" fi # need to come before AC_OUTPUT if test x$coin_projectdir != xyes; then # write coin_subdirs to a file so that project configuration knows where to find uninstalled projects echo $coin_subdirs > coin_subdirs.txt else # substitute for OBJDIR, needed to setup .pc file for uninstalled project ABSBUILDDIR="`pwd`" fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${ALWAYS_FALSE_TRUE}" && test -z "${ALWAYS_FALSE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ALWAYS_FALSE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ALWAYS_FALSE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_CC_IS_CL_TRUE}" && test -z "${COIN_CC_IS_CL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_CC_IS_CL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_CC_IS_CL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_CXX_IS_CL_TRUE}" && test -z "${COIN_CXX_IS_CL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_CXX_IS_CL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_CXX_IS_CL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_EXTERNALS_TRUE}" && test -z "${HAVE_EXTERNALS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_EXTERNALS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_EXTERNALS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DEPENDENCY_LINKING_TRUE}" && test -z "${DEPENDENCY_LINKING_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DEPENDENCY_LINKING\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DEPENDENCY_LINKING\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_PKGCONFIG_TRUE}" && test -z "${COIN_HAS_PKGCONFIG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_PKGCONFIG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_PKGCONFIG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_COINUTILS_TRUE}" && test -z "${COIN_HAS_COINUTILS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_COINUTILS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_COINUTILS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_COINUTILS_TRUE}" && test -z "${COIN_HAS_COINUTILS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_COINUTILS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_COINUTILS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_GLPK_TRUE}" && test -z "${COIN_HAS_GLPK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_GLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_GLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_GLPK_TRUE}" && test -z "${COIN_HAS_GLPK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_GLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_GLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_SOPLEX_TRUE}" && test -z "${COIN_HAS_SOPLEX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_SOPLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_SOPLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_SOPLEX_TRUE}" && test -z "${COIN_HAS_SOPLEX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_SOPLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_SOPLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_SAMPLE_TRUE}" && test -z "${COIN_HAS_SAMPLE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_SAMPLE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_SAMPLE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_SAMPLE_TRUE}" && test -z "${COIN_HAS_SAMPLE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_SAMPLE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_SAMPLE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_NETLIB_TRUE}" && test -z "${COIN_HAS_NETLIB_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_NETLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_NETLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_NETLIB_TRUE}" && test -z "${COIN_HAS_NETLIB_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_NETLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_NETLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_CPX_TRUE}" && test -z "${COIN_HAS_CPX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_CPX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_CPX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_MSK_TRUE}" && test -z "${COIN_HAS_MSK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_MSK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_MSK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_XPR_TRUE}" && test -z "${COIN_HAS_XPR_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_XPR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_XPR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_GRB_TRUE}" && test -z "${COIN_HAS_GRB_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_GRB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_GRB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by Osi $as_me 0.106.4, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ Osi config.status 0.106.4 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "src/Osi/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Osi/Makefile" ;; "src/OsiCpx/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OsiCpx/Makefile" ;; "src/OsiGlpk/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OsiGlpk/Makefile" ;; "src/OsiMsk/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OsiMsk/Makefile" ;; "src/OsiXpr/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OsiXpr/Makefile" ;; "src/OsiGrb/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OsiGrb/Makefile" ;; "src/OsiSpx/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OsiSpx/Makefile" ;; "src/OsiCommonTest/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OsiCommonTest/Makefile" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "osi.pc" ) CONFIG_FILES="$CONFIG_FILES osi.pc" ;; "osi-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-uninstalled.pc" ;; "osi-unittests.pc" ) CONFIG_FILES="$CONFIG_FILES osi-unittests.pc" ;; "osi-unittests-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-unittests-uninstalled.pc" ;; "osi-cplex.pc" ) CONFIG_FILES="$CONFIG_FILES osi-cplex.pc:src/OsiCpx/osi-cplex.pc.in" ;; "osi-cplex-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-cplex-uninstalled.pc:src/OsiCpx/osi-cplex-uninstalled.pc.in" ;; "osi-glpk.pc" ) CONFIG_FILES="$CONFIG_FILES osi-glpk.pc:src/OsiGlpk/osi-glpk.pc.in" ;; "osi-glpk-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-glpk-uninstalled.pc:src/OsiGlpk/osi-glpk-uninstalled.pc.in" ;; "osi-gurobi.pc" ) CONFIG_FILES="$CONFIG_FILES osi-gurobi.pc:src/OsiGrb/osi-gurobi.pc.in" ;; "osi-gurobi-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-gurobi-uninstalled.pc:src/OsiGrb/osi-gurobi-uninstalled.pc.in" ;; "osi-mosek.pc" ) CONFIG_FILES="$CONFIG_FILES osi-mosek.pc:src/OsiMsk/osi-mosek.pc.in" ;; "osi-mosek-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-mosek-uninstalled.pc:src/OsiMsk/osi-mosek-uninstalled.pc.in" ;; "osi-xpress.pc" ) CONFIG_FILES="$CONFIG_FILES osi-xpress.pc:src/OsiXpr/osi-xpress.pc.in" ;; "osi-xpress-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-xpress-uninstalled.pc:src/OsiXpr/osi-xpress-uninstalled.pc.in" ;; "osi-soplex.pc" ) CONFIG_FILES="$CONFIG_FILES osi-soplex.pc:src/OsiSpx/osi-soplex.pc.in" ;; "osi-soplex-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES osi-soplex-uninstalled.pc:src/OsiSpx/osi-soplex-uninstalled.pc.in" ;; "doxydoc/doxygen.conf" ) CONFIG_FILES="$CONFIG_FILES doxydoc/doxygen.conf" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "src/Osi/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/Osi/config.h" ;; "src/Osi/config_osi.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/Osi/config_osi.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@ALWAYS_FALSE_TRUE@,$ALWAYS_FALSE_TRUE,;t t s,@ALWAYS_FALSE_FALSE@,$ALWAYS_FALSE_FALSE,;t t s,@have_svnversion@,$have_svnversion,;t t s,@OSI_SVN_REV@,$OSI_SVN_REV,;t t s,@CDEFS@,$CDEFS,;t t s,@ADD_CFLAGS@,$ADD_CFLAGS,;t t s,@DBG_CFLAGS@,$DBG_CFLAGS,;t t s,@OPT_CFLAGS@,$OPT_CFLAGS,;t t s,@sol_cc_compiler@,$sol_cc_compiler,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@COIN_CC_IS_CL_TRUE@,$COIN_CC_IS_CL_TRUE,;t t s,@COIN_CC_IS_CL_FALSE@,$COIN_CC_IS_CL_FALSE,;t t s,@MPICC@,$MPICC,;t t s,@CXXDEFS@,$CXXDEFS,;t t s,@ADD_CXXFLAGS@,$ADD_CXXFLAGS,;t t s,@DBG_CXXFLAGS@,$DBG_CXXFLAGS,;t t s,@OPT_CXXFLAGS@,$OPT_CXXFLAGS,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@COIN_CXX_IS_CL_TRUE@,$COIN_CXX_IS_CL_TRUE,;t t s,@COIN_CXX_IS_CL_FALSE@,$COIN_CXX_IS_CL_FALSE,;t t s,@MPICXX@,$MPICXX,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@LIBTOOLM4@,$LIBTOOLM4,;t t s,@have_autoconf@,$have_autoconf,;t t s,@have_automake@,$have_automake,;t t s,@have_svn@,$have_svn,;t t s,@BUILDTOOLSDIR@,$BUILDTOOLSDIR,;t t s,@AUX_DIR@,$AUX_DIR,;t t s,@abs_source_dir@,$abs_source_dir,;t t s,@abs_lib_dir@,$abs_lib_dir,;t t s,@abs_include_dir@,$abs_include_dir,;t t s,@abs_bin_dir@,$abs_bin_dir,;t t s,@HAVE_EXTERNALS_TRUE@,$HAVE_EXTERNALS_TRUE,;t t s,@HAVE_EXTERNALS_FALSE@,$HAVE_EXTERNALS_FALSE,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@ac_c_preproc_warn_flag@,$ac_c_preproc_warn_flag,;t t s,@ac_cxx_preproc_warn_flag@,$ac_cxx_preproc_warn_flag,;t t s,@RPATH_FLAGS@,$RPATH_FLAGS,;t t s,@DEPENDENCY_LINKING_TRUE@,$DEPENDENCY_LINKING_TRUE,;t t s,@DEPENDENCY_LINKING_FALSE@,$DEPENDENCY_LINKING_FALSE,;t t s,@LT_LDFLAGS@,$LT_LDFLAGS,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@ac_ct_PKG_CONFIG@,$ac_ct_PKG_CONFIG,;t t s,@COIN_HAS_PKGCONFIG_TRUE@,$COIN_HAS_PKGCONFIG_TRUE,;t t s,@COIN_HAS_PKGCONFIG_FALSE@,$COIN_HAS_PKGCONFIG_FALSE,;t t s,@COIN_PKG_CONFIG_PATH@,$COIN_PKG_CONFIG_PATH,;t t s,@COIN_PKG_CONFIG_PATH_UNINSTALLED@,$COIN_PKG_CONFIG_PATH_UNINSTALLED,;t t s,@COINUTILS_LIBS@,$COINUTILS_LIBS,;t t s,@COINUTILS_CFLAGS@,$COINUTILS_CFLAGS,;t t s,@COINUTILS_DATA@,$COINUTILS_DATA,;t t s,@COINUTILS_DEPENDENCIES@,$COINUTILS_DEPENDENCIES,;t t s,@COINUTILS_LIBS_INSTALLED@,$COINUTILS_LIBS_INSTALLED,;t t s,@COINUTILS_CFLAGS_INSTALLED@,$COINUTILS_CFLAGS_INSTALLED,;t t s,@COINUTILS_DATA_INSTALLED@,$COINUTILS_DATA_INSTALLED,;t t s,@OSILIB_CFLAGS@,$OSILIB_CFLAGS,;t t s,@OSILIB_LIBS@,$OSILIB_LIBS,;t t s,@OSILIB_PCLIBS@,$OSILIB_PCLIBS,;t t s,@OSILIB_PCREQUIRES@,$OSILIB_PCREQUIRES,;t t s,@OSILIB_DEPENDENCIES@,$OSILIB_DEPENDENCIES,;t t s,@OSILIB_CFLAGS_INSTALLED@,$OSILIB_CFLAGS_INSTALLED,;t t s,@OSILIB_LIBS_INSTALLED@,$OSILIB_LIBS_INSTALLED,;t t s,@COIN_HAS_COINUTILS_TRUE@,$COIN_HAS_COINUTILS_TRUE,;t t s,@COIN_HAS_COINUTILS_FALSE@,$COIN_HAS_COINUTILS_FALSE,;t t s,@GLPK_LIBS@,$GLPK_LIBS,;t t s,@GLPK_CFLAGS@,$GLPK_CFLAGS,;t t s,@GLPK_DATA@,$GLPK_DATA,;t t s,@GLPK_DEPENDENCIES@,$GLPK_DEPENDENCIES,;t t s,@GLPK_LIBS_INSTALLED@,$GLPK_LIBS_INSTALLED,;t t s,@GLPK_CFLAGS_INSTALLED@,$GLPK_CFLAGS_INSTALLED,;t t s,@GLPK_DATA_INSTALLED@,$GLPK_DATA_INSTALLED,;t t s,@OSIGLPKLIB_CFLAGS@,$OSIGLPKLIB_CFLAGS,;t t s,@OSIGLPKLIB_LIBS@,$OSIGLPKLIB_LIBS,;t t s,@OSIGLPKLIB_PCLIBS@,$OSIGLPKLIB_PCLIBS,;t t s,@OSIGLPKLIB_PCREQUIRES@,$OSIGLPKLIB_PCREQUIRES,;t t s,@OSIGLPKLIB_DEPENDENCIES@,$OSIGLPKLIB_DEPENDENCIES,;t t s,@OSIGLPKLIB_CFLAGS_INSTALLED@,$OSIGLPKLIB_CFLAGS_INSTALLED,;t t s,@OSIGLPKLIB_LIBS_INSTALLED@,$OSIGLPKLIB_LIBS_INSTALLED,;t t s,@COIN_HAS_GLPK_TRUE@,$COIN_HAS_GLPK_TRUE,;t t s,@COIN_HAS_GLPK_FALSE@,$COIN_HAS_GLPK_FALSE,;t t s,@SOPLEX_LIBS@,$SOPLEX_LIBS,;t t s,@SOPLEX_CFLAGS@,$SOPLEX_CFLAGS,;t t s,@SOPLEX_DATA@,$SOPLEX_DATA,;t t s,@SOPLEX_DEPENDENCIES@,$SOPLEX_DEPENDENCIES,;t t s,@SOPLEX_LIBS_INSTALLED@,$SOPLEX_LIBS_INSTALLED,;t t s,@SOPLEX_CFLAGS_INSTALLED@,$SOPLEX_CFLAGS_INSTALLED,;t t s,@SOPLEX_DATA_INSTALLED@,$SOPLEX_DATA_INSTALLED,;t t s,@OSISPXLIB_CFLAGS@,$OSISPXLIB_CFLAGS,;t t s,@OSISPXLIB_LIBS@,$OSISPXLIB_LIBS,;t t s,@OSISPXLIB_PCLIBS@,$OSISPXLIB_PCLIBS,;t t s,@OSISPXLIB_PCREQUIRES@,$OSISPXLIB_PCREQUIRES,;t t s,@OSISPXLIB_DEPENDENCIES@,$OSISPXLIB_DEPENDENCIES,;t t s,@OSISPXLIB_CFLAGS_INSTALLED@,$OSISPXLIB_CFLAGS_INSTALLED,;t t s,@OSISPXLIB_LIBS_INSTALLED@,$OSISPXLIB_LIBS_INSTALLED,;t t s,@COIN_HAS_SOPLEX_TRUE@,$COIN_HAS_SOPLEX_TRUE,;t t s,@COIN_HAS_SOPLEX_FALSE@,$COIN_HAS_SOPLEX_FALSE,;t t s,@SAMPLE_LIBS@,$SAMPLE_LIBS,;t t s,@SAMPLE_CFLAGS@,$SAMPLE_CFLAGS,;t t s,@SAMPLE_DATA@,$SAMPLE_DATA,;t t s,@SAMPLE_DEPENDENCIES@,$SAMPLE_DEPENDENCIES,;t t s,@SAMPLE_LIBS_INSTALLED@,$SAMPLE_LIBS_INSTALLED,;t t s,@SAMPLE_CFLAGS_INSTALLED@,$SAMPLE_CFLAGS_INSTALLED,;t t s,@SAMPLE_DATA_INSTALLED@,$SAMPLE_DATA_INSTALLED,;t t s,@COIN_HAS_SAMPLE_TRUE@,$COIN_HAS_SAMPLE_TRUE,;t t s,@COIN_HAS_SAMPLE_FALSE@,$COIN_HAS_SAMPLE_FALSE,;t t s,@NETLIB_LIBS@,$NETLIB_LIBS,;t t s,@NETLIB_CFLAGS@,$NETLIB_CFLAGS,;t t s,@NETLIB_DATA@,$NETLIB_DATA,;t t s,@NETLIB_DEPENDENCIES@,$NETLIB_DEPENDENCIES,;t t s,@NETLIB_LIBS_INSTALLED@,$NETLIB_LIBS_INSTALLED,;t t s,@NETLIB_CFLAGS_INSTALLED@,$NETLIB_CFLAGS_INSTALLED,;t t s,@NETLIB_DATA_INSTALLED@,$NETLIB_DATA_INSTALLED,;t t s,@COIN_HAS_NETLIB_TRUE@,$COIN_HAS_NETLIB_TRUE,;t t s,@COIN_HAS_NETLIB_FALSE@,$COIN_HAS_NETLIB_FALSE,;t t s,@CPXINCDIR@,$CPXINCDIR,;t t s,@CPXLIB@,$CPXLIB,;t t s,@COIN_HAS_CPX_TRUE@,$COIN_HAS_CPX_TRUE,;t t s,@COIN_HAS_CPX_FALSE@,$COIN_HAS_CPX_FALSE,;t t s,@MSKINCDIR@,$MSKINCDIR,;t t s,@MSKLIB@,$MSKLIB,;t t s,@COIN_HAS_MSK_TRUE@,$COIN_HAS_MSK_TRUE,;t t s,@COIN_HAS_MSK_FALSE@,$COIN_HAS_MSK_FALSE,;t t s,@XPRINCDIR@,$XPRINCDIR,;t t s,@XPRLIB@,$XPRLIB,;t t s,@COIN_HAS_XPR_TRUE@,$COIN_HAS_XPR_TRUE,;t t s,@COIN_HAS_XPR_FALSE@,$COIN_HAS_XPR_FALSE,;t t s,@GRBINCDIR@,$GRBINCDIR,;t t s,@GRBLIB@,$GRBLIB,;t t s,@COIN_HAS_GRB_TRUE@,$COIN_HAS_GRB_TRUE,;t t s,@COIN_HAS_GRB_FALSE@,$COIN_HAS_GRB_FALSE,;t t s,@OSI_EXAMPLES_SOLVER_NAME@,$OSI_EXAMPLES_SOLVER_NAME,;t t s,@OSI_EXAMPLES_SOLVER_CFLAGS@,$OSI_EXAMPLES_SOLVER_CFLAGS,;t t s,@OSI_EXAMPLES_SOLVER_LIBS@,$OSI_EXAMPLES_SOLVER_LIBS,;t t s,@OSI_EXAMPLES_SOLVER_PCNAME@,$OSI_EXAMPLES_SOLVER_PCNAME,;t t s,@coin_have_doxygen@,$coin_have_doxygen,;t t s,@coin_doxy_usedot@,$coin_doxy_usedot,;t t s,@coin_doxy_tagname@,$coin_doxy_tagname,;t t s,@coin_doxy_logname@,$coin_doxy_logname,;t t s,@coin_doxy_tagfiles@,$coin_doxy_tagfiles,;t t s,@coin_doxy_excludes@,$coin_doxy_excludes,;t t s,@LIBEXT@,$LIBEXT,;t t s,@VPATH_DISTCLEANFILES@,$VPATH_DISTCLEANFILES,;t t s,@ABSBUILDDIR@,$ABSBUILDDIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test x"$coin_vpath_link_files" = x; then : ; else lnkcmd="$coin_link_input_cmd" if test "$lnkcmd" = cp; then { echo "$as_me:$LINENO: Copying data files for VPATH configuration" >&5 echo "$as_me: Copying data files for VPATH configuration" >&6;} else { echo "$as_me:$LINENO: Creating VPATH links for data files" >&5 echo "$as_me: Creating VPATH links for data files" >&6;} fi for file in $coin_vpath_link_files; do dir=`(dirname "./$file") 2>/dev/null || $as_expr X"./$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"./$file" : 'X\(//\)[^/]' \| \ X"./$file" : 'X\(//\)$' \| \ X"./$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"./$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test -d $dir; then : ; else { if $as_mkdir_p; then mkdir -p $dir else as_dir=$dir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dir" >&5 echo "$as_me: error: cannot create directory $dir" >&2;} { (exit 1); exit 1; }; }; } fi rm -f $file $lnkcmd $abs_source_dir/$file $file done fi { echo "$as_me:$LINENO: In case of trouble, first consult the troubleshooting page at https://projects.coin-or.org/BuildTools/wiki/user-troubleshooting" >&5 echo "$as_me: In case of trouble, first consult the troubleshooting page at https://projects.coin-or.org/BuildTools/wiki/user-troubleshooting" >&6;} if test x$coin_projectdir = xyes; then { echo "$as_me:$LINENO: Configuration of $PACKAGE_NAME successful" >&5 echo "$as_me: Configuration of $PACKAGE_NAME successful" >&6;} else { echo "$as_me:$LINENO: Main configuration of $PACKAGE_NAME successful" >&5 echo "$as_me: Main configuration of $PACKAGE_NAME successful" >&6;} fi else { echo "$as_me:$LINENO: No configuration of $PACKAGE_NAME necessary" >&5 echo "$as_me: No configuration of $PACKAGE_NAME necessary" >&6;} fi Osi-0.106.4/config.guess0000755000076600007660000012706311405216166013425 0ustar coincoin#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-05-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: