Cgl-0.58.9/0000755000076600007660000000000012377555671011022 5ustar coincoinCgl-0.58.9/cgl-uninstalled.pc.in0000644000076600007660000000200612130021364015004 0ustar coincoinprefix=@prefix@ libdir=@ABSBUILDDIR@/src Name: CGL Description: COIN-OR Cut Generation Library URL: https://projects.coin-or.org/Cgl Version: @PACKAGE_VERSION@ Libs: ${libdir}/libCgl.la @CGLLIB_PCLIBS@ Cflags: -I@abs_source_dir@/src -I@abs_source_dir@/src/CglAllDifferent -I@abs_source_dir@/src/CglClique -I@abs_source_dir@/src/CglDuplicateRow -I@abs_source_dir@/src/CglFlowCover -I@abs_source_dir@/src/CglGMI -I@abs_source_dir@/src/CglGomory -I@abs_source_dir@/src/CglKnapsackCover -I@abs_source_dir@/src/CglLandP -I@abs_source_dir@/src/CglLiftAndProject -I@abs_source_dir@/src/CglMixedIntegerRounding -I@abs_source_dir@/src/CglMixedIntegerRounding2 -I@abs_source_dir@/src/CglOddHole -I@abs_source_dir@/src/CglPreProcess -I@abs_source_dir@/src/CglProbing -I@abs_source_dir@/src/CglRedSplit -I@abs_source_dir@/src/CglRedSplit2 -I@abs_source_dir@/src/CglResidualCapacity -I@abs_source_dir@/src/CglSimpleRounding -I@abs_source_dir@/src/CglTwomir -I@abs_source_dir@/src/CglZeroHalf -I@ABSBUILDDIR@/src Requires: @CGLLIB_PCREQUIRES@ Cgl-0.58.9/config.sub0000755000076600007660000007772611405215371013005 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: Cgl-0.58.9/AUTHORS0000644000076600007660000000350412130021364012042 0ustar coincoinCglAllDifferrent John Forrest - contributor & PM CglClique & CliqueHelper JP Fasano John Forrest Lazlo Ladanyi - PM Marta Eso - contributor CglCutGenerator John Forrest - contributor & PM CglDuplicateRow John Forrest - contributor & PM CglFlowCover & FlowCoverTest John Forrest Laszlo Ladani Yan Xu - contributor & PM Jeff Linderoth - contributor Martin Savelsbergh - contributor CglGMI John Forrest - PM A more robust Gomory Giacomo Nannicini - contributor CglGomory & GomoryTest JP Fasano John Forrest - contributor & PM Laszlo Ladanyi - contributor CglKnapsackCover John Forrest Laszlo Ladanyi Robin Lougee - contributor & PM CglLandP Pierre Bonami - contributor & PM CglLiftAndProject John Forrest Laszlo Ladanyi Robin Lougee - contributor & PM CglMessage John Forrest - contributor & PM CglMixedIntegerRounding John Forrest Laszlo Ladanyi - contributor Joao Goncalves - contributor & PM CglMixedIntegerRounding2 John Forrest - contributor & PM CglOddHole John Forrest - contributor & PM Laszlo Ladanyi CglPreProcess John Forrest - contributor & PM CglProbing & Probing Test JP Fasano John Forrest - contributor & PM Laszlo Ladanyi CglRedSplit John Forrest JP Fasano Francois Margot - contributor & PM CglRedSplit2 John Forrest - PM Based on CglRedSplit Giacomo Nannicini - contributor CglResidualCapacity Francisco Barahona - contributor & PM CglSimpleRounding John Forrest Laszlo Ladanyi Robin Lougee - contributor & PM CglStored John Forrest - contributor & PM CglTwomir JP Fasano John Forrest Oktay Gunluk - contributor & PM Laszlo Ladanyi Sanjeeb Dash - contributor Marcos Goycoolea - contributor CglZeroHalf Alberto Caprara - contributor John Forrest - PM Cgl-0.58.9/doxydoc/0000755000076600007660000000000012377555671012473 5ustar coincoinCgl-0.58.9/doxydoc/doxygen.conf.in0000644000076600007660000017377512244007524015426 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 = NO # 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 = NO # 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 Cgl-0.58.9/cgl.pc.in0000644000076600007660000000045511510106537012501 0ustar coincoinprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/coin Name: CGL Description: COIN-OR Cut Generation Library URL: https://projects.coin-or.org/Cgl Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lCgl @CGLLIB_PCLIBS@ Cflags: -I${includedir} Requires: @CGLLIB_PCREQUIRES@ Cgl-0.58.9/install-sh0000755000076600007660000002202111405215371013000 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: Cgl-0.58.9/examples/0000755000076600007660000000000012377555671012640 5ustar coincoinCgl-0.58.9/examples/cgl1.cpp0000644000076600007660000001616011510726535014161 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). //----------------------------------------------------- // Simple example usage of the cut generation library. // // This sample program iteratively tightens a // given formulation by adding cuts, then calls // branch-and-bound to solve the tightened // formulation. // // usage: // cgl1 mpsFileName objectiveSense // where: // mpsFileName: Name of an mps file (without the // file extension) // objectiveSense: min for minimization, // max for maximization. // example: // cgl1 ../../Data/Sample/p0033 min //----------------------------------------------------- // The knapsack cut generator assumes the primal solution is feasible. #include #include #include #include "CoinError.hpp" #include "OsiCuts.hpp" #include "OsiClpSolverInterface.hpp" //#include "OsiOslSolverInterface.hpp" #include "CoinWarmStartBasis.hpp" #include #include "CglKnapsackCover.hpp" #include "CglSimpleRounding.hpp" using std::cerr; using std::cout; using std::endl; using std::string; int main(int argc, const char *argv[]) { // If no parms specified then use these string mpsFileName; #if defined(SAMPLEDIR) mpsFileName = SAMPLEDIR "/p0033.mps"; #else if (argc == 1) { fprintf(stderr, "Do not know where to find sample MPS files.\n"); exit(1); } #endif string objSense = "min"; // Make sure a file name and objective sense or nothing // were specified if ( argc!=1 && argc!=3 ) { cerr <<"Incorrect number of command line parameters." <(si.getWarmStart()) ; assert (basis); int nDelete=0; for (int i=numberRows;igetArtifStatus(i); if (status == CoinWarmStartBasis::basic) del[nDelete++] = i; } delete basis; if (nDelete) { si.deleteRows(nDelete,del); // should take zero iterations si.resolve(); cout << nDelete << " rows deleted as basic - resolve took " << si.getIterationCount() <<" iterations" < #include #include #include "OsiSolverInterface.hpp" #include "OsiSolverParameters.hpp" #include "OsiClpSolverInterface.hpp" #include "CglRedSplit.hpp" #include "CglRedSplit2.hpp" int main(int argc, char **argv) { char *f_name_lp, *last_dot_pos, f_name[256], *f_name_pos; int i, ncol; if((argc < 2) || (argc > 2)) { printf("### ERROR: main(): Usage: One of the following\ncgl_data_test input_file_name.mps\ncgl_data_test input_file_name.lp\n"); exit(1); } f_name_lp = strdup(argv[1]); f_name_pos = strrchr(f_name_lp, '/'); if(f_name_pos != NULL) { strcpy(f_name, &(f_name_pos[1])); } else { strcpy(f_name, f_name_lp); } last_dot_pos = strrchr(f_name, '.'); if(last_dot_pos != NULL) { last_dot_pos = '\0'; } // Do for both RedSplit and RedSplit2 { OsiClpSolverInterface *clp = new OsiClpSolverInterface; clp->messageHandler()->setLogLevel(0); if(strcmp(&(f_name_lp[strlen(f_name_lp)-3]), ".lp") == 0) { clp->readLp(f_name_lp); } else { if(strcmp(&(f_name_lp[strlen(f_name_lp)-4]), ".mps") == 0) { clp->readMps(f_name_lp); } else { printf("### ERROR: unrecognized file type\n"); exit(1); } } ncol = clp->getNumCols(); clp->initialSolve(); printf("LP value: %12.2f\n", clp->getObjValue()); OsiCuts cuts; // Define parameters for CglRedSplit generator CglParam cpar; cpar.setMAX_SUPPORT(ncol+1); CglRedSplitParam rspar(cpar); // Create a cut generator with the given parameters CglRedSplit cutGen(rspar); char *colType = new char[ncol]; for(i=0; iisContinuous(i)) { colType[i] = 'C'; } else { colType[i] = 'I'; } } int round, max_rounds = 10; for(round=0; roundapplyRowCuts(ncuts, newRowCuts); delete[] newRowCuts; printf("round %4d: %4d generated cuts new objective value: %12.2f\n", round, ncuts, clp->getObjValue()); clp->resolve(); if(clp->isAbandoned()) { printf("###ERROR: Numerical difficulties in Solver\n"); exit(1); } if(clp->isProvenPrimalInfeasible()) { printf("### WARNING: Problem is infeasible\n"); exit(1); } } delete clp; delete[] colType; } { OsiClpSolverInterface *clp = new OsiClpSolverInterface; clp->messageHandler()->setLogLevel(0); if(strcmp(&(f_name_lp[strlen(f_name_lp)-3]), ".lp") == 0) { clp->readLp(f_name_lp); } else { if(strcmp(&(f_name_lp[strlen(f_name_lp)-4]), ".mps") == 0) { clp->readMps(f_name_lp); } else { printf("### ERROR: unrecognized file type\n"); exit(1); } } ncol = clp->getNumCols(); clp->initialSolve(); printf("LP value: %12.2f\n", clp->getObjValue()); OsiCuts cuts; // Define parameters for CglRedSplit2 generator CglParam cpar; cpar.setMAX_SUPPORT(ncol+1); CglRedSplit2Param rspar(cpar); // Create a cut generator with the given parameters CglRedSplit2 cutGen(rspar); char *colType = new char[ncol]; for(i=0; iisContinuous(i)) { colType[i] = 'C'; } else { colType[i] = 'I'; } } int round, max_rounds = 10; for(round=0; roundapplyRowCuts(ncuts, newRowCuts); delete[] newRowCuts; printf("round %4d: %4d generated cuts new objective value: %12.2f\n", round, ncuts, clp->getObjValue()); clp->resolve(); if(clp->isAbandoned()) { printf("###ERROR: Numerical difficulties in Solver\n"); exit(1); } if(clp->isProvenPrimalInfeasible()) { printf("### WARNING: Problem is infeasible\n"); exit(1); } } delete clp; delete[] colType; } free(f_name_lp); return(0); } Cgl-0.58.9/LICENSE0000644000076600007660000002622711507177625012031 0ustar coincoinEclipse Public License - v 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means any person or entity that distributes the Program. "Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Contributors may not remove or alter any copyright notices contained within the Program. Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. Cgl-0.58.9/Makefile.am0000644000076600007660000000557111645645660013061 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 1051 2011-10-13 20:36:00Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # Subdirectories # ######################################################################## SUBDIRS = src # 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 if ALWAYS_FALSE SUBDIRS += test endif ######################################################################## # Additional files to be included in tarball # ######################################################################## # Here we need include all files that are not mentioned in other Makefiles EXTRA_DIST = examples/cgl1.cpp \ examples/cgl_data_test.cpp \ examples/Makefile.in ######################################################################## # 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 ######################################################################## # Installation of the addlibs file # ######################################################################## pkgconfiglibdir = $(libdir)/pkgconfig pkgconfiglib_DATA = cgl.pc addlibsdir = $(DESTDIR)$(datadir)/coin/doc/Cgl install-data-hook: @$(mkdir_p) "$(addlibsdir)" if COIN_HAS_PKGCONFIG PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ \ $(PKG_CONFIG) --libs cgl > $(addlibsdir)/cgl_addlibs.txt else if COIN_CXX_IS_CL echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libCgl.lib @CGLLIB_LIBS_INSTALLED@" > $(addlibsdir)/cgl_addlibs.txt else echo -L@abs_lib_dir@ -lCgl @CGLLIB_LIBS_INSTALLED@ > $(addlibsdir)/cgl_addlibs.txt endif endif uninstall-hook: rm -f $(addlibsdir)/cgl_addlibs.txt ######################################################################## # Maintainer Stuff # ######################################################################## CLEANFILES = # Files that are generated and should be cleaned with make distclean DISTCLEANFILES = include BuildTools/Makemain.inc Cgl-0.58.9/configure.ac0000644000076600007660000001505312377505651013305 0ustar coincoin# Copyright (C) 2006 International Business Machines. # All Rights Reserved. # This file is distributed under the Eclipse Public License. ## $Id: configure.ac 1213 2014-08-28 01:53:45Z tkr $ # Author: Andreas Waechter IBM 2006-04-13 ############################################################################# # Names and other basic things # ############################################################################# AC_PREREQ(2.59) AC_INIT([Cgl],[0.58.9],[cgl@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/CglMessage.hpp) # 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 # If this project depends on external projects, the Externals file in # the source root directory contains definition of where to find those # externals. The following macro ensures that those externals are # retrieved by svn if they are not there yet. AC_COIN_PROJECTDIR_INIT(Cgl,9:9:8) # Check if user wants to produce debugging code AC_COIN_DEBUG_COMPILE(Cgl) # 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], [CglLib]) if test $coin_has_coinutils != yes ; then AC_MSG_ERROR([Required package CoinUtils not available.]) fi AC_COIN_CHECK_PACKAGE(Osi, [osi], [CglLib]) if test $coin_has_osi != yes ; then AC_MSG_ERROR([Required package Osi not available.]) fi AC_COIN_CHECK_PACKAGE(Sample, [coindatasample]) # Clp can be used by CglLandP AC_COIN_CHECK_PACKAGE(OsiClp, [osi-clp], [CglLib]) ############################################################################# # Solvers for unittesting # ############################################################################# # These are not really required for the compilation of Cgl, but we # need to know which are available in order to compile the unitTest # correctly. AC_COIN_CHECK_PACKAGE(OsiCpx, [osi-cplex]) AC_COIN_CHECK_PACKAGE(OsiGlpk, [osi-glpk]) #AC_COIN_CHECK_PACKAGE(OsiGrb, [osi-gurobi]) AC_COIN_CHECK_PACKAGE(OsiMsk, [osi-mosek]) AC_COIN_CHECK_PACKAGE(OsiXpr, [osi-xpress]) AC_COIN_CHECK_PACKAGE(OsiVol, [osi-vol]) AC_COIN_CHECK_PACKAGE(OsiDyLP, [osi-dylp]) #AC_COIN_CHECK_PACKAGE(OsiSpx, [osi-soplex]) ############################################################################# # System header # ############################################################################# AC_COIN_CHECK_CXX_CHEADER(math) AC_COIN_CHECK_CXX_CHEADER(float) AC_COIN_CHECK_CXX_CHEADER(ieeefp) ############################################################################# # Determine list of all Cgl subprojects # ############################################################################# # In order to avoid that one has to update this configure.ac and the # Makefile.am whenever a new cut generator is added, we automatically determine # the list of all subdirectories of src with a Makefile.in (CGL_SUBDIRS), # and also a list of all sublibraries relative to src (CGL_SUBLIBS) that # can be used in the src/Makefile.am. (It is still necessary to manually # add an entry to write the Makefile in the AC_CONFIG_FILES list below.) AC_SUBST(CGL_SUBDIRS) AC_SUBST(CGL_SUBLIBS) curr_dir=`pwd` cd $srcdir/src for file in `ls */Makefile.in`; do newdir=`echo $file | sed -e s%/Makefile.in%% | sed -e s%^./%% ` CGL_SUBDIRS="$CGL_SUBDIRS $newdir" CGL_SUBLIBS="$CGL_SUBLIBS $newdir/lib${newdir}.la" done cd $curr_dir ############################################################################# # Check for doxygen # ############################################################################# AC_COIN_DOXYGEN(CoinUtils) ############################################################################## # Finishing up by writing all the output # ############################################################################## # Install files for unitTest AC_COIN_VPATH_LINK([test/CglTestData/capPlan1.mps test/CglTestData/l152lav.mps test/CglTestData/egout.mps test/CglTestData/lseu.mps]) # Here list all the files that configure should create (except for the # configuration header file) AC_CONFIG_FILES([Makefile examples/Makefile src/Makefile src/CglAllDifferent/Makefile src/CglClique/Makefile src/CglDuplicateRow/Makefile src/CglFlowCover/Makefile src/CglGMI/Makefile src/CglGomory/Makefile src/CglKnapsackCover/Makefile src/CglLandP/Makefile src/CglLiftAndProject/Makefile src/CglMixedIntegerRounding/Makefile src/CglMixedIntegerRounding2/Makefile src/CglOddHole/Makefile src/CglPreProcess/Makefile src/CglProbing/Makefile src/CglRedSplit/Makefile src/CglRedSplit2/Makefile src/CglResidualCapacity/Makefile src/CglSimpleRounding/Makefile src/CglTwomir/Makefile src/CglZeroHalf/Makefile test/Makefile cgl.pc cgl-uninstalled.pc]) AC_CONFIG_FILES([doxydoc/doxygen.conf]) # Here put the location and name of the configuration header file AC_CONFIG_HEADER([src/config.h src/config_cgl.h]) # Finally, we let configure write all the output... AC_COIN_FINALIZE Cgl-0.58.9/src/0000755000076600007660000000000012377555671011611 5ustar coincoinCgl-0.58.9/src/CglProbing/0000755000076600007660000000000012377555671013637 5ustar coincoinCgl-0.58.9/src/CglProbing/CglProbing.cpp0000644000076600007660000117631712311577556016403 0ustar coincoin// $Id: CglProbing.cpp 1202 2014-03-17 13:58:06Z forrest $ // 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). #include #include #include #include #include #include #define PROBING100 0 //#define PRINT_DEBUG //#define CGL_DEBUG 1 //#undef NDEBUG #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinFinite.hpp" #include "OsiRowCutDebugger.hpp" #include "CglProbing.hpp" //#define PROBING_EXTRA_STUFF true #define PROBING_EXTRA_STUFF false #define FIXED_ALLOWANCE 10 #define SIZE_ROW_MULT 4 #define SIZE_ROW_ADD 2000 typedef struct {double infeasibility;int sequence;} double_int_pair; class double_int_pair_compare { public: bool operator() (double_int_pair x , double_int_pair y) const { return ( x.infeasibility < y.infeasibility); } }; // for hashing typedef struct { int index, next; } CoinHashLink; static double multiplier[] = {1.23456789e2,-9.87654321}; static int hashCut (const OsiRowCut2 & x, int size) { int xN =x.row().getNumElements(); double xLb = x.lb(); double xUb = x.ub(); const int * xIndices = x.row().getIndices(); const double * xElements = x.row().getElements(); unsigned int hashValue; double value=1.0; if (xLb>-1.0e10) value += xLb*multiplier[0]; if (xUb<1.0e10) value += xUb*multiplier[1]; for( int j=0;jsizeof(hashValue)) { assert (sizeof(value)==2*sizeof(hashValue)); union { double d; int i[2]; } xx; xx.d = value; hashValue = (xx.i[0] + xx.i[1]); } else { assert (sizeof(value)==sizeof(hashValue)); union { double d; unsigned int i[2]; } xx; xx.d = value; hashValue = xx.i[0]; } return hashValue%(size); } static bool same (const OsiRowCut2 & x, const OsiRowCut2 & y) { int xN =x.row().getNumElements(); int yN =y.row().getNumElements(); bool identical=false; if (xN==yN) { double xLb = x.lb(); double xUb = x.ub(); double yLb = y.lb(); double yUb = y.ub(); if (fabs(xLb-yLb)<1.0e-8&&fabs(xUb-yUb)<1.0e-8) { const int * xIndices = x.row().getIndices(); const double * xElements = x.row().getElements(); const int * yIndices = y.row().getIndices(); const double * yElements = y.row().getElements(); int j; for( j=0;j1.0e-12) break; } identical = (j==xN); } } return identical; } class row_cut { public: row_cut(int nRows, bool initialPass ) { numberCuts_=0; if (nRows<500) { maxSize_ = SIZE_ROW_MULT*nRows + SIZE_ROW_ADD; } else if (nRows<5000) { maxSize_ = (SIZE_ROW_MULT*nRows + SIZE_ROW_ADD)>>1; } else if (nRows<10000) { maxSize_ = (SIZE_ROW_MULT*(nRows>>1) + SIZE_ROW_ADD)>>1; } else { maxSize_ = (SIZE_ROW_MULT*CoinMin(nRows,100000) + SIZE_ROW_ADD)>>2; } size_ = (maxSize_>>3)+10; if (initialPass) size_ = size_>>1; if (size_<1000) hashSize_=4*size_; else hashSize_=2*size_; nRows_ = nRows; rowCut_ = new OsiRowCut2 * [size_]; hash_ = new CoinHashLink[hashSize_]; for (int i=0;i= 0 ) { if ( !same(*temp[i],*temp[j1]) ) { int k = hash_[ipos].next; if ( k != -1 ) ipos = k; else break; } else { found = j1; break; } } else { break; } } if (found<0) { assert (hash_[ipos].next==-1); if (ipos==jpos) { // first hash_[ipos].index=i; } else { // find next space while ( true ) { ++lastHash_; assert (lastHash_1.0e12) bad=true; } if (bad) return 1; OsiRowCut2 newCut(whichRow); newCut.setLb(newLb); newCut.setUb(newUb); newCut.setRow(vector); int ipos = hashCut(newCut,hashSize_); int found = -1; int jpos=ipos; while ( true ) { int j1 = hash_[ipos].index; if ( j1 >= 0 ) { if ( !same(newCut,*rowCut_[j1]) ) { int k = hash_[ipos].next; if ( k != -1 ) ipos = k; else break; } else { found = j1; break; } } else { break; } } if (found<0) { assert (hash_[ipos].next==-1); if (ipos==jpos) { // first hash_[ipos].index=numberCuts_; } else { // find next space while ( true ) { ++lastHash_; assert (lastHash_setLb(newLb); newCutPtr->setUb(newUb); newCutPtr->setRow(vector); rowCut_[numberCuts_++]=newCutPtr; return 0; } else { return 1; } } else { return -1; } } void addCuts(OsiCuts & cs, OsiRowCut ** whichRow,int iPass) { int numberCuts=cs.sizeRowCuts(); int i ; if (numberCuts_whichRow(); if (iRow>=0&&!whichRow[iRow]) whichRow[iRow]=cs.rowCutPtr(numberCuts);; } numberCuts++; } } else { for (i=numberCuts_-1;i>=0;i--) { cs.insert(*rowCut_[i]); if (whichRow) { int iRow= rowCut_[i]->whichRow(); if (iRow>=0&&!whichRow[iRow]) whichRow[iRow]=cs.rowCutPtr(numberCuts);; } numberCuts++; } } } else { // just best double * effectiveness = new double[numberCuts_]; int iCut=0; for (i=0;ieffectiveness(); if (whichRow) { int iRow= rowCut_[i]->whichRow(); if (iRow>=0) value -= 1.0e10; } effectiveness[iCut++]=value; } std::sort(effectiveness,effectiveness+numberCuts_); double threshold = -1.0e20; if (iCut>nRows_) threshold = effectiveness[nRows_]; for ( i=0;ieffectiveness()>threshold) { cs.insert(*rowCut_[i]); if (whichRow) { int iRow= rowCut_[i]->whichRow(); if (iRow>=0&&!whichRow[iRow]) whichRow[iRow]=cs.rowCutPtr(numberCuts);; } numberCuts++; } } delete[] effectiveness ; } for (i = 0 ; i < numberCuts_ ; i++) { delete rowCut_[i] ; rowCut_[i] = 0 ; } numberCuts_=0; } }; // Adds in cut to list #ifdef CGL_DEBUG // Checks bounds okay against debugger static void checkBounds(const OsiRowCutDebugger * debugger,OsiColCut & cut) { if (debugger) { // on optimal path const double * optimal = debugger->optimalSolution(); int i; int nIndex; const double * values; const int * index; const CoinPackedVector & lbs = cut.lbs(); values = lbs.getElements(); nIndex = lbs.getNumElements(); index = lbs.getIndices(); for (i=0;i=optimal[iColumn]-1.0e-5); } } } #endif #define CGL_REASONABLE_INTEGER_BOUND 1.23456789e10 // This tightens column bounds (and can declare infeasibility) // It may also declare rows to be redundant int CglProbing::tighten(double *colLower, double * colUpper, const int *column, const double *rowElements, const CoinBigIndex *rowStart, const CoinBigIndex * rowStartPos,const int * rowLength, double *rowLower, double *rowUpper, int nRows,int nCols,char * intVar,int maxpass, double tolerance) { int i, j, k, kre; int krs; int dolrows; int iflagu, iflagl; int ntotal=0,nchange=1,jpass=0; double dmaxup, dmaxdown, dbound; int ninfeas=0; // For clique stuff double * cliqueMin=NULL; double * cliqueMax=NULL; // And second best ones double * cliqueMin2 = NULL; double * cliqueMax2 = NULL; if (cliqueRowStart_&&numberRows_&&cliqueRowStart_[numberRows_]) { cliqueMin = new double[nCols]; cliqueMax = new double[nCols]; cliqueMin2 = new double[nCols]; cliqueMax2 = new double[nCols]; } else { // do without cliques and using sorted version assert (rowStartPos); while(nchange) { nchange = 0; if (jpass==maxpass) break; jpass++; dolrows = (jpass & 1) == 1; for (i = 0; i < nRows; ++i) { if (rowLower[i]>-1.0e20||rowUpper[i]<1.0e20) { int iflagu = 0; int iflagl = 0; double dmaxup = 0.0; double dmaxdown = 0.0; int krs = rowStart[i]; int krs2 = rowStartPos[i]; int kre = rowStart[i]+rowLength[i]; /* ------------------------------------------------------------*/ /* Compute L(i) and U(i) */ /* ------------------------------------------------------------*/ for (k = krs; k < krs2; ++k) { double value=rowElements[k]; int j = column[k]; if (colUpper[j] < 1.0e12) dmaxdown += colUpper[j] * value; else ++iflagl; if (colLower[j] > -1.0e12) dmaxup += colLower[j] * value; else ++iflagu; } for (k = krs2; k < kre; ++k) { double value=rowElements[k]; int j = column[k]; if (colUpper[j] < 1.0e12) dmaxup += colUpper[j] * value; else ++iflagu; if (colLower[j] > -1.0e12) dmaxdown += colLower[j] * value; else ++iflagl; } if (iflagu) dmaxup=1.0e31; if (iflagl) dmaxdown=-1.0e31; if (dmaxup <= rowUpper[i] + tolerance && dmaxdown >= rowLower[i] - tolerance) { /* * The sum of the column maxs is at most the row ub, and * the sum of the column mins is at least the row lb; * this row says nothing at all. * I suspect that this corresponds to * an implied column singleton in the paper (viii, on p. 325), * where the singleton in question is the row slack. */ ++nchange; rowLower[i]=-COIN_DBL_MAX; rowUpper[i]=COIN_DBL_MAX; } else { if (dmaxup < rowLower[i] -tolerance || dmaxdown > rowUpper[i]+tolerance) { ninfeas++; break; } /* Finite U(i) */ /* -------------------------------------------------------------*/ /* below is deliberate mistake (previously was by chance) */ /* never do both */ if (iflagu == 0 && rowLower[i] > 0.0 && iflagl == 0 && rowUpper[i] < 1e15) { if (dolrows) { iflagu = 1; } else { iflagl = 1; } } if (iflagu == 0 && rowLower[i] > -1e15) { for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; if (value > 0.0) { if (colUpper[j] < 1.0e12) { dbound = colUpper[j] + (rowLower[i] - dmaxup) / value; if (dbound > colLower[j] + 1.0e-8) { /* we can tighten the lower bound */ /* the paper mentions this as a possibility on p. 227 */ colLower[j] = dbound; ++nchange; /* this may have fixed the variable */ /* I believe that this roughly corresponds to a * forcing constraint in the paper (p. 226). * If there is a forcing constraint (with respect * to the original, untightened bounds), then in this * loop we will go through all the columns and fix * each of them to their implied bound, rather than * determining that the row as a whole is forced * and just fixing them without doing computation for * each column (as in the paper). * By doing it this way, we can tighten bounds and * get forcing constraints for free. */ if (colUpper[j] - colLower[j] <= tolerance) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } else { if (colLower[j] > -1.0e12) { dbound = colLower[j] + (rowLower[i] - dmaxup) / value; if (dbound < colUpper[j] - 1.0e-8) { colUpper[j] = dbound; ++nchange; if (colUpper[j] - colLower[j] <= tolerance) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } } } /* ----------------------------------------------------------------*/ /* Finite L(i) */ /* ----------------------------------------------------------------*/ if (iflagl == 0 && rowUpper[i] < 1e15) { for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; if (value < 0.0) { if (colUpper[j] < 1.0e12) { dbound = colUpper[j] + (rowUpper[i] - dmaxdown) / value; if (dbound > colLower[j] + 1.0e-8) { colLower[j] = dbound; ++nchange; if (! (colUpper[j] - colLower[j] > tolerance)) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } else { if (colLower[j] > -1.0e12) { dbound = colLower[j] + (rowUpper[i] - dmaxdown) / value; if (dbound < colUpper[j] - 1.0e-8) { colUpper[j] = dbound; ++nchange; if (! (colUpper[j] - colLower[j] > tolerance)) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } } } } } } for (j = 0; j < nCols; ++j) { if (intVar[j]) { if (colUpper[j]-colLower[j]>1.0e-8) { if (floor(colUpper[j]+1.0e-4)colLower[j]) nchange++; // clean up anyway colLower[j]=ceil(colLower[j]-1.0e-4); if (colUpper[j]-1.0e20||rowUpper[i]<1.0e20) { iflagu = 0; iflagl = 0; dmaxup = 0.0; dmaxdown = 0.0; krs = rowStart[i]; kre = rowStart[i]+rowLength[i]; /* ------------------------------------------------------------*/ /* Compute L(i) and U(i) */ /* ------------------------------------------------------------*/ if (!cliqueMin||i>=numberRows_||cliqueRowStart_[i]==cliqueRowStart_[i+1]) { // without cliques for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; if (value > 0.0) { if (colUpper[j] < 1.0e12) dmaxup += colUpper[j] * value; else ++iflagu; if (colLower[j] > -1.0e12) dmaxdown += colLower[j] * value; else ++iflagl; } else if (value<0.0) { if (colUpper[j] < 1.0e12) dmaxdown += colUpper[j] * value; else ++iflagl; if (colLower[j] > -1.0e12) dmaxup += colLower[j] * value; else ++iflagu; } } if (iflagu) dmaxup=1.0e31; if (iflagl) dmaxdown=-1.0e31; } else { // with cliques int nClique=0; int bias = cliqueRowStart_[i]-krs; double dmaxup2=0.0; double dmaxdown2=0.0; double sumZeroFixes=0.0; for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; int iClique = sequenceInCliqueEntry(cliqueRow_[k+bias]); bool oneFixes = oneFixesInCliqueEntry(cliqueRow_[k+bias]); if (iClique>=numberColumns_||colUpper[j]==colLower[j]) { if (value > 0.0) { if (colUpper[j] >= 1.0e12) { dmaxup = 1e31; ++iflagu; } else { dmaxup += colUpper[j] * value; } if (colLower[j] <= -1.0e12) { dmaxdown = -1e31; ++iflagl; } else { dmaxdown += colLower[j] * value; } } else if (value<0.0) { if (colUpper[j] >= 1.0e12) { dmaxdown = -1e31; ++iflagl; } else { dmaxdown += colUpper[j] * value; } if (colLower[j] <= -1.0e12) { dmaxup = 1e31; ++iflagu; } else { dmaxup += colLower[j] * value; } } } else { // clique may help if (iClique>=nClique) { //zero out for (int j=nClique;j<=iClique;j++) { cliqueMin[j]=0.0; cliqueMax[j]=0.0; cliqueMin2[j]=0.0; cliqueMax2[j]=0.0; } nClique=iClique+1; } // Update best and second best if (oneFixes) { if (value > 0.0) { dmaxup2 += value; cliqueMax2[iClique] = cliqueMax[iClique]; cliqueMax[iClique] = CoinMax(cliqueMax[iClique],value); } else if (value<0.0) { dmaxdown2 += value; cliqueMin2[iClique] = cliqueMin[iClique]; cliqueMin[iClique] = CoinMin(cliqueMin[iClique],value); } } else { sumZeroFixes += value; if (value > 0.0) { dmaxup2 += value; cliqueMin2[iClique] = cliqueMin[iClique]; cliqueMin[iClique] = CoinMin(cliqueMin[iClique],-value); } else if (value<0.0) { dmaxdown2 += value; cliqueMax2[iClique] = cliqueMax[iClique]; cliqueMax[iClique] = CoinMax(cliqueMax[iClique],-value); } } } } double dmaxup3 = dmaxup + sumZeroFixes; double dmaxdown3 = dmaxdown + sumZeroFixes; for (int iClique=0;iClique=dmaxdown-1.0e-8); if (dmaxup3dmaxdown+1.0e-8) { cliqueChanges=true; //printf("normal min/max %g , %g clique %g , %g\n", // dmaxdown,dmaxup,dmaxdown3,dmaxup3); dmaxdown=dmaxdown3; dmaxup=dmaxup3; } } if (dmaxup <= rowUpper[i] + tolerance && dmaxdown >= rowLower[i] - tolerance) { /* * The sum of the column maxs is at most the row ub, and * the sum of the column mins is at least the row lb; * this row says nothing at all. * I suspect that this corresponds to * an implied column singleton in the paper (viii, on p. 325), * where the singleton in question is the row slack. */ ++nrwdrp; rowLower[i]=-COIN_DBL_MAX; rowUpper[i]=COIN_DBL_MAX; } else { if (dmaxup < rowLower[i] -tolerance || dmaxdown > rowUpper[i]+tolerance) { ninfeas++; assert (!cliqueChanges); break; } /* Finite U(i) */ /* -------------------------------------------------------------*/ /* below is deliberate mistake (previously was by chance) */ /* never do both */ if (iflagu == 0 && rowLower[i] > 0.0 && iflagl == 0 && rowUpper[i] < 1e15) { if (dolrows) { iflagu = 1; } else { iflagl = 1; } } if (!cliqueChanges) { // without cliques if (iflagu == 0 && rowLower[i] > -1e15) { for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; if (value > 0.0) { if (colUpper[j] < 1.0e12) { dbound = colUpper[j] + (rowLower[i] - dmaxup) / value; if (dbound > colLower[j] + 1.0e-8) { /* we can tighten the lower bound */ /* the paper mentions this as a possibility on p. 227 */ colLower[j] = dbound; ++ilbred; /* this may have fixed the variable */ /* I believe that this roughly corresponds to a * forcing constraint in the paper (p. 226). * If there is a forcing constraint (with respect * to the original, untightened bounds), then in this * loop we will go through all the columns and fix * each of them to their implied bound, rather than * determining that the row as a whole is forced * and just fixing them without doing computation for * each column (as in the paper). * By doing it this way, we can tighten bounds and * get forcing constraints for free. */ if (colUpper[j] - colLower[j] <= tolerance) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } else { if (colLower[j] > -1.0e12) { dbound = colLower[j] + (rowLower[i] - dmaxup) / value; if (dbound < colUpper[j] - 1.0e-8) { colUpper[j] = dbound; ++iubred; if (colUpper[j] - colLower[j] <= tolerance) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } } } /* ----------------------------------------------------------------*/ /* Finite L(i) */ /* ----------------------------------------------------------------*/ if (iflagl == 0 && rowUpper[i] < 1e15) { for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; if (value < 0.0) { if (colUpper[j] < 1.0e12) { dbound = colUpper[j] + (rowUpper[i] - dmaxdown) / value; if (dbound > colLower[j] + 1.0e-8) { colLower[j] = dbound; ++ilbred; if (! (colUpper[j] - colLower[j] > tolerance)) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } else { if (colLower[j] > -1.0e12) { dbound = colLower[j] + (rowUpper[i] - dmaxdown) / value; if (dbound < colUpper[j] - 1.0e-8) { colUpper[j] = dbound; ++iubred; if (! (colUpper[j] - colLower[j] > tolerance)) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } } } } } } } else { // with cliques int bias = cliqueRowStart_[i]-krs; if (iflagu == 0 && rowLower[i] > -1e15) { for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; int iClique = sequenceInCliqueEntry(cliqueRow_[k+bias]); //bool oneFixes = (cliqueRow_[k+bias].oneFixes!=0); if (iClique>=numberColumns_) { if (value > 0.0) { if (colUpper[j] < 1.0e12) { dbound = colUpper[j] + (rowLower[i] - dmaxup) / value; if (dbound > colLower[j] + 1.0e-8) { /* we can tighten the lower bound */ /* the paper mentions this as a possibility on p. 227 */ colLower[j] = dbound; ++ilbred; /* this may have fixed the variable */ /* I believe that this roughly corresponds to a * forcing constraint in the paper (p. 226). * If there is a forcing constraint (with respect * to the original, untightened bounds), then in this * loop we will go through all the columns and fix * each of them to their implied bound, rather than * determining that the row as a whole is forced * and just fixing them without doing computation for * each column (as in the paper). * By doing it this way, we can tighten bounds and * get forcing constraints for free. */ if (colUpper[j] - colLower[j] <= tolerance) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } #if 0 } else if (intVar[j]==1 && rowUpper[i]>1.0e20) { // can we modify coefficient if (dmaxdown+value>rowLower[i]+1.0e-8) { assert (dmaxdown -1.0e12) { dbound = colLower[j] + (rowLower[i] - dmaxup) / value; if (dbound < colUpper[j] - 1.0e-8) { colUpper[j] = dbound; ++iubred; if (colUpper[j] - colLower[j] <= tolerance) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } #if 0 } else if (intVar[j]==1 && rowUpper[i]>1.0e20) { // can we modify coefficient if (dmaxdown-value>rowLower[i]+1.0e-8) { assert (dmaxdowncolLower[j]) { // in clique // adjustment double dmaxup2=dmaxup; assert (cliqueMax[iClique]>=0); assert (cliqueMax2[iClique]>=0); /* get max up if at other bound May not go down at all but will not go up */ if (fabs(value)==fabs(cliqueMax[iClique])) dmaxup2 -= cliqueMax[iClique]-cliqueMax2[iClique]; if (dmaxup2 0.0) { colLower[j] = 1.0; ++ilbred; } else { colUpper[j] = 0.0; ++iubred; } } } } } } /* ----------------------------------------------------------------*/ /* Finite L(i) */ /* ----------------------------------------------------------------*/ if (iflagl == 0 && rowUpper[i] < 1e15) { for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; int iClique = sequenceInCliqueEntry(cliqueRow_[k+bias]); //bool oneFixes = (cliqueRow_[k+bias].oneFixes!=0); if (iClique>=numberColumns_) { if (value < 0.0) { if (colUpper[j] < 1.0e12) { dbound = colUpper[j] + (rowUpper[i] - dmaxdown) / value; if (dbound > colLower[j] + 1.0e-8) { colLower[j] = dbound; ++ilbred; if (! (colUpper[j] - colLower[j] > tolerance)) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } #if 0 } else if (intVar[j]==1 && rowLower[i]<-1.0e20) { // can we modify coefficient if (dmaxup+valuerowUpper[i]-1.0e-8); double change = dmaxup+value - rowUpper[i]; double newValue = value - change; if (newValue<1.0e-12) newValue=0.0; printf("Could change value from %g to %g b\n", value,newValue); // dmaxdown -= change; } #endif } } } else { if (colLower[j] > -1.0e12) { dbound = colLower[j] + (rowUpper[i] - dmaxdown) / value; if (dbound < colUpper[j] - 1.0e-8) { colUpper[j] = dbound; ++iubred; if (! (colUpper[j] - colLower[j] > tolerance)) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if (colUpper[j] - colLower[j] < -100.0*tolerance) { ninfeas++; } } #if 0 } else if (intVar[j]==1 && rowLower[i]<-1.0e20) { // can we modify coefficient if (dmaxup-valuerowUpper[i]-1.0e-8); double change = dmaxup-value-rowUpper[i]; double newValue = value+change; double newUpper = rowUpper[i]+change; if (newValue<1.0e-12) newValue=0.0; printf("Could change value from %g to %g and uprow from %g to %g b\n", value,newValue,rowLower[i],newUpper); // dmaxup += change } #endif } } } } else if (colUpper[j]>colLower[j]) { // in clique // adjustment double dmaxdown2=dmaxdown; assert (cliqueMin[iClique]<=0); assert (cliqueMin2[iClique]<=0); /* get max down if this is at other bound May not go up at all but will not go down */ if (fabs(value)==fabs(cliqueMin[iClique])) dmaxdown2 -= cliqueMin[iClique]-cliqueMin2[iClique]; if (dmaxdown2>rowUpper[i]+1.0e-8) { /* --------------------------------------------------*/ /* check if infeasible !!!!! */ /* --------------------------------------------------*/ if ( dmaxdown>rowUpper[i]+1.0e-8) { ninfeas++; } else { if (value < 0.0) { colLower[j] = 1.0; ++ilbred; } else { colUpper[j] = 0.0; ++iubred; } } } } } } } } } } for (j = 0; j < nCols; ++j) { if (intVar[j]) { if (colUpper[j]-colLower[j]>1.0e-8) { if (floor(colUpper[j]+1.0e-4)colLower[j]) nchange++; // clean up anyway colLower[j]=ceil(colLower[j]-1.0e-4); if (colUpper[j]-1.0e20||rowUpper[i]<1.0e20) { iflagu = 0; iflagl = 0; dmaxup = 0.0; dmaxdown = 0.0; krs = rowStart[i]; kre = rowStart[i]+rowLength[i]; /* ------------------------------------------------------------*/ /* Compute L(i) and U(i) */ /* ------------------------------------------------------------*/ for (k = krs; k < kre; ++k) { double value=rowElements[k]; j = column[k]; if (value > 0.0) { if (colUpper[j] < 1.0e12) dmaxup += colUpper[j] * value; else ++iflagu; if (colLower[j] > -1.0e12) dmaxdown += colLower[j] * value; else ++iflagl; } else if (value<0.0) { if (colUpper[j] < 1.0e12) dmaxdown += colUpper[j] * value; else ++iflagl; if (colLower[j] > -1.0e12) dmaxup += colLower[j] * value; else ++iflagu; } } if (iflagu) maxR[i]=1.0e60; else maxR[i]=dmaxup; if (iflagl) minR[i]=-1.0e60; else minR[i]=dmaxdown; #if 0 if (minR[i]<-1.0e10&&maxR[i]>1.0e10) { markR[i]=-2; } else { #endif markR[i]=-1; #if 0 } #endif } else { minR[i]=-1.0e60; maxR[i]=1.0e60; #if 0 markR[i]=-2; abort(); #else markR[i]=-1; #endif } } } #ifdef CGL_DEBUG static int nPath=0; #endif //------------------------------------------------------------------- // Generate disaggregation cuts //------------------------------------------------------------------- void CglProbing::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info2) { #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&debugger->onOptimalPath(si)) { printf("On optimal path %d\n",nPath); nPath++; int nCols=si.getNumCols(); int i; const double * solution = si.getColSolution(); const double * lower = si.getColLower(); const double * upper = si.getColUpper(); const double * optimal = debugger->optimalSolution(); const double * objective = si.getObjCoefficients(); double objval1=0.0,objval2=0.0; for (i=0;i1 printf("%d %g %g %g %g\n",i,lower[i],solution[i],upper[i],optimal[i]); #endif objval1 += solution[i]*objective[i]; objval2 += optimal[i]*objective[i]; assert(optimal[i]>=lower[i]&&optimal[i]<=upper[i]); } printf("current obj %g, integer %g\n",objval1,objval2); } #endif int saveRowCuts=rowCuts_; if (rowCuts_<0) { if (info2.inTree) rowCuts_=4; else rowCuts_=-rowCuts_; } int nRows=si.getNumRows(); double * rowLower = new double[nRows+1]; double * rowUpper = new double[nRows+1]; int nCols=si.getNumCols(); // Set size if not set if (!rowCopy_) { numberRows_=nRows; numberColumns_=nCols; } double * colLower = new double[nCols]; double * colUpper = new double[nCols]; CglTreeInfo info = info2; int ninfeas=gutsOfGenerateCuts(si,cs,rowLower,rowUpper,colLower,colUpper,&info); if (ninfeas) { // generate infeasible cut and return OsiRowCut rc; rc.setLb(COIN_DBL_MAX); rc.setUb(0.0); cs.insert(rc); #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&debugger->onOptimalPath(si)) assert(!debugger->invalidCut(rc)); #endif } delete [] rowLower; delete [] rowUpper; delete [] colLower; delete [] colUpper; delete [] colLower_; delete [] colUpper_; colLower_ = NULL; colUpper_ = NULL; rowCuts_=saveRowCuts; } int CglProbing::generateCutsAndModify(const OsiSolverInterface & si, OsiCuts & cs, CglTreeInfo * info) { #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&debugger->onOptimalPath(si)) { printf("On optimal path %d\n",nPath); nPath++; int nCols=si.getNumCols(); int i; const double * solution = si.getColSolution(); const double * lower = si.getColLower(); const double * upper = si.getColUpper(); const double * optimal = debugger->optimalSolution(); const double * objective = si.getObjCoefficients(); double objval1=0.0,objval2=0.0; for (i=0;i1 printf("%d %g %g %g %g\n",i,lower[i],solution[i],upper[i],optimal[i]); #endif objval1 += solution[i]*objective[i]; objval2 += optimal[i]*objective[i]; assert(optimal[i]>=lower[i]-1.0e-5&&optimal[i]<=upper[i]+1.0e-5); } printf("current obj %g, integer %g\n",objval1,objval2); } #endif int saveRowCuts=rowCuts_; if (rowCuts_<0) { if (info->inTree) rowCuts_=4; else rowCuts_=-rowCuts_; } int saveMode = mode_; bool rowCliques=false; if (!mode_) { if (info->pass!=4||info->inTree) { mode_=1; } else { saveMode=1; // make sure do just once rowCliques=true; } } int nRows=si.getNumRows(); double * rowLower = new double[nRows+1]; double * rowUpper = new double[nRows+1]; int nCols=si.getNumCols(); double * colLower = new double[nCols]; double * colUpper = new double[nCols]; int ninfeas=gutsOfGenerateCuts(si,cs,rowLower,rowUpper,colLower,colUpper,info); if (ninfeas) { // generate infeasible cut and return OsiRowCut rc; rc.setLb(COIN_DBL_MAX); rc.setUb(0.0); cs.insert(rc); #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&debugger->onOptimalPath(si)) assert(!debugger->invalidCut(rc)); #endif } rowCuts_=saveRowCuts; mode_=saveMode; // move bounds so can be used by user if (mode_==3) { delete [] rowLower_; delete [] rowUpper_; rowLower_ = rowLower; rowUpper_ = rowUpper; } else { delete [] rowLower; delete [] rowUpper; } delete [] colLower_; delete [] colUpper_; colLower_ = colLower; colUpper_ = colUpper; // Setup information if (rowCliques&&numberRows_&&numberColumns_) setupRowCliqueInformation(si); return ninfeas; } bool analyze(const OsiSolverInterface * solverX, char * intVar, double * lower, double * upper) { OsiSolverInterface * solver = solverX->clone(); const double *objective = solver->getObjCoefficients() ; int numberColumns = solver->getNumCols() ; int numberRows = solver->getNumRows(); double direction = solver->getObjSense(); int iRow,iColumn; // Row copy CoinPackedMatrix matrixByRow(*solver->getMatrixByRow()); const double * elementByRow = matrixByRow.getElements(); const int * column = matrixByRow.getIndices(); const CoinBigIndex * rowStart = matrixByRow.getVectorStarts(); const int * rowLength = matrixByRow.getVectorLengths(); // Column copy CoinPackedMatrix matrixByCol(*solver->getMatrixByCol()); const double * element = matrixByCol.getElements(); const int * row = matrixByCol.getIndices(); const CoinBigIndex * columnStart = matrixByCol.getVectorStarts(); const int * columnLength = matrixByCol.getVectorLengths(); const double * rowLower = solver->getRowLower(); const double * rowUpper = solver->getRowUpper(); char * ignore = new char [numberRows]; int * which = new int[numberRows]; double * changeRhs = new double[numberRows]; memset(changeRhs,0,numberRows*sizeof(double)); memset(ignore,0,numberRows); int numberChanged=0; bool finished=false; while (!finished) { int saveNumberChanged = numberChanged; for (iRow=0;iRow lower[jColumn]+1.0e-8) { if (!intVar[jColumn]) { if (numberContinuous==0) { jColumn1=jColumn; value1=value; } else { jColumn2=jColumn; value2=value; } numberContinuous++; } else { if (fabs(value-floor(value+0.5))>1.0e-12) allIntegerCoeff=false; } } else { sumFixed += lower[jColumn]*value; } } double low = rowLower[iRow]; if (low>-1.0e20) { low -= sumFixed; if (fabs(low-floor(low+0.5))>1.0e-12) allIntegerCoeff=false; } double up = rowUpper[iRow]; if (up<1.0e20) { up -= sumFixed; if (fabs(up-floor(up+0.5))>1.0e-12) allIntegerCoeff=false; } if (!allIntegerCoeff) continue; // can't do if (numberContinuous==1) { // see if really integer // This does not allow for complicated cases if (low==up) { if (fabs(value1)>1.0e-3) { value1 = 1.0/value1; if (fabs(value1-floor(value1+0.5))<1.0e-12) { // integer numberChanged++; intVar[jColumn1]=77; } } } else { if (fabs(value1)>1.0e-3) { value1 = 1.0/value1; if (fabs(value1-floor(value1+0.5))<1.0e-12) { // This constraint will not stop it being integer ignore[iRow]=1; } } } } else if (numberContinuous==2) { if (low==up) { /* need general theory - for now just look at 2 cases - 1 - +- 1 one in column and just costs i.e. matching objective 2 - +- 1 two in column but feeds into G/L row which will try and minimize (take out 2 for now - until fixed) */ if (fabs(value1)==1.0&&value1*value2==-1.0&&!lower[jColumn1] &&!lower[jColumn2]&&columnLength[jColumn1]==1&&columnLength[jColumn2]==1) { int n=0; int i; double objChange=direction*(objective[jColumn1]+objective[jColumn2]); double bound = CoinMin(upper[jColumn1],upper[jColumn2]); bound = CoinMin(bound,1.0e20); for ( i=columnStart[jColumn1];i=0.0) { // see if all rows OK bool good=true; for (i=0;i0.0) { double rhs = rowLower[jRow]; if (rhs>0.0) { double ratio =rhs/value; if (fabs(ratio-floor(ratio+0.5))>1.0e-12) good=false; } } else { double rhs = rowUpper[jRow]; if (rhs<0.0) { double ratio =rhs/value; if (fabs(ratio-floor(ratio+0.5))>1.0e-12) good=false; } } } else if (rowLength[jRow]==2) { if (value>0.0) { if (rowLower[jRow]>-1.0e20) good=false; } else { if (rowUpper[jRow]<1.0e20) good=false; } } else { good=false; } } } if (good) { // both can be integer numberChanged++; intVar[jColumn1]=77; numberChanged++; intVar[jColumn2]=77; } } // clear for (i=0;i lower[iColumn]+1.0e-8&&!intVar[iColumn]) { double value; value = upper[iColumn]; if (value<1.0e20&&fabs(value-floor(value+0.5))>1.0e-12) continue; value = lower[iColumn]; if (value>-1.0e20&&fabs(value-floor(value+0.5))>1.0e-12) continue; bool integer=true; for (CoinBigIndex j=columnStart[iColumn];j1.0e20) { upper[iColumn] = 1.0e20; } else { upper[iColumn] = floor(upper[iColumn]+1.0e-5); } if (lower[iColumn]<-1.0e20) { lower[iColumn] = -1.0e20; } else { lower[iColumn] = ceil(lower[iColumn]-1.0e-5); if (lower[iColumn]>upper[iColumn]) feasible=false; } if (lower[iColumn]==0.0&&upper[iColumn]==1.0) intVar[iColumn]=1; else if (lower[iColumn]==upper[iColumn]) intVar[iColumn]=0; else intVar[iColumn]=2; } } delete [] which; delete [] changeRhs; delete [] ignore; //if (numberChanged) //printf("%d variables could be made integer\n",numberChanged); delete solver; return feasible; } int CglProbing::gutsOfGenerateCuts(const OsiSolverInterface & si, OsiCuts & cs , double * rowLower, double * rowUpper, double * colLower, double * colUpper, CglTreeInfo * info) { //printf("PASS\n"); // Get basic problem information int nRows; CoinPackedMatrix * rowCopy=NULL; int numberRowCutsBefore = cs.sizeRowCuts(); // get branch and bound cutoff double cutoff; bool cutoff_available = si.getDblParam(OsiDualObjectiveLimit,cutoff); if (!cutoff_available||usingObjective_<0) { // cut off isn't set or isn't valid cutoff = si.getInfinity(); } cutoff *= si.getObjSense(); if (fabs(cutoff)>1.0e30) assert (cutoff>1.0e30); int mode=mode_; int nCols=si.getNumCols(); // get integer variables const char * intVarOriginal = si.getColType(true); char * intVar = CoinCopyOfArray(intVarOriginal,nCols); int i; int numberIntegers=0; CoinMemcpyN(si.getColLower(),nCols,colLower); CoinMemcpyN(si.getColUpper(),nCols,colUpper); const double * colsol =si.getColSolution(); // and put reasonable bounds on integer variables for (i=0;i1.0e12) colUpper[i] = CGL_REASONABLE_INTEGER_BOUND; if (colsol[i]>-1.0e10&&colLower[i]<-1.0e12) colLower[i] = -CGL_REASONABLE_INTEGER_BOUND; } } } bool feasible=true; if (!info->inTree&&!info->pass) { // make more integer feasible = analyze(&si,intVar,colLower,colUpper); } if (feasible&&PROBING_EXTRA_STUFF) { // tighten bounds on djs // should be in CbcCutGenerator and check if basic const double * djs =si.getReducedCost(); const double * colsol =si.getColSolution(); double direction = si.getObjSense(); double cutoff; bool cutoff_available = si.getDblParam(OsiDualObjectiveLimit,cutoff); if (!cutoff_available||usingObjective_<0) { // cut off isn't set or isn't valid cutoff = si.getInfinity(); } cutoff *= direction; if (fabs(cutoff)>1.0e30) assert (cutoff>1.0e30); double current = si.getObjValue(); current *= direction; double gap=CoinMax(cutoff-current,1.0e-1); for (int i = 0; i < nCols; ++i) { double djValue = djs[i]*direction; if (colUpper[i]-colLower[i]>1.0e-8) { if (colsol[i]gap) { if (si.isInteger(i)) { printf("why int %d not fixed at lb\n",i); colUpper[i]= colLower[i]; } else { double newUpper = colLower[i] + gap/djValue; if (newUppercolUpper[i]-primalTolerance_) { if (-djValue>gap) { if (si.isInteger(i)) { printf("why int %d not fixed at ub\n",i); colLower[i]= colUpper[i]; } else { double newLower = colUpper[i] + gap/djValue; if (newLower>colLower[i]) { //printf("%d lb from %g to %g\n",i,colLower[i],newLower); colLower[i]= CoinMin(newLower,colUpper[i]-1.0e-5); } } } } } } } int ninfeas=0; // Set up maxes int maxProbe = info->inTree ? maxProbe_ : maxProbeRoot_; int maxElements = info->inTree ? maxElements_ : maxElementsRoot_; //if (!info->inTree&&!info->pass) //maxElements=nCols; // Get objective offset double offset; si.getDblParam(OsiObjOffset,offset); #ifdef COIN_DEVELOP if (offset&&!info->inTree&&!info->pass) printf("CglProbing obj offset %g\n",offset); #endif // see if using cached copy or not if (!rowCopy_) { // create from current nRows=si.getNumRows(); // mode==0 is invalid if going from current matrix if (mode==0) mode=1; // add in objective if there is a cutoff if (cutoff<1.0e30&&usingObjective_>0) { rowCopy = new CoinPackedMatrix(*si.getMatrixByRow(),1,nCols,false); } else { rowCopy = new CoinPackedMatrix(*si.getMatrixByRow()); } // add in objective if there is a cutoff if (cutoff<1.0e30&&usingObjective_>0) { int * columns = new int[nCols]; double * elements = new double[nCols]; int n=0; const double * objective = si.getObjCoefficients(); bool maximize = (si.getObjSense()==-1); for (i=0;iappendRow(n,columns,elements); delete [] columns; delete [] elements; CoinMemcpyN(si.getRowLower(),nRows,rowLower); CoinMemcpyN(si.getRowUpper(),nRows,rowUpper); rowLower[nRows]=-COIN_DBL_MAX; rowUpper[nRows]=cutoff+offset; nRows++; } else { CoinMemcpyN(si.getRowLower(),nRows,rowLower); CoinMemcpyN(si.getRowUpper(),nRows,rowUpper); } } else { // use snapshot nRows=numberRows_; assert(nCols==numberColumns_); rowCopy = new CoinPackedMatrix(*rowCopy_); assert (rowCopy_->getNumRows()==numberRows_); rowLower = new double[nRows]; rowUpper = new double[nRows]; CoinMemcpyN(rowLower_,nRows,rowLower); CoinMemcpyN(rowUpper_,nRows,rowUpper); if (usingObjective_>0) { rowLower[nRows-1]=-COIN_DBL_MAX; rowUpper[nRows-1]=cutoff+offset; } } CoinBigIndex * rowStartPos = NULL; int * realRows = NULL; { // Now take out rows with too many elements int * rowLength = rowCopy->getMutableVectorLengths(); //#define OUTRUBBISH double * elements = rowCopy->getMutableElements(); int * column = rowCopy->getMutableIndices(); CoinBigIndex * rowStart = rowCopy->getMutableVectorStarts(); #ifdef OUTRUBBISH double large=1.0e3; #endif int nDelete = 0; int nKeep=0; int * which = new int[nRows]; int nElements=rowCopy->getNumElements(); int nTotalOut=0; int nRealRows = si.getNumRows(); for (i=0;imaxElements||(rowLower[i]<-1.0e20&&rowUpper[i]>1.0e20)) { // keep objective if (imaxElements&&i1.0e20)) { which[nDelete++]=i; } else { #ifdef OUTRUBBISH // out all rows with infinite plus and minus int nPlus=rowUpper[i]>-large ? 0 : 1; int nMinus=rowLower[i]large) { if (elements[j]>0.0) nPlus++; else nMinus++; } if (colLower[iColumn]<-large) { if (elements[j]<0.0) nPlus++; else nMinus++; } } if (!nPlus||!nMinus) { rowLower[nKeep]=rowLower[i]; rowUpper[nKeep]=rowUpper[i]; nKeep++; } else { nExtraDel++; which[nDelete++]=i; } #else if (info->strengthenRow&&!info->pass&&(rowLower[i]<-1.0e20||rowUpper[i]>1.0e20)) { int nPlus=0; int nMinus=0; for (CoinBigIndex j=rowStart[i];j0.0) { nPlus++; } else { nMinus++; } } else { nPlus=2; nMinus=2; break; } } double effectiveness=0.0; if (nPlus==1&&rowUpper[i]>0.0&&rowUpper[i]<1.0e10) { // can make element smaller for (CoinBigIndex j=rowStart[i];j0.0) { elements[j] -= rowUpper[i]; //printf("pass %d row %d plus el from %g to %g\n",info->pass, // i,elements[j]+rowUpper[i],elements[j]); } effectiveness += fabs(elements[j]); } rowUpper[i]=0.0; } else if (nMinus==1&&rowLower[i]<0.0&&rowLower[i]>-1.0e10) { // can make element smaller in magnitude for (CoinBigIndex j=rowStart[i];jpass, // i,elements[j]+rowLower[i],elements[j]); } effectiveness += fabs(elements[j]); } rowLower[i]=0.0; } if (effectiveness) { OsiRowCut rc; rc.setLb(rowLower[i]); rc.setUb(rowUpper[i]); int start = rowStart[i]; int n = rowLength[i]; rc.setRow(rowLength[i],column+start,elements+start,false); // but get rid of tinies CoinPackedVector & row = rc.mutableRow(); double * elements = row.getElements(); int n2=0; for (n2=0;n21.0e-12) { elements[n2]=elements[i]; columns[n2++]=columns[i]; } } row.truncate(n2); } rc.setEffectiveness(effectiveness); assert (!info->strengthenRow[i]); info->strengthenRow[i]=rc.clone(); } } rowLower[nKeep]=rowLower[i]; rowUpper[nKeep]=rowUpper[i]; nKeep++; #endif } } if (nDelete) { #ifdef OUTRUBBISH if (nExtraDel) { printf("%d rows deleted (extra %d)\n",nDelete,nExtraDel); } #else #endif if (info->strengthenRow) { // Set up pointers to real rows realRows = new int [nRows]; CoinZeroN(realRows,nRows); for (i=0;ideleteRows(nDelete,which); nRows=nKeep; } delete [] which; if (!nRows) { #ifdef COIN_DEVELOP printf("All rows too long for probing\n"); #endif // nothing left!! // delete stuff delete rowCopy; if (rowCopy_) { delete [] rowLower; delete [] rowUpper; } delete [] intVar; // and put back unreasonable bounds on integer variables const double * trueLower = si.getColLower(); const double * trueUpper = si.getColUpper(); for (i=0;igetMutableElements(); column = rowCopy->getMutableIndices(); rowStart = rowCopy->getMutableVectorStarts(); rowLength = rowCopy->getMutableVectorLengths(); #if 0 int nFixed=0; for (i=0;icolLower[iColumn]) { double value = elements[j]; if (value<0.0) { elements[newSize]=value; column[newSize++]=iColumn; } else if (value>0.0) { elements2[nOther]=value; column2[nOther++]=iColumn; } } else { offset += colUpper[iColumn]*elements[j]; } } rowStartPos[i] = newSize; for (int k=0;k-1.0e20) rowLower[i] -= offset; if (rowUpper[i]<1.0e20) rowUpper[i] -= offset; } } delete [] column2; delete [] elements2; rowStart[nRows]=newSize; rowCopy->setNumElements(newSize); } CoinPackedMatrix * columnCopy=new CoinPackedMatrix(*rowCopy,0,0,true); int nRowsSafe=CoinMin(nRows,si.getNumRows()); #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&!debugger->onOptimalPath(si)) debugger = NULL; #else const OsiRowCutDebugger * debugger = NULL; #endif const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * rowElements = rowCopy->getElements(); // Arrays so user can find out what happened if (!lookedAt_) { lookedAt_ = new int[nCols]; } numberThisTime_=0; // Let us never add more than twice the number of rows worth of row cuts // Keep cuts out of cs until end so we can find duplicates quickly int nRowsFake = info->inTree ? nRowsSafe/3 : nRowsSafe; if (!info->inTree&&!info->pass) nRowsFake *= 5; row_cut rowCut(nRowsFake,!info->inTree); int * markR = new int [nRows]; double * minR = new double [nRows]; double * maxR = new double [nRows]; if (mode) { ninfeas= tighten(colLower, colUpper, column, rowElements, rowStart, rowStartPos ,rowLength, rowLower, rowUpper, nRows, nCols, intVar, 2, primalTolerance_); if (!feasible) ninfeas=1; if (!ninfeas) { // create column cuts where integer bounds have changed { const double * lower = si.getColLower(); const double * upper = si.getColUpper(); const double * colsol = si.getColSolution(); int numberChanged=0,ifCut=0; CoinPackedVector lbs; CoinPackedVector ubs; for (i = 0; i < nCols; ++i) { if (intVar[i]) { colUpper[i] = CoinMin(upper[i],floor(colUpper[i]+1.0e-4)); if (colUpper[i]lower[i]+1.0e-8) { if (colLower[i]>colsol[i]+1.0e-8) ifCut=1; lbs.insert(i,colLower[i]); numberChanged++; } } } if (numberChanged) { OsiColCut cc; cc.setUbs(ubs); cc.setLbs(lbs); if (ifCut) { cc.setEffectiveness(100.0); } else { cc.setEffectiveness(1.0e-5); } #ifdef CGL_DEBUG checkBounds(debugger,cc); #endif cs.insert(cc); } } if (maxProbe>0) { numberThisTime_=0; // get min max etc for rows tighten2(colLower, colUpper, column, rowElements, rowStart, rowLength, rowLower, rowUpper, minR , maxR , markR, nRows); // decide what to look at if (mode==1) { const double * colsol = si.getColSolution(); double_int_pair * array = new double_int_pair [nCols]; # ifdef ZEROFAULT std::memset(array,0,sizeof(double_int_pair)*nCols) ; # endif double multiplier = -1.0; if (info->inTree||(info->pass&1)!=0) multiplier=1.0; //const int * columnLength = si.getMatrixByCol()->getVectorLengths(); for (i=0;i1.0e-8) { double away = fabs(0.5-(colsol[i]-floor(colsol[i]))); if (away<0.49999||!info->inTree) { //array[numberThisTime_].infeasibility=away; array[numberThisTime_].infeasibility=away*multiplier; //array[numberThisTime_].infeasibility=-columnLength[i]; array[numberThisTime_++].sequence=i; } } } //printf("maxP %d num %d\n",maxProbe,numberThisTime_); std::sort(array,array+numberThisTime_,double_int_pair_compare()); //numberThisTime_=CoinMin(numberThisTime_,maxProbe); for (i=0;i1.0e-8) { lookedAt_[numberThisTime_++]=i; } } } #if 0 // Only look at short rows for (i=0;imaxElements) abort(); //markR[i]=-2; } #endif // sort to be clean //std::sort(lookedAt_,lookedAt_+numberThisTime_); if (!numberCliques_) { ninfeas= probe(si, debugger, cs, colLower, colUpper, rowCopy,columnCopy, rowStartPos, realRows, rowLower, rowUpper, intVar, minR, maxR, markR, info); } else { ninfeas= probeCliques(si, debugger, cs, colLower, colUpper, rowCopy,columnCopy, realRows,rowLower, rowUpper, intVar, minR, maxR, markR, info); } } } } else if (maxProbe>0) { // global cuts from previous calculations // could check more thoroughly that integers are correct assert(numberIntegers==numberIntegers_); // make up list of new variables to look at numberThisTime_=0; const double * colsol = si.getColSolution(); double_int_pair * array = new double_int_pair [nCols]; # ifdef ZEROFAULT std::memset(array,0,sizeof(double_int_pair)*nCols) ; # endif for (i=0;i1.0e-8) { double away = fabs(0.5-(colsol[j]-floor(colsol[j]))); array[numberThisTime_].infeasibility=away; array[numberThisTime_++].sequence=i; } } std::sort(array,array+numberThisTime_,double_int_pair_compare()); numberThisTime_=CoinMin(numberThisTime_,maxProbe); for (i=0;imaxElements) abort(); //markR[i]=-2; } #endif ninfeas= probeCliques(si, debugger, csNew, colLower, colUpper, rowCopy,columnCopy, realRows, rowLower, rowUpper, intVar, minR, maxR, markR, info); } if (!ninfeas) { // go through row cuts int nCuts = csNew.sizeRowCuts(); int iCut; // need space for backward lookup // just for ones being looked at int * backward = new int [2*nCols]; int * onList = backward + nCols; for (i=0;i0.0); // delta to 0 => x to 0.0 cutVector_[i].length++; } else { if (elements[1-which]<0.0&&fabs(elements[which]/elements[1-which]- colUpper[other])<1.0e-5) { // delta to 1 => x to upper bound cutVector_[i].length++; } else { if (onList[other]) { double value0 = elements[0]; double value1 = elements[1]; if (value0*value1==-1.0) { // can do something ? int j=backward[other]; cutVector_[i].length++; cutVector_[j].length++; } else { continue; } } } } } else { if (onList[other]) { if (elements[0]==1.0&&elements[1]==1.0&&rcut.ub()==1.0) { // can do something ? int j=backward[other]; cutVector_[i].length++; cutVector_[j].length++; } else { continue; } } } } else { assert(rcut.ub()==DBL_MAX); if (!lb) { // LB if (elements[which]>0.0) { //assert (elements[1-which]<0.0); // delta to 0 => x to 0.0 // flip so same as UB cutVector_[i].length++; } else { if (elements[1-which]<0.0&&fabs(elements[which]/elements[1-which]- colUpper[other])<1.0e-5) { // delta to 1 => x to upper bound cutVector_[i].length++; } else { if (onList[other]) { double value0 = elements[0]; double value1 = elements[1]; if (value0*value1==-1.0) { // can do something ? int j=backward[other]; cutVector_[i].length++; cutVector_[j].length++; } else { continue; } } } } } } } // allocate space for (i=0;i=0) setAffectedInDisaggregation(cutVector_[i].index[iput],j); else setAffectedInDisaggregation(cutVector_[i].index[iput],other); setWhenAtUBInDisaggregation(cutVector_[i].index[iput],false); setAffectedToUBInDisaggregation(cutVector_[i].index[iput],false); setZeroOneInDisaggregation(cutVector_[i].index[iput],onList[other]!=0); cutVector_[i].length++; } else { if (elements[1-which]<0.0&&fabs(elements[which]/elements[1-which]- colUpper[other])<1.0e-5) { // delta to 1 => x to upper bound iput=cutVector_[i].length; if (j>=0) setAffectedInDisaggregation(cutVector_[i].index[iput],j); else setAffectedInDisaggregation(cutVector_[i].index[iput],other); setWhenAtUBInDisaggregation(cutVector_[i].index[iput],true); setAffectedToUBInDisaggregation(cutVector_[i].index[iput],true); setZeroOneInDisaggregation(cutVector_[i].index[iput],onList[other]!=0); cutVector_[i].length++; } else { if (onList[other]) { double value0 = elements[0]; double value1 = elements[1]; if (value0*value1==-1.0) { // can do something ? int j=backward[other]; assert (j>=0); // flip so value0 1.0 if (value1==1.0) { j=i; i=backward[other]; value1=value0; value0=1.0; } assert (value0==1.0); assert (value1==-1.0); iput=cutVector_[i].length; setAffectedInDisaggregation(cutVector_[i].index[iput],j); setWhenAtUBInDisaggregation(cutVector_[i].index[iput],true); setAffectedToUBInDisaggregation(cutVector_[i].index[iput],true); setZeroOneInDisaggregation(cutVector_[i].index[iput],true); cutVector_[i].length++; iput=cutVector_[j].length; setAffectedInDisaggregation(cutVector_[j].index[iput],i); setWhenAtUBInDisaggregation(cutVector_[j].index[iput],false); setAffectedToUBInDisaggregation(cutVector_[j].index[iput],false); setZeroOneInDisaggregation(cutVector_[j].index[iput],true); cutVector_[j].length++; } } } } } else { if (onList[other]) { if (elements[0]==1.0&&elements[1]==1.0&&rcut.ub()==1.0) { // can do something ? int j=backward[other]; assert (j>=0); iput=cutVector_[i].length; setAffectedInDisaggregation(cutVector_[i].index[iput],j); setWhenAtUBInDisaggregation(cutVector_[i].index[iput],true); setAffectedToUBInDisaggregation(cutVector_[i].index[iput],false); setZeroOneInDisaggregation(cutVector_[i].index[iput],true); cutVector_[i].length++; iput=cutVector_[j].length; setAffectedInDisaggregation(cutVector_[j].index[iput],i); setWhenAtUBInDisaggregation(cutVector_[j].index[iput],true); setAffectedToUBInDisaggregation(cutVector_[j].index[iput],false); setZeroOneInDisaggregation(cutVector_[j].index[iput],true); cutVector_[j].length++; } else { #ifdef COIN_DEVELOP abort(); #endif continue; } } } } else { assert(rcut.ub()==DBL_MAX); if (!lb) { // LB if (elements[which]>0.0) { iput=cutVector_[i].length; if (j>=0) setAffectedInDisaggregation(cutVector_[i].index[iput],j); else setAffectedInDisaggregation(cutVector_[i].index[iput],other); setWhenAtUBInDisaggregation(cutVector_[i].index[iput],false); setAffectedToUBInDisaggregation(cutVector_[i].index[iput],false); setZeroOneInDisaggregation(cutVector_[i].index[iput],onList[other]!=0); cutVector_[i].length++; } else { if (elements[1-which]<0.0&&fabs(elements[which]/elements[1-which]- colUpper[other])<1.0e-5) { iput=cutVector_[i].length; if (j>=0) setAffectedInDisaggregation(cutVector_[i].index[iput],j); else setAffectedInDisaggregation(cutVector_[i].index[iput],other); setWhenAtUBInDisaggregation(cutVector_[i].index[iput],true); setAffectedToUBInDisaggregation(cutVector_[i].index[iput],true); setZeroOneInDisaggregation(cutVector_[i].index[iput],onList[other]!=0); cutVector_[i].length++; } else { if (onList[other]) { double value0 = elements[0]; double value1 = elements[1]; if (value0*value1==-1.0) { // can do something ? int j=backward[other]; assert (j>=0); // flip so value0 -1.0 if (value1==-1.0) { j=i; i=backward[other]; value1=value0; value0=-1.0; } assert (value0==-1.0); assert (value1==1.0); iput=cutVector_[i].length; setAffectedInDisaggregation(cutVector_[i].index[iput],j); setWhenAtUBInDisaggregation(cutVector_[i].index[iput],true); setAffectedToUBInDisaggregation(cutVector_[i].index[iput],true); setZeroOneInDisaggregation(cutVector_[i].index[iput],true); cutVector_[i].length++; iput=cutVector_[j].length; setAffectedInDisaggregation(cutVector_[j].index[iput],i); setWhenAtUBInDisaggregation(cutVector_[j].index[iput],false); setAffectedToUBInDisaggregation(cutVector_[j].index[iput],false); setZeroOneInDisaggregation(cutVector_[j].index[iput],true); cutVector_[j].length++; } } } } } } } delete [] backward; // Now sort and get rid of duplicates // could also see if any are cliques int longest=0; for (i=0;i>3; int zeroOne = (sortit[k]&4)>>2; int whenAtUB = (sortit[k]&2)>>1; int affectedToUB = sortit[k]&1; disaggregationAction action; action.affected=0; setAffectedInDisaggregation(action,affected); setZeroOneInDisaggregation(action,zeroOne!=0); setWhenAtUBInDisaggregation(action,whenAtUB!=0); setAffectedToUBInDisaggregation(action,affectedToUB!=0); if (affected!=affectedLast||zeroOne!=zeroOneLast) { // new variable thisOne.index[put++]=action; } else if (whenAtUB!=whenAtUBLast||affectedToUB!=affectedToUBLast) { // new action - what can we discover thisOne.index[put++]=action; int j=cutVector_[i].sequence; int k=affected; if (zeroOne) { k=cutVector_[k].sequence; if (logLevel_>1) printf("For %d %d 0-1 pair",j,k) ; } else { if (logLevel_>1) printf("For %d %d pair",j,k) ; } if (logLevel_>1) printf(" old whenAtUB, affectedToUB %d %d, new whenAtUB, affectedToUB %d %d\n", whenAtUBLast, affectedToUBLast,whenAtUB, affectedToUB); } affectedLast=affected; zeroOneLast=zeroOne; whenAtUBLast=whenAtUB; affectedToUBLast=affectedToUB; } if (put(affected)>i) { bool whenAtUB = whenAtUBInDisaggregation(thisOne.index[k]); bool affectedToUB = affectedToUBInDisaggregation(thisOne.index[k]); disaggregation otherOne=cutVector_[affected]; int numberOther = otherOne.length; // Could do binary search if a lot int lastAction=-1; for (int j=0;j x + y <=1 (1,1 impossible) 1 -> x - y <=0 (1,0 impossible) 2 -> -x + y <=0 (0,1 impossible) 3 -> -x -y <= -1 (0,0 impossible) 10 -> x == y 11 -> x + y == 1 20 -> x == 0 21 -> x == 1 22 -> y == 0 23 -> y == 1 */ int action=-1; if (whenAtUB) { if (affectedToUB) { // x -> 1 => y -> 1 if (whenAtUBOther) { if (affectedToUBOther) { // y -> 1 => x -> 1 action=10; // x,y must be same } else { // y -> 1 => x -> 0 action=20; // If x is 1 then contradiction } } else { if (affectedToUBOther) { // y -> 0 => x -> 1 action=23; // if y is 0 then contradiction } else { // y -> 0 => x -> 0 action=1; // x,y 1,0 impossible } } } else { // x -> 1 => y -> 0 if (whenAtUBOther) { if (affectedToUBOther) { // y -> 1 => x -> 1 action=22; // If y is 1 then contradiction } else { // y -> 1 => x -> 0 action=0; } } else { if (affectedToUBOther) { // y -> 0 => x -> 1 action=11; // x,y with same values impossible } else { // y -> 0 => x -> 0 action=20; // If x is 1 then contradiction } } } } else { if (affectedToUB) { // x -> 0 => y -> 1 if (whenAtUBOther) { if (affectedToUBOther) { // y -> 1 => x -> 1 action=21; // If x is 0 then contradiction } else { // y -> 1 => x -> 0 action=11; // x,y must be different } } else { if (affectedToUBOther) { // y -> 0 => x -> 1 action=3; // one of x,y must be 1 } else { // y -> 0 => x -> 0 action=23; // if y is 0 then contradiction } } } else { // x -> 0 => y -> 0 if (whenAtUBOther) { if (affectedToUBOther) { // y -> 1 => x -> 1 action=2; // x,y 0,1 impossible } else { // y -> 1 => x -> 0 action=22; // If y is 1 then contradiction } } else { if (affectedToUBOther) { // y -> 0 => x -> 1 action=21; // if x is 0 then contradiction } else { // y -> 0 => x -> 0 action=10; // x,y must be same } } } } assert (action>=0); if (action<4) { // clique - see if there if (oneFixStart_) { switch (action) { case 0: break; case 1: break; case 2: break; case 3: break; } // If not can we add or strengthen } // check last action if (lastAction>=0) { if (logLevel_>1) printf("XX lastAction %d, this %d\n",lastAction,action); } } else if (action<12) { if (logLevel_>1) printf("XX Could eliminate one of %d %d 0-1 variables %c\n",i,affected, (lastAction>=0) ? '*' : ' '); if (info->strengthenRow) { OsiRowCut rc; int index[2]; double element[2]; index[0]=cutVector_[i].sequence; element[0]=1.0; index[1]=cutVector_[affected].sequence; if (action==10) { // 10 -> x == y rc.setLb(0.0); rc.setUb(0.0); element[1]= -1.0; } else { // 11 -> x + y == 1 rc.setLb(1.0); rc.setUb(1.0); element[1]= 1.0; } rc.setRow(2,index,element,false); cs.insert(rc); } } else { if (action<22) { if (logLevel_>1) printf("XX Could fix a 0-1 variable %d\n",i); } else { if (logLevel_>1) printf("XX Could fix a 0-1 variable %d\n",affected); } } //printf("%d when %d forces %d to %d , %d when %d forces %d to %d\n", // i,whenAtUB,affected,affectedToUB, // affected, whenAtUBOther,i, affectedToUBOther); } } } } } delete [] sortit; } if (cutVector_) { // now see if any disaggregation cuts are violated for (i=0;i1.0e-8) { double away = fabs(0.5-(solInt-floor(solInt))); if (away<0.4999999) { disaggregation thisOne=cutVector_[i]; int k; OsiRowCut rc; for (k=0;k 0 => x to lb (at present just 0) infeasibility = solValue - upper * solInt; if (infeasibility > 1.0e-3) { rc.setLb(-COIN_DBL_MAX); rc.setUb(0.0); index[0]=icol; element[0]=1.0; index[1]=j; element[1]= -upper; } else { infeasibility=0.0; } } else { // delta -> 0 => x to ub abort(); } } else { if (affectedToUBInDisaggregation(thisOne.index[k])) { // delta -> 1 => x to ub (?) icol = affectedInDisaggregation(thisOne.index[k]); if (zeroOneInDisaggregation(thisOne.index[k])) icol = cutVector_[icol].sequence; solValue=colsol[icol]; upper=colUpper_[icol]; if (!colLower[icol]) { infeasibility = upper * solInt - solValue; if (infeasibility > 1.0e-3) { rc.setLb(-COIN_DBL_MAX); rc.setUb(0.0); index[0]=icol; element[0]=-1.0; index[1]=j; element[1]= upper; } else { infeasibility=0.0; } } else { assert (upper==colLower[icol]); infeasibility=0.0; } } else { // delta + delta2 <= 1 assert (zeroOneInDisaggregation(thisOne.index[k])); // delta -> 1 => delta2 -> 0 icol = affectedInDisaggregation(thisOne.index[k]); icol = cutVector_[icol].sequence; // only do if icol > j if (icol >j && colUpper[icol] ) { solValue=colsol[icol]; if (!colLower[icol]) { infeasibility = solInt + solValue - 1.0; if (infeasibility > 1.0e-3) { rc.setLb(-COIN_DBL_MAX); rc.setUb(1.0); index[0]=icol; element[0]=1.0; index[1]=j; element[1]= 1.0; } else { infeasibility=0.0; } } else { assert (upper==colLower[icol]); infeasibility=0.0; } } } } if (infeasibility) { rc.setEffectiveness(infeasibility); rc.setRow(2,index,element,false); if (logLevel_>1) printf("%g <= %g * x%d + %g * x%d <= %g\n", rc.lb(),element[0],index[0],element[1],index[1],rc.ub()); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); } } } } } } } delete [] markR; delete [] minR; delete [] maxR; // Add in row cuts if (!ninfeas) { rowCut.addCuts(cs,info->strengthenRow,0); } // delete stuff delete rowCopy; delete columnCopy; if (rowCopy_) { delete [] rowLower; delete [] rowUpper; } delete [] intVar; delete [] rowStartPos; delete [] realRows; // and put back unreasonable bounds on integer variables const double * trueLower = si.getColLower(); const double * trueUpper = si.getColUpper(); if (!ninfeas) { for (i=0;iinTree&&((info->options&4)==4||((info->options&8)&&!info->pass))) { int numberRowCutsAfter = cs.sizeRowCuts(); for (int i=numberRowCutsBefore;isetGloballyValid(); } return ninfeas; } // Does probing and adding cuts int CglProbing::probe( const OsiSolverInterface & si, const OsiRowCutDebugger * #ifdef CGL_DEBUG debugger #endif ,OsiCuts & cs, double * colLower, double * colUpper, CoinPackedMatrix *rowCopy, CoinPackedMatrix *columnCopy, const CoinBigIndex * rowStartPos,const int * realRows, const double * rowLower, const double * rowUpper, const char * intVar, double * minR, double * maxR, int * markR, CglTreeInfo * info) { int nRows=rowCopy->getNumRows(); int nRowsSafe=CoinMin(nRows,si.getNumRows()); int nCols=rowCopy->getNumCols(); const double * currentColLower = si.getColLower(); const double * currentColUpper = si.getColUpper(); // Set up maxes int maxStack = info->inTree ? maxStack_ : maxStackRoot_; int maxPass = info->inTree ? maxPass_ : maxPassRoot_; if ((totalTimesCalled_%10)==-1) { int newMax=CoinMin(2*maxStack,50); maxStack=CoinMax(newMax,maxStack); } double relaxedTolerance=2.0*primalTolerance_; #define ONE_ARRAY #ifdef ONE_ARRAY unsigned int DIratio = sizeof(double)/sizeof(int); assert (DIratio==1||DIratio==2); int nSpace = 8*nCols+4*nRows+2*maxStack; nSpace += (4*nCols+nRows+maxStack+DIratio-1)>>(DIratio-1); double * colsol = new double[nSpace]; double * djs = colsol + nCols; double * columnGap = djs + nCols; double * saveL = columnGap + nCols; double * saveU = saveL + 2*nCols; double * saveMin = saveU + 2*nCols; double * saveMax = saveMin + nRows; double * largestPositiveInRow = saveMax + nRows; double * largestNegativeInRow = largestPositiveInRow + nRows; double * element = largestNegativeInRow + nRows; double * lo0 = element + nCols; double * up0 = lo0 + maxStack; int * markC = reinterpret_cast (up0+maxStack); int * stackC = markC + nCols; int * stackR = stackC + 2*nCols; int * index = stackR + nRows; int * stackC0 = index + nCols; #else double * colsol = new double[nCols]; double * djs = new double[nCols]; double * columnGap = new double [nCols]; double * saveL = new double [2*nCols]; double * saveU = new double [2*nCols]; double * saveMin = new double [nRows]; double * saveMax = new double [nRows]; double * largestPositiveInRow = new double [nRows]; double * largestNegativeInRow = new double [nRows]; double * element = new double[nCols]; double * lo0 = new double[maxStack]; double * up0 = new double[maxStack]; int * markC = new int [nCols]; int * stackC = new int [2*nCols]; int * stackR = new int [nRows]; int * index = new int[nCols]; int * stackC0 = new int[maxStack]; #endif // Let us never add more than twice the number of rows worth of row cuts // Keep cuts out of cs until end so we can find duplicates quickly #define PROBING4 #ifdef PROBING4 int nRowsFake = info->inTree ? nRowsSafe/3 : nRowsSafe*10; #else int nRowsFake = info->inTree ? nRowsSafe/3 : nRowsSafe; #endif if (!info->inTree&&!info->pass) nRowsFake *= 10; bool justReplace = ((info->options&64)!=0)&&(realRows!=NULL); if (justReplace) { nRowsFake=nRows; } row_cut rowCut(nRowsFake, !info->inTree); totalTimesCalled_++; const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const double * rowElements = rowCopy->getElements(); const int * row = columnCopy->getIndices(); const CoinBigIndex * columnStart = columnCopy->getVectorStarts(); const int * columnLength = columnCopy->getVectorLengths(); const double * columnElements = columnCopy->getElements(); #define MOVE_SINGLETONS #ifdef MOVE_SINGLETONS const double * objective = si.getObjCoefficients(); const int * columnLength2 = si.getMatrixByCol()->getVectorLengths(); #endif bool anyColumnCuts=false; int ninfeas=0; int rowCuts; double disaggEffectiveness; /* clean up djs and solution */ CoinMemcpyN(si.getReducedCost(),nCols,djs); CoinMemcpyN( si.getColSolution(),nCols,colsol); disaggEffectiveness=1.0e-3; rowCuts=rowCuts_; //CoinBigIndex * rowStartPos = new CoinBigIndex [nRows]; #ifndef NDEBUG const int * rowLength = rowCopy->getVectorLengths(); #endif for (int i=0;i0.0) break; } assert (rowStartPos[i]==kk); #endif double value; value=0.0; for ( kk =rowStart[i];kk1.0e-8) { if (colsol[i]colUpper[i]-primalTolerance_) { colsol[i]=colUpper[i]; djs[i] = CoinMin(0.0,djValue); } else { djs[i]=0.0; } } columnGap[i]=gap-primalTolerance_; } int ipass=0,nfixed=-1; double cutoff; bool cutoff_available = si.getDblParam(OsiDualObjectiveLimit,cutoff); if (!cutoff_available||usingObjective_<0) { // cut off isn't set or isn't valid cutoff = si.getInfinity(); } cutoff *= direction; if (fabs(cutoff)>1.0e30) assert (cutoff>1.0e30); double current = si.getObjValue(); current *= direction; /* for both way coding */ int nstackC0=-1; int nstackR,nstackC; //int nFix=0; for (int i=0;i1.0e10) markC[i] |= 8; if (colLower[i]<-1.0e10) markC[i] |= 4; } } //printf("PROBE %d fixed out of %d\n",nFix,nCols); double tolerance = 1.0e1*primalTolerance_; // If we are going to replace coefficient then we don't need to be effective //double needEffectiveness = info->strengthenRow ? -1.0e10 : 1.0e-3; double needEffectiveness = info->strengthenRow ? 1.0e-8 : 1.0e-3; if (justReplace&&(info->pass&1)!=0) needEffectiveness=-1.0e10; if (PROBING_EXTRA_STUFF) { int nCut=0; for (int iRow=0;iRow colLower[jColumn]+1.0e-8) { if (intVar[jColumn]) { numberInt++; whichInt=jColumn; intValue=value; } else if (value<0) { numberNeg++; } } else { sumFixed += colLower[jColumn]*value; } } if (numberInt==1&&numberNeg==0&&intValue<0.0&&!rowUpper[iRow]&&rowLower[iRow]<-1.0e30&&!sumFixed) { double intSol = colsol[whichInt]; for (CoinBigIndex j=rowStart[iRow];j colLower[jColumn]+1.0e-8) { if (!intVar[jColumn]) { if (colLower[jColumn]||colUpper[jColumn]>1.0) continue;; double upper = colUpper[jColumn]; if (colsol[jColumn]>intSol*upper+1.0e-4) { nCut++; OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(0.0); rc.setEffectiveness(1.0e-5); int index[2]; double element[2]; index[0]=jColumn; index[1]=whichInt; element[0]=1.0; element[1]=-upper; rc.setRow(2,index,element,false); cs.insert(rc); } } } } } } if (nCut) printf("%d possible cuts\n",nCut); } bool saveFixingInfo = false; #if PROBING100 CglTreeProbingInfo * probingInfo = dynamic_cast (info); const int * backward = NULL; const int * integerVariable = NULL; const int * toZero = NULL; const int * toOne = NULL; const fixEntry * fixEntries=NULL; #endif if (info->inTree) { #if PROBING100 backward = probingInfo->backward(); integerVariable = probingInfo->integerVariable(); toZero = probingInfo->toZero(); toOne = probingInfo->toOne(); fixEntries=probingInfo->fixEntries(); #endif } else { saveFixingInfo = (info->initializeFixing(&si)>0); } while (ipassinTree&&!info->pass) ? -1 : 0; int maxProbe = info->inTree ? maxProbe_ : maxProbeRoot_; if (justFix<0) maxProbe=numberThisTime_; if (maxProbe==123) { // Try and be a bit intelligent maxProbe=0; if (!info->inTree) { if (!info->pass||numberThisTime_<-100) { maxProbe=numberThisTime_; } else { int cutDown = 4; int offset = info->pass % cutDown; int i; int k=0; int kk=offset; for (i=0;ipass % cutDown; int i; int k=0; int kk=offset; for (i=0;iinTree&&!info->pass) leftTotalStack = 1234567890; #endif //printf("maxStack %d maxPass %d numberThisTime %d info pass %d\n", // maxStack,maxPass,numberThisTime_,info->pass); for (iLook=0;iLookinTree)) { #ifdef COIN_DEVELOP if (!info->inTree) printf("Exiting a on pass %d, maxProbe %d\n", ipass,maxProbe); #endif break; } else if (justFix<=0) { if (!info->inTree) { rowCuts=0; justFix=1; disaggEffectiveness=COIN_DBL_MAX; needEffectiveness=COIN_DBL_MAX; //maxStack=10; maxPass=1; } else if (!nfixed) { #ifdef COIN_DEVELOP printf("Exiting b on pass %d, maxProbe %d\n", ipass,maxProbe); #endif break; } } } int j=lookedAt_[iLook]; //if (j==231||j==226) //printf("size %d %d j is %d\n",rowCut.numberCuts(),cs.sizeRowCuts(),j);//printf("looking at %d (%d out of %d)\n",j,iLook,numberThisTime_); solval=colsol[j]; down = floor(solval+tolerance); up = ceil(solval-tolerance); if(columnGap[j]<0.0) markC[j]=3; if ((markC[j]&3)!=0||!intVar[j]) continue; double saveSolval = solval; if (solval>=colUpper[j]-tolerance||solval<=colLower[j]+tolerance||up==down) { if (solval<=colLower[j]+2.0*tolerance) { solval = colLower[j]+1.0e-1; down=colLower[j]; up=down+1.0; } else if (solval>=colUpper[j]-2.0*tolerance) { solval = colUpper[j]-1.0e-1; up=colUpper[j]; down=up-1; } else { // odd up=down+1.0; solval = down+1.0e-1; } } assert (up<=colUpper[j]); assert (down>=colLower[j]); assert (up>down); int istackC,iway, istackR; int way[]={1,2,1}; int feas[]={1,2,4}; int feasible=0; int notFeasible; for (iway=0;iway<3;iway ++) { int fixThis=0; double objVal=current; int goingToTrueBound=0; stackC[0]=j; markC[j]=way[iway]; double solMovement; double movement; if (way[iway]==1) { movement=down-colUpper[j]; solMovement = down-colsol[j]; assert(movement<-0.99999); if (fabs(down-colLower[j])<1.0e-7) { goingToTrueBound=2; down=colLower[j]; } } else { movement=up-colLower[j]; solMovement = up-colsol[j]; assert(movement>0.99999); if (fabs(up-colUpper[j])<1.0e-7) { goingToTrueBound=2; up=colUpper[j]; } } if (goingToTrueBound&&(colUpper[j]-colLower[j]>1.5||colLower[j])) goingToTrueBound=1; // switch off disaggregation if not wanted if ((rowCuts&1)==0) goingToTrueBound=0; bool canReplace = info->strengthenRow&&(goingToTrueBound==2); #ifdef PRINT_DEBUG if (fabs(movement)>1.01) { printf("big %d %g %g %g\n",j,colLower[j],solval,colUpper[j]); } #endif if (solMovement*djs[j]>0.0) objVal += solMovement*djs[j]; nstackC=1; nstackR=0; saveL[0]=colLower[j]; saveU[0]=colUpper[j]; assert (saveU[0]>saveL[0]); notFeasible=0; if (movement<0.0) { colUpper[j] += movement; colUpper[j] = floor(colUpper[j]+0.5); columnGap[j] = colUpper[j]-colLower[j]-primalTolerance_; #ifdef PRINT_DEBUG printf("** Trying %d down to 0\n",j); #endif } else { colLower[j] += movement; colLower[j] = floor(colLower[j]+0.5); columnGap[j] = colUpper[j]-colLower[j]-primalTolerance_; #ifdef PRINT_DEBUG printf("** Trying %d up to 1\n",j); #endif } if (fabs(colUpper[j]-colLower[j])<1.0e-6) markC[j]=3; // say fixed markC[j] &= ~12; if (colUpper[j]>1.0e10) markC[j] |= 8; if (colLower[j]<-1.0e10) markC[j] |= 4; istackC=0; /* update immediately */ int k; for ( k=columnStart[j];k0.0) { /* up */ if (value>0.0) { /* up does not change - down does */ if (minR[irow]>-1.0e10) minR[irow] += value; if (minR[irow]>rowUpper[irow]+1.0e-5) { notFeasible=1; istackC=1; break; } } else { /* down does not change - up does */ if (maxR[irow]<1.0e10) maxR[irow] += value; if (maxR[irow]-1.0e10) minR[irow] -= value; if (minR[irow]>rowUpper[irow]+1.0e-5) { notFeasible=1; istackC=1; break; } } else { /* down does not change - up does */ if (maxR[irow]<1.0e10) maxR[irow] -= value; if (maxR[irow]=0) { int nFix=0; // 0-1 see what else could be fixed if (jway==1) { // fixed to 0 int j; for ( j=toZero_[jColumn];jsaveL[nstackC]); assert (nstackCsaveL[nstackC]); assert (nstackCsaveL[nstackC]); assert (nstackCsaveL[nstackC]); assert (nstackC0) doRowUpN=false; if (rowUp2-largestPositiveInRow[irow]>0) doRowUpP=false; } } else { doRowUpN=false; doRowUpP=false; rowUp2=COIN_DBL_MAX; } double rowLo = rowLower[irow]; double rowLo2=0.0; bool doRowLoN; bool doRowLoP; if (rowLo>-1.0e10) { doRowLoN=true; doRowLoP=true; rowLo2 = rowLo-maxR[irow]; if (rowLo2>tolerance) { notFeasible=true; break; } else { if (rowLo2-largestNegativeInRow[irow]<0) doRowLoN=false; if (rowLo2+largestPositiveInRow[irow]<0) doRowLoP=false; } } else { doRowLoN=false; doRowLoP=false; rowLo2=-COIN_DBL_MAX; } if (doRowUpN&&doRowLoN) { //doRowUpN=doRowLoN=false; // Start neg values loop for (int kk =rStart;kk=-1e10) assert ((markIt&4)==0); else assert ((markIt&4)!=0); assert (value2<0.0); double gap = columnGap[kcol]*value2; bool doUp = (rowUp2 + gap < -1.0e-7); bool doDown = (rowLo2 -gap > 1.0e-7); if (doUp||doDown) { double moveUp=0.0; double moveDown=0.0; double newUpper=-1.0; double newLower=1.0; if ( doUp&&(markIt&(2+8))==0) { double dbound = colUpper[kcol]+rowUp2/value2; if (intVar[kcol]) { markIt |= 2; newLower = ceil(dbound-relaxedTolerance); } else { newLower=dbound; if (newLower+primalTolerance_>colUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveUp = newLower-colLower[kcol]; } if ( doDown&&(markIt&(1+4))==0) { double dbound = colLower[kcol] + rowLo2/value2; if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+relaxedTolerance); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveDown = newUpper-colUpper[kcol]; } if (!moveUp&&!moveDown) continue; bool onList = ((markC[kcol]&3)!=0); if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (moveUp&&nstackC<2*maxStack) { fixThis++; if (!onList) { stackC[nstackC]=kcol; saveL[nstackC]=colLower[kcol]; saveU[nstackC]=colUpper[kcol]; assert (saveU[nstackC]>saveL[nstackC]); assert (nstackCcolsol[kcol]) { if (djs[kcol]<0.0) { /* should be infeasible */ assert (newLower>colUpper[kcol]+primalTolerance_); } else { objVal += moveUp*djs[kcol]; } } if (intVar[kcol]) newLower = CoinMax(colLower[kcol],ceil(newLower-1.0e-4)); colLower[kcol]=newLower; columnGap[kcol] = colUpper[kcol]-newLower-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value*moveUp; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveUp; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]saveL[nstackC]); assert (nstackC0.0) { /* should be infeasible */ assert (colLower[kcol]>newUpper+primalTolerance_); } else { objVal += moveDown*djs[kcol]; } } if (intVar[kcol]) newUpper = CoinMin(colUpper[kcol],floor(newUpper+1.0e-4)); colUpper[kcol]=newUpper; columnGap[kcol] = newUpper-colLower[kcol]-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj-1.0e10) minR[krow] += value*moveDown; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ columnGap[kcol] = -1.0e50; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveDown; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; break; } } } } // end big loop rStart->rPos } else if (doRowUpN) { // Start neg values loop for (int kk =rStart;kkcolUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveUp = newLower-colLower[kcol]; if (!moveUp) continue; bool onList = ((markC[kcol]&3)!=0); if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (moveUp&&nstackC<2*maxStack) { fixThis++; if (!onList) { stackC[nstackC]=kcol; saveL[nstackC]=colLower[kcol]; saveU[nstackC]=colUpper[kcol]; assert (saveU[nstackC]>saveL[nstackC]); assert (nstackCcolsol[kcol]) { if (djs[kcol]<0.0) { /* should be infeasible */ assert (newLower>colUpper[kcol]+primalTolerance_); } else { objVal += moveUp*djs[kcol]; } } if (intVar[kcol]) newLower = CoinMax(colLower[kcol],ceil(newLower-1.0e-4)); colLower[kcol]=newLower; columnGap[kcol] = colUpper[kcol]-newLower-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value*moveUp; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ columnGap[kcol] = -1.0e50; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveUp; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; break; } } } } // end big loop rStart->rPos } else if (doRowLoN) { // Start neg values loop for (int kk =rStart;kk 1.0e-7); if (doDown&& (markIt&(1+4))==0 ) { double dbound = colLower[kcol] + rowLo2/value2; if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+relaxedTolerance); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveDown = newUpper-colUpper[kcol]; if (!moveDown) continue; bool onList = ((markC[kcol]&3)!=0); if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (moveDown&&nstackC<2*maxStack) { fixThis++; if (!onList) { stackC[nstackC]=kcol; saveL[nstackC]=colLower[kcol]; saveU[nstackC]=colUpper[kcol]; assert (saveU[nstackC]>saveL[nstackC]); assert (nstackC0.0) { /* should be infeasible */ assert (colLower[kcol]>newUpper+primalTolerance_); } else { objVal += moveDown*djs[kcol]; } } if (intVar[kcol]) newUpper = CoinMin(colUpper[kcol],floor(newUpper+1.0e-4)); colUpper[kcol]=newUpper; columnGap[kcol] = newUpper-colLower[kcol]-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj-1.0e10) minR[krow] += value*moveDown; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ columnGap[kcol] = -1.0e50; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveDown; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; break; } } } } // end big loop rStart->rPos } rStart = rEnd; rEnd = rowStart[irow+1]; if (doRowUpP&&doRowLoP) { //doRowUpP=doRowLoP=false; // Start pos values loop for (int kk =rStart;kk 0.0); /* positive element */ double gap = columnGap[kcol]*value2; bool doDown = (rowLo2 + gap > 1.0e-7); bool doUp = (rowUp2 - gap < -1.0e-7); if (doDown||doUp) { double moveUp=0.0; double moveDown=0.0; double newUpper=-1.0; double newLower=1.0; if (doDown&&(markIt&(2+8))==0) { double dbound = colUpper[kcol] + rowLo2/value2; if (intVar[kcol]) { markIt |= 2; newLower = ceil(dbound-relaxedTolerance); } else { newLower=dbound; if (newLower+primalTolerance_>colUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveUp = newLower-colLower[kcol]; } if (doUp&&(markIt&(1+4))==0) { double dbound = colLower[kcol] + rowUp2/value2; if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+relaxedTolerance); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveDown = newUpper-colUpper[kcol]; } if (!moveUp&&!moveDown) continue; bool onList = ((markC[kcol]&3)!=0); if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (moveUp&&nstackC<2*maxStack) { fixThis++; if (!onList) { stackC[nstackC]=kcol; saveL[nstackC]=colLower[kcol]; saveU[nstackC]=colUpper[kcol]; assert (saveU[nstackC]>saveL[nstackC]); assert (nstackCcolsol[kcol]) { if (djs[kcol]<0.0) { /* should be infeasible */ assert (newLower>colUpper[kcol]+primalTolerance_); } else { objVal += moveUp*djs[kcol]; } } if (intVar[kcol]) newLower = CoinMax(colLower[kcol],ceil(newLower-1.0e-4)); colLower[kcol]=newLower; columnGap[kcol] = colUpper[kcol]-newLower-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value*moveUp; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ columnGap[kcol] = -1.0e50; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveUp; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]saveL[nstackC]); assert (nstackC0.0) { /* should be infeasible */ assert (colLower[kcol]>newUpper+primalTolerance_); } else { objVal += moveDown*djs[kcol]; } } if (intVar[kcol]) newUpper = CoinMin(colUpper[kcol],floor(newUpper+1.0e-4)); colUpper[kcol]=newUpper; columnGap[kcol] = newUpper-colLower[kcol]-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj-1.0e10) minR[krow] += value*moveDown; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ columnGap[kcol] = -1.0e50; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveDown; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; break; } } } } // end big loop rPos->rEnd } else if (doRowUpP) { // Start pos values loop for (int kk =rStart;kk 0.0); /* positive element */ double gap = columnGap[kcol]*value2; bool doUp = (rowUp2 - gap < -1.0e-7); if (doUp&&(markIt&(1+4))==0) { double newUpper=-1.0; double dbound = colLower[kcol] + rowUp2/value2; if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+relaxedTolerance); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } double moveDown = newUpper-colUpper[kcol]; if (!moveDown) continue; bool onList = ((markC[kcol]&3)!=0); if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (nstackC<2*maxStack) { fixThis++; if (!onList) { stackC[nstackC]=kcol; saveL[nstackC]=colLower[kcol]; saveU[nstackC]=colUpper[kcol]; assert (saveU[nstackC]>saveL[nstackC]); assert (nstackC0.0) { /* should be infeasible */ assert (colLower[kcol]>newUpper+primalTolerance_); } else { objVal += moveDown*djs[kcol]; } } if (intVar[kcol]) newUpper = CoinMin(colUpper[kcol],floor(newUpper+1.0e-4)); colUpper[kcol]=newUpper; columnGap[kcol] = newUpper-colLower[kcol]-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj-1.0e10) minR[krow] += value*moveDown; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ columnGap[kcol] = -1.0e50; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveDown; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; break; } } } } // end big loop rPos->rEnd } else if (doRowLoP) { // Start pos values loop for (int kk =rStart;kk 0.0); /* positive element */ double gap = columnGap[kcol]*value2; bool doDown = (rowLo2 +gap > 1.0e-7); if (doDown&&(markIt&(2+8))==0) { double newLower=1.0; double dbound = colUpper[kcol] + rowLo2/value2; if (intVar[kcol]) { markIt |= 2; newLower = ceil(dbound-relaxedTolerance); } else { newLower=dbound; if (newLower+primalTolerance_>colUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } double moveUp = newLower-colLower[kcol]; if (!moveUp) continue; bool onList = ((markC[kcol]&3)!=0); if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (nstackC<2*maxStack) { fixThis++; if (!onList) { stackC[nstackC]=kcol; saveL[nstackC]=colLower[kcol]; saveU[nstackC]=colUpper[kcol]; assert (saveU[nstackC]>saveL[nstackC]); assert (nstackCcolsol[kcol]) { if (djs[kcol]<0.0) { /* should be infeasible */ assert (newLower>colUpper[kcol]+primalTolerance_); } else { objVal += moveUp*djs[kcol]; } } if (intVar[kcol]) newLower = CoinMax(colLower[kcol],ceil(newLower-1.0e-4)); colLower[kcol]=newLower; columnGap[kcol] = colUpper[kcol]-newLower-primalTolerance_; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } markC[kcol] &= ~12; if (colUpper[kcol]>1.0e10) markC[kcol] |= 8; if (colLower[kcol]<-1.0e10) markC[kcol] |= 4; /* update immediately */ for (int jj =columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value*moveUp; if (krow==irow) rowUp2 = rowUp-minR[irow]; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ columnGap[kcol] = -1.0e50; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveUp; if (krow==irow) rowLo2 = rowLo-maxR[irow]; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; break; } } } } // end big loop rPos->rEnd } } istackC++; } if (!notFeasible) { if (objVal<=cutoff) { feasible |= feas[iway]; } else { #ifdef PRINT_DEBUG printf("not feasible on dj\n"); #endif notFeasible=1; if (iway==1&&feasible==0) { /* not feasible at all */ ninfeas=1; j=nCols-1; break; } } if (!notFeasible&&saveFixingInfo) { // save fixing info assert (j==stackC[0]); int toValue = (way[iway]==1) ? -1 : +1; for (istackC=1;istackCfixes(j,toValue, icol,colLower[icol]==saveL[istackC]); } } } } else if (iway==1&&feasible==0) { /* not feasible at all */ ninfeas=1; j=nCols-1; iLook=numberThisTime_; ipass=maxPass; break; } if (notFeasible) goingToTrueBound=0; if (iway==2||(iway==1&&feasible==2)) { /* keep */ iway=3; nfixed++; OsiColCut cc; int nTot=0,nFix=0,nInt=0; bool ifCut=false; for (istackC=0;istackCcolUpper[icol]+primalTolerance_) { ifCut=true; anyColumnCuts=true; } } } } if (nFix) { nTot=nFix; cc.setUbs(nFix,index,element); nFix=0; } for (istackC=0;istackCcurrentColLower[icol]+1.0e-4) { element[nFix]=colLower[icol]; index[nFix++]=icol; nInt++; if (colsol[icol]primalTolerance_) { markC[icol]&= ~3; } else { markC[icol]=3; } } for (istackR=0;istackR=0;istackC--) { int icol=stackC[istackC]; double oldU=saveU[istackC]; double oldL=saveL[istackC]; if(goingToTrueBound==2&&istackC&&!justReplace) { // upper disaggregation cut would be // xval < upper + (old_upper-upper) (jval-down) boundChange = oldU-colUpper[icol]; if (boundChange>0.0&&oldU<1.0e10&& (colsol[icol]>colUpper[icol] + boundChange*solMove+primalTolerance_)) { // create cut OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(colUpper[icol]-down*boundChange); index[0]=icol; element[0]=1.0; index[1]=j; element[1]= - boundChange; // effectiveness is how far j moves double newSol = (colsol[icol]-colUpper[icol])/ boundChange; assert(newSol>solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); } } // lower disaggregation cut would be // xval > lower + (old_lower-lower) (jval-down) boundChange = oldL-colLower[icol]; if (boundChange<0.0&&oldL>-1.0e10&& (colsol[icol]solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); #if 0 printf("%d original bounds %g, %g new Lo %g sol= %g int %d sol= %g\n",icol,oldL,oldU,colLower[icol],colsol[icol], j, colsol[j]); printf("-1.0 * x(%d) + %g * y(%d) <= %g\n", icol,boundChange,j,rc.ub()); #endif } } } colUpper[icol]=oldU; colLower[icol]=oldL; columnGap[icol] = oldU-oldL-primalTolerance_; markC[icol]= 0; if (oldU>1.0e10) markC[icol] |= 8; if (oldL<-1.0e10) markC[icol] |= 4; } for (istackR=0;istackRprimalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut // also see if singletons can go to good objective // Taken out as should be found elsewhere // and has to be original column length #ifdef MOVE_SINGLETONS bool moveSingletons=true; #endif for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]!=1) { moveSingletons=false; } } } #endif } #ifdef MOVE_SINGLETONS if (moveSingletons) { // can fix any with good costs for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]==1) { double value = rowElements[kk]; if (direction*objective[iColumn]*value<0.0&&!(markC[iColumn]&3)) { // Fix if (nstackC0+10.0) { lo0[nstackC0]=colUpper[iColumn]; up0[nstackC0]=colUpper[iColumn]; } else { lo0[nstackC0]=colLower[iColumn]; up0[nstackC0]=colLower[iColumn]; } nstackC0++; } } } } } } } #endif if (sum-gap*colsol[j]>maxR[irow]+primalTolerance_||(info->strengthenRow&&rowLower[irow]<-1.0e20)) { // can be a cut // subtract gap from upper and integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; double sum2=0.0; for (int kk =rowStart[irow];kk1.0e-12) { index[n]=kColumn; element[n++]=el; } coefficientExists=true; } sum2 += colsol[kColumn]*el; } if (!coefficientExists) { index[n]=j; element[n++]=-gap; sum2 -= colsol[j]*gap; } OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); double ub =rowUpper[irow]-gap*(colLower[j]+1.0); rc.setUb(ub); double effectiveness=sum2-ub; effectiveness = CoinMax(effectiveness, (sum-gap*colsol[j] -maxR[irow])/gap); if (!coefficientExists) effectiveness=CoinMax(1.0e-7, effectiveness); rc.setEffectiveness(effectiveness); //rc.setEffectiveness((sum-gap*colsol[j]-maxR[irow])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif // If strengthenRow point to row //if(info->strengthenRow) //printf("a point to row %d\n",irow); //#define STRENGTHEN_PRINT #ifdef STRENGTHEN_PRINT if (canReplace&&rowLower[irow]<-1.0e20) { printf("1Cut %g <= ",rc.lb()); int k; //printf("original row %d - %g <= <= %g - j = %d\n",iow,rowLower[irow],rowUpper[irow],j); //for (int kk=rowStart[irow];kk=0) realRow=realRows[realRow]; if (!justReplace) { rowCut.addCutIfNotDuplicate(rc,realRow); } else if (realRow>=0) { double effectiveness=0.0; for (int i=0;istrengthenRow[realRow]||info->strengthenRow[realRow]->effectiveness()>effectiveness) { delete info->strengthenRow[realRow]; rc.setEffectiveness(effectiveness); info->strengthenRow[realRow]=rc.clone(); } } } } } gap = minR[irow]-rowLower[irow]; if (!ifCut&&(gap>primalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut sum =0.0; // also see if singletons can go to good objective #ifdef MOVE_SINGLETONS bool moveSingletons=true; #endif for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]!=1) { moveSingletons=false; } } } #endif } #ifdef MOVE_SINGLETONS if (moveSingletons) { // can fix any with good costs for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]==1) { double value = rowElements[kk]; if (direction*objective[iColumn]*value>0.0&&!(markC[iColumn]&3)) { // Fix if (nstackC0+1strengthenRow&&rowUpper[irow]>1.0e20)) { // can be a cut // add gap to lower and integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; double sum2=0.0; for (int kk =rowStart[irow];kk1.0e-12) { index[n]=kColumn; element[n++]=el; } coefficientExists=true; } sum2 += colsol[kColumn]*el; } if (!coefficientExists) { index[n]=j; element[n++]=gap; sum2 += colsol[j]*gap; } OsiRowCut rc; double lb = rowLower[irow]+gap*(colLower[j]+1.0); rc.setLb(lb); rc.setUb(COIN_DBL_MAX); // effectiveness double effectiveness=lb-sum2; effectiveness = CoinMax(effectiveness, (minR[irow]- sum-gap*colsol[j])/gap); if (!coefficientExists) effectiveness=CoinMax(1.0e-7, effectiveness); rc.setEffectiveness(effectiveness); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(info->strengthenRow) //printf("b point to row %d\n",irow); #ifdef STRENGTHEN_PRINT if (canReplace&&rowUpper[irow]>1.0e20) { printf("2Cut %g <= ",rc.lb()); int k; for ( k=0;k1.0e20) ? irow : -1; if (realRows&&realRow>=0) realRow=realRows[realRow]; if (!justReplace) { rowCut.addCutIfNotDuplicate(rc,realRow); } else if (realRow>=0) { double effectiveness=0.0; for (int i=0;istrengthenRow[realRow]||info->strengthenRow[realRow]->effectiveness()>effectiveness) { delete info->strengthenRow[realRow]; rc.setEffectiveness(effectiveness); info->strengthenRow[realRow]=rc.clone(); } } } } } } minR[irow]=saveMin[istackR]; maxR[irow]=saveMax[istackR]; markR[irow]=-1; } } else { if (iway==1&&feasible==3) { iway=3; #ifdef MOVE_SINGLETONS // look for singletons that can move (just at root) if ((rowCuts&2)!=0&&goingToTrueBound&&info->strengthenRow) { for (istackR=0;istackRprimalTolerance_) { // also see if singletons can go to good objective bool moveSingletons=true; for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]!=1) { moveSingletons=false; } } } } if (moveSingletons) { // can fix any with good costs for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]==1) { double value = rowElements[kk]; if (direction*objective[iColumn]*value<0.0&&!(markC[iColumn]&3)) { // Fix stackC[nstackC]=iColumn; saveL[nstackC]=colLower[iColumn]; saveU[nstackC]=colUpper[iColumn]; assert (saveU[nstackC]>saveL[nstackC]); if (value>0.0) { colLower[iColumn]=colUpper[iColumn]; } else { colUpper[iColumn]=colLower[iColumn]; } columnGap[iColumn] = -primalTolerance_; assert (nstackCprimalTolerance_) { // also see if singletons can go to good objective bool moveSingletons=true; for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]!=1) { moveSingletons=false; } } } } if (moveSingletons) { // can fix any with good costs for (int kk =rowStart[irow];kkcolLower[iColumn]) { if (columnLength2[iColumn]==1) { double value = rowElements[kk]; if (direction*objective[iColumn]*value>0.0&&!(markC[iColumn]&3)) { // Fix stackC[nstackC]=iColumn; saveL[nstackC]=colLower[iColumn]; saveU[nstackC]=colUpper[iColumn]; assert (saveU[nstackC]>saveL[nstackC]); if (value<0.0) { colLower[iColumn]=colUpper[iColumn]; } else { colUpper[iColumn]=colLower[iColumn]; } columnGap[iColumn] = -primalTolerance_; assert (nstackC=0;istackC--) { int icol=stackC[istackC]; markC[icol]=istackC+1000; } OsiColCut cc; int nTot=0,nFix=0,nInt=0; bool ifCut=false; for (istackC=1;istackC=0) { if (CoinMin(lo0[istackC],colLower[icol])>saveL[istackC1]+1.0e-4) { saveL[istackC1]=CoinMin(lo0[istackC],colLower[icol]); if (intVar[icol]/*||!info->inTree*/) { element[nFix]=saveL[istackC1]; index[nFix++]=icol; nInt++; if (colsol[icol]=0) { if (CoinMax(up0[istackC],colUpper[icol])inTree*/) { element[nFix]=saveU[istackC1]; index[nFix++]=icol; nInt++; if (colsol[icol]>saveU[istackC1]+primalTolerance_) ifCut=true; } nfixed++; } else if (!info->inTree&&saveL[0]==0.0&&saveU[0]==1.0) { // See if can do two cut double upperWhenDown = up0[istackC]; double lowerWhenDown = lo0[istackC]; double upperWhenUp = colUpper[icol]; double lowerWhenUp = colLower[icol]; double upperOriginal = saveU[istackC1]; double lowerOriginal = saveL[istackC1]; if (upperWhenDownupperOriginal-1.0e-12) { OsiRowCut rc; rc.setLb(lowerOriginal); rc.setUb(lowerOriginal); rc.setEffectiveness(1.0e-5); int index[2]; double element[2]; index[0]=j; index[1]=icol; element[0]=-(upperOriginal-lowerOriginal); // If zero then - must have been fixed without noticing! if (fabs(element[0])>1.0e-8) { element[1]=1.0; rc.setRow(2,index,element,false); cs.insert(rc); } } else if (upperWhenUpupperOriginal-1.0e-12) { OsiRowCut rc; rc.setLb(upperOriginal); rc.setUb(upperOriginal); rc.setEffectiveness(1.0e-5); int index[2]; double element[2]; index[0]=j; index[1]=icol; element[0]=upperOriginal-lowerOriginal; element[1]=1.0; rc.setRow(2,index,element,false); cs.insert(rc); } } } } if (nFix) { nTot+=nFix; cc.setUbs(nFix,index,element); } // could tighten continuous as well if (nInt) { if (ifCut) { cc.setEffectiveness(100.0); } else { cc.setEffectiveness(1.0e-5); } #ifdef CGL_DEBUG checkBounds(debugger,cc); #endif cs.insert(cc); } } else { goingToTrueBound=0; } double solMove = up-saveSolval; double boundChange; /* restore all */ for (istackC=nstackC-1;istackC>=0;istackC--) { int icol=stackC[istackC]; double oldU=saveU[istackC]; double oldL=saveL[istackC]; if(goingToTrueBound==2&&istackC&&!justReplace) { // upper disaggregation cut would be // xval < upper + (old_upper-upper) (up-jval) boundChange = oldU-colUpper[icol]; if (boundChange>0.0&&oldU<1.0e10&& (colsol[icol]>colUpper[icol] + boundChange*solMove+primalTolerance_)) { // create cut OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(colUpper[icol]+up*boundChange); index[0]=icol; element[0]=1.0; index[1]=j; element[1]= + boundChange; // effectiveness is how far j moves double newSol = (colsol[icol]-colUpper[icol])/ boundChange; assert(newSol>solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); } } // lower disaggregation cut would be // xval > lower + (old_lower-lower) (up-jval) boundChange = oldL-colLower[icol]; if (boundChange<0.0&&oldL>-1.0e10&& (colsol[icol]solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); } } } colUpper[icol]=oldU; colLower[icol]=oldL; columnGap[icol] = oldU-oldL-primalTolerance_; if (oldU>oldL+1.0e-4) { markC[icol]=0; if (oldU>1.0e10) markC[icol] |= 8; if (oldL<-1.0e10) markC[icol] |= 4; } else { markC[icol]=3; } } for (istackR=0;istackRstrengthenRow&&(goingToTrueBound==2); bool ifCut=anyColumnCuts; double gap = rowUpper[irow]-maxR[irow]; double sum=0.0; if (!ifCut&&(gap>primalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut for (int kk =rowStart[irow];kkrowUpper[irow]+primalTolerance_||(canReplace&&rowLower[irow]<-1.e20)) { // can be a cut // add gap to integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; double sum2=0.0; for (int kk =rowStart[irow];kk1.0e-12) { index[n]=kColumn; element[n++]=el; } coefficientExists=true; } sum2 += colsol[kColumn]*el; } if (!coefficientExists) { index[n]=j; element[n++]=gap; sum2 += colsol[j]*gap; } OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); double ub = rowUpper[irow]+gap*(colUpper[j]-1.0); rc.setUb(ub); // effectiveness double effectiveness=sum2-ub; effectiveness = CoinMax(effectiveness, (sum+gap*colsol[j]- rowUpper[irow])/gap); if (!coefficientExists) effectiveness=CoinMax(1.0e-7, effectiveness); rc.setEffectiveness(effectiveness); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(canReplace) //printf("c point to row %d\n",irow); #ifdef STRENGTHEN_PRINT if (canReplace&&rowLower[irow]<-1.0e20) { printf("3Cut %g <= ",rc.lb()); int k; for ( k=0;k=0) realRow=realRows[realRow]; if (!justReplace) { rowCut.addCutIfNotDuplicate(rc,realRow); } else if (realRow>=0) { double effectiveness=0.0; for (int i=0;istrengthenRow[realRow]||info->strengthenRow[realRow]->effectiveness()>effectiveness) { delete info->strengthenRow[realRow]; rc.setEffectiveness(effectiveness); info->strengthenRow[realRow]=rc.clone(); } } } } } gap = minR[irow]-rowLower[irow]; if (!ifCut&&(gap>primalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut if (!sum) { for (int kk =rowStart[irow];kk1.0e20)) { // can be a cut // subtract gap from integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; double sum2=0.0; for (int kk =rowStart[irow];kk1.0e-12) { index[n]=kColumn; element[n++]=el; } coefficientExists=true; } sum2 += colsol[kColumn]*el; } if (!coefficientExists) { index[n]=j; element[n++]=-gap; sum2 -= colsol[j]*gap; } OsiRowCut rc; double lb = rowLower[irow]-gap*(colUpper[j]-1); rc.setLb(lb); rc.setUb(COIN_DBL_MAX); double effectiveness=lb-sum2; effectiveness = CoinMax(effectiveness, (rowLower[irow]- sum+gap*colsol[j])/gap); if (!coefficientExists) effectiveness=CoinMax(1.0e-7, effectiveness); rc.setEffectiveness(effectiveness); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(canReplace) //printf("d point to row %d\n",irow); #ifdef STRENGTHEN_PRINT if (canReplace&&rowUpper[irow]>1.0e20) { printf("4Cut %g <= ",rc.lb()); int k; for ( k=0;k1.0e20) ? irow : -1; if (realRows&&realRow>=0) realRow=realRows[realRow]; if (!justReplace) { rowCut.addCutIfNotDuplicate(rc,realRow); } else if (realRow>=0) { double effectiveness=0.0; for (int i=0;istrengthenRow[realRow]||info->strengthenRow[realRow]->effectiveness()>effectiveness) { delete info->strengthenRow[realRow]; rc.setEffectiveness(effectiveness); info->strengthenRow[realRow]=rc.clone(); } } } } } } minR[irow]=saveMin[istackR]; maxR[irow]=saveMax[istackR]; markR[irow]=-1; } } } } } } if ((!ninfeas&&!rowCut.outOfSpace())&&(info->strengthenRow|| !rowCut.numberCuts())&&rowCuts) { // Try and find ALL big M's for (int i = 0; i < nRowsSafe; ++i) { if ((rowLower[i]>-1.0e20||rowUpper[i]<1.0e20)&& (!info->strengthenRow||!info->strengthenRow[i])) { int iflagu = 0; int iflagl = 0; double dmaxup = 0.0; double dmaxdown = 0.0; int krs = rowStart[i]; int kre = rowStart[i+1]; int kInt = -1; double rhsAdjustment=0.0; int nPosInt=0; int nNegInt=0; double valueInteger=0.0; // Find largest integer coefficient int k; for ( k = krs; k < kre; ++k) { int j = column[k]; if (intVar[j]) { double value=rowElements[k]; if (colUpper[j]>colLower[j]&&!colLower[j]&& fabs(value)>fabs(valueInteger)) { kInt=j; valueInteger=value; } } } if (kInt>=0) { double upperBound = CoinMin(colUpper[kInt],static_cast(COIN_INT_MAX)); double upAdjust=0.0; double downAdjust=0.0; for (k = krs; k < kre; ++k) { double value=rowElements[k]; int j = column[k]; if (colUpper[j]==colLower[j]) { rhsAdjustment += colUpper[j]*value; continue; } if (intVar[j]) { if (value>0.0) nPosInt++; else nNegInt++; } else { nPosInt = -nCols; } if (j!=kInt) { // treat as continuous if (value > 0.0) { if (colUpper[j] >= 1e15) { dmaxup = 1e31; ++iflagu; } else { dmaxup += colUpper[j] * value; } if (colLower[j] <= -1e15) { dmaxdown = -1e31; ++iflagl; } else { dmaxdown += colLower[j] * value; } } else if (value<0.0) { if (colUpper[j] >= 1e15) { dmaxdown = -1e31; ++iflagl; } else { dmaxdown += colUpper[j] * value; } if (colLower[j] <= -1e15) { dmaxup = 1e31; ++iflagu; } else { dmaxup += colLower[j] * value; } } } else { // Chosen variable if (value > 0.0) { if (colUpper[j] >= 1e15) { upAdjust = 1e31; } else { upAdjust = colUpper[j] * value; } if (colLower[j] <= -1e15) { downAdjust = -1e31; } else { downAdjust = colLower[j] * value; } } else if (value<0.0) { if (colUpper[j] >= 1e15) { downAdjust = -1e31; } else { downAdjust = colUpper[j] * value; } if (colLower[j] <= -1e15) { upAdjust = 1e31; } else { upAdjust = colLower[j] * value; } } } } dmaxup += rhsAdjustment; dmaxdown += rhsAdjustment; // end of row if (iflagu) dmaxup=1.0e31; if (iflagl) dmaxdown=-1.0e31; // See if redundant if (dmaxdown+downAdjust>rowLower[i]-tolerance&& dmaxup+upAdjustrowLower[i]&& dmaxup+valueInteger*upperBoundrowLower[i]&&dmaxup+valueIntegerrowUpper[i]+primalTolerance_)) { // can tighten (maybe) double saveValue = valueInteger; if (valueInteger>0.0) { assert (dmaxdownrowUpper[i]); valueInteger = rowUpper[i]-dmaxup; } if (fabs(saveValue-valueInteger)>1.0e-12) { // take OsiRowCut rc; rc.setLb(rowLower[i]); rc.setUb(rowUpper[i]); int n=0; double sum=0.0; for (int kk=rowStart[i];kk=0.0); #if 0 if (fabs(rowElements[kk])>1.01*fabs(valueInteger)) { printf("row %d changing coefficient of %d from %g to %g\n", i,kInt,rowElements[kk],valueInteger); } #endif if (fabs(valueInteger)>1.0e-12) { index[n]=column[kk]; element[n++]=valueInteger; } } } double gap = 0.0; if (sumrowUpper[i]) gap=sum-rowUpper[i]; if (gap>1.0e-4||info->strengthenRow!=NULL) { gap += 1.0e5; rc.setEffectiveness(gap); rc.setRow(n,index,element,false); #ifdef STRENGTHEN_PRINT { printf("1aCut %g <= ",rc.lb()); int irow =i; int k; for ( k=0;kstrengthenRow,info->pass); } else { for (int i=0;i=0) { OsiRowCut * cut = info->strengthenRow[realRow]; if (cut) { #ifdef CLP_INVESTIGATE printf("Row %d, real row %d effectiveness %g\n",i,realRow,cut->effectiveness()); #endif cs.insert(cut); } } } } } #if 0 { int numberRowCutsAfter = cs.sizeRowCuts() ; int k ; for (k = 0;kinTree ? maxStack_ : maxStackRoot_; int nRows=rowCopy->getNumRows(); int nCols=rowCopy->getNumCols(); double * colsol = new double[nCols]; double * djs = new double[nCols]; const double * currentColLower = si.getColLower(); const double * currentColUpper = si.getColUpper(); double * tempL = new double [nCols]; double * tempU = new double [nCols]; int * markC = new int [nCols]; int * stackC = new int [2*nCols]; int * stackR = new int [nRows]; double * saveL = new double [2*nCols]; double * saveU = new double [2*nCols]; double * saveMin = new double [nRows]; double * saveMax = new double [nRows]; double * element = new double[nCols]; int * index = new int[nCols]; // For trying to extend cliques int * cliqueStack=NULL; int * cliqueCount=NULL; int * to_01=NULL; if (!mode_) { to_01 = new int[nCols]; cliqueStack = new int[numberCliques_]; cliqueCount = new int[numberCliques_]; int i; for (i=0;iinTree ? nRows/3 : nRows; row_cut rowCut(nRowsFake, !info->inTree); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * rowElements = rowCopy->getElements(); const int * row = columnCopy->getIndices(); const CoinBigIndex * columnStart = columnCopy->getVectorStarts(); const int * columnLength = columnCopy->getVectorLengths(); const double * columnElements = columnCopy->getElements(); double movement; int i, j, k,kk,jj; int kcol,krow; bool anyColumnCuts=false; double dbound, value, value2; int ninfeas=0; int rowCuts; double disaggEffectiveness; if (mode_) { /* clean up djs and solution */ CoinMemcpyN(si.getReducedCost(),nCols,djs); CoinMemcpyN( si.getColSolution(),nCols,colsol); disaggEffectiveness=1.0e-3; rowCuts=rowCuts_; } else { // need to go from a neutral place memset(djs,0,nCols*sizeof(double)); CoinMemcpyN( si.getColSolution(),nCols,colsol); disaggEffectiveness=-1.0e10; if (rowCuts_!=4) rowCuts=1; else rowCuts=4; } for (i = 0; i < nCols; ++i) { /* was if (intVar[i]) */ if (1) { if (colUpper[i]-colLower[i]>1.0e-8) { if (colsol[i]colUpper[i]-primalTolerance_) { colsol[i]=colUpper[i]; djs[i] = CoinMin(0.0,djs[i]); } else { djs[i]=0.0; } /*if (fabs(djs[i])<1.0e-5) djs[i]=0.0;*/ } } } int ipass=0,nfixed=-1; double cutoff; bool cutoff_available = si.getDblParam(OsiDualObjectiveLimit,cutoff); if (!cutoff_available||usingObjective_<0) { // cut off isn't set or isn't valid cutoff = si.getInfinity(); } cutoff *= si.getObjSense(); if (fabs(cutoff)>1.0e30) assert (cutoff>1.0e30); double current = si.getObjValue(); // make irrelevant if mode is 0 if (!mode_) cutoff=COIN_DBL_MAX; /* for both way coding */ int nstackC0=-1; int * stackC0 = new int[maxStack]; double * lo0 = new double[maxStack]; double * up0 = new double[maxStack]; int nstackR,nstackC; for (i=0;iinTree ? maxPass_ : maxPassRoot_; // If we are going to replace coefficient then we don't need to be effective double needEffectiveness = info->strengthenRow ? -1.0e10 : 1.0e-3; while (ipass=colUpper[j]-tolerance||solval<=colLower[j]+tolerance||up==down) { if (solval<=colLower[j]+2.0*tolerance) { solval = colLower[j]+1.0e-1; down=colLower[j]; up=down+1.0; } else if (solval>=colUpper[j]-2.0*tolerance) { solval = colUpper[j]-1.0e-1; up=colUpper[j]; down=up-1; } else { // odd up=down+1.0; solval = down+1.0e-1; } } assert (up<=colUpper[j]); assert (down>=colLower[j]); assert (up>down); if ((solval-down>1.0e-6&&up-solval>1.0e-6)||mode_!=1) { int istackC,iway, istackR; int way[]={1,2,1}; int feas[]={1,2,4}; int feasible=0; int notFeasible; for (iway=0;iway<3;iway ++) { int fixThis=0; double objVal=current; int goingToTrueBound=0; stackC[0]=j; markC[j]=way[iway]; double solMovement; if (way[iway]==1) { movement=down-colUpper[j]; solMovement = down-colsol[j]; assert(movement<-0.99999); if (fabs(down-colLower[j])<1.0e-7) { goingToTrueBound=2; down=colLower[j]; } } else { movement=up-colLower[j]; solMovement = up-colsol[j]; assert(movement>0.99999); if (fabs(up-colUpper[j])<1.0e-7) { goingToTrueBound=2; up=colUpper[j]; } } if (goingToTrueBound&&(colUpper[j]-colLower[j]>1.5||colLower[j])) goingToTrueBound=1; // switch off disaggregation if not wanted if ((rowCuts&1)==0) goingToTrueBound=0; #ifdef PRINT_DEBUG if (fabs(movement)>1.01) { printf("big %d %g %g %g\n",j,colLower[j],solval,colUpper[j]); } #endif if (solMovement*djs[j]>0.0) objVal += solMovement*djs[j]; nstackC=1; nstackR=0; saveL[0]=colLower[j]; saveU[0]=colUpper[j]; assert (saveU[0]>saveL[0]); notFeasible=0; if (movement<0.0) { colUpper[j] += movement; colUpper[j] = floor(colUpper[j]+0.5); #ifdef PRINT_DEBUG printf("** Trying %d down to 0\n",j); #endif } else { colLower[j] += movement; colLower[j] = floor(colLower[j]+0.5); #ifdef PRINT_DEBUG printf("** Trying %d up to 1\n",j); #endif } if (fabs(colUpper[j]-colLower[j])<1.0e-6) markC[j]=3; // say fixed istackC=0; /* update immediately */ for (k=columnStart[j];k0.0) { /* up */ if (value>0.0) { /* up does not change - down does */ if (minR[irow]>-1.0e10) minR[irow] += value; if (minR[irow]>rowUpper[irow]+1.0e-5) { notFeasible=1; istackC=1; break; } } else { /* down does not change - up does */ if (maxR[irow]<1.0e10) maxR[irow] += value; if (maxR[irow]-1.0e10) minR[irow] -= value; if (minR[irow]>rowUpper[irow]+1.0e-5) { notFeasible=1; istackC=1; break; } } else { /* down does not change - up does */ if (maxR[irow]<1.0e10) maxR[irow] -= value; if (maxR[irow]=0) { int start; int end; if (colLower[jcol]>saveL[istackC]) { // going up start = oneFixStart_[jcol]; end = zeroFixStart_[jcol]; } else { assert (colUpper[jcol]saveL[nstackC]); nstackC++; if (!kway) { // going up double solMovement=1.0-colsol[kcol]; if (solMovement>0.0001) { assert (djs[kcol]>=0.0); objVal += djs[kcol]*solMovement; } colLower[kcol]=1.0; /* update immediately */ for (int jj =columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value; if (maxR[krow]-1.0e10) minR[krow] -= value; if (minR[krow]>rowUpper[krow]+1.0e-5) { notFeasible=1; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] -= value; if (maxR[krow] colLower[kcol] + primalTolerance_) { if (intVar[kcol]) { markIt |= 2; newLower = ceil(dbound-primalTolerance_); } else { newLower=dbound; if (newLower+primalTolerance_>colUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveUp = newLower-colLower[kcol]; } } if (colLower[kcol] > -1e10 && (markIt&1)==0 && rowLower[irow]>-1.0e10) { dbound = colLower[kcol] + (rowLower[irow]-maxR[irow])/value2; if (dbound < colUpper[kcol] - primalTolerance_) { if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+primalTolerance_); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveDown = newUpper-colUpper[kcol]; } } } else { /* positive element */ if (colUpper[kcol] < 1e10 && (markIt&2)==0 && rowLower[irow]>-1.0e10) { dbound = colUpper[kcol] + (rowLower[irow]-maxR[irow])/value2; if (dbound > colLower[kcol] + primalTolerance_) { if (intVar[kcol]) { markIt |= 2; newLower = ceil(dbound-primalTolerance_); } else { newLower=dbound; if (newLower+primalTolerance_>colUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveUp = newLower-colLower[kcol]; } } if (colLower[kcol] > -1e10 && (markIt&1)==0 && rowUpper[irow]<1.0e10) { dbound = colLower[kcol] + (rowUpper[irow]-minR[irow])/value2; if (dbound < colUpper[kcol] - primalTolerance_) { if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+primalTolerance_); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; //markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveDown = newUpper-colUpper[kcol]; } } } if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (moveUp&&nstackC<2*maxStack) { fixThis++; #ifdef PRINT_DEBUG printf("lower bound on %d increased from %g to %g by row %d %g %g\n",kcol,colLower[kcol],newLower,irow,rowLower[irow],rowUpper[irow]); value=0.0; for (jj=rowStart[irow];jjprimalTolerance_) { printf("(%d, %g) ",ii,rowElements[jj]); } else { value += rowElements[jj]*colLower[ii]; } } printf(" - fixed %g\n",value); for (jj=rowStart[irow];jjsaveL[nstackC]); nstackC++; onList=true; } if (newLower>colsol[kcol]) { if (djs[kcol]<0.0) { /* should be infeasible */ assert (newLower>colUpper[kcol]+primalTolerance_); } else { objVal += moveUp*djs[kcol]; } } if (intVar[kcol]) newLower = CoinMax(colLower[kcol],ceil(newLower-1.0e-4)); colLower[kcol]=newLower; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } /* update immediately */ for (jj=columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value*moveUp; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveUp; if (maxR[krow]primalTolerance_) { printf("(%d, %g) ",ii,rowElements[jj]); } else { value += rowElements[jj]*colLower[ii]; } } printf(" - fixed %g\n",value); for (jj=rowStart[irow];jjsaveL[nstackC]); nstackC++; onList=true; } if (newUpper0.0) { /* should be infeasible */ assert (colLower[kcol]>newUpper+primalTolerance_); } else { objVal += moveDown*djs[kcol]; } } if (intVar[kcol]) newUpper = CoinMin(colUpper[kcol],floor(newUpper+1.0e-4)); colUpper[kcol]=newUpper; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } /* update immediately */ for (jj=columnStart[kcol];jj-1.0e10) minR[krow] += value*moveDown; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveDown; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; #ifdef PRINT_DEBUG printf("** not feasible this way\n"); #endif break; } } } #if 0 } #endif } istackC++; } if (!notFeasible) { if (objVal<=cutoff) { feasible |= feas[iway]; } else { #ifdef PRINT_DEBUG printf("not feasible on dj\n"); #endif notFeasible=1; if (iway==1&&feasible==0) { /* not feasible at all */ ninfeas=1; j=nCols-1; break; } } } else if (iway==1&&feasible==0) { /* not feasible at all */ ninfeas=1; j=nCols-1; iLook=numberThisTime_; ipass=maxPass; break; } if (notFeasible) goingToTrueBound=0; if (iway==2||(iway==1&&feasible==2)) { /* keep */ iway=3; nfixed++; if (mode_) { OsiColCut cc; int nTot=0,nFix=0,nInt=0; bool ifCut=false; for (istackC=0;istackCcolUpper[icol]+primalTolerance_) { ifCut=true; anyColumnCuts=true; } } } } if (nFix) { nTot=nFix; cc.setUbs(nFix,index,element); nFix=0; } for (istackC=0;istackCcurrentColLower[icol]+1.0e-4) { element[nFix]=colLower[icol]; index[nFix++]=icol; nInt++; if (colsol[icol]primalTolerance_) { markC[icol]=0; } else { markC[icol]=3; } } for (istackR=0;istackR=0;istackC--) { int icol=stackC[istackC]; double oldU=saveU[istackC]; double oldL=saveL[istackC]; if(goingToTrueBound==2&&istackC) { // Work for extending cliques if (!mode_&&numberCliques_) { int i_01 = to_01[icol]; if (i_01>=0) { int start; int end; if (colLower[icol]) { // going up - but we want weak way start = zeroFixStart_[icol]; end = endFixStart_[icol]; } else { // going down - but we want weak way start = oneFixStart_[icol]; end = zeroFixStart_[icol]; } //if (end>start) //printf("j %d, other %d is in %d cliques\n", // j,i_01,end-start); for (int i=start;i0.0&&oldU<1.0e10&& (!mode_||colsol[icol]>colUpper[icol] + boundChange*solMove+primalTolerance_)) { // create cut OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(colUpper[icol]-down*boundChange); index[0]=icol; element[0]=1.0; index[1]=j; element[1]= - boundChange; // effectiveness is how far j moves double newSol = (colsol[icol]-colUpper[icol])/ boundChange; if (mode_) assert(newSol>solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); } } // lower disaggregation cut would be // xval > lower + (old_lower-lower) (jval-down) boundChange = oldL-colLower[icol]; if (boundChange<0.0&&oldL>-1.0e10&& (!mode_||colsol[icol]solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); #if 0 printf("%d original bounds %g, %g new Lo %g sol= %g int %d sol= %g\n",icol,oldL,oldU,colLower[icol],colsol[icol], j, colsol[j]); printf("-1.0 * x(%d) + %g * y(%d) <= %g\n", icol,boundChange,j,rc.ub()); #endif } } } colUpper[icol]=oldU; colLower[icol]=oldL; markC[icol]=0; } if (nCliquesAffected) { for (int i=0;i1) printf("** could extend clique by adding j!\n"); } } } for (istackR=0;istackRprimalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut for (kk=rowStart[irow];kkmaxR[irow]+primalTolerance_||(info->strengthenRow&&rowLower[irow]<-1.0e20)) { // can be a cut // subtract gap from upper and integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=-gap; } OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(rowUpper[irow]-gap*(colLower[j]+1.0)); // effectiveness is how far j moves rc.setEffectiveness((sum-gap*colsol[j]-maxR[irow])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif // If strengthenRow point to row //if(info->strengthenRow) //printf("a point to row %d\n",irow); #ifdef STRENGTHEN_PRINT if (rowLower[irow]<-1.0e20) { printf("5Cut %g <= ",rc.lb()); int k; for ( k=0;k0) realRow=realRows[realRow]; rowCut.addCutIfNotDuplicate(rc,realRow); } } } gap = minR[irow]-rowLower[irow]; if (!ifCut&&(gap>primalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut if (!sum) { for (kk=rowStart[irow];kkstrengthenRow&&rowUpper[irow]>1.0e20)) { // can be a cut // add gap to lower and integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=gap; } OsiRowCut rc; rc.setLb(rowLower[irow]+gap*(colLower[j]+1.0)); rc.setUb(COIN_DBL_MAX); // effectiveness is how far j moves rc.setEffectiveness((minR[irow]-sum-gap*colsol[j])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(info->strengthenRow) //printf("b point to row %d\n",irow); #ifdef STRENGTHEN_PRINT if (rowUpper[irow]>1.0e20) { printf("6Cut %g <= ",rc.lb()); int k; for ( k=0;k1.0e20) ? irow : -1; if (realRows&&realRow>0) realRow=realRows[realRow]; rowCut.addCutIfNotDuplicate(rc,realRow); } } } } minR[irow]=saveMin[istackR]; maxR[irow]=saveMax[istackR]; markR[irow]=-1; } } else { if (iway==1&&feasible==3) { iway=3; /* point back to stack */ for (istackC=nstackC-1;istackC>=0;istackC--) { int icol=stackC[istackC]; markC[icol]=istackC+1000; } if (mode_) { OsiColCut cc; int nTot=0,nFix=0,nInt=0; bool ifCut=false; for (istackC=0;istackC=0) { if (CoinMin(lo0[istackC],colLower[icol])>saveL[istackC1]+1.0e-4) { saveL[istackC1]=CoinMin(lo0[istackC],colLower[icol]); if (intVar[icol]) { element[nFix]=saveL[istackC1]; index[nFix++]=icol; nInt++; if (colsol[icol]=0) { if (CoinMax(up0[istackC],colUpper[icol])saveU[istackC1]+primalTolerance_) ifCut=true; } nfixed++; } } } if (nFix) { nTot+=nFix; cc.setUbs(nFix,index,element); } // could tighten continuous as well if (nInt) { if (ifCut) { cc.setEffectiveness(100.0); } else { cc.setEffectiveness(1.0e-5); } #ifdef CGL_DEBUG checkBounds(debugger,cc); #endif cs.insert(cc); } } } else { goingToTrueBound=0; } double solMove = up-saveSolval; double boundChange; /* restore all */ int nCliquesAffected=0; for (istackC=nstackC-1;istackC>=0;istackC--) { int icol=stackC[istackC]; double oldU=saveU[istackC]; double oldL=saveL[istackC]; if(goingToTrueBound==2&&istackC) { // Work for extending cliques if (!mode_&&numberCliques_&&iway==3) { int i_01 = to_01[icol]; if (i_01>=0) { int start; int end; if (colLower[icol]) { // going up - but we want weak way start = zeroFixStart_[icol]; end = endFixStart_[icol]; } else { // going down - but we want weak way start = oneFixStart_[icol]; end = zeroFixStart_[icol]; } //if (end>start) //printf("up j %d, other %d is in %d cliques\n", // j,i_01,end-start); for (int i=start;i0.0&&oldU<1.0e10&& (!mode_||colsol[icol]>colUpper[icol] + boundChange*solMove+primalTolerance_)) { // create cut OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(colUpper[icol]+up*boundChange); index[0]=icol; element[0]=1.0; index[1]=j; element[1]= + boundChange; // effectiveness is how far j moves double newSol = (colsol[icol]-colUpper[icol])/ boundChange; if (mode_) assert(newSol>solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); } } // lower disaggregation cut would be // xval > lower + (old_lower-lower) (up-jval) boundChange = oldL-colLower[icol]; if (boundChange<0.0&&oldL>-1.0e10&& (!mode_||colsol[icol]solMove); rc.setEffectiveness(newSol-solMove); if (rc.effectiveness()>disaggEffectiveness) { rc.setRow(2,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif rowCut.addCutIfNotDuplicate(rc); } } } colUpper[icol]=oldU; colLower[icol]=oldL; if (oldU>oldL+1.0e-4) markC[icol]=0; else markC[icol]=3; } if (nCliquesAffected) { for (int i=0;i1) printf("** could extend clique by adding j!\n"); } } } for (istackR=0;istackRprimalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut for (kk=rowStart[irow];kkrowUpper[irow]+primalTolerance_||(info->strengthenRow&&rowLower[irow]<-1.0e20)) { // can be a cut // add gap to integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=gap; } OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(rowUpper[irow]+gap*(colUpper[j]-1.0)); // effectiveness is how far j moves rc.setEffectiveness((sum+gap*colsol[j]-rowUpper[irow])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(info->strengthenRow) //printf("c point to row %d\n",irow); #ifdef STRENGTHEN_PRINT if (rowLower[irow]<-1.0e20) { printf("7Cut %g <= ",rc.lb()); int k; for ( k=0;k0) realRow=realRows[realRow]; rowCut.addCutIfNotDuplicate(rc,realRow); } } } gap = minR[irow]-rowLower[irow]; if (!ifCut&&(gap>primalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut if (!sum) { for (kk=rowStart[irow];kkstrengthenRow&&rowUpper[irow]>1.0e20)) { // can be a cut // subtract gap from integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=-gap; } OsiRowCut rc; rc.setLb(rowLower[irow]-gap*(colUpper[j]-1)); rc.setUb(COIN_DBL_MAX); // effectiveness is how far j moves rc.setEffectiveness((rowLower[irow]-sum+gap*colsol[j])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(info->strengthenRow) //printf("d point to row %d\n",irow); #ifdef STRENGTHEN_PRINT if (rowUpper[irow]>1.0e20) { printf("8Cut %g <= ",rc.lb()); int k; for ( k=0;k1.0e20) ? irow : -1; if (realRows&&realRow>0) realRow=realRows[realRow]; rowCut.addCutIfNotDuplicate(rc,realRow); } } } } minR[irow]=saveMin[istackR]; maxR[irow]=saveMax[istackR]; markR[irow]=-1; } } } } } } } delete [] cliqueStack; delete [] cliqueCount; delete [] to_01; delete [] stackC0; delete [] lo0; delete [] up0; delete [] tempL; delete [] tempU; delete [] markC; delete [] stackC; delete [] stackR; delete [] saveL; delete [] saveU; delete [] saveMin; delete [] saveMax; delete [] index; delete [] element; delete [] djs; delete [] colsol; // Add in row cuts if (!ninfeas) { rowCut.addCuts(cs,info->strengthenRow,0); } return (ninfeas); } // Does probing and adding cuts for clique slacks int CglProbing::probeSlacks( const OsiSolverInterface & si, const OsiRowCutDebugger * #ifdef CGL_DEBUG debugger #endif ,OsiCuts & cs, double * colLower, double * colUpper, CoinPackedMatrix *rowCopy, CoinPackedMatrix *columnCopy, double * rowLower, double * rowUpper, char * intVar, double * minR, double * maxR,int * markR, CglTreeInfo * info) { if (!numberCliques_) return 0; // Set up maxes int maxProbe = info->inTree ? maxProbe_ : maxProbeRoot_; int maxStack = info->inTree ? maxStack_ : maxStackRoot_; int nRows=rowCopy->getNumRows(); int nCols=rowCopy->getNumCols(); double * colsol = new double[nCols]; CoinMemcpyN( si.getColSolution(),nCols,colsol); int rowCuts=rowCuts_; double_int_pair * array = new double_int_pair [numberCliques_]; // look at <= cliques int iClique; int nLook=0; for (iClique=0;iCliqueinTree ? nRows/3 : nRows; row_cut rowCut(nRowsFake, !info->inTree); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * rowElements = rowCopy->getElements(); const int * row = columnCopy->getIndices(); const CoinBigIndex * columnStart = columnCopy->getVectorStarts(); const int * columnLength = columnCopy->getVectorLengths(); const double * columnElements = columnCopy->getElements(); double movement; int i, j, k,kk,jj; int kcol,irow,krow; bool anyColumnCuts=false; double dbound, value, value2; int ninfeas=0; for (i = 0; i < nCols; ++i) { if (colUpper[i]-colLower[i]>1.0e-8) { if (colsol[i]colUpper[i]-primalTolerance_) { colsol[i]=colUpper[i]; } } } int ipass=0,nfixed=-1; /* for both way coding */ int nstackC0=-1; int * stackC0 = new int[maxStack]; double * lo0 = new double[maxStack]; double * up0 = new double[maxStack]; int nstackR,nstackC; for (i=0;iinTree ? maxPass_ : maxPassRoot_; double needEffectiveness = info->strengthenRow ? -1.0e10 : 1.0e-3; while (ipass0.99999); up=colUpper[j]; } nstackC=1; nstackR=0; saveL[0]=colLower[j]; saveU[0]=colUpper[j]; assert (saveU[0]>saveL[0]); notFeasible=0; if (movement<0.0) { colUpper[j] += movement; colUpper[j] = floor(colUpper[j]+0.5); #ifdef PRINT_DEBUG printf("** Trying %d down to 0\n",j); #endif } else { colLower[j] += movement; colLower[j] = floor(colLower[j]+0.5); #ifdef PRINT_DEBUG printf("** Trying %d up to 1\n",j); #endif } if (fabs(colUpper[j]-colLower[j])<1.0e-6) markC[j]=3; // say fixed istackC=0; /* update immediately */ for (k=columnStart[j];k0.0) { /* up */ if (value>0.0) { /* up does not change - down does */ if (minR[irow]>-1.0e10) minR[irow] += value; if (minR[irow]>rowUpper[irow]+1.0e-5) { notFeasible=1; istackC=1; break; } } else { /* down does not change - up does */ if (maxR[irow]<1.0e10) maxR[irow] += value; if (maxR[irow]-1.0e10) minR[irow] -= value; if (minR[irow]>rowUpper[irow]+1.0e-5) { notFeasible=1; istackC=1; break; } } else { /* down does not change - up does */ if (maxR[irow]<1.0e10) maxR[irow] -= value; if (maxR[irow]=0) { int start; int end; if (colLower[jcol]>saveL[istackC]) { // going up start = oneFixStart_[jcol]; end = zeroFixStart_[jcol]; } else { assert (colUpper[jcol]saveL[nstackC]); nstackC++; if (!kway) { // going up colLower[kcol]=1.0; /* update immediately */ for (jj=columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value; if (maxR[krow]-1.0e10) minR[krow] -= value; if (minR[krow]>rowUpper[krow]+1.0e-5) { notFeasible=1; break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] -= value; if (maxR[krow] colLower[kcol] + primalTolerance_) { if (intVar[kcol]) { markIt |= 2; newLower = ceil(dbound-primalTolerance_); } else { newLower=dbound; if (newLower+primalTolerance_>colUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveUp = newLower-colLower[kcol]; } } if (colLower[kcol] > -1e10 && (markIt&1)==0 && rowLower[irow]>-1.0e10) { dbound = colLower[kcol] + (rowLower[irow]-maxR[irow])/value2; if (dbound < colUpper[kcol] - primalTolerance_) { if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+primalTolerance_); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveDown = newUpper-colUpper[kcol]; } } } else { /* positive element */ if (colUpper[kcol] < 1e10 && (markIt&2)==0 && rowLower[irow]>-1.0e10) { dbound = colUpper[kcol] + (rowLower[irow]-maxR[irow])/value2; if (dbound > colLower[kcol] + primalTolerance_) { if (intVar[kcol]) { markIt |= 2; newLower = ceil(dbound-primalTolerance_); } else { newLower=dbound; if (newLower+primalTolerance_>colUpper[kcol]&& newLower-primalTolerance_<=colUpper[kcol]) { newLower=colUpper[kcol]; markIt |= 2; markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveUp = newLower-colLower[kcol]; } } if (colLower[kcol] > -1e10 && (markIt&1)==0 && rowUpper[irow]<1.0e10) { dbound = colLower[kcol] + (rowUpper[irow]-minR[irow])/value2; if (dbound < colUpper[kcol] - primalTolerance_) { if (intVar[kcol]) { markIt |= 1; newUpper = floor(dbound+primalTolerance_); } else { newUpper=dbound; if (newUpper-primalTolerance_=colLower[kcol]) { newUpper=colLower[kcol]; markIt |= 1; markIt=3; } else { // avoid problems - fix later ? markIt=3; } } moveDown = newUpper-colUpper[kcol]; } } } if (nstackC<2*maxStack) { markC[kcol] = markIt; } if (moveUp&&nstackC<2*maxStack) { fixThis++; #ifdef PRINT_DEBUG printf("lower bound on %d increased from %g to %g by row %d %g %g\n",kcol,colLower[kcol],newLower,irow,rowLower[irow],rowUpper[irow]); value=0.0; for (jj=rowStart[irow];jjprimalTolerance_) { printf("(%d, %g) ",ii,rowElements[jj]); } else { value += rowElements[jj]*colLower[ii]; } } printf(" - fixed %g\n",value); for (jj=rowStart[irow];jjsaveL[nstackC]); nstackC++; onList=true; } if (intVar[kcol]) newLower = CoinMax(colLower[kcol],ceil(newLower-1.0e-4)); colLower[kcol]=newLower; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } /* update immediately */ for (jj=columnStart[kcol];jj0.0) { /* up does not change - down does */ if (minR[krow]>-1.0e10) minR[krow] += value*moveUp; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveUp; if (maxR[krow]primalTolerance_) { printf("(%d, %g) ",ii,rowElements[jj]); } else { value += rowElements[jj]*colLower[ii]; } } printf(" - fixed %g\n",value); for (jj=rowStart[irow];jjsaveL[nstackC]); nstackC++; onList=true; } if (intVar[kcol]) newUpper = CoinMin(colUpper[kcol],floor(newUpper+1.0e-4)); colUpper[kcol]=newUpper; if (fabs(colUpper[kcol]-colLower[kcol])<1.0e-6) { markC[kcol]=3; // say fixed } /* update immediately */ for (jj=columnStart[kcol];jj-1.0e10) minR[krow] += value*moveDown; if (minR[krow]>rowUpper[krow]+1.0e-5) { colUpper[kcol]=-1.0e50; /* force infeasible */ break; } } else { /* down does not change - up does */ if (maxR[krow]<1.0e10) maxR[krow] += value*moveDown; if (maxR[krow]colUpper[kcol]+primalTolerance_) { notFeasible=1;; k=columnStart[jcol]+columnLength[jcol]; istackC=nstackC+1; #ifdef PRINT_DEBUG printf("** not feasible this way\n"); #endif break; } } } } } istackC++; } if (!notFeasible) { feasible |= feas[iway]; } else if (iway==1&&feasible==0) { /* not feasible at all */ ninfeas=1; j=nCols-1; iLook=nLook; ipass=maxPass; break; } if (iway==2||(iway==1&&feasible==2)) { /* keep */ iway=3; nfixed++; if (mode_) { OsiColCut cc; int nTot=0,nFix=0,nInt=0; bool ifCut=false; for (istackC=0;istackCcolUpper[icol]+primalTolerance_) { ifCut=true; anyColumnCuts=true; } } } } if (nFix) { nTot=nFix; cc.setUbs(nFix,index,element); nFix=0; } for (istackC=0;istackCcurrentColLower[icol]+1.0e-4) { element[nFix]=colLower[icol]; index[nFix++]=icol; nInt++; if (colsol[icol]primalTolerance_) { markC[icol]=0; } else { markC[icol]=3; } } for (istackR=0;istackR=0;istackC--) { int icol=stackC[istackC]; double oldU=saveU[istackC]; double oldL=saveL[istackC]; colUpper[icol]=oldU; colLower[icol]=oldL; markC[icol]=0; } for (istackR=0;istackRprimalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut for (kk=rowStart[irow];kkmaxR[irow]+primalTolerance_||info->strengthenRow) { // can be a cut // subtract gap from upper and integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=-gap; } OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(rowUpper[irow]-gap*(colLower[j]+1.0)); // effectiveness is how far j moves rc.setEffectiveness((sum-gap*colsol[j]-maxR[irow])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif // If strengthenRow point to row //if(info->strengthenRow) //printf("a point to row %d\n",irow); #ifdef STRENGTHEN_PRINT { printf("9Cut %g <= ",rc.lb()); int k; for ( k=0;kprimalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut if (!sum) { for (kk=rowStart[irow];kkstrengthenRow) { // can be a cut // add gap to lower and integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=gap; } OsiRowCut rc; rc.setLb(rowLower[irow]+gap*(colLower[j]+1.0)); rc.setUb(COIN_DBL_MAX); // effectiveness is how far j moves rc.setEffectiveness((minR[irow]-sum-gap*colsol[j])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(info->strengthenRow) //printf("b point to row %d\n",irow); #ifdef STRENGTHEN_PRINT { printf("10Cut %g <= ",rc.lb()); int k; for ( k=0;k=0;istackC--) { int icol=stackC[istackC]; markC[icol]=istackC+1000; } if (mode_) { OsiColCut cc; int nTot=0,nFix=0,nInt=0; bool ifCut=false; for (istackC=0;istackC=0) { if (CoinMin(lo0[istackC],colLower[icol])>saveL[istackC1]+1.0e-4) { saveL[istackC1]=CoinMin(lo0[istackC],colLower[icol]); if (intVar[icol]) { element[nFix]=saveL[istackC1]; index[nFix++]=icol; nInt++; if (colsol[icol]=0) { if (CoinMax(up0[istackC],colUpper[icol])saveU[istackC1]+primalTolerance_) ifCut=true; } nfixed++; } } } if (nFix) { nTot+=nFix; cc.setUbs(nFix,index,element); } // could tighten continuous as well if (nInt) { if (ifCut) { cc.setEffectiveness(100.0); } else { cc.setEffectiveness(1.0e-5); } #ifdef CGL_DEBUG checkBounds(debugger,cc); #endif cs.insert(cc); } } } /* restore all */ for (istackC=nstackC-1;istackC>=0;istackC--) { int icol=stackC[istackC]; double oldU=saveU[istackC]; double oldL=saveL[istackC]; colUpper[icol]=oldU; colLower[icol]=oldL; if (oldU>oldL+1.0e-4) markC[icol]=0; else markC[icol]=3; } for (istackR=0;istackRprimalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut for (kk=rowStart[irow];kkrowUpper[irow]+primalTolerance_||info->strengthenRow) { // can be a cut // add gap to integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=gap; } OsiRowCut rc; rc.setLb(-COIN_DBL_MAX); rc.setUb(rowUpper[irow]+gap*(colUpper[j]-1.0)); // effectiveness is how far j moves rc.setEffectiveness((sum+gap*colsol[j]-rowUpper[irow])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(info->strengthenRow) //printf("c point to row %d\n",irow); #ifdef STRENGTHEN_PRINT { printf("11Cut %g <= ",rc.lb()); int k; for ( k=0;kprimalTolerance_&&gap<1.0e8)) { // see if the strengthened row is a cut if (!sum) { for (kk=rowStart[irow];kkstrengthenRow) { // can be a cut // subtract gap from integer coefficient // saveU and saveL spare int * index = reinterpret_cast(saveL); double * element = saveU; int n=0; bool coefficientExists=false; for (kk=rowStart[irow];kk1.0e-12) { index[n]=column[kk]; element[n++]=value; } coefficientExists=true; } } if (!coefficientExists) { index[n]=j; element[n++]=-gap; } OsiRowCut rc; rc.setLb(rowLower[irow]-gap*(colUpper[j]-1)); rc.setUb(COIN_DBL_MAX); // effectiveness is how far j moves rc.setEffectiveness((rowLower[irow]-sum+gap*colsol[j])/gap); if (rc.effectiveness()>needEffectiveness) { rc.setRow(n,index,element,false); #ifdef CGL_DEBUG if (debugger) assert(!debugger->invalidCut(rc)); #endif //if(info->strengthenRow) //printf("d point to row %d\n",irow); #ifdef STRENGTHEN_PRINT { printf("12Cut %g <= ",rc.lb()); int k; for ( k=0;kstrengthenRow,0); } delete [] array; abort(); return (ninfeas); } // Create a copy of matrix which is to be used // this is to speed up process and to give global cuts // Can give an array with 1 set to select, 0 to ignore // column bounds are tightened // If array given then values of 1 will be set to 0 if redundant int CglProbing::snapshot ( const OsiSolverInterface & si, char * possible,bool withObjective) { deleteSnapshot(); // Get basic problem information numberColumns_=si.getNumCols(); numberRows_=si.getNumRows(); colLower_ = new double[numberColumns_]; colUpper_ = new double[numberColumns_]; CoinMemcpyN(si.getColLower(),numberColumns_,colLower_); CoinMemcpyN(si.getColUpper(),numberColumns_,colUpper_); rowLower_= new double [numberRows_+1]; rowUpper_= new double [numberRows_+1]; CoinMemcpyN(si.getRowLower(),numberRows_,rowLower_); CoinMemcpyN(si.getRowUpper(),numberRows_,rowUpper_); int i; if (possible) { for (i=0;igetMutableIndices(); const CoinBigIndex * rowStart = rowCopy_->getVectorStarts(); const int * rowLength = rowCopy_->getVectorLengths(); double * rowElements = rowCopy_->getMutableElements(); // Put negative first int * column2 = new int[numberColumns_]; double * elements2 = new double[numberColumns_]; CoinBigIndex * rowStartPos = new CoinBigIndex [numberRows_]; for (int i=0;i 1 (one or more variables infeasible), shouldn't we bail out here? */ // do integer stuff for mode 0 cutVector_ = new disaggregation [number01Integers_]; memset(cutVector_,0,number01Integers_*sizeof(disaggregation)); number01Integers_=0; for (i=0;i1.0e30) possible[i]=0; } } int * index = new int[numberRows_]; int nDrop=0,nKeep=0; for (i=0;i1.0e30) { index[nDrop++]=i; } else { rowLower_[nKeep]=rowLower_[i]; rowUpper_[nKeep++]=rowUpper_[i]; } } numberRows_=nKeep; if (nDrop) rowCopy_->deleteRows(nDrop,index); delete [] index; if (withObjective) { // add in objective int * columns = new int[numberColumns_]; double * elements = new double[numberColumns_]; int n=0; const double * objective = si.getObjCoefficients(); bool maximize = (si.getObjSense()==-1); for (i=0;iappendRow(n,columns,elements); delete [] columns; delete [] elements; numberRows_++; } // create column copy if (rowCopy_->getNumElements()) { columnCopy_=new CoinPackedMatrix(*rowCopy_,0,0,true); } else { columnCopy_=new CoinPackedMatrix(); } // make sure big enough - in case too many rows dropped columnCopy_->setDimensions(numberRows_,numberColumns_); rowCopy_->setDimensions(numberRows_,numberColumns_); return returnCode; } // Delete snapshot void CglProbing::deleteSnapshot() { delete [] rowLower_; delete [] rowUpper_; delete [] colLower_; delete [] colUpper_; delete rowCopy_; delete columnCopy_; rowCopy_=NULL; columnCopy_=NULL; rowLower_=NULL; rowUpper_=NULL; colLower_=NULL; colUpper_=NULL; int i; for (i=0;i=0&&mode<3) { // take off bottom bit mode_ &= ~15; mode_ |= mode; } } int CglProbing::getMode() const { return mode_&15; } // Set maximum number of passes per node void CglProbing::setMaxPass(int value) { if (value>0) maxPass_=value; } // Get maximum number of passes per node int CglProbing::getMaxPass() const { return maxPass_; } // Set log level void CglProbing::setLogLevel(int value) { if (value>=0) logLevel_=value; } // Get log level int CglProbing::getLogLevel() const { return logLevel_; } // Set maximum number of unsatisfied variables to look at void CglProbing::setMaxProbe(int value) { if (value>=0) maxProbe_=value; } // Get maximum number of unsatisfied variables to look at int CglProbing::getMaxProbe() const { return maxProbe_; } // Set maximum number of variables to look at in one probe void CglProbing::setMaxLook(int value) { if (value>=0) maxStack_=value; } // Get maximum number of variables to look at in one probe int CglProbing::getMaxLook() const { return maxStack_; } // Set maximum number of elements in row for scan void CglProbing::setMaxElements(int value) { if (value>0) maxElements_=value; } // Get maximum number of elements in row for scan int CglProbing::getMaxElements() const { return maxElements_; } // Set maximum number of passes per node (root node) void CglProbing::setMaxPassRoot(int value) { if (value>0) maxPassRoot_=value; } // Get maximum number of passes per node (root node) int CglProbing::getMaxPassRoot() const { return maxPassRoot_; } // Set maximum number of unsatisfied variables to look at (root node) void CglProbing::setMaxProbeRoot(int value) { if (value>0) maxProbeRoot_=value; } // Get maximum number of unsatisfied variables to look at (root node) int CglProbing::getMaxProbeRoot() const { return maxProbeRoot_; } // Set maximum number of variables to look at in one probe (root node) void CglProbing::setMaxLookRoot(int value) { if (value>0) maxStackRoot_=value; } // Get maximum number of variables to look at in one probe (root node) int CglProbing::getMaxLookRoot() const { return maxStackRoot_; } // Set maximum number of elements in row for scan (root node) void CglProbing::setMaxElementsRoot(int value) { if (value>0) maxElementsRoot_=value; } // Get maximum number of elements in row for scan (root node) int CglProbing::getMaxElementsRoot() const { return maxElementsRoot_; } // Set whether to use objective void CglProbing::setUsingObjective(int yesNo) { usingObjective_=yesNo; } // Get whether objective is being used int CglProbing::getUsingObjective() const { return usingObjective_; } // Decide whether to do row cuts void CglProbing::setRowCuts(int type) { if (type>-5&&type<5) rowCuts_=type; } // Returns row cuts generation type int CglProbing::rowCuts() const { return rowCuts_; } // Returns tight lower const double * CglProbing::tightLower() const { return colLower_; } // Returns tight upper const double * CglProbing::tightUpper() const { return colUpper_; } // Returns relaxed Row lower const double * CglProbing::relaxedRowLower() const { return rowLower_; } // Returns relaxed Row upper const double * CglProbing::relaxedRowUpper() const { return rowUpper_; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglProbing::CglProbing () : CglCutGenerator(), primalTolerance_(1.1e-07), mode_(1), rowCuts_(1), maxPass_(3), logLevel_(0), maxProbe_(100), maxStack_(50), maxElements_(1000), maxPassRoot_(3), maxProbeRoot_(100), maxStackRoot_(50), maxElementsRoot_(10000), usingObjective_(0) { numberRows_=0; numberColumns_=0; rowCopy_=NULL; columnCopy_=NULL; rowLower_=NULL; rowUpper_=NULL; colLower_=NULL; colUpper_=NULL; numberIntegers_=0; number01Integers_=0; numberThisTime_=0; totalTimesCalled_=0; lookedAt_=NULL; cutVector_=NULL; numberCliques_=0; cliqueType_=NULL; cliqueStart_=NULL; cliqueEntry_=NULL; oneFixStart_=NULL; zeroFixStart_=NULL; endFixStart_=NULL; whichClique_=NULL; cliqueRow_=NULL; cliqueRowStart_=NULL; tightenBounds_=NULL; } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglProbing::CglProbing ( const CglProbing & rhs) : CglCutGenerator(rhs), primalTolerance_(rhs.primalTolerance_), mode_(rhs.mode_), rowCuts_(rhs.rowCuts_), maxPass_(rhs.maxPass_), logLevel_(rhs.logLevel_), maxProbe_(rhs.maxProbe_), maxStack_(rhs.maxStack_), maxElements_(rhs.maxElements_), maxPassRoot_(rhs.maxPassRoot_), maxProbeRoot_(rhs.maxProbeRoot_), maxStackRoot_(rhs.maxStackRoot_), maxElementsRoot_(rhs.maxElementsRoot_), usingObjective_(rhs.usingObjective_) { numberRows_=rhs.numberRows_; numberColumns_=rhs.numberColumns_; numberCliques_=rhs.numberCliques_; if (rhs.rowCopy_) { rowCopy_= new CoinPackedMatrix(*(rhs.rowCopy_)); columnCopy_= new CoinPackedMatrix(*(rhs.columnCopy_)); rowLower_=new double[numberRows_]; CoinMemcpyN(rhs.rowLower_,numberRows_,rowLower_); rowUpper_=new double[numberRows_]; CoinMemcpyN(rhs.rowUpper_,numberRows_,rowUpper_); colLower_=new double[numberColumns_]; CoinMemcpyN(rhs.colLower_,numberColumns_,colLower_); colUpper_=new double[numberColumns_]; CoinMemcpyN(rhs.colUpper_,numberColumns_,colUpper_); int i; numberIntegers_=rhs.numberIntegers_; number01Integers_=rhs.number01Integers_; cutVector_=new disaggregation [number01Integers_]; CoinMemcpyN(rhs.cutVector_,number01Integers_,cutVector_); for (i=0;i=0;i--) { if (oneFixStart_[i]>=0) { n2=endFixStart_[i]; break; } } assert (n==n2); #endif whichClique_ = new int [n]; CoinMemcpyN(rhs.whichClique_,n,whichClique_); if (rhs.cliqueRowStart_) { cliqueRowStart_ = CoinCopyOfArray(rhs.cliqueRowStart_,numberRows_+1); n=cliqueRowStart_[numberRows_]; cliqueRow_ = CoinCopyOfArray(rhs.cliqueRow_,n); } else { cliqueRow_=NULL; cliqueRowStart_=NULL; } } else { cliqueType_=NULL; cliqueStart_=NULL; cliqueEntry_=NULL; oneFixStart_=NULL; zeroFixStart_=NULL; endFixStart_=NULL; cliqueRow_=NULL; cliqueRowStart_=NULL; whichClique_=NULL; } if (rhs.tightenBounds_) { assert (numberColumns_); tightenBounds_=CoinCopyOfArray(rhs.tightenBounds_,numberColumns_); } else { tightenBounds_=NULL; } } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglProbing::clone() const { return new CglProbing(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglProbing::~CglProbing () { // free memory delete [] rowLower_; delete [] rowUpper_; delete [] colLower_; delete [] colUpper_; delete rowCopy_; delete columnCopy_; delete [] lookedAt_; delete [] cliqueType_; delete [] cliqueStart_; delete [] cliqueEntry_; delete [] oneFixStart_; delete [] zeroFixStart_; delete [] endFixStart_; delete [] whichClique_; delete [] cliqueRow_; delete [] cliqueRowStart_; if (cutVector_) { for (int i=0;i=0;i--) { if (oneFixStart_[i]>=0) { n2=endFixStart_[i]; break; } } assert (n==n2); #endif whichClique_ = new int [n]; CoinMemcpyN(rhs.whichClique_,n,whichClique_); if (rhs.cliqueRowStart_) { cliqueRowStart_ = CoinCopyOfArray(rhs.cliqueRowStart_,numberRows_+1); n=cliqueRowStart_[numberRows_]; cliqueRow_ = CoinCopyOfArray(rhs.cliqueRow_,n); } else { cliqueRow_=NULL; cliqueRowStart_=NULL; } } else { cliqueType_=NULL; cliqueStart_=NULL; cliqueEntry_=NULL; oneFixStart_=NULL; zeroFixStart_=NULL; endFixStart_=NULL; whichClique_=NULL; cliqueRow_=NULL; cliqueRowStart_=NULL; } if (rhs.tightenBounds_) { assert (numberColumns_); tightenBounds_=CoinCopyOfArray(rhs.tightenBounds_,numberColumns_); } else { tightenBounds_=NULL; } } return *this; } /// This can be used to refresh any inforamtion void CglProbing::refreshSolver(OsiSolverInterface * solver) { if (rowCopy_) { // snapshot existed - redo snapshot(*solver,NULL); } } /* Creates cliques for use by probing. Can also try and extend cliques as a result of probing (root node). Returns number of cliques found. */ int CglProbing::createCliques( OsiSolverInterface & si, int minimumSize, int maximumSize) { // get rid of what is there deleteCliques(); CoinPackedMatrix matrixByRow(*si.getMatrixByRow()); int numberRows = si.getNumRows(); if (!rowCopy_) numberRows_=numberRows; numberColumns_ = si.getNumCols(); numberCliques_=0; int numberEntries=0; int numberIntegers=0; int * lookup = new int[numberColumns_]; int i; for (i=0;i0.0) { which[numberP1++]=iColumn; } else { numberM1++; which[numberIntegers-numberM1]=iColumn; } } int iUpper = static_cast (floor(upperValue+1.0e-5)); int iLower = static_cast (ceil(lowerValue-1.0e-5)); int state=0; if (upperValue<1.0e6) { if (iUpper==1-numberM1) state=1; else if (iUpper==-numberM1) state=2; else if (iUpper<-numberM1) state=3; } if (!state&&lowerValue>-1.0e6) { if (-iLower==1-numberP1) state=-1; else if (-iLower==-numberP1) state=-2; else if (-iLower<-numberP1) state=-3; } if (good&&state) { if (abs(state)==3) { // infeasible numberCliques_ = -99999; break; } else if (abs(state)==2) { // we can fix all numberFixed += numberP1+numberM1; if (state>0) { // fix all +1 at 0, -1 at 1 for (i=0;i= minimumSize&&length= maximumSize) { // too big numberBig++; totalBig += numberP1+numberM1; } } } } if (numberCliques_<0) { if (logLevel_) printf("*** Problem infeasible\n"); } else { if (numberCliques_) { if (logLevel_) printf("%d cliques of average size %g found, %d P1, %d M1\n", numberCliques_, (static_cast(totalP1+totalM1))/ (static_cast (numberCliques_)), totalP1,totalM1); } else { if (logLevel_>1) printf("No cliques found\n"); } if (numberBig) { if (logLevel_) printf("%d large cliques ( >= %d) found, total %d\n", numberBig,maximumSize,totalBig); } if (numberFixed) { if (logLevel_) printf("%d variables fixed\n",numberFixed); } } if (numberCliques_>0) { cliqueType_ = new cliqueType [numberCliques_]; cliqueStart_ = new int [numberCliques_+1]; cliqueEntry_ = new cliqueEntry [numberEntries]; oneFixStart_ = new int [numberColumns_]; zeroFixStart_ = new int [numberColumns_]; endFixStart_ = new int [numberColumns_]; whichClique_ = new int [numberEntries]; numberEntries=0; cliqueStart_[0]=0; for (i=0;i0.0) { which[numberP1++]=iColumn; } else { numberM1++; which[numberIntegers-numberM1]=iColumn; } } int iUpper = static_cast (floor(upperValue+1.0e-5)); int iLower = static_cast (ceil(lowerValue-1.0e-5)); int state=0; if (upperValue<1.0e6) { if (iUpper==1-numberM1) state=1; } if (!state&&lowerValue>-1.0e6) { state=-1; } if (abs(state)!=1) continue; // must have been fixed if (iLower==iUpper) { cliqueType_[numberCliques_].equality=1; } else { cliqueType_[numberCliques_].equality=0; } if (state>0) { for (i=0;i=0) { int n1=oneFixStart_[iColumn]; int n2=zeroFixStart_[iColumn]; oneFixStart_[iColumn]=numberEntries; which[iColumn]=numberEntries; numberEntries += n1; zeroFixStart_[iColumn]=numberEntries; endFixStart_[iColumn]=numberEntries; numberEntries += n2; } } // now put in for (iClique=0;iClique0; } // Sets up clique information for each row void CglProbing::setupRowCliqueInformation(const OsiSolverInterface & si) { if (!numberCliques_) return; CoinPackedMatrix * rowCopy; if (!rowCopy_) { // create from current numberRows_=si.getNumRows(); numberColumns_=si.getNumCols(); rowCopy = new CoinPackedMatrix(*si.getMatrixByRow()); } else { rowCopy = rowCopy_; assert(numberRows_<=si.getNumRows()); assert(numberColumns_==si.getNumCols()); } assert(numberRows_&&numberColumns_); cliqueRowStart_ = new int [numberRows_+1]; cliqueRowStart_[0]=0; // Temporary array while building list cliqueEntry ** array = new cliqueEntry * [numberRows_]; // Which cliques in use int * which = new int[numberCliques_]; int * count = new int[numberCliques_]; int * back =new int[numberColumns_]; CoinZeroN(count,numberCliques_); CoinFillN(back,numberColumns_,-1); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * lower = si.getColLower(); const double * upper = si.getColUpper(); int iRow; for (iRow=0;iRowlower[iColumn]) { back[iColumn]=j-rowStart[iRow]; numberFree++; for (int k=oneFixStart_[iColumn];klargest) { largest=count[iClique]; whichClique=iClique; } } // Add in if >1 (but not if all as that means clique==row) if (whichClique>=0&&largestlower[iColumn]) { bool found=false; int k; for ( k=oneFixStart_[iColumn];k=0&&kgenerateCuts(si,cs,info); //int n2=cs.sizeRowCuts(); //if (n2>n1) //printf("added %d cuts\n",n2-n1); } } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglImplication::CglImplication () : CglCutGenerator(), probingInfo_(NULL) { // nothing to do here } //------------------------------------------------------------------- // Constructor with info //------------------------------------------------------------------- CglImplication::CglImplication (CglTreeProbingInfo * info) : CglCutGenerator(), probingInfo_(info) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglImplication::CglImplication ( const CglImplication & source) : CglCutGenerator(source), probingInfo_(source.probingInfo_) { // Nothing to do here } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglImplication::clone() const { return new CglImplication(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglImplication::~CglImplication () { // Nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglImplication & CglImplication::operator=( const CglImplication& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); probingInfo_=rhs.probingInfo_; } return *this; } // Create C++ lines to get to current state std::string CglImplication::generateCpp( FILE * fp) { CglImplication other; fprintf(fp,"0#include \"CglImplication.hpp\"\n"); fprintf(fp,"3 CglImplication implication;\n"); return "implication"; } Cgl-0.58.9/src/CglProbing/CglProbing.hpp0000644000076600007660000004363412130104734016361 0ustar coincoin// $Id: CglProbing.hpp 1123 2013-04-06 20:47:24Z stefan $ // 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). #ifndef CglProbing_H #define CglProbing_H #include #include "CglCutGenerator.hpp" /** Only useful type of disaggregation is most normal For now just done for 0-1 variables Can be used for building cliques */ typedef struct { //unsigned int zeroOne:1; // nonzero if affected variable is 0-1 //unsigned int whenAtUB:1; // nonzero if fixing happens when this variable at 1 //unsigned int affectedToUB:1; // nonzero if affected variable fixed to UB //unsigned int affected:29; // If 0-1 then 0-1 sequence, otherwise true unsigned int affected; } disaggregationAction; /** Probing Cut Generator Class */ class CglProbing : public CglCutGenerator { friend void CglProbingUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /**@name Generate Cuts */ //@{ /** Generate probing/disaggregation cuts for the model of the solver interface, si. This is a simplification of probing ideas put into OSL about ten years ago. The only known documentation is a copy of a talk handout - we think Robin Lougee-Heimer has a copy! For selected integer variables (e.g. unsatisfied ones) the effect of setting them up or down is investigated. Setting a variable up may in turn set other variables (continuous as well as integer). There are various possible results: 1) It is shown that problem is infeasible (this may also be because objective function or reduced costs show worse than best solution). If the other way is feasible we can generate a column cut (and continue probing), if not feasible we can say problem infeasible. 2) If both ways are feasible, it can happen that x to 0 implies y to 1 ** and x to 1 implies y to 1 (again a column cut). More common is that x to 0 implies y to 1 and x to 1 implies y to 0 so we could substitute for y which might lead later to more powerful cuts. ** This is not done in this code as there is no mechanism for returning information. 3) When x to 1 a constraint went slack by c. We can tighten the constraint ax + .... <= b (where a may be zero) to (a+c)x + .... <= b. If this cut is violated then it is generated. 4) Similarly we can generate implied disaggregation cuts Note - differences to cuts in OSL. a) OSL had structures intended to make this faster. b) The "chaining" in 2) was done c) Row cuts modified original constraint rather than adding cut b) This code can cope with general integer variables. Insert the generated cuts into OsiCut, cs. If a "snapshot" of a matrix exists then this will be used. Presumably this will give global cuts and will be faster. No check is done to see if cuts will be global. Otherwise use current matrix. Both row cuts and column cuts may be returned The mode options are: 0) Only unsatisfied integer variables will be looked at. If no information exists for that variable then probing will be done so as a by-product you "may" get a fixing or infeasibility. This will be fast and is only available if a snapshot exists (otherwise as 1). The bounds in the snapshot are the ones used. 1) Look at unsatisfied integer variables, using current bounds. Probing will be done on all looked at. 2) Look at all integer variables, using current bounds. Probing will be done on all ** If generateCutsAndModify is used then new relaxed row bounds and tightened column bounds are generated Returns number of infeasibilities */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); int generateCutsAndModify( const OsiSolverInterface & si, OsiCuts & cs, CglTreeInfo * info); //@} /**@name snapshot etc */ //@{ /** Create a copy of matrix which is to be used this is to speed up process and to give global cuts Can give an array with 1 set to select, 0 to ignore column bounds are tightened If array given then values of 1 will be set to 0 if redundant. Objective may be added as constraint Returns 1 if infeasible otherwise 0 */ int snapshot ( const OsiSolverInterface & si, char * possible=NULL, bool withObjective=true); /// Deletes snapshot void deleteSnapshot ( ); /** Creates cliques for use by probing. Only cliques >= minimumSize and < maximumSize created Can also try and extend cliques as a result of probing (root node). Returns number of cliques found. */ int createCliques( OsiSolverInterface & si, int minimumSize=2, int maximumSize=100); /// Delete all clique information void deleteCliques(); //@} /**@name Get tighter column bounds */ //@{ /// Lower const double * tightLower() const; /// Upper const double * tightUpper() const; /// Array which says tighten continuous const char * tightenBounds() const { return tightenBounds_;} //@} /**@name Get possible freed up row bounds - only valid after mode==3 */ //@{ /// Lower const double * relaxedRowLower() const; /// Upper const double * relaxedRowUpper() const; //@} /**@name Change mode */ //@{ /// Set void setMode(int mode); /// Get int getMode() const; //@} /**@name Change maxima */ //@{ /// Set maximum number of passes per node void setMaxPass(int value); /// Get maximum number of passes per node int getMaxPass() const; /// Set log level - 0 none, 1 - a bit, 2 - more details void setLogLevel(int value); /// Get log level int getLogLevel() const; /// Set maximum number of unsatisfied variables to look at void setMaxProbe(int value); /// Get maximum number of unsatisfied variables to look at int getMaxProbe() const; /// Set maximum number of variables to look at in one probe void setMaxLook(int value); /// Get maximum number of variables to look at in one probe int getMaxLook() const; /// Set maximum number of elements in row for it to be considered void setMaxElements(int value); /// Get maximum number of elements in row for it to be considered int getMaxElements() const; /// Set maximum number of passes per node (root node) void setMaxPassRoot(int value); /// Get maximum number of passes per node (root node) int getMaxPassRoot() const; /// Set maximum number of unsatisfied variables to look at (root node) void setMaxProbeRoot(int value); /// Get maximum number of unsatisfied variables to look at (root node) int getMaxProbeRoot() const; /// Set maximum number of variables to look at in one probe (root node) void setMaxLookRoot(int value); /// Get maximum number of variables to look at in one probe (root node) int getMaxLookRoot() const; /// Set maximum number of elements in row for it to be considered (root node) void setMaxElementsRoot(int value); /// Get maximum number of elements in row for it to be considered (root node) int getMaxElementsRoot() const; /** Returns true if may generate Row cuts in tree (rather than root node). Used so know if matrix will change in tree. Really meant so column cut generators can still be active without worrying code. Default is true */ virtual bool mayGenerateRowCutsInTree() const; //@} /**@name Get information back from probing */ //@{ /// Number looked at this time inline int numberThisTime() const { return numberThisTime_;} /// Which ones looked at this time inline const int * lookedAt() const { return lookedAt_;} //@} /**@name Stop or restart row cuts (otherwise just fixing from probing) */ //@{ /// Set /// 0 no cuts, 1 just disaggregation type, 2 coefficient ( 3 both) void setRowCuts(int type); /// Get int rowCuts() const; //@} /**@name Whether use objective as constraint */ //@{ /** Set 0 don't 1 do -1 don't even think about it */ void setUsingObjective(int yesNo); /// Get int getUsingObjective() const; //@} /**@name Mark which continuous variables are to be tightened */ //@{ /// Mark variables to be tightened void tightenThese(const OsiSolverInterface & solver, int number, const int * which); //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglProbing (); /// Copy constructor CglProbing ( const CglProbing &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglProbing & operator=( const CglProbing& rhs); /// Destructor virtual ~CglProbing (); /// This can be used to refresh any inforamtion virtual void refreshSolver(OsiSolverInterface * solver); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} private: // Private member methods /**@name probe */ //@{ /// Does probing and adding cuts (without cliques and mode_!=0) int probe( const OsiSolverInterface & si, const OsiRowCutDebugger * debugger, OsiCuts & cs, double * colLower, double * colUpper, CoinPackedMatrix *rowCopy, CoinPackedMatrix *columnCopy,const CoinBigIndex * rowStartPos, const int * realRow, const double * rowLower, const double * rowUpper, const char * intVar, double * minR, double * maxR, int * markR, CglTreeInfo * info); /// Does probing and adding cuts (with cliques) int probeCliques( const OsiSolverInterface & si, const OsiRowCutDebugger * debugger, OsiCuts & cs, double * colLower, double * colUpper, CoinPackedMatrix *rowCopy, CoinPackedMatrix *columnCopy, const int * realRow, double * rowLower, double * rowUpper, char * intVar, double * minR, double * maxR, int * markR, CglTreeInfo * info); /// Does probing and adding cuts for clique slacks int probeSlacks( const OsiSolverInterface & si, const OsiRowCutDebugger * debugger, OsiCuts & cs, double * colLower, double * colUpper, CoinPackedMatrix *rowCopy, CoinPackedMatrix *columnCopy, double * rowLower, double * rowUpper, char * intVar, double * minR, double * maxR,int * markR, CglTreeInfo * info); /** Does most of work of generateCuts Returns number of infeasibilities */ int gutsOfGenerateCuts( const OsiSolverInterface & si, OsiCuts & cs, double * rowLower, double * rowUpper, double * colLower, double * colUpper, CglTreeInfo * info); /// Sets up clique information for each row void setupRowCliqueInformation(const OsiSolverInterface & si); /** This tightens column bounds (and can declare infeasibility) It may also declare rows to be redundant */ int tighten(double *colLower, double * colUpper, const int *column, const double *rowElements, const CoinBigIndex *rowStart,const CoinBigIndex * rowStartPos, const int * rowLength, double *rowLower, double *rowUpper, int nRows,int nCols,char * intVar,int maxpass, double tolerance); /// This just sets minima and maxima on rows void tighten2(double *colLower, double * colUpper, const int *column, const double *rowElements, const CoinBigIndex *rowStart, const int * rowLength, double *rowLower, double *rowUpper, double * minR, double * maxR, int * markR, int nRows); //@} // Private member data struct disaggregation_struct_tag ; friend struct CglProbing::disaggregation_struct_tag ; /**@name Private member data */ //@{ /// Row copy (only if snapshot) CoinPackedMatrix * rowCopy_; /// Column copy (only if snapshot) CoinPackedMatrix * columnCopy_; /// Lower bounds on rows double * rowLower_; /// Upper bounds on rows double * rowUpper_; /// Lower bounds on columns double * colLower_; /// Upper bounds on columns double * colUpper_; /// Number of rows in snapshot (or when cliqueRow stuff computed) int numberRows_; /// Number of columns in problem ( must == current) int numberColumns_; /// Tolerance to see if infeasible double primalTolerance_; /** Mode - 0 lazy using snapshot, 1 just unsatisfied, 2 all. 16 bit set if want to extend cliques at root node */ int mode_; /** Row cuts flag 0 no cuts, 1 just disaggregation type, 2 coefficient ( 3 both), 4 just column cuts -n as +n but just fixes variables unless at root */ int rowCuts_; /// Maximum number of passes to do in probing int maxPass_; /// Log level - 0 none, 1 - a bit, 2 - more details int logLevel_; /// Maximum number of unsatisfied variables to probe int maxProbe_; /// Maximum number of variables to look at in one probe int maxStack_; /// Maximum number of elements in row for scan int maxElements_; /// Maximum number of passes to do in probing at root int maxPassRoot_; /// Maximum number of unsatisfied variables to probe at root int maxProbeRoot_; /// Maximum number of variables to look at in one probe at root int maxStackRoot_; /// Maximum number of elements in row for scan at root int maxElementsRoot_; /// Whether to include objective as constraint int usingObjective_; /// Number of integer variables int numberIntegers_; /// Number of 0-1 integer variables int number01Integers_; /// Number looked at this time int numberThisTime_; /// Total number of times called int totalTimesCalled_; /// Which ones looked at this time int * lookedAt_; /// Disaggregation cuts and for building cliques typedef struct disaggregation_struct_tag { int sequence; // integer variable // index will be NULL if no probing done yet int length; // length of newValue disaggregationAction * index; // columns whose bounds will be changed } disaggregation; disaggregation * cutVector_; /// Cliques /// Number of cliques int numberCliques_; /// Clique type typedef struct { unsigned int equality:1; // nonzero if clique is == } cliqueType; cliqueType * cliqueType_; /// Start of each clique int * cliqueStart_; /// Entries for clique cliqueEntry * cliqueEntry_; /** Start of oneFixes cliques for a column in matrix or -1 if not in any clique */ int * oneFixStart_; /** Start of zeroFixes cliques for a column in matrix or -1 if not in any clique */ int * zeroFixStart_; /// End of fixes for a column int * endFixStart_; /// Clique numbers for one or zero fixes int * whichClique_; /** For each column with nonzero in row copy this gives a clique "number". So first clique mentioned in row is always 0. If no entries for row then no cliques. If sequence > numberColumns then not in clique. */ cliqueEntry * cliqueRow_; /// cliqueRow_ starts for each row int * cliqueRowStart_; /// If not null and [i] !=0 then also tighten even if continuous char * tightenBounds_; //@} }; inline int affectedInDisaggregation(const disaggregationAction & dis) { return dis.affected&0x1fffffff;} inline void setAffectedInDisaggregation(disaggregationAction & dis, int affected) { dis.affected = affected|(dis.affected&0xe0000000);} #ifdef NDEBUG inline bool zeroOneInDisaggregation(const disaggregationAction & ) { return true;} #else inline bool zeroOneInDisaggregation(const disaggregationAction & dis) //{ return (dis.affected&0x80000000)!=0;} { assert ((dis.affected&0x80000000)!=0); return true;} #endif inline void setZeroOneInDisaggregation(disaggregationAction & dis,bool zeroOne) { dis.affected = (zeroOne ? 0x80000000 : 0)|(dis.affected&0x7fffffff);} inline bool whenAtUBInDisaggregation(const disaggregationAction & dis) { return (dis.affected&0x40000000)!=0;} inline void setWhenAtUBInDisaggregation(disaggregationAction & dis,bool whenAtUB) { dis.affected = (whenAtUB ? 0x40000000 : 0)|(dis.affected&0xbfffffff);} inline bool affectedToUBInDisaggregation(const disaggregationAction & dis) { return (dis.affected&0x20000000)!=0;} inline void setAffectedToUBInDisaggregation(disaggregationAction & dis,bool affectedToUB) { dis.affected = (affectedToUB ? 0x20000000 : 0)|(dis.affected&0xdfffffff);} //############################################################################# /** A function that tests the methods in the CglProbing class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglProbingUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); /// This just uses implication info class CglImplication : public CglCutGenerator { public: /**@name Generate Cuts */ //@{ /** Generate cuts from implication table Insert generated cuts into the cut set cs. */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglImplication (); /// Constructor with info CglImplication (CglTreeProbingInfo * info); /// Copy constructor CglImplication ( const CglImplication &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglImplication & operator=( const CglImplication& rhs); /// Destructor virtual ~CglImplication (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} /**@name Set implication */ //@{ /// Set implication inline void setProbingInfo(CglTreeProbingInfo * info) { probingInfo_=info;} //@} private: /**@name Private member data */ //@{ /// Pointer to tree probing info CglTreeProbingInfo * probingInfo_; //@} }; #endif Cgl-0.58.9/src/CglProbing/Makefile.am0000644000076600007660000000320311621724114015646 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglCglProbing # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglProbing.la # List all source files for this library, including headers libCglProbing_la_SOURCES = CglProbing.cpp CglProbing.hpp CglProbingTest.cpp # This is for libtool (on Windows) libCglProbing_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglProbing.hpp Cgl-0.58.9/src/CglProbing/Makefile.in0000644000076600007660000005401012240340055015655 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/CglProbing 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglProbing_la_LIBADD = am_libCglProbing_la_OBJECTS = CglProbing.lo CglProbingTest.lo libCglProbing_la_OBJECTS = $(am_libCglProbing_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 = $(libCglProbing_la_SOURCES) DIST_SOURCES = $(libCglProbing_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglCglProbing # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglProbing.la # List all source files for this library, including headers libCglProbing_la_SOURCES = CglProbing.cpp CglProbing.hpp CglProbingTest.cpp # This is for libtool (on Windows) libCglProbing_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglProbing.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/CglProbing/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglProbing/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglProbing.la: $(libCglProbing_la_OBJECTS) $(libCglProbing_la_DEPENDENCIES) $(CXXLINK) $(libCglProbing_la_LDFLAGS) $(libCglProbing_la_OBJECTS) $(libCglProbing_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglProbing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglProbingTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglProbing/CglProbingTest.cpp0000644000076600007660000001301412130104734017201 0ustar coincoin// $Id: CglProbingTest.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CoinPackedMatrix.hpp" #include "CglProbing.hpp" //-------------------------------------------------------------------------- // test EKKsolution methods. void CglProbingUnitTest( const OsiSolverInterface * baseSiP, const std::string mpsDir ) { # ifdef CGL_DEBUG int i ; // define just once # endif CoinRelFltEq eq(0.000001); // Test default constructor { CglProbing aGenerator; } // Test copy & assignment { CglProbing rhs; { CglProbing bGenerator; CglProbing cGenerator(bGenerator); rhs=bGenerator; } } { OsiCuts osicuts; CglProbing test1; OsiSolverInterface * siP = baseSiP->clone(); int nColCuts; int nRowCuts; std::string fn = mpsDir+"p0033"; siP->readMps(fn.c_str(),"mps"); siP->initialSolve(); // just unsatisfied variables test1.generateCuts(*siP,osicuts); nColCuts = osicuts.sizeColCuts(); nRowCuts = osicuts.sizeRowCuts(); std::cout<<"There are "<getColLower(); const double * up = siP->getColUpper(); for (i=0; ilo[icol]) std::cout<<"Can increase lb on "<getColSolution(); rcut = osicuts.rowCut(i); rpv = rcut.row(); const int n = rpv.getNumElements(); const int * indices = rpv.getIndices(); double* elements = rpv.getElements(); double sum2=0.0; int k=0; double lb=rcut.lb(); double ub=rcut.ub(); for (k=0; kub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<getColLower(); const double * up = siP->getColUpper(); for (i=0; ilo[icol]) std::cout<<"Can increase lb on "<getColSolution(); rcut = osicuts.rowCut(i); rpv = rcut.row(); const int n = rpv.getNumElements(); const int * indices = rpv.getIndices(); double* elements = rpv.getElements(); double sum2=0.0; int k=0; double lb=rcut.lb(); double ub=rcut.ub(); for (k=0; kub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<=4); delete siP; } } Cgl-0.58.9/src/config_default.h0000644000076600007660000000170112130104734014703 0ustar coincoin /* include the COIN-OR-wide system specific configure header */ #include "configall_system.h" /* include the public project specific macros */ #include "config_cgl_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_CGL_CHECKLEVEL 0 /* Define to the debug verbosity level (0 is no output) */ #define COIN_CGL_VERBOSITY 0 /* Define to 1 if the Clp package is used */ #define COIN_HAS_OSICLP 1 /* Define to 1 if the CoinUtils package is used */ #define COIN_HAS_COINUTILS 1 /* Define to 1 if the Osi package is used */ #define COIN_HAS_OSI 1 /* Define to 1 if the Vol package is used */ #define COIN_HAS_VOL 1 Cgl-0.58.9/src/CglClique/0000755000076600007660000000000012377555671013461 5ustar coincoinCgl-0.58.9/src/CglClique/CglClique.hpp0000644000076600007660000002446712130104734016030 0ustar coincoin// $Id: CglClique.hpp 1123 2013-04-06 20:47:24Z stefan $ // 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 _CglClique_h_ #define _CglClique_h_ #include "CglCutGenerator.hpp" //class OsiCuts; //class OsiSolverInterface; class CglClique : public CglCutGenerator { friend void CglCliqueUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /// Copy constructor CglClique(const CglClique& rhs); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglClique& operator=(const CglClique& rhs); public: virtual void generateCuts(const OsiSolverInterface& si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /**@name Constructors and destructors */ //@{ /** Default constructor. If the setPacking argument is set to true then CglClique will assume that the problem in the solverinterface passed to the generateCuts() method describes a set packing problem, i.e., - all variables are binary - the matrix is a 0-1 matrix - all constraints are '= 1' or '<= 1' Otherwise the user can use the considerRows() method to set the list of clique rows, that is, - all coeffs corresponding to binary variables at fractional level is 1 - all other coeffs are non-negative - the constraint is '= 1' or '<= 1'. If the user does not set the list of clique rows then CglClique will start the generateCuts() methods by scanning the matrix for them. Also justOriginalRows can be set to true to limit clique creation */ CglClique(bool setPacking = false, bool justOriginalRows = false); /// Destructor virtual ~CglClique() {} /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); void considerRows(const int numRows, const int* rowInd); public: /** possible choices for selecting the next node in the star clique search */ enum scl_next_node_method { SCL_MIN_DEGREE, SCL_MAX_DEGREE, SCL_MAX_XJ_MAX_DEG }; void setStarCliqueNextNodeMethod(scl_next_node_method method) { scl_next_node_rule = method; } void setStarCliqueCandidateLengthThreshold(int maxlen) { scl_candidate_length_threshold = maxlen; } void setRowCliqueCandidateLengthThreshold(int maxlen) { rcl_candidate_length_threshold = maxlen; } void setStarCliqueReport(bool yesno = true) { scl_report_result = yesno; } void setRowCliqueReport(bool yesno = true) { rcl_report_result = yesno; } void setDoStarClique(bool yesno = true) { do_star_clique = yesno; } void setDoRowClique(bool yesno = true) { do_row_clique = yesno; } void setMinViolation(double minviol) { petol = minviol; } double getMinViolation() const { return petol; } private: struct frac_graph ; friend struct frac_graph ; /** A node of the fractional graph. There is a node for every variable at fractional level. */ struct fnode { /** pointer into all_nbr */ int *nbrs; /** 1-x_i-x_j, needed for odd holes, in the same order as the adj list, pointer into all_edgecost */ double *edgecosts; /** degree of the node */ int degree; /** the fractional value of the variable corresponding to this node */ double val; }; /** A graph corresponding to a fractional solution of an LP. Two nodes are adjacent iff their columns are non-orthogonal. */ struct frac_graph { /** # of nodes = # of fractional values in the LP solution */ int nodenum; /** # of edges in the graph */ int edgenum; /** density= edgenum/(nodenum choose 2) */ double density; int min_deg_node; int min_degree; int max_deg_node; int max_degree; /** The array of the nodes in the graph */ fnode *nodes; /** The array of all the neighbors. First the indices of the nodes adjacent to node 0 are listed, then those adjacent to node 1, etc. */ int *all_nbr; /** The array of the costs of the edges going to the neighbors */ double *all_edgecost; frac_graph() : nodenum(0), edgenum(0), density(0), min_deg_node(0), min_degree(0), max_deg_node(0), max_degree(0), nodes(0), all_nbr(0), all_edgecost(0) {} }; protected: /** An indicator showing whether the whole matrix in the solverinterface is a set packing problem or not */ bool setPacking_; /// True if just look at original rows bool justOriginalRows_; /** pieces of the set packing part of the solverinterface */ int sp_numrows; int* sp_orig_row_ind; int sp_numcols; int* sp_orig_col_ind; double* sp_colsol; int* sp_col_start; int* sp_col_ind; int* sp_row_start; int* sp_row_ind; /** the intersection graph corresponding to the set packing problem */ frac_graph fgraph; /** the node-node incidence matrix of the intersection graph. */ bool* node_node; /** The primal tolerance in the solverinterface. */ double petol; /** data for the star clique algorithm */ /** Parameters */ /**@{*/ /** whether to do the row clique algorithm or not. */ bool do_row_clique; /** whether to do the star clique algorithm or not. */ bool do_star_clique; /** How the next node to be added to the star clique should be selected */ scl_next_node_method scl_next_node_rule; /** In the star clique method the maximal length of the candidate list (those nodes that are in a star, i.e., connected to the center of the star) to allow complete enumeration of maximal cliques. Otherwise a greedy algorithm is used. */ int scl_candidate_length_threshold; /** whether to give a detailed statistics on the star clique method */ bool scl_report_result; /** In the row clique method the maximal length of the candidate list (those nodes that can extend the row clique, i.e., connected to all nodes in the row clique) to allow complete enumeration of maximal cliques. Otherwise a greedy algorithm is used. */ int rcl_candidate_length_threshold; /** whether to give a detailed statistics on the row clique method */ bool rcl_report_result; /**@}*/ /** variables/arrays that are used across many methods */ /**@{*/ /** List of indices that must be in the to be created clique. This is just a pointer, it is never new'd and therefore does not need to be delete[]'d either. */ const int* cl_perm_indices; /** The length of cl_perm_indices */ int cl_perm_length; /** List of indices that should be considered for extending the ones listed in cl_perm_indices. */ int* cl_indices; /** The length of cl_indices */ int cl_length; /** An array of nodes discarded from the candidate list. These are rechecked when a maximal clique is found just to make sure that the clique is really maximal. */ int* cl_del_indices; /** The length of cl_del_indices */ int cl_del_length; /**@}*/ private: /** Scan through the variables and select those that are binary and are at a fractional level. */ void selectFractionalBinaries(const OsiSolverInterface& si); /** Scan through the variables and select those that are at a fractional level. We already know that everything is binary. */ void selectFractionals(const OsiSolverInterface& si); /** */ void selectRowCliques(const OsiSolverInterface& si,int numOriginalRows); /** */ void createSetPackingSubMatrix(const OsiSolverInterface& si); /** */ void createFractionalGraph(); /** */ int createNodeNode(); /** */ void deleteSetPackingSubMatrix(); /** */ void deleteFractionalGraph(); /** */ void find_scl(OsiCuts& cs); /** */ void find_rcl(OsiCuts& cs); /** */ int scl_choose_next_node(const int current_nodenum, const int *current_indices, const int *current_degrees, const double *current_values); /** */ void scl_delete_node(const int del_ind, int& current_nodenum, int *current_indices, int *current_degrees, double *current_values); /** */ int enumerate_maximal_cliques(int& pos, bool* scl_label, OsiCuts& cs); /** */ int greedy_maximal_clique(OsiCuts& cs); /** */ void recordClique(const int len, int* indices, OsiCuts& cs); }; //############################################################################# /** A function that tests the methods in the CglClique class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglCliqueUnitTest(const OsiSolverInterface * siP, const std::string mpdDir); /// This works on a fake solver i.e. invented rows class CglProbing; class CglFakeClique : public CglClique { public: /// Copy constructor CglFakeClique(const CglFakeClique& rhs); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglFakeClique& operator=(const CglFakeClique& rhs); virtual void generateCuts(const OsiSolverInterface& si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /**@name Constructors and destructors */ //@{ /** Default constructor. If the setPacking argument is set to true then CglFakeClique will assume that the problem in the solverinterface passed to the generateCuts() method describes a set packing problem, i.e., - all variables are binary - the matrix is a 0-1 matrix - all constraints are '= 1' or '<= 1' Otherwise the user can use the considerRows() method to set the list of clique rows, that is, - all coeffs corresponding to binary variables at fractional level is 1 - all other coeffs are non-negative - the constraint is '= 1' or '<= 1'. If the user does not set the list of clique rows then CglFakeClique will start the generateCuts() methods by scanning the matrix for them. */ CglFakeClique(OsiSolverInterface * solver=NULL,bool setPacking = false); /// Destructor virtual ~CglFakeClique(); /// Assign solver (generator takes over ownership) void assignSolver(OsiSolverInterface * fakeSolver); protected: /// fake solver to use OsiSolverInterface * fakeSolver_; /// Probing object CglProbing * probing_; }; #endif Cgl-0.58.9/src/CglClique/CglClique.cpp0000644000076600007660000007124512130104734016017 0ustar coincoin// $Id: CglClique.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 "CoinHelperFunctions.hpp" #include "OsiCuts.hpp" #include "OsiRowCut.hpp" #include "CglClique.hpp" /*****************************************************************************/ CglClique::CglClique(bool setPacking, bool justOriginalRows) : CglCutGenerator(), setPacking_(setPacking), justOriginalRows_(justOriginalRows), sp_numrows(0), sp_orig_row_ind(0), sp_numcols(0), sp_orig_col_ind(0), sp_colsol(0), sp_col_start(0), sp_col_ind(0), sp_row_start(0), sp_row_ind(0), node_node(0), petol(-1.0), do_row_clique(true), do_star_clique(true), scl_next_node_rule(SCL_MAX_XJ_MAX_DEG), scl_candidate_length_threshold(12), scl_report_result(true), rcl_candidate_length_threshold(12), rcl_report_result(true), cl_perm_indices(0), cl_perm_length(0), cl_indices(0), cl_length(0), cl_del_indices(0), cl_del_length(0) {} // Copy constructor CglClique::CglClique(const CglClique& rhs) : CglCutGenerator(rhs), setPacking_(rhs.setPacking_), justOriginalRows_(rhs.justOriginalRows_), sp_numrows(rhs.sp_numrows), sp_orig_row_ind(rhs.sp_orig_row_ind), sp_numcols(rhs.sp_numcols), sp_orig_col_ind(rhs.sp_orig_col_ind), sp_colsol(rhs.sp_colsol), sp_col_start(rhs.sp_col_start), sp_col_ind(rhs.sp_col_ind), sp_row_start(rhs.sp_row_start), sp_row_ind(rhs.sp_row_ind), node_node(rhs.node_node), petol(rhs.petol), do_row_clique(rhs.do_row_clique), do_star_clique(rhs.do_star_clique), scl_next_node_rule(rhs.scl_next_node_rule), scl_candidate_length_threshold(rhs.scl_candidate_length_threshold), scl_report_result(rhs.scl_report_result), rcl_candidate_length_threshold(rhs.rcl_candidate_length_threshold), rcl_report_result(rhs.rcl_report_result), cl_perm_indices(rhs.cl_perm_indices), cl_perm_length(rhs.cl_perm_length), cl_indices(rhs.cl_indices), cl_length(rhs.cl_length), cl_del_indices(rhs.cl_del_indices), cl_del_length(rhs.cl_del_length) { } /*****************************************************************************/ /*****************************************************************************/ void CglClique::generateCuts(const OsiSolverInterface& si, OsiCuts & cs, const CglTreeInfo info) { int i; bool has_petol_set = petol != -1.0; if (! has_petol_set) si.getDblParam(OsiPrimalTolerance, petol); int numberOriginalRows = si.getNumRows(); if (info.inTree&&justOriginalRows_) numberOriginalRows = info.formulation_rows; int numberRowCutsBefore = cs.sizeRowCuts(); // First select which rows/columns we are interested in. if (!setPacking_) { selectFractionalBinaries(si); if (!sp_orig_row_ind) { selectRowCliques(si,numberOriginalRows); } } else { selectFractionals(si); delete[] sp_orig_row_ind; sp_numrows = numberOriginalRows; //sp_numcols = si.getNumCols(); sp_orig_row_ind = new int[sp_numrows]; for (i = 0; i < sp_numrows; ++i) sp_orig_row_ind[i] = i; } // Just original rows if (justOriginalRows_&&info.inTree) sp_numrows = CoinMin(info.formulation_rows,sp_numrows); createSetPackingSubMatrix(si); fgraph.edgenum = createNodeNode(); createFractionalGraph(); cl_indices = new int[sp_numcols]; cl_del_indices = new int[sp_numcols]; if (do_row_clique) find_rcl(cs); if (do_star_clique) find_scl(cs); if (!info.inTree&&((info.options&4)==4||((info.options&8)&&!info.pass))) { int numberRowCutsAfter = cs.sizeRowCuts(); for (int i=numberRowCutsBefore;isetGloballyValid(); } delete[] cl_indices; cl_indices = 0; delete[] cl_del_indices; cl_del_indices = 0; deleteFractionalGraph(); delete[] node_node; node_node = 0; deleteSetPackingSubMatrix(); if (! has_petol_set) petol = -1; } /*****************************************************************************/ /*===========================================================================* * Find violated row cliques. * * Algorithm: For each row of the matrix collect all variables not in the * row's support that are non-orthogonal to all variables in the row. These * variables form a candidate set in which we look for maximal cliques * (enumerate all or try to find one greedily, depending on the size of the * candidate set). When a violated maximal clique is found, it is recorded in * the cut set. *===========================================================================*/ void CglClique::find_rcl(OsiCuts& cs) { const int nodenum = fgraph.nodenum; const fnode *nodes = fgraph.nodes; /* A flag for each column that might be used to extend the current row clique */ bool *cand = new bool[nodenum]; /* In cl_indices we'll list the indices of the 'true' entries in cand */ /* The degree of each candidate (those listed in cl_indices) */ int *degrees = new int[nodenum]; /** An array used in the recursive complete enumeration of maximal cliques. The first cl_length entries are used. */ bool* label = new bool[nodenum]; int i, j, k; /* initialize global variables */ cl_del_length = 0; cl_length = 0; int clique_count = 0; int largest_length = 0; /* for each row of the matrix */ for (j = 0; j < sp_numrows; j++) { /* if the row is of zero length, take the next row */ const int len = sp_row_start[j+1] - sp_row_start[j]; if (!len) continue; /* the beginning of the row to be considered */ const int *row = sp_row_ind + sp_row_start[j]; /* copy the row of node_node corresponding to the first column in 'row' into cand, and take the AND of this vector with every row of node_node corresponding to the rest of the columns in 'row' to determine those columns that are non-orthog to every column in row */ std::copy(node_node + row[0]*nodenum, node_node + (row[0]+1)*nodenum, cand); for (i = 1; i < len; i++) { const bool* node_node_col = node_node + row[i] * nodenum; for (k = 0; k < nodenum; k++) cand[k] &= node_node_col[k]; } cl_length = 0; for (k = 0; k < nodenum; k++) if (cand[k]) cl_indices[cl_length++] = k; largest_length = CoinMax(cl_length, largest_length); /* if there is anything in indices, enumerate (or greedily find) maximal cliques */ if (cl_length > 0) { cl_perm_length = len; cl_perm_indices = row; if (cl_length <= rcl_candidate_length_threshold) { for (i = 0; i < cl_length; i++) label[i] = false; int pos = 0; clique_count += enumerate_maximal_cliques(pos, label, cs); } else { /* order cl_indices into decreasing order of their degrees */ for (i = 0; i < cl_length; i++) degrees[i] = nodes[cl_indices[i]].degree; CoinSort_2(degrees, degrees + cl_length, cl_indices, CoinFirstGreater_2()); clique_count += greedy_maximal_clique(cs); } } } if (rcl_report_result) { printf("\nrcl Found %i new violated cliques with the row-clique method", clique_count); printf("\nrcl The largest admissible number was %i (threshold %i)\n", largest_length, rcl_candidate_length_threshold); if (largest_length < rcl_candidate_length_threshold) printf("rcl all row cliques have been enumerated\n"); else printf("rcl not all row cliques have been eliminated\n"); } delete[] degrees; delete[] cand; delete[] label; } /*****************************************************************************/ /*===========================================================================* * Find violated star cliques, a la Hoffman-Padberg. * * Algorithm: Take min degree node. Check for violated cuts in the subgraph * consisting of this node and its neighbors (the "star" of this node). Then * delete the node and continue with the now min degree node. * * Implementation: Two arrays are defined, one contains the indices the other * the degrees of all the nodes still in the graph. If the min degree is 0 * or 1 then the min degree node can be deleted at once. * All cliques are enumerated in v U star(v) if the min degree is smaller * than the threshold scl_candidate_length_threshold, otherwise attemp to * find maximal clique greedily. * * Note: Indices in current_indices are always kept in increasing order. *===========================================================================*/ void CglClique::find_scl(OsiCuts& cs) { const int nodenum = fgraph.nodenum; const fnode *nodes = fgraph.nodes; // Return at once if no nodes - otherwise we get invalid reads if (!nodenum) return; int *current_indices = new int[nodenum]; int *current_degrees = new int[nodenum]; double *current_values = new double[nodenum]; int *star = cl_indices; int *star_deg = new int[nodenum]; /** An array used in the recursive complete enumeration of maximal cliques. The first cl_length entries are used. */ bool* label = new bool[nodenum]; int i, cnt1 = 0, cnt2 = 0, cnt3 = 0; int clique_cnt_e = 0, clique_cnt_g = 0; int largest_star_size = 0; /* initialize global variables */ cl_del_length = 0; /* initialize current_nodes, current_degrees and current_values */ int current_nodenum = nodenum; for (i = 0; i < nodenum; i++) { current_indices[i] = i; current_degrees[i] = nodes[i].degree; current_values[i] = nodes[i].val; } /* find first node to be checked */ int best_ind = scl_choose_next_node(current_nodenum, current_indices, current_degrees, current_values); int v = current_indices[best_ind]; int v_deg = current_degrees[best_ind]; double v_val = current_values[best_ind]; /* while there are nodes left in the graph ... (more precisely, while there are at least 3 nodes in the graph) */ while (current_nodenum > 2) { /* if the best node is of degree < 2 then it can be deleted */ if (v_deg < 2) { cl_del_indices[cl_del_length++] = v; scl_delete_node(best_ind, current_nodenum, current_indices, current_degrees, current_values); best_ind = scl_choose_next_node(current_nodenum, current_indices, current_degrees, current_values); v = current_indices[best_ind]; v_deg = current_degrees[best_ind]; v_val = current_values[best_ind]; largest_star_size = CoinMax(largest_star_size, v_deg); continue; } /* star will contain the indices of v's neighbors (but not v's index) */ const bool* node_node_start = node_node + nodenum * v; int& star_length = cl_length; star_length = 0; double star_val = v_val; for (i = 0; i < current_nodenum; i++) { const int other_node = current_indices[i]; if (node_node_start[other_node]) { star[star_length] = other_node; star_deg[star_length++] = current_degrees[i]; star_val += current_values[i]; } } /* quick check: if sum of values for the star does not exceed 1 then there won't be a violated clique in the star */ if (star_val >= 1 + petol) { /* node whose star we're evaluating is always in */ cl_perm_length = 1; cl_perm_indices = &v; /* find maximal violated cliques in star. cliques found here might not be maximal wrt to entire fractional graph, only for the current subset of it (some nodes might be already deleted...) Note that star is the same as cl_indices and start_length is cl_length... */ if (v_deg < scl_candidate_length_threshold) { // par /* enumerate if v_deg is small enough */ for (i = 0; i < star_length; i++) label[i] = false; int pos = 0; clique_cnt_e += enumerate_maximal_cliques(pos, label, cs); cnt1++; } else { /* greedily find if v_deg is too big */ /* order nodes in *decreasing* order of their degrees in star */ CoinSort_2(star_deg, star_deg + star_length, star, CoinFirstGreater_2()); /* find maxl clique greedily, including v */ clique_cnt_g += greedy_maximal_clique(cs); cnt2++; } } else { cnt3++; } /* delete v from current_indices */ cl_del_indices[cl_del_length++] = v; scl_delete_node(best_ind, current_nodenum, current_indices, current_degrees, current_values); best_ind = scl_choose_next_node(current_nodenum, current_indices, current_degrees, current_values); v = current_indices[best_ind]; v_deg = current_degrees[best_ind]; v_val = current_values[best_ind]; largest_star_size = CoinMax(largest_star_size, v_deg); } const int clique_cnt = clique_cnt_e + clique_cnt_g; if (scl_report_result) { printf("\nscl Found %i new violated cliques with the star-clique method", clique_cnt); printf("\nscl The largest star size was %i (threshold %i)\n", largest_star_size, scl_candidate_length_threshold); // par printf("scl Enumeration %i times, found %i maxl cliques\n", cnt1, clique_cnt_e); printf("scl Greedy %i times, found %i maxl cliques\n", cnt2, clique_cnt_g); printf("scl Skipped a star b/c of small solution value %i times\n", cnt3); if (cnt2 == 0) printf("scl all cliques have been enumerated\n"); else printf("scl not all cliques have been eliminated\n"); } delete[] current_indices; delete[] current_degrees; delete[] current_values; delete[] star_deg; delete[] label; } /*****************************************************************************/ /*===========================================================================* * returns the index of the "best" node wrt current_indices, etc. *===========================================================================*/ int CglClique::scl_choose_next_node(const int current_nodenum, const int * /* current_indices */, const int *current_degrees, const double *current_values) { int best = 0; int best_deg = current_degrees[0]; double best_val = current_values[0]; int i; switch (scl_next_node_rule) { // p->par.scl_which_node case SCL_MIN_DEGREE: // NOTE: could use stl::min_element for (i = 1; i < current_nodenum; i++) if (current_degrees[i] < best_deg) { best = i; best_deg = current_degrees[i]; } break; case SCL_MAX_DEGREE: // NOTE: could use stl::max_element for (i = 1; i < current_nodenum; i++) if (current_degrees[i] > best_deg) { best = i; best_deg = current_degrees[i]; } break; case SCL_MAX_XJ_MAX_DEG: for (i = 1; i < current_nodenum; i++) { if (current_values[i] > best_val) { best = i; best_val = current_values[i]; best_deg = current_degrees[i]; } else if (current_values[i] == best_val && current_degrees[i] > best_deg) { best = i; best_deg = current_degrees[i]; } } break; default: printf("ERROR: bad starcl_which_node (in scl_choose_next_node\n"); break; } return(best); } /*****************************************************************************/ /*===========================================================================* * Delete the node of index del_ind (this index is wrt current_indices) from * the list current_indices (current_degrees and current_values) and based on * the graph stored in fgraph decrease the degrees of its neighbors. * * There are at least 3 nodes in the graph when this function is invoked. * * Note that the node indices in current_indices are in increasing order, * and that this ordering is maintained here. * * fgraph: IN, pointer to the fractional graph * node_node: IN, node_node incidence matrix * del_ind: IN, the index of the node to be deleted (wrt to current_indices) * pcurrent_nodenum: INOUT, pointer to the current number of nodes * current_indices: INOUT, array of current node indices * current_degrees: INOUT, array of current node degrees, in the dame order * as in current_indices * current_values: INOUT, array of solution values *===========================================================================*/ void CglClique::scl_delete_node(const int del_ind, int& current_nodenum, int *current_indices, int *current_degrees, double *current_values) { const int v = current_indices[del_ind]; /* delete the entry corresponding to del_ind from current_indices, current_degrees and current_values */ memmove(reinterpret_cast(current_indices + del_ind), reinterpret_cast(current_indices + (del_ind+1)), (current_nodenum-del_ind-1) * sizeof(int)); memmove(reinterpret_cast(current_degrees + del_ind), reinterpret_cast(current_degrees + (del_ind+1)), (current_nodenum-del_ind-1) * sizeof(int)); memmove(reinterpret_cast(current_values + del_ind), reinterpret_cast(current_values + (del_ind+1)), (current_nodenum-del_ind-1) * sizeof(double)); current_nodenum--; /* decrease the degrees of v's neighbors by 1 */ const bool* node_node_start = node_node + (fgraph.nodenum * v); for (int i = 0; i < current_nodenum; ++i) if (node_node_start[current_indices[i]]) current_degrees[i]--; } /*****************************************************************************/ /*===========================================================================* * Enumerate all maximal cliques on the nodes in scl_indices. Maximal cliques * that are violated are added to the cut list. Returns the number of maximal * violated cliques found. The algorithm is recursive. * * Data members used from CglClique * fgraph: IN, the description of the intersection graph * cl_perm_length: IN, the length of cl_perm_indices * cl_perm_indices: IN, indices of nodes that MUST be in the clique, these * nodes are supposed to be connected to all nodes in * cl_indices * cl_length: IN, length of cl_indices and label * cl_indices: IN, indices of nodes on which maximal cliques are sought * cl_del_length: IN, length of cl_del_indices * cl_del_indices: IN, indices of nodes that are already deleted. these * nodes are tested whether they can be added to a max * clique discovered in scl_indices. if any of them can be * added then the clique is not maximal after all... * * Arguments: * label: INOUT, indicates which nodes are in the clique at the moment * pos: INOUT, position within cl_indices (and label), nodes up to * position pos in cl_indices are permanently labeled (backtrack cannot * change labels) *===========================================================================*/ int CglClique::enumerate_maximal_cliques(int& pos, bool* label, OsiCuts& cs) { const fnode *nodes = fgraph.nodes; const int nodenum = fgraph.nodenum; int i, j, k, cnt; /* starting from position pos, find the first node in cl_indices that can be added to the clique, and label it with true */ while (pos < cl_length) { label[pos] = true; const bool* node_node_start = node_node + cl_indices[pos] * nodenum; for (j = 0; j < pos; j++) if (label[j] && ! node_node_start[cl_indices[j]]) { label[pos] = false; break; } if (label[pos++] == true) break; } /* found counts the number of maximal violated cliques that have been sent to the lp under the current level of recursion */ int found = 0; /* if not all nodes are labeled: recurse by setting the last node labeled true once to true and once to false; otherwise check whether the clique found is maximal and violated */ if (pos < cl_length) { found += enumerate_maximal_cliques(pos, label, cs); label[pos-1] = false; found += enumerate_maximal_cliques(pos, label, cs); } else { /* check if the clique can be extended on cl_indices */ /* copy indices of the clique into coef (not user inds, coef is a tmp) */ int* coef = new int[cl_length + cl_perm_length]; for (j = cl_length - 1, cnt = 0; j >= 0; j--) if (label[j]) coef[cnt++] = cl_indices[j]; if (!cnt) { delete[] coef; return(found); } /* check if the clique can be extended on cl_indices */ for (k = cl_length - 1; k >= 0; k--) { if (!label[k]) { const bool* node_node_start = node_node + cl_indices[k] * nodenum; for (i = cnt - 1; i >= 0; i--) if (!node_node_start[coef[i]]) break; /* if k can be added to the clique, return (the clique is not maximal, so it will be or was recorded) */ if (i < 0) { delete[] coef; return(found); } } } /* now the clique is maximal on cl_indices. fill relative indices into coef */ for (j = 0; j < cl_perm_length; j++) coef[cnt++] = cl_perm_indices[j]; /* check if clique is violated */ double lhs = 0; for (j = 0; j < cnt; j++) lhs += nodes[coef[j]].val; if (lhs < 1 + petol) { delete[] coef; return(found); } /* if clique can be extended on cl_del_indices then it can be discarded (was already counted) */ for (i = 0; i < cl_del_length; i++) { const bool* node_node_start = node_node + cl_del_indices[i]*nodenum; for (j = cnt - 1; j >= 0; j--) if (!node_node_start[coef[j]]) break; /* if cl_del_indices[i] can be added to the clique, return */ if (j < 0) { delete[] coef; return(found); } } recordClique(cnt, coef, cs); delete[] coef; ++found; } return(found); } /*****************************************************************************/ /*===========================================================================* * Find a violated clique greedily in the given array of indices, starting * from pos. Return the number of violated cliques found (1 or 0). * This routine overwrites the array indices: those variables in the * clique will be shuffled to the beginning of the array (after pos). *===========================================================================*/ int CglClique::greedy_maximal_clique(OsiCuts& cs) { assert(cl_length > 0); const fnode *nodes = fgraph.nodes; const int nodenum = fgraph.nodenum; int i, j; int * coef = new int[cl_length + cl_perm_length]; coef[0] = cl_indices[0]; int cnt = 1; for (j = 1; j < cl_length; j++) { const int var = cl_indices[j]; const bool* node_node_start = node_node + var * nodenum; for (i = cnt-1; i >= 0; i--) if (!node_node_start[coef[i]]) break; if (i < 0) coef[cnt++] = var; } for (j = 0; j < cl_perm_length; j++) coef[cnt++] = cl_perm_indices[j]; /* now coef contains the clique */ /* only cliques of size at least 3 are interesting */ if (cnt < 3) { delete[] coef; return(0); } /* compute lhs */ double lhs = 0; for (j = 0; j < cnt; j++) lhs += nodes[coef[j]].val; if (lhs > 1 + petol) { recordClique(cnt, coef, cs); delete[] coef; return(1); } delete[] coef; return(0); } /*****************************************************************************/ /*===========================================================================* *===========================================================================*/ void CglClique::recordClique(const int len, int* indices, OsiCuts& cs) { /* transform relative indices into user indices and order them */ for (int j = len - 1; j >= 0; j--) indices[j] = sp_orig_col_ind[indices[j]]; std::sort(indices, indices + len); OsiRowCut rowcut; double* coef = new double[len]; std::fill(coef, coef + len, 1.0); rowcut.setRow(len, indices, coef); rowcut.setUb(1.0); CoinAbsFltEq equal(1.0e-12); cs.insertIfNotDuplicate(rowcut,equal); delete[] coef; } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglClique::clone() const { return new CglClique(*this); } /*****************************************************************************/ // Create C++ lines to get to current state std::string CglClique::generateCpp( FILE * fp) { CglClique other; fprintf(fp,"0#include \"CglClique.hpp\"\n"); fprintf(fp,"3 CglClique clique;\n"); std::string types[] = {"SCL_MIN_DEGREE","SCL_MAX_DEGREE", "SCL_MAX_XJ_MAX_DEG"}; if (scl_next_node_rule!=other.scl_next_node_rule) fprintf(fp,"3 clique.setStarCliqueNextNodeMethod(CglClique::%s);\n", types[scl_next_node_rule].c_str()); else fprintf(fp,"4 clique.setStarCliqueNextNodeMethod(CglClique::%s);\n", types[scl_next_node_rule].c_str()); if (scl_candidate_length_threshold!=other.scl_candidate_length_threshold) fprintf(fp,"3 clique.setStarCliqueCandidateLengthThreshold(%d);\n", scl_candidate_length_threshold); else fprintf(fp,"4 clique.setStarCliqueCandidateLengthThreshold(%d);\n", scl_candidate_length_threshold); if (rcl_candidate_length_threshold!=other.rcl_candidate_length_threshold) fprintf(fp,"3 clique.setRowCliqueCandidateLengthThreshold(%d);\n", rcl_candidate_length_threshold); else fprintf(fp,"4 clique.setRowCliqueCandidateLengthThreshold(%d);\n", rcl_candidate_length_threshold); if (scl_report_result!=other.scl_report_result) fprintf(fp,"3 clique.setStarCliqueReport(%s);\n", scl_report_result ? "true" : "false"); else fprintf(fp,"4 clique.setStarCliqueReport(%s);\n", scl_report_result ? "true" : "false"); if (rcl_report_result!=other.rcl_report_result) fprintf(fp,"3 clique.setRowCliqueReport(%s);\n", rcl_report_result ? "true" : "false"); else fprintf(fp,"4 clique.setRowCliqueReport(%s);\n", rcl_report_result ? "true" : "false"); if (do_star_clique!=other.do_star_clique) fprintf(fp,"3 clique.setDoStarClique(%s);\n", do_star_clique ? "true" : "false"); else fprintf(fp,"4 clique.setDoStarClique(%s);\n", do_star_clique ? "true" : "false"); if (do_row_clique!=other.do_row_clique) fprintf(fp,"3 clique.setDoRowClique(%s);\n", do_row_clique ? "true" : "false"); else fprintf(fp,"4 clique.setDoRowClique(%s);\n", do_row_clique ? "true" : "false"); if (petol!=other.petol) fprintf(fp,"3 clique.setMinViolation(%g);\n",petol); else fprintf(fp,"4 clique.setMinViolation(%g);\n",petol); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 clique.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 clique.setAggressiveness(%d);\n",getAggressiveness()); return "clique"; } /*****************************************************************************/ #include "../CglProbing/CglProbing.hpp" CglFakeClique::CglFakeClique(OsiSolverInterface * solver, bool setPacking) : CglClique(setPacking,true) { if (solver) fakeSolver_ = solver->clone(); else fakeSolver_ = NULL; if (fakeSolver_) { probing_ = new CglProbing(); probing_->refreshSolver(fakeSolver_); } else { probing_ = NULL; } } // Copy constructor CglFakeClique::CglFakeClique(const CglFakeClique& rhs) : CglClique(rhs) { if (rhs.fakeSolver_) { fakeSolver_ = rhs.fakeSolver_->clone(); probing_ = new CglProbing(*rhs.probing_); probing_->refreshSolver(fakeSolver_); } else { fakeSolver_ = NULL; probing_ = NULL; } } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglFakeClique::clone() const { return new CglFakeClique(*this); } // Destructor CglFakeClique::~CglFakeClique() { delete fakeSolver_; delete probing_; } // Assign solver (generator takes over ownership) void CglFakeClique::assignSolver(OsiSolverInterface * fakeSolver) { delete fakeSolver_; fakeSolver_ = fakeSolver; if (fakeSolver_) { delete [] sp_orig_row_ind; sp_orig_row_ind=NULL; } if (probing_) probing_->refreshSolver(fakeSolver_); } // Generate cuts void CglFakeClique::generateCuts(const OsiSolverInterface& si, OsiCuts & cs, const CglTreeInfo info) { if (fakeSolver_) { assert (si.getNumCols()==fakeSolver_->getNumCols()); fakeSolver_->setColLower(si.getColLower()); fakeSolver_->setColSolution(si.getColSolution()); fakeSolver_->setColUpper(si.getColUpper()); CglClique::generateCuts(*fakeSolver_,cs,info); if (probing_) { // get and set branch and bound cutoff double cutoff; si.getDblParam(OsiDualObjectiveLimit,cutoff); fakeSolver_->setDblParam(OsiDualObjectiveLimit,cutoff); probing_->generateCuts(*fakeSolver_,cs,info); } } else { // just use real solver CglClique::generateCuts(si,cs,info); } } Cgl-0.58.9/src/CglClique/CglCliqueHelper.cpp0000644000076600007660000002772312130104734017161 0ustar coincoin// $Id: CglCliqueHelper.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 "CoinPackedMatrix.hpp" #include "OsiSolverInterface.hpp" #include "CglClique.hpp" /*****************************************************************************/ /*===========================================================================* Scan through the variables and select those that are binary and are at a fractional level. *===========================================================================*/ void CglClique::selectFractionalBinaries(const OsiSolverInterface& si) { // extract the primal tolerance from the solver double lclPetol = 0.0; si.getDblParam(OsiPrimalTolerance, lclPetol); const int numcols = si.getNumCols(); if (petol<0.0) { // do all if not too many int n=0; for (int i = 0; i < numcols; ++i) { if (si.isBinary(i)) n++; } if (n<5000) lclPetol=-1.0e-5; } const double* x = si.getColSolution(); std::vector fracind; int i; for (i = 0; i < numcols; ++i) { if (si.isBinary(i) && x[i] > lclPetol && x[i] < 1-petol) fracind.push_back(i); } sp_numcols = static_cast(fracind.size()); sp_orig_col_ind = new int[sp_numcols]; sp_colsol = new double[sp_numcols]; for (i = 0; i < sp_numcols; ++i) { sp_orig_col_ind[i] = fracind[i]; sp_colsol[i] = x[fracind[i]]; } } /*****************************************************************************/ /*===========================================================================* Scan through the variables and select those that are at a fractional level. We already know that everything is binary. *===========================================================================*/ void CglClique::selectFractionals(const OsiSolverInterface& si) { // extract the primal tolerance from the solver double lclPetol = 0.0; si.getDblParam(OsiPrimalTolerance, lclPetol); const int numcols = si.getNumCols(); const double* x = si.getColSolution(); std::vector fracind; int i; for (i = 0; i < numcols; ++i) { if (x[i] > lclPetol && x[i] < 1-lclPetol) fracind.push_back(i); } sp_numcols = static_cast(fracind.size()); sp_orig_col_ind = new int[sp_numcols]; sp_colsol = new double[sp_numcols]; for (i = 0; i < sp_numcols; ++i) { sp_orig_col_ind[i] = fracind[i]; sp_colsol[i] = x[fracind[i]]; } } /*****************************************************************************/ /*===========================================================================* *===========================================================================*/ void CglClique::selectRowCliques(const OsiSolverInterface& si,int numOriginalRows) { const int numrows = si.getNumRows(); std::vector clique(numrows, 1); int i, j, k; // First scan through the binary fractional variables and see where do they // have a 1 coefficient const CoinPackedMatrix& mcol = *si.getMatrixByCol(); for (j = 0; j < sp_numcols; ++j) { const CoinShallowPackedVector& vec = mcol.getVector(sp_orig_col_ind[j]); const int* ind = vec.getIndices(); const double* elem = vec.getElements(); for (i = vec.getNumElements() - 1; i >= 0; --i) { if (elem[i] != 1.0) { clique[ind[i]] = 0; } } } // Now check the sense and rhs (by checking rowupper) and the rest of the // coefficients const CoinPackedMatrix& mrow = *si.getMatrixByRow(); const double* rub = si.getRowUpper(); for (i = 0; i < numrows; ++i) { if (rub[i] != 1.0||i>=numOriginalRows) { clique[i] = 0; continue; } if (clique[i] == 1) { const CoinShallowPackedVector& vec = mrow.getVector(i); const double* elem = vec.getElements(); for (j = vec.getNumElements() - 1; j >= 0; --j) { if (elem[j] < 0) { clique[i] = 0; break; } } } } // Finally collect the still standing rows into sp_orig_row_ind sp_numrows = std::accumulate(clique.begin(), clique.end(), 0); sp_orig_row_ind = new int[sp_numrows]; for (i = 0, k = 0; i < numrows; ++i) { if (clique[i] == 1) { sp_orig_row_ind[k++] = i; } } } /*****************************************************************************/ /*===========================================================================* Create the set packing submatrix *===========================================================================*/ void CglClique::createSetPackingSubMatrix(const OsiSolverInterface& si) { sp_col_start = new int[sp_numcols+1]; sp_row_start = new int[sp_numrows+1]; std::fill(sp_col_start, sp_col_start + (sp_numcols+1), 0); std::fill(sp_row_start, sp_row_start + (sp_numrows+1), 0); int i, j; const CoinPackedMatrix& mcol = *si.getMatrixByCol(); const int numrows = si.getNumRows(); int* clique = new int[numrows]; std::fill(clique, clique+numrows, -1); for (i = 0; i < sp_numrows; ++i) clique[sp_orig_row_ind[i]] = i; for (j = 0; j < sp_numcols; ++j) { const CoinShallowPackedVector& vec = mcol.getVector(sp_orig_col_ind[j]); const int* ind = vec.getIndices(); for (i = vec.getNumElements() - 1; i >= 0; --i) { if (clique[ind[i]] >= 0) { ++sp_col_start[j]; ++sp_row_start[clique[ind[i]]]; } } } std::partial_sum(sp_col_start, sp_col_start+sp_numcols, sp_col_start); std::rotate(sp_col_start, sp_col_start+sp_numcols, sp_col_start + (sp_numcols+1)); std::partial_sum(sp_row_start, sp_row_start+sp_numrows, sp_row_start); std::rotate(sp_row_start, sp_row_start+sp_numrows, sp_row_start + (sp_numrows+1)); const int nzcnt = sp_col_start[sp_numcols]; assert(nzcnt == sp_row_start[sp_numrows]); /* Now create the vectors with row indices for each column (sp_col_ind) and column indices for each row (sp_row_ind). It turns out that CoinIsOrthogonal assumes that the row indices for a given column are listed in ascending order. This is *not* a solver-independent assumption! At best, one can hope that the underlying solver will produce an index vector that's either ascending or descending. Under that assumption, compare the first and last entries and proceed accordingly. Eventually some solver will come along that hands back an index vector in random order, and CoinIsOrthogonal will break. Until then, try and avoid the cost of a sort. */ sp_col_ind = new int[nzcnt]; sp_row_ind = new int[nzcnt]; int last=0; for (j = 0; j < sp_numcols; ++j) { const CoinShallowPackedVector& vec = mcol.getVector(sp_orig_col_ind[j]); const int len = vec.getNumElements(); const int* ind = vec.getIndices(); if (ind[0] < ind[len-1]) { for (i = 0; i < len; ++i) { const int sp_row = clique[ind[i]]; if (sp_row >= 0) { sp_col_ind[sp_col_start[j]++] = sp_row; sp_row_ind[sp_row_start[sp_row]++] = j; } } } else { for (i = len-1; i >= 0; --i) { const int sp_row = clique[ind[i]]; if (sp_row >= 0) { sp_col_ind[sp_col_start[j]++] = sp_row; sp_row_ind[sp_row_start[sp_row]++] = j; } } } // sort std::sort(sp_col_ind+last,sp_col_ind+sp_col_start[j]); last=sp_col_start[j]; } std::rotate(sp_col_start, sp_col_start+sp_numcols, sp_col_start + (sp_numcols+1)); sp_col_start[0] = 0; std::rotate(sp_row_start, sp_row_start+sp_numrows, sp_row_start + (sp_numrows+1)); sp_row_start[0] = 0; delete[] clique; } /*****************************************************************************/ static inline bool CoinIsOrthogonal(const int* first0, const int* last0, const int* first1, const int* last1) { while (first0 != last0 && first1 != last1) { if (*first0 == *first1) return false; if (*first0 < *first1) ++first0; else ++first1; } return true; } /*===========================================================================* Build up the fractional graph *===========================================================================*/ void CglClique::createFractionalGraph() { // fgraph.edgenum is filled when createNodeNode is invoked fgraph.nodenum = sp_numcols; fgraph.all_nbr = new int[2*fgraph.edgenum]; fgraph.nodes = new fnode[sp_numcols+1]; int *all_nbr = fgraph.all_nbr; fnode *nodes = fgraph.nodes; int min_degree, max_degree, min_deg_node, max_deg_node; # ifdef ZEROFAULT // May be read below even if sp_numcols == 0 nodes[0].degree = 0 ; # endif int i, j, total_deg, old_total; /*========================================================================* Construct the adjacency lists (neighbors) of the nodes in fgraph. Two nodes are adjacent iff the columns corresponding to them are non-orthogonal. *========================================================================*/ for ( i = 0, total_deg = 0; i < sp_numcols; i++ ) { old_total = total_deg; const bool* node_node_i = node_node + i * sp_numcols; for ( j = 0; j < sp_numcols; j++ ) { if ( node_node_i[j] ) { all_nbr[total_deg++] = j; } } nodes[i].val = sp_colsol[i]; nodes[i].degree = total_deg - old_total; nodes[i].nbrs = all_nbr + old_total; } fgraph.density = static_cast (total_deg) / (sp_numcols * (sp_numcols-1)); /*========================================================================* Compute the min and max degree. *========================================================================*/ min_deg_node = 0; max_deg_node = 0; min_degree = max_degree = nodes[0].degree; for ( i = 0; i < sp_numcols; i++ ) { if ( nodes[i].degree < min_degree ) { min_deg_node = i; min_degree = nodes[i].degree; } if ( nodes[i].degree > max_degree ) { max_deg_node = i; max_degree = nodes[i].degree; } } fgraph.min_degree = min_degree; fgraph.max_degree = max_degree; fgraph.min_deg_node = min_deg_node; fgraph.max_deg_node = max_deg_node; } /*****************************************************************************/ /*===========================================================================* * Construct the node-node incidence matrix from the fractional graph. *===========================================================================*/ int CglClique::createNodeNode() { node_node = new bool[sp_numcols * sp_numcols]; std::fill(node_node, node_node + sp_numcols * sp_numcols, false); int i, j; int edgenum = 0; for (i = 0; i < sp_numcols; ++i) { for (j = i+1; j < sp_numcols; ++j) { if (! CoinIsOrthogonal(sp_col_ind + sp_col_start[i], sp_col_ind + sp_col_start[i+1], sp_col_ind + sp_col_start[j], sp_col_ind + sp_col_start[j+1]) ) { node_node[i * sp_numcols + j] = true; node_node[j * sp_numcols + i] = true; ++edgenum; } } } return edgenum; } /*****************************************************************************/ /*===========================================================================* * Cleanup routines *===========================================================================*/ void CglClique::deleteSetPackingSubMatrix() { delete[] sp_orig_row_ind; sp_orig_row_ind = 0; delete[] sp_orig_col_ind; sp_orig_col_ind = 0; delete[] sp_colsol; sp_colsol = 0; delete[] sp_col_start; sp_col_start = 0; delete[] sp_col_ind; sp_col_ind = 0; delete[] sp_row_start; sp_row_start = 0; delete[] sp_row_ind; sp_row_ind = 0; } void CglClique::deleteFractionalGraph() { fgraph.nodenum = 0; fgraph.edgenum = 0; fgraph.density = 0; fgraph.min_deg_node = 0; fgraph.min_degree = 0; fgraph.max_deg_node = 0; fgraph.max_degree = 0; delete[] fgraph.all_nbr; fgraph.all_nbr = 0; delete[] fgraph.nodes; fgraph.nodes = 0; delete[] fgraph.all_edgecost; fgraph.all_edgecost = 0; } Cgl-0.58.9/src/CglClique/Makefile.am0000644000076600007660000000322711621724114015476 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglClique # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglClique.la # List all source files for this library, including headers libCglClique_la_SOURCES = \ CglClique.cpp CglClique.hpp \ CglCliqueHelper.cpp CglCliqueTest.cpp # This is for libtool (on Windows) libCglClique_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglClique.hpp Cgl-0.58.9/src/CglClique/Makefile.in0000644000076600007660000005416012240340055015505 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/CglClique 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglClique_la_LIBADD = am_libCglClique_la_OBJECTS = CglClique.lo CglCliqueHelper.lo \ CglCliqueTest.lo libCglClique_la_OBJECTS = $(am_libCglClique_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 = $(libCglClique_la_SOURCES) DIST_SOURCES = $(libCglClique_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglClique # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglClique.la # List all source files for this library, including headers libCglClique_la_SOURCES = \ CglClique.cpp CglClique.hpp \ CglCliqueHelper.cpp CglCliqueTest.cpp # This is for libtool (on Windows) libCglClique_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglClique.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/CglClique/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglClique/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglClique.la: $(libCglClique_la_OBJECTS) $(libCglClique_la_DEPENDENCIES) $(CXXLINK) $(libCglClique_la_LDFLAGS) $(libCglClique_la_OBJECTS) $(libCglClique_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglClique.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglCliqueHelper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglCliqueTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglClique/CglCliqueTest.cpp0000644000076600007660000000342512130104734016652 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 #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglClique.hpp" void CglCliqueUnitTest(const OsiSolverInterface *baseSiP, const std::string mpsDir) { // Test default constructor { CglClique aGenerator; } // Test copy & assignment { CglClique rhs; { CglClique bGenerator; CglClique cGenerator(bGenerator); //rhs=bGenerator; } } // Test get/set methods { CglClique getset; // None to test } // Test generateCuts { CglClique gct; OsiSolverInterface *siP = baseSiP->clone(); std::string fn = mpsDir+"l152lav"; std::string fn2 = mpsDir+"l152lav.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(),"mps"); siP->initialSolve(); double lpRelax = siP->getObjValue(); OsiCuts cs; gct.generateCuts(*siP, cs); int nRowCuts = cs.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cs); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); std::cout<<"Initial LP value: "< #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglMixedIntegerRounding2.hpp" void CglMixedIntegerRounding2UnitTest(const OsiSolverInterface *baseSiP, const std::string mpsDir) { // Test default constructor { CglMixedIntegerRounding2 aGenerator; } // Test copy & assignment { CglMixedIntegerRounding2 rhs; { CglMixedIntegerRounding2 bGenerator; CglMixedIntegerRounding2 cGenerator(bGenerator); rhs=bGenerator; } } // Test get/set methods { CglMixedIntegerRounding2 getset; int gagg = 10 * getset.getMAXAGGR_(); getset.setMAXAGGR_(gagg); int gagg2 = getset.getMAXAGGR_(); assert(gagg == gagg2); bool gmult = !getset.getMULTIPLY_(); getset.setMULTIPLY_(gmult); bool gmult2 = getset.getMULTIPLY_(); assert(gmult == gmult2); int gcrit = getset.getCRITERION_(); gcrit = (gcrit) % 3 + 1; getset.setCRITERION_(gcrit); int gcrit2 = getset.getCRITERION_(); assert(gcrit == gcrit2); int gpre = getset.getDoPreproc(); gpre = (gpre + 1) % 3 - 1; getset.setDoPreproc(gpre); int gpre2 = getset.getDoPreproc(); assert(gpre == gpre2); } // Test generateCuts { CglMixedIntegerRounding2 gct; OsiSolverInterface *siP = baseSiP->clone(); std::string fn = mpsDir+"capPlan1"; std::string fn2 = mpsDir+"capPlan1.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(),"mps"); siP->initialSolve(); double lpRelax = siP->getObjValue(); OsiCuts cs; gct.setDoPreproc(1); // Needed for DyLP gct.generateCuts(*siP, cs); int nRowCuts = cs.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cs); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); printf("Initial LP value: %f\n", lpRelax); printf("LP value with cuts: %f\n", lpRelaxAfter); assert( lpRelax < lpRelaxAfter ); assert(lpRelaxAfter < 964); } delete siP; } } Cgl-0.58.9/src/CglMixedIntegerRounding2/CglMixedIntegerRounding2.cpp0000644000076600007660000015240112130104734023675 0ustar coincoin// LAST EDIT: //----------------------------------------------------------------------------- // name: Mixed Integer Rounding Cut Generator // authors: Joao Goncalves (jog7@lehigh.edu) // Laszlo Ladanyi (ladanyi@us.ibm.com) // date: August 11, 2004 //----------------------------------------------------------------------------- // Copyright (C) 2004, International Business Machines Corporation and others. // All Rights Reserved. // This code is published under the Eclipse Public License. //#include //#include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedMatrix.hpp" #include "CoinPackedVector.hpp" #include "CglMixedIntegerRounding2.hpp" //----------------------------------------------------------------------------- // Generate Mixed Integer Rounding inequality //------------------------------------------------------------------- void CglMixedIntegerRounding2::generateCuts(const OsiSolverInterface& si, OsiCuts& cs, const CglTreeInfo info) { // If the LP or integer presolve is used, then need to redo preprocessing // everytime this function is called. Otherwise, just do once. bool preInit = false; bool preReso = false; si.getHintParam(OsiDoPresolveInInitial, preInit); si.getHintParam(OsiDoPresolveInResolve, preReso); if (preInit == false && preReso == false && doPreproc_ == -1 ) { // Do once if (doneInitPre_ == false) { mixIntRoundPreprocess(si); doneInitPre_ = true; } } else { if(doPreproc_ == 1){ // Do everytime mixIntRoundPreprocess(si); doneInitPre_ = true; } else { if (doneInitPre_ == false) { mixIntRoundPreprocess(si); doneInitPre_ = true; } } } int numberRowCutsBefore = cs.sizeRowCuts(); const double* xlp = si.getColSolution(); // LP solution const double* colUpperBound = si.getColUpper(); // vector of upper bounds const double* colLowerBound = si.getColLower(); // vector of lower bounds // get matrix by row const CoinPackedMatrix & tempMatrixByRow = *si.getMatrixByRow(); CoinPackedMatrix matrixByRow(false,0.0,0.0); // There are no duplicates but this is faster matrixByRow.submatrixOfWithDuplicates(tempMatrixByRow, numRows_, indRows_); CoinPackedMatrix matrixByCol(matrixByRow,0,0,true); //matrixByCol.reverseOrdering(); //const CoinPackedMatrix & matrixByRow = *si.getMatrixByRow(); const double* LHS = si.getRowActivity(); //const double* coefByRow = matrixByRow.getElements(); //const int* colInds = matrixByRow.getIndices(); //const int* rowStarts = matrixByRow.getVectorStarts(); // get matrix by column //const CoinPackedMatrix & matrixByCol = *si.getMatrixByCol(); const double* coefByCol = matrixByCol.getElements(); const int* rowInds = matrixByCol.getIndices(); const int* colStarts = matrixByCol.getVectorStarts(); generateMirCuts(si, xlp, colUpperBound, colLowerBound, matrixByRow, LHS, //coefByRow, //colInds, rowStarts, //matrixByCol, coefByCol, rowInds, colStarts, cs); if (!info.inTree&&((info.options&4)==4||((info.options&8)&&!info.pass))) { int numberRowCutsAfter = cs.sizeRowCuts(); for (int i=numberRowCutsBefore;isetGloballyValid(); } } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglMixedIntegerRounding2::CglMixedIntegerRounding2 () : CglCutGenerator() { gutsOfConstruct(1, true, 1, -1); } //------------------------------------------------------------------- // Alternate Constructor //------------------------------------------------------------------- CglMixedIntegerRounding2::CglMixedIntegerRounding2 (const int maxaggr, const bool multiply, const int criterion, const int preproc) : CglCutGenerator() { gutsOfConstruct(maxaggr, multiply, criterion, preproc); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglMixedIntegerRounding2::CglMixedIntegerRounding2 ( const CglMixedIntegerRounding2 & rhs) : CglCutGenerator(rhs) { gutsOfCopy(rhs); } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglMixedIntegerRounding2::clone() const { return new CglMixedIntegerRounding2(*this); } //------------------------------------------------------------------ // Assignment operator //------------------------------------------------------------------- CglMixedIntegerRounding2 & CglMixedIntegerRounding2::operator=(const CglMixedIntegerRounding2& rhs) { if (this != &rhs) { gutsOfDelete(); CglCutGenerator::operator=(rhs); gutsOfCopy(rhs); } return *this; } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglMixedIntegerRounding2::~CglMixedIntegerRounding2 () { gutsOfDelete(); } //------------------------------------------------------------------- // Construct //------------------------------------------------------------------- void CglMixedIntegerRounding2::gutsOfConstruct (const int maxaggr, const bool multiply, const int criterion, const int preproc) { if (maxaggr > 0) { MAXAGGR_ = maxaggr; } else { throw CoinError("Unallowable value. maxaggr must be > 0", "gutsOfConstruct","CglMixedIntegerRounding2"); } MULTIPLY_ = multiply; if ((criterion >= 1) && (criterion <= 3)) { CRITERION_ = criterion; } else { throw CoinError("Unallowable value. criterion must be 1, 2 or 3", "gutsOfConstruct","CglMixedIntegerRounding2"); } if ((preproc >= -1) && (preproc <= 2)) { doPreproc_ = preproc; } else { throw CoinError("Unallowable value. preproc must be -1, 0 or 1", "gutsOfConstruct","CglMixedIntegerRounding"); } EPSILON_ = 1.0e-6; UNDEFINED_ = -1; TOLERANCE_ = 1.0e-4; numRows_ = 0; numCols_ = 0; doneInitPre_ = false; vubs_ = 0; vlbs_ = 0; rowTypes_ = 0; indRows_ = 0; numRowMix_ = 0; indRowMix_ = 0; numRowCont_ = 0; indRowCont_ = 0; numRowInt_ = 0; indRowInt_ = 0; numRowContVB_ = 0; indRowContVB_ = 0; integerType_ = NULL; sense_=NULL; RHS_=NULL; } //------------------------------------------------------------------- // Delete //------------------------------------------------------------------- void CglMixedIntegerRounding2::gutsOfDelete () { if (vubs_ != 0) { delete [] vubs_; vubs_ = 0; } if (vlbs_ != 0) { delete [] vlbs_; vlbs_ = 0; } if (rowTypes_ != 0) { delete [] rowTypes_; rowTypes_ = 0; } if (indRows_ != 0) { delete [] indRows_; indRows_ = 0; } if (indRowMix_ != 0) { delete [] indRowMix_; indRowMix_ = 0; } if (indRowCont_ != 0) { delete [] indRowCont_; indRowCont_ = 0; } if (indRowInt_ != 0) { delete [] indRowInt_; indRowInt_ = 0; } if (indRowContVB_ != 0) { delete [] indRowContVB_; indRowContVB_ = 0; } if (integerType_ !=NULL) { delete [] integerType_; integerType_=NULL;} if (sense_ !=NULL) { delete [] sense_; sense_=NULL;} if (RHS_ !=NULL) { delete [] RHS_; RHS_=NULL;} } //------------------------------------------------------------------- // Copy //------------------------------------------------------------------- void CglMixedIntegerRounding2::gutsOfCopy (const CglMixedIntegerRounding2& rhs) { MAXAGGR_ = rhs.MAXAGGR_; MULTIPLY_ = rhs.MULTIPLY_; CRITERION_ = rhs.CRITERION_; EPSILON_ = rhs.EPSILON_; UNDEFINED_ = rhs.UNDEFINED_; TOLERANCE_ = rhs.TOLERANCE_; doPreproc_ = rhs.doPreproc_; numRows_ = rhs.numRows_; numCols_ = rhs.numCols_; doneInitPre_ = rhs.doneInitPre_; numRowMix_ = rhs.numRowMix_; numRowCont_ = rhs.numRowCont_; numRowInt_ = rhs.numRowInt_; numRowContVB_ = rhs.numRowContVB_; if (numCols_ > 0) { vubs_ = new CglMixIntRoundVUB2 [numCols_]; vlbs_ = new CglMixIntRoundVLB2 [numCols_]; CoinDisjointCopyN(rhs.vubs_, numCols_, vubs_); CoinDisjointCopyN(rhs.vlbs_, numCols_, vlbs_); integerType_ = CoinCopyOfArray(rhs.integerType_,numCols_); } else { vubs_ = 0; vlbs_ = 0; integerType_ = NULL; } if (numRows_ > 0) { rowTypes_ = new RowType [numRows_]; CoinDisjointCopyN(rhs.rowTypes_, numRows_, rowTypes_); indRows_ = new int [numRows_]; CoinDisjointCopyN(rhs.indRows_, numRows_, indRows_); sense_ = CoinCopyOfArray(rhs.sense_,numRows_); RHS_ = CoinCopyOfArray(rhs.RHS_,numRows_); } else { rowTypes_ = 0; indRows_ = 0; sense_=NULL; RHS_=NULL; } if (numRowMix_ > 0) { indRowMix_ = new int [numRowMix_]; CoinDisjointCopyN(rhs.indRowMix_, numRowMix_, indRowMix_); } else { indRowMix_ = 0; } if (numRowCont_ > 0) { indRowCont_ = new int [numRowCont_]; CoinDisjointCopyN(rhs.indRowCont_, numRowCont_, indRowCont_); indRowContVB_ = new int [numRowCont_]; CoinDisjointCopyN(rhs.indRowContVB_, numRowCont_, indRowContVB_); } else { indRowCont_ = 0; indRowContVB_ = 0; } if (numRowInt_ > 0) { indRowInt_ = new int [numRowInt_]; CoinDisjointCopyN(rhs.indRowInt_, numRowInt_, indRowInt_); } else { indRowInt_ = 0; } } //------------------------------------------------------------------- // Do preprocessing // It determines the type of each row. It also identifies the variable // upper bounds and variable lower bounds. //------------------------------------------------------------------- void CglMixedIntegerRounding2:: mixIntRoundPreprocess(const OsiSolverInterface& si) { // get matrix stored by row const CoinPackedMatrix & matrixByRow = *si.getMatrixByRow(); numRows_ = si.getNumRows(); numCols_ = si.getNumCols(); const double* coefByRow = matrixByRow.getElements(); const int* colInds = matrixByRow.getIndices(); const int* rowStarts = matrixByRow.getVectorStarts(); const int* rowLengths = matrixByRow.getVectorLengths(); // Get copies of sense and RHS so we can modify if ranges if (sense_) { delete [] sense_; delete [] RHS_; } sense_ = CoinCopyOfArray(si.getRowSense(),numRows_); RHS_ = CoinCopyOfArray(si.getRightHandSide(),numRows_); // Save integer type for speed if (integerType_) delete [] integerType_; integerType_ = new char [numCols_]; int iColumn; for (iColumn=0;iColumn 0) indRows_ = new int [numRows_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_MIX numRowMix_ = numMIX; if (indRowMix_ != 0) { delete [] indRowMix_; indRowMix_ = 0; } if (numRowMix_ > 0) indRowMix_ = new int [numRowMix_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_CONT numRowCont_ = numCONT; if (indRowCont_ != 0) { delete [] indRowCont_; indRowCont_ = 0; } if (numRowCont_ > 0) indRowCont_ = new int [numRowCont_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_INT numRowInt_ = numINT; if (indRowInt_ != 0) { delete [] indRowInt_; indRowInt_ = 0; } if (numRowInt_ > 0) indRowInt_ = new int [numRowInt_]; // Destructor will free memory #if CGL_DEBUG std::cout << "The num of rows = " << numRows_ << std::endl; std::cout << "Summary of Row Type" << std::endl; std::cout << "numUNDEFINED = " << numUNDEFINED << std::endl; std::cout << "numVARUB = " << numVARUB << std::endl; std::cout << "numVARLB = " << numVARLB << std::endl; std::cout << "numVAREQ = " << numVAREQ << std::endl; std::cout << "numMIX = " << numMIX << std::endl; std::cout << "numCONT = " << numCONT << std::endl; std::cout << "numINT = " << numINT << std::endl; std::cout << "numOTHER = " << numOTHER << std::endl; #endif //--------------------------------------------------------------------------- // Setup vubs_ and vlbs_ if (vubs_ != 0) { delete [] vubs_; vubs_ = 0; } vubs_ = new CglMixIntRoundVUB2 [numCols_]; // Destructor will free if (vlbs_ != 0) { delete [] vlbs_; vlbs_ = 0; } vlbs_ = new CglMixIntRoundVLB2 [numCols_]; // Destructor will free // Initialization. Altough this has been done in constructor, it is needed // for the case where the mixIntRoundPreprocess is called more than once for (int iCol = 0; iCol < numCols_; ++iCol) { vubs_[iCol].setVar(UNDEFINED_); vlbs_[iCol].setVar(UNDEFINED_); } int countM = 0; int countC = 0; int countI = 0; for ( iRow = 0; iRow < numRows_; ++iRow) { RowType rowType = rowTypes_[iRow]; // fill the vector indRows_ with the indices of all rows indRows_[iRow] = iRow; // fill the vector indRowMix_ with the indices of the rows of type ROW_MIX if (rowType == ROW_MIX) { indRowMix_[countM] = iRow; countM++; } // fill the vector indRowCont_ with the indices of rows of type ROW_CONT else if (rowType == ROW_CONT) { indRowCont_[countC] = iRow; countC++; } // fill the vector indRowInt_ with the indices of the rows of type ROW_INT else if (rowType == ROW_INT) { indRowInt_[countI] = iRow; countI++; } // create vectors with variable lower and upper bounds else if ( (rowType == ROW_VARUB) || (rowType == ROW_VARLB) || (rowType == ROW_VAREQ) ) { int startPos = rowStarts[iRow]; int stopPos = startPos + rowLengths[iRow]; int xInd = 0, yInd = 0; // x is continuous, y is integer double xCoef = 0.0, yCoef = 0.0; for (int i = startPos; i < stopPos; ++i) { if ( fabs(coefByRow[i]) > EPSILON_ ) { if( integerType_[colInds[i]] ) { yInd = colInds[i]; yCoef = coefByRow[i]; } else { xInd = colInds[i]; xCoef = coefByRow[i]; } } } switch (rowType) { case ROW_VARUB: // Inequality: x <= ? * y vubs_[xInd].setVar(yInd); vubs_[xInd].setVal(-yCoef / xCoef); break; case ROW_VARLB: // Inequality: x >= ? * y vlbs_[xInd].setVar(yInd); vlbs_[xInd].setVal(-yCoef / xCoef); break; case ROW_VAREQ: // Inequality: x >= AND <= ? * y vubs_[xInd].setVar(yInd); vubs_[xInd].setVal(-yCoef / xCoef); vlbs_[xInd].setVar(yInd); vlbs_[xInd].setVal(-yCoef / xCoef); break; default: // I am getting compiler bug which gets here - I am disabling - JJF //throw CoinError("Unknown row type: impossible", // "MixIntRoundPreprocess", // "CglMixedIntegerRounding2"); break; } } } // allocate memory for vector of indices of rows of type ROW_CONT // that have at least one variable with variable upper or lower bound if (indRowContVB_ != 0) { delete [] indRowContVB_; indRowContVB_ = 0; } if (numRowCont_ > 0) indRowContVB_ = new int [numRowCont_]; // Destructor will free memory // create vector with rows of type ROW_CONT that have at least // one variable with variable upper or lower bound countC = 0; for (int i = 0; i < numRowCont_; ++i) { int indRow = indRowCont_[i]; int jStart = rowStarts[indRow]; int jStop = jStart + rowLengths[indRow]; for (int j = jStart; j < jStop; ++j) { int indCol = colInds[j]; CglMixIntRoundVLB2 VLB = vlbs_[indCol]; CglMixIntRoundVUB2 VUB = vubs_[indCol]; if (( VLB.getVar() != UNDEFINED_ ) || ( VUB.getVar() != UNDEFINED_ ) ){ indRowContVB_[countC] = indRow; countC++; break; } } } numRowContVB_ = countC; } //------------------------------------------------------------------- // Determine the type of a given row //------------------------------------------------------------------- CglMixedIntegerRounding2::RowType CglMixedIntegerRounding2::determineRowType(//const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const char sense, const double rhs) const { if (rowLen == 0 || fabs(rhs) > 1.0e20) return ROW_UNDEFINED; RowType rowType = ROW_UNDEFINED; int numPosInt = 0; // num of positive integer variables int numNegInt = 0; // num of negative integer variables int numInt = 0; // num of integer variables int numPosCon = 0; // num of positive continuous variables int numNegCon = 0; // num of negative continuous variables int numCon = 0; // num of continuous variables // Summarize the variable types of the given row. for ( int i = 0; i < rowLen; ++i ) { if ( coef[i] < -EPSILON_ ) { if( integerType_[ind[i]] ) ++numNegInt; else ++numNegCon; } else if ( coef[i] > EPSILON_ ) { if( integerType_[ind[i]] ) ++numPosInt; else ++numPosCon; } } numInt = numNegInt + numPosInt; numCon = numNegCon + numPosCon; #if CGL_DEBUG std::cout << "numNegInt = " << numNegInt << std::endl; std::cout << "numPosInt = " << numPosInt << std::endl; std::cout << "numInt = " << numInt << std::endl; std::cout << "numNegCon = " << numNegCon << std::endl; std::cout << "numPosCon = " << numPosCon << std::endl; std::cout << "numCon = " << numCon << std::endl; std::cout << "rowLen = " << rowLen << std::endl; #endif //------------------------------------------------------------------------- // Classify row type based on the types of variables. if ((numInt > 0) && (numCon > 0)) { if ((numInt == 1) && (numCon == 1) && (fabs(rhs) <= EPSILON_)) { // It's a variable bound constraint switch (sense) { case 'L': rowType = numPosCon == 1 ? ROW_VARUB : ROW_VARLB; break; case 'G': rowType = numPosCon == 1 ? ROW_VARLB : ROW_VARUB; break; case 'E': rowType = ROW_VAREQ; break; default: break; } } else { // It's a constraint with continuous and integer variables; // The total number of variables is at least 2 rowType = ROW_MIX; } } else if (numInt == 0) { // It's a constraint with only continuous variables rowType = ROW_CONT; } else if ((numCon == 0) && ((sense == 'L') || (sense == 'G'))) { // It's a <= or >= constraint with only integer variables rowType = ROW_INT; } else // It's a constraint that does not fit the above categories rowType = ROW_OTHER; return rowType; } //------------------------------------------------------------------- // Generate MIR cuts //------------------------------------------------------------------- void CglMixedIntegerRounding2::generateMirCuts( const OsiSolverInterface& si, const double* xlp, const double* colUpperBound, const double* colLowerBound, const CoinPackedMatrix& matrixByRow, const double* LHS, //const double* coefByRow, //const int* colInds, //const int* rowStarts, //const CoinPackedMatrix& matrixByCol, const double* coefByCol, const int* rowInds, const int* colStarts, OsiCuts& cs ) const { #if CGL_DEBUG // OPEN FILE std::ofstream fout("stats.dat"); #endif // Define upper limit for the loop where the cMIRs are constructed int upperLimit; if (MULTIPLY_) upperLimit = 2; else upperLimit = 1; // create a vector with the columns that were used in the aggregation int* listColsSelected = new int[MAXAGGR_]; // create a vector with the rows that were aggregated int* listRowsAggregated = new int[MAXAGGR_]; // create a vector with the LP solutions of the slack variables double* xlpExtra = new double[MAXAGGR_]; // loop until maximum number of aggregated rows is reached or a // violated cut is found int numRowMixAndRowContVB = numRowMix_ + numRowContVB_; int numRowMixAndRowContVBAndRowInt = numRowMixAndRowContVB + numRowInt_; // Get large enough vector CoinIndexedVector rowAggregated(si.getNumCols()); CoinIndexedVector rowToAggregate(si.getNumCols()); CoinIndexedVector mixedKnapsack(si.getNumCols()); CoinIndexedVector contVariablesInS(si.getNumCols()); CoinIndexedVector rowToUse(si.getNumCols()); // And work vectors CoinIndexedVector workVectors[4]; for (int i=0; i<4; i++) workVectors[i].reserve(si.getNumCols()); CoinIndexedVector setRowsAggregated(si.getNumRows()); for (int iRow = 0; iRow < numRowMixAndRowContVBAndRowInt; ++iRow) { int rowSelected; // row selected to be aggregated next int colSelected; // column selected for pivot in aggregation rowAggregated.clear(); double rhsAggregated; // create a set with the indices of rows selected setRowsAggregated.clear(); // loop until the maximum number of aggregated rows is reached for (int iAggregate = 0; iAggregate < MAXAGGR_; ++iAggregate) { if (iAggregate == 0) { // select row if (iRow < numRowMix_) { rowSelected = indRowMix_[iRow]; } else if (iRow < numRowMixAndRowContVB) { rowSelected = indRowContVB_[iRow - numRowMix_]; } else { rowSelected = indRowInt_[iRow - numRowMixAndRowContVB]; } copyRowSelected(iAggregate, rowSelected, setRowsAggregated, listRowsAggregated, xlpExtra, sense_[rowSelected], RHS_[rowSelected], LHS[rowSelected], matrixByRow, rowAggregated, rhsAggregated); } else { // search for a row to aggregate bool foundRowToAggregate = selectRowToAggregate( /*si,*/ rowAggregated, colUpperBound, colLowerBound, setRowsAggregated, xlp, coefByCol, rowInds, colStarts, rowSelected, colSelected); // if finds row to aggregate, compute aggregated row if (foundRowToAggregate) { rowToAggregate.clear(); double rhsToAggregate; listColsSelected[iAggregate] = colSelected; copyRowSelected(iAggregate, rowSelected, setRowsAggregated, listRowsAggregated, xlpExtra, sense_[rowSelected], RHS_[rowSelected], LHS[rowSelected], matrixByRow, rowToAggregate, rhsToAggregate); // call aggregate row heuristic aggregateRow(colSelected, rowToAggregate, rhsToAggregate, rowAggregated, rhsAggregated); } else break; } // construct cMIR with current rowAggregated // and, if upperLimit=2 construct also a cMIR with // the current rowAggregated multiplied by -1 for (int i = 0; i < upperLimit; ++i) { // create vector for mixed knapsack constraint double rhsMixedKnapsack; rowToUse.copy(rowAggregated); if (i==0) { rhsMixedKnapsack = rhsAggregated; } else { rowToUse *= -1.0; rhsMixedKnapsack = - rhsAggregated; } mixedKnapsack.clear(); double sStar = 0.0; // create vector for the continuous variables in s contVariablesInS.clear(); // call bound substitution heuristic bool foundMixedKnapsack = boundSubstitution( si, rowToUse, xlp, xlpExtra, colUpperBound, colLowerBound, mixedKnapsack, rhsMixedKnapsack, sStar, contVariablesInS); // if it did not find a mixed knapsack it is because there is at // least one integer variable with lower bound different than zero // or there are no integer or continuous variables. // In this case, we continue without trying to generate a c-MIR if (!foundMixedKnapsack) { #if CGL_DEBUG std::cout << "couldn't create mixed knapsack" << std::endl; #endif continue; } OsiRowCut cMirCut; // Find a c-MIR cut with the current mixed knapsack constraint bool hasCut = cMirSeparation(si, matrixByRow, rowToUse, listRowsAggregated, sense_, RHS_, //coefByRow, colInds, rowStarts, xlp, sStar, colUpperBound, colLowerBound, mixedKnapsack, rhsMixedKnapsack, contVariablesInS, workVectors,cMirCut); #if CGL_DEBUG // PRINT STATISTICS printStats(fout, hasCut, si, rowAggregated, rhsAggregated, xlp, xlpExtra, listRowsAggregated, listColsSelected, iAggregate+1, colUpperBound, colLowerBound ); #endif // if a cut was found, insert it into cs if (hasCut) { #if CGL_DEBUG std::cout << "MIR cut generated " << std::endl; #endif cs.insert(cMirCut); } } } } // free memory delete [] listColsSelected; listColsSelected = 0; delete [] listRowsAggregated; listRowsAggregated = 0; delete [] xlpExtra; xlpExtra = 0; #if CGL_DEBUG // CLOSE FILE fout.close(); #endif return; } //------------------------------------------------------------------- // Copy row selected to CoinIndexedVector //------------------------------------------------------------------- void CglMixedIntegerRounding2::copyRowSelected( const int iAggregate, const int rowSelected, CoinIndexedVector& setRowsAggregated, int* listRowsAggregated, double* xlpExtra, const char sen, const double rhs, const double lhs, const CoinPackedMatrix& matrixByRow, CoinIndexedVector& rowToAggregate, double& rhsToAggregate) const { // copy the row selected to a vector of type CoinIndexedVector const CoinShallowPackedVector reqdBySunCC = matrixByRow.getVector(rowSelected) ; rowToAggregate = reqdBySunCC ; rhsToAggregate = rhs; // update list of indices of rows selected setRowsAggregated.insert(rowSelected,1.0); listRowsAggregated[iAggregate] = rowSelected; // Add a slack variable if needed and compute its current value if (sen == 'L') { rowToAggregate.insert(numCols_ + iAggregate, 1); xlpExtra[iAggregate] = rhs - lhs; } else if (sen == 'G') { rowToAggregate.insert(numCols_ + iAggregate, -1); xlpExtra[iAggregate] = lhs - rhs; } } //------------------------------------------------------------------- // Construct the set P* and select a row to aggregate //------------------------------------------------------------------- bool CglMixedIntegerRounding2::selectRowToAggregate( //const OsiSolverInterface& si, const CoinIndexedVector& rowAggregated, const double* colUpperBound, const double* colLowerBound, const CoinIndexedVector& setRowsAggregated, const double* xlp, const double* coefByCol, const int* rowInds, const int* colStarts, int& rowSelected, int& colSelected ) const { bool foundRowToAggregate = false; double deltaMax = 0.0; // maximum delta const int numColsAggregated = rowAggregated.getNumElements(); const int *rowAggregatedIndices = rowAggregated.getIndices(); const double *rowAggregatedElements = rowAggregated.denseVector(); for (int j = 0; j < numColsAggregated; ++j) { // store the index and coefficient of column j int indCol = rowAggregatedIndices[j]; if (indCol >= numCols_) continue; double coefCol = rowAggregatedElements[indCol]; // Consider only continuous variables if ( (integerType_[indCol]) || (fabs(coefCol) < EPSILON_)) continue; // Compute current lower bound CglMixIntRoundVLB2 VLB = vlbs_[indCol]; double LB = ( VLB.getVar() != UNDEFINED_ ) ? VLB.getVal() * xlp[VLB.getVar()] : colLowerBound[indCol]; // Compute current upper bound CglMixIntRoundVUB2 VUB = vubs_[indCol]; double UB = ( VUB.getVar() != UNDEFINED_ ) ? VUB.getVal() * xlp[VUB.getVar()] : colUpperBound[indCol]; // Compute distances from current solution to upper and lower bounds double delta = CoinMin(xlp[indCol] - LB, UB - xlp[indCol]); // In case this variable is acceptable look for possible rows if (delta > deltaMax) { int iStart = colStarts[indCol]; int iStop = colStarts[indCol+1]; // int count = 0; // std::vector rowPossible; // find a row to use in aggregation for (int i = iStart; i < iStop; ++i) { int rowInd = rowInds[i]; if (!setRowsAggregated.denseVector()[rowInd]) { // if the row was not already selected, select it RowType rType = rowTypes_[rowInd]; if ( ((rType == ROW_MIX) || (rType == ROW_CONT)) && (fabs(coefByCol[i]) > EPSILON_) ) { // rowPossible.push_back(rowInd); rowSelected = rowInd; deltaMax = delta; colSelected = indCol; foundRowToAggregate = true; //count++; break; } } } // if (count > 0) // rowSelected = rowPossible[rand() % count]; // std::cout << count << std::endl; } } return foundRowToAggregate; } //------------------------------------------------------------------- // Aggregate the selected row with the current aggregated row //------------------------------------------------------------------- void CglMixedIntegerRounding2::aggregateRow( const int colSelected, CoinIndexedVector& rowToAggregate, double rhs, CoinIndexedVector& rowAggregated, double& rhsAggregated ) const { // quantity to multiply by the coefficients of the row to aggregate double multiCoef = rowAggregated[colSelected] / rowToAggregate[colSelected]; rowToAggregate *= multiCoef; rhs *= multiCoef; rowAggregated = rowAggregated - rowToAggregate; rhsAggregated -= rhs; } //------------------------------------------------------------------- // Choose the bound substitution based on the criteria defined by the user //------------------------------------------------------------------- inline bool CglMixedIntegerRounding2::isLowerSubst(const double inf, const double aj, const double xlp, const double LB, const double UB) const { if (CRITERION_ == 1) { // criterion 1 (the same as criterion (a) in the paper) return xlp - LB < UB - xlp; } else { if (UB == inf || xlp == LB) return true; if (LB == -inf || xlp == UB) return false; if (CRITERION_ == 2) // criterion 2 (the same as criterion (b) in the paper) return aj < 0; else // criterion 3 (the same as criterion (c) in the paper) return aj > 0; } } //------------------------------------------------------------------- // Bound substitution heuristic //------------------------------------------------------------------- bool CglMixedIntegerRounding2::boundSubstitution( const OsiSolverInterface& si, const CoinIndexedVector& rowAggregated, const double* xlp, const double* xlpExtra, const double* colUpperBound, const double* colLowerBound, CoinIndexedVector& mixedKnapsack, double& rhsMixedKnapsack, double& sStar, CoinIndexedVector& contVariablesInS ) const { bool generated = false; const int numColsAggregated = rowAggregated.getNumElements(); const int *rowAggregatedIndices = rowAggregated.getIndices(); const double *rowAggregatedElements = rowAggregated.denseVector(); // go through all the variables and if it is continuous and delta is // negative, store variable in the vector contVariablesInS. // If it is integer, store variable in the vector mixedKnapsack int numCont = 0; double infinity = si.getInfinity(); int j; for ( j = 0; j < numColsAggregated; ++j) { // get index and coefficient of column j in the aggregated row const int indCol = rowAggregatedIndices[j]; const double coefCol = rowAggregatedElements[indCol]; // if the lower bound is equal to the upper bound, remove variable if ( (indCol < numCols_) && (colLowerBound[indCol] == colUpperBound[indCol]) ) { rhsMixedKnapsack -= coefCol * colLowerBound[indCol]; continue; } if (fabs(coefCol) < EPSILON_) continue; // set the coefficients of the integer variables if ( (indCol < numCols_) && (integerType_[indCol]) ) { // Copy the integer variable to the vector mixedKnapsack mixedKnapsack.add(indCol,coefCol); continue; } // Select the continuous variables and copy the ones in s to // the vector contVariablesInS if (indCol < numCols_) { // variable is model variable // Compute lower bound for variable indCol const CglMixIntRoundVLB2 VLB = vlbs_[indCol]; const double LB = ( VLB.getVar() != UNDEFINED_ ) ? VLB.getVal() * xlp[VLB.getVar()] : colLowerBound[indCol]; // Compute upper bound for variable indCol const CglMixIntRoundVUB2 VUB = vubs_[indCol]; const double UB = ( VUB.getVar() != UNDEFINED_ ) ? VUB.getVal() * xlp[VUB.getVar()] : colUpperBound[indCol]; // if both bounds are infinite, then we cannot form a mixed knapsack if ( (LB == -1.0 * infinity) && (UB == infinity) ) { #if CGL_DEBUG std::cout << "continuous var with infinite bounds. " << "Cannot form mixed Knapsack = " << std::endl; #endif return generated; } // Select the bound substitution if (isLowerSubst(infinity, rowAggregatedElements[indCol], xlp[indCol], LB, UB)) { if (VLB.getVar() != UNDEFINED_ ) { const int indVLB = VLB.getVar(); mixedKnapsack.add(indVLB, coefCol * VLB.getVal()); } else { rhsMixedKnapsack -= coefCol * LB; } // Update sStar if (coefCol < -EPSILON_) { contVariablesInS.insert(indCol, coefCol); sStar -= coefCol * (xlp[indCol] - LB); numCont++; } } else { if (VUB.getVar() != UNDEFINED_ ) { const int indVUB = VUB.getVar(); mixedKnapsack.add(indVUB, coefCol * VUB.getVal()); } else { rhsMixedKnapsack -= coefCol * UB; } // Update sStar if (coefCol > EPSILON_) { contVariablesInS.insert(indCol, - coefCol); sStar += coefCol * (UB - xlp[indCol]); numCont++; } } } else { // variable is slack variable // in this case the LB = 0 and the UB = infinity // Update sStar const double tLB = xlpExtra[indCol - numCols_]; if (coefCol < -EPSILON_) { contVariablesInS.insert(indCol, coefCol); sStar -= coefCol * tLB; numCont++; } } } // if there are no continuous variables to form s, then we stop #if CGL_DEBUG std::cout << "# of continuous var in mixedKnapsack = " << numCont << std::endl; #endif if (numCont == 0) return generated; // check that the integer variables have lower bound equal to zero const int numInt = mixedKnapsack.getNumElements(); // if there are not integer variables in mixedKnapsack, then we stop // CAUTION: all the coefficients could be zero #if CGL_DEBUG std::cout << "# of integer var in mixedKnapsack = " << numInt << std::endl; #endif if (numInt == 0) return generated; const int *knapsackIndices = mixedKnapsack.getIndices(); const double *knapsackElements = mixedKnapsack.denseVector(); for ( j = 0; j < numInt; ++j) { int indCol = knapsackIndices[j]; // if the coefficient is zero, disregard if (fabs(knapsackElements[indCol]) < EPSILON_) continue; // if the lower bound is not zero, then we stop if (fabs(colLowerBound[indCol]) > EPSILON_) return generated; } // if the lower bounds of all integer variables are zero, proceed generated = true; return generated; } //------------------------------------------------------------------- // c-MIR separation heuristic //------------------------------------------------------------------- bool CglMixedIntegerRounding2::cMirSeparation( const OsiSolverInterface& si, const CoinPackedMatrix& matrixByRow, const CoinIndexedVector& rowAggregated, const int* listRowsAggregated, const char* sense, const double* RHS, //const double* coefByRow, //const int* colInds, const int* rowStarts, const double* xlp, const double sStar, const double* colUpperBound, const double* colLowerBound, const CoinIndexedVector& mixedKnapsack, const double& rhsMixedKnapsack, const CoinIndexedVector& contVariablesInS, CoinIndexedVector * workVectors, OsiRowCut& cMirCut) const { bool generated = false; double numeratorBeta = rhsMixedKnapsack; CoinIndexedVector * cMIR = &workVectors[0]; cMIR->copy(mixedKnapsack); double rhscMIR; double maxViolation = 0.0; double bestDelta = 0.0; CoinIndexedVector * bestCut = &workVectors[1]; double rhsBestCut = 0.0; double sCoefBestCut = 0.0; const int numInt = mixedKnapsack.getNumElements(); const int *knapsackIndices = mixedKnapsack.getIndices(); const double *knapsackElements = mixedKnapsack.denseVector(); const int *contVarInSIndices = contVariablesInS.getIndices(); const double *contVarInSElements = contVariablesInS.denseVector(); // Construct set C, T will be the rest. // Also, for T we construct a CoinIndexedVector named complT which // contains the vars in T that are strictly between their bounds CoinIndexedVector & setC = workVectors[3]; setC.clear(); CoinIndexedVector * complT = &workVectors[2]; complT->clear(); double infinity = si.getInfinity(); int j; for ( j = 0; j < numInt; ++j) { const int indCol = knapsackIndices[j]; // if the upper bound is infinity, then indCol is in T and cannot // be in complT if (colUpperBound[indCol] != infinity) { if (xlp[indCol] >= colUpperBound[indCol] / 2.0) { setC.insert(j,1.0); numeratorBeta -= knapsackElements[indCol] * colUpperBound[indCol]; } else { if ( (xlp[indCol] <= EPSILON_) || (xlp[indCol] >= colUpperBound[indCol] - EPSILON_)) continue; complT->insert(j, fabs(xlp[indCol] - colUpperBound[indCol]/2)); } } } // Sort the indices in complT by nondecreasing values // (which are $|y^*_j-u_j/2|$) if (complT->getNumElements() > 0) { complT->sortIncrElement(); } // Construct c-MIR inequalities and take the one with the largest violation for ( j = 0; j < numInt; ++j) { int indCol = knapsackIndices[j]; if ( (xlp[indCol] <= EPSILON_) || (xlp[indCol] >= colUpperBound[indCol] - EPSILON_)) continue; double delta = knapsackElements[indCol]; // delta has to be positive if (delta <= EPSILON_) continue; double violation = 0.0; double sCoef = 0.0; // form a cMIR inequality cMirInequality(numInt, delta, numeratorBeta, knapsackIndices, knapsackElements, xlp, sStar, colUpperBound, setC, *cMIR, rhscMIR, sCoef, violation); // store cut if it is the best found so far if (violation > maxViolation + EPSILON_) { bestCut->copy(*cMIR); rhsBestCut = rhscMIR; sCoefBestCut = sCoef; maxViolation = violation; bestDelta = delta; } } // if no violated inequality has been found, exit now if (maxViolation == 0.0) { bestCut->clear(); return generated; } // improve the best violated inequality. // try to divide delta by 2, 4 or 8 and see if increases the violation double deltaBase = bestDelta; for (int multFactor = 2; multFactor <= 8; multFactor *= 2) { double delta = deltaBase / multFactor; double violation = 0.0; double sCoef = 0.0; // form a cMIR inequality cMirInequality(numInt, delta, numeratorBeta, knapsackIndices, knapsackElements, xlp, sStar, colUpperBound, setC, *cMIR, rhscMIR, sCoef, violation); // store cut if it is the best found so far if (violation > maxViolation + EPSILON_) { bestCut->copy(cMIR); rhsBestCut = rhscMIR; sCoefBestCut = sCoef; maxViolation = violation; bestDelta = delta; } } // improve cMIR for the best delta // complT contains indices into mixedKnapsack for the variables // which may be complemented and they are already appropriately // sorted. const int complTSize = complT->getNumElements(); if (complTSize > 0) { const int *complTIndices = complT->getIndices(); for (int j = 0; j < complTSize; ++j) { // move variable in set complT from set T to set C int jIndex = complTIndices[j]; int indCol = knapsackIndices[jIndex]; // do nothing if upper bound is infinity if (colUpperBound[indCol] >= infinity) continue; setC.insert(jIndex,1.0); double violation = 0.0; double sCoef = 0.0; double localNumeratorBeta = numeratorBeta - mixedKnapsack[indCol] * colUpperBound[indCol]; // form a cMIR inequality cMirInequality(numInt, bestDelta, localNumeratorBeta, knapsackIndices, knapsackElements, xlp, sStar, colUpperBound, setC, *cMIR, rhscMIR, sCoef, violation); // store cut if it is the best found so far; otherwise, move the variable // that was added to set C back to set T if (violation > maxViolation + EPSILON_) { bestCut->copy(cMIR); rhsBestCut = rhscMIR; sCoefBestCut = sCoef; maxViolation = violation; numeratorBeta = localNumeratorBeta; } else setC.quickAdd(jIndex,-1.0); } } // write the best cut found with the model variables int numCont = contVariablesInS.getNumElements(); for ( j = 0; j < numCont; ++j) { int indCol = contVarInSIndices[j]; double coefCol = contVarInSElements[indCol]; if (indCol < numCols_) { // variable is model variable // Compute lower bound for variable indCol CglMixIntRoundVLB2 VLB = vlbs_[indCol]; double LB = ( VLB.getVar() != UNDEFINED_ ) ? VLB.getVal() * xlp[VLB.getVar()] : colLowerBound[indCol]; // Compute upper bound for variable indCol CglMixIntRoundVUB2 VUB = vubs_[indCol]; double UB = ( VUB.getVar() != UNDEFINED_ ) ? VUB.getVal() * xlp[VUB.getVar()] : colUpperBound[indCol]; // Select the bound substitution if (isLowerSubst(infinity, rowAggregated[indCol], xlp[indCol], LB, UB)) { if (VLB.getVar() != UNDEFINED_ ) { int indVLB = VLB.getVar(); bestCut->add(indVLB, - sCoefBestCut * coefCol * VLB.getVal()); bestCut->insert(indCol, sCoefBestCut * coefCol); } else { rhsBestCut += sCoefBestCut * coefCol * colLowerBound[indCol]; bestCut->insert(indCol, sCoefBestCut * coefCol); } } else { if (VUB.getVar() != UNDEFINED_ ) { int indVUB = VUB.getVar(); bestCut->add(indVUB, sCoefBestCut * coefCol * VUB.getVal()); bestCut->insert(indCol, - sCoefBestCut * coefCol); } else { rhsBestCut -= sCoefBestCut * coefCol * colUpperBound[indCol]; bestCut->insert(indCol, - sCoefBestCut * coefCol); } } } else { // variable is slack variable // in this case the LB = 0 and the UB = infinity // copy the row selected to a vector of type CoinIndexedVector const int iRow = listRowsAggregated[indCol - numCols_]; double multiplier; if (sense[iRow] == 'L') { // if it is a <= inequality, the coefficient of the slack is 1 multiplier = (- sCoefBestCut * coefCol); } else { // if it is a <= inequality, the coefficient of the slack is -1 multiplier = (sCoefBestCut * coefCol); } rhsBestCut += RHS[iRow]*multiplier; CoinShallowPackedVector row = matrixByRow.getVector(iRow); int nElements = row.getNumElements(); const int * column = row.getIndices(); const double * element = row.getElements(); for (int i=0;iadd(column[i],element[i]*multiplier); } } // Check the violation of the cut after it is written with the original // variables. int cutLen = bestCut->getNumElements(); int* cutInd = bestCut->getIndices(); double* cutCoef = bestCut->denseVector(); double cutRHS = rhsBestCut; double violation = 0.0; double normCut = 0.0; //double smallest=COIN_DBL_MAX; double largest=0.0; // Also weaken by small coefficients for ( j = 0; j < cutLen; ++j) { int column = cutInd[j]; double value = cutCoef[column]; //smallest=CoinMin(smallest,fabs(value)); largest=CoinMax(largest,fabs(value)); //normCut += value * value; } //normCut=sqrt(normCut); //printf("smallest %g largest %g norm %g\n", // smallest,largest,normCut); double testValue=CoinMax(1.0e-6*largest,1.0e-12); //normCut=0.0; int n=0; for ( j = 0; j < cutLen; ++j) { int column = cutInd[j]; double value = cutCoef[column]; if (fabs(value)>testValue) { violation += value * xlp[column]; normCut += value * value; cutInd[n++]=column; } else if (value) { cutCoef[column]=0.0; // Weaken if (value>0.0) { // Allow for at lower bound cutRHS -= value*colLowerBound[column]; } else { // Allow for at upper bound cutRHS -= value*colUpperBound[column]; } } } cutLen=n; violation -= cutRHS; violation /= sqrt(normCut); if ( violation > TOLERANCE_ ) { // cutCoef is still unpacked std::sort(cutInd,cutInd+cutLen); int i; for ( i=0;i=0); assert(cutCoef[k]); assert (fabs(cutCoef[k])>1.0e-12); } } #endif // Zero bestCut by hand bestCut->setNumElements(0); for ( i=0;iclear(); } return generated; } //------------------------------------------------------------------- // construct a c-MIR inequality //------------------------------------------------------------------- void CglMixedIntegerRounding2::cMirInequality( const int numInt, const double delta, const double numeratorBeta, const int *knapsackIndices, const double* knapsackElements, const double* xlp, const double sStar, const double* colUpperBound, const CoinIndexedVector& setC, CoinIndexedVector& cMIR, double& rhscMIR, double& sCoef, double& violation) const { // form a cMIR inequality double beta = numeratorBeta / delta; double f = beta - floor(beta); rhscMIR = floor(beta); double normCut = 0.0; // coefficients of variables in set T for (int i = 0; i < numInt; ++i) { const int iIndex = knapsackIndices[i]; double G = 0.0; if (setC.denseVector()[i] != 1.0) { // i is not in setC, i.e., it is in T G = functionG(knapsackElements[iIndex] / delta, f); violation += (G * xlp[iIndex]); normCut += G * G; cMIR.setElement(i, G); } else { G = functionG( - knapsackElements[iIndex] / delta, f); violation -= (G * xlp[iIndex]); normCut += G * G; rhscMIR -= G * colUpperBound[iIndex]; cMIR.setElement(i, -G); } } sCoef = 1.0 / (delta * (1.0 - f)); violation -= (rhscMIR + sCoef * sStar); normCut += sCoef * sCoef; violation /= sqrt(normCut); } //------------------------------------------------------------------- // function G for computing coefficients in cMIR inequality //------------------------------------------------------------------- inline double CglMixedIntegerRounding2::functionG( const double d, const double f ) const { double delta = d - floor(d) - f; if (delta > EPSILON_) return floor(d) + delta / (1 - f); else return floor(d); } //------------------------------------------------------------------- // Printing statistics //------------------------------------------------------------------- void CglMixedIntegerRounding2::printStats( std::ofstream & fout, const bool hasCut, const OsiSolverInterface& si, const CoinIndexedVector& rowAggregated, const double& rhsAggregated, const double* xlp, const double* xlpExtra, const int* listRowsAggregated, const int* listColsSelected, const int level, const double* colUpperBound, const double* colLowerBound ) const { const int numColsAggregated = rowAggregated.getNumElements(); const int *rowAggregatedIndices = rowAggregated.getIndices(); const double *rowAggregatedElements = rowAggregated.denseVector(); fout << "Rows "; for (int i = 0; i < level; ++i) { fout << listRowsAggregated[i] << " "; } fout << std::endl; int numColsBack = 0; // go through all the variables for (int j = 0; j < numColsAggregated; ++j) { // get index and coefficient of column j in the aggregated row int indCol = rowAggregatedIndices[j]; double coefCol = rowAggregatedElements[indCol]; // check if a column used in aggregation is back into the aggregated row for (int i = 0; i < level-1; ++i) { if ( (listColsSelected[i] == indCol) && (coefCol != 0) ) { numColsBack++; break; } } if (fabs(coefCol) < EPSILON_) { // print variable number and coefficient fout << indCol << " " << 0.0 << std::endl; continue; } else { // print variable number and coefficient fout << indCol << " " << coefCol << " "; } // integer variables if ( (indCol < numCols_) && (integerType_[indCol]) ) { // print fout << "I " << xlp[indCol] << " " << colLowerBound[indCol] << " " << colUpperBound[indCol] << std::endl; continue; } // continuous variables if (indCol < numCols_) { // variable is model variable // print fout << "C " << xlp[indCol] << " " << colLowerBound[indCol] << " " << colUpperBound[indCol] << " "; // variable lower bound? CglMixIntRoundVLB2 VLB = vlbs_[indCol]; if (VLB.getVar() != UNDEFINED_) { fout << VLB.getVal() << " " << xlp[VLB.getVar()] << " " << colLowerBound[VLB.getVar()] << " " << colUpperBound[VLB.getVar()] << " "; } else { fout << "-1 -1 -1 -1 "; } // variable upper bound? CglMixIntRoundVUB2 VUB = vubs_[indCol]; if (VUB.getVar() != UNDEFINED_) { fout << VUB.getVal() << " " << xlp[VUB.getVar()] << " " << colLowerBound[VUB.getVar()] << " " << colUpperBound[VUB.getVar()] << " "; } else { fout << "-1 -1 -1 -1 "; } } else { // variable is slack variable // in this case the LB = 0 and the UB = infinity // print fout << "C " << xlpExtra[indCol-numCols_] << " " << 0.0 << " " << si.getInfinity() << " "; } fout << std::endl; } fout << "rhs " << rhsAggregated << std::endl; fout << "numColsBack " << numColsBack << std::endl; if (hasCut) { fout << "CUT: YES" << std::endl; } else { fout << "CUT: NO" << std::endl; } } // This can be used to refresh any inforamtion void CglMixedIntegerRounding2::refreshSolver(OsiSolverInterface * solver) { if (solver->getNumRows()) { mixIntRoundPreprocess(*solver); doneInitPre_ = true; } else { doneInitPre_ = false; } } // Create C++ lines to get to current state std::string CglMixedIntegerRounding2::generateCpp( FILE * fp) { CglMixedIntegerRounding2 other; fprintf(fp,"0#include \"CglMixedIntegerRounding2.hpp\"\n"); fprintf(fp,"3 CglMixedIntegerRounding2 mixedIntegerRounding2;\n"); if (MAXAGGR_!=other.MAXAGGR_) fprintf(fp,"3 mixedIntegerRounding2.setMAXAGGR_(%d);\n",MAXAGGR_); else fprintf(fp,"4 mixedIntegerRounding2.setMAXAGGR_(%d);\n",MAXAGGR_); if (MULTIPLY_!=other.MULTIPLY_) fprintf(fp,"3 mixedIntegerRounding2.setMULTIPLY_(%d);\n",MULTIPLY_); else fprintf(fp,"4 mixedIntegerRounding2.setMULTIPLY_(%d);\n",MULTIPLY_); if (CRITERION_!=other.CRITERION_) fprintf(fp,"3 mixedIntegerRounding2.setCRITERION_(%d);\n",CRITERION_); if (doPreproc_!=other.doPreproc_) fprintf(fp,"3 mixedIntegerRounding2.setDoPreproc_(%d);\n", doPreproc_); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 mixedIntegerRounding2.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 mixedIntegerRounding2.setAggressiveness(%d);\n",getAggressiveness()); return "mixedIntegerRounding2"; } void CglMixedIntegerRounding2::setDoPreproc(int value) { if (value != -1 && value != 0 && value != 1) { throw CoinError("setDoPrepoc", "invalid value", "CglMixedIntegerRounding2"); } else { doPreproc_ = value; } } bool CglMixedIntegerRounding2::getDoPreproc() const { return (doPreproc_!=0); } Cgl-0.58.9/src/CglMixedIntegerRounding2/Makefile.am0000644000076600007660000000334511621724114020431 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglMixedIntegerRounding2 # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglMixedIntegerRounding2.la # List all source files for this library, including headers libCglMixedIntegerRounding2_la_SOURCES = CglMixedIntegerRounding2.cpp CglMixedIntegerRounding2.hpp CglMixedIntegerRounding2Test.cpp # This is for libtool (on Windows) libCglMixedIntegerRounding2_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglMixedIntegerRounding2.hpp Cgl-0.58.9/src/CglMixedIntegerRounding2/Makefile.in0000644000076600007660000005457412240340055020450 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/CglMixedIntegerRounding2 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglMixedIntegerRounding2_la_LIBADD = am_libCglMixedIntegerRounding2_la_OBJECTS = \ CglMixedIntegerRounding2.lo CglMixedIntegerRounding2Test.lo libCglMixedIntegerRounding2_la_OBJECTS = \ $(am_libCglMixedIntegerRounding2_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 = $(libCglMixedIntegerRounding2_la_SOURCES) DIST_SOURCES = $(libCglMixedIntegerRounding2_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglMixedIntegerRounding2 # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglMixedIntegerRounding2.la # List all source files for this library, including headers libCglMixedIntegerRounding2_la_SOURCES = CglMixedIntegerRounding2.cpp CglMixedIntegerRounding2.hpp CglMixedIntegerRounding2Test.cpp # This is for libtool (on Windows) libCglMixedIntegerRounding2_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglMixedIntegerRounding2.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/CglMixedIntegerRounding2/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglMixedIntegerRounding2/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglMixedIntegerRounding2.la: $(libCglMixedIntegerRounding2_la_OBJECTS) $(libCglMixedIntegerRounding2_la_DEPENDENCIES) $(CXXLINK) $(libCglMixedIntegerRounding2_la_LDFLAGS) $(libCglMixedIntegerRounding2_la_OBJECTS) $(libCglMixedIntegerRounding2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglMixedIntegerRounding2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglMixedIntegerRounding2Test.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglMixedIntegerRounding2/CglMixedIntegerRounding2.hpp0000644000076600007660000003227512130104734023710 0ustar coincoin// LAST EDIT: //----------------------------------------------------------------------------- // name: Mixed Integer Rounding Cut Generator // authors: Joao Goncalves (jog7@lehigh.edu) // Laszlo Ladanyi (ladanyi@us.ibm.com) // date: August 11, 2004 //----------------------------------------------------------------------------- // Copyright (C) 2004, International Business Machines Corporation and others. // All Rights Reserved. // This code is published under the Eclipse Public License. #ifndef CglMixedIntegerRounding2_H #define CglMixedIntegerRounding2_H #include #include //#include #include "CoinError.hpp" #include "CglCutGenerator.hpp" #include "CoinIndexedVector.hpp" //============================================================================= #ifndef CGL_DEBUG #define CGL_DEBUG 0 #endif //============================================================================= // Class to store variable upper bounds (VUB) class CglMixIntRoundVUB2 { // Variable upper bounds have the form x_j <= a y_j, where x_j is // a continuous variable and y_j is an integer variable protected: int var_; // The index of y_j double val_; // The value of a public: // Default constructor CglMixIntRoundVUB2() : var_(-1), val_(-1) {} // Copy constructor CglMixIntRoundVUB2(const CglMixIntRoundVUB2& source) { var_ = source.var_; val_ = source.val_; } // Assignment operator CglMixIntRoundVUB2& operator=(const CglMixIntRoundVUB2& rhs) { if (this != &rhs) { var_ = rhs.var_; val_ = rhs.val_; } return *this; } // Destructor ~CglMixIntRoundVUB2() {} // Query and set functions int getVar() const { return var_; } double getVal() const { return val_; } void setVar(const int v) { var_ = v; } void setVal(const double v) { val_ = v; } }; //============================================================================= // Class to store variable lower bounds (VLB). // It is the same as the class to store variable upper bounds typedef CglMixIntRoundVUB2 CglMixIntRoundVLB2; //============================================================================= /** Mixed Integer Rounding Cut Generator Class */ // Reference: // Hugues Marchand and Laurence A. Wolsey // Aggregation and Mixed Integer Rounding to Solve MIPs // Operations Research, 49(3), May-June 2001. // Also published as CORE Dicusion Paper 9839, June 1998. class CglMixedIntegerRounding2 : public CglCutGenerator { friend void CglMixedIntegerRounding2UnitTest(const OsiSolverInterface * siP, const std::string mpdDir); private: //--------------------------------------------------------------------------- // Enumeration constants that describe the various types of rows enum RowType { // The row type of this row is NOT defined yet. ROW_UNDEFINED, /** After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the other is a continous, and the RHS is zero.*/ ROW_VARUB, /** After the row is flipped to 'L', the row has exactly two variables: one is positive binary and the other is a continous, and the RHS is zero.*/ ROW_VARLB, /** The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous, and the RHS is zero.*/ ROW_VAREQ, // The row contains continuous and integer variables; // the total number of variables is at least 2 ROW_MIX, // The row contains only continuous variables ROW_CONT, // The row contains only integer variables ROW_INT, // The row contains other types of rows ROW_OTHER }; public: /**@name Generate Cuts */ //@{ /** Generate Mixed Integer Rounding cuts for the model data contained in si. The generated cuts are inserted in the collection of cuts cs. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} //--------------------------------------------------------------------------- /**@name Constructors and destructors */ //@{ /// Default constructor CglMixedIntegerRounding2 (); /// Alternate Constructor CglMixedIntegerRounding2 (const int maxaggr, const bool multiply, const int criterion, const int preproc = -1); /// Copy constructor CglMixedIntegerRounding2 ( const CglMixedIntegerRounding2 &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglMixedIntegerRounding2 & operator=( const CglMixedIntegerRounding2& rhs); /// Destructor virtual ~CglMixedIntegerRounding2 (); /// This can be used to refresh any inforamtion virtual void refreshSolver(OsiSolverInterface * solver); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} //--------------------------------------------------------------------------- /**@name Set and get methods */ //@{ /// Set MAXAGGR_ inline void setMAXAGGR_ (int maxaggr) { if (maxaggr > 0) { MAXAGGR_ = maxaggr; } else { throw CoinError("Unallowable value. maxaggr must be > 0", "gutsOfConstruct","CglMixedIntegerRounding2"); } } /// Get MAXAGGR_ inline int getMAXAGGR_ () const { return MAXAGGR_; } /// Set MULTIPLY_ inline void setMULTIPLY_ (bool multiply) { MULTIPLY_ = multiply; } /// Get MULTIPLY_ inline bool getMULTIPLY_ () const { return MULTIPLY_; } /// Set CRITERION_ inline void setCRITERION_ (int criterion) { if ((criterion >= 1) && (criterion <= 3)) { CRITERION_ = criterion; } else { throw CoinError("Unallowable value. criterion must be 1, 2 or 3", "gutsOfConstruct","CglMixedIntegerRounding2"); } } /// Get CRITERION_ inline int getCRITERION_ () const { return CRITERION_; } /// Set doPreproc void setDoPreproc(int value); /// Get doPreproc bool getDoPreproc() const; //@} private: //-------------------------------------------------------------------------- // Private member methods // Construct void gutsOfConstruct ( const int maxaggr, const bool multiply, const int criterion, const int preproc); // Delete void gutsOfDelete(); // Copy void gutsOfCopy (const CglMixedIntegerRounding2& rhs); // Do preprocessing. // It determines the type of each row. It also identifies the variable // upper bounds and variable lower bounds. // It may change sense and RHS for ranged rows void mixIntRoundPreprocess(const OsiSolverInterface& si); // Determine the type of a given row. RowType determineRowType(//const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const char sense, const double rhs) const; // Generate MIR cuts void generateMirCuts( const OsiSolverInterface& si, const double* xlp, const double* colUpperBound, const double* colLowerBound, const CoinPackedMatrix& matrixByRow, const double* LHS, //const double* coefByRow, //const int* colInds, //const int* rowStarts, //const CoinPackedMatrix& matrixByCol, const double* coefByCol, const int* rowInds, const int* colStarts, OsiCuts& cs ) const; // Copy row selected to CoinIndexedVector void copyRowSelected( const int iAggregate, const int rowSelected, CoinIndexedVector& setRowsAggregated, int* listRowsAggregated, double* xlpExtra, const char sen, const double rhs, const double lhs, const CoinPackedMatrix& matrixByRow, CoinIndexedVector& rowToAggregate, double& rhsToAggregate) const; // Select a row to aggregate bool selectRowToAggregate( //const OsiSolverInterface& si, const CoinIndexedVector& rowAggregated, const double* colUpperBound, const double* colLowerBound, const CoinIndexedVector& setRowsAggregated, const double* xlp, const double* coefByCol, const int* rowInds, const int* colStarts, int& rowSelected, int& colSelected ) const; // Aggregation heuristic. // Combines one or more rows of the original matrix void aggregateRow( const int colSelected, CoinIndexedVector& rowToAggregate, double rhs, CoinIndexedVector& rowAggregated, double& rhsAggregated ) const; // Choose the bound substitution based on the criteria defined by the user inline bool isLowerSubst(const double inf, const double aj, const double xlp, const double LB, const double UB) const; // Bound substitution heuristic bool boundSubstitution( const OsiSolverInterface& si, const CoinIndexedVector& rowAggregated, const double* xlp, const double* xlpExtra, const double* colUpperBound, const double* colLowerBound, CoinIndexedVector& mixedKnapsack, double& rhsMixedKnapsack, double& sStar, CoinIndexedVector& contVariablesInS ) const; // c-MIR separation heuristic bool cMirSeparation ( const OsiSolverInterface& si, const CoinPackedMatrix& matrixByRow, const CoinIndexedVector& rowAggregated, const int* listRowsAggregated, const char* sense, const double* RHS, //const double* coefByRow, //const int* colInds, const int* rowStarts, const double* xlp, const double sStar, const double* colUpperBound, const double* colLowerBound, const CoinIndexedVector& mixedKnapsack, const double& rhsMixedKnapsack, const CoinIndexedVector& contVariablesInS, CoinIndexedVector * workVector, OsiRowCut& flowCut ) const; // function to create one c-MIR inequality void cMirInequality( const int numInt, const double delta, const double numeratorBeta, const int *knapsackIndices, const double* knapsackElements, const double* xlp, const double sStar, const double* colUpperBound, const CoinIndexedVector& setC, CoinIndexedVector& cMIR, double& rhscMIR, double& sCoef, double& violation) const; // function to compute G inline double functionG( const double d, const double f ) const; // function to print statistics (used only in debug mode) void printStats( std::ofstream & fout, const bool hasCut, const OsiSolverInterface& si, const CoinIndexedVector& rowAggregated, const double& rhsAggregated, const double* xlp, const double* xlpExtra, const int* listRowsAggregated, const int* listColsSelected, const int level, const double* colUpperBound, const double* colLowerBound ) const; private: //--------------------------------------------------------------------------- // Private member data // Maximum number of rows to aggregate int MAXAGGR_; // Flag that indicates if an aggregated row is also multiplied by -1 bool MULTIPLY_; // The criterion to use in the bound substitution int CRITERION_; // Tolerance used for numerical purposes double EPSILON_; /// There is no variable upper bound or variable lower bound defined int UNDEFINED_; // If violation of a cut is greater that this number, the cut is accepted double TOLERANCE_; /** Controls the preprocessing of the matrix to identify rows suitable for cut generation.
  • -1: preprocess according to solver settings;
  • 0: Do preprocessing only if it has not yet been done;
  • 1: Do preprocessing.
Default value: -1 **/ int doPreproc_; // The number of rows of the problem. int numRows_; // The number columns of the problem. int numCols_; // Indicates whether preprocessing has been done. bool doneInitPre_; // The array of CglMixIntRoundVUB2s. CglMixIntRoundVUB2* vubs_; // The array of CglMixIntRoundVLB2s. CglMixIntRoundVLB2* vlbs_; // Array with the row types of the rows in the model. RowType* rowTypes_; // The indices of the rows of the initial matrix int* indRows_; // The number of rows of type ROW_MIX int numRowMix_; // The indices of the rows of type ROW_MIX int* indRowMix_; // The number of rows of type ROW_CONT int numRowCont_; // The indices of the rows of type ROW_CONT int* indRowCont_; // The number of rows of type ROW_INT int numRowInt_; // The indices of the rows of type ROW_INT int* indRowInt_; // The number of rows of type ROW_CONT that have at least one variable // with variable upper or lower bound int numRowContVB_; // The indices of the rows of type ROW_CONT that have at least one variable // with variable upper or lower bound int* indRowContVB_; // If integer - for speed char * integerType_; // Sense of rows (modified if ranges) char * sense_; // RHS of rows (modified if ranges) double * RHS_; }; //############################################################################# // A function that tests the methods in the CglMixedIntegerRounding2 class. The // only reason for it not to be a member method is that this way it doesn't // have to be compiled into the library. And that's a gain, because the // library should be compiled with optimization on, but this method should be // compiled with debugging. void CglMixedIntegerRounding2UnitTest(const OsiSolverInterface * siP, const std::string mpdDir); #endif Cgl-0.58.9/src/CglGMI/0000755000076600007660000000000012377555671012653 5ustar coincoinCgl-0.58.9/src/CglGMI/CglGMI.hpp0000644000076600007660000002656112130104734014411 0ustar coincoin// Last edit: 02/05/2013 // // Name: CglGMI.hpp // Author: Giacomo Nannicini // Singapore University of Technology and Design, Singapore // email: nannicini@sutd.edu.sg // Date: 11/17/09 //----------------------------------------------------------------------------- // Copyright (C) 2009, Giacomo Nannicini. All Rights Reserved. #ifndef CglGMI_H #define CglGMI_H #include "CglCutGenerator.hpp" #include "CglGMIParam.hpp" #include "CoinWarmStartBasis.hpp" #include "CoinFactorization.hpp" /* Enable tracking of rejection of cutting planes. If this is disabled, the cut generator is slightly faster. If defined, it enables proper use of setTrackRejection and related functions. */ //#define TRACK_REJECT /* Debug output */ //#define GMI_TRACE /* Debug output: print optimal tableau */ //#define GMI_TRACETAB /* Print reason for cut rejection, whenever a cut is discarded */ //#define GMI_TRACE_CLEAN /** Gomory cut generator with several cleaning procedures, used to test * the numerical safety of the resulting cuts */ class CglGMI : public CglCutGenerator { friend void CglGMIUnitTest(const OsiSolverInterface * siP, const std::string mpdDir); public: /** Public enum: all possible reasons for cut rejection */ enum RejectionType{ failureFractionality, failureDynamism, failureViolation, failureSupport, failureScale }; /**@name generateCuts */ //@{ /** Generate Gomory Mixed-Integer cuts for the model of the solver interface si. Insert the generated cuts into OsiCuts cs. Warning: This generator currently works only with the Lp solvers Clp or Cplex9.0 or higher. It requires access to the optimal tableau and optimal basis inverse and makes assumptions on the way slack variables are added by the solver. The Osi implementations for Clp and Cplex verify these assumptions. When calling the generator, the solver interface si must contain an optimized problem and information related to the optimal basis must be available through the OsiSolverInterface methods (si->optimalBasisIsAvailable() must return 'true'). It is also essential that the integrality of structural variable i can be obtained using si->isInteger(i). */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /// Return true if needs optimal basis to do cuts (will return true) virtual bool needsOptimalBasis() const { return true; } //@} /**@name Common Methods */ //@{ // Function for checking equality with user tolerance inline bool areEqual(double x, double y, double epsAbs = 1e-12, double epsRel = 1e-12) { return (fabs((x) - (y)) <= std::max(epsAbs, epsRel * std::max(fabs(x), fabs(y)))); } // Function for checking is a number is zero inline bool isZero(double x, double epsZero = 1e-20) { return (fabs(x) <= epsZero); } // Function for checking if a number is integer inline bool isIntegerValue(double x, double intEpsAbs = 1e-9, double intEpsRel = 1e-15) { return (fabs((x) - floor((x)+0.5)) <= std::max(intEpsAbs, intEpsRel * fabs(x))); } //@} /**@name Public Methods */ //@{ // Set the parameters to the values of the given CglGMIParam object. void setParam(const CglGMIParam &source); // Return the CglGMIParam object of the generator. inline CglGMIParam getParam() const {return param;} inline CglGMIParam & getParam() {return param;} // Compute entries of is_integer. void computeIsInteger(); /// Print the current simplex tableau void printOptTab(OsiSolverInterface *solver) const; /// Set/get tracking of the rejection of cutting planes. /// Note that all rejection related functions will not do anything /// unless the generator is compiled with the define GMI_TRACK_REJECTION void setTrackRejection(bool value); bool getTrackRejection(); /// Get number of cuts rejected for given reason; see above int getNumberRejectedCuts(RejectionType reason); /// Reset counters for cut rejection tracking; see above void resetRejectionCounters(); /// Get total number of generated cuts since last resetRejectionCounters() int getNumberGeneratedCuts(); //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglGMI(); /// Constructor with specified parameters CglGMI(const CglGMIParam ¶m); /// Copy constructor CglGMI(const CglGMI &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglGMI & operator=(const CglGMI& rhs); /// Destructor virtual ~CglGMI(); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} private: // Private member methods /**@name Private member methods */ //@{ // Method generating the cuts after all CglGMI members are properly set. void generateCuts(OsiCuts & cs); /// Compute the fractional part of value, allowing for small error. inline double aboveInteger(double value) const; /// Compute the fractionalities involved in the cut, and the cut rhs. /// Returns true if cut is accepted, false if discarded inline bool computeCutFractionality(double varRhs, double& cutRhs); /// Compute the cut coefficient on a given variable inline double computeCutCoefficient(double rowElem, int index); /// Use multiples of the initial inequalities to cancel out the coefficient /// on a slack variables. inline void eliminateSlack(double cutElem, int cutIndex, double* cut, double& cutRhs, const double *elements, const int *rowStart, const int *indices, const int *rowLength, const double *rhs); /// Change the sign of the coefficients of the non basic /// variables at their upper bound. inline void flip(double& rowElem, int rowIndex); /// Change the sign of the coefficients of the non basic /// variables at their upper bound and do the translations restoring /// the original bounds. Modify the right hand side /// accordingly. Two functions: one for original variables, one for slacks. inline void unflipOrig(double& rowElem, int rowIndex, double& rowRhs); inline void unflipSlack(double& rowElem, int rowIndex, double& rowRhs, const double* slack_val); /// Pack a row of ncol elements inline void packRow(double* row, double* rowElem, int* rowIndex, int& rowNz); /// Clean the cutting plane; the cleaning procedure does several things /// like removing small coefficients, scaling, and checks several /// acceptance criteria. If this returns false, the cut should be discarded. /// There are several cleaning procedures available, that can be selected /// via the parameter param.setCLEANING_PROCEDURE(int value) bool cleanCut(double* cutElem, int* cutIndex, int& cutNz, double& cutRhs, const double* xbar); /// Cut cleaning procedures: return true if successfull, false if /// cut should be discarded by the caller of if problems encountered /// Check the violation bool checkViolation(const double* cutElem, const int* cutIndex, int cutNz, double cutrhs, const double* xbar); /// Check the dynamism bool checkDynamism(const double* cutElem, const int* cutIndex, int cutNz); /// Check the support bool checkSupport(int cutNz); /// Remove small coefficients and adjust the rhs accordingly bool removeSmallCoefficients(double* cutElem, int* cutIndex, int& cutNz, double& cutRhs); /// Adjust the rhs by relaxing by a small amount (relative or absolute) void relaxRhs(double& rhs); /// Scale the cutting plane in different ways; /// scaling_type possible values: /// 0 : scale to obtain integral cut /// 1 : scale based on norm, to obtain cut norm equal to ncol /// 2 : scale to obtain largest coefficient equal to 1 bool scaleCut(double* cutElem, int* cutIndex, int cutNz, double& cutRhs, int scalingType); /// Scale the cutting plane in order to generate integral coefficients bool scaleCutIntegral(double* cutElem, int* cutIndex, int cutNz, double& cutRhs); /// Compute the nearest rational number; used by scale_row_integral bool nearestRational(double val, double maxdelta, long maxdnom, long& numerator, long& denominator); /// Compute the greatest common divisor long computeGcd(long a, long b); /// print a vector of integers void printvecINT(const char *vecstr, const int *x, int n) const; /// print a vector of doubles: dense form void printvecDBL(const char *vecstr, const double *x, int n) const; /// print a vector of doubles: sparse form void printvecDBL(const char *vecstr, const double *elem, const int * index, int nz) const; /// Recompute the simplex tableau for want of a better accuracy. /// Requires an empty CoinFactorization object to do the computations, /// and two empty (already allocated) arrays which will contain /// the basis indices on exit. Returns 0 if successfull. int factorize(CoinFactorization & factorization, int* colBasisIndex, int* rowBasisIndex); //@} // Private member data /**@name Private member data */ //@{ /// Object with CglGMIParam members. CglGMIParam param; /// Number of rows ( = number of slack variables) in the current LP. int nrow; /// Number of structural variables in the current LP. int ncol; /// Lower bounds for structural variables const double *colLower; /// Upper bounds for structural variables const double *colUpper; /// Lower bounds for constraints const double *rowLower; /// Upper bounds for constraints const double *rowUpper; /// Righ hand side for constraints (upper bound for ranged constraints). const double *rowRhs; /// Characteristic vectors of structural integer variables or continuous /// variables currently fixed to integer values. bool *isInteger; /// Current basis status: columns int *cstat; /// Current basis status: rows int *rstat; /// Pointer on solver. Reset by each call to generateCuts(). OsiSolverInterface *solver; /// Pointer on point to separate. Reset by each call to generateCuts(). const double *xlp; /// Pointer on row activity. Reset by each call to generateCuts(). const double *rowActivity; /// Pointer on matrix of coefficient ordered by rows. /// Reset by each call to generateCuts(). const CoinPackedMatrix *byRow; /// Pointer on matrix of coefficient ordered by columns. /// Reset by each call to generateCuts(). const CoinPackedMatrix *byCol; /// Fractionality of the cut and related quantities. double f0; double f0compl; double ratiof0compl; #if defined(TRACK_REJECT) || defined (TRACK_REJECT_SIMPLE) /// Should we track the reason of each cut rejection? bool trackRejection; /// Number of failures by type int fracFail; int dynFail; int violFail; int suppFail; int smallCoeffFail; int scaleFail; /// Total number of generated cuts int numGeneratedCuts; #endif //@} }; //############################################################################# /** A function that tests the methods in the CglGMI class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglGMIUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglGMI/CglGMIParam.cpp0000644000076600007660000001475712130104734015371 0ustar coincoin// Name: CglGMIParam.hpp // Author: Giacomo Nannicini // Singapore University of Technology and Design // email: nannicini@sutd.edu.sg // based on CglRedSplitParam.cpp by Francois Margot // Date: 11/17/09 //----------------------------------------------------------------------------- // Copyright (C) 2009, Giacomo Nannicini and others. All Rights Reserved. #include #include #include #include #include #include #include "CoinPragma.hpp" #include "CglGMIParam.hpp" /***********************************************************************/ void CglGMIParam::setAway(double value) { if (value > 0.0 && value <= 0.5) { AWAY = value; } else { printf("### WARNING: CglGMIParam::setAWAY(): value: %f ignored\n", value); } } /***********************************************************************/ void CglGMIParam::setEPS_ELIM(double value) { if (value >= 0) { EPS_ELIM = value; } else { printf("### WARNING: CglGMIParam::setEPS_ELIM(): value: %f ignored\n", value); } } /* setEPS_ELIM */ /***********************************************************************/ void CglGMIParam::setEPS_RELAX_ABS(double value) { if (value >= 0) { EPS_RELAX_ABS = value; } else { printf("### WARNING: CglGMIParam::setEPS_RELAX_ABS(): value: %f ignored\n", value); } } /* setEPS_RELAX_ABS */ /***********************************************************************/ void CglGMIParam::setEPS_RELAX_REL(double value) { if (value >= 0) { EPS_RELAX_REL = value; } else { printf("### WARNING: CglGMIParam::setEPS_RELAX_REL(): value: %f ignored\n", value); } } /* setEPS_RELAX_REL */ /***********************************************************************/ void CglGMIParam::setMAXDYN(double value) { if (value >= 1.0) { MAXDYN = value; } else { printf("### WARNING: CglGMI::setMAXDYN(): value: %f ignored\n", value); } } /* setMAXDYN */ /***********************************************************************/ void CglGMIParam::setMINVIOL(double value) { if (value >= 0.0) { MINVIOL = value; } else { printf("### WARNING: CglGMIParam::setMINVIOL(): value: %f ignored\n", value); } } /* setMINVIOL */ /***********************************************************************/ void CglGMIParam::setMAX_SUPPORT_REL(double value) { if (value >= 0.0 && value <= 1.0) { MAX_SUPPORT_REL = value; } else { printf("### WARNING: CglGMIParam::setMAX_SUPPORT_REL(): value: %f ignored\n", value); } } /* setMAX_SUPPORT_REL */ /***********************************************************************/ void CglGMIParam::setUSE_INTSLACKS(bool value) { USE_INTSLACKS = value; } /* setUSE_INTSLACKS */ /***********************************************************************/ void CglGMIParam::setCHECK_DUPLICATES(bool value) { CHECK_DUPLICATES = value; } /* setCHECK_DUPLICATES */ /***********************************************************************/ void CglGMIParam::setINTEGRAL_SCALE_CONT(bool value) { INTEGRAL_SCALE_CONT = value; } /* setINTEGRAL_SCALE_CONT */ /***********************************************************************/ void CglGMIParam::setENFORCE_SCALING(bool value) { ENFORCE_SCALING = value; } /* setENFORCE_SCALING */ /***********************************************************************/ void CglGMIParam::setCLEAN_PROC(CleaningProcedure value) { CLEAN_PROC = value; } /* setCLEAN_PROC */ /***********************************************************************/ CglGMIParam::CglGMIParam(double eps, double away, double eps_coeff, double eps_el, double eps_relax_abs, double eps_relax_rel, double max_dyn, double min_viol, int max_supp_abs, double max_supp_rel, CleaningProcedure clean_proc, bool use_int_slacks, bool check_duplicates, bool integral_scale_cont, bool enforce_scaling) : CglParam(COIN_DBL_MAX, eps, eps_coeff, max_supp_abs), AWAY(away), EPS_ELIM(eps_el), EPS_RELAX_ABS(eps_relax_abs), EPS_RELAX_REL(eps_relax_rel), MAXDYN(max_dyn), MINVIOL(min_viol), MAX_SUPPORT_REL(max_supp_rel), CLEAN_PROC(clean_proc), USE_INTSLACKS(use_int_slacks), CHECK_DUPLICATES(check_duplicates), INTEGRAL_SCALE_CONT(integral_scale_cont), ENFORCE_SCALING(enforce_scaling) {} /***********************************************************************/ CglGMIParam::CglGMIParam(CglParam &source, double away, double eps_el, double eps_ra, double eps_rr, double max_dyn, double min_viol, double max_supp_rel, CleaningProcedure clean_proc, bool use_int_slacks, bool check_duplicates, bool integral_scale_cont, bool enforce_scaling) : CglParam(source), AWAY(away), EPS_ELIM(eps_el), EPS_RELAX_ABS(eps_ra), EPS_RELAX_REL(eps_rr), MAXDYN(max_dyn), MINVIOL(min_viol), MAX_SUPPORT_REL(max_supp_rel), CLEAN_PROC(clean_proc), USE_INTSLACKS(use_int_slacks), CHECK_DUPLICATES(check_duplicates), INTEGRAL_SCALE_CONT(integral_scale_cont), ENFORCE_SCALING(enforce_scaling) {} /***********************************************************************/ CglGMIParam::CglGMIParam(const CglGMIParam &source) : CglParam(source), AWAY(source.AWAY), EPS_ELIM(source.EPS_ELIM), EPS_RELAX_ABS(source.EPS_RELAX_ABS), EPS_RELAX_REL(source.EPS_RELAX_REL), MAXDYN(source.MAXDYN), MINVIOL(source.MINVIOL), MAX_SUPPORT_REL(source.MAX_SUPPORT_REL), CLEAN_PROC(source.CLEAN_PROC), USE_INTSLACKS(source.USE_INTSLACKS), CHECK_DUPLICATES(source.CHECK_DUPLICATES), INTEGRAL_SCALE_CONT(source.INTEGRAL_SCALE_CONT), ENFORCE_SCALING(source.ENFORCE_SCALING) {} /***********************************************************************/ CglGMIParam* CglGMIParam::clone() const { return new CglGMIParam(*this); } /***********************************************************************/ CglGMIParam& CglGMIParam::operator=(const CglGMIParam &rhs) { if(this != &rhs) { CglParam::operator=(rhs); AWAY = rhs.AWAY; EPS_ELIM = rhs.EPS_ELIM; EPS_RELAX_ABS = rhs.EPS_RELAX_ABS; EPS_RELAX_REL = rhs.EPS_RELAX_REL; MAXDYN = rhs.MAXDYN; MINVIOL = rhs.MINVIOL; MAX_SUPPORT_REL = rhs.MAX_SUPPORT_REL; CLEAN_PROC = rhs.CLEAN_PROC; USE_INTSLACKS = rhs.USE_INTSLACKS; CHECK_DUPLICATES = rhs.CHECK_DUPLICATES; INTEGRAL_SCALE_CONT = rhs.INTEGRAL_SCALE_CONT; ENFORCE_SCALING = rhs.ENFORCE_SCALING; } return *this; } /***********************************************************************/ CglGMIParam::~CglGMIParam() {} Cgl-0.58.9/src/CglGMI/CglGMIParam.hpp0000644000076600007660000002704712130104734015372 0ustar coincoin// Name: CglGMIParam.hpp // Author: Giacomo Nannicini // Singapore University of Technology and Design // email: nannicini@sutd.edu.sg // based on CglRedSplitParam.hpp by Francois Margot // Date: 11/17/09 //----------------------------------------------------------------------------- // Copyright (C) 2009, Giacomo Nannicini and others. All Rights Reserved. #ifndef CglGMIParam_H #define CglGMIParam_H #include "CglParam.hpp" /**@name CglGMI Parameters */ //@{ /** Class collecting parameters for the GMI cut generator. Parameters of the generator are listed below. Modifying the default values for parameters other than the last four might result in invalid cuts. - MAXDYN: Maximum ratio between largest and smallest non zero coefficients in a cut. See method setMAXDYN(). - EPS_ELIM: Precision for deciding if a coefficient is zero when eliminating slack variables. See method setEPS_ELIM(). - MINVIOL: Minimum violation for the current basic solution in a generated cut. See method setMINVIOL(). - USE_INTSLACKS: Use integer slacks to generate cuts. (not implemented yet, will be in the future). See method setUSE_INTSLACKS(). - AWAY: Look only at basic integer variables whose current value is at least this value away from being integer. See method setAway(). - CHECK_DUPLICATES: Should we check for duplicates when adding a cut to the collection? Can be slow. Default 0 - do not check, add cuts anyway. - CLEAN_PROC: Cleaning procedure that should be used. Look below at the enumeration CleaningProcedure for possible values. - INTEGRAL_SCALE_CONT: If we try to scale cut coefficients so that they become integral, do we also scale on continuous variables? Default 0 - do not scale continuous vars. Used only if CLEAN_PROC does integral scaling. - ENFORCE_SCALING: Discard badly scaled cuts, or keep them (unscaled). Default 1 - yes. */ //@} class CglGMIParam : public CglParam { public: /**@name Enumerations */ enum CleaningProcedure{ /* CglLandP procedure I */ CP_CGLLANDP1, /* CglLandP procedure II */ CP_CGLLANDP2, /* CglRedSplit procedure I */ CP_CGLREDSPLIT, /* Only integral cuts, i.e. cuts with integral coefficients */ CP_INTEGRAL_CUTS, /* CglLandP procedure I with integral scaling */ CP_CGLLANDP1_INT, /* CglLandP procedure I with scaling of the max element to 1 if possible */ CP_CGLLANDP1_SCALEMAX, /* CglLandP procedure I with scaling of the rhs to 1 if possible */ CP_CGLLANDP1_SCALERHS }; /**@name Set/get methods */ //@{ /** Aliases for parameter get/set method in the base class CglParam */ /** Value for Infinity. Default: DBL_MAX */ inline void setInfinity(double value) {setINFINIT(value);} inline double getInfinity() const {return INFINIT;} /** Epsilon for comparing numbers. Default: 1.0e-6 */ inline void setEps(double value) {setEPS(value);} inline double getEps() const {return EPS;} /** Epsilon for zeroing out coefficients. Default: 1.0e-5 */ inline void setEpsCoeff(double value) {setEPS_COEFF(value);} inline double getEpsCoeff() const {return EPS_COEFF;} /** Maximum support of the cutting planes. Default: INT_MAX */ inline void setMaxSupport(int value) {setMAX_SUPPORT(value);} inline int getMaxSupport() const {return MAX_SUPPORT;} /** Alias for consistency with our naming scheme */ inline void setMaxSupportAbs(int value) {setMAX_SUPPORT(value);} inline int getMaxSupportAbs() const {return MAX_SUPPORT;} inline int getMAX_SUPPORT_ABS() const {return MAX_SUPPORT;} /** Set AWAY, the minimum distance from being integer used for selecting rows for cut generation; all rows whose pivot variable should be integer but is more than away from integrality will be selected; Default: 0.005 */ virtual void setAway(double value); /** Get value of away */ inline double getAway() const {return AWAY;} /// Aliases inline void setAWAY(double value) {setAway(value);} inline double getAWAY() const {return AWAY;} /** Set the value of EPS_ELIM, epsilon for values of coefficients when eliminating slack variables; Default: 0 */ virtual void setEPS_ELIM(double value); /** Get the value of EPS_ELIM */ inline double getEPS_ELIM() const {return EPS_ELIM;} /// Aliases inline void setEpsElim(double value) {setEPS_ELIM(value);} inline double getEpsElim() const {return EPS_ELIM;} /** Set EPS_RELAX_ABS */ virtual void setEPS_RELAX_ABS(double value); /** Get value of EPS_RELAX_ABS */ inline double getEPS_RELAX_ABS() const {return EPS_RELAX_ABS;} /// Aliases inline void setEpsRelaxAbs(double value) {setEPS_RELAX_ABS(value);} inline double getEpsRelaxAbs() const {return EPS_RELAX_ABS;} /** Set EPS_RELAX_REL */ virtual void setEPS_RELAX_REL(double value); /** Get value of EPS_RELAX_REL */ inline double getEPS_RELAX_REL() const {return EPS_RELAX_REL;} /// Aliases inline void setEpsRelaxRel(double value) {setEPS_RELAX_REL(value);} inline double getEpsRelaxRel() const {return EPS_RELAX_REL;} // Set the maximum ratio between largest and smallest non zero // coefficients in a cut. Default: 1e6. virtual void setMAXDYN(double value); /** Get the value of MAXDYN */ inline double getMAXDYN() const {return MAXDYN;} /// Aliases inline void setMaxDyn(double value) {setMAXDYN(value);} inline double getMaxDyn() const {return MAXDYN;} /** Set the value of MINVIOL, the minimum violation for the current basic solution in a generated cut. Default: 1e-7 */ virtual void setMINVIOL(double value); /** Get the value of MINVIOL */ inline double getMINVIOL() const {return MINVIOL;} /// Aliases inline void setMinViol(double value) {setMINVIOL(value);} inline double getMinViol() const {return MINVIOL;} /** Set the value of MAX_SUPPORT_REL, the factor contributing to the maximum support relative to the number of columns. Maximum allowed support is: MAX_SUPPORT_ABS + MAX_SUPPORT_REL*ncols. Default: 0.1 */ virtual void setMAX_SUPPORT_REL(double value); /** Get the value of MINVIOL */ inline double getMAX_SUPPORT_REL() const {return MAX_SUPPORT_REL;} /// Aliases inline void setMaxSupportRel(double value) {setMAX_SUPPORT_REL(value);} inline double getMaxSupportRel() const {return MAX_SUPPORT_REL;} /** Set the value of USE_INTSLACKS. Default: 0 */ virtual void setUSE_INTSLACKS(bool value); /** Get the value of USE_INTSLACKS */ inline bool getUSE_INTSLACKS() const {return USE_INTSLACKS;} /// Aliases inline void setUseIntSlacks(bool value) {setUSE_INTSLACKS(value);} inline int getUseIntSlacks() const {return USE_INTSLACKS;} /** Set the value of CHECK_DUPLICATES. Default: 0 */ virtual void setCHECK_DUPLICATES(bool value); /** Get the value of CHECK_DUPLICATES */ inline bool getCHECK_DUPLICATES() const {return CHECK_DUPLICATES;} /// Aliases inline void setCheckDuplicates(bool value) {setCHECK_DUPLICATES(value);} inline bool getCheckDuplicates() const {return CHECK_DUPLICATES;} /** Set the value of CLEAN_PROC. Default: CP_CGLLANDP1 */ virtual void setCLEAN_PROC(CleaningProcedure value); /** Get the value of CLEAN_PROC. */ inline CleaningProcedure getCLEAN_PROC() const {return CLEAN_PROC;} /// Aliases inline void setCleanProc(CleaningProcedure value) {setCLEAN_PROC(value);} inline CleaningProcedure getCleaningProcedure() const {return CLEAN_PROC;} /** Set the value of INTEGRAL_SCALE_CONT. Default: 0 */ virtual void setINTEGRAL_SCALE_CONT(bool value); /** Get the value of INTEGRAL_SCALE_CONT. */ inline bool getINTEGRAL_SCALE_CONT() const {return INTEGRAL_SCALE_CONT;} /// Aliases inline void setIntegralScaleCont(bool value) {setINTEGRAL_SCALE_CONT(value);} inline bool getIntegralScaleCont() const {return INTEGRAL_SCALE_CONT;} /** Set the value of ENFORCE_SCALING. Default: 1 */ virtual void setENFORCE_SCALING(bool value); /** Get the value of ENFORCE_SCALING. */ inline bool getENFORCE_SCALING() const {return ENFORCE_SCALING;} /// Aliases inline void setEnforceScaling(bool value) {setENFORCE_SCALING(value);} inline bool getEnforcescaling() const {return ENFORCE_SCALING;} //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglGMIParam(double eps = 1e-12, double away = 0.005, double eps_coeff = 1e-11, double eps_elim = 0, double eps_relax_abs = 1e-11, double eps_relax_rel = 1e-13, double max_dyn = 1e6, double min_viol = 1e-4, int max_supp_abs = 1000, double max_supp_rel = 0.1, CleaningProcedure clean_proc = CP_CGLLANDP1, bool use_int_slacks = false, bool check_duplicates = false, bool integral_scale_cont = false, bool enforce_scaling = true); /// Constructor from CglParam CglGMIParam(CglParam &source, double away = 0.005, double eps_elim = 1e-12, double eps_relax_abs = 1e-11, double eps_relax_rel = 1e-13, double max_dyn = 1e6, double min_viol = 1e-4, double max_supp_rel = 0.1, CleaningProcedure clean_proc = CP_CGLLANDP1, bool use_int_slacks = false, bool check_duplicates = false, bool integral_scale_cont = false, bool enforce_scaling = true); /// Copy constructor CglGMIParam(const CglGMIParam &source); /// Clone virtual CglGMIParam* clone() const; /// Assignment operator virtual CglGMIParam& operator=(const CglGMIParam &rhs); /// Destructor virtual ~CglGMIParam(); //@} protected: /**@name Parameters */ //@{ /** Use row only if pivot variable should be integer but is more than AWAY from being integer. */ double AWAY; /** Epsilon for value of coefficients when eliminating slack variables. Default: 0. */ double EPS_ELIM; /** Value added to the right hand side of each generated cut to relax it. Default: 1e-11 */ double EPS_RELAX_ABS; /** For a generated cut with right hand side rhs_val, EPS_RELAX_EPS * fabs(rhs_val) is used to relax the constraint. Default: 1.e-13 */ double EPS_RELAX_REL; /** Maximum ratio between largest and smallest non zero coefficients in a cut. Default: 1e6. */ double MAXDYN; /** Minimum violation for the current basic solution in a generated cut. Default: 1e-4. */ double MINVIOL; /** Maximum support relative to number of columns. Must be between 0 and 1. Default: 0. */ double MAX_SUPPORT_REL; /** Which cleaning procedure should be used? */ CleaningProcedure CLEAN_PROC; /** Use integer slacks to generate cuts if USE_INTSLACKS = 1. Default: 0. */ bool USE_INTSLACKS; /** Check for duplicates when adding the cut to the collection? */ bool CHECK_DUPLICATES; /** Should we try to rescale cut coefficients on continuous variables so that they become integral, or do we only rescale coefficients on integral variables? Used only by cleaning procedure that try the integral scaling. */ bool INTEGRAL_SCALE_CONT; /** Should we discard badly scaled cuts (according to the scaling procedure in use)? If false, CglGMI::scaleCut always returns true, even though it still scales cuts whenever possible, but not cut is rejected for scaling. Default true. Used only by cleaning procedure that try to scale. */ bool ENFORCE_SCALING; //@} }; #endif Cgl-0.58.9/src/CglGMI/CglGMI.cpp0000644000076600007660000013226112130104734014377 0ustar coincoin// Last edit: 02/05/2013 // // Name: CglGMI.cpp // Author: Giacomo Nannicini // Singapore University of Technology and Design, Singapore // email: nannicini@sutd.edu.sg // Date: 11/17/09 //----------------------------------------------------------------------------- // Copyright (C) 2009, Giacomo Nannicini. All Rights Reserved. #include #include #include #include #include #include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinIndexedVector.hpp" #include "OsiSolverInterface.hpp" #include "OsiRowCutDebugger.hpp" #include "CoinFactorization.hpp" #include "CglGMI.hpp" #include "CoinFinite.hpp" //------------------------------------------------------------------- // Generate GMI cuts //------------------------------------------------------------------- /***************************************************************************/ CglGMI::CglGMI() : CglCutGenerator(), param(), nrow(0), ncol(0), colLower(NULL), colUpper(NULL), rowLower(NULL), rowUpper(NULL), rowRhs(NULL), isInteger(NULL), cstat(NULL), rstat(NULL), solver(NULL), xlp(NULL), rowActivity(NULL), byRow(NULL), byCol(NULL), f0(0.0), f0compl(0.0), ratiof0compl(0.0) #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE , trackRejection(false), fracFail(0), dynFail(0), violFail(0), suppFail(0), scaleFail(0), numGeneratedCuts(0) #endif { } /***************************************************************************/ CglGMI::CglGMI(const CglGMIParam ¶meters) : CglCutGenerator(), param(parameters), nrow(0), ncol(0), colLower(NULL), colUpper(NULL), rowLower(NULL), rowUpper(NULL), rowRhs(NULL), isInteger(NULL), cstat(NULL), rstat(NULL), solver(NULL), xlp(NULL), rowActivity(NULL), byRow(NULL), byCol(NULL), f0(0.0), f0compl(0.0), ratiof0compl(0.0) #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE , trackRejection(false), fracFail(0), dynFail(0), violFail(0), suppFail(0), scaleFail(0), numGeneratedCuts(0) #endif { } /***************************************************************************/ CglGMI::CglGMI(const CglGMI& rhs) : CglCutGenerator(rhs), param(rhs.param), nrow(rhs.nrow), ncol(rhs.ncol), colLower(rhs.colLower), colUpper(rhs.colUpper), rowLower(rhs.rowLower), rowUpper(rhs.rowUpper), rowRhs(rhs.rowRhs), isInteger(rhs.isInteger), cstat(rhs.cstat), rstat(rhs.rstat), solver(rhs.solver), xlp(rhs.xlp), rowActivity(rhs.rowActivity), byRow(rhs.byRow), byCol(rhs.byCol), f0(rhs.f0), f0compl(rhs.f0compl), ratiof0compl(rhs.ratiof0compl) #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE , trackRejection(rhs.trackRejection), fracFail(rhs.fracFail), dynFail(rhs.dynFail), violFail(rhs.violFail), suppFail(rhs.suppFail), scaleFail(rhs.scaleFail), numGeneratedCuts(rhs.numGeneratedCuts) #endif { } /***************************************************************************/ CglGMI & CglGMI::operator=(const CglGMI& rhs) { if(this != &rhs){ CglCutGenerator::operator=(rhs); param = rhs.param; nrow = rhs.nrow; ncol = rhs.ncol; colLower = rhs.colLower; colUpper = rhs.colUpper; rowLower = rhs.rowLower; rowUpper = rhs.rowUpper; rowRhs = rhs.rowRhs; isInteger = rhs.isInteger; cstat = rhs.cstat; rstat = rhs.rstat; solver = rhs.solver; xlp = rhs.xlp; rowActivity = rhs.rowActivity; byRow = rhs.byRow; byCol = rhs.byCol; f0 = rhs.f0; f0compl = rhs.f0compl; ratiof0compl = rhs.ratiof0compl; #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE trackRejection = rhs.trackRejection; fracFail = rhs.fracFail; dynFail = rhs.dynFail; violFail = rhs.violFail; suppFail = rhs.suppFail; scaleFail = rhs.scaleFail; numGeneratedCuts = rhs.numGeneratedCuts; #endif } return *this; } /***************************************************************************/ CglGMI::~CglGMI() { } /*********************************************************************/ CglCutGenerator * CglGMI::clone() const { return new CglGMI(*this); } /***************************************************************************/ // Returns (value - floor) inline double CglGMI::aboveInteger(double value) const { return (value - floor(value)); } /* aboveInteger */ /**********************************************************/ void CglGMI::printvecINT(const char *vecstr, const int *x, int n) const { int num, fromto, upto; num = (n/10) + 1; printf("%s :\n", vecstr); for (int j = 0; j < num; ++j) { fromto = 10*j; upto = 10 * (j+1); if(n <= upto) upto = n; for (int i = fromto; i < upto; ++i) printf(" %4d", x[i]); printf("\n"); } printf("\n"); } /* printvecINT */ /**********************************************************/ void CglGMI::printvecDBL(const char *vecstr, const double *x, int n) const { int num, fromto, upto; num = (n/10) + 1; printf("%s :\n", vecstr); for (int j = 0; j < num; ++j) { fromto = 10*j; upto = 10 * (j+1); if(n <= upto) upto = n; for (int i = fromto; i < upto; ++i) printf(" %7.3f", x[i]); printf("\n"); } printf("\n"); } /* printvecDBL */ /**********************************************************/ void CglGMI::printvecDBL(const char *vecstr, const double *elem, const int * index, int nz) const { printf("%s\n", vecstr); int written = 0; for (int j = 0; j < nz; ++j) { written += printf("%d:%.3f ", index[j], elem[j]); if (written > 70) { printf("\n"); written = 0; } } if (written > 0) { printf("\n"); } } /* printvecDBL */ /************************************************************************/ inline bool CglGMI::computeCutFractionality(double varRhs, double& cutRhs) { f0 = aboveInteger(varRhs); f0compl = 1 - f0; if (f0 < param.getAway() || f0compl < param.getAway()) return false; ratiof0compl = f0/f0compl; cutRhs = -f0; return true; } /* computeCutFractionality */ /************************************************************************/ inline double CglGMI::computeCutCoefficient(double rowElem, int index) { // See Wolsey "Integer Programming" (1998), p. 130, fourth line from top // after correcting typo (Proposition 8.8), flipping all signs to get <=. if (index < ncol && isInteger[index]) { double f = aboveInteger(rowElem); if(f > f0) { return (-((1-f) * ratiof0compl)); } else { return (-f); } } else{ if(rowElem < 0) { return (rowElem*ratiof0compl); } else { return (-rowElem); } } } /* computeCutCoefficient */ /************************************************************************/ inline void CglGMI::eliminateSlack(double cutElem, int index, double* cut, double& cutRhs, const double *elements, const int *rowStart, const int *indices, const int *rowLength, const double *rhs) { // now i is where coefficients on slack variables begin; // eliminate the slacks int rowpos = index - ncol; if(fabs(cutElem) > param.getEPS_ELIM()) { if (areEqual(rowLower[rowpos], rowUpper[rowpos], param.getEPS(), param.getEPS())) { // "almost" fixed slack, we'll just skip it return; } int upto = rowStart[rowpos] + rowLength[rowpos]; for (int j = rowStart[rowpos]; j < upto; ++j) { cut[indices[j]] -= cutElem * elements[j]; } cutRhs -= cutElem * rhs[rowpos]; } } /* eliminateSlack */ /************************************************************************/ inline void CglGMI::flip(double& rowElem, int index) { if ((index < ncol && cstat[index] == 2) || (index >= ncol && rstat[index-ncol] == 2)) { rowElem = -rowElem; } } /* flip */ /************************************************************************/ inline void CglGMI::unflipOrig(double& rowElem, int index, double& rowRhs) { if (cstat[index] == 2) { // structural variable at upper bound rowElem = -rowElem; rowRhs += rowElem*colUpper[index]; } else if (cstat[index] == 3) { // structural variable at lower bound rowRhs += rowElem*colLower[index]; } } /* unflipOrig */ /************************************************************************/ inline void CglGMI::unflipSlack(double& rowElem, int index, double& rowRhs, const double* slackVal) { if (rstat[index-ncol] == 2) { // artificial variable at upper bound rowElem = -rowElem; rowRhs += rowElem*slackVal[index-ncol]; } else if (rstat[index-ncol] == 3) { // artificial variable at lower bound rowRhs += rowElem*slackVal[index-ncol]; } } /* unflipSlack */ /************************************************************************/ inline void CglGMI::packRow(double* row, double* rowElem, int* rowIndex, int& rowNz) { rowNz = 0; for (int i = 0; i < ncol; ++i) { if (!isZero(fabs(row[i]))) { rowElem[rowNz] = row[i]; rowIndex[rowNz] = i; rowNz++; } } } /************************************************************************/ bool CglGMI::cleanCut(double* cutElem, int* cutIndex, int& cutNz, double& cutRhs, const double* xbar) { CglGMIParam::CleaningProcedure cleanProc = param.getCLEAN_PROC(); if (cleanProc == CglGMIParam::CP_CGLLANDP1) { if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } relaxRhs(cutRhs); removeSmallCoefficients(cutElem, cutIndex, cutNz, cutRhs); if (!checkSupport(cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: too large support\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { suppFail++; } #endif return false; } if (!checkDynamism(cutElem, cutIndex, cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad dynamism\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { dynFail++; } #endif return false; } if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation (final check)\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } } /* end of cleaning procedure CP_CGLLANDP1 */ else if (cleanProc == CglGMIParam::CP_CGLLANDP2) { if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } relaxRhs(cutRhs); if (!checkDynamism(cutElem, cutIndex, cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad dynamism\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { dynFail++; } #endif return false; } if (!scaleCut(cutElem, cutIndex, cutNz, cutRhs, 1) && param.getENFORCE_SCALING()) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad scaling\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { scaleFail++; } #endif return false; } removeSmallCoefficients(cutElem, cutIndex, cutNz, cutRhs); if (!checkSupport(cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: too large support\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { suppFail++; } #endif return false; } if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation (final check)\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } } /* end of cleaning procedure CP_CGLLANDP2 */ else if (cleanProc == CglGMIParam::CP_CGLREDSPLIT) { if (!scaleCut(cutElem, cutIndex, cutNz, cutRhs, 3) && param.getENFORCE_SCALING()) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad scaling\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { scaleFail++; } #endif return false; } removeSmallCoefficients(cutElem, cutIndex, cutNz, cutRhs); if (!checkDynamism(cutElem, cutIndex, cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad dynamism\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { dynFail++; } #endif return false; } if (!checkSupport(cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: too large support\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { suppFail++; } #endif return false; } if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation (final check)\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } relaxRhs(cutRhs); } /* end of cleaning procedure CP_CGLREDSPLIT */ else if (cleanProc == CglGMIParam::CP_INTEGRAL_CUTS) { removeSmallCoefficients(cutElem, cutIndex, cutNz, cutRhs); if (!checkSupport(cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: too large support\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { suppFail++; } #endif return false; } if (!checkDynamism(cutElem, cutIndex, cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad dynamism\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { dynFail++; } #endif return false; } if (!scaleCut(cutElem, cutIndex, cutNz, cutRhs, 0) && param.getENFORCE_SCALING()) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad scaling\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { scaleFail++; } #endif return false; } if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation (final check)\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } } /* end of cleaning procedure CP_INTEGRAL_CUTS */ else if (cleanProc == CglGMIParam::CP_CGLLANDP1_INT) { if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } removeSmallCoefficients(cutElem, cutIndex, cutNz, cutRhs); if (!checkSupport(cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: too large support\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { suppFail++; } #endif return false; } if (!checkDynamism(cutElem, cutIndex, cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad dynamism\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { dynFail++; } #endif return false; } // scale cut so that it becomes integral, if possible if (!scaleCut(cutElem, cutIndex, cutNz, cutRhs, 0)) { if (param.getENFORCE_SCALING()){ #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad scaling\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { scaleFail++; } #endif return false; } else { // If cannot scale to integral and not enforcing, relax rhs // (as per CglLandP cleaning procedure) relaxRhs(cutRhs); } } if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation (final check)\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } } /* end of cleaning procedure CP_CGLLANDP1_INT */ else if (cleanProc == CglGMIParam::CP_CGLLANDP1_SCALEMAX || cleanProc == CglGMIParam::CP_CGLLANDP1_SCALERHS) { if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } if (// Try to scale cut, but do not discard if cannot scale ((cleanProc == CglGMIParam::CP_CGLLANDP1_SCALEMAX && !scaleCut(cutElem, cutIndex, cutNz, cutRhs, 1)) || (cleanProc == CglGMIParam::CP_CGLLANDP1_SCALERHS && !scaleCut(cutElem, cutIndex, cutNz, cutRhs, 2))) && param.getENFORCE_SCALING()) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad scaling\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { scaleFail++; } #endif return false; } relaxRhs(cutRhs); removeSmallCoefficients(cutElem, cutIndex, cutNz, cutRhs); if (!checkSupport(cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: too large support\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { suppFail++; } #endif return false; } if (!checkDynamism(cutElem, cutIndex, cutNz)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad dynamism\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { dynFail++; } #endif return false; } if (!checkViolation(cutElem, cutIndex, cutNz, cutRhs, xbar)) { #if defined GMI_TRACE_CLEAN printf("CglGMI::cleanCut(): cut discarded: bad violation (final check)\n"); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { violFail++; } #endif return false; } } /* end of cleaning procedures CP_CGLLANDP1_SCALEMAX and CG_CGLLANDP1_SCALERHS */ return true; } /************************************************************************/ bool CglGMI::checkViolation(const double* cutElem, const int* cutIndex, int cutNz, double cutrhs, const double* xbar) { double lhs = 0.0; for (int i = 0; i < cutNz; ++i) { lhs += cutElem[i]*xbar[cutIndex[i]]; } double violation = lhs - cutrhs; if (fabs(cutrhs) > 1) { violation /= fabs(cutrhs); } if (violation >= param.getMINVIOL()) { return true; } else{ #if defined GMI_TRACE_CLEAN printf("Cut lhs %g, rhs %g, violation %g; cut discarded\n", lhs, cutrhs, violation); #endif return false; } } /* checkViolation */ /************************************************************************/ bool CglGMI::checkDynamism(const double* cutElem, const int* cutIndex, int cutNz) { double min = param.getINFINIT(); double max = 0.0; double val = 0.0; for (int i = 0; i < cutNz; ++i) { if (!isZero(cutElem[i])) { val = fabs(cutElem[i]); min = CoinMin(min, val); max = CoinMax(max, val); } } if (max > min*param.getMAXDYN()) { #if defined GMI_TRACE_CLEAN printf("Max elem %g, min elem %g, dyn %g; cut discarded\n", max, min, max/min); #endif return false; } else{ return true; } } /* checkDynamism */ /************************************************************************/ bool CglGMI::checkSupport(int cutNz) { if (cutNz > param.getMAX_SUPPORT_ABS() + param.getMAX_SUPPORT_REL()*ncol) { #if defined GMI_TRACE_CLEAN printf("Support %d; cut discarded\n", cutNz); #endif return false; } else{ return true; } } /************************************************************************/ bool CglGMI::removeSmallCoefficients(double* cutElem, int* cutIndex, int& cutNz, double& cutRhs) { double value, absval; int currPos = 0; int col; for (int i = 0; i < cutNz; ++i) { col = cutIndex[i]; value = cutElem[i]; absval = fabs(value); if (!isZero(absval) && absval <= param.getEPS_COEFF()) { // small coefficient: remove and adjust rhs if possible if ((value > 0.0) && (colLower[col] > -param.getINFINIT())) { cutRhs -= value * colLower[col]; } else if ((value < 0.0) && (colUpper[col] < param.getINFINIT())) { cutRhs -= value * colUpper[col]; } } else if (absval > param.getEPS_COEFF()) { if (currPos < i) { cutElem[currPos] = cutElem[i]; cutIndex[currPos] = cutIndex[i]; } currPos++; } } cutNz = currPos; return true; } /************************************************************************/ void CglGMI::relaxRhs(double& rhs) { if(param.getEPS_RELAX_REL() > 0.0) { rhs += fabs(rhs) * param.getEPS_RELAX_REL() + param.getEPS_RELAX_ABS(); } else{ rhs += param.getEPS_RELAX_ABS(); } } /************************************************************************/ bool CglGMI::scaleCut(double* cutElem, int* cutIndex, int cutNz, double& cutRhs, int scalingType) { /// scalingType possible values: /// 0 : scale to obtain integral cut /// 1 : scale to obtain largest coefficient equal to 1 /// 2 : scale to obtain rhs equal to 1 /// 3 : scale based on norm, to obtain cut norm equal to ncol /// Returns true if scaling is successful. if (scalingType == 0) { return scaleCutIntegral(cutElem, cutIndex, cutNz, cutRhs); } else if (scalingType == 1) { double max = fabs(cutRhs); for (int i = 0; i < cutNz; ++i) { if (!isZero(cutElem[i])) { max = CoinMax(max, fabs(cutElem[i])); } } if (max < param.getEPS() || max > param.getMAXDYN()) { #if defined GMI_TRACE_CLEAN printf("Scale %g; %g %g cut discarded\n", max, param.getEPS(), 1/param.getMAXDYN()); #endif return false; } else{ for (int i = 0; i < cutNz; ++i) { cutElem[i] /= max; } cutRhs /= max; return true; } } else if (scalingType == 2) { double max = fabs(cutRhs); if (max < param.getEPS() || max > param.getMAXDYN()) { #if defined GMI_TRACE_CLEAN printf("Scale %g; %g %g cut discarded\n", max, param.getEPS(), 1/param.getMAXDYN()); #endif return false; } else{ for (int i = 0; i < cutNz; ++i) { cutElem[i] /= max; } cutRhs /= max; return true; } } else if (scalingType == 3) { int support = 0; double norm = 0.0; for (int i = 0; i < cutNz; ++i) { if (!isZero(fabs(cutElem[i]))) { support++; norm += cutElem[i]*cutElem[i]; } } double scale = sqrt(norm / support); if ((scale < 0.02) || (scale > 100)) { #if defined GMI_TRACE_CLEAN printf("Scale %g; cut discarded\n", scale); #endif return false; } else{ for (int i = 0; i < cutNz; ++i) { cutElem[i] /= scale; } cutRhs /= scale; return true; } } return false; } /* scaleCut */ /************************************************************************/ bool CglGMI::scaleCutIntegral(double* cutElem, int* cutIndex, int cutNz, double& cutRhs) { long gcd, lcm; double maxdelta = param.getEPS(); double maxscale = 1000; long maxdnom = 1000; long numerator = 0, denominator = 0; // Initialize gcd and lcm if (nearestRational(cutRhs, maxdelta, maxdnom, numerator, denominator)) { gcd = labs(numerator); lcm = denominator; } else{ #if defined GMI_TRACE_CLEAN printf("Cannot compute rational number, scaling procedure aborted\n"); #endif return false; } for (int i = 0; i < cutNz; ++i) { if (solver->isContinuous(cutIndex[i]) && !param.getINTEGRAL_SCALE_CONT()) { continue; } if(nearestRational(cutElem[i], maxdelta, maxdnom, numerator, denominator)) { gcd = computeGcd(gcd,labs(numerator)); lcm *= denominator/(computeGcd(lcm,denominator)); } else{ #if defined GMI_TRACE_CLEAN printf("Cannot compute rational number, scaling procedure aborted\n"); #endif return false; } } double scale = ((double)lcm)/((double)gcd); if (fabs(scale) > maxscale) { #if defined GMI_TRACE_CLEAN printf("Scaling factor too large, scaling procedure aborted\n"); #endif return false; } // Looks like we have a good scaling factor; scale and return; for (int i = 0; i < cutNz; ++i) { cutElem[i] *= scale; } cutRhs *= scale; return true; } /* scaleCutIntegral */ /************************************************************************/ /* arguments: * val = double precision value that must be converted * maxdelta = max allowed difference between val and the rational computed * maxdnom = max allowed denominator * numerator = the numerator will be stored here if successful * denominator = the denominator will be stored here if successful * returns true if successful, false if not. * * This function is based on SCIPrealToRational() from SCIP, scip@zib.de. * The copyright of SCIP and of this function belongs to ZIB. * We explicitly obtained the rights to license this function under GPL * from ZIB. More information can be obtained from the authors. * * Copyright (C) 2012 Konrad-Zuse-Zentrum * fuer Informationstechnik Berlin */ bool CglGMI::nearestRational(double val, double maxdelta, long maxdnom, long& numerator, long& denominator) { /// Denominators that should be tried for the integral scaling phase. /// These values are taken from SCIP. static const double simplednoms[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 25.0, -1.0}; double a, b; double g0, g1, gx; double h0, h1, hx; double delta0, delta1; double epsilon; int i; /* try the simple denominators first: each value of the simplednoms table * multiplied by powers of 10 is tried as denominator */ for (i = 0; simplednoms[i] > 0.0; ++i) { double num, dnom; double ratval0, ratval1; double diff; /* try powers of 10 (including 10^0) */ dnom = simplednoms[i]; while (dnom <= maxdnom) { num = floor(val * dnom); ratval0 = num/dnom; ratval1 = (num+1.0)/dnom; diff = fabs(val - ratval0); if (diff < maxdelta) { numerator = (long)num; denominator = (long)dnom; return true; } diff = fabs(val - ratval1); if (diff < maxdelta) { numerator = (long)(num+1.0); denominator = (long)dnom; return true; } dnom *= 10.0; } } /* the simple denominators didn't work: calculate rational * representation with arbitrary denominator */ epsilon = maxdelta/2.0; b = val; a = floor(b + epsilon); g0 = a; h0 = 1.0; g1 = 1.0; h1 = 0.0; delta0 = val - g0/h0; delta1 = (delta0 < 0.0 ? val - (g0-1.0)/h0 : val - (g0+1.0)/h0); while ((fabs(delta0) > maxdelta) && (fabs(delta1) > maxdelta)) { if ((b-a) < epsilon || h0 < 0 || h1 < 0) return false; b = 1.0 / (b - a); a = floor(b + epsilon); if (a < 0.0) return false; gx = g0; hx = h0; g0 = a * g0 + g1; h0 = a * h0 + h1; g1 = gx; h1 = hx; if (h0 > maxdnom) return false; delta0 = val - g0/h0; delta1 = (delta0 < 0.0 ? val - (g0-1.0)/h0 : val - (g0+1.0)/h0); } if (fabs(g0) > (LONG_MAX >> 4) || h0 > (LONG_MAX >> 4)) return false; if (h0 > 0.5) return false; if (delta0 < -maxdelta) { if (fabs(delta1) > maxdelta) return false; numerator = (long)(g0 - 1.0); denominator = (long)h0; } else if (delta0 > maxdelta) { if (fabs(delta1) > maxdelta) return false; numerator = (long)(g0 + 1.0); denominator = (long)h0; } else{ numerator = (long)g0; denominator = (long)h0; } if ((denominator < 1) || (fabs(val - (double)(numerator)/(double)(denominator)) > maxdelta)) return false; return true; } /* nearestRational */ /************************************************************************/ long CglGMI::computeGcd(long a, long b) { // This is the standard Euclidean algorithm for gcd long remainder = 1; // Make sure a<=b (will always remain so) if (a > b) { // Swap a and b long temp = a; a = b; b = temp; } // If zero then gcd is nonzero if (!a) { if (b) { return b; } else { printf("### WARNING: CglGMI::computeGcd() given two zeroes!\n"); exit(1); } } while (remainder) { remainder = b % a; b = a; a = remainder; } return b; } /* computeGcd */ /************************************************************************/ void CglGMI::generateCuts(const OsiSolverInterface &si, OsiCuts & cs, const CglTreeInfo ) { solver = const_cast(&si); if (solver == NULL) { printf("### WARNING: CglGMI::generateCuts(): no solver available.\n"); return; } if (!solver->optimalBasisIsAvailable()) { printf("### WARNING: CglGMI::generateCuts(): no optimal basis available.\n"); return; } #if defined OSI_TABLEAU if (!solver->canDoSimplexInterface()) { printf("### WARNING: CglGMI::generateCuts(): solver does not provide simplex tableau.\n"); printf("### WARNING: CglGMI::generateCuts(): recompile without OSI_TABLEAU.\n"); return; } #endif // Get basic problem information from solver ncol = solver->getNumCols(); nrow = solver->getNumRows(); colLower = solver->getColLower(); colUpper = solver->getColUpper(); rowLower = solver->getRowLower(); rowUpper = solver->getRowUpper(); rowRhs = solver->getRightHandSide(); xlp = solver->getColSolution(); rowActivity = solver->getRowActivity(); byRow = solver->getMatrixByRow(); byCol = solver->getMatrixByCol(); generateCuts(cs); } /* generateCuts */ /************************************************************************/ void CglGMI::generateCuts(OsiCuts &cs) { isInteger = new bool[ncol]; computeIsInteger(); cstat = new int[ncol]; rstat = new int[nrow]; solver->getBasisStatus(cstat, rstat); // 0: free 1: basic // 2: upper 3: lower #if defined GMI_TRACETAB printvecINT("cstat", cstat, ncol); printvecINT("rstat", rstat, nrow); #endif // list of basic integer fractional variables int *listFracBasic = new int[nrow]; int numFracBasic = 0; for (int i = 0; i < ncol; ++i) { // j is the variable which is basic in row i if ((cstat[i] == 1) && (isInteger[i])) { if (CoinMin(aboveInteger(xlp[i]), 1-aboveInteger(xlp[i])) > param.getAway()) { listFracBasic[numFracBasic] = i; numFracBasic++; } #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE else if (trackRejection) { // Say that we tried to generate a cut, but it was discarded // because of small fractionality if (!isIntegerValue(xlp[i])) { fracFail++; numGeneratedCuts++; } } #endif } } #if defined GMI_TRACE printf("CglGMI::generateCuts() : %d fractional rows\n", numFracBasic); #endif if (numFracBasic == 0) { delete[] listFracBasic; delete[] cstat; delete[] rstat; delete[] isInteger; return; } // there are rows with basic integer fractional variables, so we can // generate cuts // Basis index for columns and rows; each element is -1 if corresponding // variable is nonbasic, and contains the basis index if basic. // The basis index is the row in which the variable is basic. int* colBasisIndex = new int[ncol]; int* rowBasisIndex = new int[nrow]; #if defined OSI_TABLEAU memset(colBasisIndex, -1, ncol*sizeof(int)); memset(rowBasisIndex, -1, nrow*sizeof(int)); solver->enableFactorization(); int* basicVars = new int[nrow]; solver->getBasics(basicVars); for (int i = 0; i < nrow; ++i) { if (basicVars[i] < ncol) { colBasisIndex[basicVars[i]] = i; } else { rowBasisIndex[basicVars[i] - ncol] = i; } } #else CoinFactorization factorization; if (factorize(factorization, colBasisIndex, rowBasisIndex)) { printf("### WARNING: CglGMI::generateCuts(): error during factorization!\n"); return; } #endif // cut in sparse form double* cutElem = new double[ncol]; int* cutIndex = new int[ncol]; int cutNz = 0; double cutRhs; // cut in dense form double* cut = new double[ncol]; double *slackVal = new double[nrow]; for (int i = 0; i < nrow; ++i) { slackVal[i] = rowRhs[i] - rowActivity[i]; } #if defined OSI_TABLEAU // Column part and row part of a row of the simplex tableau double* tableauColPart = new double[ncol]; double* tableauRowPart = new double[nrow]; #else // Need some more data for simplex tableau computation const int * row = byCol->getIndices(); const CoinBigIndex * columnStart = byCol->getVectorStarts(); const int * columnLength = byCol->getVectorLengths(); const double * columnElements = byCol->getElements(); // Create work arrays for factorization // two vectors for updating: the first one is needed to do the computations // but we do not use it, the second one contains a row of the basis inverse CoinIndexedVector work; CoinIndexedVector array; // Make sure they large enough work.reserve(nrow); array.reserve(nrow); int * arrayRows = array.getIndices(); double * arrayElements = array.denseVector(); // End of code to create work arrays double one = 1.0; #endif // Matrix elements by row for slack substitution const double *elements = byRow->getElements(); const int *rowStart = byRow->getVectorStarts(); const int *indices = byRow->getIndices(); const int *rowLength = byRow->getVectorLengths(); // Indices of basic and slack variables, and cut elements int iBasic, slackIndex; double cutCoeff; double rowElem; // Now generate the cuts: obtain a row of the simplex tableau // where an integer variable is basic and fractional, and compute the cut for (int i = 0; i < numFracBasic; ++i) { if (!computeCutFractionality(xlp[listFracBasic[i]], cutRhs)) { // cut is discarded because of the small fractionalities involved #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { // Say that we tried to generate a cut, but it was discarded // because of small fractionality fracFail++; numGeneratedCuts++; } #endif continue; } // the variable listFracBasic[i] is basic in row iBasic iBasic = colBasisIndex[listFracBasic[i]]; #if defined GMI_TRACE printf("Row %d with var %d basic, f0 = %f\n", i, listFracBasic[i], f0); #endif #if defined OSI_TABLEAU solver->getBInvARow(iBasic, tableauColPart, tableauRowPart); #else array.clear(); array.setVector(1, &iBasic, &one); factorization.updateColumnTranspose (&work, &array); int numberInArray=array.getNumElements(); #endif // reset the cut memset(cut, 0, ncol*sizeof(double)); // columns for (int j = 0; j < ncol; ++j) { if ((colBasisIndex[j] >= 0) || (areEqual(colLower[j], colUpper[j], param.getEPS(), param.getEPS()))) { // Basic or fixed variable -- skip continue; } #ifdef OSI_TABLEAU rowElem = tableauColPart[j]; #else rowElem = 0.0; // add in row of tableau for (int h = columnStart[j]; h < columnStart[j]+columnLength[j]; ++h) { rowElem += columnElements[h]*arrayElements[row[h]]; } #endif if (!isZero(fabs(rowElem))) { // compute cut coefficient flip(rowElem, j); cutCoeff = computeCutCoefficient(rowElem, j); if (isZero(cutCoeff)) { continue; } unflipOrig(cutCoeff, j, cutRhs); cut[j] = cutCoeff; #if defined GMI_TRACE printf("var %d, row %f, cut %f\n", j, rowElem, cutCoeff); #endif } } // now do slacks part #if defined OSI_TABLEAU for (int j = 0 ; j < nrow; ++j) { // index of the row corresponding to the slack variable slackIndex = j; if (rowBasisIndex[j] >= 0) { // Basic variable -- skip it continue; } rowElem = tableauRowPart[j]; #else for (int j = 0 ; j < numberInArray ; ++j) { // index of the row corresponding to the slack variable slackIndex = arrayRows[j]; rowElem = arrayElements[slackIndex]; #endif if (!isZero(fabs(rowElem))) { slackIndex += ncol; // compute cut coefficient flip(rowElem, slackIndex); cutCoeff = computeCutCoefficient(rowElem, slackIndex); if (isZero(fabs(cutCoeff))) { continue; } unflipSlack(cutCoeff, slackIndex, cutRhs, slackVal); eliminateSlack(cutCoeff, slackIndex, cut, cutRhs, elements, rowStart, indices, rowLength, rowRhs); #if defined GMI_TRACE printf("var %d, row %f, cut %f\n", slackIndex, rowElem, cutCoeff); #endif } } packRow(cut, cutElem, cutIndex, cutNz); if (cutNz == 0) continue; #if defined GMI_TRACE printvecDBL("final cut:", cutElem, cutIndex, cutNz); printf("cutRhs: %f\n", cutRhs); #endif #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE if (trackRejection) { numGeneratedCuts++; } #endif if (cleanCut(cutElem, cutIndex, cutNz, cutRhs, xlp) && cutNz > 0) { OsiRowCut rc; rc.setRow(cutNz, cutIndex, cutElem); rc.setLb(-param.getINFINIT()); rc.setUb(cutRhs); if (!param.getCHECK_DUPLICATES()) { cs.insert(rc); } else{ cs.insertIfNotDuplicate(rc, CoinAbsFltEq(param.getEPS_COEFF())); } } } #if defined GMI_TRACE printf("CglGMI::generateCuts() : number of cuts : %d\n", cs.sizeRowCuts()); #endif #if defined OSI_TABLEAU solver->disableFactorization(); delete[] basicVars; delete[] tableauColPart; delete[] tableauRowPart; #endif delete[] colBasisIndex; delete[] rowBasisIndex; delete[] cut; delete[] slackVal; delete[] cutElem; delete[] cutIndex; delete[] listFracBasic; delete[] cstat; delete[] rstat; delete[] isInteger; } /* generateCuts */ /***********************************************************************/ void CglGMI::setParam(const CglGMIParam &source) { param = source; } /* setParam */ /***********************************************************************/ void CglGMI::computeIsInteger() { for (int i = 0; i < ncol; ++i) { if(solver->isInteger(i)) { isInteger[i] = true; } else { if((areEqual(colLower[i], colUpper[i], param.getEPS(), param.getEPS())) && (isIntegerValue(colUpper[i]))) { // continuous variable fixed to an integer value isInteger[i] = true; } else { isInteger[i] = false; } } } } /* computeIsInteger */ /***********************************************************************/ void CglGMI::printOptTab(OsiSolverInterface *lclSolver) const { int *cstat = new int[ncol]; int *rstat = new int[nrow]; lclSolver->enableFactorization(); lclSolver->getBasisStatus(cstat, rstat); // 0: free 1: basic // 2: upper 3: lower int *basisIndex = new int[nrow]; // basisIndex[i] = // index of pivot var in row i // (slack if number >= ncol) lclSolver->getBasics(basisIndex); double *z = new double[ncol]; // workspace to get row of the tableau double *slack = new double[nrow]; // workspace to get row of the tableau double *slackVal = new double[nrow]; for (int i = 0; i < nrow; i++) { slackVal[i] = rowRhs[i] - rowActivity[i]; } const double *rc = lclSolver->getReducedCost(); const double *dual = lclSolver->getRowPrice(); const double *solution = lclSolver->getColSolution(); printvecINT("cstat", cstat, ncol); printvecINT("rstat", rstat, nrow); printvecINT("basisIndex", basisIndex, nrow); printvecDBL("solution", solution, ncol); printvecDBL("slackVal", slackVal, nrow); printvecDBL("reduced_costs", rc, ncol); printvecDBL("dual solution", dual, nrow); printf("Optimal Tableau:\n"); for (int i = 0; i < nrow; i++) { lclSolver->getBInvARow(i, z, slack); for (int ii = 0; ii < ncol; ++ii) { printf("%5.2f ", z[ii]); } printf(" | "); for (int ii = 0; ii < nrow; ++ii) { printf("%5.2f ", slack[ii]); } printf(" | "); if(basisIndex[i] < ncol) { printf("%5.2f ", solution[basisIndex[i]]); } else { printf("%5.2f ", slackVal[basisIndex[i]-ncol]); } printf("\n"); } for (int ii = 0; ii < 7*(ncol+nrow+1); ++ii) { printf("-"); } printf("\n"); for (int ii = 0; ii < ncol; ++ii) { printf("%5.2f ", rc[ii]); } printf(" | "); for (int ii = 0; ii < nrow; ++ii) { printf("%5.2f ", -dual[ii]); } printf(" | "); printf("%5.2f\n", -lclSolver->getObjValue()); lclSolver->disableFactorization(); delete[] cstat; delete[] rstat; delete[] basisIndex; delete[] slack; delete[] z; delete[] slackVal; } /* printOptTab */ /*********************************************************************/ // Create C++ lines to get to current state std::string CglGMI::generateCpp(FILE * fp) { CglGMI other; fprintf(fp,"0#include \"CglGMI.hpp\"\n"); fprintf(fp,"3 CglGMI GMI;\n"); if (param.getMAX_SUPPORT()!=other.param.getMAX_SUPPORT()) fprintf(fp,"3 GMI.setLimit(%d);\n",param.getMAX_SUPPORT()); else fprintf(fp,"4 GMI.setLimit(%d);\n",param.getMAX_SUPPORT()); if (param.getAway()!=other.param.getAway()) fprintf(fp,"3 GMI.setAway(%g);\n",param.getAway()); else fprintf(fp,"4 GMI.setAway(%g);\n",param.getAway()); if (param.getEPS()!=other.param.getEPS()) fprintf(fp,"3 GMI.setEPS(%g);\n",param.getEPS()); else fprintf(fp,"4 GMI.setEPS(%g);\n",param.getEPS()); if (param.getEPS_COEFF()!=other.param.getEPS_COEFF()) fprintf(fp,"3 GMI.setEPS_COEFF(%g);\n",param.getEPS_COEFF()); else fprintf(fp,"4 GMI.set.EPS_COEFF(%g);\n",param.getEPS_COEFF()); if (param.getEPS_RELAX_ABS()!=other.param.getEPS_RELAX_ABS()) fprintf(fp,"3 GMI.set.EPS_RELAX(%g);\n",param.getEPS_RELAX_ABS()); else fprintf(fp,"4 GMI.set.EPS_RELAX(%g);\n",param.getEPS_RELAX_ABS()); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 GMI.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 GMI.setAggressiveness(%d);\n",getAggressiveness()); return "GMI"; } /*********************************************************************/ int CglGMI::factorize(CoinFactorization & factorization, int* colBasisIndex, int* rowBasisIndex) { // Start of code to create a factorization from warm start ==== // Taken (with small modifications) from CglGomory int status=-100; for (int i = 0; i < nrow; ++i) { if (rstat[i] == 1) { rowBasisIndex[i]=1; } else { rowBasisIndex[i]=-1; } } for (int i = 0; i < ncol; ++i) { if (cstat[i] == 1) { colBasisIndex[i]=1; } else { colBasisIndex[i]=-1; } } // returns 0 if okay, -1 singular, -2 too many in basis, -99 memory */ while (status<-98) { status=factorization.factorize(*byCol, rowBasisIndex, colBasisIndex); if (status==-99) factorization.areaFactor(factorization.areaFactor()*2.0); } if (status) { return -1; } #if defined GMI_TRACE double condition = 0.0; const CoinFactorizationDouble * pivotRegion = factorization.pivotRegion(); for (int i = 0; i < nrow; ++i) { condition += log(fabs(pivotRegion[i])); } printf("CglGMI::factorize(): condition number recomputed as sum of log: %g\n", (condition)); #endif return 0; } /*********************************************************************/ void CglGMI::setTrackRejection(bool value) { #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE trackRejection = value; if (trackRejection) { // reset data members resetRejectionCounters(); } #endif } /*********************************************************************/ bool CglGMI::getTrackRejection() { #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE return trackRejection; #else return false; #endif } /*********************************************************************/ void CglGMI::resetRejectionCounters() { #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE fracFail = 0; dynFail = 0; violFail = 0; suppFail = 0; scaleFail = 0; numGeneratedCuts = 0; #endif } /*********************************************************************/ int CglGMI::getNumberRejectedCuts(RejectionType reason) { #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE switch (reason) { case failureFractionality: return fracFail; case failureDynamism: return dynFail; case failureViolation: return violFail; case failureSupport: return suppFail; case failureScale: return scaleFail; } return 0; #else return 0; #endif } /*********************************************************************/ int CglGMI::getNumberGeneratedCuts() { #if defined TRACK_REJECT || defined TRACK_REJECT_SIMPLE return numGeneratedCuts; #else return 0; #endif } Cgl-0.58.9/src/CglGMI/Makefile.am0000644000076600007660000000321312130104734014657 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglGMI # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglGMI.la # List all source files for this library, including headers libCglGMI_la_SOURCES = \ CglGMI.cpp CglGMI.hpp \ CglGMIParam.cpp CglGMIParam.hpp # This is for libtool (on Windows) libCglGMI_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglGMI.hpp CglGMIParam.hpp Cgl-0.58.9/src/CglGMI/Makefile.in0000644000076600007660000005370712240340055014705 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/CglGMI 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglGMI_la_LIBADD = am_libCglGMI_la_OBJECTS = CglGMI.lo CglGMIParam.lo libCglGMI_la_OBJECTS = $(am_libCglGMI_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 = $(libCglGMI_la_SOURCES) DIST_SOURCES = $(libCglGMI_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglGMI # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglGMI.la # List all source files for this library, including headers libCglGMI_la_SOURCES = \ CglGMI.cpp CglGMI.hpp \ CglGMIParam.cpp CglGMIParam.hpp # This is for libtool (on Windows) libCglGMI_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglGMI.hpp CglGMIParam.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/CglGMI/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglGMI/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglGMI.la: $(libCglGMI_la_OBJECTS) $(libCglGMI_la_DEPENDENCIES) $(CXXLINK) $(libCglGMI_la_LDFLAGS) $(libCglGMI_la_OBJECTS) $(libCglGMI_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglGMI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglGMIParam.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglCutGenerator.hpp0000644000076600007660000000652412130104734015332 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 CglCutGenerator_H #define CglCutGenerator_H #include "OsiCuts.hpp" #include "OsiSolverInterface.hpp" #include "CglTreeInfo.hpp" //------------------------------------------------------------------- // // Abstract base class for generating cuts. // //------------------------------------------------------------------- /// /** Cut Generator Base Class This is an abstract base class for generating cuts. A specific cut generator will inherit from this class. */ class CglCutGenerator { public: /**@name Generate Cuts */ //@{ /** Generate cuts for the model data contained in si. The generated cuts are inserted into and returned in the collection of cuts cs. */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo())=0; //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglCutGenerator (); /// Copy constructor CglCutGenerator ( const CglCutGenerator &); /// Clone virtual CglCutGenerator * clone() const = 0; /// Assignment operator CglCutGenerator & operator=(const CglCutGenerator& rhs); /// Destructor virtual ~CglCutGenerator (); /** Create C++ lines to set the generator in the current state. The output must be parsed by the calling code, as each line starts with a key indicating the following:
0: must be kept (for #includes etc)
3: Set to changed (not default) values
4: Set to default values (redundant)
Keys 1, 2, 5, 6, 7, 8 are defined, but not applicable to cut generators. */ virtual std::string generateCpp( FILE * ) {return "";} /// This can be used to refresh any information virtual void refreshSolver(OsiSolverInterface * ) {} //@} /**@name Gets and Sets */ //@{ /** Get Aggressiveness - 0 = neutral, 100 is normal root node. Really just a hint to cut generator */ inline int getAggressiveness() const { return aggressive_;} /** Set Aggressiveness - 0 = neutral, 100 is normal root node. Really just a hint to cut generator */ inline void setAggressiveness(int value) { aggressive_=value;} /// Set whether can do global cuts inline void setGlobalCuts(bool trueOrFalse) { canDoGlobalCuts_ = trueOrFalse;} /// Say whether can do global cuts inline bool canDoGlobalCuts() const {return canDoGlobalCuts_;} /** Returns true if may generate Row cuts in tree (rather than root node). Used so know if matrix will change in tree. Really meant so column cut generators can still be active without worrying code. Default is true */ virtual bool mayGenerateRowCutsInTree() const; /// Return true if needs optimal basis to do cuts virtual bool needsOptimalBasis() const; /// Return maximum length of cut in tree virtual int maximumLengthOfCutInTree() const { return COIN_INT_MAX;} //@} // test this class //static void unitTest(); // private: /** Aggressiveness - 0 = neutral, 100 is normal root node. Really just a hint to cut generator */ int aggressive_; /// True if can do global cuts i.e. no general integers bool canDoGlobalCuts_; }; #endif Cgl-0.58.9/src/CglFlowCover/0000755000076600007660000000000012377555671014145 5ustar coincoinCgl-0.58.9/src/CglFlowCover/CglFlowCover.cpp0000644000076600007660000012103512360447667017204 0ustar coincoin// $Id: CglFlowCover.cpp 1207 2014-07-13 09:21:59Z forrest $ //----------------------------------------------------------------------------- // name: Cgl Lifted Simple Generalized Flow Cover Cut Generator // author: Yan Xu email: yan.xu@sas.com // Jeff Linderoth email: jtl3@lehigh.edu // Martin Savelsberg email: martin.savelsbergh@isye.gatech.edu // date: 05/01/2003 // comments: please scan this file for '???' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2003, Yan Xu, Jeff Linderoth, Martin Savelsberg and others. // All Rights Reserved. // This code is published under the Eclipse Public License. #include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedMatrix.hpp" #include "CoinPackedVector.hpp" #include "CoinSort.hpp" #include "CglFlowCover.hpp" // added #define to get rid of warnings (so uncomment if =true) //#define CGLFLOW_DEBUG2 static bool CGLFLOW_DEBUG=false; static bool doLift=true; #include //------------------------------------------------------------------- // Overloaded operator<< for printing VUB and VLB. //------------------------------------------------------------------- std::ostream& operator<<( std::ostream& os, const CglFlowVUB &v ) { os << " VAR = " << v.getVar() << "\t VAL = " << v.getVal() << std::endl; return os; } //------------------------------------------------------------------- // Determine row types. Find the VUBS and VLBS. //------------------------------------------------------------------- void CglFlowCover::flowPreprocess(const OsiSolverInterface& si) { CoinPackedMatrix matrixByRow(*si.getMatrixByRow()); int numRows = si.getNumRows(); int numCols = si.getNumCols(); const char* sense = si.getRowSense(); const double* RHS = si.getRightHandSide(); const double* coefByRow = matrixByRow.getElements(); const int* colInds = matrixByRow.getIndices(); const int* rowStarts = matrixByRow.getVectorStarts(); const int* rowLengths = matrixByRow.getVectorLengths(); int iRow = -1; int iCol = -1; numCols_ = numCols; // Record col and row numbers for copy constructor numRows_ = numRows; if (rowTypes_ != 0) { delete [] rowTypes_; rowTypes_ = 0; } rowTypes_ = new CglFlowRowType [numRows];// Destructor will free memory // Get integer types const char * columnType = si.getColType (true); // Summarize the row type infomation. int numUNDEFINED = 0; int numVARUB = 0; int numVARLB = 0; int numVAREQ = 0; int numMIXUB = 0; int numMIXEQ = 0; int numNOBINUB = 0; int numNOBINEQ = 0; int numSUMVARUB = 0; int numSUMVAREQ = 0; int numUNINTERSTED = 0; int* ind = new int [numCols]; double* coef = new double [numCols]; for (iRow = 0; iRow < numRows; ++iRow) { int rowLen = rowLengths[iRow]; char sen = sense[iRow]; double rhs = RHS[iRow]; CoinDisjointCopyN(colInds + rowStarts[iRow], rowLen, ind); CoinDisjointCopyN(coefByRow + rowStarts[iRow], rowLen, coef); CglFlowRowType rowType = determineOneRowType(si, rowLen, ind, coef, sen, rhs); rowTypes_[iRow] = rowType; switch(rowType) { case CGLFLOW_ROW_UNDEFINED: ++numUNDEFINED; break; case CGLFLOW_ROW_VARUB: ++numVARUB; break; case CGLFLOW_ROW_VARLB: ++numVARLB; break; case CGLFLOW_ROW_VAREQ: ++numVAREQ; break; case CGLFLOW_ROW_MIXUB: ++numMIXUB; break; case CGLFLOW_ROW_MIXEQ: ++numMIXEQ; break; case CGLFLOW_ROW_NOBINUB: ++numNOBINUB; break; case CGLFLOW_ROW_NOBINEQ: ++numNOBINEQ; break; case CGLFLOW_ROW_SUMVARUB: ++numSUMVARUB; break; case CGLFLOW_ROW_SUMVAREQ: ++numSUMVAREQ; break; case CGLFLOW_ROW_UNINTERSTED: ++numUNINTERSTED; break; default: throw CoinError("Unknown row type", "flowPreprocess", "CglFlowCover"); } } delete [] ind; ind = NULL; delete [] coef; coef = NULL; if(CGLFLOW_DEBUG) { std::cout << "The num of rows = " << numRows << std::endl; std::cout << "Summary of Row Type" << std::endl; std::cout << "numUNDEFINED = " << numUNDEFINED << std::endl; std::cout << "numVARUB = " << numVARUB << std::endl; std::cout << "numVARLB = " << numVARLB << std::endl; std::cout << "numVAREQ = " << numVAREQ << std::endl; std::cout << "numMIXUB = " << numMIXUB << std::endl; std::cout << "numMIXEQ = " << numMIXEQ << std::endl; std::cout << "numNOBINUB = " << numNOBINUB << std::endl; std::cout << "numNOBINEQ = " << numNOBINEQ << std::endl; std::cout << "numSUMVARUB = " << numSUMVARUB << std::endl; std::cout << "numSUMVAREQ = " << numSUMVAREQ << std::endl; std::cout << "numUNINTERSTED = " << numUNINTERSTED << std::endl; } //--------------------------------------------------------------------------- // Setup vubs_ and vlbs_ if (vubs_ != 0) { delete [] vubs_; vubs_ = 0; } vubs_ = new CglFlowVUB [numCols]; // Destructor will free memory if (vlbs_ != 0) { delete [] vlbs_; vlbs_ = 0; } vlbs_ = new CglFlowVLB [numCols]; // Destructor will free memory for (iCol = 0; iCol < numCols; ++iCol) { // Initilized in constructor vubs_[iCol].setVar(UNDEFINED_); // but, need redo since may call vlbs_[iCol].setVar(UNDEFINED_); // preprocess(...) more than once } for (iRow = 0; iRow < numRows; ++iRow) { CglFlowRowType rowType2 = rowTypes_[iRow]; if ( (rowType2 == CGLFLOW_ROW_VARUB) || (rowType2 == CGLFLOW_ROW_VARLB) || (rowType2 == CGLFLOW_ROW_VAREQ) ) { int startPos = rowStarts[iRow]; int index0 = colInds[startPos]; int index1 = colInds[startPos + 1]; double coef0 = coefByRow[startPos]; double coef1 = coefByRow[startPos + 1]; int xInd, yInd; // x is binary double xCoef, yCoef; if ( columnType[index0]==1 ) { xInd = index0; yInd = index1; xCoef = coef0; yCoef = coef1; } else { xInd = index1; yInd = index0; xCoef = coef1; yCoef = coef0; } switch (rowType2) { case CGLFLOW_ROW_VARUB: // Inequality: y <= ? * x vubs_[yInd].setVar(xInd); vubs_[yInd].setVal(-xCoef / yCoef); break; case CGLFLOW_ROW_VARLB: // Inequality: y >= ? * x vlbs_[yInd].setVar(xInd); vlbs_[yInd].setVal(-xCoef / yCoef); break; case CGLFLOW_ROW_VAREQ: // Inequality: y >= AND <= ? * x vubs_[yInd].setVar(xInd); vubs_[yInd].setVal(-xCoef / yCoef); vlbs_[yInd].setVar(xInd); vlbs_[yInd].setVal(-xCoef / yCoef); break; default: throw CoinError("Unknown row type: impossible", "flowPreprocess", "CglFlowCover"); } } } if(CGLFLOW_DEBUG) { printVubs(std::cout); } } //----------------------------------------------------------------------------- // Generate LSGFC cuts //------------------------------------------------------------------- void CglFlowCover::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info) { if (getMaxNumCuts() <= 0) return; if (getNumFlowCuts() >= getMaxNumCuts()) return; #if 0 bool preInit = false; bool preReso = false; si.getHintParam(OsiDoPresolveInInitial, preInit); si.getHintParam(OsiDoPresolveInResolve, preReso); if (preInit == false && preReso == false) { // Do once if (doneInitPre_ == false) { flowPreprocess(si); doneInitPre_ = true; } } else #endif int numberRowCutsBefore = cs.sizeRowCuts(); flowPreprocess(si); CoinPackedMatrix matrixByRow(*si.getMatrixByRow()); const char* sense = si.getRowSense(); const double* rhs = si.getRightHandSide(); const double* elementByRow = matrixByRow.getElements(); const int* colInd = matrixByRow.getIndices(); const CoinBigIndex* rowStart = matrixByRow.getVectorStarts(); const int* rowLength = matrixByRow.getVectorLengths(); int* ind = 0; double* coef = 0; int iRow, iCol; CglFlowRowType rType; for (iRow = 0; iRow < numRows_; ++iRow) { rType = getRowType(iRow); if( ( rType != CGLFLOW_ROW_MIXUB ) && ( rType != CGLFLOW_ROW_MIXEQ ) && ( rType != CGLFLOW_ROW_NOBINUB ) && ( rType != CGLFLOW_ROW_NOBINEQ ) && ( rType != CGLFLOW_ROW_SUMVARUB ) && ( rType != CGLFLOW_ROW_SUMVAREQ ) ) continue; const int sta = rowStart[iRow]; // Start position of iRow const int rowLen = rowLength[iRow]; // iRow length / non-zero elements if (ind != 0) { delete [] ind; ind = 0; } ind = new int [rowLen]; if (coef != 0) { delete [] coef; coef = 0; } coef = new double [rowLen]; int lastPos = sta + rowLen; for (iCol = sta; iCol < lastPos; ++iCol) { ind[iCol - sta] = colInd[iCol]; coef[iCol - sta] = elementByRow[iCol]; } OsiRowCut flowCut1, flowCut2, flowCut3; double violation = 0.0; bool hasCut = false; if (sense[iRow] == 'E') { hasCut = generateOneFlowCut(si, rowLen, ind, coef, 'L', rhs[iRow], flowCut1, violation); if (hasCut) { // If find a cut cs.insert(flowCut1); incNumFlowCuts(); if (getNumFlowCuts() >= getMaxNumCuts()) break; } hasCut = false; hasCut = generateOneFlowCut(si, rowLen, ind, coef, 'G', rhs[iRow], flowCut2, violation); if (hasCut) { cs.insert(flowCut2); incNumFlowCuts(); if (getNumFlowCuts() >= getMaxNumCuts()) break; } } if (sense[iRow] == 'L' || sense[iRow] == 'G') { hasCut = generateOneFlowCut(si, rowLen, ind, coef, sense[iRow], rhs[iRow], flowCut3, violation); if (hasCut) { cs.insert(flowCut3); incNumFlowCuts(); if (getNumFlowCuts() >= getMaxNumCuts()) break; } } } #ifdef CGLFLOW_DEBUG2 if(CGLFLOW_DEBUG) { std::cout << "\nnumFlowCuts = "<< getNumFlowCuts() << std::endl; std::cout << "CGLFLOW_COL_BINNEG = "<< CGLFLOW_COL_BINNEG << std::endl; } #endif if (!info.inTree&&((info.options&4)==4||((info.options&8)&&!info.pass))) { int numberRowCutsAfter = cs.sizeRowCuts(); for (int i=numberRowCutsBefore;isetGloballyValid(); } if (ind != 0) { delete [] ind; ind = 0; } if (coef != 0) { delete [] coef; coef = 0; } } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglFlowCover::CglFlowCover() : CglCutGenerator(), maxNumCuts_(2000), numFlowCuts_(0), EPSILON_(1.0e-6), UNDEFINED_(-1), INFTY_(1.0e30), TOLERANCE_(0.05), firstProcess_(true), numRows_(0), numCols_(0), doneInitPre_(false), vubs_(0), vlbs_(0), rowTypes_(0) { // DO NOTHING } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglFlowCover::CglFlowCover (const CglFlowCover & source) : CglCutGenerator(source), maxNumCuts_(source.maxNumCuts_), numFlowCuts_(source.numFlowCuts_), EPSILON_(source.EPSILON_), UNDEFINED_(source.UNDEFINED_), INFTY_(source.INFTY_), TOLERANCE_(source.TOLERANCE_), firstProcess_(true), numRows_(source.numRows_), numCols_(source.numCols_), doneInitPre_(source.doneInitPre_) { if (numCols_ > 0) { vubs_ = new CglFlowVUB [numCols_]; vlbs_ = new CglFlowVLB [numCols_]; CoinDisjointCopyN(source.vubs_, numCols_, vubs_); CoinDisjointCopyN(source.vlbs_, numCols_, vlbs_); } else { vubs_ = 0; vlbs_ = 0; } if (numRows_ > 0) { rowTypes_ = new CglFlowRowType [numRows_]; CoinDisjointCopyN(source.rowTypes_, numRows_, rowTypes_); } else { rowTypes_ = 0; } } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglFlowCover::clone() const { return new CglFlowCover(*this); } //------------------------------------------------------------------ // Assignment operator //------------------------------------------------------------------- CglFlowCover & CglFlowCover::operator=(const CglFlowCover& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); maxNumCuts_ = rhs.maxNumCuts_; numFlowCuts_ = rhs.numFlowCuts_; EPSILON_ = rhs.EPSILON_; UNDEFINED_ = rhs.UNDEFINED_; INFTY_ = rhs.INFTY_; TOLERANCE_ = rhs.TOLERANCE_; numRows_ = rhs.numRows_; numCols_ = rhs.numCols_; doneInitPre_ = rhs.doneInitPre_; if (numCols_ > 0) { vubs_ = new CglFlowVUB [numCols_]; vlbs_ = new CglFlowVLB [numCols_]; CoinDisjointCopyN(rhs.vubs_, numCols_, vubs_); CoinDisjointCopyN(rhs.vlbs_, numCols_, vlbs_); } if (numRows_ > 0) { rowTypes_ = new CglFlowRowType [numRows_]; CoinDisjointCopyN(rhs.rowTypes_, numRows_, rowTypes_); } } return *this; } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglFlowCover::~CglFlowCover () { if (vubs_ != 0) { delete [] vubs_; vubs_ = 0; } if (vlbs_ != 0) { delete [] vlbs_; vlbs_ = 0; } if (rowTypes_ != 0) { delete [] rowTypes_; rowTypes_ = 0; } } //------------------------------------------------------------------- // Given the model data, a row of the model, and a LP solution, // this function tries to generate a violated lifted simple generalized // flow cover. //------------------------------------------------------------------- bool CglFlowCover::generateOneFlowCut( const OsiSolverInterface & si, const int rowLen, int* ind, double* coef, char sense, double rhs, OsiRowCut& flowCut, double& violation ) { bool generated = false; const double* xlp = si.getColSolution(); const int numCols = si.getNumCols(); double* up = new double [rowLen]; double* x = new double [rowLen]; double* y = new double [rowLen]; CglFlowColType* sign = new CglFlowColType [rowLen]; int i, j; double value, LB, UB; CglFlowVLB VLB; CglFlowVUB VUB; CGLFLOW_DEBUG=false; doLift=true; // Get integer types const char * columnType = si.getColType (); for (i = 0; i < rowLen; ++i) { if ( xlp[ind[i]] - floor(xlp[ind[i]]) > EPSILON_ && ceil(xlp[ind[i]]) - xlp[ind[i]] > EPSILON_ ) break; } if (i == rowLen) { delete [] sign; delete [] up; delete [] x; delete [] y; return generated; } //------------------------------------------------------------------------- if (sense == 'G') flipRow(rowLen, coef, rhs); // flips everything, // but the sense if(CGLFLOW_DEBUG) { std::cout << "***************************" << std::endl; std::cout << "Generate Flow cover -- initial constraint, converted to L sense..." << std::endl; std::cout << "Rhs = " << rhs << std::endl; std::cout << "coef [var_index]" << " -- " << "xlp[var_index]" << '\t' << "vub_coef[vub_index] vub_lp_value OR var_index_col_ub" << std::endl; for(int iD = 0; iD < rowLen; ++iD) { VUB = getVubs(ind[iD]); std::cout << std::setw(5) << coef[iD] << "[" << std::setw(5) << ind[iD] << "] -- " << std::setw(20) << xlp[ind[iD]] << '\t'; if (VUB.getVar() != UNDEFINED_) { std::cout << std::setw(20) << VUB.getVal() << "[" << std::setw(5) << VUB.getVar() << "]" << std::setw(20) << xlp[VUB.getVar()] << std::endl; } else std::cout << std::setw(20) << si.getColUpper()[ind[iD]] << " " << std::setw(20) << 1.0 << std::endl; } } //------------------------------------------------------------------------- // Generate conservation inequality and capacity equalities from // the given row. for (i = 0; i < rowLen; ++i) { VLB = getVlbs(ind[i]); LB = ( VLB.getVar() != UNDEFINED_ ) ? VLB.getVal() : si.getColLower()[ind[i]]; VUB = getVubs(ind[i]); UB = ( VUB.getVar() != UNDEFINED_ ) ? VUB.getVal() : si.getColUpper()[ind[i]]; if (LB < -EPSILON_) { // Only consider rows whose variables are all delete [] sign; // non-negative (LB>= 0). delete [] up; delete [] x; delete [] y; return generated; } if ( columnType[ind[i]]==1 ) { // Binary variable value = coef[i]; if (value > EPSILON_) sign[i] = CGLFLOW_COL_BINPOS; else { sign[i] = CGLFLOW_COL_BINNEG; value = -value; } up[i] = value; x[i] = xlp[ind[i]]; y[i] = value * x[i]; } else { value = coef[i]; if (value > EPSILON_) sign[i] = CGLFLOW_COL_CONTPOS; else { sign[i] = CGLFLOW_COL_CONTNEG; value = -value; } up[i] = value* UB; x[i] = (VUB.getVar() != UNDEFINED_) ? xlp[VUB.getVar()] : 1.0; y[i] = value * xlp[ind[i]]; } } //------------------------------------------------------------------------- // Find a initial cover (C+, C-) in (N+, N-) double knapRHS = rhs; double tempSum = 0.0; double tempMin = INFTY_; CglFlowColCut * candidate = new CglFlowColCut [rowLen]; CglFlowColCut * label = new CglFlowColCut [rowLen]; double* ratio = new double [rowLen]; int t = -1; for (i = 0; i < rowLen; ++i) { candidate[i] = label[i] = CGLFLOW_COL_OUTCUT; ratio[i] = INFTY_; switch(sign[i]) { case CGLFLOW_COL_CONTPOS: case CGLFLOW_COL_BINPOS: if( y[i] > EPSILON_ ) { ratio[i] = (1.0 - x[i]) / up[i]; if( y[i] > up[i] * x[i] - EPSILON_ ) { // Violated candidate[i] = CGLFLOW_COL_PRIME; tempSum += up[i]; } else { candidate[i] = CGLFLOW_COL_SECONDARY; } } break; case CGLFLOW_COL_CONTNEG: case CGLFLOW_COL_BINNEG: if( up[i] > ( (1.0 - EPSILON_) * INFTY_ ) ) { // UB is infty label[i] = CGLFLOW_COL_INCUT; } else { knapRHS += up[i]; if( y[i] < up[i] ) { candidate[i] = CGLFLOW_COL_PRIME; ratio[i] = x[i] / up[i]; tempSum += up[i]; } } break; } } double diff, tempD, lambda; int xID = -1; if (knapRHS >1.0e10) { if(CGLFLOW_DEBUG) { std::cout << "knapsack RHS too large. RETURN." << std::endl; } delete [] sign; delete [] up; delete [] x; delete [] y; delete [] candidate; delete [] label; delete [] ratio; return generated; } while (tempSum < knapRHS + EPSILON_) { // Not a cover yet diff = INFTY_; for (i = 0; i < rowLen; ++i) { if (candidate[i] == CGLFLOW_COL_SECONDARY) { tempD = up[i] * x[i] - y[i]; if (tempD < diff - EPSILON_) { diff = tempD; xID = i; } } } if( diff > (1.0 - EPSILON_) * INFTY_ ) { // NO cover exits. delete [] sign; delete [] up; delete [] x; delete [] y; delete [] candidate; delete [] label; delete [] ratio; return generated; } else { tempSum += up[xID]; candidate[xID] = CGLFLOW_COL_PRIME; } } // Solve the knapsack problem to get an initial cover tempSum = 0.0; for (i = 0; i < rowLen; ++i) { if (candidate[i] == CGLFLOW_COL_PRIME && ratio[i] < EPSILON_) { //Zero ratio label[i] = CGLFLOW_COL_INCUT; tempSum += up[i]; } } while (tempSum < knapRHS + EPSILON_) { tempMin = INFTY_; xID=-1; for (i = 0; i < rowLen; i++) { // Search the col with minimum ratio if (candidate[i] == CGLFLOW_COL_PRIME && label[i] == 0 && ratio[i] < tempMin) { tempMin = ratio[i]; xID = i; } } if (xID>=0) { label[xID] = CGLFLOW_COL_INCUT; tempSum += up[xID]; } else { if(CGLFLOW_DEBUG) { std::cout << "knapsack RHS too large B. RETURN." << std::endl; } delete [] sign; delete [] up; delete [] x; delete [] y; delete [] candidate; delete [] label; delete [] ratio; return generated; } } // Reduce to a minimal cover for (i = 0; i < rowLen; ++i) { if (label[i] == CGLFLOW_COL_INCUT && ratio[i] > EPSILON_) { if (tempSum - up[i] > knapRHS + EPSILON_) { label[i] = CGLFLOW_COL_OUTCUT; tempSum -= up[i]; } } } for (i = 0; i < rowLen; ++i) { if (label[i] == CGLFLOW_COL_INCUT && ratio[i] < EPSILON_) { if (tempSum - up[i] > knapRHS + EPSILON_) { label[i] = CGLFLOW_COL_OUTCUT; tempSum -= up[i]; } } } // Due to the way to handle N- for(i = 0; i < rowLen; ++i) { if( sign[i] < 0 ) label[i] = label[i]==CGLFLOW_COL_OUTCUT?CGLFLOW_COL_INCUT:CGLFLOW_COL_OUTCUT; } // No cover, no cut. bool emptyCover = true; for (i = 0; i < rowLen; ++i) { if (label[i] == CGLFLOW_COL_INCUT) { emptyCover = false; break; } } if (emptyCover) { if(CGLFLOW_DEBUG) { std::cout << "No cover. RETURN." << std::endl; } delete [] sign; delete [] up; delete [] x; delete [] y; delete [] candidate; delete [] label; delete [] ratio; return generated; } lambda = tempSum - knapRHS; if(CGLFLOW_DEBUG) { double sum_mj_Cplus = 0.0; double sum_mj_Cminus= 0.0; // double checkLambda; // variable not used anywhere (LL) // print out the knapsack variables std::cout << "Knapsack Cover: C+" << std::endl; for (i = 0; i < rowLen; ++i) { if ( label[i] == CGLFLOW_COL_INCUT && sign[i] > 0 ) { std::cout << ind[i] << '\t' << up[i] << std::endl; sum_mj_Cplus += up[i]; } } std::cout << "Knapsack Cover: C-" << std::endl; for (i = 0; i < rowLen; ++i) { if ( label[i] == CGLFLOW_COL_INCUT && sign[i] < 0 ) { std::cout << ind[i] << '\t' << up[i] << std::endl; sum_mj_Cminus += up[i]; } } // rlh: verified "lambda" is lambda in the paper. // lambda = (sum coefficients in C+) - (sum of VUB // coefficients in C-) - rhs-orig-constraint std::cout << "lambda = " << lambda << std::endl; } //------------------------------------------------------------------------- // Generate a violated SGFC int numCMinus = 0; int numPlusPlus = 0; double* rho = new double [rowLen]; double* xCoef = new double [rowLen]; double* yCoef = new double [rowLen]; double cutRHS = rhs; double temp = 0.0; double sum = 0.0; double minPlsM = INFTY_; double minNegM = INFTY_; for(i = 0; i < rowLen; ++i) { rho[i] = 0.0; xCoef[i] = 0.0; yCoef[i] = 0.0; } // Project out variables in C- // d^' = d + sum_{i in C^-} m_i. Now cutRHS = d^' for (i = 0; i < rowLen; ++i) { if ( label[i] == CGLFLOW_COL_INCUT && sign[i] < 0 ) { cutRHS += up[i]; ++numCMinus; } } // (1) Compute the coefficients of the simple generalized flow cover // (2) Compute minPlsM, minNegM and sum // // sum = sum_{i in C+\C++} m_i + sum_{i in L--} m_i = m. Page 15. // minPlsM = min_{i in C++} m_i // minNegM = min_{i in L-} m_i temp = cutRHS; for (i = 0; i < rowLen; ++i) { if (label[i] == CGLFLOW_COL_INCUT && sign[i] > 0) { // C+ yCoef[i] = 1.0; if ( up[i] > lambda + EPSILON_ ) { // C++ ++numPlusPlus; xCoef[i] = lambda - up[i]; cutRHS += xCoef[i]; if( up[i] < minPlsM ) { minPlsM = up[i]; } } else { // C+\C++ xCoef[i] = 0.0; // rlh: is this necesarry? (xCoef initialized to zero) sum += up[i]; } } if (label[i] != CGLFLOW_COL_INCUT && sign[i] < 0) { // N-\C- temp += up[i]; if ( up[i] > lambda) { // L- if(CGLFLOW_DEBUG) { std::cout << "Variable " << ind[i] << " is in L-" << std::endl; } yCoef[i] = 0.0; xCoef[i] = -lambda; label[i] = CGLFLOW_COL_INLMIN; if ( up[i] < minNegM ) { minNegM = up[i]; } } else { // L-- if(CGLFLOW_DEBUG) { std::cout << "Variable " << ind[i] << " is in L-- " << std::endl; } yCoef[i] = -1.0; xCoef[i] = 0.0; // rlh: is this necesarry? (xCoef initialized to zero) label[i] = CGLFLOW_COL_INLMINMIN; sum += up[i]; } } } // Sort the upper bounds (m_i) of variables in C++ and L-. int ix; int index = 0; double* mt = new double [rowLen]; double* M = new double [rowLen + 1]; // order to look at variables int * order = new int [rowLen]; int nLook=0; for (int i = 0; i < rowLen; ++i) { if ( (label[i] == CGLFLOW_COL_INCUT && sign[i] > 0) || label[i] == CGLFLOW_COL_INLMIN ) { // C+ || L- // possible M[nLook]=-up[i]; order[nLook++]=i; } } CoinSort_2(M,M+nLook,order); int kLook=0; while (kLook 0) || label[i] == CGLFLOW_COL_INLMIN ) { // C+ || L- if ( up[i] > lambda ) { // C++ || L-(up[i] > lambda) ix = i; } } if( ix == UNDEFINED_ ) break; mt[index++] = up[ix]; // Record m_i in C++ and L-(not all) in descending order. if( label[ix] == CGLFLOW_COL_INLMIN ) label[ix] = CGLFLOW_COL_INLMINDONE; else label[ix] = CGLFLOW_COL_INCUTDONE; } //printf("mins %g %g\n",minNegM,minPlsM); if( index == 0 || numPlusPlus == 0) { // No column in C++ and L-(not all). RETURN. if(CGLFLOW_DEBUG) { std::cout << "index = 0. RETURN." << std::endl; } delete [] sign; delete [] up; delete [] x; delete [] y; delete [] candidate; delete [] label; delete [] ratio; delete [] rho; delete [] xCoef; delete [] yCoef; delete [] mt; delete [] M; delete [] order; return generated; } for ( i = 0; i < rowLen; i++ ) { switch( label[i] ) { case CGLFLOW_COL_INCUTDONE: label[i] = CGLFLOW_COL_INCUT; break; case CGLFLOW_COL_INLMIN: case CGLFLOW_COL_INLMINDONE: case CGLFLOW_COL_INLMINMIN: label[i] = CGLFLOW_COL_OUTCUT; break; case CGLFLOW_COL_INCUT: case CGLFLOW_COL_OUTCUT: case CGLFLOW_COL_PRIME: case CGLFLOW_COL_SECONDARY: break; } } /* Get t */ t = 0; for ( i = 0; i < index; ++i ) { if ( mt[i] < minPlsM ) { t = i; break; } } if (i == index) { t = index; } /* Compute M_i */ M[0] = 0.0; for ( i = 1; i <= index; ++i ) { M[i] = M[(i-1)] + mt[(i-1)]; if(CGLFLOW_DEBUG) { std::cout << "t = " << t << std::endl; std::cout << "mt[" << std::setw(5) << (i-1) << "]=" << std::setw(2) << ", M[" << std::setw(5) << i << "]=" << std::setw(20) << M[i] << std::endl; } } // Exit if very big M if (M[index]>1.0e30) { // rlh: should test for huge col UB earler // no sense doing all this work in that case. if(CGLFLOW_DEBUG) { std::cout << "M[index]>1.0e30. RETURN." << std::endl; delete [] sign; delete [] up; delete [] x; delete [] y; delete [] candidate; delete [] label; delete [] ratio; delete [] rho; delete [] xCoef; delete [] yCoef; delete [] mt; delete [] M; delete [] order; return generated; } } /* Get ml */ double ml = CoinMin(sum, lambda); if(CGLFLOW_DEBUG) { // sum = sum_{i in C+\C++} m_i + sum_{i in L--} m_i = m. Page 15. std::cout << "ml = CoinMin(m, lambda) = CoinMin(" << sum << ", " << lambda << ") =" << ml << std::endl; } /* rho_i = max[0, m_i - (minPlsM - lamda) - ml */ if (t < index ) { /* rho exits only for t <= index-1 */ value = (minPlsM - lambda) + ml; for (i = t; i < index; ++i) { rho[i] = CoinMax(0.0, mt[i] - value); if(CGLFLOW_DEBUG) { std::cout << "rho[" << std::setw(5) << i << "]=" << std::setw(20) << rho[i] << std::endl; } } } // Calculate the violation violation = -cutRHS; for ( i = 0; i < rowLen; ++i ) { #ifdef CGLFLOW_DEBUG2 if(CGLFLOW_DEBUG) { std::cout << "i = " << i << " ind = " << ind[i] << " sign = " << sign[i] << " coef = " << coef[i] << " x = " << x[i] << " xCoef = " << xCoef[i] << " y = " << y[i] << " yCoef = " << yCoef[i] << " up = " << up[i] << " label = " << label[i] << std::endl; } #endif violation += y[i] * yCoef[i] + x[i] * xCoef[i]; } if(CGLFLOW_DEBUG) { std::cout << "violation = " << violation << std::endl; } // double violationBeforeLift=violation; // variable not used anywhere (LL) if(doLift && fabs(violation) > TOLERANCE_ ) { // LIFTING double estY, estX; double movement = 0.0; double dPrimePrime = temp + cutRHS; bool lifted = false; for( i = 0; i < rowLen; ++i ) { if ( (label[i] != CGLFLOW_COL_INCUT) && (sign[i] > 0) ) {/* N+\C+*/ lifted = liftPlus(estY, estX, index, up[i], lambda, y[i], x[i], dPrimePrime, M); xCoef[i] = -estX; yCoef[i] = estY; if(CGLFLOW_DEBUG) { if (lifted) { printf("Success: Lifted col %i (up_i=%f,yCoef[i]=%f,xCoef[i]=%f) in N+\\C+\n", ind[i], up[i], yCoef[i], xCoef[i]); } else { printf("Failed to Lift col %i (m_i=%f) in N+\\C+\n", ind[i], up[i]); } } } if (label[i] == CGLFLOW_COL_INCUT && sign[i] < 0) { /* C- */ liftMinus(movement, t, index, up[i], dPrimePrime, lambda, ml, M, rho); if(movement > EPSILON_) { if(CGLFLOW_DEBUG) { printf("Success: Lifted col %i in C-, movement=%f\n", ind[i], movement); } lifted = true; xCoef[i] = -movement; cutRHS -= movement; } else { if(CGLFLOW_DEBUG) { printf("Failed to Lift col %i in C-, g=%f\n", ind[i], movement); } } } } } //------------------------------------------------------------------- // Calculate the violation violation = -cutRHS; for ( i = 0; i < rowLen; ++i ) { #ifdef CGLFLOW_DEBUG2 if(CGLFLOW_DEBUG) { std::cout << "i = " << i << " ind = " << ind[i] << " sign = " << sign[i] << " coef = " << coef[i] << " x = " << x[i] << " xCoef = " << xCoef[i] << " y = " << y[i] << " yCoef = " << yCoef[i] << " up = " << up[i] << " label = " << label[i] << std::endl; } #endif violation += y[i] * yCoef[i] + x[i] * xCoef[i]; } if(CGLFLOW_DEBUG) { std::cout << "violation = " << violation << std::endl; } int cutLen = 0; int* cutInd = 0; double* cutCoef = 0; // If violated, transform the inequality back to original system if ( violation > TOLERANCE_ ) { cutLen = 0; cutInd = new int [3*numCols]; cutCoef = new double [3*numCols]; assert (cutLen EPSILON_ ) { if ( sign[i] == CGLFLOW_COL_CONTPOS ) cutCoef[cutLen] = coef[i] * yCoef[i]; else cutCoef[cutLen] = -coef[i] * yCoef[i]; cutInd[cutLen++] = ind[i]; } if ( fabs( xCoef[i] ) > EPSILON_ ) { if ( VUB.getVar() != UNDEFINED_ ) { cutCoef[cutLen] = xCoef[i]; cutInd[cutLen++] = VUB.getVar(); } else cutRHS -= xCoef[i]; } } if ( ( sign[i] == CGLFLOW_COL_BINPOS ) || ( sign[i] == CGLFLOW_COL_BINNEG ) ) { if (fabs(yCoef[i]) > EPSILON_ || fabs(xCoef[i]) > EPSILON_) { if (sign[i] == CGLFLOW_COL_BINPOS) cutCoef[cutLen] = coef[i] * yCoef[i] + xCoef[i]; else cutCoef[cutLen] = -coef[i] * yCoef[i] + xCoef[i]; cutInd[cutLen++] = ind[i]; } } } #if 1 assert (cutLen); CoinShortSort_2(cutInd,cutInd+cutLen,cutCoef); j=0; int lastInd=cutInd[0]; double lastCoef=cutCoef[0]; for ( i = 1; i < cutLen+1; ++i ) { if (i==cutLen||cutInd[i]>lastInd) { if ( fabs(lastCoef) >= EPSILON_ ) { cutCoef[j]=lastCoef; cutInd[j++]=lastInd; lastCoef = cutCoef[i]; if (i TOLERANCE_ ) { flowCut.setRow(cutLen, cutInd, cutCoef); flowCut.setLb(-1.0 * si.getInfinity()); flowCut.setUb(cutRHS); flowCut.setEffectiveness(violation); generated = true; if(CGLFLOW_DEBUG) { std::cout << "generateOneFlowCover(): Found a cut" << std::endl; } } else { if(CGLFLOW_DEBUG) { std::cout << "generateOneFlowCover(): Lost a cut" << std::endl; } } } //------------------------------------------------------------------------- delete [] sign; delete [] up; delete [] x; delete [] y; delete [] candidate; delete [] label; delete [] ratio; delete [] rho; delete [] xCoef; delete [] yCoef; delete [] mt; delete [] M; delete [] order; delete [] cutInd; delete [] cutCoef; return generated; } //------------------------------------------------------------------- // Flip a row from ">=" to "<=", and vice versa. //------------------------------------------------------------------- void CglFlowCover::flipRow(int rowLen, double* coef, double& rhs) const { for(int i = 0; i < rowLen; ++i) coef[i] = -coef[i]; rhs = -rhs; } //------------------------------------------------------------------- // Flip a row from ">=" to "<=", and vice versa. Have 'sense'. //------------------------------------------------------------------- void CglFlowCover::flipRow(int rowLen, double* coef, char& sen, double& rhs) const { for(int i = 0; i < rowLen; ++i) coef[i] = -coef[i]; sen = (sen == 'G') ? 'L' : 'G'; rhs = -rhs; } //------------------------------------------------------------------- // Determine the type of a given row //------------------------------------------------------------------- CglFlowRowType CglFlowCover::determineOneRowType(const OsiSolverInterface& si, int rowLen, int* ind, double* coef, char sense, double rhs) const { if (rowLen == 0) return CGLFLOW_ROW_UNDEFINED; if (sense == 'R') return CGLFLOW_ROW_UNINTERSTED; // Could be fixed CglFlowRowType rowType = CGLFLOW_ROW_UNDEFINED; // Get integer types const char * columnType = si.getColType (); int numPosBin = 0; // num of positive binary variables int numNegBin = 0; // num of negative binary variables int numBin = 0; // num of binary variables int numPosCol = 0; // num of positive variables int numNegCol = 0; // num of negative variables int i; bool flipped = false; // Range row will only consider as 'L' if (sense == 'G') { // Transform to " <= " flipRow(rowLen, coef, sense, rhs); flipped = true; } // Summarize the variable types of the given row. for ( i = 0; i < rowLen; ++i ) { if ( coef[i] < -EPSILON_ ) { ++numNegCol; if( columnType[ind[i]]==1 ) ++numNegBin; } else { ++numPosCol; if( columnType[ind[i]]==1 ) ++numPosBin; } } numBin = numNegBin + numPosBin; if(CGLFLOW_DEBUG) { std::cout << "numNegBin = " << numNegBin << std::endl; std::cout << "numPosBin = " << numPosBin << std::endl; std::cout << "numBin = " << numBin << std::endl; std::cout << "rowLen = " << rowLen << std::endl; } //------------------------------------------------------------------------ // Classify row type based on the types of variables. // All variables are binary. NOT interested in this type of row right now if (numBin == rowLen) rowType = CGLFLOW_ROW_UNINTERSTED; // All variables are NOT binary if (rowType == CGLFLOW_ROW_UNDEFINED && numBin == 0) { if (sense == 'L') rowType = CGLFLOW_ROW_NOBINUB; else rowType = CGLFLOW_ROW_NOBINEQ; } // There are binary and other types of variables if (rowType == CGLFLOW_ROW_UNDEFINED) { if ((rhs < -EPSILON_) || (rhs > EPSILON_) || (numBin != 1)) { if (sense == 'L') rowType = CGLFLOW_ROW_MIXUB; else rowType = CGLFLOW_ROW_MIXEQ; } else { // EXACTLY one binary if (rowLen == 2) { // One binary and one other type if (sense == 'L') { if (numNegCol == 1 && numNegBin == 1) rowType = CGLFLOW_ROW_VARUB; if (numPosCol == 1 && numPosBin == 1) rowType = CGLFLOW_ROW_VARLB; } else rowType = CGLFLOW_ROW_VAREQ; } else { // One binary and 2 or more other types if (numNegCol==1 && numNegBin==1) {// Binary has neg coef and if (sense == 'L') // other are positive rowType = CGLFLOW_ROW_SUMVARUB; else rowType = CGLFLOW_ROW_SUMVAREQ; } } } } // Still undefined if (rowType == CGLFLOW_ROW_UNDEFINED) { if (sense == 'L') rowType = CGLFLOW_ROW_MIXUB; else rowType = CGLFLOW_ROW_MIXEQ; } if (flipped == true) { flipRow(rowLen, coef, sense, rhs); } return rowType; } /*===========================================================================*/ void CglFlowCover::liftMinus(double &movement, /* Output */ int t, int r, double z, double dPrimePrime, double lambda, double ml, double *M, double *rho) const { int i; movement = 0.0; if (z > dPrimePrime) { movement = z - M[r] + r * lambda; } else { for (i = 0; i < t; ++i) { if ( (z >= M[i]) && (z <= M[(i+1)] - lambda) ) { movement = i * lambda; return; } } for (i = 1; i < t; ++i) { if ( (z >= M[i] - lambda) && (z <= M[i]) ) { movement = z - M[i] + i * lambda; return; } } for (i = t; i < r; ++i) { if ( (z >= M[i] - lambda) && (z <= M[i] - lambda + ml + rho[i]) ) { movement = z - M[i] + i * lambda; return; } } for (i = t; i < r; ++i) { if ( (z >= M[i]-lambda+ml+rho[i]) && (z <= M[(i+1)]-lambda) ) { movement = i * lambda; return; } } if ((z >= M[r] - lambda) && z <= dPrimePrime) { movement = z - M[r] + r * lambda; } } } /*===========================================================================*/ bool CglFlowCover::liftPlus(double &alpha, double &beta, int r, double m_j, double lambda, double y_j, double x_j, double dPrimePrime, double *M) const { int i; bool status = false; /* Default: fail to lift */ double value; alpha = 0.0; beta = 0.0; if (m_j > M[r] - lambda + EPSILON_) { if (m_j < dPrimePrime - EPSILON_) { if ((m_j > (M[r] - lambda)) && (m_j <= M[r])){ /* FIXME: Test */ value = y_j - x_j * (M[r] - r * lambda); /* FIXME: Is this "if" useful */ if (value > 0.0) { status = true; alpha = 1.0; beta = M[r] - r * lambda; if(CGLFLOW_DEBUG) { printf("liftPlus:1: value=%f, alpah=%f, beta=%f\n", value, alpha,beta); } } else { if(CGLFLOW_DEBUG) { printf("liftPlus:1: value=%f, become worst\n",value); } } } } else { if(CGLFLOW_DEBUG) { printf("liftPlus:1: too big number\n"); } } } else { for (i = 1; i <= r; ++i) { if ((m_j > (M[i] - lambda)) && (m_j <= M[i])){ /* FIXME: Test */ value = y_j - x_j * (M[i] - i * lambda); /* FIXME: Is this "if" useful */ if (value > 0.0) { status = true; alpha = 1.0; beta = M[i] - i * lambda; if(CGLFLOW_DEBUG) { printf("liftPlus:2: value=%f, alpah=%f, beta=%f\n", value, alpha, beta); } } else { if(CGLFLOW_DEBUG) { printf("liftPlus:2: value=%f, become worst\n",value); } } return status; } } } return status; } // Create C++ lines to get to current state std::string CglFlowCover::generateCpp( FILE * fp) { CglFlowCover other; fprintf(fp,"0#include \"CglFlowCover.hpp\"\n"); fprintf(fp,"3 CglFlowCover flowCover;\n"); if (maxNumCuts_!=other.maxNumCuts_) fprintf(fp,"3 flowCover.setMaxNumCuts(%d);\n",maxNumCuts_); else fprintf(fp,"4 flowCover.setMaxNumCuts(%d);\n",maxNumCuts_); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 flowCover.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 flowCover.setAggressiveness(%d);\n",getAggressiveness()); return "flowCover"; } Cgl-0.58.9/src/CglFlowCover/CglFlowCoverTest.cpp0000644000076600007660000001103111507177625020032 0ustar coincoin// $Id: CglFlowCoverTest.cpp 908 2010-12-30 21:54:29Z mjs $ //----------------------------------------------------------------------------- // name: Cgl Lifed Simple Generalized Flow Cover Cut Generator // author: Yan Xu email: Yan.Xu@sas.com // Jeff Linderoth email: jtl3@lehigh.edu // Martin Savelsberg email: martin.savelsbergh@isye.gatech.edu // date: 05/01/2003 // comments: please scan this file for '???' and read the comments //----------------------------------------------------------------------------- // Copyright (C) 2003, Yan Xu, Jeff Linderoth, Martin Savelsberg and others. // All Rights Reserved. // This code is published under the Eclipse Public License. #ifdef NDEBUG #undef NDEBUG #endif #include #include //#include "CoinPackedMatrix.hpp" #include "CglFlowCover.hpp" //-------------------------------------------------------------------------- void CglFlowCoverUnitTest( const OsiSolverInterface * baseSiP, const std::string mpsDir ) { // Test default constructor { CglFlowCover aGenerator; assert (aGenerator.getMaxNumCuts() == 2000); } // Test copy & assignment { CglFlowCover rhs; { CglFlowCover bGenerator; bGenerator.setMaxNumCuts(100); CglFlowCover cGenerator(bGenerator); rhs=bGenerator; } } { OsiCuts osicuts1; CglFlowCover test; OsiSolverInterface * siP = baseSiP->clone(); int nRowCuts; std::string fn(mpsDir+"egout"); std::string fn2 = mpsDir+"egout.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(), "mps"); // Check the preprocess test.flowPreprocess(*siP); #ifdef CGL_DEBUG test.printVubs(std::cout); #endif // Test generating cuts siP->initialSolve(); double lpRelax = siP->getObjValue(); test.generateCuts(*siP, osicuts1); nRowCuts = osicuts1.sizeRowCuts(); #ifdef CGL_DEBUG std::cout<<"There are " << nRowCuts << " flow cuts" << std::endl; int i; for (i = 0; i < nRowCuts; i++){ OsiRowCut rcut; CoinPackedVector rpv; const double* colsol = siP->getColSolution(); rcut = osicuts1.rowCut(i); rpv = rcut.row(); const int n = rpv.getNumElements(); const int* indices = rpv.getIndices(); double* elements = rpv.getElements(); double sum2 = 0.0; int k = 0; double lb = rcut.lb(); double ub = rcut.ub(); for (k = 0; k < n; ++k){ int column = indices[k]; sum2 += colsol[column] * elements[k]; } if (sum2 > ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout << "Cut " << i <<" lb " << lb << " solution " << sum2 <<" ub " << ub << std::endl; for (k = 0; k < n; ++k){ int column = indices[k]; std::cout << "(col=" << column << ", el = " << elements[k] << ", sol = " << colsol[column] << ") "; } std::cout <applyCuts(osicuts2); siP->resolve(); nRowCuts = osicuts2.sizeRowCuts(); std::cout<<"There are " << nRowCuts << " flow cuts" << std::endl; #ifdef CGL_DEBUG for (i = 0; i < nRowCuts; i++){ OsiRowCut rcut; CoinPackedVector rpv; const double* colsol = siP->getColSolution(); rcut = osicuts2.rowCut(i); rpv = rcut.row(); const int n = rpv.getNumElements(); const int* indices = rpv.getIndices(); double* elements = rpv.getElements(); double sum2 = 0.0; int k = 0; double lb = rcut.lb(); double ub = rcut.ub(); for (k = 0; k < n; ++k){ int column = indices[k]; sum2 += colsol[column] * elements[k]; } if (sum2 > ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout << "Cut " << i <<" lb " << lb << " solution " << sum2 <<" ub " << ub << std::endl; for (k = 0; k < n; ++k){ int column = indices[k]; std::cout << "(col=" << column << ", el = " << elements[k] << ", sol = " << colsol[column] << ") "; } std::cout < 0); rc = siP->applyCuts(osicuts2); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); std::cout<<"Initial LP value: "< #include "CoinError.hpp" #include "CglCutGenerator.hpp" //============================================================================= //============================================================================= /** This enumerative constant describes the various col types.*/ enum CglFlowColType { /** The column(variable) is a negative binary variable.*/ CGLFLOW_COL_BINNEG = -2, /** The column is a negative continous variable.*/ CGLFLOW_COL_CONTNEG, /** The column is a positive continous variable.*/ CGLFLOW_COL_CONTPOS = 1, /** The column is a positive binary variable.*/ CGLFLOW_COL_BINPOS }; enum CglFlowColStatus{ }; /** This enumerative constant describes the various stati of vars in a cut or not.*/ enum CglFlowColCut{ /** The column is NOT in cover.*/ CGLFLOW_COL_OUTCUT = 0, /** The column is in cover now. */ CGLFLOW_COL_INCUT, /** The column is decided to be in cover. */ CGLFLOW_COL_INCUTDONE, /** The column is in L-. */ CGLFLOW_COL_INLMIN, /** The column is decided to be in L-. */ CGLFLOW_COL_INLMINDONE, /** The column is in L--.*/ CGLFLOW_COL_INLMINMIN, /** This enumerative constant describes the various stati of vars in determining the cover.*/ /** The column is a prime candidate. */ CGLFLOW_COL_PRIME, /** The column is a secondary candidate. */ CGLFLOW_COL_SECONDARY }; /** This enumerative constant describes the various row types.*/ enum CglFlowRowType { /** The row type of this row is NOT defined yet.*/ CGLFLOW_ROW_UNDEFINED, /** After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the other is continous, and the RHS is zero.*/ CGLFLOW_ROW_VARUB, /** After the row is flipped to 'L', the row has exactlytwo variables: one is positive binary and the other is continous, and the RHS is zero.*/ CGLFLOW_ROW_VARLB, /** The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous, and the RHS is zero.*/ CGLFLOW_ROW_VAREQ, /** Rows can not be classfied into other types and the row sense is NOT 'E'.*/ CGLFLOW_ROW_MIXUB, /** Rows can not be classfied into other types and the row sense is 'E'.*/ CGLFLOW_ROW_MIXEQ, /** All variables are NOT binary and the row sense is NOT 'E'. */ CGLFLOW_ROW_NOBINUB, /** All variables are NOT binary and the row sense is 'E'. */ CGLFLOW_ROW_NOBINEQ, /** The row has one binary and 2 or more other types of variables and the row sense is NOT 'E'. */ CGLFLOW_ROW_SUMVARUB, /** The row has one binary and 2 or more other types of variables and the row sense is 'E'. */ CGLFLOW_ROW_SUMVAREQ, /** All variables are binary. */ CGLFLOW_ROW_UNINTERSTED }; //============================================================================= /** Variable upper bound class. */ class CglFlowVUB { protected: int varInd_; /** The index of the associated 0-1 variable.*/ double upper_; /** The Value of the associated upper bound.*/ public: CglFlowVUB() : varInd_(-1), upper_(-1) {} CglFlowVUB(const CglFlowVUB& source) { varInd_= source.varInd_; upper_ = source.upper_; } CglFlowVUB& operator=(const CglFlowVUB& rhs) { if (this == &rhs) return *this; varInd_= rhs.varInd_; upper_ = rhs.upper_; return *this; } /**@name Query and set functions for associated 0-1 variable index and value. */ //@{ inline int getVar() const { return varInd_; } inline double getVal() const { return upper_; } inline void setVar(const int v) { varInd_ = v; } inline void setVal(const double v) { upper_ = v; } //@} }; //============================================================================= /** Variable lower bound class, which is the same as vub. */ typedef CglFlowVUB CglFlowVLB; /** Overloaded operator<< for printing VUB and VLB.*/ std::ostream& operator<<( std::ostream& os, const CglFlowVUB &v ); //============================================================================= /** * Lifed Simple Generalized Flow Cover Cut Generator Class. */ class CglFlowCover : public CglCutGenerator { friend void CglFlowCoverUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /** * Do the following tasks: *
    *
  • classify row types *
  • indentify vubs and vlbs *
* This function is called by * generateCuts(const OsiSolverInterface & si, OsiCuts & cs). */ void flowPreprocess(const OsiSolverInterface& si); /**@name Generate Cuts */ //@{ /** Generate Lifed Simple Generalized flow cover cuts for the model data contained in si. The generated cuts are inserted into and returned in the collection of cuts cs. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Functions to query and set maximum number of cuts can be generated. */ //@{ inline int getMaxNumCuts() const { return maxNumCuts_; } inline void setMaxNumCuts(int mc) { maxNumCuts_ = mc; } //@} /**@name Functions to query and set the number of cuts have been generated. */ //@{ inline int getNumFlowCuts() { return numFlowCuts_; } inline void setNumFlowCuts(int fc) { numFlowCuts_ = fc; } inline void incNumFlowCuts(int fc = 1) { numFlowCuts_ += fc; } //@} //------------------------------------------------------------------------- /**@name Constructors and destructors */ //@{ /// Default constructor CglFlowCover (); /// Copy constructor CglFlowCover ( const CglFlowCover &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglFlowCover & operator=( const CglFlowCover& rhs); /// Destructor virtual ~CglFlowCover (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} private: //------------------------------------------------------------------------- // Private member functions /** Based a given row, a LP solution and other model data, this function tries to generate a violated lifted simple generalized flow cover. */ bool generateOneFlowCut( const OsiSolverInterface & si, const int rowLen, int* ind, double* coef, char sense, double rhs, OsiRowCut& flowCut, double& violation ); /** Transform a row from ">=" to "<=", and vice versa. */ void flipRow(int rowLen, double* coef, double& rhs) const; /** Transform a row from ">=" to "<=", and vice versa. Have 'sense'. */ void flipRow(int rowLen, double* coef, char& sen, double& rhs) const; /** Determine the type of a given row. */ CglFlowRowType determineOneRowType(const OsiSolverInterface& si, int rowLen, int* ind, double* coef, char sen, double rhs) const; /** Lift functions */ void liftMinus(double &movement, /* Output */ int t, int r, double z, double dPrimePrime, double lambda, double ml, double *M, double *rho) const; bool liftPlus(double &alpha, double &beta, int r, double m_j, double lambda, double y_j, double x_j, double dPrimePrime, double *M) const; //------------------------------------------------------------------------- //**@name Query and set the row type of a givne row. */ //@{ inline const CglFlowRowType* getRowTypes() const { return rowTypes_; } inline CglFlowRowType getRowType(const int i) const { return rowTypes_[i]; } /** Set rowtypes, take over the ownership. */ inline void setRowTypes(CglFlowRowType* rt) { rowTypes_ = rt; rt = 0; } inline void setRowTypes(const CglFlowRowType rt, const int i) { if (rowTypes_ != 0) rowTypes_[i] = rt; else { std::cout << "ERROR: Should allocate memory for rowType_ before " << "using it " << std::endl; throw CoinError("Forgot to allocate memory for rowType_", "setRowType", "CglFlowCover"); } } //@} //------------------------------------------------------------------------- //**@name Query and set vubs. */ //@{ inline const CglFlowVUB* getVubs() const { return vubs_; } inline const CglFlowVUB& getVubs(int i) const { return vubs_[i]; } /** Set CglFlowVUBs,take over the ownership. */ inline void setVubs(CglFlowVUB* vubs) { vubs_ = vubs; vubs = 0; } inline void setVubs(const CglFlowVUB& vub, int i) { if (vubs_ != 0) vubs_[i] = vub; else { std::cout << "ERROR: Should allocate memory for vubs_ before " << "using it " << std::endl; throw CoinError("Forgot to allocate memory for vubs_", "setVubs", "CglFlowCover"); } } inline void printVubs(std::ostream& os) const { for (int i = 0; i < numCols_; ++i) { os << "ix: " << i << ", " << vubs_[i]; } } //@} //------------------------------------------------------------------------- //**@name Query and set vlbs. */ //@{ inline const CglFlowVLB* getVlbs() const { return vlbs_; } inline const CglFlowVLB& getVlbs(int i) const { return vlbs_[i]; } /** Set CglFlowVLBs,take over the ownership. */ inline void setVlbs(CglFlowVLB* vlbs) { vlbs_ = vlbs; vlbs = 0; } inline void setVlbs(const CglFlowVLB& vlb, int i) { if (vlbs_ != 0) vlbs_[i] = vlb; else { std::cout << "ERROR: Should allocate memory for vlbs_ before " << "using it " << std::endl; throw CoinError("Forgot to allocate memory for vlbs_", "setVlbs", "CglFlowCover"); } } //@} private: //------------------------------------------------------------------------ // Private member data /** The maximum number of flow cuts to be generated. Default is 2000. */ int maxNumCuts_; /** The number flow cuts found.*/ int numFlowCuts_; /** Tolerance used for numerical purpose. */ double EPSILON_; /** The variable upper bound of a flow is not indentified yet.*/ int UNDEFINED_; /** Very large number. */ double INFTY_; /** If violation of a cut is greater that this number, the cut is useful.*/ double TOLERANCE_; /** First time preprocessing */ bool firstProcess_; /** The number rows of the problem.*/ int numRows_; /** The number columns of the problem.*/ int numCols_; /** Indicate whether initial flow preprecessing has been done. */ bool doneInitPre_; /** The array of CglFlowVUBs. */ CglFlowVUB* vubs_; /** The array of CglFlowVLBs. */ CglFlowVLB* vlbs_; /** CglFlowRowType of the rows in model. */ CglFlowRowType* rowTypes_; }; //############################################################################# /** A function that tests the methods in the CglFlowCover class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglFlowCoverUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglLiftAndProject/0000755000076600007660000000000012377555671015107 5ustar coincoinCgl-0.58.9/src/CglLiftAndProject/CglLiftAndProject.cpp0000644000076600007660000003031012130104734021057 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 "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CglLiftAndProject.hpp" #include "CoinPackedVector.hpp" #include "CoinSort.hpp" #include "CoinPackedMatrix.hpp" //----------------------------------------------------------------------------- // Generate Lift-and-Project cuts //------------------------------------------------------------------- void CglLiftAndProject::generateCuts(const OsiSolverInterface& si, OsiCuts& cs, const CglTreeInfo /*info*/) { // Assumes the mixed 0-1 problem // // min {cx: >= btilde} // // is in canonical form with all bounds, // including x_t>=0, -x_t>=-1 for x_t binary, // explicitly stated in the constraint matrix. // See ~/COIN/Examples/Cgl2/cgl2.cpp // for a general purpose "convert" function. // Reference [BCC]: Balas, Ceria, and Corneujols, // "A lift-and-project cutting plane algorithm // for mixed 0-1 program", Math Prog 58, (1993) // 295-324. // This implementation uses Normalization 1. // Given canonical problem and // the lp-relaxation solution, x, // the LAP cut generator attempts to construct // a cut for every x_j such that 0getElements(); const int * AtildeIndices = Atilde->getIndices(); const CoinBigIndex * AtildeStarts = Atilde->getVectorStarts(); const int * AtildeLengths = Atilde->getVectorLengths(); const int AtildeFullSize = AtildeStarts[m]; const double * btilde = si.getRowLower(); // Set up memory for system (10) [BCC:307] // (the problem over the norm intersected // with the polar cone) // // min <,u> + x_ju_0 // s.t. // = (0,...,0,beta_,beta)^T // w is nonneg for all but the // last two entries, which are free. // where // w = (u,v,v_0,u_0)in BCC notation // u and v are m-vectors; u,v >=0 // v_0 and u_0 are free-scalars, and // // B = Atilde^T -Atilde^T -e_j e_j // btilde^T e_0^T 0 0 // e_0^T btilde^T 1 0 // ^T indicates Transpose // e_0 is a (AtildeNCols x 1) vector of all zeros // e_j is e_0 with a 1 in the jth position // Storing B in column order. B is a (n+2 x 2m+2) matrix // But need to allow for possible gaps in Atilde. // At each iteration, only need to change 2 cols and objfunc // Sane design of OsiSolverInterface does not permit mucking // with matrix. // Because we must delete and add cols to alter matrix, // and we can only add columns on the end of the matrix // put the v_0 and u_0 columns on the end. // rather than as described in [BCC] // Initially allocating B with space for v_0 and u_O cols // but not populating, for efficiency. // B without u_0 and v_0 is a (n+2 x 2m) size matrix. int twoM = 2*m; int BNumRows = n+2; int BNumCols = twoM+2; int BFullSize = 2*AtildeFullSize+twoM+3; double * BElements = new double[BFullSize]; int * BIndices = new int[BFullSize]; CoinBigIndex * BStarts = new CoinBigIndex [BNumCols+1]; int * BLengths = new int[BNumCols]; int i, ij, k=0; int nPlus1=n+1; int offset = AtildeStarts[m]+m; for (i=0; i,u> // Note: at each iteration coefficient u_0 // changes to // w=(u,v,beta,v_0,u_0) size 2m+3 // So, BOjective[2m+2]=x[j] double * BObjective= new double[BNumCols]; double * Atildex = new double[m]; CoinFillN(BObjective,BNumCols,0.0); Atilde->times(x,Atildex); // Atildex is size m, x is size n CoinDisjointCopyN(Atildex,m,BObjective); // Number of cols and size of Elements vector // in B without the v_0 and u_0 cols int BFullSizeLessThree = BFullSize-3; // Load B matrix into a column orders CoinPackedMatrix CoinPackedMatrix * BMatrix = new CoinPackedMatrix(true, BNumRows, BNumColsLessTwo, BFullSizeLessThree, BElements,BIndices, BStarts,BLengths); // Assign problem into a solver interface // Note: coneSi will cleanup the memory itself OsiSolverInterface * coneSi = si.clone(false); coneSi->assignProblem (BMatrix, BColLowers, BColUppers, BObjective, BRowLowers, BRowUppers); // Problem sense should default to "min" by default, // but just to be virtuous... coneSi->setObjSense(1.0); // The plot outline from here on down: // coneSi has been assigned B without the u_0 and v_0 columns // Calculate base objective <,u> // bool haveWarmStart = false; // For (j=0; j=1) continue; // // IMPROVEME: if(haveWarmStart) check if j attractive // add {-e_j,0,-1} matrix column for v_0 // add {e_j,0,0} matrix column for u_0 // objective coefficient for u_0 is x_j // if (haveWarmStart) // set warmstart info // solve min{objw:Bw=0; w>=0,except v_0, u_0 free} // if (bounded) // get warmstart info // haveWarmStart=true; // ustar = optimal u solution // ustar_0 = optimal u_0 solution // alpha^T= -ustar_0e_j^T // (double check >= beta_ should be violated) // add >= beta_ to cutset // endif // delete column for u_0 // this deletes all column info. // delete column for v_0 // endFor // clean up memory // return 0; int * nVectorIndices = new int[n]; CoinIotaN(nVectorIndices, n, 0); bool haveWarmStart = false; bool equalObj1, equalObj2; CoinRelFltEq eq; double v_0Elements[2] = {-1,1}; double u_0Elements[1] = {1}; CoinWarmStart * warmStart = 0; double * ustar = new double[m]; CoinFillN(ustar, m, 0.0); double* alpha = new double[n]; CoinFillN(alpha, n, 0.0); for (j=0;jgetMatrixByRow(); #endif coneSi->addCol(v_0,-solverINFINITY,solverINFINITY,0); coneSi->addCol(u_0,-solverINFINITY,solverINFINITY,x[j]); if(haveWarmStart) { coneSi->setWarmStart(warmStart); coneSi->resolve(); } else { #if CGL_DEBUG const CoinPackedMatrix *see2 = coneSi->getMatrixByRow(); #endif coneSi->initialSolve(); } if(coneSi->isProvenOptimal()){ warmStart = coneSi->getWarmStart(); haveWarmStart=true; const double * wstar = coneSi->getColSolution(); CoinDisjointCopyN(wstar, m, ustar); Atilde->transposeTimes(ustar,alpha); alpha[j]+=wstar[BNumCols-1]; #if debug int p; double sum; for(p=0;p >= beta_ to cutset OsiRowCut rc; rc.setRow(n,nVectorIndices,alpha); rc.setLb(beta_); rc.setUb(solverINFINITY); cs.insert(rc); } // delete col for u_o and v_0 coneSi->deleteCols(2,delCols); // clean up memory } // clean up delete [] alpha; delete [] ustar; delete [] nVectorIndices; // BMatrix, BColLowers,BColUppers, BObjective, BRowLowers, BRowUppers // are all freed by OsiSolverInterface destructor (?) delete [] BLengths; delete [] BStarts; delete [] BIndices; delete [] BElements; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglLiftAndProject::CglLiftAndProject () : CglCutGenerator(), beta_(1), epsilon_(1.0e-08), onetol_(1-epsilon_) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglLiftAndProject::CglLiftAndProject (const CglLiftAndProject & source) : CglCutGenerator(source), beta_(source.beta_), epsilon_(source.epsilon_), onetol_(source.onetol_) { // Nothing to do here } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglLiftAndProject::clone() const { return new CglLiftAndProject(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglLiftAndProject::~CglLiftAndProject () { // Nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglLiftAndProject & CglLiftAndProject::operator=( const CglLiftAndProject& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); beta_=rhs.beta_; epsilon_=rhs.epsilon_; onetol_=rhs.onetol_; } return *this; } // Create C++ lines to get to current state std::string CglLiftAndProject::generateCpp( FILE * fp) { CglLiftAndProject other; fprintf(fp,"0#include \"CglLiftAndProject.hpp\"\n"); fprintf(fp,"3 CglLiftAndProject liftAndProject;\n"); if (beta_!=other.beta_) fprintf(fp,"3 liftAndProject.setBeta(%d);\n",static_cast (beta_)); else fprintf(fp,"4 liftAndProject.setBeta(%d);\n",static_cast (beta_)); fprintf(fp,"3 liftAndProject.setAggressiveness(%d);\n",getAggressiveness()); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 liftAndProject.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 liftAndProject.setAggressiveness(%d);\n",getAggressiveness()); return "liftAndProject"; } Cgl-0.58.9/src/CglLiftAndProject/CglLiftAndProject.hpp0000644000076600007660000000505212130104734021071 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 CglLiftAndProject_H #define CglLiftAndProject_H #include #include "CglCutGenerator.hpp" /** Lift And Project Cut Generator Class */ class CglLiftAndProject : public CglCutGenerator { friend void CglLiftAndProjectUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /**@name Generate Cuts */ //@{ /** Generate lift-and-project cuts for the model of the solver interface, si. Insert the generated cuts into OsiCut, cs. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /** Get the normalization : Either beta=+1 or beta=-1. */ double getBeta() const { return beta_; } /** Set the normalization : Either beta=+1 or beta=-1. Default value is 1. */ void setBeta(int oneOrMinusOne){ if (oneOrMinusOne==1 || oneOrMinusOne==-1){ beta_= static_cast(oneOrMinusOne); } else { throw CoinError("Unallowable value. Beta must be 1 or -1", "cutGeneration","CglLiftAndProject"); } } //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglLiftAndProject (); /// Copy constructor CglLiftAndProject ( const CglLiftAndProject &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglLiftAndProject & operator=( const CglLiftAndProject& rhs); /// Destructor virtual ~CglLiftAndProject (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} private: // Private member methods /**@name Private methods */ //@{ //@} // Private member data /**@name Private member data */ //@{ /// The normalization is beta_=1 or beta_=-1 double beta_; /// epsilon double epsilon_; /// 1-epsilon double onetol_; //@} }; //############################################################################# /** A function that tests the methods in the CglLiftAndProject class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglLiftAndProjectUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglLiftAndProject/Makefile.am0000644000076600007660000000323211621724114017120 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglLiftAndProject # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglLiftAndProject.la # List all source files for this library, including headers libCglLiftAndProject_la_SOURCES = CglLiftAndProject.cpp CglLiftAndProject.hpp # This is for libtool (on Windows) libCglLiftAndProject_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglLiftAndProject.hpp Cgl-0.58.9/src/CglLiftAndProject/Makefile.in0000644000076600007660000005407112240340055017134 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/CglLiftAndProject 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglLiftAndProject_la_LIBADD = am_libCglLiftAndProject_la_OBJECTS = CglLiftAndProject.lo libCglLiftAndProject_la_OBJECTS = \ $(am_libCglLiftAndProject_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 = $(libCglLiftAndProject_la_SOURCES) DIST_SOURCES = $(libCglLiftAndProject_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglLiftAndProject # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglLiftAndProject.la # List all source files for this library, including headers libCglLiftAndProject_la_SOURCES = CglLiftAndProject.cpp CglLiftAndProject.hpp # This is for libtool (on Windows) libCglLiftAndProject_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglLiftAndProject.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/CglLiftAndProject/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglLiftAndProject/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglLiftAndProject.la: $(libCglLiftAndProject_la_OBJECTS) $(libCglLiftAndProject_la_DEPENDENCIES) $(CXXLINK) $(libCglLiftAndProject_la_LDFLAGS) $(libCglLiftAndProject_la_OBJECTS) $(libCglLiftAndProject_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglLiftAndProject.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglLandP/0000755000076600007660000000000012377555671013235 5ustar coincoinCgl-0.58.9/src/CglLandP/CglLandPTest.cpp0000644000076600007660000003036112130104734016201 0ustar coincoin// $Id: CglLandPTest.cpp 1123 2013-04-06 20:47:24Z stefan $ // Copyright (C) 2000-2009, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). // UnitTest for CglGomory adapted for lift-and-project #include #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CoinPackedMatrix.hpp" #include "OsiCuts.hpp" #include "CoinWarmStartBasis.hpp" #include "CglLandP.hpp" void CglLandPUnitTest( OsiSolverInterface * si, const std::string &mpsDir) { CoinRelFltEq eq(1e-05); // Test default constructor { CglLandP aGenerator; assert(aGenerator.parameter().pivotLimit==20); assert(aGenerator.parameter().maxCutPerRound==5000); assert(aGenerator.parameter().failedPivotLimit==1); assert(aGenerator.parameter().degeneratePivotLimit==0); assert(eq(aGenerator.parameter().pivotTol, 1e-04)); assert(eq(aGenerator.parameter().away, 5e-04)); assert(eq(aGenerator.parameter().timeLimit, COIN_DBL_MAX)); assert(eq(aGenerator.parameter().singleCutTimeLimit, COIN_DBL_MAX)); assert(aGenerator.parameter().useTableauRow==true); assert(aGenerator.parameter().modularize==false); assert(aGenerator.parameter().strengthen==true); assert(aGenerator.parameter().perturb==true); assert(aGenerator.parameter().pivotSelection==CglLandP::mostNegativeRc); } // Test copy constructor { CglLandP a; { CglLandP b; b.parameter().pivotLimit = 100; b.parameter().maxCutPerRound = 100; b.parameter().failedPivotLimit = 10; b.parameter().degeneratePivotLimit = 10; b.parameter().pivotTol = 1e-07; b.parameter().away = 1e-10; b.parameter().timeLimit = 120; b.parameter().singleCutTimeLimit = 15; b.parameter().useTableauRow = true; b.parameter().modularize = true; b.parameter().strengthen = false; b.parameter().perturb = false; b.parameter().pivotSelection=CglLandP::bestPivot; //Test Copy CglLandP c(b); assert(c.parameter().pivotLimit == 100); assert(c.parameter().maxCutPerRound == 100); assert(c.parameter().failedPivotLimit == 10); assert(c.parameter().degeneratePivotLimit == 10); assert(c.parameter().pivotTol == 1e-07); assert(c.parameter().away == 1e-10); assert(c.parameter().timeLimit == 120); assert(c.parameter().singleCutTimeLimit == 15); assert(c.parameter().useTableauRow == true); assert(c.parameter().modularize == true); assert(c.parameter().strengthen == false); assert(c.parameter().perturb == false); assert(c.parameter().pivotSelection == CglLandP::bestPivot); a=b; assert(a.parameter().pivotLimit == 100); assert(a.parameter().maxCutPerRound == 100); assert(a.parameter().failedPivotLimit == 10); assert(a.parameter().degeneratePivotLimit == 10); assert(a.parameter().pivotTol == 1e-07); assert(a.parameter().away == 1e-10); assert(a.parameter().timeLimit == 120); assert(a.parameter().singleCutTimeLimit == 15); assert(a.parameter().useTableauRow == true); assert(a.parameter().modularize == true); assert(a.parameter().strengthen == false); assert(a.parameter().perturb == false); assert(a.parameter().pivotSelection == CglLandP::bestPivot); } } { // Maximize 2 x2 // s.t. // 2x1 + 2x2 <= 3 // -2x1 + 2x2 <= 1 // 7x1 + 4x2 <= 8 // -7x1 + 4x2 <= 1 // x1, x2 >= 0 and x1, x2 integer // Slacks are s1, s2, s3, s4 //Test that problem is correct // Optimal Basis is x1, x2, s3, s4 with tableau // x1 0.25 s1 -0.25 s2 = 0.5 // x2 0.25 s1 0.25 s2 = 1 // -2.75 s1 0.75 s2 s3 = 0.5 // 0.75 s1 -2.75 s2 s4 = 0.5 // z= -0.25 s1 -0.25 s2 = -1 // Gomory cut from variable x1 is x2 <= 0.5 // Can be improved by first pivoting s2 in and s4 out, then s1 in and s3 out // to x2 <= 0.25 { int start[2] = {0,4}; int length[2] = {4,4}; int rows[8] = {0,1,2,3,0,1,2,3}; double elements[8] = {2.0,-2.0,7.0,-7.0,2.0,2.0,4.0,4.0}; CoinPackedMatrix columnCopy(true,4,2,8,elements,rows,start,length); double rowLower[4]={-COIN_DBL_MAX,-COIN_DBL_MAX, -COIN_DBL_MAX,-COIN_DBL_MAX}; double rowUpper[4]={3.,1.,8.,1.}; double colLower[2]={0.0,0.0}; double colUpper[2]={1.0,1.0}; double obj[2]={-1,-1}; int intVar[2]={0,1}; OsiSolverInterface * siP = si->clone(); siP->loadProblem(columnCopy, colLower, colUpper, obj, rowLower, rowUpper); siP->setInteger(intVar,2); CglLandP test; test.setLogLevel(2); test.parameter().sepSpace = CglLandP::Full; siP->resolve(); // Test generateCuts method { OsiCuts cuts; test.generateCuts(*siP,cuts); cuts.printCuts(); assert(cuts.sizeRowCuts()==1); OsiRowCut aCut = cuts.rowCut(0); assert(eq(aCut.lb(), -.0714286)); CoinPackedVector row = aCut.row(); if (row.getNumElements() == 1) { assert(row.getIndices()[0]==1); assert(eq(row.getElements()[0], -4*.0714286)); } else if (row.getNumElements() == 2) { assert(row.getIndices()[0]==0); assert(eq(row.getElements()[0], 0.)); assert(row.getIndices()[1]==1); assert(eq(row.getElements()[1], -1)); } OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); } if (0) { OsiCuts cuts; test.generateCuts(*siP,cuts); cuts.printCuts(); assert(cuts.sizeRowCuts()==1); OsiRowCut aCut = cuts.rowCut(0); CoinPackedVector row = aCut.row(); if (row.getNumElements() == 1) { assert(row.getIndices()[0]==1); assert(eq(row.getElements()[0], -1)); } else if (row.getNumElements() == 2) { assert(row.getIndices()[0]==0); assert(eq(row.getElements()[0], 0.)); assert(row.getIndices()[1]==1); assert(eq(row.getElements()[1], -1)); } assert(eq(aCut.lb(), 0.)); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); } delete siP; } } if (1) //Test on p0033 { // Setup OsiSolverInterface * siP = si->clone(); std::string fn(mpsDir+"p0033"); siP->readMps(fn.c_str(),"mps"); siP->activateRowCutDebugger("p0033"); CglLandP test; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, 2520.5717391304347) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif OsiCuts cuts; // Test generateCuts method test.generateCuts(*siP,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); //assert( eq(lpRelaxAfter, 2592.1908295194507) ); std::cout<<"Relaxation after "< 2840. ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); delete siP; } if (1) //test again with modularization { // Setup OsiSolverInterface * siP = si->clone(); std::string fn(mpsDir+"p0033"); siP->readMps(fn.c_str(),"mps"); siP->activateRowCutDebugger("p0033"); CglLandP test; test.parameter().modularize = true; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, 2520.5717391304347) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif OsiCuts cuts; // Test generateCuts method test.generateCuts(*siP,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); //assert( eq(lpRelaxAfter, 2592.1908295194507) ); std::cout<<"Relaxation after "< 2840. ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); delete siP; } if (1) //test again with alternate pivoting rule { // Setup OsiSolverInterface * siP = si->clone(); std::string fn(mpsDir+"p0033"); siP->readMps(fn.c_str(),"mps"); siP->activateRowCutDebugger("p0033"); CglLandP test; test.parameter().pivotSelection = CglLandP::bestPivot; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, 2520.5717391304347) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif OsiCuts cuts; // Test generateCuts method test.generateCuts(*siP,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); //assert( eq(lpRelaxAfter, 2592.1908295194507) ); std::cout<<"Relaxation after "< 2840. ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); delete siP; } if (1) //Finally test code in documentation { // Setup OsiSolverInterface * siP = si->clone(); std::string fn(mpsDir+"p0033"); siP->readMps(fn.c_str(),"mps"); siP->activateRowCutDebugger("p0033"); CglLandP landpGen; landpGen.parameter().timeLimit = 10.; landpGen.parameter().pivotLimit = 2; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, 2520.5717391304347) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif OsiCuts cuts; // Test generateCuts method landpGen.generateCuts(*siP, cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); //assert( eq(lpRelaxAfter, 2592.1908295194507) ); std::cout<<"Relaxation after "< 2840. ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); delete siP; } } Cgl-0.58.9/src/CglLandP/CglLandPTabRow.hpp0000644000076600007660000000350612130104734016466 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // LIF // CNRS, Aix-Marseille Universites // Date: 02/23/08 // // $Id: CglLandPTabRow.hpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #ifndef CglLandPTabRow_H #define CglLandPTabRow_H #include "CoinIndexedVector.hpp" #include namespace LAP { class CglLandPSimplex; struct TabRow: public CoinIndexedVector { /** Row number.*/ int num; /** Row right-hand-side.*/ double rhs; /** Row of what?*/ const CglLandPSimplex * si_; /** Flag to say if row is modularized.*/ bool modularized_; TabRow(): CoinIndexedVector(), si_(NULL), modularized_(false) {} TabRow(const CglLandPSimplex *si): CoinIndexedVector(), num(-1), rhs(0), si_(si), modularized_(false) {} TabRow(const TabRow & source):CoinIndexedVector(source), num(source.num), rhs(source.rhs), si_(source.si_) { } TabRow& operator=(const TabRow & r) { if (this != &r) { CoinIndexedVector::operator=(r); num = r.num; rhs = r.rhs; si_ = r.si_; } return *this; } bool operator==(const TabRow &r) const; ~TabRow() { } void modularize(const bool * integerVar); void print(std::ostream & os, int width = 9, const int * nonBasics = NULL, int m = 0); inline const double& operator[](const int &index) const { return denseVector()[index]; } inline double& operator[](const int &index) { return denseVector()[index]; } }; }/* Ends LAP Namespace.*/ #endif Cgl-0.58.9/src/CglLandP/CglLandPValidator.hpp0000644000076600007660000000754112130104734017220 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 11/22/05 // // $Id: CglLandPValidator.hpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #ifndef CglLandPValidator_H #define CglLandPValidator_H #include "OsiSolverInterface.hpp" #include "CglParam.hpp" #include /** constants describing rejection codes*/ //[5] = {"Accepted", "violation too small", "small coefficient too small", "big dynamic","too dense"} namespace LAP { /** Class to validate or reject a cut */ class Validator { public: /** Reasons for rejecting a cut */ enum RejectionsReasons { NoneAccepted=0 /**Cut was accepted*/, SmallViolation /** Violation of the cut is too small */, SmallCoefficient /** There is a small coefficient we can not get rid off.*/, BigDynamic /** Dynamic of coefficinet is too important. */, DenseCut/**cut is too dense */, EmptyCut/**After cleaning cut has become empty*/, DummyEnd/** dummy*/ }; /** Constructor with default values */ Validator(double maxFillIn = 1., double maxRatio = 1e8, double minViolation = 0, bool scale = false, double rhsScale = 1); /** Clean an OsiCut */ int cleanCut(OsiRowCut & aCut, const double * solCut,const OsiSolverInterface &si, const CglParam & par, const double * colLower, const double * colUpper); /** Clean an OsiCut by another method */ int cleanCut2(OsiRowCut & aCut, const double * solCut, const OsiSolverInterface &si, const CglParam & par, const double * colLower, const double * colUpper); /** Call the cut cleaner */ int operator()(OsiRowCut & aCut, const double * solCut,const OsiSolverInterface &si, const CglParam & par, const double * colLower, const double * colUpper) { return cleanCut(aCut, solCut, si, par, colLower, colUpper); } /** @name set functions */ /** @{ */ void setMaxFillIn(double value) { maxFillIn_ = value; } void setMaxRatio(double value) { maxRatio_ = value; } void setMinViolation(double value) { minViolation_ = value; } void setRhsScale(double v) { rhsScale_ = v; } /** @} */ /** @name get functions */ /** @{ */ double getMaxFillIn() { return maxFillIn_; } double getMaxRatio() { return maxRatio_; } double getMinViolation() { return minViolation_; } /** @} */ const std::string& failureString(RejectionsReasons code) const { return rejections_[static_cast (code)]; } const std::string& failureString(int code) const { return rejections_[ code]; } int numRejected(RejectionsReasons code)const { return numRejected_[static_cast (code)]; } int numRejected(int code)const { return numRejected_[ code]; } private: static void fillRejectionReasons(); /** max percentage of given formulation fillIn should be accepted for cut fillin.*/ double maxFillIn_; /** max ratio between smallest and biggest coefficient */ double maxRatio_; /** minimum violation for accepting a cut */ double minViolation_; /** Do we do scaling? */ bool scale_; /** Scale of right-hand-side.*/ double rhsScale_; /** Strings explaining reason for rejections */ static std::vector rejections_; /** Number of cut rejected for each of the reasons.*/ std::vector numRejected_; }; }/* Ends namespace LAP.*/ #endif Cgl-0.58.9/src/CglLandP/CglLandPSimplex.cpp0000644000076600007660000031743412233745655016735 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 21/07/05 // // $Id: CglLandPSimplex.cpp 1152 2013-10-29 14:52:29Z forrest $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #include "CglLandPSimplex.hpp" #include "CoinTime.hpp" #ifdef COIN_HAS_OSICLP #include "OsiClpSolverInterface.hpp" #endif #include "CoinIndexedVector.hpp" #include #include #include #include #define REMOVE_LOG 0 #define RED_COST_CHECK 1e-6 //#define OUT_CGLP_PIVOTS #ifdef OUT_CGLP_PIVOTS #include "CglLandPOutput.hpp" #endif #ifdef DEBUG_LAP /* The function is not used anywhere (LL) static void MyAssertFunc(bool c, const std::string &s, const std::string& file, unsigned int line){ if (c != true){ fprintf(stderr, "Failed MyAssertion: %s in %s line %i.\n", s.c_str(), file.c_str(), line); throw -1; } } */ static void DblGtAssertFunc(const double& a, const std::string &a_s, const double&b, const std::string& b_s, const std::string& file, unsigned int line) { if (a //#define TEST_M3 namespace LAP { void CglLandPSimplex::printTableau(std::ostream & os) { int width = 9; os<<"Tableau at current basis"<getBasics(basic2); for (int i = 0; i < nrows_ ; i++) assert(basics_[i]==basic2[i]); delete [] basic2; return true; } CglLandPSimplex::CglLandPSimplex(const OsiSolverInterface &si, const CglLandP::CachedData &cached, const CglLandP::Parameters ¶ms, Validator& validator): #ifdef COIN_HAS_OSICLP clp_(NULL), #endif row_k_(this), original_row_k_(this), row_i_(this), new_row_(this), gammas_(false), rowFlags_(NULL), col_in_subspace(), colCandidateToLeave_(NULL), basics_(NULL), nonBasics_(NULL), M1_(), M2_(), M3_(), sigma_(0), basis_(NULL), colsolToCut_(NULL), colsol_(NULL), ncols_orig_(0),nrows_orig_(0), inDegenerateSequence_(false), chosenReducedCostVal_(1e100), original_index_(), si_(NULL), validator_(validator), numPivots_(0), numSourceRowEntered_(0), numIncreased_(0) { ncols_orig_ = si.getNumCols(); nrows_orig_ = si.getNumRows(); handler_ = new CoinMessageHandler(); handler_->setLogLevel(2); messages_ = LandPMessages(); si_ = const_cast(&si); #ifdef COIN_HAS_OSICLP OsiClpSolverInterface * clpSi = dynamic_cast(si_); if (clpSi) { clp_ = clpSi; } #endif int rowsize = ncols_orig_ + nrows_orig_ + 1; row_k_.reserve(rowsize); #ifndef NDEBUG new_row_.reserve(rowsize); #endif lo_bounds_.resize(ncols_orig_ + nrows_orig_); up_bounds_.resize(ncols_orig_ + nrows_orig_); CoinCopyN(si.getColLower(),ncols_orig_, &lo_bounds_[0]); CoinCopyN(si.getColUpper(),ncols_orig_,&up_bounds_[0]); const double * rowUpper = si.getRowUpper(); const double * rowLower = si.getRowLower(); double infty = si.getInfinity(); int i=ncols_orig_; for (int iRow = 0; iRow < nrows_orig_ ; iRow++, i++) { if (rowUpper[iRow] < infty) lo_bounds_[i]=0.; else lo_bounds_[i]= - infty; if (rowLower[iRow] <= - infty) up_bounds_[i] = infty; else if (rowUpper[iRow] < infty) { lo_bounds_[i] = rowLower[iRow] - rowUpper[iRow]; up_bounds_[i] = 0; } else up_bounds_[i] = 0.; } cuts_.resize(ncols_orig_); if (params.pivotLimit != 0) { own_ = true; rWk1_.resize(nrows_orig_); rWk2_.resize(nrows_orig_); rWk3_.resize(nrows_orig_); rWk4_.resize(nrows_orig_); rIntWork_.resize(nrows_orig_); row_i_.reserve(rowsize); rowFlags_ = new bool[nrows_orig_]; col_in_subspace.resize(ncols_orig_ + nrows_orig_); colCandidateToLeave_ = new bool[ncols_orig_]; basics_ = new int[nrows_orig_]; nonBasics_ = new int[ncols_orig_]; colsolToCut_ = new double[ncols_orig_ + nrows_orig_]; colsol_ = new double[ncols_orig_ + nrows_orig_]; original_index_.resize(ncols_orig_ + nrows_orig_); CoinIotaN(&original_index_[0],ncols_orig_ + nrows_orig_, 0); } else { nrows_ = nrows_orig_; ncols_ = ncols_orig_; original_index_.resize(ncols_orig_ + nrows_orig_); CoinIotaN(&original_index_[0],ncols_orig_ + nrows_orig_, 0); own_ = false; si_->enableSimplexInterface(0); basis_ = new CoinWarmStartBasis(*cached.basis_); } cacheUpdate(cached,params.sepSpace != CglLandP::Full); if (params.normalization) { computeWeights(params.lhs_norm, params.normalization, params.rhsWeightType); } else rhs_weight_ = 1; } CglLandPSimplex::~CglLandPSimplex() { delete handler_; handler_ = NULL; delete basis_; basis_ = NULL; if (own_) { delete [] rowFlags_; rowFlags_ = NULL; delete [] colCandidateToLeave_; colCandidateToLeave_ = NULL; delete [] basics_; basics_ = NULL; delete [] nonBasics_; nonBasics_ = NULL; delete [] colsolToCut_; colsolToCut_ = NULL; delete [] colsol_; colsol_ = NULL; } else { si_->disableSimplexInterface(); } } /** Compute normalization weights.*/ void CglLandPSimplex::computeWeights(CglLandP::LHSnorm norm, CglLandP::Normalization type, CglLandP::RhsWeightType rhs) { norm_weights_.clear(); norm_weights_.resize(ncols_orig_ ,1.); norm_weights_.resize(ncols_orig_ + nrows_orig_, 0.); double * rows_weights = &norm_weights_[ncols_orig_]; std::vector nnz(nrows_orig_,0); const CoinPackedMatrix * m = si_->getMatrixByCol(); const double * val = m->getElements(); const int * ind = m->getIndices(); const int * length = m->getVectorLengths(); const CoinBigIndex * start = m->getVectorStarts(); rhs_weight_ = 1; if (type== CglLandP::WeightRHS) { if (rhs == CglLandP::Fixed) rhs_weight_ = (ncols_orig_ + 1);//params.rhsWeight; else if (rhs == CglLandP::Dynamic) { throw -1; } } if (norm == CglLandP::Infinity) { for (int i = 0 ; i < ncols_orig_ ; i++) { CoinBigIndex begin = start[i]; CoinBigIndex end = begin + length[i]; for (CoinBigIndex k = begin ; k < end ; k++) { rows_weights[ind[k]] = CoinMax(fabs(val[k]), rows_weights[ind[k]]); rhs_weight_ += fabs(val[k]); nnz[ind[k]] ++; } } } else if (norm == CglLandP::L1 || norm == CglLandP::Average) { for (int i = 0 ; i < ncols_orig_ ; i++) { CoinBigIndex begin = start[i]; CoinBigIndex end = begin + length[i]; for (CoinBigIndex k = begin ; k < end ; k++) { rows_weights[ind[k]] += fabs(val[k]); nnz[ind[k]] ++; } } if (norm == CglLandP::Average) { for (int i = 0 ; i < nrows_orig_ ; i++) { rows_weights[i] = static_cast(nnz[i]); } } if (type== CglLandP::WeightBoth) { rhs_weight_ += (ncols_orig_ + 1); std::cout<<"rhs_weight : "< (nnz[i]); } if (type== CglLandP::WeightBoth) { rhs_weight_ = (ncols_orig_ + 1); } } else if (norm ==CglLandP::Uniform) { for (int i = 0 ; i < nrows_orig_ ; i++) { rows_weights[i] = static_cast (1); } if (type== CglLandP::WeightBoth) { rhs_weight_ = (ncols_orig_ + 1); } } } void CglLandPSimplex::cacheUpdate(const CglLandP::CachedData &cached, bool reducedSpace) { integers_ = cached.integers_; if (own_) { CoinCopyN(cached.basics_, nrows_orig_, basics_); CoinCopyN(cached.nonBasics_, ncols_orig_, nonBasics_); CoinCopyN(cached.colsol_, nrows_orig_ + ncols_orig_, colsol_); for (int i = 0 ; i < ncols_orig_ ; i++) { colsol_[nonBasics_[i]] = 0; } CoinCopyN(cached.colsol_, nrows_orig_ + ncols_orig_, colsolToCut_); //Zero all non basics in colsol setup the reduced space col_in_subspace.resize(0); col_in_subspace.resize(ncols_orig_+nrows_orig_,true); for (int i = 0 ; i < ncols_orig_ ; i++) { setColsolToCut(nonBasics_[i],0.); colsol_[nonBasics_[i]] = 0; } /** Mark the variables at zero in solution to cut so that we know that their contribution to reduced cost has to be computed*/ int n_removed =0; if (reducedSpace) { for (int ii = 0; ii < ncols_orig_ ; ii++) { if (getColsolToCut(ii) - up_bounds_[ii] > 1e-08 || getColsolToCut(ii) - lo_bounds_[ii] < 1e-08) { col_in_subspace[ii]=false; n_removed++; } } } } else { basics_ = cached.basics_; nonBasics_ = cached.nonBasics_; } } bool CglLandPSimplex::resetSolver(const CoinWarmStartBasis * /*basis*/) { si_->disableSimplexInterface(); return 0; } int CglLandPSimplex::generateExtraCuts(const CglLandP::CachedData & cached, const CglLandP::Parameters& params) { int ret_val = 0; for (int i = 0 ; i < nrows_ && cuts_.numberCuts() < params.extraCutsLimit; i++) { if (basics_[i] < ncols_) ret_val += generateExtraCut(i, cached, params); } return ret_val; } int CglLandPSimplex::generateExtraCut(int i, const CglLandP::CachedData & cached, const CglLandP::Parameters& params) { const int & iCol = basics_[i]; if (!isInteger(iCol) || int_val(colsol_[iCol], params.away) || !int_val(getColsolToCut(iCol), params.away) || colsol_[iCol] < getLoBound(iCol) || colsol_[iCol] > getUpBound(iCol) || (cuts_.rowCut(iCol) != NULL) ) { return false; } #ifdef DBG_OUT printf("var: %i, basic in row %i. integer=%i, colsol_=%f, colsolToCut_=%f.\n",iCol, i, isInteger(iCol), colsol_[iCol], getColsolToCut(iCol)); printf("generating extra cut....\n"); #endif OsiRowCut * cut = new OsiRowCut; generateMig(i, *cut, params); assert(fabs(row_k_.rhs - colsol_[iCol]) < 1e-10); int code = validator_(*cut, cached.colsol_, *si_, params, &lo_bounds_[0], &up_bounds_[0]); if (code) { delete cut; return false; } else { cuts_.insert(iCol, cut); return true; } } void CglLandPSimplex::genThisBasisMigs(const CglLandP::CachedData &cached, const CglLandP::Parameters & params) { for (int i = 0 ; i < cached.nBasics_ ; i++) { const int iCol = basics_[i]; if (iCol >= ncols_ || !cached.integers_[iCol] || int_val(colsol_[iCol], params.away)) continue; OsiRowCut * cut = new OsiRowCut; generateMig(i, *cut, params); int code = validator_(*cut, cached.colsol_, *si_, params, &lo_bounds_[0], &up_bounds_[0]); if (code) { delete cut; continue; } cut->setEffectiveness(cut->violated(cached.colsol_)); if (cuts_.rowCut(iCol) == NULL || cut->effectiveness() > cuts_.rowCut(iCol)->effectiveness()) { cuts_.insert(iCol,cut); } else delete cut; } } bool CglLandPSimplex::generateMig(int row, OsiRowCut & cut, const CglLandP::Parameters & params) { row_k_.num = row; pullTableauRow(row_k_); row_k_.rhs = row_k_.rhs - floor(row_k_.rhs); if (params.strengthen || params.modularize) createMIG(row_k_, cut); else createIntersectionCut(row_k_, cut); return 1;//At this point nothing failed, always generate a cut } bool CglLandPSimplex::optimize (int row, OsiRowCut & cut,const CglLandP::CachedData &cached,const CglLandP::Parameters & params) { bool optimal = false; int nRowFailed = 0; double timeLimit = CoinMin(params.timeLimit, params.singleCutTimeLimit); timeLimit += CoinCpuTime(); // double timeBegin = CoinCpuTime(); /** Copy the cached information */ nrows_ = nrows_orig_; ncols_ = ncols_orig_; CoinCopyN(cached.basics_, nrows_, basics_); CoinCopyN(cached.nonBasics_, ncols_, nonBasics_); CoinCopyN(cached.colsol_, nrows_+ ncols_, colsol_); CoinCopyN(cached.colsol_, nrows_+ ncols_, colsolToCut_); delete basis_; basis_ = new CoinWarmStartBasis(*cached.basis_); #define CACHED_SOLVER #ifndef CACHED_SOLVER si_->enableSimplexInterface(0); #else delete si_; si_ = cached.solver_->clone(); #ifdef COIN_HAS_OSICLP OsiClpSolverInterface * clpSi = dynamic_cast(si_); OsiClpSolverInterface * clpSiRhs = dynamic_cast(cached.solver_); if (clpSi) { clp_ = clpSi; clpSi->getModelPtr()->copyEnabledStuff(clpSiRhs->getModelPtr());; } #endif #endif #ifdef APPEND_ROW if (params.modularize) { append_row(row, params.modularize); row_k_.modularize(integers_); } #endif for (int i = 0 ; i < ncols_; i++) { setColsolToCut(nonBasics_[i], 0.); colsol_[nonBasics_[i]] = 0; } #ifdef APPEND_ROW if (params.modularize) row_k_.num = nrows_ - 1; else #endif row_k_.num = row; pullTableauRow(row_k_); row_k_.rhs = row_k_.rhs - floor(row_k_.rhs); if (params.modularize) row_k_.modularize(integers_); updateM1_M2_M3(row_k_, 0., params.perturb); sigma_ = computeCglpObjective(row_k_); handler_->message(Separating,messages_)<message(LogHead, messages_)<= 0) { if (params.pivotSelection == CglLandP::mostNegativeRc || (params.pivotSelection == CglLandP::initialReducedCosts && numPivots == 0)) { if (params.pivotSelection == CglLandP::initialReducedCosts) rowFlags_[leaving] = false; incoming = fastFindBestPivotColumn(direction, gammaSign, params.pivotTol, params.away, (params.sepSpace==CglLandP::Fractional), allowDegeneratePivot, bestSigma, false//params.modularize ); while (incoming < 0 && !optimal && nRowFailed < maxTryRow) // if no improving was found rescan the tables of reduced cost to find a good one { if (incoming == -1 || params.countMistakenRc) nRowFailed ++; rowFlags_[leaving] = false; hasFlagedRow = true; leaving = rescanReducedCosts(direction, gammaSign, params.pivotTol); if (leaving >= 0) { incoming = fastFindBestPivotColumn(direction, gammaSign, params.pivotTol, params.away, (params.sepSpace==CglLandP::Fractional), allowDegeneratePivot, bestSigma, false//params.modularize ); } else optimal = true; } } else if (params.pivotSelection == CglLandP::bestPivot) { incoming = findBestPivot(leaving, direction, params); } } } else if (params.pivotSelection == CglLandP::initialReducedCosts) { assert(numPivots > 0); while (incoming < 0 && !optimal) // if no improving was found rescan the tables of reduced cost to find a good one { if (!hasFlagedRow) hasFlagedRow = true; leaving = rescanReducedCosts(direction, gammaSign, params.pivotTol); rowFlags_[leaving] = false; if (leaving >= 0) { incoming = fastFindBestPivotColumn(direction, gammaSign, params.pivotTol, params.away, (params.sepSpace==CglLandP::Fractional), allowDegeneratePivot, bestSigma, false//params.modularize ); } else optimal = true; } } if (leaving >= 0) { if ( incoming >= 0 && !optimal) { if (inDegenerateSequence_) //flag leaving row { numberConsecutiveDegenerate++; allowDegeneratePivot = numberConsecutiveDegenerate < params.degeneratePivotLimit; rowFlags_[leaving] = false; } else { beObstinate = 0; numberConsecutiveDegenerate = 0; allowDegeneratePivot = numberConsecutiveDegenerate < params.degeneratePivotLimit; } double gamma = - row_k_[nonBasics_[incoming]] / row_i_[nonBasics_[incoming]]; #ifdef COIN_HAS_OSICLP if (numPivots && ( numPivots % 40 == 0 ) && clp_) { clp_->getModelPtr()->factorize(); } #endif #ifndef OLD_COMPUTATION bool recompute_source_row = (numPivots && (numPivots % 10 == 0 || fabs(gamma) < 1e-05)); #endif std::pair cur_pivot(nonBasics_[incoming],basics_[leaving]); bool pivoted = changeBasis(incoming,leaving,direction, #ifndef OLD_COMPUTATION recompute_source_row, #endif false);//params.modularize); if (leaving == row) { numSourceRowEntered_++; } if (params.generateExtraCuts == CglLandP::WhenEnteringBasis && basics_[leaving] < ncols_ && cuts_.numberCuts() < params.extraCutsLimit) generateExtraCut(leaving, cached, params); if (pivoted) { numPivots++; double lastSigma = sigma_; if (params.modularize) { row_k_.modularize(integers_); } sigma_ = computeCglpObjective(row_k_); if (sigma_ - lastSigma > -1e-4*(lastSigma)) { if(sigma_ > 0) return 0; #if 0 if (sigma_ > 0 || sigma_ - lastSigma > 1e1*(-lastSigma)) return 0; #endif } handler_->message(PivotLog,messages_)<1e-8) { handler_->message(PivotFailedSigmaIncreased,messages_)<message(PivotFailedSigmaUnchanged,messages_)< params.failedPivotLimit) break; } } else //attained max number of leaving vars tries with no improvement { handler_->message(WarnGiveUpRow,messages_)<message(FinishedOptimal, messages_)<= params.pivotLimit) { std::string limit="pivots"; handler_->message(HitLimit, messages_)<= params.failedPivotLimit) { std::string limit="failed pivots"; handler_->message(HitLimit, messages_)<message(CutStat, messages_)<getInfinity(); int clpLeavingStatus = leavingStatus; #ifdef COIN_HAS_OSICLP if (clp_) { if (basics_[leaving] >= ncols_) clpLeavingStatus = - leavingStatus; } #endif int code = 0; code = si_->pivot(nonBasics_[incoming],basics_[leaving], clpLeavingStatus); if (code) { #ifdef OLD_COMPUTATION if (!modularize) { pullTableauRow(row_k_); row_k_.rhs = row_k_.rhs - floor(row_k_.rhs); } else{ int & indexLeaving = basics_[leaving]; if (leavingStatus==1) { setColsolToCut(indexLeaving, getUpBound(indexLeaving) - getColsolToCut(indexLeaving)); } else { setColsolToCut(indexLeaving, getColsolToCut(indexLeaving) + getLoBound(indexLeaving)); } } #endif return 0; } numPivots_ ++; //swap bounds int & indexLeaving = basics_[leaving]; #ifdef OLD_COMPUTATION if (!modularize) { if (leavingStatus==1) { setColsolToCut(indexLeaving, getUpBound(indexLeaving) - getColsolToCut(indexLeaving)); } else { setColsolToCut(indexLeaving, getColsolToCut(indexLeaving) - getLoBound(indexLeaving)); } } #endif if (indexLeaving < ncols_) { basis_->setStructStatus(indexLeaving, leavingStatus==1 ? CoinWarmStartBasis::atUpperBound : CoinWarmStartBasis::atLowerBound); } else { int iRow = basics_[leaving] - ncols_; basis_->setArtifStatus(iRow, leavingStatus==1 ? CoinWarmStartBasis::atUpperBound : CoinWarmStartBasis::atLowerBound); // assert(leavingStatus==-1 || (rowLower_[iRow]>-1e50 && rowUpper_[iRow] < 1e50)); } if (nonBasics_[incoming] < ncols_) { int & indexIncoming = nonBasics_[incoming]; CoinWarmStartBasis::Status status = basis_->getStructStatus(indexIncoming); if (status==CoinWarmStartBasis::atUpperBound) setColsolToCut(indexIncoming, getUpBound(indexIncoming) - getColsolToCut(indexIncoming)); else setColsolToCut(indexIncoming, getColsolToCut(indexIncoming) + getLoBound(indexIncoming)); basis_->setStructStatus(indexIncoming, CoinWarmStartBasis::basic); } else { int iRow = nonBasics_[incoming] - ncols_; int & indexIncoming = nonBasics_[incoming]; if (basis_->getArtifStatus(iRow)==CoinWarmStartBasis::atUpperBound) setColsolToCut(indexIncoming, getUpBound(indexIncoming) - getColsolToCut(indexIncoming)); else setColsolToCut(indexIncoming, getColsolToCut(indexIncoming) + getLoBound(indexIncoming)); basis_->setArtifStatus(iRow, CoinWarmStartBasis::basic); } int swap = basics_[leaving]; basics_[leaving] = nonBasics_[incoming]; nonBasics_[incoming] = swap; //update solution of leaving variable colsol_[nonBasics_[incoming]] = 0; //update solution for basics const double * lpSol = si_->getColSolution(); const double * rowAct = si_->getRowActivity(); const double * rowLower = si_->getRowLower(); const double * rowUpper = si_->getRowUpper(); for (int i = 0 ; i < nrows_ ; i++) { int& iCol = basics_[i]; if (iCol -infty) { colsol_[iCol] += rowLower[iRow]; } else { colsol_[iCol] += rowUpper[iRow]; } } } // basics_ may unfortunately change reload int k = basics_[row_k_.num]; si_->getBasics(basics_); if (basics_[row_k_.num] != k) { for (int ii = 0 ; ii < nrows_ ; ii++) { if (basics_[ii]==k) { row_k_.num= ii; break; } } } #ifndef OLD_COMPUTATION if (!modularize && recompute_source_row) { #else if (!modularize) { #endif pullTableauRow(row_k_); row_k_.rhs = row_k_.rhs - floor(row_k_.rhs); } #if 0 } #endif else //Update row k by hand { double gamma = - row_k_[basics_[leaving]] / row_i_[basics_[leaving]]; row_k_[basics_[leaving]] = 0; row_k_.quickAdd(nonBasics_[incoming], gamma); if(1 || fabs(gamma) > 1e-9){ int nnz = row_i_.getNumElements(); const int * indices = row_i_.getIndices(); for (int i = 0 ; i < nnz; i++) { if(row_k_.getNumElements() > row_k_.capacity() - 2) row_k_.scan(); if (indices[i] != nonBasics_[incoming] && indices[i] != basics_[leaving]) row_k_.quickAdd(indices[i], gamma * row_i_[indices[i]]); } row_k_.rhs += gamma * row_i_.rhs; } row_k_.scan(); row_k_.clean(1e-10); checkVec(row_k_); #if 0 TabRow test_row(this); int rowsize = ncols_orig_ + nrows_orig_ + 1; test_row.reserve(rowsize); test_row.num = row_k_.num; pullTableauRow(test_row); test_row.rhs = test_row.rhs - floor(test_row.rhs); VecModEqAssert(row_k_, test_row); #endif } return true; } /** Find a row which can be used to perform an improving pivot return index of the cut or -1 if none exists * (i.e., find the leaving variable).*/ int CglLandPSimplex::findCutImprovingPivotRow( int &direction, int &gammaSign, double tolerance) { bool bestRed = 0; tolerance = -10*tolerance; int bestRow = -1; int bestDirection = 0; int bestGamma = 0; double infty = si_->getInfinity(); for (row_i_.num = 0 ; row_i_.num < nrows_; row_i_.num++) { //if ( (row_k_.modularized_ || row_i_.num != row_k_.num)//obviously not necessary to combine row k with itself (unless modularized) if ( (row_i_.num != row_k_.num)//obviously not necessary to combine row k with itself (unless modularized) && rowFlags_[row_i_.num] //row has not been flaged // && fabs(getUpBound(basics_[row_i_.num]) - getLoBound(basics_[row_i_.num]))>1e-09 //variable is not fixed ) { pullTableauRow(row_i_); double tau = computeRedCostConstantsInRow(); if (getLoBound(basics_[row_i_.num]) > -infty) // variable can leave at its lower bound //Compute reduced cost with basics_[i] value decreasing { direction = -1; gammaSign = -1; double redCost = computeCglpRedCost(direction, gammaSign, tau); if (redCost=0 && row_i_.num != bestRow) { row_i_.num=bestRow; pullTableauRow(row_i_); } assert (bestRow<0||direction!=0); return bestRow; } /** Find a row which can be used to perform an improving pivot the fast way * (i.e., find the leaving variable). \return index of the cut or -1 if none exists. */ int CglLandPSimplex::fastFindCutImprovingPivotRow( int &direction, int &gammaSign, double tolerance, bool flagPositiveRows) { bool modularize = false; double sigma = sigma_ /rhs_weight_; //Fill vector to compute contribution to reduced cost of variables in M1 and M2 (nz non-basic vars in row_k_.row). // 1. Put the values // 2. Post multiply by basis inverse double * rWk1bis_ =NULL; CoinFillN(&rWk1_[0],nrows_,static_cast (0)); if (modularize) CoinFillN(rWk1bis_, nrows_, static_cast (0)); int capacity = 0; const CoinPackedMatrix* mat = si_->getMatrixByCol(); const CoinBigIndex* starts = mat->getVectorStarts(); const CoinBigIndex * lengths = mat->getVectorLengths(); const int * indices = mat->getIndices(); const double * elements = mat->getElements(); for (unsigned int i = 0 ; i < M1_.size() ; i++) { const int& ii = M1_[i]; if (ii < ncols_) { const CoinBigIndex& begin = starts[ii]; const CoinBigIndex end = begin + lengths[ii]; bool swap = false; if (basis_->getStructStatus(ii)==CoinWarmStartBasis::atUpperBound) swap = true; for (CoinBigIndex k = begin ; k < end ; k++) { if (swap) { rWk1_[indices[k]] += normedCoef(elements[k] * sigma, ii); if (modularize) { rWk1bis_[indices[k]] += elements[k] * (getColsolToCut(ii) - normedCoef(sigma, ii)); } } else { rWk1_[indices[k]] -= normedCoef(elements[k] * sigma, ii); if (modularize) { rWk1bis_[indices[k]] -= elements[k] * (getColsolToCut(ii) - normedCoef(sigma, ii)); } } } } else { bool swap = false; if (basis_->getArtifStatus(ii - ncols_orig_)==CoinWarmStartBasis::atUpperBound) swap = true; if (swap) { rWk1_[ii - ncols_] += normedCoef(sigma, ii); if (modularize) { rWk1bis_[ii - ncols_] += (getColsolToCut(ii) - normedCoef(sigma, ii)); } } else { rWk1_[ii - ncols_] -= normedCoef(sigma, ii); if (modularize) { rWk1bis_[ii - ncols_] -= (getColsolToCut(ii) - normedCoef(sigma, ii)); } } } } for (unsigned int i = 0 ; i < M2_.size(); i++) { const int& ii = M2_[i]; if (iigetStructStatus(ii)==CoinWarmStartBasis::atUpperBound) swap = true; for (CoinBigIndex k = begin ; k < end ; k++) { if (swap) { rWk1_[indices[k]] += elements[k] * (getColsolToCut(ii) - normedCoef(sigma, ii)); if (modularize) rWk1bis_[indices[k]] += elements[k] * normedCoef(sigma, ii); } else { rWk1_[indices[k]] -= elements[k] * (getColsolToCut(ii) - normedCoef(sigma, ii)); if (modularize) rWk1bis_[indices[k]] -= elements[k] * normedCoef(sigma, ii); } } } else { bool swap = false; if (basis_->getArtifStatus(M2_[i] - ncols_orig_)==CoinWarmStartBasis::atUpperBound) swap = true; if (swap) { rWk1_[ii - ncols_] += (getColsolToCut(ii) - normedCoef(sigma, ii)); if (modularize) rWk1bis_[ii - ncols_] += normedCoef(sigma, ii); } else { rWk1_[ii - ncols_] -= (getColsolToCut(ii) - normedCoef(sigma, ii)); if (modularize) rWk1bis_[ii - ncols_] -= normedCoef(sigma, ii); } } } for (int i = 0 ; i < nrows_ ; i++) { if (rWk1_[i]) rIntWork_[capacity++] = i; } CoinIndexedVector indexed; indexed.borrowVector(nrows_, capacity, &rIntWork_[0], &rWk1_[0]); #ifdef COIN_HAS_OSICLP if (clp_) clp_->getBInvACol(&indexed); else #endif throw CoinError("Function not implemented in this OsiSolverInterface", "getBInvACol","CglLandpSimplex"); indexed.returnVector(); if (modularize) { capacity = 0; for (int i = 0 ; i < nrows_ ; i++) { if (rWk1bis_[i]) rIntWork_[capacity++] = i; } indexed.borrowVector(nrows_, capacity, &rIntWork_[0], rWk1bis_); #ifdef COIN_HAS_OSICLP if (clp_) clp_->getBInvACol(&indexed); else #endif indexed.returnVector(); } //Now compute the contribution of the variables in M3_ //Need to get the column of the tableau in rW3_ for each of these and //add up with correctly in storage for multiplier for negative gamma (named rW3_) and //for positive gamma (which is named rW4_) if (!M3_.empty()) { CoinFillN(&rWk3_[0],nrows_,0.); CoinFillN(&rWk4_[0],nrows_,0.); if (modularize) { double * rWk3bis_ = NULL; double * rWk4bis_ = NULL; CoinFillN(rWk3bis_,nrows_,0.); CoinFillN(rWk4bis_,nrows_,0.); } } for (unsigned int i = 0 ; i < M3_.size() ; i++) { const int & ii = M3_[i]; si_->getBInvACol(ii, &rWk2_[0]); bool swap = false; if (ii < ncols_orig_ && basis_->getStructStatus(ii)==CoinWarmStartBasis::atUpperBound) swap = true; if (ii >= ncols_orig_ && basis_->getArtifStatus(ii - ncols_orig_)==CoinWarmStartBasis::atUpperBound) swap = true; for (int j = 0 ; j < nrows_ ; j++) { if (swap) rWk2_[j] = - rWk2_[j]; if (rWk2_[j] > 0.) { //is in M1 for multiplier with negative gamma rWk3_[j] -= normedCoef(sigma*rWk2_[j], ii); //is in M2 for multiplier with positive gamma rWk4_[j] -= (getColsolToCut(ii) - normedCoef(sigma, ii))*rWk2_[j]; } else if (rWk2_[j] < 0.) { //is in M2 for multiplier with negative gamma rWk3_[j] -=(getColsolToCut(ii) - normedCoef(sigma, ii))*rWk2_[j]; //is in M1 for multiplier with positive gamma rWk4_[j] -= normedCoef(sigma, ii)*rWk2_[j]; } } } //Now, we just need to add up everything correctly for each of the reduced //cost. Compute the Tau in rWk2_ which is not used anymore then compute the reduced cost in rWk1_ for u^l_j // rwk2_ in u^u_j rWk3_ for v^u_j rWk4_ for v^u_j // Let's rename not to get too much confused double * ul_i = &rWk1_[0]; double * uu_i = &rWk2_[0]; double * vl_i = &rWk3_[0]; double * vu_i = &rWk4_[0]; int bestRow = -1; int bestDirection = 0; int bestGammaSign = 0; // double infty = si_->getInfinity(); nNegativeRcRows_ = 0;//counter int nZeroRc = 0; int nPositiveRc = 0; double fzero = getColsolToCut(basics_[row_k_.num]) - floor(getColsolToCut(basics_[row_k_.num])); // fzero = row_k_.rhs; //for (int i = 0 ; i < ncols_orig_ ; i++) { // fzero -= getColsolToCut(nonBasics_[i]) * row_k_[nonBasics_[i]]; //} double bestReducedCost = -tolerance; for (int i = 0 ; i < nrows_ ; i++) { //if ((!row_k_.modularized_ && i == row_k_.num)//obviously not necessary to combine row k with itself if ((i == row_k_.num)//obviously not necessary to combine row k with itself // && fabs(getUpBound(basics_[row_i_.num]) - getLoBound(basics_[row_i_.num]))>1e-09 //variable is not fixed || col_in_subspace[basics_[i]] == false ) { ul_i[i]=uu_i[i]=vl_i[i]=vu_i[i]=10.; rowFlags_[i] = false; continue; } double tau1 = rWk1_[i]; double tau2 = rWk1_[i]; double tau3 = rWk1_[i]; double tau4 = rWk1_[i]; if (!M3_.empty()) { tau1 += rWk3_[i]; tau2 += rWk4_[i]; tau3 += rWk4_[i]; tau4 += rWk3_[i]; } if (modularize) { tau1 = rWk1_[i] + rWk3_[i]; tau2 = rWk1bis_[i] + rWk3_[i]; tau3 = - rWk1_[i] - rWk4_[i]; tau4 = - rWk1bis_[i] - rWk3_[i]; } double redCost; bool hasNegativeRc = false; double loBound = getLoBound(basics_[i]); if (loBound > -1e50) { redCost = - normedCoef(sigma,basics_[i]) + (tau1) + (1 - fzero) * ( colsol_[basics_[i]] - loBound); if (redCost < -tolerance) { ul_i[i] = redCost; hasNegativeRc = true; } else { if (fabs(redCost) < tolerance) nZeroRc++; else nPositiveRc ++; ul_i[i] = 10.; } if (redCost < bestReducedCost && rowFlags_[i] ) //row has not been flaged { bestDirection = -1; bestGammaSign = -1; bestReducedCost = redCost; bestRow = i; } redCost = -normedCoef(sigma,basics_[i]) - (tau2) - (1 - fzero) * ( colsol_[basics_[i]] - loBound) - loBound + getColsolToCut(basics_[i]); if (redCost < -tolerance) { vl_i[i] = redCost; hasNegativeRc = true; } else { if (fabs(redCost) < tolerance) nZeroRc++; else nPositiveRc ++; vl_i[i]=10.; } if (redCost < bestReducedCost && rowFlags_[i]) //row has not been flaged { bestDirection = -1; bestGammaSign = 1; bestReducedCost = redCost; bestRow = i; } } else { ul_i[i] = 10.; vl_i[i] = 10.; } double upBound = getUpBound(basics_[i]); if (getUpBound(basics_[i]) < 1e50) { redCost = - normedCoef(sigma,basics_[i]) - (tau3) + (1 - fzero) * ( - colsol_[basics_[i]] + upBound); if (redCost < -tolerance) { uu_i[i] = redCost; hasNegativeRc = true; } else { if (fabs(redCost) < tolerance) nZeroRc++; else nPositiveRc ++; uu_i[i] = 10.; } if (redCost < bestReducedCost && rowFlags_[i]) //row has not been flaged { bestDirection = 1; bestGammaSign = -1; bestReducedCost = redCost; bestRow = i; } redCost = -normedCoef(sigma,basics_[i]) + (tau4) - (1 - fzero) * ( - colsol_[basics_[i]] + upBound) + upBound - getColsolToCut(basics_[i]); if (redCost < -tolerance) { vu_i[i] = redCost; hasNegativeRc = true; } else { if (fabs(redCost) < tolerance) nZeroRc++; else nPositiveRc ++; vu_i[i] = 10.; } if (redCost < bestReducedCost && rowFlags_[i]) //row has not been flaged { bestDirection = 1; bestGammaSign = 1; bestReducedCost = redCost; bestRow = i; } } else { uu_i[i] = 10.; vu_i[i] = 10.; } if (hasNegativeRc) nNegativeRcRows_ ++; else if (flagPositiveRows) rowFlags_[i] = false; } handler_->message(NumberNegRc, messages_)<message(NumberZeroRc, messages_)<message(NumberPosRc, messages_)<message(FoundImprovingRow, messages_)<< bestRow<getInfinity(); double bestReducedCost = -tolerance; for (int i = 0 ; i < nrows_ ; i++) { if (i == row_k_.num//obviously not necessary to combine row k with itself || !rowFlags_[i] //row has not been flaged // && fabs(getUpBound(basics_[row_i_.num]) - getLoBound(basics_[row_i_.num]))>1e-09 //variable is not fixed ) continue; if (ul_i[i] < bestReducedCost && rowFlags_[i]) //row has not been flaged { bestDirection = -1; bestGammaSign = -1; bestReducedCost = ul_i[i]; bestRow = i; } if (vl_i[i] < bestReducedCost && rowFlags_[i]) //row has not been flaged { bestDirection = -1; bestGammaSign = 1; bestReducedCost = vl_i[i]; bestRow = i; } if (uu_i[i] < bestReducedCost && rowFlags_[i]) //row has not been flaged { bestDirection = 1; bestGammaSign = -1; bestReducedCost = uu_i[i]; bestRow = i; } if (vu_i[i] < bestReducedCost && rowFlags_[i]) //row has not been flaged { bestDirection = 1; bestGammaSign = 1; bestReducedCost = vu_i[i]; bestRow = i; } } direction = bestDirection; gammaSign = bestGammaSign; // row_i_.num=bestRow; if (bestRow != -1) { chosenReducedCostVal_ = bestReducedCost; row_i_.num=bestRow; pullTableauRow(row_i_); handler_->message(FoundImprovingRow, messages_)<< bestRow<0.) { if (gammaSign > 0) { p += row_k * val; } else { // if(fabs(getColsolToCut(nonBasics_[i])) > 0) { p += row_k * val; q += row_i * val; } } r += normedCoef(row_k, ii) ; s += normedCoef(row_i, ii); } else if (coeff< 0.) { if (gammaSign > 0) { q -= row_i * val; } r -= normedCoef(row_k,ii); s -= normedCoef(row_i,ii); } else { if (gammaSign > 0 && row_i < 0) { q -= row_i * val; } else if (gammaSign < 0 && row_i < 0) { q += row_i * val; } s += normedCoef(gammaSign*fabs(row_i),ii); } } } // double f_plus(double gamma, int gammaSign){ // double num = row_k_. // for(int i = 0 ; i < ncols_ ; i++){ // } //} /** Find the column which leads to the best cut (i.e., find incoming variable).*/ int CglLandPSimplex::fastFindBestPivotColumn(int direction, int gammaSign, double pivotTol, double rhsTol, bool reducedSpace, bool allowDegenerate, double & bestSigma, bool modularize) { gammas_.clear(); pivotTol = 1e-05; adjustTableauRow(basics_[row_i_.num], row_i_, direction); double fzero = getColsolToCut(basics_[row_k_.num]) - floor(getColsolToCut(basics_[row_k_.num])); double p = 0; double q = 0; if(!modularize){//Take a shortcut p = -row_k_.rhs * (1 - fzero); q = row_i_.rhs * fzero; if (gammaSign < 0){ q -= row_i_.rhs; } } double r = 1.; double s = normedCoef( static_cast (gammaSign), basics_[row_i_.num]); bool haveSmallGammaPivot = false; double gammaTolerance = 0; if (allowDegenerate) gammaTolerance = 0; //fill the array with the gammas of correct sign for (int i = 0 ; i < ncols_ ; i++) { const int &ii = nonBasics_[i];//True index const double& val = getColsolToCut(ii); //value in solution to cut const double& row_k = row_k_[ii]; // coefficient in row k const double& row_i = row_i_[ii]; // coefficient in row i if(modularize){ p-=row_k_.rhs*row_k*val; q-=row_i_.rhs*row_k*val; } if (reducedSpace && colCandidateToLeave_[i]==false) { assert(col_in_subspace[ii]==false); continue; } double gamma = 1; if (fabs(row_i) > gammaTolerance && fabs(row_k) > gammaTolerance) { gamma = - row_k/row_i; if (gamma * gammaSign > gammaTolerance) { gammas_.insert(i,gamma*gammaSign); } } gamma = fabs(gamma); // we already know the sign of gamma, its absolute value is more usefull if (row_k>gammaTolerance) { if (gammaSign > 0) { p += row_k * val; } else { { p += row_k * val; q += row_i * val; } } r += normedCoef(row_k, ii) ; s += normedCoef(row_i, ii); } else if (row_k< gammaTolerance) { if (gammaSign > 0) { q -= row_i * val; } r -= normedCoef(row_k,ii); s -= normedCoef(row_i,ii); } else { haveSmallGammaPivot |= true; if (gammaSign > 0 && row_i < 0) { q -= row_i * val; } else if (gammaSign < 0 && row_i < 0) { q += row_i * val; } s += normedCoef(gammaSign*fabs(row_i),ii); } } if(modularize){ p -= row_k_.rhs * (1 - row_k_.rhs); q += row_i_.rhs * row_k_.rhs; if (gammaSign < 0){ q -= row_i_.rhs; } } int n = gammas_.getNumElements(); if (n==0) { resetOriginalTableauRow(basics_[row_i_.num], row_i_, direction); return -2; } gammas_.sortIncrElement(); const int* inds = gammas_.getIndices(); const double * elements = gammas_.getElements(); int bestColumn = -1; double newSigma = 1e100; DblEqAssert(sigma_, rhs_weight_*p/r); bestSigma = sigma_ = rhs_weight_*p/r; int lastValid = -1; #ifndef NDEBUG bool rc_positive=false; if (M3_.size()) DblEqAssert( gammaSign*(q * r - p * s)/r, chosenReducedCostVal_); #endif if ( gammaSign*(q * r - p * s) >= 0) { // after recomputing reduced cost (using exact row) it is found to be >=0 resetOriginalTableauRow(basics_[row_i_.num], row_i_, direction); return -2; #ifndef NDEBUG rc_positive = true; #endif } for (int i = 0 ; i < n ; i++) { double newRhs = row_k_.rhs + gammaSign * elements[i] * row_i_.rhs; if (newRhs < rhsTol || newRhs > 1 - rhsTol) { // if(i == 0) break; } newSigma = (p + gammaSign * elements[i] * q)*rhs_weight_/(r + gammaSign*elements[i] * s); #ifdef DEBUG_LAP double alt = computeCglpObjective(gammaSign*elements[i], false); DblEqAssert(newSigma, alt); #endif if (newSigma > bestSigma - 1e-08*bestSigma) { #ifndef NDEBUG if (!rc_positive) { } if (0 && elements[i] <= 1e-05) { } #endif break; } else if (newSigma <= bestSigma) // && colCandidateToLeave_[inds[i]]) { bestColumn = inds[i]; bestSigma = newSigma; lastValid = i; } #ifndef NDEBUG if (rc_positive) { break; } #endif int col = nonBasics_[inds[i]]; if (row_i_[col] *gammaSign > 0) { p += row_k_[col] * getColsolToCut(col); q += row_i_[col] * getColsolToCut(col); r += normedCoef(row_k_[col]*2,col); s += normedCoef(row_i_[col]*2,col); } else { p -= row_k_[col] * getColsolToCut(col); q -= row_i_[col] * getColsolToCut(col); r -= normedCoef(row_k_[col]*2,col); s -= normedCoef(row_i_[col]*2,col); } if (gammaSign*(q * r - p * s) >= 0) /* function is starting to increase stop here*/ { #ifndef NDEBUG if (0 && elements[i] <= 1e-5) { } rc_positive = true; #endif break; } } //Get the results did we find a valid pivot? is it degenerate? if (bestColumn == -1) // Apparently no pivot is within the tolerances { resetOriginalTableauRow(basics_[row_i_.num], row_i_, direction); handler_->message(WarnFailedPivotTol, messages_)<message(WarnFailedPivotTol, messages_)<message(FoundBestImprovingCol, messages_)<message(WarnFailedBestImprovingCol, messages_)<getInfinity(); int j = 0; double gamma = 0.; for (; j< ncols_orig_ ; j++) { if (reducedSpace && !colCandidateToLeave_[j] ) continue; if (fabs(row_i_[nonBasics_[j]])< pivotTol) { continue; } gamma = - row_k_[nonBasics_[j]]/row_i_[nonBasics_[j]]; newRow[basics_[row_k_.num]] = 1.; newRow.rhs = row_k_.rhs + gamma * row_i_.rhs; if (newRow.rhs > 1e-5 && newRow.rhs < 1 - 1e-5 ) { double m_j = computeCglpObjective(gamma, modularize, newRow); if (m_j < m) { varOut = j; m = m_j; } } } resetOriginalTableauRow(basics_[row_i_.num], row_i_, direction); if (m < sigma_ ) { handler_->message(FoundBestImprovingCol, messages_)< Note that by theory only one reduced cost (for u_i, or v_i) maybe negative for each direction. */ int direction; /** gammSign is the sign of gamma (corresponding to taking rc for u_i or v_i) for the best of the two rc for this row.*/ int gammaSign; /** gammaSign2 is the sign of gamma for the worst of the two rc for this row.*/ int gammaSign2; /** if both reduced costs are <0 value is the smallest of the two.*/ double value; /** greatest of the two reduced costs */ double value2; /** index of the row.*/ int row; bool operator<(const reducedCost & other) const { return (value>other.value); } }; /** Find incoming and leaving variables which lead to the most violated adjacent normalized lift-and-project cut. \remark At this point reduced costs should be already computed. \return incoming variable variable, \param leaving variable \param direction leaving direction \param numTryRows number rows tried \param pivotTol pivot tolerance \param reducedSpace separaration space (reduced or full) \param allowNonStrictlyImproving wether or not to allow non stricly improving pivots. */ int CglLandPSimplex::findBestPivot(int &leaving, int & direction, const CglLandP::Parameters & params) { // 1. Sort <0 reduced costs in increasing order // 2. for numTryRows reduced costs call findBestPivotColumn // if better record // The reduced cost are already here in rWk1_ is u^l_j // rwk2_ is u^u_j rWk3_ is v^u_j rWk4_ is v^u_j // Let's rename not to get too much confused double * ul_i = &rWk1_[0]; double * uu_i = &rWk2_[0]; double * vl_i = &rWk3_[0]; double * vu_i = &rWk4_[0]; reducedCost * rc = new reducedCost[nNegativeRcRows_]; int k = 0; rc[k].direction = 0;//initialize first rc int k2 = 0; for (int i = 0 ; i < nrows_ ; i++) { if (ul_i[i] < -params.pivotTol) // && rowFlags_[i]) //row has not been flaged { rc[k].direction = -1; rc[k].gammaSign = -1; rc[k].value = ul_i[i]; rc[k].row = i; k2++; } if (vl_i[i] < -params.pivotTol) //&& rowFlags_[i]) //row has not been flaged { rc[k].direction = -1; rc[k].gammaSign = 1; rc[k].value = vl_i[i]; rc[k].row = i; k2++; } if (uu_i[i] < -params.pivotTol) // && rowFlags_[i]) //row has not been flaged { if (rc[k].direction == 0) { rc[k].direction = 1; rc[k].gammaSign = -1; rc[k].value = uu_i[i]; rc[k].row = i; } else { if (uu_i[i] -1e-02) break; if (rc[l].value > -1e-02) break; row_i_.num=rc[l].row; pullTableauRow(row_i_);//Get the tableau row //compute f+ or f- for the best negative rc corresponding to this row chosenReducedCostVal_ = rc[l].value; double sigma; int incoming = fastFindBestPivotColumn (rc[l].direction, rc[l].gammaSign, params.pivotTol, params.away, (params.sepSpace==CglLandP::Fractional), 0, sigma, params.modularize); if (incoming!=-1 && bestSigma > sigma) { // std::cout<<"I found a better pivot "< 0 ? 1 : -1; bestRc = rc[l].value; notImproved = 0; } //Now evenutally compute f+ or f- for the other negative rc (if if exists) if (rc[l].direction == 2 || rc[l].direction == -2) { rc[l].direction/= -2;//Reverse the direction chosenReducedCostVal_ = rc[l].value2;//need to set this for debug double //checks incoming = fastFindBestPivotColumn (rc[l].direction, rc[l].gammaSign2, params.pivotTol, params.away, (params.sepSpace==CglLandP::Fractional), 0, sigma, params.modularize); if (incoming!=-1 && bestSigma > sigma) { // std::cout<<"I found a better pivot "< 0 ? coeff *(1- row.rhs): - coeff * row.rhs)*getColsolToCut(jj); } return numerator*rhs_weight_/denominator; } double CglLandPSimplex::computeCglpObjective(double gamma, bool strengthen) { double rhs = row_k_.rhs + gamma * row_i_.rhs; double numerator = - rhs * (1 - rhs); double denominator = 1; double coeff = gamma;//newRowCoefficient(basics_[row_i_.num], gamma); if (strengthen && isInteger(basics_[row_i_.num])) coeff = modularizedCoef(coeff, rhs); denominator += normedCoef(fabs(coeff), basics_[row_i_.num]); numerator += (coeff > 0 ? coeff *(1- rhs): - coeff * rhs)* getColsolToCut(basics_[row_i_.num]); for (int j = 0 ; j < ncols_ ; j++) { if (col_in_subspace[nonBasics_[j]]==false) { continue; } coeff = newRowCoefficient(nonBasics_[j], gamma); if (strengthen && nonBasics_[j] < ncols_orig_ && isInteger(j)) coeff = modularizedCoef(coeff, rhs); denominator += normedCoef(fabs(coeff), nonBasics_[j]); numerator += (coeff > 0 ? coeff *(1- rhs): - coeff * rhs)* getColsolToCut(nonBasics_[j]); } return numerator*rhs_weight_/denominator; } double CglLandPSimplex::computeCglpObjective(double gamma, bool strengthen, TabRow & newRow) { newRow.clear(); newRow.rhs = row_k_.rhs + gamma * row_i_.rhs; double numerator = -newRow.rhs * (1 - newRow.rhs); double denominator = 1; int * indices = newRow.getIndices(); int k = 0; { if (col_in_subspace[basics_[row_i_.num]]==false) { DblEqAssert(0.,1.); } double & val = newRow[ basics_[row_i_.num]] = gamma;//newRowCoefficient(basics_[row_i_.num], gamma); indices[k++] = basics_[row_i_.num]; if (strengthen && row_i_.num < ncols_orig_ && isInteger(row_i_.num)) newRow[ basics_[row_i_.num]] = modularizedCoef(newRow[ basics_[row_i_.num]], newRow.rhs); denominator += normedCoef(fabs(val), basics_[row_i_.num]); numerator += (val > 0 ? val *(1- newRow.rhs): - val * newRow.rhs)* getColsolToCut(basics_[row_i_.num]); } for (int j = 0 ; j < ncols_ ; j++) { double & val = newRow[nonBasics_[j]] = newRowCoefficient(nonBasics_[j], gamma); indices[k++] = nonBasics_[j]; if (strengthen && nonBasics_[j] < ncols_orig_ && isInteger(j)) newRow[ nonBasics_[j]] = modularizedCoef(val, newRow.rhs); if (col_in_subspace[nonBasics_[j]]==false) continue; denominator += normedCoef(fabs(val), nonBasics_[j]); numerator += (val > 0 ? val *(1- newRow.rhs): - val * newRow.rhs)* getColsolToCut(nonBasics_[j]); } newRow.setNumElements(k); //assert (fabs(numerator/denominator - computeCglpObjective(newRow))<1e-04); return numerator*rhs_weight_/denominator; } /** Compute the reduced cost of Cglp */ double CglLandPSimplex::computeCglpRedCost(int direction, int gammaSign, double tau) { double toBound; toBound = direction == -1 ? getLoBound(basics_[row_i_.num]) : getUpBound(basics_[row_i_.num]); double value =0; int sign = gammaSign * direction; double tau1 = 0; double tau2 = 0; for (unsigned int i = 0 ; i < M3_.size() ; i++) { tau1 += fabs(row_i_ [M3_[i]]); if (sign == 1 && row_i_[M3_[i]] < 0) { tau2 += row_i_[M3_[i]] * getColsolToCut(M3_[i]); } else if (sign == -1 && row_i_[M3_[i]] > 0) { tau2 += row_i_[M3_[i]] * getColsolToCut(M3_[i]); } } double Tau = - sign * (tau + tau2) - tau1 * sigma_; value = - sigma_ + Tau + (1 - getColsolToCut(basics_[row_k_.num])) * sign * (row_i_.rhs - toBound) + (gammaSign == 1)*direction*(toBound - getColsolToCut(basics_[row_i_.num])); return value; } /** Compute the value of sigma and thau (which are constants for a row i as defined in Mike Perregaard thesis */ double CglLandPSimplex::computeRedCostConstantsInRow() { double tau1 = 0; //the part which will be multiplied by sigma double tau2 = 0;//the rest for (unsigned int i = 0 ; i < M1_.size() ; i++) { tau1 += row_i_[M1_[i]]; } for (unsigned int i = 0 ; i < M2_.size() ; i++) { tau1 -= row_i_[M2_[i]]; tau2 += row_i_[M2_[i]] * getColsolToCut(M2_[i]); } return sigma_ * tau1 + tau2; } void CglLandPSimplex::updateM1_M2_M3(TabRow & row, double tolerance, bool perturb) { M1_.clear(); M2_.clear(); M3_.clear(); tolerance = 0; for (int i = 0; itolerance) { if (col_in_subspace[ii]) { M2_.push_back(ii); colCandidateToLeave_[i]=true; } else { colCandidateToLeave_[i]=false; } } else { if (col_in_subspace[ii]) { if (perturb) //assign to M1 or M2 at random { int sign = CoinDrand48() > 0.5 ? 1 : -1; if (sign == -1) //put into M1 { M1_.push_back(ii); colCandidateToLeave_[i]=true; } else //put into M2 { M2_.push_back(ii); colCandidateToLeave_[i]=true; } } else { M3_.push_back(ii); colCandidateToLeave_[i] = true; } } else { colCandidateToLeave_[i] = false; } } } //std::cout<<"M3 has "<getColLower(); const double * rowLower = si_->getRowLower(); const double * colUpper = si_->getColUpper(); const double * rowUpper = si_->getRowUpper(); // double f_0 = row.rhs; //put the row back into original form for (int j = 0; j < ncols_ ; j++) { if ((nonBasics_[j] < ncols_)) { CoinWarmStartBasis::Status status = getStatus(nonBasics_[j]); if (status==CoinWarmStartBasis::atLowerBound) { // row.rhs += getLoBound(nonBasics_[j]) * row[nonBasics_[j]]; } else if (status==CoinWarmStartBasis::atUpperBound) { row[nonBasics_[j]] = - row[nonBasics_[j]]; // row.rhs += getUpBound(nonBasics_[j]) * row[nonBasics_[j]]; } else { throw; } } } // return ; cut.setUb(COIN_DBL_MAX); double * vec = new double[ncols_orig_+ nrows_orig_ ]; CoinFillN(vec, ncols_orig_ + nrows_orig_, 0.); double infty = si_->getInfinity(); double cutRhs = row.rhs; cutRhs = cutRhs * (1 - cutRhs); for (int j = 0; j < ncols_ ; j++) { if (fabs(row[nonBasics_[j]])>1e-10) { double value = intersectionCutCoef(row[nonBasics_[j]], row.rhs); if (nonBasics_[j]getStructStatus(nonBasics_[j]); if (status==CoinWarmStartBasis::atUpperBound) { value = - intersectionCutCoef(- row[nonBasics_[j]], row.rhs) ; cutRhs += value * colUpper[nonBasics_[j]]; } else cutRhs += value * colLower[nonBasics_[j]]; vec[original_index_[nonBasics_[j]]] += value; } else if (nonBasics_[j]>=ncols_) { int iRow = nonBasics_[j] - ncols_; if (rowLower[iRow] > -infty) { value = -value; cutRhs -= value*rowLower[iRow]; assert(basis_->getArtifStatus(iRow)==CoinWarmStartBasis::atUpperBound || (fabs(rowLower[iRow] - rowUpper[iRow]) < 1e-08)); } else { cutRhs -= value*rowUpper[iRow]; assert(basis_->getArtifStatus(iRow)==CoinWarmStartBasis::atLowerBound); } vec[nonBasics_[j]] = value; assert(fabs(cutRhs)<1e100); } } } const CoinPackedMatrix * mat = si_->getMatrixByCol(); const CoinBigIndex * starts = mat->getVectorStarts(); const int * lengths = mat->getVectorLengths(); const double * values = mat->getElements(); const CoinBigIndex * indices = mat->getIndices(); for (int j = 0 ; j < ncols_ ; j++) { const int& start = starts[j]; int end = start + lengths[j]; for (int k = start ; k < end ; k++) { vec[original_index_[j]] -= vec[original_index_[ncols_ + indices[k]]] * values[k]; } } //Pack vec into the cut int * inds = new int [ncols_orig_]; int nelem = 0; for (int i = 0 ; i < ncols_orig_ ; i++) { if (fabs(vec[i]) > COIN_INDEXED_TINY_ELEMENT) { vec[nelem] = vec[i]; inds[nelem++] = i; } } cut.setLb(cutRhs); cut.setRow(nelem, inds, vec, false); delete [] vec; } /** Compute the normalization factor of the cut.*/ double CglLandPSimplex::normalizationFactor(const TabRow & row) const { double numerator = rhs_weight_; double denominator = 1.; for (int j = 0 ; j < ncols_ ; j++) { denominator += fabs(normedCoef(row[nonBasics_[j]], nonBasics_[j])); } return numerator/denominator; } /** Create MIG cut from row k*/ void CglLandPSimplex::createMIG( TabRow &row, OsiRowCut &cut) const { const double * colLower = si_->getColLower(); const double * rowLower = si_->getRowLower(); const double * colUpper = si_->getColUpper(); const double * rowUpper = si_->getRowUpper(); if (1) { double f_0 = row.rhs - floor(row.rhs); //put the row back into original form for (int j = 0; j < ncols_ ; j++) { if (nonBasics_[j] < ncols_) { const CoinWarmStartBasis::Status status = basis_->getStructStatus(nonBasics_[j]); if (status==CoinWarmStartBasis::atLowerBound) { // row.rhs += getLoBound(nonBasics_[j]) * row[nonBasics_[j]]; } else if (status==CoinWarmStartBasis::atUpperBound) { row[nonBasics_[j]] = - row[nonBasics_[j]]; // row.rhs += getUpBound(nonBasics_[j]) * row[nonBasics_[j]]; } else { throw; } } } //double scaleFactor = normalizationFactor(row); row.rhs = f_0; cut.setUb(COIN_DBL_MAX); double * vec = new double[ncols_orig_ + nrows_orig_]; CoinFillN(vec, ncols_orig_ + nrows_orig_, 0.); //f_0 = row.rhs - floor(row.rhs); double infty = si_->getInfinity(); double cutRhs = row.rhs - floor(row.rhs); cutRhs = cutRhs * (1 - cutRhs); assert(fabs(cutRhs)<1e100); for (int j = 0; j < ncols_ ; j++) { if (fabs(row[nonBasics_[j]])>0.) { { if (nonBasics_[j]getStructStatus(nonBasics_[j]); double value; if (status==CoinWarmStartBasis::atUpperBound) { value = - strengthenedIntersectionCutCoef(nonBasics_[j], - row[nonBasics_[j]], row.rhs) ; cutRhs += value * colUpper[nonBasics_[j]]; } else if (status==CoinWarmStartBasis::atLowerBound) { value = strengthenedIntersectionCutCoef(nonBasics_[j], row[nonBasics_[j]], row.rhs); cutRhs += value * colLower[nonBasics_[j]]; } else { std::cerr<<"Invalid basis"<getArtifStatus(iRow)==CoinWarmStartBasis::atUpperBound || (rowUpper[iRow] < infty)); } vec[original_index_[nonBasics_[j]]] = value; assert(fabs(cutRhs)<1e100); } } } } //Eliminate slacks eliminate_slacks(vec); //Pack vec into the cut int * inds = new int [ncols_orig_]; int nelem = 0; for (int i = 0 ; i < ncols_orig_ ; i++) { if (fabs(vec[i]) > COIN_INDEXED_TINY_ELEMENT) { vec[nelem] = vec[i]; inds[nelem++] = i; } } cut.setLb(cutRhs); cut.setRow(nelem, inds, vec, false); //std::cout<<"Scale factor: "<getMatrixByCol(); const CoinBigIndex * starts = mat->getVectorStarts(); const int * lengths = mat->getVectorLengths(); const double * values = mat->getElements(); const CoinBigIndex * indices = mat->getIndices(); const double * vecSlacks = vec + ncols_orig_; for (int j = 0 ; j < ncols_ ; j++) { const CoinBigIndex& start = starts[j]; CoinBigIndex end = start + lengths[j]; double & val = vec[original_index_[j]]; for (CoinBigIndex k = start ; k < end ; k++) { val -= vecSlacks[indices[k]] * values[k]; } } } void CglLandPSimplex::scaleCut(OsiRowCut & cut, double factor) const { DblGtAssert(factor, 0.); cut *= factor; cut.setLb(cut.lb()*factor); } #ifdef APPEND_ROW void CglLandPSimplex::append_row(int row_num, bool modularize) { int old_idx = basics_[row_num]; int r_idx = nrows_ - 1; if (basis_->getArtifStatus(nrows_ - 1) == CoinWarmStartBasis::basic) { int i = 0; for (; i < ncols_ ; i++) { if (nonBasics_[i] == ncols_ + nrows_ -1) break; } if (i < ncols_) { nonBasics_[i] = ncols_ + nrows_ - 1; assert(basics_[nrows_ - 1] == ncols_ + nrows_ - 1); basics_[nrows_ - 1] = ncols_ - 1; } } #if 0 if (basis_->getStructStatus(ncols_ - 1) != CoinWarmStartBasis::basic) { basis_->setStructStatus(ncols_ - 1, CoinWarmStartBasis::basic); assert(basis_->getArtifStatus(nrows_ - 1) == CoinWarmStartBasis::basic); basis_->setArtifStatus(nrows_ - 1, CoinWarmStartBasis::atLowerBound); si_->pivot(ncols_ - 1, ncols_ + nrows_ - 1, -1); } #endif TabRow row(this); int rowsize = ncols_orig_ + nrows_orig_ + 1; row.reserve(rowsize); row.num = row_num; pullTableauRow(row); row.rhs -= floor(row.rhs); if (basis_->getStructStatus(ncols_ - 1) != CoinWarmStartBasis::basic) { basis_->setStructStatus(ncols_ - 1, CoinWarmStartBasis::basic); assert(basis_->getArtifStatus(nrows_ - 1) == CoinWarmStartBasis::basic); basis_->setArtifStatus(nrows_ - 1, CoinWarmStartBasis::atLowerBound); si_->pivot(ncols_ - 1, ncols_ + nrows_ - 1, -1); } int n = row.getNumElements(); const int* ind = row.getIndices(); #ifdef COIN_HAS_OSICLP CoinPackedMatrix * m = clp_->getMutableMatrixByCol(); #endif #if 1 const double * rowLower = si_->getRowLower(); const double * rowUpper = si_->getRowUpper(); double infty = si_->getInfinity(); double rhs = floor (colsol_[old_idx]);//floor(row.rhs); std::vector vec(rowsize,0.); for (int i = 0 ; i < n ; i++) { const int &ni = ind[i]; if (ni == old_idx) continue; if (integers_[ni]) { double f = modularizedCoef(row[ni],row.rhs); f = floor(row[ni] - f + 0.5); row[ni] -= f; if (ni < ncols_) { if (basis_->getStructStatus(ni) == CoinWarmStartBasis::atUpperBound) { f *= -1; rhs += f * getUpBound(ni); } if (basis_->getStructStatus(ni) == CoinWarmStartBasis::atLowerBound) { //f *= -1; rhs -= f * getLoBound(ni); } vec[ni]=f; } else { int iRow = ind[i] - ncols_; if (basis_->getArtifStatus(iRow)==CoinWarmStartBasis::atLowerBound) { rhs -= f*rowUpper[iRow]; } else if (basis_->getArtifStatus(iRow)==CoinWarmStartBasis::atUpperBound) { f *= -1; rhs -= f*rowLower[iRow]; assert(rowLower[iRow] < infty); } vec[ni] = f; } } } vec[old_idx] = 1; eliminate_slacks(&vec[0]); for (int i = 0 ; i < rowsize ; i++) { if (vec[i]) m->modifyCoefficient(r_idx, i, vec[i], true); } si_->setRowBounds(r_idx, rhs, rhs); #endif #if 1 si_->messageHandler()->setLogLevel(0); si_->resolve(); assert(si_->getIterationCount() == 0); #endif /* Update the cached info.*/ #ifndef NDEBUG int * basics = new int[nrows_]; #else int * basics = basics_; #endif si_->getBasics(basics); #ifndef NDEBUG for (int i = 0 ; i < r_idx ; i++) { assert(basics[i] == basics_[i]); } assert(basics[r_idx] == ncols_ - 1); delete [] basics_; basics_ = basics; #endif assert(basis_->getStructStatus(old_idx) == CoinWarmStartBasis::basic); assert(basis_->getStructStatus(ncols_ - 1) == CoinWarmStartBasis::basic); n = 0; for (int i = 0 ; i < ncols_ ; i++) { if (basis_->getStructStatus(i) != CoinWarmStartBasis::basic) { nonBasics_[n++] = i; } } for (int i = 0 ; i < nrows_ ; i++) { if (basis_->getArtifStatus(i) != CoinWarmStartBasis::basic) { nonBasics_[n++] = i + ncols_; } } assert (n == ncols_); colsol_[ncols_ - 1] = si_->getColSolution()[ncols_-1]; colsolToCut_[ncols_ - 1] = si_->getColSolution()[ncols_-1]; } void CglLandPSimplex::check_mod_row(TabRow & row) { int rowsize = ncols_orig_ + nrows_orig_; for (int i = 0 ; i < rowsize ; i++) { assert(! integers_[i] || ((row[i] <= row.rhs+1e-08) && (row[i] >= row.rhs - 1- 1e-08))); } } void CglLandPSimplex::update_row(TabRow &row) { int r_idx = nrows_ - 1; int c_idx = ncols_ - 1; assert(basics_[row.num] == ncols_ - 1); assert(r_idx == row.num); int rowsize = nrows_ + ncols_; int n = row.getNumElements(); const int* ind = row.getIndices(); #ifdef COIN_HAS_OSICLP CoinPackedMatrix * m = clp_->getMutableMatrixByCol(); #endif //double * m_el = m->getMutableElements(); //const int * m_id = m->getIndices(); //const int * m_le = m->getVectorLengths(); //const CoinBigIndex * m_st = m->getVectorStarts(); const double * rowLower = si_->getRowLower(); const double * rowUpper = si_->getRowUpper(); double infty = si_->getInfinity(); double rhs = floor(row.rhs); std::vector vec(rowsize,0.); for (int i = 0 ; i < n ; i++) { const int &ni = ind[i]; if (ni == c_idx) continue; if (integers_[ni]) { double f = modularizedCoef(row[ni],row.rhs); f = floor(row[ni] - f + 0.5); //row[ni] -= f; if (ni < ncols_) { assert(basis_->getStructStatus(ni) != CoinWarmStartBasis::basic); if (basis_->getStructStatus(ni) == CoinWarmStartBasis::atUpperBound) { f *= -1; rhs += f * getUpBound(ni); } if (basis_->getStructStatus(ni) == CoinWarmStartBasis::atLowerBound) { rhs -= f * getLoBound(ni); } vec[ni]=f; } else { //continue; int iRow = ind[i] - ncols_; if (iRow == r_idx) continue; assert(basis_->getArtifStatus(iRow) != CoinWarmStartBasis::basic); if (basis_->getArtifStatus(iRow)==CoinWarmStartBasis::atLowerBound) { rhs -= f*rowUpper[iRow]; } else if (basis_->getArtifStatus(iRow)==CoinWarmStartBasis::atUpperBound) { f *= -1; rhs -= f*rowLower[iRow]; assert(rowUpper[iRow] < infty); } vec[ni] = f; } } } std::copy(vec.begin(),vec.end(), std::ostream_iterator(std::cout, "\t")); std::cout<(std::cout, "\t")); std::cout<getCoefficient(r_idx,i); m->modifyCoefficient(r_idx, i, f + vec[i], true); } } si_->setRowBounds(r_idx, rowLower[r_idx] + rhs, rowUpper[r_idx] + rhs); #ifdef COIN_HAS_OSICLP clp_->getModelPtr()->factorize(); #endif pullTableauRow(row); assert(row.rhs >= 0. && row.rhs <= 1.); bool stop = false; for (int i = 0 ; i < rowsize ; i++) { if (integers_[i] && (row[i] > row.rhs || row[i] < row.rhs - 1)) { stop = true; } //assert(! integers_[i] || (row[i] <= row.rhs && row[i] > row.rhs - 1)); } if (stop) exit(10); } #endif /** Get the row i of the tableau */ void CglLandPSimplex::pullTableauRow(TabRow &row) const { const double * rowLower = si_->getRowLower(); const double * rowUpper = si_->getRowUpper(); row.clear(); row.modularized_ = false; double infty = si_->getInfinity(); /* Get the row */ #ifdef COIN_HAS_OSICLP if (clp_) { CoinIndexedVector array2; array2.borrowVector(nrows_, 0, row.getIndices() + ncols_, row.denseVector() + ncols_); clp_->getBInvARow(row.num, &row, &array2); { int n = array2.getNumElements(); int * indices1 = row.getIndices() + row.getNumElements(); int * indices2 = array2.getIndices(); for ( int i = 0 ; i < n ; i++) { *indices1 = indices2[i] + ncols_; indices1++; } row.setNumElements(n + row.getNumElements()); array2.returnVector(); } } else #endif { si_->getBInvARow(row.num,row.denseVector(),row.denseVector() + ncols_); } //Clear basic element (it is a trouble for most of the computations) row[basics_[row.num]]=0.; // row.row[basics_[row.num]]=1; /* get the rhs */ { int iCol = basics_[row.num]; if (iColgetColSolution()[iCol]; else // Osi does not give direct acces to the value of slacks { iCol -= ncols_; row.rhs = - si_->getRowActivity()[iCol]; if (rowLower[iCol]> -infty) { row.rhs += rowLower[iCol]; } else { row.rhs+= rowUpper[iCol]; } } } //Now adjust the row of the tableau to reflect non-basic variables activity for (int j = 0; j < ncols_ ; j++) { if (nonBasics_[j]getStructStatus(nonBasics_[j])==CoinWarmStartBasis::atLowerBound) { } else if (basis_->getStructStatus(nonBasics_[j])==CoinWarmStartBasis::atUpperBound) { row[nonBasics_[j]] = -row[nonBasics_[j]]; } else { std::cout<<(basis_->getStructStatus(nonBasics_[j])==CoinWarmStartBasis::isFree)<getArtifStatus(iRow)==CoinWarmStartBasis::atUpperBound) { row[nonBasics_[j]] = -row[nonBasics_[j]]; } } } // row.clean(1e-30); } /** Adjust the row of the tableau to reflect leaving variable direction */ void CglLandPSimplex::adjustTableauRow(int var, TabRow & row, int direction) { double bound = 0; assert(direction != 0); if (direction > 0) { for (int j = 0 ; j < ncols_orig_ ; j++) row[nonBasics_[j]] = - row[nonBasics_[j]]; row.rhs = -row.rhs; bound = getUpBound(var); setColsolToCut(var, bound - getColsolToCut(var)); row.rhs += bound; } else if (direction < 0) { bound = getLoBound(var); setColsolToCut(var, getColsolToCut(var) - bound); row.rhs -= bound; } // assert(fabs(row.rhs)<1e100); } /** reset the tableau row after a call to adjustTableauRow */ void CglLandPSimplex::resetOriginalTableauRow(int var, TabRow & row, int direction) { if (direction > 0) { adjustTableauRow(var, row, direction); } else { double bound = getLoBound(var); row.rhs += bound; setColsolToCut(var, getColsolToCut(var) + bound); } } template struct SortingOfArray { X * array; SortingOfArray(X* a): array(a) {} bool operator()(const int i, const int j) { return array[i] < array[j]; } }; void CglLandPSimplex::removeRows(int nDelete, const int * rowsIdx) { std::vector sortedIdx; for (int i = 0 ; i < nDelete ; i++) sortedIdx.push_back(rowsIdx[i]); std::sort(sortedIdx.end(), sortedIdx.end()); si_->deleteRows(nDelete, rowsIdx); int k = 1; int l = sortedIdx[0]; for (int i = sortedIdx[0] + 1 ; k < nDelete ; i++) { if (sortedIdx[k] == i) { k++; } else { original_index_[l] = original_index_[i]; l++; } } delete basis_; basis_ = dynamic_cast (si_->getWarmStart()); assert(basis_); /* Update rowFlags_ */ std::vector order(nrows_); for (unsigned int i = 0 ; i < order.size() ; i++) { order[i] = i; } std::sort(order.begin(), order.end(), SortingOfArray(basics_)); k = 0; l = 0; for (int i = 0 ; k < nDelete ; i++) { if (basics_[order[i]] == sortedIdx[k]) { basics_[order[i]] = -1; k++; } else { order[l] = order[i]; l++; } } k = 0; for (int i = 0 ; i < nrows_ ; i++) { if (basics_[i] == -1) { k++; } else { basics_[l] = basics_[i]; rowFlags_[l] = rowFlags_[i]; rWk1_[l] = rWk1_[i]; rWk2_[l] = rWk2_[i]; rWk4_[l] = rWk3_[i]; rWk4_[l] = rWk4_[i]; if (row_k_.num == i) row_k_.num = l; l++; } } nrows_ = nrows_ - nDelete; original_index_.resize(nrows_); int numStructural = basis_->getNumStructural(); assert(ncols_ = numStructural); int nNonBasics = 0; for (int i = 0 ; i < numStructural ; i++) { if (basis_->getStructStatus(i) != CoinWarmStartBasis::basic) { nonBasics_[nNonBasics++] = i; } } int numArtificial = basis_->getNumArtificial(); assert(nrows_ = numArtificial); for (int i = 0 ; i < numArtificial ; i++) { if (basis_->getArtifStatus(i)!= CoinWarmStartBasis::basic) { nonBasics_[nNonBasics++] = i + numStructural; } } assert (nNonBasics == ncols_); } void CglLandPSimplex::printEverything(){ row_k_.print(std::cout, 2, nonBasics_, ncols_); printf("nonBasics_: "); for(int i = 0 ; i < ncols_ ; i++){ printf("%5i ",nonBasics_[i]); } printf("\n"); printf("basics_: "); for(int i = 0 ; i < nrows_ ; i++){ printf("%5i ",basics_[i]); } printf("\n"); printf("source row:"); for(int i = 0 ; i < ncols_ + nrows_ ; i++){ printf("%10.9g ", row_k_[i]); } printf("%10.9g", row_k_.rhs); printf("\n"); printf(" source indices: "); for(int i = 0 ; i < row_k_.getNumElements() ; i++){ printf("%5i %20.20g ", row_k_.getIndices()[i], row_k_[row_k_.getIndices()[i]]); } printf("\n"); printf("colsolToCut: "); for(int i = 0 ; i < ncols_ + nrows_ ; i++){ printf("%10.6g ", colsolToCut_[i]); } printf("\n"); printf("colsol: "); for(int i = 0 ; i < ncols_ + nrows_ ; i++){ printf("%10.6g ", colsol_[i]); } printf("\n"); } }/* Ends LAP namespace.*/ Cgl-0.58.9/src/CglLandP/CglLandPUtils.hpp0000644000076600007660000000517612130104734016375 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // LIF // CNRS, Aix-Marseille Universites // Date: 02/23/08 // // $Id: CglLandPUtils.hpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #ifndef CglLandPUtils_H #define CglLandPUtils_H #include "CglLandPTabRow.hpp" class CoinRelFltEq; class OsiRowCut; class OsiCuts; #include #include namespace LAP { /** Compute \$ \frac{\sum\limits_{j=1}^n | \overline a_{ij} |}{1 - \overline a_{i0}} \$ for row passed as argument.*/ double normCoef(TabRow &row, int ncols, const int * nonBasics); /** scale the cut passed as argument*/ void scale(OsiRowCut &cut); /** scale the cut passed as argument using provided normalization factor*/ void scale(OsiRowCut &cut, double norma); /** Modularize row.*/ void modularizeRow(TabRow & row, const bool * integerVar); /** return the coefficients of the intersection cut */ inline double intersectionCutCoef(double alpha_i, double beta) { if (alpha_i>0) return alpha_i* (1 - beta); else return -alpha_i * beta;// (1 - beta); } /** compute the modularized row coefficient for an integer variable*/ inline double modularizedCoef(double alpha, double beta) { double f_i = alpha - floor(alpha); if (f_i <= beta) return f_i; else return f_i - 1; } /** Says is value is integer*/ inline bool int_val(double value, double tol) { return fabs( floor( value + 0.5 ) - value ) < tol; } /** To store extra cuts generated by columns from which they origin.*/ struct Cuts { Cuts(): numberCuts_(0), cuts_(0) { } /** Puts all the cuts into an OsiCuts */ int insertAll(OsiCuts & cs, CoinRelFltEq& eq); /** Destructor.*/ ~Cuts() {} /** Access to row cut indexed by i*/ OsiRowCut * rowCut(unsigned int i) { return cuts_[i]; } /** const access to row cut indexed by i*/ const OsiRowCut * rowCut(unsigned int i) const { return cuts_[i]; } /** insert a cut for variable i and count number of cuts.*/ void insert(int i, OsiRowCut * cut); /** Access to number of cuts.*/ int numberCuts() { return numberCuts_; } /** resize vector.*/ void resize(unsigned int i) { cuts_.resize(i, reinterpret_cast (NULL)); } private: /** Stores the number of cuts.*/ int numberCuts_; /** Store the cuts by index of the generating simple disjunction.*/ std::vector cuts_; }; } #endif Cgl-0.58.9/src/CglLandP/CglLandPUtils.cpp0000644000076600007660000000476012130104734016366 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // LIF // CNRS, Aix-Marseille Universites // Date: 02/23/08 // // $Id: CglLandPUtils.cpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #include "CglLandPUtils.hpp" #include "OsiRowCut.hpp" #include "OsiCuts.hpp" namespace LAP { double normCoef(TabRow &row, int ncols, const int * nonBasics) { double res = 1; for (int i = 0 ; i < ncols ; i++) res += fabs(row[nonBasics[i]]); return res/(1-row.rhs); } /** scale the cut passed as argument using provided normalization factor*/ void scale(OsiRowCut &cut, double norma) { assert(norma >0.); CoinPackedVector row; row.reserve(cut.row().getNumElements()); for (int i = 0 ; i < cut.row().getNumElements() ; i++) { row.insert(cut.row().getIndices()[i], cut.row().getElements()[i]/norma); } cut.setLb(cut.lb()/norma); cut.setRow(row); } /** scale the cut passed as argument*/ void scale(OsiRowCut &cut) { double rhs = fabs(cut.lb()); CoinPackedVector row; row.reserve(cut.row().getNumElements()); for (int i = 0 ; i < cut.row().getNumElements() ; i++) { row.insert(cut.row().getIndices()[i], cut.row().getElements()[i]/rhs); } cut.setLb(cut.lb()/rhs); cut.setRow(row); } /** Modularize row.*/ void modularizeRow(TabRow & row, const bool * integerVar) { const int& n = row.getNumElements(); const int* ind = row.getIndices(); for (int i = 0 ; i < n ; i++) { const int &ni = ind[i]; if (integerVar[ni]) row[ni] = modularizedCoef(row[ni],row.rhs); } } int Cuts::insertAll(OsiCuts & cs, CoinRelFltEq& eq) { int r_val = 0; for (unsigned int i = 0 ; i < cuts_.size() ; i++) { if (cuts_[i] != NULL) { cs.insertIfNotDuplicate(*cuts_[i], eq); delete cuts_[i]; cuts_[i] = NULL; r_val++; } } return r_val; } /** insert a cut for variable i and count number of cuts.*/ void Cuts::insert(int i, OsiRowCut * cut) { if (cuts_[i] == NULL) numberCuts_++; else { printf("Replacing cut with violation %g with one from optimal basis with violation %g.\n", cuts_[i]->effectiveness(), cut->effectiveness()); delete cuts_[i]; } cuts_[i] = cut; } } Cgl-0.58.9/src/CglLandP/CglLandPMessages.hpp0000644000076600007660000000253712130104734017042 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // LIF // CNRS, Aix-Marseille Universites // Date: 02/23/08 // // $Id: CglLandPMessages.hpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #ifndef CglLandPMessages_H #define CglLandPMessages_H #include "CoinMessage.hpp" #include "CoinMessageHandler.hpp" namespace LAP { /** Forward declaration of class to store extra debug data.*/ class DebugData; /** Types of messages for lift-and-project simplex.*/ enum LAP_messages { Separating, FoundImprovingRow, FoundBestImprovingCol, WarnFailedBestImprovingCol, LogHead, PivotLog, FinishedOptimal, HitLimit, NumberNegRc, NumberZeroRc, NumberPosRc, WeightsStats, WarnBadSigmaComputation, WarnBadRowComputation, WarnGiveUpRow, PivotFailedSigmaUnchanged, PivotFailedSigmaIncreased, FailedSigmaIncreased, WarnBadRhsComputation, WarnFailedPivotTol, WarnFailedPivotIIf, RoundStats, CutStat, DUMMY_END }; /** Message handler for lift-and-project simplex. */ class LandPMessages : public CoinMessages { public: /** Constructor */ LandPMessages(); }; } #endif Cgl-0.58.9/src/CglLandP/CglLandP.hpp0000644000076600007660000002274012130104734015350 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 07/21/05 // // $Id: CglLandP.hpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #ifndef CglLandP_H #define CglLandP_H #include "CglLandPValidator.hpp" #include "CglCutGenerator.hpp" #include "CglParam.hpp" #include class CoinWarmStartBasis; /** Performs one round of Lift & Project using CglLandPSimplex to build cuts */ namespace LAP { enum LapMessagesTypes { BEGIN_ROUND, END_ROUND, DURING_SEP, CUT_REJECTED, CUT_FAILED, CUT_GAP, LAP_CUT_FAILED_DO_MIG, LAP_MESSAGES_DUMMY_END }; /** Output messages for Cgl */ class LapMessages : public CoinMessages { public: /** Constructor */ LapMessages( ); /** destructor.*/ virtual ~LapMessages() {} }; class CglLandPSimplex; } class CglLandP : public CglCutGenerator { friend void CglLandPUnitTest(OsiSolverInterface *si, const std::string & mpsDir); friend class LAP::CglLandPSimplex; friend class CftCglp; public: enum SelectionRules { mostNegativeRc /** select most negative reduced cost */, bestPivot /** select best possible pivot.*/, initialReducedCosts/** Select only those rows which had initialy a 0 reduced cost.*/ }; enum ExtraCutsMode { none/** Generate no extra cuts.*/, AtOptimalBasis /** Generate cuts from the optimal basis.*/, WhenEnteringBasis /** Generate cuts as soon as a structural enters the basis.*/, AllViolatedMigs/** Generate all violated Mixed integer Gomory cuts in the course of the optimization.*/ }; /** Space where cuts are optimized.*/ enum SeparationSpaces { Fractional=0 /** True fractional space.*/, Fractional_rc/** Use fractional space only for computing reduced costs.*/, Full /** Work in full space.*/ }; /** Normalization */ enum Normalization { Unweighted = 0, WeightRHS, WeightLHS, WeightBoth }; enum LHSnorm { L1 = 0, L2, SupportSize, Infinity, Average, Uniform }; /** RHS weight in normalization.*/ enum RhsWeightType { Fixed = 0 /** 2*initial number of constraints. */, Dynamic /** 2 * current number of constraints. */ }; /** Class storing parameters. \remark I take all parameters from Ionut's code */ class Parameters : public CglParam { public: /** Default constructor (with default values)*/ Parameters(); /** Copy constructor */ Parameters(const Parameters &other); /** Assignment opertator */ Parameters & operator=(const Parameters &other); /// @name integer parameters ///@{ /** Max number of pivots before we generate the cut \default 20 */ int pivotLimit; /** Max number of pivots at regular nodes. Put a value if you want it lower than the global pivot limit. \default 100.*/ int pivotLimitInTree; /** Maximum number of cuts generated at a given round*/ int maxCutPerRound; /** Maximum number of failed pivots before aborting */ int failedPivotLimit; /** maximum number of consecutive degenerate pivots \default 0 */ int degeneratePivotLimit; /** Maximum number of extra rows to generate per round.*/ int extraCutsLimit; ///@} /// @name double parameters ///@{ /** Tolerance for small pivots values (should be the same as the solver */ double pivotTol; /** A variable have to be at least away from integrity to be generated */ double away; /** Total time limit for cut generation.*/ double timeLimit; /** Time limit for generating a single cut.*/ double singleCutTimeLimit; /** Weight to put in RHS of normalization if static.*/ double rhsWeight; ///@} /// @name Flags ///@{ /** Do we use tableau row or the disjunction (I don't really get that there should be a way to always use the tableau)*/ bool useTableauRow; /** Do we apply Egon Balas's Heuristic for modularized cuts */ bool modularize; /** Do we strengthen the final cut (always do if modularize is 1) */ bool strengthen; /** Wether to limit or not the number of mistaken RC (when perturbation is applied).*/ bool countMistakenRc; /** Work in the reduced space (only non-structurals enter the basis) */ SeparationSpaces sepSpace; /** Apply perturbation procedure. */ bool perturb; /** How to weight normalization.*/ Normalization normalization; /** How to weight RHS of normalization.*/ RhsWeightType rhsWeightType; /** How to weight LHS of normalization.*/ LHSnorm lhs_norm; /** Generate extra constraints from optimal lift-and-project basis.*/ ExtraCutsMode generateExtraCuts; /** Which rule to apply for choosing entering and leaving variables.*/ SelectionRules pivotSelection; ///@} }; /** Constructor for the class*/ CglLandP(const CglLandP::Parameters ¶ms = CglLandP::Parameters(), const LAP::Validator &validator = LAP::Validator()); /** Destructor */ ~CglLandP(); /** Copy constructor */ CglLandP(const CglLandP &source); /** Assignment operator */ CglLandP& operator=(const CglLandP &rhs); /** Clone function */ CglCutGenerator * clone() const; /**@name Generate Cuts */ //@{ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} virtual bool needsOptimalBasis() const { return true; } LAP::Validator & validator() { return validator_; } /** set level of log for cut generation procedure :
  1. for none
  2. for log at begin and end of procedure + at some time interval
  3. for log at every cut generated
*/ void setLogLevel(int level) { handler_->setLogLevel(level); } class NoBasisError : public CoinError { public: NoBasisError(): CoinError("No basis available","LandP","") {} }; class SimplexInterfaceError : public CoinError { public: SimplexInterfaceError(): CoinError("Invalid conversion to simplex interface", "CglLandP","CglLandP") {} }; Parameters & parameter() { return params_; } private: void scanExtraCuts(OsiCuts& cs, const double * colsol) const; Parameters params_; /** Some informations that will be changed by the pivots and that we want to keep*/ struct CachedData { CachedData(int nBasics = 0 , int nNonBasics = 0); CachedData(const CachedData & source); CachedData& operator=(const CachedData &source); /** Get the data from a problem */ void getData(const OsiSolverInterface &si); void clean(); ~CachedData(); /** Indices of basic variables in starting basis (ordered if variable basics_[i] s basic in row i)*/ int * basics_; /** Indices of non-basic variables */ int *nonBasics_; /** number of basics variables */ int nBasics_; /** number of non-basics */ int nNonBasics_; /** Optimal basis */ CoinWarmStartBasis * basis_; /** Stores the value of the solution to cut */ double * colsol_; /** Stores the values of the slacks */ double * slacks_; /** Stores wheter slacks are integer constrained */ bool * integers_; /** Solver before pivots */ OsiSolverInterface * solver_; }; /** Retrieve sorted integer variables which are fractional in the solution. Return the number of variables.*/ int getSortedFractionals(CoinPackedVector &xFrac, const CachedData & data, const CglLandP::Parameters& params) const; /** Retrieve sorted integer variables which are fractional in the solution. Return the number of variables.*/ void getSortedFractionalIndices(std::vector& indices, const CachedData &data, const CglLandP::Parameters & params) const; /** Cached informations about problem.*/ CachedData cached_; /** message handler */ CoinMessageHandler * handler_; /** messages */ CoinMessages messages_; /** cut validator */ LAP::Validator validator_; /** number of rows in the original problems. */ int numrows_; /** number of columns in the original problems. */ int numcols_; /** Original lower bounds for the problem (for lifting cuts).*/ double * originalColLower_; /** Original upper bounds for the problem (for lifting cuts).*/ double * originalColUpper_; /** Flag to say if cuts can be lifted.*/ bool canLift_; /** Store some extra cut which could be cheaply generated but do not cut current incumbent.*/ OsiCuts extraCuts_; }; void CglLandPUnitTest(OsiSolverInterface *si, const std::string & mpsDir); #endif Cgl-0.58.9/src/CglLandP/Makefile.am0000644000076600007660000000411412130104734015242 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 243 2006-06-01 20:11:02Z andreasw $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglLandP # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglLandP.la # List all source files for this library, including headers libCglLandP_la_SOURCES = \ CglLandPTabRow.hpp \ CglLandPUtils.cpp CglLandPUtils.hpp if COIN_HAS_OSICLP libCglLandP_la_SOURCES += \ CglLandP.cpp CglLandP.hpp \ CglLandPTabRow.cpp \ CglLandPMessages.h CglLandPMessages.cpp \ CglLandPSimplex.cpp CglLandPSimplex.hpp \ CglLandPValidator.cpp CglLandPValidator.hpp \ CglLandPTest.cpp endif # This is for libtool (on Windows) libCglLandP_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)/..` \ -I`$(CYGPATH_W) $(srcdir)/../CglGomory` \ $(COINUTILS_CFLAGS) $(OSI_CFLAGS) if COIN_HAS_OSICLP AM_CPPFLAGS += $(OSICLP_CFLAGS) endif # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 if COIN_HAS_OSICLP includecoin_HEADERS = CglLandP.hpp CglLandPValidator.hpp endif Cgl-0.58.9/src/CglLandP/CglLandPMessages.cpp0000644000076600007660000001027712130104734017035 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 21/07/05 // // $Id: CglLandPMessages.cpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #include "CglLandPMessages.hpp" #include #define REMOVE_LOG 0 namespace LAP { #ifdef LAP_ADD_MSG #error "Macro ADD_MSG already defined" #endif #define LAP_ADD_MSG(Id,Type,Level,MSG) addMessage(Id, CoinOneMessage( Type(Id), Level, MSG)) inline int std_m(int n) { return 1 + n; } inline int warn_m(int n) { return 3000 + n; } inline int err_m(int n) { return n + 6000; } LandPMessages::LandPMessages() : CoinMessages(DUMMY_END) { strcpy(source_,"Lap"); LAP_ADD_MSG(Separating,std_m,3+REMOVE_LOG,"Starting separation on variable %d, initial depth of cut %f"); LAP_ADD_MSG(FoundImprovingRow, std_m,4, "Found improving row (leaving variable). Row %d (basic var %d), " "leaving status %d, sign of gamma %d, reduced cost %f"); LAP_ADD_MSG(FoundBestImprovingCol, std_m, 4, " Found best improvement (entering variable). Var %d, " "value of gamma %f, expected depth of next cut %f"); LAP_ADD_MSG(WarnFailedBestImprovingCol, err_m, 3, "Failed to find an improving entering variable while reduced cost was %f, " "depth of current cut %f, best cut depth with pivot %f"); //Log line is cut number time pivot number, cut depth, leaving, incoming gamma degenerate LAP_ADD_MSG(LogHead, std_m, 3+REMOVE_LOG, "Pivot no \t cut depth \t leaving var \t incoming var \t direction \t gamma \t degenerate"); LAP_ADD_MSG(PivotLog, std_m, 3+REMOVE_LOG, "%8d\t %9f\t %11d \t %11d \t %11d \t %8f \t %12d \t %.5g \t %11d"); LAP_ADD_MSG(FinishedOptimal, std_m, 2, "Found optimal lift-and-project cut, depth %f number of pivots performed %d"); LAP_ADD_MSG(HitLimit, std_m, 2, "Stopping lift-and-project optimization hit %s limit. Number of pivots %d"); LAP_ADD_MSG(WarnBadSigmaComputation, err_m, 1, "Cut depth after pivot is not what was expected by computations before, difference %.15f"); LAP_ADD_MSG(WarnBadRowComputation, err_m, 1, "Row obtained after pivot is not what was expected (distance between the two %f in norm inf)."); LAP_ADD_MSG(WarnGiveUpRow, err_m,1,"Limit of %d negative reduced costs with no strict improvement"); LAP_ADD_MSG(PivotFailedSigmaUnchanged, err_m, 1, "A pivot failed to be performed (probably refactorization was performed) but sigma is unchanged continue..."); LAP_ADD_MSG(PivotFailedSigmaIncreased, err_m, 1,"A pivot failed to be performed, and sigma has changed exit without generating cut"); LAP_ADD_MSG(FailedSigmaIncreased, err_m,1,"Cut violation has increased in last pivot"); LAP_ADD_MSG (WarnBadRhsComputation, err_m,1, "rhs obtained after pivot is not what was expected (distance between the two %f)."); LAP_ADD_MSG(WarnFailedPivotTol, err_m, 2,"All pivots are below tolerance"); LAP_ADD_MSG(WarnFailedPivotIIf, err_m, 2,"There is no possible pivot within tolerance (every pivot make rhs for current row %f too close to integer feasibility"); LAP_ADD_MSG(NumberNegRc, std_m, 4, "Number of rows with negative reduced cost %i"); LAP_ADD_MSG(NumberZeroRc, std_m, 4, "Number of rows with zero reduced cost %i"); LAP_ADD_MSG(NumberPosRc, std_m, 4, "Number of rows with positive reduced cost %i"); LAP_ADD_MSG(WeightsStats, std_m, 2, "Maximal weight %g minimal weight %g"); LAP_ADD_MSG(RoundStats, std_m, 1, "Separated %i cuts with %i pivots, source entered %i times, %i sigma increases."); LAP_ADD_MSG(CutStat, std_m, 1, "Separated cut %i with %i pivots, source entered %i times, %i sigma increases, %i potential cycles.%g"); } } Cgl-0.58.9/src/CglLandP/CglLandPTabRow.cpp0000644000076600007660000000377712130104734016473 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // LIF // CNRS, Aix-Marseille Universites // Date: 02/23/08 // // $Id: CglLandPTabRow.cpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #include "CglLandPTabRow.hpp" #include "CglLandPSimplex.hpp" namespace LAP { void TabRow::print(std::ostream & os, int width, const int * nonBasics, int m) { os.width(3); os.precision(4); os.setf(std::ios_base::right, std::ios_base::adjustfield); os<<"idx: "; const double * dense = denseVector(); for (int j = 0 ; j < m ; j++) { os.width(width); os.setf(std::ios_base::right, std::ios_base::adjustfield); os< #include #include "CglConfig.h" #include "CglLandP.hpp" #include "OsiSolverInterface.hpp" #include "CoinMessage.hpp" #include "CoinMessageHandler.hpp" #include "CoinWarmStartBasis.hpp" #include "CoinPackedMatrix.hpp" #ifdef COIN_HAS_OSICLP #include "OsiClpSolverInterface.hpp" #endif #include "CglLandPTabRow.hpp" #include "CglLandPUtils.hpp" #include "CglLandPMessages.hpp" //#define APPEND_ROW #define OLD_COMPUTATION namespace LAP { /** Forward declaration of class to store extra debug data.*/ class DebugData; class CglLandPSimplex { public: /** Usefull onstructor */ CglLandPSimplex(const OsiSolverInterface &si, const CglLandP::CachedData &cached, const CglLandP::Parameters ¶ms, Validator &validator); /** Destructor */ ~CglLandPSimplex(); /**Update cached information in case of basis change in a round*/ void cacheUpdate(const CglLandP::CachedData &cached, bool reducedSpace = 0); /** reset the solver to optimal basis */ bool resetSolver(const CoinWarmStartBasis * basis); /** Perfom pivots to find the best cuts */ bool optimize(int var, OsiRowCut & cut, const CglLandP::CachedData &cached, const CglLandP::Parameters & params); /** Find Gomory cut (i.e. don't do extra setup required for pivots).*/ bool generateMig(int row, OsiRowCut &cut, const CglLandP::Parameters & params); /** Find extra constraints in current tableau.*/ int generateExtraCuts(const CglLandP::CachedData &cached, const CglLandP::Parameters & params); /** Generate a constrainte for a row of the tableau different from the source row.*/ int generateExtraCut(int i, const CglLandP::CachedData & cached, const CglLandP::Parameters& params); void genThisBasisMigs(const CglLandP::CachedData &cached, const CglLandP::Parameters & params) ; /** insert all extra cuts in cs.*/ int insertAllExtr(OsiCuts & cs, CoinRelFltEq eq); void setLogLevel(int level) { handler_->setLogLevel(level); } void setSi(OsiSolverInterface *si) { si_ = si; #ifdef COIN_HAS_OSICLP OsiClpSolverInterface * clpSi = dynamic_cast(si_); if (clpSi) { clp_ = clpSi; } #endif } void freeSi() { assert(si_ != NULL); delete si_; si_ = NULL; #ifdef COIN_HAS_OSICLP clp_ = NULL; #endif } Cuts& extraCuts() { return cuts_; } void loadBasis(const OsiSolverInterface &si, std::vector &M1, std::vector &M2, int k); int getNumCols() const { return ncols_; } int getNumRows() const { return nrows_; } const CoinWarmStartBasis * getBasis() const { return basis_; } const int * getNonBasics() const { return nonBasics_; } const int * getBasics() const { return basics_; } void outPivInfo(int ncuts) { handler_->message(RoundStats, messages_)<= ncols_ && lo_bounds_[original_index_[index]] < -1e-10 && up_bounds_[original_index_[index]] <= 1e-09); } /** Access to value in solution to cut (indexed in reduced problem) */ inline void setColsolToCut(int index, double value) { colsolToCut_[original_index_[index]] = value; } /** Get the basic status of a variable (structural or slack).*/ inline CoinWarmStartBasis::Status getStatus(int index) const { if (index < ncols_) return basis_->getStructStatus(index); return basis_->getArtifStatus(index - ncols_); } /** Say if variable index by i in current tableau is integer.*/ inline bool isInteger(int index) const { return integers_[original_index_[index]]; } /** Compute normalization weights.*/ void computeWeights(CglLandP::LHSnorm norm, CglLandP::Normalization type, CglLandP::RhsWeightType rhs); /** Evenutaly multiply a by w if normed_weights_ is not empty.*/ double normedCoef(double a, int ii) const { if (norm_weights_.empty()) { return a; } else { return a*norm_weights_[ii]; } } /** print the tableau of current basis. */ void printTableau(std::ostream & os); /** Print everything .*/ void printEverything(); /** print the tableau of current basis. */ void printTableauLateX(std::ostream & os); void printRowLateX(std::ostream & os, int i); void printCutLateX(std::ostream & os, int i); /** Print CGLP basis corresponding to current tableau and source row.*/ void printCglpBasis(std::ostream& os = std::cout); /** Put variables in M1 M2 and M3 according to their sign.*/ void get_M1_M2_M3(const TabRow & row, std::vector &M1, std::vector &M2, std::vector &M3); /** Put a vector in structural sapce.*/ void eliminate_slacks(double * vec) const; private: /// No default constructor CglLandPSimplex(); /// No copy constructor CglLandPSimplex(const CglLandPSimplex&); /// No assignment operator CglLandPSimplex& operator=(const CglLandPSimplex&); #ifdef COIN_HAS_OSICLP /** Pointer to OsiClpSolverInterface if used.*/ OsiClpSolverInterface * clp_; #endif /** Update values in M1 M2 and M3 before an iteration.*/ void updateM1_M2_M3(TabRow & row, double tolerance, bool alwaysComputeCheap); /** Remove rows from current tableau.*/ void removeRows(int nDelete, const int * rowsIdx); void compute_p_q_r_s(double gamma, int gammaSign, double &p, double & q, double & r , double &s); /// @name Work infos /// @{ /** Source row for cut */ TabRow row_k_; /** Original version of source row (without modularization).*/ TabRow original_row_k_; /** Row of leaving candidate*/ TabRow row_i_; #ifndef NDBEUG TabRow new_row_; #endif /**vector to sort the gammas*/ CoinPackedVector gammas_; /**first work vector in row space.*/ std::vector rWk1_; /**scond work vector in row space.*/ std::vector rWk2_; /**third work vector in row space.*/ std::vector rWk3_; /**fourth work vector in row space.*/ std::vector rWk4_; /** integer valued work vector on the rows */ std::vector rIntWork_; /** Flag rows which we don't want to try anymore */ bool * rowFlags_; /** Flag columns which are in the subspace (usualy remove nonbasic structurals in subspace) */ std::vector col_in_subspace; /** Flag columns which have to be considered for leaving the basis */ bool *colCandidateToLeave_; /** Store the basics variable */ int * basics_; /** Stores the nonBasicVariables */ int * nonBasics_; /** Stores the variables which are always in M1 for a given k*/ std::vector M1_; /** Stores the variables which are always in M2 for a given k*/ std::vector M2_; /** Stores the variables which could be either in M1 or M2 */ std::vector M3_; /** stores the cglp value of the normalized cut obtained from row k_ */ double sigma_; /** Keep track of basis status */ CoinWarmStartBasis * basis_; /** Pointer to the solution to cut (need to be modified after each pivot because we are only considering slacks).*/ double * colsolToCut_; /** Pointer to the current basic solution.*/ double * colsol_; /// cached numcols in original problem int ncols_orig_; ///cached numrows in original problem int nrows_orig_; /// cached number of columns in reduced size problem int ncols_; /// Cached number of rows in reduced size problem int nrows_; // for fast access to lower bounds (both cols and rows) std::vector lo_bounds_; // for fast access to upper bounds (both cols and rows) std::vector up_bounds_; /// Say if we are in a sequence of degenerate pivots bool inDegenerateSequence_; /// Value for the reduced cost chosen for pivoting double chosenReducedCostVal_; /// pointer to array of integer info for both structural and slacks const bool * integers_; /// Original index of variable before deletions. std::vector original_index_; /// Stores extra cuts which are generated along the procedure Cuts cuts_; /// @} /// @name Interfaces to the solver /// @{ /** Pointer to the solver interface */ OsiSolverInterface * si_; ///@} /// Own the data or not? bool own_; /// A pointer to a cut validator Validator & validator_; /// Weights for the normalization constraint std::vector norm_weights_; /// Weight for rhs of normalization constraint.*/ double rhs_weight_; /// number of rows with a <0 rc in current iteration int nNegativeRcRows_; /** Check that the basis is correct.*/ bool checkBasis(); /** Record the number of pivots.*/ int numPivots_; /** Record the number of times the source row entered the basis.*/ int numSourceRowEntered_; /** Record the number of times that sigma increased.*/ int numIncreased_; /** Message handler. */ CoinMessageHandler * handler_; /** Messages. */ CoinMessages messages_; #ifndef NDEBUG double bestSigma_; #endif protected: /** \name Slow versions of the function (old versions do not work).*/ /** @{ */ /** Compute the reduced cost of Cglp */ double computeCglpRedCost(int direction, int gammaSign, double tau); /** Compute the value of sigma and thau (which are constants for a row i as defined in Mike Perregaard thesis */ double computeRedCostConstantsInRow(); /** Compute the objective value of the Cglp with linear combintation of the two rows by gamma */ double computeCglpObjective(double gamma, bool strengthen, TabRow &row); /** Compute the objective value of the Cglp with linear combintation of the row_k_ and gamma row_i_ */ double computeCglpObjective(double gamma, bool strengthen); /** Find a row which can be used to perform an improving pivot return index of the cut or -1 if none exists * (i.e., find the leaving variable).*/ int findCutImprovingPivotRow( int &direction, int &gammaSign, double tolerance); /** Find the column which leads to the best cut (i.e., find incoming variable).*/ int findBestPivotColumn(int direction, double pivotTol, bool reducedSpace, bool allowDegeneratePivot, bool modularize); #if 1 int plotCGLPobj(int direction, double gammaTolerance, double pivotTol, bool reducedSpace, bool allowDegenerate, bool modularize); #endif /** @} */ }; /** return the coefficients of the strengthened intersection cut */ double CglLandPSimplex::strengthenedIntersectionCutCoef(int i, double alpha_i, double beta) const { // double ratio = beta/(1-beta); if ( (!integers_[i])) return intersectionCutCoef(alpha_i, beta); else { double f_i = alpha_i - floor(alpha_i); if (f_i < beta) return f_i*(1- beta); else return (1 - f_i)*beta;//(1-beta); } } /** return the coefficient of the new row (combining row_k + gamma row_i). */ double CglLandPSimplex::newRowCoefficient(int j, double gamma) const { return row_k_[j] + gamma * row_i_[j]; } } #endif Cgl-0.58.9/src/CglLandP/CglLandPValidator.cpp0000644000076600007660000002224212130104734017206 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 11/22/05 // // $Id: CglLandPValidator.cpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #include "CglLandPValidator.hpp" #include "CoinPackedMatrix.hpp" #include "OsiRowCut.hpp" #ifdef HAVE_CMATH # include #else # ifdef HAVE_MATH_H # include # endif #endif namespace LAP { std::vector Validator::rejections_; /** Clean an OsiCut \return 1 if min violation is too small \return 2 if small coefficient can not be removed \return 3 if dynamic is too big \return 4 if too many non zero element*/ int Validator::cleanCut(OsiRowCut & aCut, const double * solCut, const OsiSolverInterface &si, const CglParam& par, const double * origColLower, const double * origColUpper) { /** Compute fill-in in si */ int numcols = si.getNumCols(); const double * colLower = (origColLower) ? origColLower : si.getColLower(); const double * colUpper = (origColUpper) ? origColUpper : si.getColUpper(); int maxNnz = static_cast (maxFillIn_ * static_cast (numcols)); double rhs = aCut.lb(); assert (aCut.ub()> 1e50); CoinPackedVector *vec = const_cast(&aCut.row()); int * indices = vec->getIndices(); double * elems = vec->getElements(); int n = vec->getNumElements(); /** First compute violation if it is too small exit */ double violation = aCut.violated(solCut); if (violation < minViolation_) return 1; /** Now relax get dynamic and remove tiny elements */ int offset = 0; rhs -= 1e-8; double smallest = 1e100; double biggest = 0; for (int i = 0 ; i < n ; i++) { double val = fabs(elems[i]); if (val <= par.getEPS()) //try to remove coef { if (val>0 && val<1e-20) { offset++; continue; throw; } if (val==0) { offset++; continue; } int & iCol = indices[i]; if (elems[i]>0. && colUpper[iCol] < 10000.) { offset++; rhs -= elems[i] * colUpper[iCol]; elems[i]=0; } else if (elems[i]<0. && colLower[iCol] > -10000.) { offset++; rhs -= elems[i] * colLower[iCol]; elems[i]=0.; } else { #ifdef DEBUG std::cout<<"Small coefficient : "< maxRatio_ * smallest) { #ifdef DEBUG std::cout<<"Whaooo "< maxNnz) { numRejected_[DenseCut] ++; return DenseCut; } if (offset == n) { numRejected_[EmptyCut]++; return EmptyCut; } if (offset) vec->truncate(n - offset); indices = vec->getIndices(); elems = vec->getElements(); n = vec->getNumElements(); aCut.setLb(rhs); violation = aCut.violated(solCut); if (violation < minViolation_) { numRejected_[SmallViolation]++; return SmallViolation; } return NoneAccepted; } /**Clean cut 2, different algorithm. First check the dynamic of the cut if < maxRatio scale to a biggest coef of 1 otherwise scale it so that biggest coeff is 1 and try removing tinys ( < 1/maxRatio) either succeed or fail */ int Validator::cleanCut2(OsiRowCut & aCut, const double * solCut, const OsiSolverInterface &si, const CglParam &/* par */, const double * origColLower, const double * origColUpper) { /** Compute fill-in in si */ int numcols = si.getNumCols(); // int numrows = si.getNumRows(); const double * colLower = (origColLower) ? origColLower : si.getColLower(); const double * colUpper = (origColUpper) ? origColUpper : si.getColUpper(); int maxNnz = static_cast ( maxFillIn_ * static_cast (numcols)); double rhs = aCut.lb(); assert (aCut.ub()> 1e50); CoinPackedVector *vec = const_cast(&aCut.row()); // vec->sortIncrIndex(); int * indices = vec->getIndices(); double * elems = vec->getElements(); int n = vec->getNumElements(); if (n==0) { numRejected_[EmptyCut]++; return EmptyCut; } /** First compute violation if it is too small exit */ double violation = aCut.violated(solCut); if (violation < minViolation_) return 1; /** Now relax get dynamic and remove tiny elements */ int offset = 0; rhs -= 1e-10; double smallest = fabs(rhs); double biggest = smallest; double veryTiny = 1e-20; for (int i = 0 ; i < n ; i++) { double val = fabs(elems[i]); if (val > veryTiny) //tiny should be very very small { smallest = std::min(val,smallest); biggest = std::max (val,biggest); } } if (biggest > 1e9) { #ifdef DEBUG std::cout<<"Whaooo "< maxRatio_ * smallest) //we have to remove some small coefficients { double myTiny = biggest * toBeBiggest / maxRatio_; veryTiny *= toBeBiggest ; for (int i = 0 ; i < n ; i++) { double val = fabs(elems[i]); if (val < myTiny) { if (val< veryTiny) { offset++; continue; } int & iCol = indices[i]; if (elems[i]>0. && colUpper[iCol] < 1000.) { offset++; rhs -= elems[i] * colUpper[iCol]; elems[i]=0; } else if (elems[i]<0. && colLower[iCol] > -1000.) { offset++; rhs -= elems[i] * colLower[iCol]; elems[i]=0.; } else { numRejected_[SmallCoefficient]++; return SmallCoefficient; } } else //Not a small coefficient keep it { if (offset) //if offset is zero current values are ok { int i2 = i - offset; indices[i2] = indices[i]; elems[i2] = elems[i]; } } } } if ((n - offset) > maxNnz) { numRejected_[DenseCut] ++; return DenseCut; } if (offset) vec->truncate(n - offset); if (vec->getNumElements() == 0 ) { numRejected_[EmptyCut]++; return EmptyCut; } /** recheck violation */ aCut.setLb(rhs); violation = aCut.violated(solCut); if (violation < minViolation_) { numRejected_[SmallViolation]++; return SmallViolation; } assert(fabs(rhs)<1e09); return NoneAccepted; } /** Constructor with default values */ Validator::Validator(double maxFillIn, double maxRatio, double minViolation, bool scale, double rhsScale): maxFillIn_(maxFillIn), maxRatio_(maxRatio), minViolation_(minViolation), scale_(scale), rhsScale_(rhsScale), numRejected_(DummyEnd,0) { fillRejectionReasons(); } void Validator::fillRejectionReasons() { if (rejections_.size() == 0) { rejections_.resize(DummyEnd) ; rejections_[NoneAccepted] = "Cut was accepted"; rejections_[SmallViolation] = "Violation of the cut is too small "; rejections_[SmallCoefficient] = "There is a small coefficient we can not get rid off."; rejections_[BigDynamic] = "Dynamic of coefficinet is too important. "; rejections_[DenseCut] = "Cut is too dense."; rejections_[EmptyCut] = "Cleaned cut is empty"; } } } /* Ends namespace LAP.*/ Cgl-0.58.9/src/CglLandP/CglLandP.cpp0000644000076600007660000005403712130104734015347 0ustar coincoin// Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved. // Author: Pierre Bonami // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 07/21/05 // // $Id: CglLandP.cpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //--------------------------------------------------------------------------- #include "CglLandP.hpp" #include "CglLandPSimplex.hpp" #define INT_INFEAS(value) fabs(value - floor(value+0.5)) #include "CglConfig.h" #ifdef COIN_HAS_OSICLP #include "OsiClpSolverInterface.hpp" #endif #define CLONE_SI //Solver is cloned between two cuts #include "CoinTime.hpp" #include "CglGomory.hpp" #include "CoinFactorization.hpp" #include namespace LAP { //Setup output messages LapMessages::LapMessages( ) :CoinMessages(LAP_MESSAGES_DUMMY_END) { strcpy(source_,"Lap"); addMessage(BEGIN_ROUND,CoinOneMessage( 1, 2,"Starting %s round %d variable considered for separation.")); addMessage(END_ROUND,CoinOneMessage(2, 2,"End ouf %s round %d cut generated in %g seconds.")); addMessage(DURING_SEP,CoinOneMessage(3,1,"After %g seconds, separated %d cuts.")); addMessage(CUT_REJECTED, CoinOneMessage(4,1,"Cut rejected for %s.")); addMessage(CUT_FAILED,CoinOneMessage(5,1,"Generation failed.")); addMessage(CUT_GAP, CoinOneMessage(7,1,"CUTGAP after %i pass objective is %g")); addMessage(LAP_CUT_FAILED_DO_MIG, CoinOneMessage(3006,1,"Failed to generate a cut generate a Gomory cut instead")); } } using namespace LAP; CglLandP::Parameters::Parameters(): CglParam(), pivotLimit(20), pivotLimitInTree(10), maxCutPerRound(5000), failedPivotLimit(1), degeneratePivotLimit(0), extraCutsLimit(5), pivotTol(1e-4), away(5e-4), timeLimit(COIN_DBL_MAX), singleCutTimeLimit(COIN_DBL_MAX), rhsWeight(1.), useTableauRow(true), modularize(false), strengthen(true), countMistakenRc(false), sepSpace(Fractional), perturb(true), normalization(Unweighted), rhsWeightType(Fixed), lhs_norm(L1), generateExtraCuts(none), pivotSelection(mostNegativeRc) { EPS = 1e-08; } CglLandP::Parameters::Parameters(const Parameters &other): CglParam(other), pivotLimit(other.pivotLimit), pivotLimitInTree(other.pivotLimitInTree), maxCutPerRound(other.maxCutPerRound), failedPivotLimit(other.failedPivotLimit), degeneratePivotLimit(other.degeneratePivotLimit), extraCutsLimit(other.extraCutsLimit), pivotTol(other.pivotTol), away(other.away), timeLimit(other.timeLimit), singleCutTimeLimit(other.singleCutTimeLimit), rhsWeight(other.rhsWeight), useTableauRow(other.useTableauRow), modularize(other.modularize), strengthen(other.strengthen), countMistakenRc(other.countMistakenRc), sepSpace(other.sepSpace), perturb(other.perturb), normalization(other.normalization), rhsWeightType(other.rhsWeightType), lhs_norm(other.lhs_norm), generateExtraCuts(other.generateExtraCuts), pivotSelection(other.pivotSelection) {} CglLandP::Parameters & CglLandP::Parameters::operator=(const Parameters &other) { if (this != &other) { CglParam::operator=(other); pivotLimit = other.pivotLimit; pivotLimitInTree = other.pivotLimitInTree; maxCutPerRound = other.maxCutPerRound; failedPivotLimit = other.failedPivotLimit; degeneratePivotLimit = other.failedPivotLimit; extraCutsLimit = other.extraCutsLimit; pivotTol = other.pivotTol; away = other.away; timeLimit = other.timeLimit; singleCutTimeLimit = other.singleCutTimeLimit; rhsWeight = other.rhsWeight; useTableauRow = other.useTableauRow; modularize = other.modularize; strengthen = other.strengthen; countMistakenRc = other.countMistakenRc; sepSpace = other.sepSpace; perturb = other.perturb; normalization = other.normalization; rhsWeightType = other.rhsWeightType; lhs_norm = other.lhs_norm; generateExtraCuts = other.generateExtraCuts; pivotSelection = other.pivotSelection; } return *this; } CglLandP::CachedData::CachedData(int nBasics, int nNonBasics): basics_(NULL), nonBasics_(NULL), nBasics_(nBasics), nNonBasics_(nNonBasics), basis_(NULL), colsol_(NULL), slacks_(NULL), integers_(NULL), solver_(NULL) { if (nBasics_>0) { basics_ = new int[nBasics_]; integers_ = new bool [nNonBasics_ + nBasics_]; } if (nNonBasics_>0) nonBasics_ = new int[nNonBasics_]; if (nBasics_ + nNonBasics_ > 0) { colsol_ = new double[nBasics_ + nNonBasics_]; slacks_ = &colsol_[nNonBasics_]; } } CglLandP::CachedData::CachedData(const CachedData &source): basics_(NULL), nonBasics_(NULL), nBasics_(source.nBasics_), nNonBasics_(source.nNonBasics_), basis_(NULL), colsol_(NULL), slacks_(NULL), integers_(NULL), solver_(NULL) { if (nBasics_>0) { basics_ = new int[nBasics_]; CoinCopyN(source.basics_, nBasics_, basics_); integers_ = new bool [nNonBasics_ + nBasics_]; CoinCopyN(source.integers_, nBasics_ + nNonBasics_, integers_); } if (nNonBasics_>0) { nonBasics_ = new int[nNonBasics_]; CoinCopyN(source.nonBasics_, nBasics_, nonBasics_); } if (nBasics_ + nNonBasics_ > 0) { colsol_ = new double[nBasics_ + nNonBasics_]; slacks_ = &colsol_[nNonBasics_]; CoinCopyN(source.colsol_, nBasics_ + nNonBasics_, colsol_); } if (source.basis_!=NULL) basis_ = new CoinWarmStartBasis(*source.basis_); if (source.solver_!=NULL) solver_ = source.solver_->clone(); } CglLandP::CachedData& CglLandP::CachedData::operator=(const CachedData &source) { if (this != &source) { nBasics_ = source.nBasics_; nNonBasics_ = source.nNonBasics_; if (basics_ == NULL) delete [] basics_; basics_ = NULL; if (nonBasics_ == NULL) delete [] nonBasics_; nonBasics_ = NULL; if (basis_ == NULL) delete [] basis_; basis_ = NULL; if (colsol_ == NULL) delete [] colsol_; colsol_ = NULL; if (slacks_ == NULL) delete [] slacks_; slacks_ = NULL; if (integers_ == NULL) delete [] integers_; integers_ = NULL; if (nBasics_>0) { basics_ = new int[nBasics_]; CoinCopyN(source.basics_, nBasics_, basics_); integers_ = new bool [nBasics_ + nNonBasics_]; CoinCopyN(source.integers_, nBasics_ + nNonBasics_, integers_); } if (nNonBasics_>0) { nonBasics_ = new int[nNonBasics_]; CoinCopyN(source.nonBasics_, nBasics_, nonBasics_); } if (nBasics_ + nNonBasics_ > 0) { colsol_ = new double[nBasics_ + nNonBasics_]; slacks_ = &colsol_[nNonBasics_]; CoinCopyN(source.colsol_, nBasics_ + nNonBasics_, colsol_); } if (source.basis_!=NULL) basis_ = new CoinWarmStartBasis(*source.basis_); delete solver_; if (source.solver_) solver_ = source.solver_->clone(); } return *this; } void CglLandP::CachedData::getData(const OsiSolverInterface &si) { int nBasics = si.getNumRows(); int nNonBasics = si.getNumCols(); if (basis_ != NULL) delete basis_; basis_ = dynamic_cast (si.getWarmStart()); if (!basis_) throw NoBasisError(); if (nBasics_ > 0 || nBasics != nBasics_) { delete [] basics_; basics_ = NULL; } if (basics_ == NULL) { basics_ = new int[nBasics]; nBasics_ = nBasics; } if (nNonBasics_ > 0 || nNonBasics != nNonBasics_) { delete [] nonBasics_; nonBasics_ = NULL; } if (nonBasics_ == NULL) { nonBasics_ = new int[nNonBasics]; nNonBasics_ = nNonBasics; } int n = nBasics + nNonBasics; if ( nBasics_ + nNonBasics_ > 0 || nBasics_ + nNonBasics_ != n) { delete [] colsol_; delete [] integers_; integers_ = NULL; colsol_ = NULL; slacks_ = NULL; } if (colsol_ == NULL) { colsol_ = new double[n]; slacks_ = &colsol_[nNonBasics]; } if (integers_ == NULL) { integers_ = new bool[n]; } const double * rowLower = si.getRowLower(); const double * rowUpper = si.getRowUpper(); //determine which slacks are integer const CoinPackedMatrix * m = si.getMatrixByCol(); const double * elems = m->getElements(); const int * inds = m->getIndices(); const CoinBigIndex * starts = m->getVectorStarts(); const int * lengths = m->getVectorLengths(); // int numElems = m->getNumElements(); int numCols = m->getNumCols(); assert(numCols == nNonBasics_); // int numRows = m->getNumRows(); CoinFillN(integers_ ,n, true); for (int i = 0 ; i < numCols ; i++) { if (si.isContinuous(i)) integers_[i] = false; } bool * integerSlacks = integers_ + numCols; for (int i = 0 ; i < nBasics ; i++) { if (rowLower[i] > -1e50 && INT_INFEAS(rowLower[i]) > 1e-15) integerSlacks[i] = false; if (rowUpper[i] < 1e50 && INT_INFEAS(rowUpper[i]) > 1e-15) integerSlacks[i] = false; } for (int i = 0 ; i < numCols ; i++) { CoinBigIndex end = starts[i] + lengths[i]; if (integers_[i]) { for (CoinBigIndex k=starts[i] ; k < end; k++) { if (integerSlacks[inds[k]] && INT_INFEAS(elems[k])>1e-15 ) integerSlacks[inds[k]] = false; } } else { for (CoinBigIndex k=starts[i] ; k < end; k++) { if (integerSlacks[inds[k]]) integerSlacks[inds[k]] = false; } } } CoinCopyN(si.getColSolution(), si.getNumCols(), colsol_); CoinCopyN(si.getRowActivity(), si.getNumRows(), slacks_); for (int i = 0 ; i < si.getNumRows() ; i++) { slacks_[i]*=-1; if (rowLower[i]>-1e50) { slacks_[i] += rowLower[i]; } else { slacks_[i] += rowUpper[i]; } } //Now get the fill the arrays; nNonBasics = 0; nBasics = 0; //For having the index variables correctly ordered we need to access to OsiSimplexInterface { OsiSolverInterface * ncSi = (const_cast(&si)); ncSi->enableSimplexInterface(0); ncSi->getBasics(basics_); // Save enabled solver solver_ = si.clone(); #ifdef COIN_HAS_OSICLP OsiClpSolverInterface * clpSi = dynamic_cast(solver_); const OsiClpSolverInterface * clpSiRhs = dynamic_cast(&si); if (clpSi) clpSi->getModelPtr()->copyEnabledStuff(clpSiRhs->getModelPtr());; #endif ncSi->disableSimplexInterface(); } int numStructural = basis_->getNumStructural(); for (int i = 0 ; i < numStructural ; i++) { if (basis_->getStructStatus(i)== CoinWarmStartBasis::basic) { nBasics++; //Basically do nothing } else { nonBasics_[nNonBasics++] = i; } } int numArtificial = basis_->getNumArtificial(); for (int i = 0 ; i < numArtificial ; i++) { if (basis_->getArtifStatus(i)== CoinWarmStartBasis::basic) { //Just check number of basics nBasics++; } else { nonBasics_[nNonBasics++] = i + basis_->getNumStructural(); } } } void CglLandP::CachedData::clean(){ if (basics_!=NULL) delete [] basics_; basics_ = NULL; if (nonBasics_!=NULL) delete [] nonBasics_; nonBasics_ = NULL; if (colsol_ != NULL) delete [] colsol_; colsol_ = NULL; delete basis_; basis_ = NULL; if (integers_) delete [] integers_; integers_ = NULL; nBasics_ = 0; nNonBasics_ = 0; delete solver_; solver_ = NULL; } CglLandP::CachedData::~CachedData() { if (basics_!=NULL) delete [] basics_; if (nonBasics_!=NULL) delete [] nonBasics_; if (colsol_ != NULL) delete [] colsol_; delete basis_; if (integers_) delete [] integers_; delete solver_; } CglLandP::CglLandP(const CglLandP::Parameters ¶ms, const LAP::Validator &validator): params_(params), cached_(), validator_(validator), numcols_(-1), originalColLower_(NULL), originalColUpper_(NULL), canLift_(false), extraCuts_() { handler_ = new CoinMessageHandler(); handler_->setLogLevel(0); messages_ = LapMessages(); } CglLandP::~CglLandP() { delete handler_; if (originalColLower_ != NULL) delete [] originalColLower_; if (originalColUpper_ != NULL) delete [] originalColUpper_; } CglLandP::CglLandP(const CglLandP & source): CglCutGenerator(source), params_(source.params_), cached_(source.cached_), validator_(source.validator_), numcols_(source.numcols_), originalColLower_(NULL), originalColUpper_(NULL), canLift_(source.canLift_), extraCuts_(source.extraCuts_) { handler_ = new CoinMessageHandler(); handler_->setLogLevel(source.handler_->logLevel()); messages_ = LapMessages(); if (numcols_ != -1) { assert(numcols_ > 0); assert(originalColLower_!=NULL); assert(originalColUpper_!=NULL); originalColLower_ = new double[numcols_]; originalColUpper_ = new double[numcols_]; CoinCopyN(source.originalColLower_,numcols_,originalColLower_); CoinCopyN(source.originalColUpper_,numcols_,originalColUpper_); } } /** Assignment operator */ CglLandP& CglLandP::operator=(const CglLandP &rhs) { if (this != &rhs) { params_ = rhs.params_; cached_ = rhs.cached_; validator_ = rhs.validator_; extraCuts_ = rhs.extraCuts_; } return *this; } CglCutGenerator * CglLandP::clone() const { return new CglLandP(*this); } extern double restaurationTime; struct cutsCos { int i; int j; double angle; cutsCos(int i_, int j_ , double angle_):i(i_), j(j_), angle(angle_) { } bool operator<(const cutsCos&other)const { return angle > other.angle; } }; void CglLandP::scanExtraCuts(OsiCuts& cs, const double * colsol) const { int numAdded = 0; for (int i = extraCuts_.sizeRowCuts() - 1; i > -1 ; i--) { double violation = extraCuts_.rowCut(i).violated(colsol); if (violation > 0.) { cs.insert(extraCuts_.rowCut(i)); numAdded++; // std::cout<<"A cut computed in a previous iteration is violated by "<message(CUT_GAP, messages_)<addCol(CoinPackedVector(), 0, 1, 0); t_si->setInteger(new_idx); t_si->addRow(v,0, 0); t_si->resolve(); } #else const OsiSolverInterface * t_si = &si; #endif cached_.getData(*t_si); CglLandPSimplex landpSi(*t_si, cached_, params, validator_); if (params.generateExtraCuts == CglLandP::AllViolatedMigs) { landpSi.genThisBasisMigs(cached_, params); } landpSi.setLogLevel(handler_->logLevel()); int nCut = 0; std::vector indices; getSortedFractionalIndices(indices,cached_, params); #ifndef NDEBUG int numrows = si.getNumRows(); #endif #ifdef DO_STAT //Get informations on current optimum { OsiSolverInterface * gapTester = si.clone(); gapTester->resolve(); roundsStats_.analyseOptimalBasis(gapTester,info.pass, numrows_); delete gapTester; } #endif params_.timeLimit += CoinCpuTime(); CoinRelFltEq eq(1e-04); for (unsigned int i = 0; i < indices.size() && nCut < params.maxCutPerRound && nCut < cached_.nBasics_ ; i++) { //Check for time limit int iRow = indices[i]; assert(iRow < numrows); OsiRowCut cut; int code=1; OsiSolverInterface * ncSi = NULL; if (params.pivotLimit != 0) { ncSi = t_si->clone(); landpSi.setSi(ncSi); ncSi->setDblParam(OsiDualObjectiveLimit, COIN_DBL_MAX); ncSi->messageHandler()->setLogLevel(0); } int generated = 0; if (params.pivotLimit == 0) { generated = landpSi.generateMig(iRow, cut, params); } else { generated = landpSi.optimize(iRow, cut, cached_, params); if (params.generateExtraCuts == CglLandP::AllViolatedMigs) { landpSi.genThisBasisMigs(cached_, params); } landpSi.resetSolver(cached_.basis_); } code = 0; if (generated) code = validator_(cut, cached_.colsol_, si, params, originalColLower_, originalColUpper_); if (!generated || code) { if (params.pivotLimit !=0) { handler_->message(LAP_CUT_FAILED_DO_MIG, messages_)<clone(); landpSi.setSi(ncSi); params.pivotLimit = 0; if (landpSi.optimize(iRow, cut, cached_, params)) { code = validator_(cut, cached_.colsol_, si, params, originalColLower_, originalColUpper_); } params.pivotLimit = params_.pivotLimit; } } if (params.pivotLimit != 0) { landpSi.freeSi(); } if (code) { handler_->message(CUT_REJECTED, messages_)<< validator_.failureString(code)<message(LAP_CUT_FAILED_DO_MIG, messages_) < class StableCompare { public: inline bool operator()(const CoinTriple& t1, const CoinTriple& t2) const { return (t1.third < t2.third) || ((t1.third == t2.third) && (t1.second < t2.second)); } }; template struct StableExternalComp { const std::vector &vec_1_; const std::vector &vec_2_; StableExternalComp(const std::vector &vec_1, const std::vector &vec_2): vec_1_(vec_1), vec_2_(vec_2) { } CoinRelFltEq eq; bool operator()(int i, int j) { bool result = (vec_1_[i] < vec_1_[j]) || ( ((vec_1_[i]== vec_1_[j])) && (vec_2_[i] < vec_2_[j])); return result; } }; void CglLandP::getSortedFractionalIndices(std::vector &frac_indices, const CachedData &data, const CglLandP::Parameters & params) const { std::vector colIndices; std::vector values; std::vector indices; for (int i = 0 ; i < data.nBasics_ ; i++) { const int& iCol = data.basics_[i]; if (iCol >= data.nNonBasics_ || !data.integers_[iCol] || INT_INFEAS(data.colsol_[iCol]) <= params.away) continue; const double value = INT_INFEAS(data.colsol_[iCol]); frac_indices.push_back(i); indices.push_back(static_cast(values.size())); values.push_back(- value); colIndices.push_back(iCol); } std::sort(indices.begin(), indices.end(),StableExternalComp(values,colIndices)); colIndices = frac_indices; for (unsigned int i = 0; i < indices.size() ; i++) { frac_indices[i] = colIndices[indices[i]]; } } Cgl-0.58.9/src/CglAllDifferent/0000755000076600007660000000000012377555671014576 5ustar coincoinCgl-0.58.9/src/CglAllDifferent/Makefile.am0000644000076600007660000000321611621724114016611 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglAllDifferent # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglAllDifferent.la # List all source files for this library, including headers libCglAllDifferent_la_SOURCES = CglAllDifferent.cpp CglAllDifferent.hpp # This is for libtool (on Windows) libCglAllDifferent_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglAllDifferent.hpp Cgl-0.58.9/src/CglAllDifferent/CglAllDifferent.hpp0000644000076600007660000000552512130104734020254 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 CglAllDifferent_H #define CglAllDifferent_H #include #include "CglCutGenerator.hpp" /** AllDifferent Cut Generator Class This has a number of sets. All the members in each set are general integer variables which have to be different from all others in the set. At present this only generates column cuts At present it is very primitive compared to proper CSP implementations */ class CglAllDifferent : public CglCutGenerator { public: /**@name Generate Cuts */ //@{ /** This fixes (or reduces bounds) on sets of all different variables */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglAllDifferent (); /// Useful constructot CglAllDifferent(int numberSets, const int * starts, const int * which); /// Copy constructor CglAllDifferent ( const CglAllDifferent &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglAllDifferent & operator=( const CglAllDifferent& rhs); /// Destructor virtual ~CglAllDifferent (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); /// This can be used to refresh any inforamtion virtual void refreshSolver(OsiSolverInterface * solver); /** Returns true if may generate Row cuts in tree (rather than root node). Used so know if matrix will change in tree. Really meant so column cut generators can still be active without worrying code. Default is true */ virtual bool mayGenerateRowCutsInTree() const { return false;} //@} /**@name Sets and Gets */ //@{ /// Set log level inline void setLogLevel(int value) { logLevel_=value;} /// Get log level inline int getLogLevel() const { return logLevel_;} /// Set Maximum number of sets to look at at once inline void setMaxLook(int value) { maxLook_=value;} /// Get Maximum number of sets to look at at once inline int getMaxLook() const { return maxLook_;} //@} private: // Private member methods /**@name */ //@{ //@} // Private member data /**@name Private member data */ //@{ /// Number of sets int numberSets_; /// Total number of variables in all different sets int numberDifferent_; /// Maximum number of sets to look at at once int maxLook_; /// Log level - 0 none, 1 - a bit, 2 - more details int logLevel_; /// Start of each set int * start_; /// Members (0,1,....) not as in original model int * which_; /// Original members int * originalWhich_; //@} }; #endif Cgl-0.58.9/src/CglAllDifferent/Makefile.in0000644000076600007660000005400712240340055016622 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/CglAllDifferent 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglAllDifferent_la_LIBADD = am_libCglAllDifferent_la_OBJECTS = CglAllDifferent.lo libCglAllDifferent_la_OBJECTS = $(am_libCglAllDifferent_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 = $(libCglAllDifferent_la_SOURCES) DIST_SOURCES = $(libCglAllDifferent_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglAllDifferent # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglAllDifferent.la # List all source files for this library, including headers libCglAllDifferent_la_SOURCES = CglAllDifferent.cpp CglAllDifferent.hpp # This is for libtool (on Windows) libCglAllDifferent_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglAllDifferent.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/CglAllDifferent/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglAllDifferent/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglAllDifferent.la: $(libCglAllDifferent_la_OBJECTS) $(libCglAllDifferent_la_DEPENDENCIES) $(CXXLINK) $(libCglAllDifferent_la_LDFLAGS) $(libCglAllDifferent_la_OBJECTS) $(libCglAllDifferent_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglAllDifferent.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglAllDifferent/CglAllDifferent.cpp0000644000076600007660000004005312130104734020242 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). #include #include #include #include #include #include //#define PRINT_DEBUG //#define CGL_DEBUG 1 //#undef NDEBUG #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinFinite.hpp" #include "OsiRowCutDebugger.hpp" #include "CglAllDifferent.hpp" #ifdef CGL_DEBUG // A declaration is required somewhere, eh? I'm assuming static so the value // carries over between calls to generateCuts. namespace { int nPath = 0 ; } #endif //------------------------------------------------------------------- // Generate cuts //------------------------------------------------------------------- void CglAllDifferent::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo ) { #ifndef NDEBUG int nCols=si.getNumCols(); #endif int i; const double * lower = si.getColLower(); const double * upper = si.getColUpper(); #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&debugger->onOptimalPath(si)) { printf("On optimal path %d\n",nPath); nPath++; int nCols=si.getNumCols(); const double * solution = si.getColSolution(); const double * optimal = debugger->optimalSolution(); const double * objective = si.getObjCoefficients(); double objval1=0.0,objval2=0.0; for (i=0;i1 printf("%d %g %g %g %g\n",i,lower[i],solution[i],upper[i],optimal[i]); #endif objval1 += solution[i]*objective[i]; objval2 += optimal[i]*objective[i]; assert(optimal[i]>=lower[i]&&optimal[i]<=upper[i]); } printf("current obj %g, integer %g\n",objval1,objval2); } #endif int * lo = new int[numberDifferent_]; int * up = new int[numberDifferent_]; for (i=0;i (lower[iColumn]); assert (floor(lower[iColumn]+0.5)==lower[iColumn]); up[i] = static_cast (upper[iColumn]); assert (floor(upper[iColumn]+0.5)==upper[iColumn]); assert (up[i]>=lo[i]); } // We are going to assume we can just have one big 2d array! // Could save by going to bits // also could skip sets where all are fixed // could do some of above by separate first pass // once a variable fixed - can take out of list // so need to redo complete stuff (including temp which_) every big pass int offset = COIN_INT_MAX; int maxValue = -COIN_INT_MAX; int numberLook=0; // copies //int * which = new int [numberTotal]; //int * start = new int [numberSets_+1]; for (i=0;i (gap) * numberDifferent_; if (size>1.0e7) { if (logLevel_) printf("Only looking at %d sets\n",numberLook); break; } } // Which sets a variable is in int * back = new int [start_[numberSets_]]; int * backStart = new int[numberDifferent_+1]; memset(backStart,0,(numberDifferent_+1)*sizeof(int)); int numberTotal = start_[numberLook]; for (i=0;i=0) { if (check[alreadyFixed[k]]==0) { check[alreadyFixed[k]]=1; continue; } else { // infeasible infeasible=true; i=numberLook; break; } } char * allowed = possible + k*gap; int n=0; for (int jj=0;jj= 0 kLook=0; for (j=kLook;jfixed) finished=false; // try again } // Could try two sets if (infeasible) { // create infeasible cut OsiRowCut rc; rc.setLb(COIN_DBL_MAX); rc.setUb(0.0); cs.insert(rc); } else { // check to see if can tighten bounds CoinPackedVector lbs; CoinPackedVector ubs; int nTightened=0; for (i=0;ilo[i]) { lbs.insert(iColumn,static_cast (firstLo+offset)); nTightened++; } if (lastUp+offset (lastUp+offset)); nTightened++; } } if (nTightened) { OsiColCut cc; cc.setUbs(ubs); cc.setLbs(lbs); cc.setEffectiveness(100.0); cs.insert(cc); } } //delete [] which; //delete [] start; delete [] first; delete [] stack; delete [] bitmap; delete [] check; delete [] alreadyFixed; delete [] back; delete [] backStart; delete [] possible; delete [] lo; delete [] up; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglAllDifferent::CglAllDifferent () : CglCutGenerator(), numberSets_(0), numberDifferent_(0), maxLook_(2), logLevel_(0), start_(NULL), which_(NULL), originalWhich_(NULL) { } //------------------------------------------------------------------- // Useful Constructor //------------------------------------------------------------------- CglAllDifferent::CglAllDifferent (int numberSets, const int * starts, const int * which) : CglCutGenerator(), numberSets_(numberSets), maxLook_(2), logLevel_(0), start_(NULL), which_(NULL), originalWhich_(NULL) { if (numberSets_>0) { int n = starts[numberSets_]; start_ = CoinCopyOfArray(starts,numberSets_+1); originalWhich_ = CoinCopyOfArray(which,n); which_ = new int[n]; int i; int maxValue=-1; for (i=0;i=0); maxValue = CoinMax(iColumn,maxValue); } maxValue++; int * translate = new int[maxValue]; for (i=0;i=0); which_[i]=iColumn; } delete [] translate; } } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglAllDifferent::CglAllDifferent ( const CglAllDifferent & rhs) : CglCutGenerator(rhs), numberSets_(rhs.numberSets_), numberDifferent_(rhs.numberDifferent_), maxLook_(rhs.maxLook_), logLevel_(rhs.logLevel_) { if (numberSets_) { int n = rhs.start_[numberSets_]; start_ = CoinCopyOfArray(rhs.start_,numberSets_+1); which_ = CoinCopyOfArray(rhs.which_,n); originalWhich_ = CoinCopyOfArray(rhs.originalWhich_,n); } else { start_=NULL; which_=NULL; originalWhich_=NULL; } } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglAllDifferent::clone() const { return new CglAllDifferent(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglAllDifferent::~CglAllDifferent () { // free memory delete [] start_; delete [] which_; delete [] originalWhich_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglAllDifferent & CglAllDifferent::operator=( const CglAllDifferent& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); // free memory delete [] start_; delete [] which_; delete [] originalWhich_; numberSets_ = rhs.numberSets_; numberDifferent_ = rhs.numberDifferent_; maxLook_ = rhs.maxLook_; logLevel_ = rhs.logLevel_; if (numberSets_) { int n = rhs.start_[numberSets_]; start_ = CoinCopyOfArray(rhs.start_,numberSets_+1); which_ = CoinCopyOfArray(rhs.which_,n); originalWhich_ = CoinCopyOfArray(rhs.originalWhich_,n); } else { start_=NULL; which_=NULL; originalWhich_=NULL; } } return *this; } /// This can be used to refresh any inforamtion void CglAllDifferent::refreshSolver(OsiSolverInterface * ) { } // Create C++ lines to get to current state std::string CglAllDifferent::generateCpp( FILE * fp) { CglAllDifferent other; fprintf(fp,"0#include \"CglAllDifferent.hpp\"\n"); fprintf(fp,"3 CglAllDifferent allDifferent;\n"); if (logLevel_!=other.logLevel_) fprintf(fp,"3 allDifferent.setLogLevel(%d);\n",logLevel_); else fprintf(fp,"4 allDifferent.setLogLevel(%d);\n",logLevel_); if (maxLook_!=other.maxLook_) fprintf(fp,"3 allDifferent.setMaxLook(%d);\n",maxLook_); else fprintf(fp,"4 allDifferent.setMaxLook(%d);\n",maxLook_); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 allDifferent.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 allDifferent.setAggressiveness(%d);\n",getAggressiveness()); return "allDifferent"; } Cgl-0.58.9/src/CglTreeInfo.cpp0000644000076600007660000014013312130104734014431 0ustar coincoin// $Id: CglTreeInfo.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 "CoinPragma.hpp" #include "CglTreeInfo.hpp" #include "CoinHelperFunctions.hpp" #include "CoinSort.hpp" #include "CoinPackedMatrix.hpp" #include "CglStored.hpp" #include "OsiRowCut.hpp" // Default constructor CglTreeInfo::CglTreeInfo () : level(-1), pass(-1), formulation_rows(-1), options(0), inTree(false), strengthenRow(NULL),randomNumberGenerator(NULL) {} // Copy constructor CglTreeInfo::CglTreeInfo (const CglTreeInfo & rhs) : level(rhs.level), pass(rhs.pass), formulation_rows(rhs.formulation_rows), options(rhs.options), inTree(rhs.inTree), strengthenRow(rhs.strengthenRow), randomNumberGenerator(rhs.randomNumberGenerator) { } // Clone CglTreeInfo * CglTreeInfo::clone() const { return new CglTreeInfo(*this); } // Assignment operator CglTreeInfo & CglTreeInfo::operator=(const CglTreeInfo& rhs) { if (this != &rhs) { //CglCutGenerator::operator=(rhs); level = rhs.level; pass = rhs.pass; formulation_rows = rhs.formulation_rows; options = rhs.options; inTree = rhs.inTree; strengthenRow = rhs.strengthenRow; randomNumberGenerator = rhs.randomNumberGenerator; } return *this; } // Destructor CglTreeInfo::~CglTreeInfo () { } // Default constructor CglTreeProbingInfo::CglTreeProbingInfo () : CglTreeInfo(), fixEntry_(NULL), toZero_(NULL), toOne_(NULL), integerVariable_(NULL), backward_(NULL), fixingEntry_(NULL), numberVariables_(0), numberIntegers_(0), maximumEntries_(0), numberEntries_(-1) { } // Constructor from model CglTreeProbingInfo::CglTreeProbingInfo (const OsiSolverInterface * model) : CglTreeInfo(), fixEntry_(NULL), toZero_(NULL), toOne_(NULL), integerVariable_(NULL), backward_(NULL), fixingEntry_(NULL), numberVariables_(0), numberIntegers_(0), maximumEntries_(0), numberEntries_(-1) { numberVariables_=model->getNumCols(); // Too many ... but integerVariable_ = new int [numberVariables_]; backward_ = new int [numberVariables_]; int i; // Get integer types const char * columnType = model->getColType (true); for (i=0;iKEEP_CLIQUES) { int * sort = new int [numberCliques]; for (iClique=numberMatrixCliques;iCliqueallow) break; else nEqual++; } delete [] sort; int j=cliqueStart[numberMatrixCliques]; int put=j; int nClique=numberMatrixCliques; for (iClique=numberMatrixCliques;iCliqueallow) { copy=true; } else if (n==allow&&nEqual) { copy=true; nEqual--; } if (copy) { cliqueType[nClique++]=cliqueType[iClique]; for (;j(entry))+j); } // lexicographic sort int * which = new int [numberCliques]; int * position = new int [numberCliques]; int * sort = new int [numberCliques]; int * value = new int [numberCliques]; for (iClique=0;iCliqueiValue||position[kClique]jFirst) { // mark all apart from lowest number as duplicate and move on lastDone =jClique-1; for (jClique=jFirst;jClique<=lastDone;jClique++) { int kClique = which [jClique]; if (kClique!=iLowest) { value[kClique]=-2; nDup++; nSave += cliqueStart[kClique+1]-cliqueStart[kClique]; } } } } } if (printit) printf("%d duplicates\n",nDup); // Now see if any subset int nOut=0; for (int jClique=0;jCliquestatic_cast (sequenceInCliqueEntry(entry[cliqueStart[iClique+1]-1]))) { value[iClique]=numberIntegers; continue; } } if (iValuekValue) continue; // not a candidate // See if subset (remember duplicates have gone) if (cliqueStart[iClique+1]-position[iClique]> cliqueStart[kClique+1]-cliqueStart[kClique]) { // could be subset ? int offset = cliqueStart[iClique]-position[kClique]; int j; bool subset=true; // what about different fixes bool odd=false; for (j=cliqueStart[kClique]+1;jkColumn) { subset=false; } else { while (iColumn1) printf("clique %d is subset of %d\n",kClique,iClique); nOut++; break; } } } } if (nOut) { if(printit) printf("Can get rid of %d cliques\n",nOut); // make new copy int nNewC=numberCliques-nOut; int size = cliqueStart[numberCliques]-nSave; int n=0; int * start = new int [nNewC+1]; char * type = new char [nNewC]; start[0]=0; cliqueEntry * entryC = new cliqueEntry [size]; int nel=0; allNew = true; for (int jClique=0;jClique=numberLastTime) allNew=false; int nn=cliqueStart[kClique+1]-cliqueStart[kClique]; memcpy(entryC+nel,entry+cliqueStart[kClique],nn*sizeof(cliqueEntry)); nel += nn; type[n++]=cliqueType[kClique]; start[n]=nel; } } int nM=n; for (int jClique=0;jClique=numberMatrixCliques) { if (kClique>=numberLastTime) allNew=false; int nn=cliqueStart[kClique+1]-cliqueStart[kClique]; memcpy(entryC+nel,entry+cliqueStart[kClique],nn*sizeof(cliqueEntry)); nel += nn; type[n++]=cliqueType[kClique]; start[n]=nel; } } // move numberCliques=n; numberMatrixCliques=nM; delete [] cliqueStart; cliqueStart=start; delete [] entry; entry = entryC; delete [] cliqueType; cliqueType = type; if (printit>1) { for (int jClique=0;jCliquegetIndices(); const double * elementByRow = rowCopy->getElements(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * lower = si.getColLower(); const double * upper = si.getColUpper(); const double * rowLower = si.getRowLower(); const double * rowUpper = si.getRowUpper(); for (int iPass=0;iPass<2;iPass++) { if (iPass) { cliqueStart = new int [numberCliques+1]; cliqueStart[0]=0; entry = new cliqueEntry [numberEntries]; cliqueType = new char [numberCliques]; whichClique = new int [numberEntries]; numberCliques=0; numberEntries=0; } #if 1 for (iRow=0;iRow0.0) { assert (numberP1 (floor(upperValue+1.0e-5)); int iLower = static_cast (ceil(lowerValue-1.0e-5)); int state=0; if (upperValue<1.0e6) { if (iUpper==1-numberM1) state=1; else if (iUpper==-numberM1) state=2; else if (iUpper<-numberM1) state=3; if (fabs(static_cast (iUpper)-upperValue)>1.0e-9) state =-1; } if (!state&&lowerValue>-1.0e6) { if (-iLower==1-numberP1) state=-1; else if (-iLower==-numberP1) state=-2; else if (-iLower<-numberP1) state=-3; if (fabs(static_cast (iLower)-lowerValue)>1.0e-9) state =-1; } if (numberP1+numberM1<2) state=-1; if (good&&state>0) { if (abs(state)==3) { // infeasible printf("FFF Infeasible\n");; //feasible=false; break; } else if (abs(state)==2) { // we can fix all //numberFixed += numberP1+numberM1; printf("FFF can fix %d\n",numberP1+numberM1); } else { for (j=0;j (numberIntegers_);iColumn++) { int j; for ( j=toZero_[iColumn];j (sequenceInCliqueEntry(entry[j])); if (oneFixesInCliqueEntry(entry[j])) { oneCount[iColumn]++; } else { zeroCount[iColumn]++; } } } int j; zeroStart[0]=0; cliqueStart[0]=0; for (j=0;j (sequenceInCliqueEntry(entry[j])); if (oneFixesInCliqueEntry(entry[j])) { int k=oneCount[iColumn]; oneCount[iColumn]++; int put = oneStart[iColumn]+k; whichClique[put]=iClique; } else { int k=zeroCount[iColumn]; zeroCount[iColumn]++; int put = zeroStart[iColumn]+k; whichClique[put]=iClique; } } } nStrengthen=0; int numberEntries=cliqueStart[numberCliques]; int maximumEntries=numberEntries; int maximumCliques=numberCliques; for (iColumn=0;iColumniColumn&&!mark[jColumn]) { mark[jColumn]=1; whichP[n++]=jColumn; assert (nmaximumEntries) { maximumEntries = CoinMax(numberEntries+jCount+1,(maximumEntries*12)/10+100); cliqueEntry * temp = new cliqueEntry [maximumEntries]; memcpy(temp,entry,numberEntries*sizeof(cliqueEntry)); delete [] entry; entry=temp; int * tempI = new int [maximumEntries]; memcpy(tempI,whichClique,numberEntries*sizeof(int)); delete [] whichClique; whichClique=tempI; } if (numberCliques==maximumCliques) { maximumCliques = (maximumCliques*12)/10+100; int * temp = new int [maximumCliques+1]; memcpy(temp,cliqueStart,(numberCliques+1)*sizeof(int)); delete [] cliqueStart; cliqueStart=temp; char * tempT = new char [maximumCliques]; memcpy(tempT,cliqueType,numberCliques); delete [] cliqueType; cliqueType=tempT; } cliqueEntry eI; eI.fixes=0; setSequenceInCliqueEntry(eI,iColumn); setOneFixesInCliqueEntry(eI,false); entry[numberEntries++]=eI; whichM[0]=iColumn; int n=1; for (int i=cliqueStart[jClique];i(entry))+numberEntries-n); cliqueType[numberCliques]='S'; numberCliques++; cliqueStart[numberCliques]=numberEntries; } } for (i=0;iiColumn&&!mark[jColumn]) { mark[jColumn]=1; whichP[n++]=jColumn; assert (nmaximumEntries) { maximumEntries = CoinMax(numberEntries+jCount+1,(maximumEntries*12)/10+100); cliqueEntry * temp = new cliqueEntry [maximumEntries]; memcpy(temp,entry,numberEntries*sizeof(cliqueEntry)); delete [] entry; entry=temp; int * tempI = new int [maximumEntries]; memcpy(tempI,whichClique,numberEntries*sizeof(int)); delete [] whichClique; whichClique=tempI; } if (numberCliques==maximumCliques) { maximumCliques = (maximumCliques*12)/10+100; int * temp = new int [maximumCliques+1]; memcpy(temp,cliqueStart,(numberCliques+1)*sizeof(int)); delete [] cliqueStart; cliqueStart=temp; char * tempT = new char [maximumCliques]; memcpy(tempT,cliqueType,numberCliques); delete [] cliqueType; cliqueType=tempT; } cliqueEntry eI; eI.fixes=0; setSequenceInCliqueEntry(eI,iColumn); setOneFixesInCliqueEntry(eI,true); entry[numberEntries++]=eI; whichM[0]=iColumn; int n=1; for (int i=cliqueStart[jClique];i(entry))+numberEntries-n); cliqueType[numberCliques]='S'; numberCliques++; cliqueStart[numberCliques]=numberEntries; } } for (i=0;i1&&numberCliques-numberDeleted>5000)) nStrengthen=0; } delete [] count; delete [] whichCount; } #if 0 if (numberCliques>numberMatrixCliques) { // should keep as cliques and also use in branching ?? double * element = new double [numberIntegers_]; for (iClique=numberMatrixCliques;iCliqueaddCut(-COIN_DBL_MAX,rhs,n,whichP,element); } delete [] element; } #endif OsiSolverInterface * newSolver=NULL; if (numberCliques>numberMatrixCliques) { newSolver = si.clone(); // Delete all rows int * start = new int [ CoinMax(numberRows,numberCliques+1)]; int i; for (i=0;ideleteRows(numberRows,start); start[0]=0; int numberElements = cliqueStart[numberCliques]; int * column = new int [numberElements]; double * element = new double [numberElements]; double * lower = new double [numberCliques]; double * upper = new double [numberCliques]; numberElements=0; for (iClique=0;iCliqueaddRows(numberCliques,start,column,element,lower,upper); delete [] start; delete [] column; delete [] element; delete [] lower; delete [] upper; } delete [] mark; delete [] whichP; delete [] whichM; delete [] cliqueStart; delete [] entry; delete [] cliqueType; delete [] zeroStart; delete [] oneStart; delete [] zeroCount; delete [] oneCount; delete [] whichClique; return newSolver; } // Take action if cut generator can fix a variable (toValue -1 for down, +1 for up) bool CglTreeProbingInfo::fixes(int variable, int toValue, int fixedVariable,bool fixedToLower) { //printf("%d going to %d fixes %d at %g\n",variable,toValue,fixedVariable,fixedToValue); int intVariable = backward_[variable]; if (intVariable<0) // off as no longer in order FIX return true; // not 0-1 (well wasn't when constructor was called) int intFix = backward_[fixedVariable]; if (intFix<0) intFix = numberIntegers_+fixedVariable; // not 0-1 int fixedTo = fixedToLower ? 0 : 1; if (numberEntries_==maximumEntries_) { // See if taking too much memory if (maximumEntries_>=CoinMax(1000000,10*numberIntegers_)) return false; maximumEntries_ += 100 +maximumEntries_/2; cliqueEntry * temp1 = new cliqueEntry [maximumEntries_]; memcpy(temp1,fixEntry_,numberEntries_*sizeof(cliqueEntry)); delete [] fixEntry_; fixEntry_ = temp1; int * temp2 = new int [maximumEntries_]; memcpy(temp2,fixingEntry_,numberEntries_*sizeof(int)); delete [] fixingEntry_; fixingEntry_ = temp2; } cliqueEntry entry1; entry1.fixes=0; setOneFixesInCliqueEntry(entry1,fixedTo!=0); setSequenceInCliqueEntry(entry1,intFix); fixEntry_[numberEntries_] = entry1; assert (toValue==-1||toValue==1); assert (fixedTo==0||fixedTo==1); if (toValue<0) fixingEntry_[numberEntries_++] = intVariable << 1; else fixingEntry_[numberEntries_++] = (intVariable << 1) | 1; return true; } // Initalizes fixing arrays etc - returns true if we want to save info int CglTreeProbingInfo::initializeFixing(const OsiSolverInterface * model) { if (numberEntries_>=0) return 2; // already got arrays else if (numberEntries_==-2) return numberEntries_; delete [] fixEntry_; delete [] toZero_; delete [] toOne_; delete [] integerVariable_; delete [] backward_; delete [] fixingEntry_; numberVariables_=model->getNumCols(); // Too many ... but integerVariable_ = new int [numberVariables_]; backward_ = new int [numberVariables_]; numberIntegers_=0; int i; // Get integer types const char * columnType = model->getColType (true); for (i=0;i=0) { CoinSort_2( fixingEntry_, fixingEntry_+numberEntries_, fixEntry_); assert (!toZero_); toZero_ = new int [numberIntegers_+1]; toOne_ = new int [numberIntegers_]; toZero_[0]=0; int n=0; int put=0; for (int intVariable = 0;intVariable>1; int way = value &1; if (intVariable!=iVar||way) break; } if (n>last) { // sort assert (sizeof(int)==4); std::sort(reinterpret_cast (fixEntry_)+last, reinterpret_cast (fixEntry_)+n); cliqueEntry temp2; temp2.fixes=0; setSequenceInCliqueEntry(temp2,numberVariables_+1); for (int i=last;i>1; if (intVariable!=iVar) break; } if (n>last) { // sort assert (sizeof(int)==4); std::sort(reinterpret_cast (fixEntry_)+last, reinterpret_cast (fixEntry_)+n); cliqueEntry temp2; temp2.fixes=0; setSequenceInCliqueEntry(temp2,numberVariables_+1); for (int i=last;i (numberIntegers_);jColumn++) { int iColumn = integerVariable_[jColumn]; if (upper[iColumn]==0.0) { int j; for ( j=toZero_[jColumn];j=0); if (!value) { int j; for ( j=toZero_[jColumn];j (numberIntegers_);jColumn++) { int j; for ( j=iLast;j (numberIntegers_);jColumn++) { int iColumn = integerVariable_[jColumn]; assert (iColumn>=0&&iColumn=0&&kColumn=0&&kColumn0.00001) { OsiRowCut rc; int index[2]; double element[2]; index[0]=iColumn; element[0]=1.0; index[1]=kColumn; element[1]= -1.0; rc.setLb(-COIN_DBL_MAX); rc.setUb(0.0); rc.setRow(2,index,element,false); cs.insert(rc); } } else { if (value1+value2>1.00001) { OsiRowCut rc; int index[2]; double element[2]; index[0]=iColumn; element[0]=1.0; index[1]=kColumn; element[1]= 1.0; rc.setLb(-COIN_DBL_MAX); rc.setUb(1.0); rc.setRow(2,index,element,false); cs.insert(rc); } } } } } else if (upper[iColumn]==0.0) { for (int j=toZero_[jColumn];j=0&&kColumn=0&&kColumn #include #include #include #include #include //#define CGL_DEBUG 2 #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "OsiRowCutDebugger.hpp" #include "CoinWarmStartBasis.hpp" #include "CglStored.hpp" #include "CglTreeInfo.hpp" #include "CoinFinite.hpp" //------------------------------------------------------------------- // Generate Stored cuts //------------------------------------------------------------------- void CglStored::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo /*info*/) { // Get basic problem information const double * solution = si.getColSolution(); int numberRowCuts = cuts_.sizeRowCuts(); for (int i=0;iviolated(solution); if (violation>=requiredViolation_) cs.insert(*rowCutPointer); } if (probingInfo_) { int number01 = probingInfo_->numberIntegers(); const cliqueEntry * entry = probingInfo_->fixEntries(); const int * toZero = probingInfo_->toZero(); const int * toOne = probingInfo_->toOne(); const int * integerVariable = probingInfo_->integerVariable(); const double * lower = si.getColLower(); const double * upper = si.getColUpper(); OsiRowCut cut; int column[2]; double element[2]; for (int i=0;i=0); double value2 = solution[jColumn]; if (oneFixesInCliqueEntry(entry[j])) { double violation = 1.0-value1-value2; if (violation>requiredViolation_) { //printf("XXX can do %d + %d >=1\n",iColumn,jColumn); cut.setLb(1.0); cut.setUb(COIN_DBL_MAX); column[0]=iColumn; element[0]=1.0; column[1]=jColumn; element[1]= 1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } else { double violation = value2-value1; if (violation>requiredViolation_) { //printf("XXX can do %d >= %d\n",iColumn,jColumn); cut.setLb(0.0); cut.setUb(COIN_DBL_MAX); column[0]=iColumn; element[0]=1.0; column[1]=jColumn; element[1]= -1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } } else { jColumn -= number01; // not 0-1 double value2 = solution[jColumn]; double lowerValue = lower[jColumn]; double upperValue = upper[jColumn]; if (oneFixesInCliqueEntry(entry[j])) { double violation = upperValue-value1*(upperValue-lowerValue)-value2; if (violation>requiredViolation_) { //printf("XXX can do %g*%d + %d >=%g\n",(upperValue-lowerValue),iColumn,jColumn,upperValue); cut.setLb(upperValue); cut.setUb(COIN_DBL_MAX); column[0]=iColumn; element[0]=upperValue-lowerValue; column[1]=jColumn; element[1]= 1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } else { double violation = value2-value1*(upperValue-lowerValue)-lowerValue; if (violation>requiredViolation_) { //printf("XXX can do %g*%d >= %d -%g\n",(upperValue-lowerValue),iColumn,jColumn,lowerValue); cut.setLb(-lowerValue); cut.setUb(COIN_DBL_MAX); column[0]=iColumn; element[0]=upperValue-lowerValue; column[1]=jColumn; element[1]= -1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } } } for (int j=toOne[i];j=0); double value2 = solution[jColumn]; if (oneFixesInCliqueEntry(entry[j])) { double violation = value1-value2; if (violation>requiredViolation_) { //printf("XXX can do %d <= %d\n",iColumn,jColumn); cut.setLb(-COIN_DBL_MAX); cut.setUb(0.0); column[0]=iColumn; element[0]=1.0; column[1]=jColumn; element[1]= -1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } else { double violation = value1+value2-1.0; if (violation>requiredViolation_) { //printf("XXX can do %d + %d <=1\n",iColumn,jColumn); cut.setLb(-COIN_DBL_MAX); cut.setUb(1.0); column[0]=iColumn; element[0]=1.0; column[1]=jColumn; element[1]= 1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } } else { jColumn -= number01; // not 0-1 double value2 = solution[jColumn]; double lowerValue = lower[jColumn]; double upperValue = upper[jColumn]; if (oneFixesInCliqueEntry(entry[j])) { double violation = lowerValue +(upperValue-lowerValue)*value1-value2; if (violation>requiredViolation_) { //printf("XXX can do %g*%d <= %d -%g\n",(upperValue-lowerValue),iColumn,jColumn,lowerValue); cut.setLb(-COIN_DBL_MAX); cut.setUb(-lowerValue); column[0]=iColumn; element[0]=upperValue-lowerValue; column[1]=jColumn; element[1]= -1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } else { double violation = (upperValue-lowerValue)*value1+value2-upperValue; if (violation>requiredViolation_) { //printf("XXX can do %g*%d + %d <=%g\n",(upperValue-lowerValue),iColumn,jColumn,upperValue); cut.setLb(-COIN_DBL_MAX); cut.setUb(upperValue); column[0]=iColumn; element[0]=upperValue-lowerValue; column[1]=jColumn; element[1]= 1.0; cut.setEffectiveness(violation); cut.setRow(2,column,element,false); cs.insert(cut); } } } } } } } // Add cuts void CglStored::addCut(const OsiCuts & cs) { int numberRowCuts = cs.sizeRowCuts(); for (int i=0;i=0) { #ifndef NDEBUG numberRead = fread(&n,sizeof(int),1,fp); assert (numberRead==1); #else fread(&n,sizeof(int),1,fp); #endif if (n<0) break; if (n>maxInCut) { maxInCut=n; delete [] index; delete [] coefficient; index = new int [maxInCut]; coefficient = new double [maxInCut]; } #ifndef NDEBUG numberRead = fread(rhs,sizeof(double),2,fp); assert (numberRead==2); #else fread(rhs,sizeof(double),2,fp); #endif fread(index,sizeof(int),n,fp); fread(coefficient,sizeof(double),n,fp); OsiRowCut rc; rc.setRow(n,index,coefficient,false); rc.setLb(rhs[0]); rc.setUb(rhs[1]); cuts_.insert(rc); } delete [] index; delete [] coefficient; fclose(fp); } } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglStored::clone() const { return new CglStored(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglStored::~CglStored () { delete probingInfo_; delete [] bestSolution_; delete [] bounds_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglStored & CglStored::operator=(const CglStored& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); requiredViolation_=rhs.requiredViolation_; cuts_=rhs.cuts_; delete probingInfo_; if (rhs.probingInfo_) probingInfo_ = new CglTreeProbingInfo(*rhs.probingInfo_); else probingInfo_ = NULL; delete [] bestSolution_; delete [] bounds_; bestSolution_ = NULL; bounds_ = NULL; numberColumns_ = rhs.numberColumns_; if (numberColumns_) { bestSolution_ = CoinCopyOfArray(rhs.bestSolution_,numberColumns_+1); bounds_ = CoinCopyOfArray(rhs.bounds_,2*numberColumns_); } } return *this; } // Save stuff void CglStored::saveStuff(double bestObjective, const double * bestSolution, const double * lower, const double * upper) { assert (numberColumns_); delete [] bestSolution_; delete [] bounds_; if (bestSolution) { bestSolution_ = new double[numberColumns_+1]; memcpy(bestSolution_,bestSolution,numberColumns_*sizeof(double)); bestSolution_[numberColumns_]=bestObjective; } else { bestSolution_=NULL; } bounds_ = new double [2*numberColumns_]; memcpy(bounds_,lower,numberColumns_*sizeof(double)); memcpy(bounds_+numberColumns_,upper,numberColumns_*sizeof(double)); } // Best objective double CglStored::bestObjective() const { if (bestSolution_) return bestSolution_[numberColumns_]; else return COIN_DBL_MAX; } Cgl-0.58.9/src/Makefile.am0000644000076600007660000000452112253611530013623 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 1171 2013-12-16 14:51:04Z tkr $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign # We need to recurse into all Cgl subproject subdirectories SUBDIRS = $(CGL_SUBDIRS) ######################################################################## # libCgl # ######################################################################## # Name of the library compiled in this directory. We want it to be installed # in the $libdir directory lib_LTLIBRARIES = libCgl.la # List all source files for this library, including headers libCgl_la_SOURCES = \ CglConfig.h \ CglCutGenerator.cpp CglCutGenerator.hpp\ CglMessage.cpp CglMessage.hpp \ CglStored.cpp CglStored.hpp \ CglParam.cpp CglParam.hpp \ CglTreeInfo.cpp CglTreeInfo.hpp # This is for libtool (on Windows) libCgl_la_LDFLAGS = $(LT_LDFLAGS) # We want to have all the sublibraries from the Cgl subprojects collected into # this library libCgl_la_LIBADD = $(CGL_SUBLIBS) if DEPENDENCY_LINKING libCgl_la_LIBADD += $(CGLLIB_LIBS) endif # Since automake is not doing this on its own, we need to declare the # dependencies to the subdirectory libraries here libCgl_la_DEPENDENCIES = $(CGL_SUBLIBS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation 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 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = \ CglCutGenerator.hpp \ CglMessage.hpp \ CglStored.hpp \ CglParam.hpp \ CglTreeInfo.hpp install-exec-local: $(install_sh_DATA) config_cgl.h $(DESTDIR)$(includecoindir)/CglConfig.h uninstall-local: rm -f $(DESTDIR)$(includecoindir)/CglConfig.h Cgl-0.58.9/src/CglResidualCapacity/0000755000076600007660000000000012377555671015465 5ustar coincoinCgl-0.58.9/src/CglResidualCapacity/CglResidualCapacity.cpp0000644000076600007660000004710112130104734022021 0ustar coincoin// LAST EDIT: //----------------------------------------------------------------------------- // Implementation of Residual Capacity Inequalities // Francisco Barahona (barahon@us.ibm.com) // // date: May 18 2006 //----------------------------------------------------------------------------- // Copyright (C) 2004, International Business Machines Corporation and others. // All Rights Reserved. // This code is published under the Eclipse Public License. //#include //#include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedMatrix.hpp" #include "CoinPackedVector.hpp" #include "CglResidualCapacity.hpp" //#define CGL_DEBUG 1 //----------------------------------------------------------------------------- // Generate Mixed Integer Rounding inequality //------------------------------------------------------------------- void CglResidualCapacity::generateCuts(const OsiSolverInterface& si, OsiCuts& cs, const CglTreeInfo /*info*/) { // If the LP or integer presolve is used, then need to redo preprocessing // everytime this function is called. Otherwise, just do once. bool preInit = false; bool preReso = false; si.getHintParam(OsiDoPresolveInInitial, preInit); si.getHintParam(OsiDoPresolveInResolve, preReso); if (preInit == false && preReso == false && doPreproc_ == -1 ) { // Do once if (doneInitPre_ == false) { resCapPreprocess(si); doneInitPre_ = true; } } else if ( doPreproc_ == 1 ){ // Do everytime resCapPreprocess(si); doneInitPre_ = true; } else if (doneInitPre_ == false) { resCapPreprocess(si); doneInitPre_ = true; } const double* xlp = si.getColSolution(); // LP solution const double* colUpperBound = si.getColUpper(); // vector of upper bounds const double* colLowerBound = si.getColLower(); // vector of lower bounds // get matrix by row const CoinPackedMatrix & tempMatrixByRow = *si.getMatrixByRow(); CoinPackedMatrix matrixByRow; matrixByRow.submatrixOf(tempMatrixByRow, numRows_, indRows_); const double* LHS = si.getRowActivity(); const double* coefByRow = matrixByRow.getElements(); const int* colInds = matrixByRow.getIndices(); const int* rowStarts = matrixByRow.getVectorStarts(); const int* rowLengths = matrixByRow.getVectorLengths(); generateResCapCuts(si, xlp, colUpperBound, colLowerBound, matrixByRow, LHS, coefByRow, colInds, rowStarts, rowLengths, cs); } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglResidualCapacity::CglResidualCapacity () : CglCutGenerator() { gutsOfConstruct(1.0e-6); } //------------------------------------------------------------------- // Alternate Constructor //------------------------------------------------------------------- CglResidualCapacity::CglResidualCapacity (const double epsilon) : CglCutGenerator() { gutsOfConstruct(epsilon); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglResidualCapacity::CglResidualCapacity ( const CglResidualCapacity & rhs) : CglCutGenerator(rhs) { gutsOfCopy(rhs); } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglResidualCapacity::clone() const { return new CglResidualCapacity(*this); } //------------------------------------------------------------------ // Assignment operator //------------------------------------------------------------------- CglResidualCapacity & CglResidualCapacity::operator=(const CglResidualCapacity& rhs) { if (this != &rhs) { gutsOfDelete(); CglCutGenerator::operator=(rhs); gutsOfCopy(rhs); } return *this; } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglResidualCapacity::~CglResidualCapacity () { gutsOfDelete(); } //------------------------------------------------------------------- // Construct //------------------------------------------------------------------- void CglResidualCapacity::gutsOfConstruct (const double epsilon) { EPSILON_ = epsilon; TOLERANCE_ = 1.0e-4; doPreproc_ = -1; numRows_ = 0; numCols_ = 0; doneInitPre_ = false; rowTypes_ = 0; indRows_ = 0; sense_=NULL; RHS_=NULL; numRowL_ = 0; indRowL_ = 0; numRowG_ = 0; indRowG_ = 0; } //------------------------------------------------------------------- // Delete //------------------------------------------------------------------- void CglResidualCapacity::gutsOfDelete () { if (rowTypes_ != 0) { delete [] rowTypes_; rowTypes_ = 0; } if (indRows_ != 0) { delete [] indRows_; indRows_ = 0; } if (indRowL_ != 0) { delete [] indRowL_; indRowL_ = 0; } if (indRowG_ != 0) { delete [] indRowG_; indRowG_ = 0; } if (sense_ !=NULL) { delete [] sense_; sense_=NULL;} if (RHS_ !=NULL) { delete [] RHS_; RHS_=NULL;} } //------------------------------------------------------------------- // Copy //------------------------------------------------------------------- void CglResidualCapacity::gutsOfCopy (const CglResidualCapacity& rhs) { EPSILON_ = rhs.EPSILON_; TOLERANCE_ = rhs.TOLERANCE_; doPreproc_ = rhs.doPreproc_; numRows_ = rhs.numRows_; numCols_ = rhs.numCols_; doneInitPre_ = rhs.doneInitPre_; numRowL_ = rhs.numRowL_; numRowG_ = rhs.numRowG_; if (numRows_ > 0) { rowTypes_ = new RowType [numRows_]; CoinDisjointCopyN(rhs.rowTypes_, numRows_, rowTypes_); indRows_ = new int [numRows_]; CoinDisjointCopyN(rhs.indRows_, numRows_, indRows_); sense_ = CoinCopyOfArray(rhs.sense_,numRows_); RHS_ = CoinCopyOfArray(rhs.RHS_,numRows_); } else { rowTypes_ = 0; indRows_ = 0; sense_=NULL; RHS_=NULL; } if (numRowL_ > 0) { indRowL_ = new int [numRowL_]; CoinDisjointCopyN(rhs.indRowL_, numRowL_, indRowL_); } else { indRowL_ = 0; } if (numRowG_ > 0) { indRowG_ = new int [numRowG_]; CoinDisjointCopyN(rhs.indRowG_, numRowG_, indRowG_); } else { indRowG_ = 0; } } //------------------------------------------------------------------- // Do preprocessing // It determines the type of each row. //------------------------------------------------------------------- void CglResidualCapacity:: resCapPreprocess(const OsiSolverInterface& si) { // get matrix stored by row const CoinPackedMatrix & matrixByRow = *si.getMatrixByRow(); numRows_ = si.getNumRows(); numCols_ = si.getNumCols(); const double* coefByRow = matrixByRow.getElements(); const int* colInds = matrixByRow.getIndices(); const int* rowStarts = matrixByRow.getVectorStarts(); const int* rowLengths = matrixByRow.getVectorLengths(); const double * colLowerBound = si.getColLower(); const double * colUpperBound = si.getColUpper(); // Get copies of sense and RHS so we can modify if ranges if (sense_) { delete [] sense_; delete [] RHS_; } sense_ = CoinCopyOfArray(si.getRowSense(),numRows_); RHS_ = CoinCopyOfArray(si.getRightHandSide(),numRows_); if (rowTypes_ != 0) { delete [] rowTypes_; rowTypes_ = 0; } rowTypes_ = new RowType [numRows_]; // Destructor will free memory // Summarize the row type infomation. int numOTHER = 0; int numL = 0; int numG = 0; int numB = 0; int iRow; const double* rowActivity = si.getRowActivity(); const double* rowLower = si.getRowLower(); const double* rowUpper = si.getRowUpper(); for (iRow = 0; iRow < numRows_; ++iRow) { // If range then choose which to use if (sense_[iRow]=='R') { if (rowActivity[iRow]-rowLower[iRow]< rowUpper[iRow]-rowActivity[iRow]) { // treat as G row RHS_[iRow]=rowLower[iRow]; sense_[iRow]='G'; } else { // treat as L row RHS_[iRow]=rowUpper[iRow]; sense_[iRow]='L'; } } // get the type of a row const RowType rowType = determineRowType(si, rowLengths[iRow], colInds+rowStarts[iRow], coefByRow+rowStarts[iRow], sense_[iRow], RHS_[iRow], colLowerBound, colUpperBound); // store the type of the current row rowTypes_[iRow] = rowType; // Summarize information about row types switch(rowType) { case ROW_OTHER: ++numOTHER; break; case ROW_L: ++numL; break; case ROW_G: ++numG; break; case ROW_BOTH: ++numB; break; default: throw CoinError("Unknown row type", "ResidualCapacityPreprocess", "CglResidualCapacity"); } } // allocate memory for vector of indices of all rows if (indRows_ != 0) { delete [] indRows_; indRows_ = 0; } if (numRows_ > 0) indRows_ = new int [numRows_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_L and ROW_BOTH numRowL_ = numL + numB; if (indRowL_ != 0) { delete [] indRowL_; indRowL_ = 0; } if (numRowL_ > 0) indRowL_ = new int [numRowL_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_G and ROW_BOTH numRowG_ = numG + numB; if (indRowG_ != 0) { delete [] indRowG_; indRowG_ = 0; } if (numRowG_ > 0) indRowG_ = new int [numRowG_]; // Destructor will free memory #if CGL_DEBUG std::cout << "The num of rows = " << numRows_ << std::endl; std::cout << "Summary of Row Type" << std::endl; std::cout << "numL = " << numL << std::endl; std::cout << "numG = " << numG << std::endl; #endif int countL = 0; int countG = 0; for ( iRow = 0; iRow < numRows_; ++iRow) { RowType rowType = rowTypes_[iRow]; // fill the vector indRows_ with the indices of all rows indRows_[iRow] = iRow; // fill the vector indRowL_ with the indices of the rows of type ROW_L and ROW_BOTH if (rowType == ROW_L || rowType == ROW_BOTH) { indRowL_[countL] = iRow; countL++; } // fill the vector indRowG_ with the indices of rows of type ROW_G and ROW_BOTH if (rowType == ROW_G || rowType == ROW_BOTH) { indRowG_[countG] = iRow; countG++; } } } //------------------------------------------------------------------- // Determine the type of a given row //------------------------------------------------------------------- CglResidualCapacity::RowType CglResidualCapacity::determineRowType(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const char sense, const double rhs, const double* colLowerBound, const double* colUpperBound) const { if (rowLen == 0) return ROW_OTHER; RowType rowType = ROW_OTHER; double *negCoef; bool flagL, flagG, flag1, flag2; switch (sense) { case 'L': flagL=treatAsLessThan(si, rowLen, ind, coef, rhs, colLowerBound, colUpperBound); if ( flagL ) rowType=ROW_L; break; case 'G': negCoef = new double[rowLen]; for ( int i=0; i < rowLen; ++i ) negCoef[i]=-coef[i]; flagG=treatAsLessThan(si, rowLen, ind, negCoef, -rhs, colLowerBound, colUpperBound); if ( flagG ) rowType=ROW_G; delete [] negCoef; break; case 'E': flag1=treatAsLessThan(si, rowLen, ind, coef, rhs, colLowerBound, colUpperBound); negCoef = new double[rowLen]; for ( int i=0; i < rowLen; ++i ) negCoef[i]=-coef[i]; flag2=treatAsLessThan(si, rowLen, ind, negCoef, -rhs, colLowerBound, colUpperBound); delete [] negCoef; if ( flag1 && !flag2 ) rowType=ROW_L; if ( !flag1 && flag2 ) rowType=ROW_G; if ( flag1 && flag2 ) rowType=ROW_BOTH; break; default: throw CoinError("Unknown sense", "determineRowType", "CglResidualCapacity"); } return rowType; } //-------------------------------------------- // determine if an ineq of type <= is a good candidate //-------------------------------------------- bool CglResidualCapacity::treatAsLessThan(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const double /*rhs*/, const double* colLowerBound, const double* colUpperBound) const { bool intFound=false; bool contFound=false; bool goodIneq=true; double intCoef=-1; // look for a_1 c_1 + + a_k c_k - d z_1 - - d z_p <= b // where c_i continuous, z_j integer for ( int i = 0; i < rowLen; ++i ) { if ( coef[i] > EPSILON_ || !si.isInteger(ind[i]) ) { if ( colLowerBound[ind[i]] < -EPSILON_ || colUpperBound[ind[i]] > 1.e10 ){ // cont var with too big bounds goodIneq=false; break; } else contFound=true; } else if ( !intFound && coef[i] < -EPSILON_ && si.isInteger(ind[i]) ){ intFound=true; intCoef=coef[i]; continue; } else if ( intFound && coef[i] < -EPSILON_ && si.isInteger(ind[i]) && fabs( coef[i] - intCoef ) > EPSILON_ ){ goodIneq=false; break; } } if ( contFound && intFound && goodIneq ) return true; else return false; } //------------------------------------------------------------------- // Generate Residual capacity cuts //------------------------------------------------------------------- void CglResidualCapacity::generateResCapCuts( const OsiSolverInterface& si, const double* xlp, const double* colUpperBound, const double* colLowerBound, const CoinPackedMatrix& /*matrixByRow*/, const double* /*LHS*/, const double* coefByRow, const int* colInds, const int* rowStarts, const int* rowLengths, OsiCuts& cs ) const { #if CGL_DEBUG // OPEN FILE std::ofstream fout("stats.dat"); #endif for (int iRow = 0; iRow < numRowL_; ++iRow) { int rowToUse=indRowL_[iRow]; OsiRowCut resCapCut; // Find a most violated residual capacity ineq bool hasCut = resCapSeparation(si, rowLengths[rowToUse], colInds+rowStarts[rowToUse], coefByRow+rowStarts[rowToUse], RHS_[rowToUse], xlp, colUpperBound, colLowerBound, resCapCut); // if a cut was found, insert it into cs if (hasCut) { #if CGL_DEBUG std::cout << "Res. cap. cut generated " << std::endl; #endif cs.insert(resCapCut); } } for (int iRow = 0; iRow < numRowG_; ++iRow) { int rowToUse=indRowG_[iRow]; OsiRowCut resCapCut; const int rowLen=rowLengths[rowToUse]; double *negCoef= new double[rowLen]; const int rStart=rowStarts[rowToUse]; for ( int i=0; i < rowLen; ++i ) negCoef[i]=-coefByRow[rStart+i]; // Find a most violated residual capacity ineq bool hasCut = resCapSeparation(si, rowLengths[rowToUse], colInds+rowStarts[rowToUse], negCoef, -RHS_[rowToUse], xlp, colUpperBound, colLowerBound, resCapCut); delete [] negCoef; // if a cut was found, insert it into cs if (hasCut) { #if CGL_DEBUG std::cout << "Res. cap. cut generated " << std::endl; #endif cs.insert(resCapCut); } } #if CGL_DEBUG // CLOSE FILE fout.close(); #endif return; } //------------------------------------------------------------------- // separation algorithm //------------------------------------------------------------------- bool CglResidualCapacity::resCapSeparation(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const double rhs, const double *xlp, const double* colUpperBound, const double* /*colLowerBound*/, OsiRowCut& resCapCut) const { // process original row to create row in canonical form std::vector positionIntVar; double ybar=0.0; double *xbar; double intCoef=-1; double *newRowCoef; int *positionContVar; double newRowRHS; int contCount=0; for ( int i = 0; i < rowLen; ++i ) { if ( coef[i] < -EPSILON_ && si.isInteger(ind[i]) ){ intCoef=-coef[i]; ybar+=xlp[ind[i]]; positionIntVar.push_back(i); } else ++contCount; } xbar = new double [contCount]; newRowCoef = new double [contCount]; positionContVar = new int [contCount]; contCount=0; newRowRHS=rhs; for ( int i = 0; i < rowLen; ++i ) if ( coef[i] > EPSILON_ || !si.isInteger(ind[i]) ){ newRowCoef[contCount]=coef[i]*colUpperBound[ind[i]]; xbar[contCount]=xlp[ind[i]]/colUpperBound[ind[i]]; if ( newRowCoef[contCount] < -EPSILON_ ){ // complement newRowCoef[contCount] = -newRowCoef[contCount]; xbar[contCount] = 1.0 - xbar[contCount]; newRowRHS+= newRowCoef[contCount]; } positionContVar[contCount++]=i; } // now separate std::vector setSbar; const double lambda = ybar - floor(ybar); double sumCoef=0.0; for ( int i = 0; i < contCount; ++i ) if ( xbar[i] > lambda ){ setSbar.push_back(i); sumCoef+=newRowCoef[i]; } const int sSize = static_cast(setSbar.size()); bool generated; if ( sSize == 0 ) generated=false; // no cut else { // generate cut const double mu= ceil( (sumCoef - newRowRHS)/intCoef ); double r = sumCoef - newRowRHS - intCoef * floor( (sumCoef - newRowRHS)/intCoef ); const int numInt = static_cast(positionIntVar.size()); const int cutLen = sSize + numInt; int* cutInd = new int [cutLen]; double* cutCoef = new double [cutLen]; double violation=0.0; double complCoef=0.0; // load continuous variables for ( int i = 0; i < sSize; ++i ){ const int newRowPosition=setSbar[i]; const int originalRowPosition=positionContVar[newRowPosition]; cutInd[i]=ind[originalRowPosition]; cutCoef[i]=coef[originalRowPosition]; if ( cutCoef[i] < -EPSILON_ ) complCoef+= cutCoef[i]*colUpperBound[ind[originalRowPosition]]; violation+=cutCoef[i]*xlp[ind[originalRowPosition]]; } // load integer variables for ( int i = 0; i < numInt; ++i ){ const int originalRowPosition=positionIntVar[i]; cutInd[i+sSize]=ind[originalRowPosition]; cutCoef[i+sSize]= - r; violation+=cutCoef[i+sSize]*xlp[ind[originalRowPosition]]; } double cutRHS=(sumCoef - r * mu) + complCoef; violation-=cutRHS; if ( violation > TOLERANCE_ ){ resCapCut.setRow(cutLen, cutInd, cutCoef); resCapCut.setLb(-1.0 * si.getInfinity()); resCapCut.setUb(cutRHS); resCapCut.setEffectiveness(violation); generated=true; #if 0 std::cout << "coef "; for(int i=0; i #include //#include #include "CoinError.hpp" #include "CglCutGenerator.hpp" //============================================================================= #ifndef CGL_DEBUG #define CGL_DEBUG 0 #endif //============================================================================= //============================================================================= /** Residual Capacity Inequalities Cut Generator Class References: T Magnanti, P Mirchandani, R Vachani, "The convex hull of two core capacitated network design problems," Math Programming 60 (1993), 233-250. A Atamturk, D Rajan, "On splittable and unsplittable flow capacitated network design arc-set polyhedra," Math Programming 92 (2002), 315-333. **/ class CglResidualCapacity : public CglCutGenerator { friend void CglResidualCapacityUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); private: //--------------------------------------------------------------------------- // Enumeration constants that describe the various types of rows enum RowType { /** row of the type a_1 c_1 + + a_k c_k - d z_1 - - d z_p <= b, where c_i are continuous variables and z_j are integer variables */ ROW_L, /** row of the type -a_1 c_1 - - a_k c_k + d z_1 + + d z_p >= b, where c_i are continuous variables and z_j are integer variables */ ROW_G, /** equation that can be treated as ROW_L and ROW_G */ ROW_BOTH, /** Other types of rows */ ROW_OTHER }; public: /**@name Get and Set Parameters */ //@{ /// Set Epsilon void setEpsilon(double value); /// Get Epsilon double getEpsilon() const; /// Set Tolerance void setTolerance(double value); /// Get Tolerance double getTolerance() const; /// Set doPreproc void setDoPreproc(int value); /// Get doPreproc bool getDoPreproc() const; //@} /**@name Generate Cuts */ //@{ /** Generate Residual Capacity cuts for the model data contained in si. The generated cuts are inserted in the collection of cuts cs. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} //--------------------------------------------------------------------------- /**@name Constructors and destructors */ //@{ /// Default constructor CglResidualCapacity (); /// Alternate Constructor CglResidualCapacity ( const double tolerance ); /// Copy constructor CglResidualCapacity ( const CglResidualCapacity &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglResidualCapacity & operator=( const CglResidualCapacity& rhs); /// Destructor virtual ~CglResidualCapacity (); /// This is to refresh preprocessing virtual void refreshPrep(); //@} private: //-------------------------------------------------------------------------- // Private member methods // Construct void gutsOfConstruct ( const double tolerance); // Delete void gutsOfDelete(); // Copy void gutsOfCopy (const CglResidualCapacity& rhs); // Do preprocessing. // It determines the type of each row. // It may change sense and RHS for ranged rows void resCapPreprocess(const OsiSolverInterface& si); // Determine the type of a given row. RowType determineRowType(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const char sense, const double rhs, const double* colLowerBound, const double* colUpperBound) const; // helps the function above bool treatAsLessThan(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const double rhs, const double* colLowerBound, const double* colUpperBound) const; // Generate Residual Capacity cuts void generateResCapCuts( const OsiSolverInterface& si, const double* xlp, const double* colUpperBound, const double* colLowerBound, const CoinPackedMatrix& matrixByRow, const double* LHS, const double* coefByRow, const int* colInds, const int* rowStarts, const int* rowLengths, OsiCuts& cs ) const; // Residual Capacity separation bool resCapSeparation(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const double rhs, const double *xlp, const double* colUpperBound, const double* colLowerBound, OsiRowCut& resCapCut) const; private: //--------------------------------------------------------------------------- // Private member data /** Tolerance used for numerical purposes, default value: 1.e-6 **/ double EPSILON_; /** If violation of a cut is greater that this number, the cut is accepted, default value: 1.e-4 **/ double TOLERANCE_; /** Controls the preprocessing of the matrix to identify rows suitable for cut generation.
  • -1: preprocess according to solver settings;
  • 0: Do preprocessing only if it has not yet been done;
  • 1: Do preprocessing.
Default value: -1 **/ int doPreproc_; // The number of rows of the problem. int numRows_; // The number columns of the problem. int numCols_; // Indicates whether preprocessing has been done. bool doneInitPre_; // Array with the row types of the rows in the model. RowType* rowTypes_; // The indices of the rows of the initial matrix int* indRows_; // Sense of rows (modified if ranges) char * sense_; // RHS of rows (modified if ranges) double * RHS_; // The number of rows of type ROW_L int numRowL_; // The indices of the rows of type ROW_L int* indRowL_; // The number of rows of type ROW_G int numRowG_; // The indices of the rows of type ROW_G int* indRowG_; }; //############################################################################# /** A function that tests the methods in the CglResidualCapacity class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglResidualCapacityUnitTest(const OsiSolverInterface * siP, const std::string mpdDir); #endif Cgl-0.58.9/src/CglResidualCapacity/Makefile.am0000644000076600007660000000330211621724114017474 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglResidualCapacity # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglResidualCapacity.la # List all source files for this library, including headers libCglResidualCapacity_la_SOURCES = CglResidualCapacity.cpp CglResidualCapacity.hpp CglResidualCapacityTest.cpp # This is for libtool (on Windows) libCglResidualCapacity_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglResidualCapacity.hpp Cgl-0.58.9/src/CglResidualCapacity/Makefile.in0000644000076600007660000005437112240340055017515 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/CglResidualCapacity 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglResidualCapacity_la_LIBADD = am_libCglResidualCapacity_la_OBJECTS = CglResidualCapacity.lo \ CglResidualCapacityTest.lo libCglResidualCapacity_la_OBJECTS = \ $(am_libCglResidualCapacity_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 = $(libCglResidualCapacity_la_SOURCES) DIST_SOURCES = $(libCglResidualCapacity_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglResidualCapacity # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglResidualCapacity.la # List all source files for this library, including headers libCglResidualCapacity_la_SOURCES = CglResidualCapacity.cpp CglResidualCapacity.hpp CglResidualCapacityTest.cpp # This is for libtool (on Windows) libCglResidualCapacity_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglResidualCapacity.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/CglResidualCapacity/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglResidualCapacity/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglResidualCapacity.la: $(libCglResidualCapacity_la_OBJECTS) $(libCglResidualCapacity_la_DEPENDENCIES) $(CXXLINK) $(libCglResidualCapacity_la_LDFLAGS) $(libCglResidualCapacity_la_OBJECTS) $(libCglResidualCapacity_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglResidualCapacity.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglResidualCapacityTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglResidualCapacity/CglResidualCapacityTest.cpp0000644000076600007660000000451112130104734022657 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 #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglResidualCapacity.hpp" void CglResidualCapacityUnitTest(const OsiSolverInterface *baseSiP, const std::string mpsDir) { // Test default constructor { CglResidualCapacity aGenerator; } // Test copy & assignment { CglResidualCapacity rhs; { CglResidualCapacity bGenerator; CglResidualCapacity cGenerator(bGenerator); rhs=bGenerator; } } // Test get/set methods { CglResidualCapacity getset; double geps = 10 * getset.getEpsilon(); getset.setEpsilon(geps); double geps2 = getset.getEpsilon(); assert(geps == geps2); double gtol = 10 * getset.getTolerance(); getset.setTolerance(gtol); double gtol2 = getset.getTolerance(); assert(gtol == gtol2); int gpre = getset.getDoPreproc(); gpre = (gpre + 1) % 3 - 1; getset.setDoPreproc(gpre); int gpre2 = getset.getDoPreproc(); assert(gpre == gpre2); } // Test generateCuts { CglResidualCapacity gct; OsiSolverInterface *siP = baseSiP->clone(); std::string fn = mpsDir+"capPlan1"; std::string fn2 = mpsDir+"capPlan1.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(),"mps"); siP->initialSolve(); double lpRelax = siP->getObjValue(); OsiCuts cs; gct.setDoPreproc(1); // Needed for DyLP gct.generateCuts(*siP, cs); int nRowCuts = cs.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cs); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); std::cout<<"Initial LP value: "< #include #include #include #include #include #include "CoinPragma.hpp" #include "CglParam.hpp" /***********************************************************************/ void CglParam::setINFINIT(const double inf) { if(inf > 0) INFINIT = inf; } /* setINFINIT */ /***********************************************************************/ void CglParam::setEPS(const double eps) { if(eps >= 0) EPS = eps; } /* setEPS */ /***********************************************************************/ void CglParam::setEPS_COEFF(const double eps_c) { if(eps_c >= 0) EPS_COEFF = eps_c; } /* setEPS_COEFF */ /***********************************************************************/ void CglParam::setMAX_SUPPORT(const int max_s) { if(max_s > 0) MAX_SUPPORT = max_s; } /* setMAX_SUPPORT */ /***********************************************************************/ CglParam::CglParam(const double inf, const double eps, const double eps_c, const int max_s) : INFINIT(inf), EPS(eps), EPS_COEFF(eps_c), MAX_SUPPORT(max_s) {} /***********************************************************************/ CglParam::CglParam(const CglParam &source) : INFINIT(source.INFINIT), EPS(source.EPS), EPS_COEFF(source.EPS_COEFF), MAX_SUPPORT(source.MAX_SUPPORT) {} /***********************************************************************/ CglParam* CglParam::clone() const { return new CglParam(*this); } /***********************************************************************/ CglParam& CglParam::operator=(const CglParam &rhs) { if(this != &rhs) { INFINIT = rhs.INFINIT; EPS = rhs.EPS; EPS_COEFF = rhs.EPS_COEFF; MAX_SUPPORT = rhs.MAX_SUPPORT; } return *this; } /***********************************************************************/ CglParam::~CglParam() {} Cgl-0.58.9/src/CglGomory/0000755000076600007660000000000012377555671013513 5ustar coincoinCgl-0.58.9/src/CglGomory/Makefile.am0000644000076600007660000000326711621724114015534 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglGomory # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglGomory.la # List all source files for this library, including headers libCglGomory_la_SOURCES = CglGomory.cpp CglGomory.hpp CglGomoryTest.cpp # This is for libtool (on Windows) libCglGomory_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) if COIN_HAS_OSICLP AM_CPPFLAGS += $(OSICLP_CFLAGS) endif # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglGomory.hpp Cgl-0.58.9/src/CglGomory/CglGomory.hpp0000644000076600007660000001442612130104734016106 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). #ifndef CglGomory_H #define CglGomory_H #include #include "CglCutGenerator.hpp" class CoinWarmStartBasis; /** Gomory Cut Generator Class */ class CglGomory : public CglCutGenerator { friend void CglGomoryUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /**@name Generate Cuts */ //@{ /** Generate Mixed Integer Gomory cuts for the model of the solver interface, si. Insert the generated cuts into OsiCut, cs. There is a limit option, which will only generate cuts with less than this number of entries. We can also only look at 0-1 variables a certain distance from integer. */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /** Generates cuts given matrix and solution etc, returns number of cuts generated */ int generateCuts( const OsiRowCutDebugger * debugger, OsiCuts & cs, const CoinPackedMatrix & columnCopy, const CoinPackedMatrix & rowCopy, const double * colsol, const double * colLower, const double * colUpper, const double * rowLower, const double * rowUpper, const char * intVar , const CoinWarmStartBasis* warm, const CglTreeInfo info = CglTreeInfo()); /** Generates cuts given matrix and solution etc, returns number of cuts generated (no row copy passed in) */ int generateCuts( const OsiRowCutDebugger * debugger, OsiCuts & cs, const CoinPackedMatrix & columnCopy, const double * colsol, const double * colLower, const double * colUpper, const double * rowLower, const double * rowUpper, const char * intVar , const CoinWarmStartBasis* warm, const CglTreeInfo info = CglTreeInfo()); /// Return true if needs optimal basis to do cuts (will return true) virtual bool needsOptimalBasis() const { return true; } //@} /**@name Change way Gomory works */ //@{ /// Pass in a copy of original solver (clone it) void passInOriginalSolver(OsiSolverInterface * solver); /// Returns original solver inline OsiSolverInterface * originalSolver() const { return originalSolver_;} /// Set type - 0 normal, 1 add original matrix one, 2 replace inline void setGomoryType(int type) { gomoryType_=type;} /// Return type inline int gomoryType() const { return gomoryType_;} //@} /**@name Change limit on how many variables in cut (default 50) */ //@{ /// Set void setLimit(int limit); /// Get int getLimit() const; /// Set at root (if #include #include #include #include #include //#define CGL_DEBUG 1 //#ifdef NDEBUG //#undef NDEBUG //#endif #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinIndexedVector.hpp" #include "OsiRowCutDebugger.hpp" #define COIN_HAS_CLP_GOMORY #ifdef COIN_HAS_CLP_GOMORY #include "OsiClpSolverInterface.hpp" #endif #include "CoinFactorization.hpp" #undef CLP_OSL #if 1 #define CLP_OSL 1 #if CLP_OSL!=1&&CLP_OSL!=3 #undef CLP_OSL #else #include "CoinOslFactorization.hpp" #endif #endif #include "CoinWarmStartBasis.hpp" #include "CglGomory.hpp" #include "CoinFinite.hpp" #ifdef CGL_DEBUG_GOMORY int gomory_try=CGL_DEBUG_GOMORY; #endif //------------------------------------------------------------------- // Generate Gomory cuts //------------------------------------------------------------------- void CglGomory::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info) { #ifdef CGL_DEBUG_GOMORY gomory_try++; #endif // Get basic problem information int numberColumns=si.getNumCols(); // get integer variables and basis char * intVar = new char[numberColumns]; int i; CoinWarmStart * warmstart = si.getWarmStart(); CoinWarmStartBasis* warm = dynamic_cast(warmstart); const double * colUpper = si.getColUpper(); const double * colLower = si.getColLower(); //#define CLP_INVESTIGATE2 #ifndef CLP_INVESTIGATE2 if ((info.options&16)!=0) #endif printf("%d %d %d\n",info.inTree,info.options,info.pass); for (i=0;icolLower[i]+0.5) { if (fabs(colUpper[i]-1.0)<1.0e-12&&fabs(colLower[i])<1.0e-12) { intVar[i]=1; //0-1 } else if (colLower[i]>=0.0) { intVar[i] = 2; // other } else { // negative bounds - I am not sure works intVar[i] = 0; } } else { intVar[i] = 0; } } else { intVar[i]=0; } } const OsiSolverInterface * useSolver=&si; #ifdef COIN_HAS_CLP_GOMORY double * objective = NULL; OsiClpSolverInterface * clpSolver = dynamic_cast(originalSolver_); int numberOriginalRows = -1; if (clpSolver) { useSolver = originalSolver_; assert (gomoryType_); // check simplex is plausible if (!clpSolver->getNumRows()||numberColumns!=clpSolver->getNumCols()) { delete originalSolver_; originalSolver_=si.clone(); clpSolver = dynamic_cast(originalSolver_); assert (clpSolver); useSolver = originalSolver_; } ClpSimplex * simplex = clpSolver->getModelPtr(); numberOriginalRows = simplex->numberRows(); int numberRows = si.getNumRows(); assert (numberOriginalRows<=numberRows); // only do if different (unless type 2x) int gomoryType = gomoryType_%10; int whenToDo = gomoryType_/10; if (whenToDo==2 ||(numberRows>numberOriginalRows && whenToDo==1 && (info.options&512)==0) || ((info.options&1024)!=0 && (info.options&512)==0 && numberTimesStalled_<3)) { // bounds memcpy(simplex->columnLower(),colLower,numberColumns*sizeof(double)); memcpy(simplex->columnUpper(),colUpper,numberColumns*sizeof(double)); double * obj = simplex->objective(); objective = CoinCopyOfArray(obj,numberColumns); const double * pi = si.getRowPrice(); const CoinPackedMatrix * rowCopy = si.getMatrixByRow(); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * rowElements = rowCopy->getElements(); const double * rowLower = si.getRowLower(); const double * rowUpper = si.getRowUpper(); int numberCopy; int numberAdd; double * rowLower2 = NULL; double * rowUpper2 = NULL; int * column2 = NULL; CoinBigIndex * rowStart2 = NULL; double * rowElements2 = NULL; char * copy = new char [numberRows-numberOriginalRows]; memset(copy,0,numberRows-numberOriginalRows); if (gomoryType==2) { numberCopy=0; numberAdd=0; for (int iRow=numberOriginalRows;iRow0.5) obj[i] -= randomNumber*0.001*fabs(obj[i]); else obj[i] += randomNumber*0.001*fabs(obj[i]); } } #endif if (numberCopy) { clpSolver->addRows(numberCopy, rowStart2,column2,rowElements2, rowLower2,rowUpper2); delete [] rowLower2 ; delete [] rowUpper2 ; delete [] column2 ; delete [] rowStart2 ; delete [] rowElements2 ; } delete [] copy; memcpy(simplex->primalColumnSolution(),si.getColSolution(), numberColumns*sizeof(double)); warm->resize(numberOriginalRows,numberColumns); clpSolver->setBasis(*warm); delete warm; simplex->setDualObjectiveLimit(COIN_DBL_MAX); simplex->setLogLevel(0); simplex->primal(1); // check basis int numberTotal=simplex->numberRows()+simplex->numberColumns(); int superbasic=0; for (int i=0;igetStatus(i)==ClpSimplex::superBasic) superbasic++; } if (superbasic) { //printf("%d superbasic!\n",superbasic); simplex->dual(); superbasic=0; for (int i=0;igetStatus(i)==ClpSimplex::superBasic) superbasic++; } assert (!superbasic); } //printf("Trying - %d its status %d objs %g %g - with offset %g\n", // simplex->numberIterations(),simplex->status(), // simplex->objectiveValue(),si.getObjValue(),simplex->objectiveValue()+offset); //simplex->setLogLevel(0); warm=simplex->getBasis(); warmstart=warm; if (simplex->status()) { //printf("BAD status %d\n",simplex->status()); //clpSolver->writeMps("clp"); //si.writeMps("si"); delete [] objective; objective=NULL; useSolver=&si; } } else { // don't do delete warmstart; warmstart=NULL; if ((info.options&1024)==0) numberTimesStalled_=0; } } #endif #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&!debugger->onOptimalPath(si)) debugger = NULL; #else const OsiRowCutDebugger * debugger = NULL; #endif int numberRowCutsBefore = cs.sizeRowCuts(); if (warmstart) generateCuts(debugger, cs, *useSolver->getMatrixByCol(), *useSolver->getMatrixByRow(), useSolver->getColSolution(), useSolver->getColLower(), useSolver->getColUpper(), useSolver->getRowLower(), useSolver->getRowUpper(), intVar,warm,info); #ifdef COIN_HAS_CLP_GOMORY if (objective) { ClpSimplex * simplex = clpSolver->getModelPtr(); memcpy(simplex->objective(),objective,numberColumns*sizeof(double)); delete [] objective; // take out locally useless cuts const double * solution = si.getColSolution(); double primalTolerance = 1.0e-7; int numberRowCutsAfter = cs.sizeRowCuts(); for (int k = numberRowCutsAfter - 1; k >= numberRowCutsBefore; k--) { const OsiRowCut * thisCut = cs.rowCutPtr(k) ; double sum = 0.0; int n = thisCut->row().getNumElements(); const int * column = thisCut->row().getIndices(); const double * element = thisCut->row().getElements(); assert (n); for (int i = 0; i < n; i++) { double value = element[i]; sum += value * solution[column[i]]; } if (sum > thisCut->ub() + primalTolerance) { sum = sum - thisCut->ub(); } else if (sum < thisCut->lb() - primalTolerance) { sum = thisCut->lb() - sum; } else { sum = 0.0; } if (!sum) { // take out cs.eraseRowCut(k); } } #ifdef CLP_INVESTIGATE2 printf("OR %p pass %d inTree %c - %d cuts (but %d deleted)\n", originalSolver_,info.pass,info.inTree?'Y':'N', numberRowCutsAfter-numberRowCutsBefore, numberRowCutsAfter-cs.sizeRowCuts()); #endif } #endif delete warmstart; delete [] intVar; if ((!info.inTree&&((info.options&4)==4||((info.options&8)&&!info.pass))) ||(info.options&16)!=0) { int limit = maximumLengthOfCutInTree(); int numberRowCutsAfter = cs.sizeRowCuts(); for (int i=numberRowCutsBefore;irow().getNumElements(); if (length<=limit) cs.rowCutPtr(i)->setGloballyValid(); } } if ((gomoryType_%10)==2) { // back to original assert(clpSolver); int numberRows = clpSolver->getNumRows(); if (numberRows>numberOriginalRows) { int numberDelete = numberRows-numberOriginalRows; int * delRow = new int [numberDelete]; for (int i=0;ideleteRows(numberDelete,delRow); delete [] delRow; } } } // Returns value - floor but allowing for small errors inline double above_integer(double value) { double value2=floor(value); double value3=floor(value+0.5); if (fabs(value3-value)<1.0e-7*(fabs(value3)+1.0)) return 0.0; return value-value2; } //------------------------------------------------------------------- // 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; #if CGL_DEBUG>1 printf("gcd of %d and %d\n",a,b); int nLoop=0; #endif // 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) { #if CGL_DEBUG>1 nLoop++; if (nLoop>50) { abort(); return -1; } #endif remainder = b % a; b = a; a = remainder; } #if CGL_DEBUG>1 printf("=> %d\n",b); #endif return b; } //------------------------------------------------------------------- // Returns the nearest rational with denominator < maxDenominator //------------------------------------------------------------------- typedef struct { int numerator; int denominator; } Rational; inline Rational nearestRational(double value, int maxDenominator) { Rational tryThis; Rational tryA; Rational tryB; double integerPart; #if CGL_DEBUG>1 printf("Rational of %g is ",value); #endif int nLoop=0; tryA.numerator=0; tryA.denominator=1; tryB.numerator=1; tryB.denominator=0; if (fabs(value)<1.0e-10) return tryA; integerPart = floor(value); value -= integerPart; tryThis.numerator = tryB.numerator* static_cast (integerPart) + tryA.numerator; tryThis.denominator = tryB.denominator* static_cast (integerPart) + tryA.denominator; tryA = tryB; tryB = tryThis; while (value>1.0e-10 && tryB.denominator <=maxDenominator) { nLoop++; if (nLoop>50) { Rational bad; bad.numerator=-1; bad.denominator=-1; #if CGL_DEBUG>1 printf(" *** bad rational\n"); #endif return bad; } value = 1.0/value; integerPart = floor(value+1.0e-10); value -= integerPart; tryThis.numerator = tryB.numerator* static_cast (integerPart) + tryA.numerator; tryThis.denominator = tryB.denominator* static_cast(integerPart) + tryA.denominator; tryA = tryB; tryB = tryThis; } if (tryB.denominator <= maxDenominator) { #if CGL_DEBUG>1 printf("%d/%d\n",tryB.numerator,tryB.denominator); #endif return tryB; } else { #if CGL_DEBUG>1 printf("%d/%d\n",tryA.numerator,tryA.denominator); #endif return tryA; } } // Does actual work - returns number of cuts int CglGomory::generateCuts( #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger, #else const OsiRowCutDebugger * , #endif OsiCuts & cs, const CoinPackedMatrix & columnCopy, const CoinPackedMatrix & rowCopy, const double * colsol, const double * colLower, const double * colUpper, const double * rowLower, const double * rowUpper, const char * intVar, const CoinWarmStartBasis* warm, const CglTreeInfo info) { int infoOptions=info.options; bool globalCuts = (infoOptions&16)!=0; double testFixed = (!globalCuts) ? 1.0e-8 : -1.0; // get what to look at double away = info.inTree ? away_ : CoinMin(away_,awayAtRoot_); int numberRows=columnCopy.getNumRows(); int numberColumns=columnCopy.getNumCols(); int numberElements=columnCopy.getNumElements(); // Allow bigger length on initial matrix (if special setting) //if (limit==512&&!info.inTree&&!info.pass) //limit=1024; // Start of code to create a factorization from warm start (A) ==== // check factorization is okay CoinFactorization factorization; #ifdef CLP_OSL CoinOslFactorization * factorization2=NULL; if (alternateFactorization_) { factorization2 = new CoinOslFactorization(); } #endif // We can either set increasing rows so ...IsBasic gives pivot row // or we can just increment iBasic one by one // for now let ...iBasic give pivot row int status=-100; // probably could use pivotVariables from OsiSimplexModel int * rowIsBasic = new int[numberRows]; int * columnIsBasic = new int[numberColumns]; int i; int numberBasic=0; for (i=0;igetArtifStatus(i) == CoinWarmStartBasis::basic) { rowIsBasic[i]=1; numberBasic++; } else { rowIsBasic[i]=-1; } } for (i=0;igetStructStatus(i) == CoinWarmStartBasis::basic) { columnIsBasic[i]=1; numberBasic++; } else { columnIsBasic[i]=-1; } } //returns 0 -okay, -1 singular, -2 too many in basis, -99 memory */ while (status<-98) { #ifdef CLP_OSL if (!alternateFactorization_) { #endif status=factorization.factorize(columnCopy, rowIsBasic, columnIsBasic); if (status==-99) factorization.areaFactor(factorization.areaFactor() * 2.0); #ifdef CLP_OSL } else { double areaFactor=1.0; status=factorization2->factorize(columnCopy, rowIsBasic, columnIsBasic,areaFactor); if (status==-99) areaFactor *= 2.0; } #endif } if (status) { #ifdef COIN_DEVELOP std::cout<<"Bad factorization of basis - status "<conditionNumber(); #else double relaxation = factorization.conditionNumber(); #endif #ifdef COIN_DEVELOP_z if (relaxation>1.0e49) printf("condition %g\n",relaxation); #endif relaxation *= conditionNumberMultiplier_; double bounds[2]={-COIN_DBL_MAX,0.0}; int iColumn,iRow; const int * column = rowCopy.getIndices(); const CoinBigIndex * rowStart = rowCopy.getVectorStarts(); const int * rowLength = rowCopy.getVectorLengths(); const double * rowElements = rowCopy.getElements(); const int * row = columnCopy.getIndices(); const CoinBigIndex * columnStart = columnCopy.getVectorStarts(); const int * columnLength = columnCopy.getVectorLengths(); const double * columnElements = columnCopy.getElements(); // we need to do book-keeping for variables at ub double tolerance = 1.0e-7; bool * swap= new bool [numberColumns]; for (iColumn=0;iColumnrowLower[iRow]+1.0e-7) { int type=0; double rhs=0.0; if (rowActivity[iRow]>=rowUpper[iRow]-1.0e-7) { type=1; rhs=rowUpper[iRow]; } else if (rowActivity[iRow]<=rowLower[iRow]+1.0e-7) { type=2; rhs=rowLower[iRow]; } else { // probably large rhs if (rowActivity[iRow]-rowLower[iRow]< rowUpper[iRow]-rowActivity[iRow]) rowType[iRow]=2; else rowType[iRow]=1; #ifdef CGL_DEBUG assert (CoinMin(rowUpper[iRow]-rowActivity[iRow], rowActivity[iRow]-rowUpper[iRow])<1.0e-5); //abort(); continue; #else continue; #endif } if (above_integer(rhs)<1.0e-10) { // could be integer slack bool allInteger=true; int k; for (k=rowStart[iRow]; k1.0e-10) { // not integer slacks allInteger=false; break; } } if (allInteger) { type |= 4; } } rowType[iRow]=type; } else { // row is equality or basic rowType[iRow]=0; } } // Start of code to create work arrays for factorization (B) ==== // two vectors for updating (one is work) CoinIndexedVector work; CoinIndexedVector array; // make sure large enough work.reserve(numberRows); array.reserve(numberRows); int * arrayRows = array.getIndices(); double * arrayElements = array.denseVector(); // End of code to create work arrays (B) ==== int numberAdded=0; // we also need somewhere to accumulate cut CoinIndexedVector cutVector; cutVector.reserve(numberColumns+1); int * cutIndex = cutVector.getIndices(); double * cutElement = cutVector.denseVector(); // and for packed form (as not necessarily in order) // also space for sort bool doSorted = (infoOptions&256)!=0; int lengthArray = static_cast(numberColumns+1+((numberColumns+1)*sizeof(int))/sizeof(double)); if (doSorted) lengthArray+=numberColumns; double * packed = new double[lengthArray]; double * sort = packed+numberColumns+1; int * which = reinterpret_cast(doSorted ? (sort+numberColumns): (sort)); double tolerance1=1.0e-6; double tolerance2=0.9; double tolerance3=1.0e-4; double tolerance6=1.0e-6; double tolerance9=1.0e-4; #define MORE_GOMORY_CUTS 1 #ifdef CLP_INVESTIGATE2 int saveLimit = info.inTree ? 50 : 1000; #else #if MORE_GOMORY_CUTS==2||MORE_GOMORY_CUTS==3 int saveLimit; #endif #endif // get limit on length of cut int limit = 0; if (!limit_) dynamicLimitInTree_ = CoinMax(50,numberColumns/40); if (!info.inTree) { limit = limitAtRoot_; if (!info.pass) { tolerance1=1.0; tolerance2=1.0e-2; tolerance3=1.0e-6; tolerance6=1.0e-7; tolerance9=1.0e-5; if (!limit) limit=numberColumns; } else { if((infoOptions&32)==0/*&&numberTimesStalled_<3*/) { if (!limit) { if(numberElements>8*numberColumns) limit=numberColumns; else limit = CoinMax(1000,numberRows/4); } } else { limit=numberColumns; numberTimesStalled_++; } } } else { limit = limit_; if (!limit) { if (!info.pass) limit = dynamicLimitInTree_; else limit=50; } } // If big - allow for rows if (limit>=numberColumns) limit += numberRows; #ifdef CLP_INVESTIGATE2 if (limit>saveLimit&&!info.inTree&&(infoOptions&512)==0) printf("Gomory limit changed from %d to %d, inTree %c, pass %d, r %d,c %d,e %d\n", saveLimit,limit,info.inTree ? 'Y' : 'N',info.pass, numberRows,numberColumns,numberElements); #endif int nCandidates=0; for (iColumn=0;iColumn=0&&intVar[iColumn]) { double reducedValue=above_integer(colsol[iColumn]); //printf("col %d bas %d val %.18g\n",iColumn,iBasic,colsol[iColumn]); if(intVar[iColumn]&&reducedValue<1.0-away&&reducedValue>away) { if (doSorted) sort[nCandidates]=fabs(0.5-reducedValue); which[nCandidates++]=iColumn; } } } int nTotalEls=COIN_INT_MAX; if (doSorted) { CoinSort_2(sort,sort+nCandidates,which); int nElsNow = columnCopy.getNumElements(); int nAdd; int nAdd2; int nReasonable; int depth=info.level; if (depth<2) { nAdd=10000; if (info.pass>0) nAdd = CoinMin(nAdd,nElsNow+2*numberRows); nAdd2 = 5*numberColumns; nReasonable = CoinMax(nAdd2,nElsNow/8+nAdd); if (!depth&&!info.pass) { // allow more nAdd += nElsNow/2; nAdd2 += nElsNow/2; nReasonable += nElsNow/2; limit=numberRows+numberColumns; } } else { nAdd = 200; nAdd2 = 2*numberColumns; nReasonable = CoinMax(nAdd2,nElsNow/8+nAdd); } nTotalEls=nReasonable; } #ifdef MORE_GOMORY_CUTS int saveTotalEls=nTotalEls; #endif #if MORE_GOMORY_CUTS==2||MORE_GOMORY_CUTS==3 saveLimit=limit; if (doSorted) limit=numberRows+numberColumns; OsiCuts longCuts; #endif #if MORE_GOMORY_CUTS==1||MORE_GOMORY_CUTS==3 OsiCuts secondaryCuts; #endif for (int kColumn=0;kColumn=0) { // Debug code below computes tableau column of basic ==== int j; #ifdef CGL_DEBUG { // put column into array array.setVector(columnLength[iColumn],row+columnStart[iColumn], columnElements+columnStart[iColumn]); // get column in tableau #ifdef CLP_OSL if (!alternateFactorization_) #endif factorization.updateColumn ( &work, &array ); #ifdef CLP_OSL else factorization2->updateColumn ( &work, &array ); #endif int nn=0; int numberInArray=array.getNumElements(); for (j=0;j1.0e-5) { assert (fabs(value-1.0)<1.0e-7); assert (indexValue==iBasic); nn++; } } assert (nn==1); array.clear(); work.checkClear(); } #endif array.clear(); assert(intVar[iColumn]&&reducedValue<1.0-away&&reducedValue>away); { #ifdef CGL_DEBUG cutVector.checkClear(); #endif // get row of tableau double one =1.0; array.setVector(1,&iBasic,&one); int numberNonInteger=0; //Code below computes tableau row ==== // get pi #ifdef CLP_OSL if (!alternateFactorization_) #endif factorization.updateColumnTranspose ( &work, &array ); #ifdef CLP_OSL else factorization2->updateColumnTranspose ( &work, &array ); #endif int numberInArray=array.getNumElements(); #ifdef CGL_DEBUG // check pivot on iColumn { double value=0.0; int k; // add in row of tableau for (k=columnStart[iColumn]; kcolLower[j]+testFixed) { double value=0.0; int k; // add in row of tableau for (k=columnStart[j];k1 if (iColumn==52) printf("for basic %d, column %d has alpha %g, colsol %g\n", iColumn,j,value,colsol[j]); #endif // deal with bounds if (swap[j]) { //reducedValue -= value*colUpper[j]; // negate value = - value; } else { //reducedValue -= value*colLower[j]; } #if CGL_DEBUG>1 if (iColumn==52) printf("%d value %g reduced %g int %d rhs %g swap %d\n", j,value,reducedValue,intVar[j],rhs,swap[j]); #endif double coefficient; if (intVar[j]) { // integer coefficient = above_integer(value); if (coefficient > reducedValue) { coefficient = ratio * (1.0-coefficient); } } else { // continuous numberNonInteger++; if (value > 0.0) { coefficient = value; } else { //??? sign wrong in book coefficient = -ratio*value; } } if (swap[j]) { // negate coefficient = - coefficient; rhs += colUpper[j]*coefficient; } else { rhs += colLower[j]*coefficient; } if (fabs(coefficient)>= COIN_INDEXED_TINY_ELEMENT) { cutElement[j] = coefficient; cutIndex[number++]=j; // If too many - break from loop if (number>limit) break; } } } else { // basic continue; } } cutVector.setNumElements(number); // If too many - just clear vector and skip if (number>limit) { cutVector.clear(); continue; } //check will be cut //reducedValue=above_integer(reducedValue); rhs += reducedValue; double violation = reducedValue; #ifdef CGL_DEBUG std::cout<<"cut has violation of "<=1.0e-16) { if ((type&1)==0) { // negate to get correct coefficient value = - value; } double coefficient; if ((type&4)!=0) { // integer coefficient = above_integer(value); if (coefficient > reducedValue) { coefficient = ratio * (1.0-coefficient); } } else { numberNonInteger++; // continuous if (value > 0.0) { coefficient = value; } else { coefficient = -ratio*value; } } if ((type&1)!=0) { // slack at ub - treat as +1.0 rhs -= coefficient*rowUpper[iRow]; } else { // negate yet again ? coefficient = - coefficient; rhs -= coefficient*rowLower[iRow]; } int k; for (k=rowStart[iRow]; k1.0e-8) { sum+=value*colsol[jColumn]; packed[number]=value; cutIndex[number++]=jColumn; } else { #define LARGE_BOUND 1.0e20 // small - adjust rhs if rhs reasonable if (value>0.0&&colLower[jColumn]>-LARGE_BOUND) { rhs -= value*colLower[jColumn]; #if MORE_GOMORY_CUTS==1||MORE_GOMORY_CUTS==3 // weaken violation violation2 -= fabs(value*(colsol[jColumn]-colLower[jColumn])); #endif } else if (value<0.0&&colUpper[jColumn]1.0e-13) { // take anyway sum+=value*colsol[jColumn]; packed[number]=value; cutIndex[number++]=jColumn; } } } // Final test on number //if (number>limit) //continue; // say zeroed out cutVector.setNumElements(0); bool accurate2=false; double difference=fabs((sum-rhs)-violation); double useTolerance; if (tolerance1>0.99) { // use absolute useTolerance = tolerance; } else { double rhs2=CoinMax(fabs(rhs),10.0); useTolerance=rhs2*0.1*tolerance1; } bool accurate = (differencerhs+tolerance2*away&& (accurate||accurate2)) { //#ifdef CGL_DEBUG #ifdef CGL_DEBUG #if CGL_DEBUG<=1 if (number<=-10) { #endif for (j=0;j %g \n",value,dxInt); #endif if (dxInt>1.0e9||fabs(dxInt-xInt[j])> 1.0e-8) { nOverflow++; break; } } if (nOverflow){ #ifdef CGL_DEBUG printf("Gomory Scaling: Warning: Overflow detected \n"); #endif numberNonInteger=-1; } else { // find greatest common divisor of the elements j=0; while (!xInt[j]) j++; // skip zeros int thisGcd = gcd(xInt[j],xInt[j+1]); j++; for (;j0.0) newOne=xInt[j]/thisGcd; else newOne=-xInt[j]/thisGcd; if (fabs(((double) newOne)-old)> 1.0e-10*(fabs(newOne)+1.0)) { // say no good - first see if happens printf("Fix this test 456 - just skip\n"); abort(); } } #endif #if CGL_DEBUG>1 printf("The gcd of xInt is %i\n",thisGcd); #endif // construct new cut by dividing through by gcd and double minMultiplier=1.0e100; double maxMultiplier=0.0; for (j=0; j0.0) { packed[j]=xInt[j]/thisGcd; } else { packed[j]=-xInt[j]/thisGcd; } #if CGL_DEBUG>1 printf("%g => %g \n",old,packed[j]); #endif if (packed[j]) { if (fabs(packed[j])>maxMultiplier*fabs(old)) maxMultiplier = packed[j]/old; if (fabs(packed[j])0.9999&&maxMultiplier/minMultiplier<1.0001); } } // erase cutElement CoinFillN(cutElement,number+1,0.0); } else { // relax rhs a tiny bit rhs += 1.0e-8; // relax if lots of elements for mixed gomory if (number>=20) { rhs += 1.0e-7*(static_cast (number/20)); } } // Take off tiny elements // for first pass reject #ifndef CGL_GOMORY_TINY_ELEMENT #define CGL_GOMORY_TINY_ELEMENT 1.0e-12 #endif { int i,number2=number; number=0; double largest=0.0; double smallest=1.0e30; for (i=0;i0.0) rhs -= value*colLower[iColumn]; else rhs += value*colUpper[iColumn]; } else { // throw away number=limit+1; numberNonInteger=1; break; } } else { int iColumn = cutIndex[i]; if (colUpper[iColumn]!=colLower[iColumn]||globalCuts) { largest=CoinMax(largest,value); smallest=CoinMin(smallest,value); cutIndex[number]=cutIndex[i]; packed[number++]=packed[i]; } else { // fixed so subtract out rhs -= packed[i]*colLower[iColumn]; } } } if (largest>1.0e10*smallest||(number>20&&smallest1.0e9*smallest) { #ifdef CLP_INVESTIGATE2 printf("WOuld reject %g %g ratio %g\n",smallest,largest, smallest/largest); #endif #if MORE_GOMORY_CUTS==1||MORE_GOMORY_CUTS==3 accurate=false; #endif } } if (number50&&numberNonInteger) bounds[1] = rhs+tolerance6+1.0e-8*fabs(rhs); // weaken double test = CoinMin(largestFactor*largestFactorMultiplier_, relaxation); if (number>5&&numberNonInteger&&test>1.0e-20) { #ifdef CLP_INVESTIGATE2 printf("relaxing rhs by %g - largestFactor was %g, rel %g\n", CoinMin(test*fabs(rhs),tolerance9),largestFactor,relaxation); #endif //bounds[1] = CoinMax(bounds[1], // rhs+CoinMin(test*fabs(rhs),tolerance9)); // weaken bounds[1] = bounds[1]+CoinMin(test*fabs(rhs),tolerance9); // weaken } #ifdef MORE_GOMORY_CUTS if (accurate) { #else { #endif OsiRowCut rc; rc.setRow(number,cutIndex,packed,false); rc.setLb(bounds[0]); rc.setUb(bounds[1]); #if MORE_GOMORY_CUTS<2 nTotalEls -= number; cs.insert(rc); #else if(number1 { // put column into array array.setVector(columnLength[iColumn],row+columnStart[iColumn], columnElements+columnStart[iColumn]); // get column in tableau #ifdef CLP_OSL if (!alternateFactorization_) #endif factorization.updateColumn ( &work, &array ); #ifdef CLP_OSL else factorization2->updateColumn ( &work, &array ); #endif int numberInArray=array.getNumElements(); printf("non-basic %d\n",iColumn); for (int j=0;j1.0e-6) { printf("%d %g\n",indexValue,value); } } } #endif } } #ifdef CLP_OSL delete factorization2; #endif delete [] rowActivity; delete [] swap; delete [] rowType; delete [] packed; delete [] rowIsBasic; delete [] columnIsBasic; #ifdef MORE_GOMORY_CUTS #if MORE_GOMORY_CUTS==1 int numberInaccurate = secondaryCuts.sizeRowCuts(); #ifdef CLP_INVESTIGATE2 int numberOrdinary = numberAdded-numberInaccurate; if (!info.inTree&&(infoOptions&512)==0) printf("Gomory has %d ordinary and %d less accurate cuts(%d els)\n", numberOrdinary,numberInaccurate,saveTotalEls-nTotalEls); #endif #elif MORE_GOMORY_CUTS==2 int numberLong = longCuts.sizeRowCuts(); #ifdef CLP_INVESTIGATE2 int numberOrdinary = numberAdded-numberLong; if (!info.inTree&&(infoOptions&512)==0) printf("Gomory has %d ordinary and %d long cuts(%d els)\n", numberOrdinary,numberLong,saveTotalEls-nTotalEls); #endif #elif MORE_GOMORY_CUTS==3 int numberLong = longCuts.sizeRowCuts(); int numberInaccurate = secondaryCuts.sizeRowCuts(); #ifdef CLP_INVESTIGATE2 int numberOrdinary = numberAdded-numberLong-numberInaccurate; if (!info.inTree&&(infoOptions&512)==0) printf("Gomory has %d ordinary, %d long and %d less accurate cuts(%d els)\n", numberOrdinary,numberLong,numberInaccurate,saveTotalEls-nTotalEls); #endif #endif if (doSorted&&limit0) { for (int i=0;irow().getNumElements(); cs.insert(longCuts.rowCut(i)); numberAdded ++; if (nTotalEls<=0) break; } break; } #endif #if MORE_GOMORY_CUTS==1||MORE_GOMORY_CUTS==3 while (nTotalEls>0) { for (int i=0;irow().getNumElements(); cs.insert(secondaryCuts.rowCut(i)); numberAdded ++; if (nTotalEls<=0) break; } break; } #endif } #else #ifdef CLP_INVESTIGATE2 if (!info.inTree&&(infoOptions&512)==0) printf("Gomory added %d cuts(%d els)\n",numberAdded,saveTotalEls-nTotalEls); #endif #endif return numberAdded; } // Limit stuff void CglGomory::setLimit(int limit) { if (limit>=0) limit_=limit; } int CglGomory::getLimit() const { return limit_; } // Limit stuff at root void CglGomory::setLimitAtRoot(int limit) { if (limit>=0) limitAtRoot_=limit; } int CglGomory::getLimitAtRoot() const { return limitAtRoot_; } // Return maximum length of cut in tree int CglGomory::maximumLengthOfCutInTree() const { if (limit_) return limit_; else return dynamicLimitInTree_; } // Away stuff void CglGomory::setAway(double value) { if (value>0.0&&value<=0.5) away_=value; } double CglGomory::getAway() const { return away_; } // Away stuff at root void CglGomory::setAwayAtRoot(double value) { if (value>0.0&&value<=0.5) awayAtRoot_=value; } double CglGomory::getAwayAtRoot() const { return awayAtRoot_; } // ConditionNumberMultiplier stuff void CglGomory::setConditionNumberMultiplier(double value) { if (value>=0.0) conditionNumberMultiplier_=value; } double CglGomory::getConditionNumberMultiplier() const { return conditionNumberMultiplier_; } // LargestFactorMultiplier stuff void CglGomory::setLargestFactorMultiplier(double value) { if (value>=0.0) largestFactorMultiplier_=value; } double CglGomory::getLargestFactorMultiplier() const { return largestFactorMultiplier_; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglGomory::CglGomory () : CglCutGenerator(), away_(0.05), awayAtRoot_(0.05), conditionNumberMultiplier_(1.0e-18), largestFactorMultiplier_(1.0e-13), originalSolver_(NULL), limit_(50), limitAtRoot_(0), dynamicLimitInTree_(-1), alternateFactorization_(0), gomoryType_(0) { } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglGomory::CglGomory (const CglGomory & source) : CglCutGenerator(source), away_(source.away_), awayAtRoot_(source.awayAtRoot_), conditionNumberMultiplier_(source.conditionNumberMultiplier_), largestFactorMultiplier_(source.largestFactorMultiplier_), originalSolver_(NULL), limit_(source.limit_), limitAtRoot_(source.limitAtRoot_), dynamicLimitInTree_(source.dynamicLimitInTree_), alternateFactorization_(source.alternateFactorization_), gomoryType_(source.gomoryType_) { if (source.originalSolver_) originalSolver_ = source.originalSolver_->clone(); } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglGomory::clone() const { return new CglGomory(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglGomory::~CglGomory () { delete originalSolver_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglGomory & CglGomory::operator=(const CglGomory& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); away_=rhs.away_; awayAtRoot_=rhs.awayAtRoot_; conditionNumberMultiplier_ = rhs.conditionNumberMultiplier_; largestFactorMultiplier_ = rhs.largestFactorMultiplier_; limit_=rhs.limit_; limitAtRoot_=rhs.limitAtRoot_; dynamicLimitInTree_ = rhs.dynamicLimitInTree_; alternateFactorization_=rhs.alternateFactorization_; gomoryType_ = rhs.gomoryType_; delete originalSolver_; if (rhs.originalSolver_) originalSolver_ = rhs.originalSolver_->clone(); else originalSolver_=NULL; } return *this; } // This can be used to refresh any information void CglGomory::refreshSolver(OsiSolverInterface * solver) { int numberColumns=solver->getNumCols(); const double * colUpper = solver->getColUpper(); const double * colLower = solver->getColLower(); canDoGlobalCuts_ = true; if (originalSolver_) { delete originalSolver_; originalSolver_ = solver->clone(); } for (int i=0;iisInteger(i)) { if (colUpper[i]>colLower[i]+1.0) { canDoGlobalCuts_ = false; break; } } } } // Pass in a copy of original solver (clone it) void CglGomory::passInOriginalSolver(OsiSolverInterface * solver) { delete originalSolver_; if (solver) { if (!gomoryType_) gomoryType_=1; originalSolver_ = solver->clone(); } else { gomoryType_=0; originalSolver_=NULL; } } // Does actual work - returns number of cuts int CglGomory::generateCuts( const OsiRowCutDebugger * debugger, OsiCuts & cs, const CoinPackedMatrix & columnCopy, const double * colsol, const double * colLower, const double * colUpper, const double * rowLower, const double * rowUpper, const char * intVar, const CoinWarmStartBasis* warm, const CglTreeInfo info) { CoinPackedMatrix rowCopy; rowCopy.reverseOrderedCopyOf(columnCopy); return generateCuts( debugger, cs, columnCopy, rowCopy, colsol, colLower, colUpper, rowLower, rowUpper, intVar, warm, info); } // Create C++ lines to get to current state std::string CglGomory::generateCpp( FILE * fp) { CglGomory other; fprintf(fp,"0#include \"CglGomory.hpp\"\n"); fprintf(fp,"3 CglGomory gomory;\n"); if (limit_!=other.limit_) fprintf(fp,"3 gomory.setLimit(%d);\n",limit_); else fprintf(fp,"4 gomory.setLimit(%d);\n",limit_); if (limitAtRoot_!=other.limitAtRoot_) fprintf(fp,"3 gomory.setLimitAtRoot(%d);\n",limitAtRoot_); else fprintf(fp,"4 gomory.setLimitAtRoot(%d);\n",limitAtRoot_); if (away_!=other.away_) fprintf(fp,"3 gomory.setAway(%g);\n",away_); else fprintf(fp,"4 gomory.setAway(%g);\n",away_); if (awayAtRoot_!=other.awayAtRoot_) fprintf(fp,"3 gomory.setAwayAtRoot(%g);\n",awayAtRoot_); else fprintf(fp,"4 gomory.setAwayAtRoot(%g);\n",awayAtRoot_); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 gomory.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 gomory.setAggressiveness(%d);\n",getAggressiveness()); return "gomory"; } Cgl-0.58.9/src/CglGomory/CglGomoryTest.cpp0000644000076600007660000012012012130104734016726 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 #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CoinPackedMatrix.hpp" #include "OsiCuts.hpp" #include "CoinWarmStartBasis.hpp" #include "CglGomory.hpp" //-------------------------------------------------------------------------- // ** At present this does not use any solver void CglGomoryUnitTest( const OsiSolverInterface * baseSiP, const std::string mpsDir ) { CoinRelFltEq eq(0.000001); // Test default constructor { CglGomory aGenerator; assert (aGenerator.getLimit()==50); assert (aGenerator.getAway()==0.05); } // Test copy & assignment etc { CglGomory rhs; { CglGomory bGenerator; bGenerator.setLimit(99); bGenerator.setAway(0.2); CglGomory cGenerator(bGenerator); rhs=bGenerator; assert (rhs.getLimit()==99); assert (rhs.getAway()==0.2); } } // Test explicit form - all integer (pg 125 Wolsey) if (1) { OsiCuts osicuts; CglGomory test1; int i; int nOldCuts=0,nRowCuts; // matrix data //deliberate hiccup of 2 between 0 and 1 CoinBigIndex start[5]={0,4,7,8,9}; int length[5]={2,3,1,1,1}; int rows[11]={0,2,-1,-1,0,1,2,0,1,2}; double elements[11]={7.0,2.0,1.0e10,1.0e10,-2.0,1.0,-2.0,1,1,1}; CoinPackedMatrix matrix(true,3,5,8,elements,rows,start,length); // rim data (objective not used just yet) double rowLower[5]={14.0,3.0,3.0,1.0e10,1.0e10}; double rowUpper[5]={14.0,3.0,3.0,-1.0e10,-1.0e10}; double colLower[7]={0.0,0.0,0.0,0.0,0.0,0.0,0.0}; double colUpper[7]={100.0,100.0,100.0,100.0,100.0,100.0,100.0}; // integer char intVar[7]={2,2,2,2,2,2,2}; // basis 1 int rowBasis1[3]={-1,-1,-1}; int colBasis1[5]={1,1,-1,-1,1}; CoinWarmStartBasis warm; warm.setSize(5,3); for (i=0;i<3;i++) { if (rowBasis1[i]<0) { warm.setArtifStatus(i,CoinWarmStartBasis::atLowerBound); } else { warm.setArtifStatus(i,CoinWarmStartBasis::basic); } } for (i=0;i<5;i++) { if (colBasis1[i]<0) { warm.setStructStatus(i,CoinWarmStartBasis::atLowerBound); } else { warm.setStructStatus(i,CoinWarmStartBasis::basic); } } // solution 1 double colsol1[5]={20.0/7.0,3.0,0.0,0.0,23.0/7.0}; test1.generateCuts(NULL, osicuts, matrix, /*objective,*/ colsol1, colLower, colUpper, rowLower, rowUpper, intVar, &warm); nRowCuts = osicuts.sizeRowCuts(); std::cout<<"There are "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<ub + 1.0e-7 ||sum2 < lb - 1.0e-7) { std::cout<<"Cut "<clone(); std::string fn(mpsDir+"p0033"); siP->readMps(fn.c_str(),"mps"); siP->activateRowCutDebugger("p0033"); CglGomory test; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); std::cout<<"Initial LP value: "<setColSolution(mycs); ****/ OsiCuts cuts; // Test generateCuts method test.generateCuts(*siP,cuts); int nRowCuts = cuts.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); std::cout<<"LP value with cuts: "< 2550.0 ); assert( lpRelaxBefore < lpRelaxAfter ); assert(lpRelaxAfter < 3089.1); delete siP; } } Cgl-0.58.9/src/Makefile.in0000644000076600007660000007105612253611530013643 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@ @DEPENDENCY_LINKING_TRUE@am__append_1 = $(CGLLIB_LIBS) subdir = src DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/config_cgl.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_cgl.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) am__DEPENDENCIES_1 = @DEPENDENCY_LINKING_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am_libCgl_la_OBJECTS = CglCutGenerator.lo CglMessage.lo CglStored.lo \ CglParam.lo CglTreeInfo.lo libCgl_la_OBJECTS = $(am_libCgl_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 = $(libCgl_la_SOURCES) DIST_SOURCES = $(libCgl_la_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 includecoinHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(includecoin_HEADERS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 # We need to recurse into all Cgl subproject subdirectories SUBDIRS = $(CGL_SUBDIRS) ######################################################################## # libCgl # ######################################################################## # Name of the library compiled in this directory. We want it to be installed # in the $libdir directory lib_LTLIBRARIES = libCgl.la # List all source files for this library, including headers libCgl_la_SOURCES = \ CglConfig.h \ CglCutGenerator.cpp CglCutGenerator.hpp\ CglMessage.cpp CglMessage.hpp \ CglStored.cpp CglStored.hpp \ CglParam.cpp CglParam.hpp \ CglTreeInfo.cpp CglTreeInfo.hpp # This is for libtool (on Windows) libCgl_la_LDFLAGS = $(LT_LDFLAGS) # We want to have all the sublibraries from the Cgl subprojects collected into # this library libCgl_la_LIBADD = $(CGL_SUBLIBS) $(am__append_1) # Since automake is not doing this on its own, we need to declare the # dependencies to the subdirectory libraries here libCgl_la_DEPENDENCIES = $(CGL_SUBLIBS) # Here list all include flags, relative to this "srcdir" directory. This # "cygpath" stuff is necessary to compile with native compilers on Windows. AM_CPPFLAGS = $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation 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 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = \ CglCutGenerator.hpp \ CglMessage.hpp \ CglStored.hpp \ CglParam.hpp \ CglTreeInfo.hpp all: config.h config_cgl.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .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/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/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/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ config_cgl.h: stamp-h2 @if test ! -f $@; then \ rm -f stamp-h2; \ $(MAKE) stamp-h2; \ else :; fi stamp-h2: $(srcdir)/config_cgl.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status src/config_cgl.h distclean-hdr: -rm -f config.h stamp-h1 config_cgl.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 libCgl.la: $(libCgl_la_OBJECTS) $(libCgl_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libCgl_la_LDFLAGS) $(libCgl_la_OBJECTS) $(libCgl_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglCutGenerator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglMessage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglStored.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglTreeInfo.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 # 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) config.h.in config_cgl.h.in $(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) config.h.in config_cgl.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: ctags-recursive $(HEADERS) $(SOURCES) config.h.in config_cgl.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in config_cgl.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 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 check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h config_cgl.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includecoindir)"; 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: 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-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-includecoinHEADERS install-exec-am: install-exec-local install-libLTLIBRARIES install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-local uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libLTLIBRARIES clean-libtool \ clean-recursive ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-recursive 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-includecoinHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-local install-exec-local: $(install_sh_DATA) config_cgl.h $(DESTDIR)$(includecoindir)/CglConfig.h uninstall-local: rm -f $(DESTDIR)$(includecoindir)/CglConfig.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: Cgl-0.58.9/src/CglMessage.cpp0000644000076600007660000000437412130021364014305 0ustar coincoin// $Id: CglMessage.cpp 1113 2013-04-06 13:28:20Z stefan $ // 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). #include "CoinPragma.hpp" #include "CglMessage.hpp" #include /// Structure for use by CglMessage.cpp typedef struct { CGL_Message internalNumber; int externalNumber; // or continuation char detail; const char * message; } Cgl_message; static Cgl_message us_english[]= { {CGL_INFEASIBLE,0,1,"Cut generators found to be infeasible! (or unbounded)"}, {CGL_CLIQUES,1,2,"%d cliques of average size %g"}, {CGL_FIXED,2,1,"%d variables fixed"}, {CGL_PROCESS_STATS,3,1,"%d fixed, %d tightened bounds, %d strengthened rows, %d substitutions"}, {CGL_SLACKS,8,1,"%d inequality constraints converted to equality constraints"}, {CGL_PROCESS_STATS2,4,1,"processed model has %d rows, %d columns (%d integer) and %d elements"}, {CGL_PROCESS_SOS1,5,1,"%d SOS with %d members"}, {CGL_PROCESS_SOS2,6,2,"%d SOS (%d members out of %d) with %d overlaps - too much overlap or too many others"}, {CGL_UNBOUNDED,7,1,"Continuous relaxation is unbounded!"}, {CGL_ELEMENTS_CHANGED1,9,2,"%d elements changed"}, {CGL_ELEMENTS_CHANGED2,10,3,"element in row %d for column %d changed from %g to %g"}, {CGL_MADE_INTEGER,11,1,"%d variables made integer"}, {CGL_ADDED_INTEGERS,12,1,"Added %d variables (from %d rows) with %d elements"}, {CGL_POST_INFEASIBLE,13,1,"Postprocessed model is infeasible - possible tolerance issue - try without preprocessing"}, {CGL_POST_CHANGED,14,1,"Postprocessing changed objective from %g to %g - possible tolerance issue - try without preprocessing"}, {CGL_GENERAL, 1000, 1, "%s"}, {CGL_DUMMY_END,999999,0,""} }; /* Constructor */ CglMessage::CglMessage(Language language) : CoinMessages(sizeof(us_english)/sizeof(Cgl_message)) { language_=language; strcpy(source_,"Cgl"); class_ = 3; // Cuts Cgl_message * message = us_english; while (message->internalNumber!=CGL_DUMMY_END) { CoinOneMessage oneMessage(message->externalNumber,message->detail, message->message); addMessage(message->internalNumber,oneMessage); message ++; } // Put into compact form toCompact(); } Cgl-0.58.9/src/CglMixedIntegerRounding/0000755000076600007660000000000012377555671016331 5ustar coincoinCgl-0.58.9/src/CglMixedIntegerRounding/CglMixedIntegerRoundingTest.cpp0000644000076600007660000000472412130104734024375 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 #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglMixedIntegerRounding.hpp" void CglMixedIntegerRoundingUnitTest(const OsiSolverInterface *baseSiP, const std::string mpsDir) { // Test default constructor { CglMixedIntegerRounding aGenerator; } // Test copy & assignment { CglMixedIntegerRounding rhs; { CglMixedIntegerRounding bGenerator; CglMixedIntegerRounding cGenerator(bGenerator); rhs=bGenerator; } } // Test get/set methods { CglMixedIntegerRounding getset; int gagg = 10 * getset.getMAXAGGR_(); getset.setMAXAGGR_(gagg); int gagg2 = getset.getMAXAGGR_(); assert(gagg == gagg2); bool gmult = !getset.getMULTIPLY_(); getset.setMULTIPLY_(gmult); bool gmult2 = getset.getMULTIPLY_(); assert(gmult == gmult2); int gcrit = getset.getCRITERION_(); gcrit = (gcrit) % 3 + 1; getset.setCRITERION_(gcrit); int gcrit2 = getset.getCRITERION_(); assert(gcrit == gcrit2); int gpre = getset.getDoPreproc(); gpre = (gpre + 1) % 3 - 1; getset.setDoPreproc(gpre); int gpre2 = getset.getDoPreproc(); assert(gpre == gpre2); } // Test generateCuts { CglMixedIntegerRounding gct; OsiSolverInterface *siP = baseSiP->clone(); std::string fn = mpsDir+"capPlan1"; std::string fn2 = mpsDir+"capPlan1.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(),"mps"); siP->initialSolve(); double lpRelax = siP->getObjValue(); OsiCuts cs; gct.generateCuts(*siP, cs); int nRowCuts = cs.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cs); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); std::cout<<"Initial LP value: "< //#include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedMatrix.hpp" #include "CoinPackedVector.hpp" #include "CglMixedIntegerRounding.hpp" //#define CGL_DEBUG 1 //----------------------------------------------------------------------------- // Generate Mixed Integer Rounding inequality //------------------------------------------------------------------- void CglMixedIntegerRounding::generateCuts(const OsiSolverInterface& si, OsiCuts& cs, const CglTreeInfo ) { // If the LP or integer presolve is used, then need to redo preprocessing // everytime this function is called. Otherwise, just do once. bool preInit = false; bool preReso = false; si.getHintParam(OsiDoPresolveInInitial, preInit); si.getHintParam(OsiDoPresolveInResolve, preReso); if (preInit == false && preReso == false && doPreproc_ == -1 ) { // Do once if (doneInitPre_ == false) { mixIntRoundPreprocess(si); doneInitPre_ = true; } } else { if(doPreproc_ == 1){ // Do everytime mixIntRoundPreprocess(si); doneInitPre_ = true; } else { if (doneInitPre_ == false) { mixIntRoundPreprocess(si); doneInitPre_ = true; } } } const double* xlp = si.getColSolution(); // LP solution const double* colUpperBound = si.getColUpper(); // vector of upper bounds const double* colLowerBound = si.getColLower(); // vector of lower bounds // get matrix by row const CoinPackedMatrix & tempMatrixByRow = *si.getMatrixByRow(); CoinPackedMatrix matrixByRow; matrixByRow.submatrixOf(tempMatrixByRow, numRows_, indRows_); CoinPackedMatrix matrixByCol = matrixByRow; matrixByCol.reverseOrdering(); //const CoinPackedMatrix & matrixByRow = *si.getMatrixByRow(); const double* LHS = si.getRowActivity(); const double* coefByRow = matrixByRow.getElements(); const int* colInds = matrixByRow.getIndices(); const int* rowStarts = matrixByRow.getVectorStarts(); const int* rowLengths = matrixByRow.getVectorLengths(); // get matrix by column //const CoinPackedMatrix & matrixByCol = *si.getMatrixByCol(); const double* coefByCol = matrixByCol.getElements(); const int* rowInds = matrixByCol.getIndices(); const int* colStarts = matrixByCol.getVectorStarts(); const int* colLengths = matrixByCol.getVectorLengths(); generateMirCuts(si, xlp, colUpperBound, colLowerBound, matrixByRow, LHS, coefByRow, colInds, rowStarts, rowLengths, //matrixByCol, coefByCol, rowInds, colStarts, colLengths, cs); } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglMixedIntegerRounding::CglMixedIntegerRounding () : CglCutGenerator() { gutsOfConstruct(1, true, 1, -1); } //------------------------------------------------------------------- // Alternate Constructor //------------------------------------------------------------------- CglMixedIntegerRounding::CglMixedIntegerRounding (const int maxaggr, const bool multiply, const int criterion, const int preproc) : CglCutGenerator() { gutsOfConstruct(maxaggr, multiply, criterion, preproc); } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglMixedIntegerRounding::CglMixedIntegerRounding ( const CglMixedIntegerRounding & rhs) : CglCutGenerator(rhs) { gutsOfCopy(rhs); } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglMixedIntegerRounding::clone() const { return new CglMixedIntegerRounding(*this); } //------------------------------------------------------------------ // Assignment operator //------------------------------------------------------------------- CglMixedIntegerRounding & CglMixedIntegerRounding::operator=(const CglMixedIntegerRounding& rhs) { if (this != &rhs) { gutsOfDelete(); CglCutGenerator::operator=(rhs); gutsOfCopy(rhs); } return *this; } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglMixedIntegerRounding::~CglMixedIntegerRounding () { gutsOfDelete(); } //------------------------------------------------------------------- // Construct //------------------------------------------------------------------- void CglMixedIntegerRounding::gutsOfConstruct (const int maxaggr, const bool multiply, const int criterion, const int preproc) { if (maxaggr > 0) { MAXAGGR_ = maxaggr; } else { throw CoinError("Unallowable value. maxaggr must be > 0", "gutsOfConstruct","CglMixedIntegerRounding"); } MULTIPLY_ = multiply; if ((criterion >= 1) && (criterion <= 3)) { CRITERION_ = criterion; } else { throw CoinError("Unallowable value. criterion must be 1, 2 or 3", "gutsOfConstruct","CglMixedIntegerRounding"); } if ((preproc >= -1) && (preproc <= 2)) { doPreproc_ = preproc; } else { throw CoinError("Unallowable value. preproc must be -1, 0 or 1", "gutsOfConstruct","CglMixedIntegerRounding"); } EPSILON_ = 1.0e-6; UNDEFINED_ = -1; TOLERANCE_ = 1.0e-4; numRows_ = 0; numCols_ = 0; doneInitPre_ = false; vubs_ = 0; vlbs_ = 0; rowTypes_ = 0; indRows_ = 0; numRowMix_ = 0; indRowMix_ = 0; numRowCont_ = 0; indRowCont_ = 0; numRowInt_ = 0; indRowInt_ = 0; numRowContVB_ = 0; indRowContVB_ = 0; sense_=NULL; RHS_=NULL; } //------------------------------------------------------------------- // Delete //------------------------------------------------------------------- void CglMixedIntegerRounding::gutsOfDelete () { if (vubs_ != 0) { delete [] vubs_; vubs_ = 0; } if (vlbs_ != 0) { delete [] vlbs_; vlbs_ = 0; } if (rowTypes_ != 0) { delete [] rowTypes_; rowTypes_ = 0; } if (indRows_ != 0) { delete [] indRows_; indRows_ = 0; } if (indRowMix_ != 0) { delete [] indRowMix_; indRowMix_ = 0; } if (indRowCont_ != 0) { delete [] indRowCont_; indRowCont_ = 0; } if (indRowInt_ != 0) { delete [] indRowInt_; indRowInt_ = 0; } if (indRowContVB_ != 0) { delete [] indRowContVB_; indRowContVB_ = 0; } if (sense_ !=NULL) { delete [] sense_; sense_=NULL;} if (RHS_ !=NULL) { delete [] RHS_; RHS_=NULL;} } //------------------------------------------------------------------- // Copy //------------------------------------------------------------------- void CglMixedIntegerRounding::gutsOfCopy (const CglMixedIntegerRounding& rhs) { MAXAGGR_ = rhs.MAXAGGR_; MULTIPLY_ = rhs.MULTIPLY_; CRITERION_ = rhs.CRITERION_; EPSILON_ = rhs.EPSILON_; UNDEFINED_ = rhs.UNDEFINED_; TOLERANCE_ = rhs.TOLERANCE_; doPreproc_ = rhs.doPreproc_; numRows_ = rhs.numRows_; numCols_ = rhs.numCols_; doneInitPre_ = rhs.doneInitPre_; numRowMix_ = rhs.numRowMix_; numRowCont_ = rhs.numRowCont_; numRowInt_ = rhs.numRowInt_; numRowContVB_ = rhs.numRowContVB_; if (numCols_ > 0) { vubs_ = new CglMixIntRoundVUB [numCols_]; vlbs_ = new CglMixIntRoundVLB [numCols_]; CoinDisjointCopyN(rhs.vubs_, numCols_, vubs_); CoinDisjointCopyN(rhs.vlbs_, numCols_, vlbs_); } else { vubs_ = 0; vlbs_ = 0; } if (numRows_ > 0) { rowTypes_ = new RowType [numRows_]; CoinDisjointCopyN(rhs.rowTypes_, numRows_, rowTypes_); indRows_ = new int [numRows_]; CoinDisjointCopyN(rhs.indRows_, numRows_, indRows_); sense_ = CoinCopyOfArray(rhs.sense_,numRows_); RHS_ = CoinCopyOfArray(rhs.RHS_,numRows_); } else { rowTypes_ = 0; indRows_ = 0; sense_=NULL; RHS_=NULL; } if (numRowMix_ > 0) { indRowMix_ = new int [numRowMix_]; CoinDisjointCopyN(rhs.indRowMix_, numRowMix_, indRowMix_); } else { indRowMix_ = 0; } if (numRowCont_ > 0) { indRowCont_ = new int [numRowCont_]; CoinDisjointCopyN(rhs.indRowCont_, numRowCont_, indRowCont_); indRowContVB_ = new int [numRowCont_]; CoinDisjointCopyN(rhs.indRowContVB_, numRowCont_, indRowContVB_); } else { indRowCont_ = 0; indRowContVB_ = 0; } if (numRowInt_ > 0) { indRowInt_ = new int [numRowInt_]; CoinDisjointCopyN(rhs.indRowInt_, numRowInt_, indRowInt_); } else { indRowInt_ = 0; } } //------------------------------------------------------------------- // Do preprocessing // It determines the type of each row. It also identifies the variable // upper bounds and variable lower bounds. //------------------------------------------------------------------- void CglMixedIntegerRounding:: mixIntRoundPreprocess(const OsiSolverInterface& si) { // get matrix stored by row const CoinPackedMatrix & matrixByRow = *si.getMatrixByRow(); numRows_ = si.getNumRows(); numCols_ = si.getNumCols(); const double* coefByRow = matrixByRow.getElements(); const int* colInds = matrixByRow.getIndices(); const int* rowStarts = matrixByRow.getVectorStarts(); const int* rowLengths = matrixByRow.getVectorLengths(); // Get copies of sense and RHS so we can modify if ranges if (sense_) { delete [] sense_; delete [] RHS_; } sense_ = CoinCopyOfArray(si.getRowSense(),numRows_); RHS_ = CoinCopyOfArray(si.getRightHandSide(),numRows_); if (rowTypes_ != 0) { delete [] rowTypes_; rowTypes_ = 0; } rowTypes_ = new RowType [numRows_]; // Destructor will free memory // Summarize the row type infomation. int numUNDEFINED = 0; int numVARUB = 0; int numVARLB = 0; int numVAREQ = 0; int numMIX = 0; int numCONT = 0; int numINT = 0; int numOTHER = 0; int iRow; const double* rowActivity = si.getRowActivity(); const double* rowLower = si.getRowLower(); const double* rowUpper = si.getRowUpper(); for (iRow = 0; iRow < numRows_; ++iRow) { // If range then choose which to use if (sense_[iRow]=='R') { if (rowActivity[iRow]-rowLower[iRow]< rowUpper[iRow]-rowActivity[iRow]) { // treat as G row RHS_[iRow]=rowLower[iRow]; sense_[iRow]='G'; } else { // treat as L row RHS_[iRow]=rowUpper[iRow]; sense_[iRow]='L'; } } // get the type of a row const RowType rowType = determineRowType(si, rowLengths[iRow], colInds+rowStarts[iRow], coefByRow+rowStarts[iRow], sense_[iRow], RHS_[iRow]); // store the type of the current row rowTypes_[iRow] = rowType; // Summarize information about row types switch(rowType) { case ROW_UNDEFINED: ++numUNDEFINED; break; case ROW_VARUB: ++numVARUB; break; case ROW_VARLB: ++numVARLB; break; case ROW_VAREQ: ++numVAREQ; break; case ROW_MIX: ++numMIX; break; case ROW_CONT: ++numCONT; break; case ROW_INT: ++numINT; break; case ROW_OTHER: ++numOTHER; break; default: throw CoinError("Unknown row type", "MixIntRoundPreprocess", "CglMixedIntegerRounding"); } } // allocate memory for vector of indices of all rows if (indRows_ != 0) { delete [] indRows_; indRows_ = 0; } if (numRows_ > 0) indRows_ = new int [numRows_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_MIX numRowMix_ = numMIX; if (indRowMix_ != 0) { delete [] indRowMix_; indRowMix_ = 0; } if (numRowMix_ > 0) indRowMix_ = new int [numRowMix_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_CONT numRowCont_ = numCONT; if (indRowCont_ != 0) { delete [] indRowCont_; indRowCont_ = 0; } if (numRowCont_ > 0) indRowCont_ = new int [numRowCont_]; // Destructor will free memory // allocate memory for vector of indices of rows of type ROW_INT numRowInt_ = numINT; if (indRowInt_ != 0) { delete [] indRowInt_; indRowInt_ = 0; } if (numRowInt_ > 0) indRowInt_ = new int [numRowInt_]; // Destructor will free memory #if CGL_DEBUG std::cout << "The num of rows = " << numRows_ << std::endl; std::cout << "Summary of Row Type" << std::endl; std::cout << "numUNDEFINED = " << numUNDEFINED << std::endl; std::cout << "numVARUB = " << numVARUB << std::endl; std::cout << "numVARLB = " << numVARLB << std::endl; std::cout << "numVAREQ = " << numVAREQ << std::endl; std::cout << "numMIX = " << numMIX << std::endl; std::cout << "numCONT = " << numCONT << std::endl; std::cout << "numINT = " << numINT << std::endl; std::cout << "numOTHER = " << numOTHER << std::endl; #endif //--------------------------------------------------------------------------- // Setup vubs_ and vlbs_ if (vubs_ != 0) { delete [] vubs_; vubs_ = 0; } vubs_ = new CglMixIntRoundVUB [numCols_]; // Destructor will free if (vlbs_ != 0) { delete [] vlbs_; vlbs_ = 0; } vlbs_ = new CglMixIntRoundVLB [numCols_]; // Destructor will free // Initialization. Altough this has been done in constructor, it is needed // for the case where the mixIntRoundPreprocess is called more than once for (int iCol = 0; iCol < numCols_; ++iCol) { vubs_[iCol].setVar(UNDEFINED_); vlbs_[iCol].setVar(UNDEFINED_); } int countM = 0; int countC = 0; int countI = 0; for ( iRow = 0; iRow < numRows_; ++iRow) { RowType rowType = rowTypes_[iRow]; // fill the vector indRows_ with the indices of all rows indRows_[iRow] = iRow; // fill the vector indRowMix_ with the indices of the rows of type ROW_MIX if (rowType == ROW_MIX) { indRowMix_[countM] = iRow; countM++; } // fill the vector indRowCont_ with the indices of rows of type ROW_CONT else if (rowType == ROW_CONT) { indRowCont_[countC] = iRow; countC++; } // fill the vector indRowInt_ with the indices of the rows of type ROW_INT else if (rowType == ROW_INT) { indRowInt_[countI] = iRow; countI++; } // create vectors with variable lower and upper bounds else if ( (rowType == ROW_VARUB) || (rowType == ROW_VARLB) || (rowType == ROW_VAREQ) ) { int startPos = rowStarts[iRow]; int stopPos = startPos + rowLengths[iRow]; int xInd = 0, yInd = 0; // x is continuous, y is integer double xCoef = 0.0, yCoef = 0.0; for (int i = startPos; i < stopPos; ++i) { if ( fabs(coefByRow[i]) > EPSILON_ ) { if( si.isInteger(colInds[i]) ) { yInd = colInds[i]; yCoef = coefByRow[i]; } else { xInd = colInds[i]; xCoef = coefByRow[i]; } } } switch (rowType) { case ROW_VARUB: // Inequality: x <= ? * y vubs_[xInd].setVar(yInd); vubs_[xInd].setVal(-yCoef / xCoef); break; case ROW_VARLB: // Inequality: x >= ? * y vlbs_[xInd].setVar(yInd); vlbs_[xInd].setVal(-yCoef / xCoef); break; case ROW_VAREQ: // Inequality: x >= AND <= ? * y vubs_[xInd].setVar(yInd); vubs_[xInd].setVal(-yCoef / xCoef); vlbs_[xInd].setVar(yInd); vlbs_[xInd].setVal(-yCoef / xCoef); break; default: // I am getting compiler bug which gets here - I am disabling - JJF //throw CoinError("Unknown row type: impossible", // "MixIntRoundPreprocess", // "CglMixedIntegerRounding"); break; } } } // allocate memory for vector of indices of rows of type ROW_CONT // that have at least one variable with variable upper or lower bound if (indRowContVB_ != 0) { delete [] indRowContVB_; indRowContVB_ = 0; } if (numRowCont_ > 0) indRowContVB_ = new int [numRowCont_]; // Destructor will free memory // create vector with rows of type ROW_CONT that have at least // one variable with variable upper or lower bound countC = 0; for (int i = 0; i < numRowCont_; ++i) { int indRow = indRowCont_[i]; int jStart = rowStarts[indRow]; int jStop = jStart + rowLengths[indRow]; for (int j = jStart; j < jStop; ++j) { int indCol = colInds[j]; CglMixIntRoundVLB VLB = vlbs_[indCol]; CglMixIntRoundVUB VUB = vubs_[indCol]; if (( VLB.getVar() != UNDEFINED_ ) || ( VUB.getVar() != UNDEFINED_ ) ){ indRowContVB_[countC] = indRow; countC++; break; } } } numRowContVB_ = countC; } //------------------------------------------------------------------- // Determine the type of a given row //------------------------------------------------------------------- CglMixedIntegerRounding::RowType CglMixedIntegerRounding::determineRowType(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const char sense, const double rhs) const { if (rowLen == 0) return ROW_UNDEFINED; if (sense == 'N' || rhs == si.getInfinity() || rhs == -si.getInfinity()) return ROW_OTHER; RowType rowType = ROW_UNDEFINED; int numPosInt = 0; // num of positive integer variables int numNegInt = 0; // num of negative integer variables int numInt = 0; // num of integer variables int numPosCon = 0; // num of positive continuous variables int numNegCon = 0; // num of negative continuous variables int numCon = 0; // num of continuous variables // Summarize the variable types of the given row. for ( int i = 0; i < rowLen; ++i ) { if ( coef[i] < -EPSILON_ ) { if( si.isInteger(ind[i]) ) ++numNegInt; else ++numNegCon; } else if ( coef[i] > EPSILON_ ) { if( si.isInteger(ind[i]) ) ++numPosInt; else ++numPosCon; } } numInt = numNegInt + numPosInt; numCon = numNegCon + numPosCon; #if CGL_DEBUG std::cout << "numNegInt = " << numNegInt << std::endl; std::cout << "numPosInt = " << numPosInt << std::endl; std::cout << "numInt = " << numInt << std::endl; std::cout << "numNegCon = " << numNegCon << std::endl; std::cout << "numPosCon = " << numPosCon << std::endl; std::cout << "numCon = " << numCon << std::endl; std::cout << "rowLen = " << rowLen << std::endl; #endif //------------------------------------------------------------------------- // Classify row type based on the types of variables. if ((numInt > 0) && (numCon > 0)) { if ((numInt == 1) && (numCon == 1) && (fabs(rhs) <= EPSILON_)) { // It's a variable bound constraint switch (sense) { case 'L': rowType = numPosCon == 1 ? ROW_VARUB : ROW_VARLB; break; case 'G': rowType = numPosCon == 1 ? ROW_VARLB : ROW_VARUB; break; case 'E': rowType = ROW_VAREQ; break; default: break; } } else { // It's a constraint with continuous and integer variables; // The total number of variables is at least 2 rowType = ROW_MIX; } } else if (numInt == 0) { // It's a constraint with only continuous variables rowType = ROW_CONT; } else if ((numCon == 0) && ((sense == 'L') || (sense == 'G'))) { // It's a <= or >= constraint with only integer variables rowType = ROW_INT; } else // It's a constraint that does not fit the above categories rowType = ROW_OTHER; return rowType; } //------------------------------------------------------------------- // Generate MIR cuts //------------------------------------------------------------------- void CglMixedIntegerRounding::generateMirCuts( const OsiSolverInterface& si, const double* xlp, const double* colUpperBound, const double* colLowerBound, const CoinPackedMatrix& matrixByRow, const double* LHS, const double* /*coefByRow*/, const int* /*colInds*/, const int* /*rowStarts*/, const int* /*rowLengths*/, //const CoinPackedMatrix& matrixByCol, const double* coefByCol, const int* rowInds, const int* colStarts, const int* colLengths, OsiCuts& cs ) const { #if CGL_DEBUG // Open debug data file; incorporate solver name so we get separate files // when running unit test. std::string dbgFname ; si.getStrParam(OsiSolverName,dbgFname) ; dbgFname = "mir_"+dbgFname+"_stats.dat" ; std::ofstream fout(dbgFname.c_str()) ; #endif // Define upper limit for the loop where the cMIRs are constructed int upperLimit; if (MULTIPLY_) upperLimit = 2; else upperLimit = 1; // create a vector with the columns that were used in the aggregation int* listColsSelected = new int[MAXAGGR_]; // create a vector with the rows that were aggregated int* listRowsAggregated = new int[MAXAGGR_]; // create a vector with the LP solutions of the slack variables double* xlpExtra = new double[MAXAGGR_]; // loop until maximum number of aggregated rows is reached or a // violated cut is found int numRowMixAndRowContVB = numRowMix_ + numRowContVB_; int numRowMixAndRowContVBAndRowInt = numRowMixAndRowContVB + numRowInt_; for (int iRow = 0; iRow < numRowMixAndRowContVBAndRowInt; ++iRow) { int rowSelected; // row selected to be aggregated next int colSelected; // column selected for pivot in aggregation CoinPackedVector rowAggregated; double rhsAggregated; // create a set with the indices of rows selected std::set setRowsAggregated; // loop until the maximum number of aggregated rows is reached for (int iAggregate = 0; iAggregate < MAXAGGR_; ++iAggregate) { if (iAggregate == 0) { // select row if (iRow < numRowMix_) { rowSelected = indRowMix_[iRow]; } else if (iRow < numRowMixAndRowContVB) { rowSelected = indRowContVB_[iRow - numRowMix_]; } else { rowSelected = indRowInt_[iRow - numRowMixAndRowContVB]; } copyRowSelected(iAggregate, rowSelected, setRowsAggregated, listRowsAggregated, xlpExtra, sense_[rowSelected], RHS_[rowSelected], LHS[rowSelected], matrixByRow, rowAggregated, rhsAggregated); } else { // search for a row to aggregate bool foundRowToAggregate = selectRowToAggregate( si, rowAggregated, colUpperBound, colLowerBound, setRowsAggregated, xlp, coefByCol, rowInds, colStarts, colLengths, rowSelected, colSelected); // if finds row to aggregate, compute aggregated row if (foundRowToAggregate) { CoinPackedVector rowToAggregate; double rhsToAggregate; listColsSelected[iAggregate] = colSelected; copyRowSelected(iAggregate, rowSelected, setRowsAggregated, listRowsAggregated, xlpExtra, sense_[rowSelected], RHS_[rowSelected], LHS[rowSelected], matrixByRow, rowToAggregate, rhsToAggregate); // call aggregate row heuristic aggregateRow(colSelected, rowToAggregate, rhsToAggregate, rowAggregated, rhsAggregated); } else break; } // construct cMIR with current rowAggregated // and, if upperLimit=2 construct also a cMIR with // the current rowAggregated multiplied by -1 for (int i = 0; i < upperLimit; ++i) { // create vector for mixed knapsack constraint CoinPackedVector rowToUse = rowAggregated; double rhsMixedKnapsack = rhsAggregated; if (i == 1) { rowToUse *= (-1.0); rhsMixedKnapsack *= (-1.0); } CoinPackedVector mixedKnapsack; double sStar = 0.0; // create vector for the continuous variables in s CoinPackedVector contVariablesInS; // call bound substitution heuristic bool foundMixedKnapsack = boundSubstitution( si, rowToUse, xlp, xlpExtra, colUpperBound, colLowerBound, mixedKnapsack, rhsMixedKnapsack, sStar, contVariablesInS); // may want some limit? if (mixedKnapsack.getNumElements()>25000) { #if CGL_DEBUG std::cout << "mixed knapsack has " <& setRowsAggregated, int* listRowsAggregated, double* xlpExtra, const char sen, const double rhs, const double lhs, const CoinPackedMatrix& matrixByRow, CoinPackedVector& rowToAggregate, double& rhsToAggregate) const { // copy the row selected to a vector of type CoinPackedVector const CoinShallowPackedVector reqdBySunCC = matrixByRow.getVector(rowSelected); rowToAggregate = reqdBySunCC ; rhsToAggregate = rhs; // update list of indices of rows selected setRowsAggregated.insert(rowSelected); listRowsAggregated[iAggregate] = rowSelected; // Add a slack variable if needed and compute its current value if (sen == 'L') { rowToAggregate.insert(numCols_ + iAggregate, 1); xlpExtra[iAggregate] = rhs - lhs; } else if (sen == 'G') { rowToAggregate.insert(numCols_ + iAggregate, -1); xlpExtra[iAggregate] = lhs - rhs; } } //------------------------------------------------------------------- // Construct the set P* and select a row to aggregate //------------------------------------------------------------------- bool CglMixedIntegerRounding::selectRowToAggregate( const OsiSolverInterface& si, const CoinPackedVector& rowAggregated, const double* colUpperBound, const double* colLowerBound, const std::set& setRowsAggregated, const double* xlp, const double* coefByCol, const int* rowInds, const int* colStarts, const int* colLengths, int& rowSelected, int& colSelected ) const { bool foundRowToAggregate = false; double deltaMax = 0.0; // maximum delta const int numColsAggregated = rowAggregated.getNumElements(); const int *rowAggregatedIndices = rowAggregated.getIndices(); const double *rowAggregatedElements = rowAggregated.getElements(); for (int j = 0; j < numColsAggregated; ++j) { // store the index and coefficient of column j int indCol = rowAggregatedIndices[j]; if (indCol >= numCols_) continue; double coefCol = rowAggregatedElements[j]; // Consider only continuous variables if ( (!si.isContinuous(indCol)) || (fabs(coefCol) < EPSILON_)) continue; // Compute current lower bound CglMixIntRoundVLB VLB = vlbs_[indCol]; double LB = ( VLB.getVar() != UNDEFINED_ ) ? VLB.getVal() * xlp[VLB.getVar()] : colLowerBound[indCol]; // Compute current upper bound CglMixIntRoundVUB VUB = vubs_[indCol]; double UB = ( VUB.getVar() != UNDEFINED_ ) ? VUB.getVal() * xlp[VUB.getVar()] : colUpperBound[indCol]; // Compute distances from current solution to upper and lower bounds double delta = CoinMin(xlp[indCol] - LB, UB - xlp[indCol]); // In case this variable is acceptable look for possible rows if (delta > deltaMax) { int iStart = colStarts[indCol]; int iStop = iStart + colLengths[indCol]; // int count = 0; // std::vector rowPossible; // find a row to use in aggregation for (int i = iStart; i < iStop; ++i) { int rowInd = rowInds[i]; if (setRowsAggregated.find(rowInd) == setRowsAggregated.end()) { // if the row was not already selected, select it RowType rType = rowTypes_[rowInd]; if ( ((rType == ROW_MIX) || (rType == ROW_CONT)) && (fabs(coefByCol[i]) > EPSILON_) ) { // rowPossible.push_back(rowInd); rowSelected = rowInd; deltaMax = delta; colSelected = indCol; foundRowToAggregate = true; //count++; break; } } } // if (count > 0) // rowSelected = rowPossible[rand() % count]; // std::cout << count << std::endl; } } return foundRowToAggregate; } //------------------------------------------------------------------- // Aggregate the selected row with the current aggregated row //------------------------------------------------------------------- void CglMixedIntegerRounding::aggregateRow( const int colSelected, CoinPackedVector& rowToAggregate, double rhs, CoinPackedVector& rowAggregated, double& rhsAggregated ) const { // quantity to multiply by the coefficients of the row to aggregate double multiCoef = rowAggregated[colSelected] / rowToAggregate[colSelected]; rowToAggregate *= multiCoef; rhs *= multiCoef; rowAggregated = rowAggregated - rowToAggregate; rhsAggregated -= rhs; } //------------------------------------------------------------------- // Choose the bound substitution based on the criteria defined by the user //------------------------------------------------------------------- inline bool CglMixedIntegerRounding::isLowerSubst(const double inf, const double aj, const double xlp, const double LB, const double UB) const { if (CRITERION_ == 1) { // criterion 1 (the same as criterion (a) in the paper) return xlp - LB < UB - xlp; } else { if (UB == inf || xlp == LB) return true; if (LB == -inf || xlp == UB) return false; if (CRITERION_ == 2) // criterion 2 (the same as criterion (b) in the paper) return aj < 0; else // criterion 3 (the same as criterion (c) in the paper) return aj > 0; } } //------------------------------------------------------------------- // Bound substitution heuristic //------------------------------------------------------------------- bool CglMixedIntegerRounding::boundSubstitution( const OsiSolverInterface& si, const CoinPackedVector& rowAggregated, const double* xlp, const double* xlpExtra, const double* colUpperBound, const double* colLowerBound, CoinPackedVector& mixedKnapsack, double& rhsMixedKnapsack, double& sStar, CoinPackedVector& contVariablesInS ) const { bool generated = false; const int numColsAggregated = rowAggregated.getNumElements(); const int *rowAggregatedIndices = rowAggregated.getIndices(); const double *rowAggregatedElements = rowAggregated.getElements(); // go through all the variables and if it is continuous and delta is // negative, store variable in the vector contVariablesInS. // If it is integer, store variable in the vector mixedKnapsack int numCont = 0; int j; for ( j = 0; j < numColsAggregated; ++j) { // get index and coefficient of column j in the aggregated row const int indCol = rowAggregatedIndices[j]; const double coefCol = rowAggregatedElements[j]; // if the lower bound is equal to the upper bound, remove variable if ( (indCol < numCols_) && (colLowerBound[indCol] == colUpperBound[indCol]) ) { rhsMixedKnapsack -= coefCol * colLowerBound[indCol]; continue; } if (fabs(coefCol) < EPSILON_) continue; // set the coefficients of the integer variables if ( (indCol < numCols_) && (!si.isContinuous(indCol)) ) { // Copy the integer variable to the vector mixedKnapsack if (mixedKnapsack.isExistingIndex(indCol)) { const int index = mixedKnapsack.findIndex(indCol); mixedKnapsack.setElement(index, mixedKnapsack[indCol] + coefCol); } else mixedKnapsack.insert(indCol, coefCol); continue; } // Select the continuous variables and copy the ones in s to // the vector contVariablesInS if (indCol < numCols_) { // variable is model variable // Compute lower bound for variable indCol const CglMixIntRoundVLB VLB = vlbs_[indCol]; const double LB = ( VLB.getVar() != UNDEFINED_ ) ? VLB.getVal() * xlp[VLB.getVar()] : colLowerBound[indCol]; // Compute upper bound for variable indCol const CglMixIntRoundVUB VUB = vubs_[indCol]; const double UB = ( VUB.getVar() != UNDEFINED_ ) ? VUB.getVal() * xlp[VUB.getVar()] : colUpperBound[indCol]; // if both bounds are infinite, then we cannot form a mixed knapsack if ( (LB == -1.0 * si.getInfinity()) && (UB == si.getInfinity()) ) { #if CGL_DEBUG std::cout << "continuous var with infinite bounds. " << "Cannot form mixed Knapsack = " << std::endl; #endif return generated; } // Select the bound substitution if (isLowerSubst(si.getInfinity(), rowAggregatedElements[j], xlp[indCol], LB, UB)) { if (VLB.getVar() != UNDEFINED_ ) { const int indVLB = VLB.getVar(); if (mixedKnapsack.isExistingIndex(indVLB)) { const int index = mixedKnapsack.findIndex(indVLB); mixedKnapsack.setElement(index, mixedKnapsack[indVLB] + coefCol * VLB.getVal()); } else mixedKnapsack.insert(indVLB, coefCol * VLB.getVal()); } else { rhsMixedKnapsack -= coefCol * LB; } // Update sStar if (coefCol < -EPSILON_) { contVariablesInS.insert(indCol, coefCol); sStar -= coefCol * (xlp[indCol] - LB); numCont++; } } else { if (VUB.getVar() != UNDEFINED_ ) { const int indVUB = VUB.getVar(); if (mixedKnapsack.isExistingIndex(indVUB)) { const int index = mixedKnapsack.findIndex(indVUB); mixedKnapsack.setElement(index, mixedKnapsack[indVUB] + coefCol * VUB.getVal()); } else mixedKnapsack.insert(indVUB, coefCol * VUB.getVal()); } else { rhsMixedKnapsack -= coefCol * UB; } // Update sStar if (coefCol > EPSILON_) { contVariablesInS.insert(indCol, - coefCol); sStar += coefCol * (UB - xlp[indCol]); numCont++; } } } else { // variable is slack variable // in this case the LB = 0 and the UB = infinity // Update sStar const double tLB = xlpExtra[indCol - numCols_]; if (coefCol < -EPSILON_) { contVariablesInS.insert(indCol, coefCol); sStar -= coefCol * tLB; numCont++; } } } // if there are no continuous variables to form s, then we stop #if CGL_DEBUG std::cout << "# of continuous var in mixedKnapsack = " << numCont << std::endl; #endif if (numCont == 0) return generated; // check that the integer variables have lower bound equal to zero const int numInt = mixedKnapsack.getNumElements(); // if there are not integer variables in mixedKnapsack, then we stop // CAUTION: all the coefficients could be zero #if CGL_DEBUG std::cout << "# of integer var in mixedKnapsack = " << numInt << std::endl; #endif if (numInt == 0) return generated; const int *knapsackIndices = mixedKnapsack.getIndices(); const double *knapsackElements = mixedKnapsack.getElements(); for ( j = 0; j < numInt; ++j) { // if the coefficient is zero, disregard if (fabs(knapsackElements[j]) < EPSILON_) continue; // if the lower bound is not zero, then we stop if (fabs(colLowerBound[knapsackIndices[j]]) > EPSILON_) return generated; } // if the lower bounds of all integer variables are zero, proceed generated = true; return generated; } //------------------------------------------------------------------- // c-MIR separation heuristic //------------------------------------------------------------------- bool CglMixedIntegerRounding::cMirSeparation( const OsiSolverInterface& si, const CoinPackedMatrix& matrixByRow, const CoinPackedVector& rowAggregated, const int* listRowsAggregated, const char* sense, const double* RHS, //const double* coefByRow, //const int* colInds, const int* rowStarts, //const int* rowLengths, const double* xlp, const double sStar, const double* colUpperBound, const double* colLowerBound, const CoinPackedVector& mixedKnapsack, const double& rhsMixedKnapsack, const CoinPackedVector& contVariablesInS, OsiRowCut& cMirCut) const { bool generated = false; double numeratorBeta = rhsMixedKnapsack; CoinPackedVector cMIR = mixedKnapsack; double rhscMIR; double maxViolation = 0.0; double bestDelta = 0.0; CoinPackedVector bestCut; double rhsBestCut = 0.0; double sCoefBestCut = 0.0; const int numInt = mixedKnapsack.getNumElements(); const int *knapsackIndices = mixedKnapsack.getIndices(); const double *knapsackElements = mixedKnapsack.getElements(); const int *contVarInSIndices = contVariablesInS.getIndices(); const double *contVarInSElements = contVariablesInS.getElements(); // Construct set C, T will be the rest. // Also, for T we construct a CoinPackedVector named complT which // contains the vars in T that are strictly between their bounds std::set setC; CoinPackedVector complT; int j; for ( j = 0; j < numInt; ++j) { const int indCol = knapsackIndices[j]; // if the upper bound is infinity, then indCol is in T and cannot // be in complT if (colUpperBound[indCol] != si.getInfinity()) { if (xlp[indCol] >= colUpperBound[indCol] / 2.0) { setC.insert(j); numeratorBeta -= knapsackElements[j] * colUpperBound[indCol]; } else { if ( (xlp[indCol] <= EPSILON_) || (xlp[indCol] >= colUpperBound[indCol] - EPSILON_)) continue; complT.insert(j, fabs(xlp[indCol] - colUpperBound[indCol]/2)); } } } // Sort the indices in complT by nondecreasing values // (which are $|y^*_j-u_j/2|$) if (complT.getNumElements() > 0) { complT.sortIncrElement(); } // Construct c-MIR inequalities and take the one with the largest violation for ( j = 0; j < numInt; ++j) { int indCol = knapsackIndices[j]; if ( (xlp[indCol] <= EPSILON_) || (xlp[indCol] >= colUpperBound[indCol] - EPSILON_)) continue; double delta = knapsackElements[j]; // delta has to be positive if (delta <= EPSILON_) continue; double violation = 0.0; double sCoef = 0.0; // form a cMIR inequality cMirInequality(numInt, delta, numeratorBeta, knapsackIndices, knapsackElements, xlp, sStar, colUpperBound, setC, cMIR, rhscMIR, sCoef, violation); // store cut if it is the best found so far if (violation > maxViolation + EPSILON_) { bestCut = cMIR; rhsBestCut = rhscMIR; sCoefBestCut = sCoef; maxViolation = violation; bestDelta = delta; } } // if no violated inequality has been found, exit now if (maxViolation == 0.0) return generated; // improve the best violated inequality. // try to divide delta by 2, 4 or 8 and see if increases the violation double deltaBase = bestDelta; for (int multFactor = 2; multFactor <= 8; multFactor *= 2) { double delta = deltaBase / multFactor; double violation = 0.0; double sCoef = 0.0; // form a cMIR inequality cMirInequality(numInt, delta, numeratorBeta, knapsackIndices, knapsackElements, xlp, sStar, colUpperBound, setC, cMIR, rhscMIR, sCoef, violation); // store cut if it is the best found so far if (violation > maxViolation + EPSILON_) { bestCut = cMIR; rhsBestCut = rhscMIR; sCoefBestCut = sCoef; maxViolation = violation; bestDelta = delta; } } // improve cMIR for the best delta // complT contains indices into mixedKnapsack for the variables // which may be complemented and they are already appropriately // sorted. const int complTSize = complT.getNumElements(); if (complTSize > 0) { const int *complTIndices = complT.getIndices(); for (int j = 0; j < complTSize; ++j) { // move variable in set complT from set T to set C int jIndex = complTIndices[j]; int indCol = knapsackIndices[jIndex]; // do nothing if upper bound is infinity if (colUpperBound[indCol] >= si.getInfinity()) continue; setC.insert(jIndex); double violation = 0.0; double sCoef = 0.0; double localNumeratorBeta = numeratorBeta - mixedKnapsack[indCol] * colUpperBound[indCol]; // form a cMIR inequality cMirInequality(numInt, bestDelta, localNumeratorBeta, knapsackIndices, knapsackElements, xlp, sStar, colUpperBound, setC, cMIR, rhscMIR, sCoef, violation); // store cut if it is the best found so far; otherwise, move the variable // that was added to set C back to set T if (violation > maxViolation + EPSILON_) { bestCut = cMIR; rhsBestCut = rhscMIR; sCoefBestCut = sCoef; maxViolation = violation; numeratorBeta = localNumeratorBeta; } else setC.erase(jIndex); } } // write the best cut found with the model variables int numCont = contVariablesInS.getNumElements(); for ( j = 0; j < numCont; ++j) { int indCol = contVarInSIndices[j]; double coefCol = contVarInSElements[j]; if (indCol < numCols_) { // variable is model variable // Compute lower bound for variable indCol CglMixIntRoundVLB VLB = vlbs_[indCol]; double LB = ( VLB.getVar() != UNDEFINED_ ) ? VLB.getVal() * xlp[VLB.getVar()] : colLowerBound[indCol]; // Compute upper bound for variable indCol CglMixIntRoundVUB VUB = vubs_[indCol]; double UB = ( VUB.getVar() != UNDEFINED_ ) ? VUB.getVal() * xlp[VUB.getVar()] : colUpperBound[indCol]; // Select the bound substitution if (isLowerSubst(si.getInfinity(), rowAggregated[indCol], xlp[indCol], LB, UB)) { if (VLB.getVar() != UNDEFINED_ ) { int indVLB = VLB.getVar(); if (bestCut.isExistingIndex(indVLB)){ int index = bestCut.findIndex(indVLB); bestCut.setElement(index, bestCut[indVLB] - sCoefBestCut * coefCol * VLB.getVal()); } else bestCut.insert(indVLB, - sCoefBestCut * coefCol * VLB.getVal()); bestCut.insert(indCol, sCoefBestCut * coefCol); } else { rhsBestCut += sCoefBestCut * coefCol * colLowerBound[indCol]; bestCut.insert(indCol, sCoefBestCut * coefCol); } } else { if (VUB.getVar() != UNDEFINED_ ) { int indVUB = VUB.getVar(); if (bestCut.isExistingIndex(indVUB)){ int index = bestCut.findIndex(indVUB); bestCut.setElement(index, bestCut[indVUB] + sCoefBestCut * coefCol * VUB.getVal()); } else bestCut.insert(indVUB, sCoefBestCut * coefCol * VUB.getVal()); bestCut.insert(indCol, - sCoefBestCut * coefCol); } else { rhsBestCut -= sCoefBestCut * coefCol * colUpperBound[indCol]; bestCut.insert(indCol, - sCoefBestCut * coefCol); } } } else { // variable is slack variable // in this case the LB = 0 and the UB = infinity // copy the row selected to a vector of type CoinPackedVector const int iRow = listRowsAggregated[indCol - numCols_]; const CoinShallowPackedVector reqdBySunCC = matrixByRow.getVector(iRow); CoinPackedVector row = reqdBySunCC ; double rhs = RHS[iRow]; if (sense[iRow] == 'L') { // if it is a <= inequality, the coefficient of the slack is 1 row *= (- sCoefBestCut * coefCol); rhs *= (- sCoefBestCut * coefCol); } else { assert (sense[iRow]=='G'); // if it is a <= inequality, the coefficient of the slack is -1 row *= (sCoefBestCut * coefCol); rhs *= (sCoefBestCut * coefCol); } rhsBestCut += rhs; bestCut = bestCut + row; } } // Check the violation of the cut after it is written with the original // variables. int cutLen = bestCut.getNumElements(); int* cutInd = bestCut.getIndices(); double* cutCoef = bestCut.getElements(); double cutRHS = rhsBestCut; double violation = 0.0; double normCut = 0.0; // Also weaken by small coefficients int n=0; for ( j = 0; j < cutLen; ++j) { double value = cutCoef[j]; int column = cutInd[j]; if (fabs(value)>1.0e-12) { violation += cutCoef[j] * xlp[column]; normCut += cutCoef[j] * cutCoef[j]; cutCoef[n]=value; cutInd[n++]=column; } else if (value) { // Weaken if (value>0.0) { // Allow for at lower bound cutRHS -= value*colLowerBound[column]; } else { // Allow for at upper bound cutRHS -= value*colUpperBound[column]; } } } cutLen=n; violation -= cutRHS; violation /= sqrt(normCut); if ( violation > TOLERANCE_ ) { cMirCut.setRow(cutLen, cutInd, cutCoef); cMirCut.setLb(-1.0 * si.getInfinity()); cMirCut.setUb(cutRHS); cMirCut.setEffectiveness(violation); #ifdef CGL_DEBUG { for (int k=0; k=0); assert(cutCoef[k]); assert (fabs(cutCoef[k])>1.0e-12); } } #endif generated = true; } return generated; } //------------------------------------------------------------------- // construct a c-MIR inequality //------------------------------------------------------------------- void CglMixedIntegerRounding::cMirInequality( const int numInt, const double delta, const double numeratorBeta, const int *knapsackIndices, const double* knapsackElements, const double* xlp, const double sStar, const double* colUpperBound, const std::set& setC, CoinPackedVector& cMIR, double& rhscMIR, double& sCoef, double& violation) const { // form a cMIR inequality double beta = numeratorBeta / delta; double f = beta - floor(beta); rhscMIR = floor(beta); double normCut = 0.0; // coefficients of variables in set T for (int i = 0; i < numInt; ++i) { const int iIndex = knapsackIndices[i]; double G = 0.0; if (setC.find(i) == setC.end()) { // i is not in setC, i.e., it is in T G = functionG(knapsackElements[i] / delta, f); violation += (G * xlp[iIndex]); normCut += G * G; cMIR.setElement(i, G); } else { G = functionG( - knapsackElements[i] / delta, f); violation -= (G * xlp[iIndex]); normCut += G * G; rhscMIR -= G * colUpperBound[iIndex]; cMIR.setElement(i, -G); } } sCoef = 1.0 / (delta * (1.0 - f)); violation -= (rhscMIR + sCoef * sStar); normCut += sCoef * sCoef; violation /= sqrt(normCut); } //------------------------------------------------------------------- // function G for computing coefficients in cMIR inequality //------------------------------------------------------------------- inline double CglMixedIntegerRounding::functionG( const double d, const double f ) const { double delta = d - floor(d) - f; if (delta > EPSILON_) return floor(d) + delta / (1 - f); else return floor(d); } //------------------------------------------------------------------- // Printing statistics //------------------------------------------------------------------- void CglMixedIntegerRounding::printStats( std::ofstream & fout, const bool hasCut, const OsiSolverInterface& si, const CoinPackedVector& rowAggregated, const double& rhsAggregated, const double* xlp, const double* xlpExtra, const int* listRowsAggregated, const int* listColsSelected, const int level, const double* colUpperBound, const double* colLowerBound ) const { const int numColsAggregated = rowAggregated.getNumElements(); const int *rowAggregatedIndices = rowAggregated.getIndices(); const double *rowAggregatedElements = rowAggregated.getElements(); fout << "Rows "; for (int i = 0; i < level; ++i) { fout << listRowsAggregated[i] << " "; } fout << std::endl; int numColsBack = 0; // go through all the variables for (int j = 0; j < numColsAggregated; ++j) { // get index and coefficient of column j in the aggregated row int indCol = rowAggregatedIndices[j]; double coefCol = rowAggregatedElements[j]; // check if a column used in aggregation is back into the aggregated row for (int i = 0; i < level-1; ++i) { if ( (listColsSelected[i] == indCol) && (coefCol != 0) ) { numColsBack++; break; } } if (fabs(coefCol) < EPSILON_) { // print variable number and coefficient fout << indCol << " " << 0.0 << std::endl; continue; } else { // print variable number and coefficient fout << indCol << " " << coefCol << " "; } // integer variables if ( (indCol < numCols_) && (!si.isContinuous(indCol)) ) { // print fout << "I " << xlp[indCol] << " " << colLowerBound[indCol] << " " << colUpperBound[indCol] << std::endl; continue; } // continuous variables if (indCol < numCols_) { // variable is model variable // print fout << "C " << xlp[indCol] << " " << colLowerBound[indCol] << " " << colUpperBound[indCol] << " "; // variable lower bound? CglMixIntRoundVLB VLB = vlbs_[indCol]; if (VLB.getVar() != UNDEFINED_) { fout << VLB.getVal() << " " << xlp[VLB.getVar()] << " " << colLowerBound[VLB.getVar()] << " " << colUpperBound[VLB.getVar()] << " "; } else { fout << "-1 -1 -1 -1 "; } // variable upper bound? CglMixIntRoundVUB VUB = vubs_[indCol]; if (VUB.getVar() != UNDEFINED_) { fout << VUB.getVal() << " " << xlp[VUB.getVar()] << " " << colLowerBound[VUB.getVar()] << " " << colUpperBound[VUB.getVar()] << " "; } else { fout << "-1 -1 -1 -1 "; } } else { // variable is slack variable // in this case the LB = 0 and the UB = infinity // print fout << "C " << xlpExtra[indCol-numCols_] << " " << 0.0 << " " << si.getInfinity() << " "; } fout << std::endl; } fout << "rhs " << rhsAggregated << std::endl; fout << "numColsBack " << numColsBack << std::endl; if (hasCut) { fout << "CUT: YES" << std::endl; } else { fout << "CUT: NO" << std::endl; } } // This can be used to refresh any inforamtion void CglMixedIntegerRounding::refreshSolver(OsiSolverInterface * ) { doneInitPre_ = false; } // Create C++ lines to get to current state std::string CglMixedIntegerRounding::generateCpp( FILE * fp) { CglMixedIntegerRounding other; fprintf(fp,"0#include \"CglMixedIntegerRounding.hpp\"\n"); fprintf(fp,"3 CglMixedIntegerRounding mixedIntegerRounding;\n"); if (MAXAGGR_!=other.MAXAGGR_) fprintf(fp,"3 mixedIntegerRounding.setMAXAGGR_(%d);\n",MAXAGGR_); else fprintf(fp,"4 mixedIntegerRounding.setMAXAGGR_(%d);\n",MAXAGGR_); if (MULTIPLY_!=other.MULTIPLY_) fprintf(fp,"3 mixedIntegerRounding.setMULTIPLY_(%d);\n",MULTIPLY_); else fprintf(fp,"4 mixedIntegerRounding.setMULTIPLY_(%d);\n",MULTIPLY_); if (CRITERION_!=other.CRITERION_) fprintf(fp,"3 mixedIntegerRounding.setCRITERION_(%d);\n",CRITERION_); if (doPreproc_!=other.doPreproc_) fprintf(fp,"3 mixedIntegerRounding.setDoPreproc_(%d);\n", doPreproc_); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 mixedIntegerRounding.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 mixedIntegerRounding.setAggressiveness(%d);\n",getAggressiveness()); return "mixedIntegerRounding"; } void CglMixedIntegerRounding::setDoPreproc(int value) { if (value != -1 && value != 0 && value != 1) { throw CoinError("setDoPrepoc", "invalid value", "CglMixedIntegerRounding2"); } else { doPreproc_ = value; } } bool CglMixedIntegerRounding::getDoPreproc() const { return (doPreproc_!=0); } Cgl-0.58.9/src/CglMixedIntegerRounding/CglMixedIntegerRounding.hpp0000644000076600007660000003213112130104734023533 0ustar coincoin// LAST EDIT: //----------------------------------------------------------------------------- // name: Mixed Integer Rounding Cut Generator // authors: Joao Goncalves (jog7@lehigh.edu) // Laszlo Ladanyi (ladanyi@us.ibm.com) // date: August 11, 2004 //----------------------------------------------------------------------------- // Copyright (C) 2004, International Business Machines Corporation and others. // All Rights Reserved. // This code is published under the Eclipse Public License. #ifndef CglMixedIntegerRounding_H #define CglMixedIntegerRounding_H #include #include //#include #include "CoinError.hpp" #include "CglCutGenerator.hpp" //============================================================================= #ifndef CGL_DEBUG #define CGL_DEBUG 0 #endif //============================================================================= // Class to store variable upper bounds (VUB) class CglMixIntRoundVUB { // Variable upper bounds have the form x_j <= a y_j, where x_j is // a continuous variable and y_j is an integer variable protected: int var_; // The index of y_j double val_; // The value of a public: // Default constructor CglMixIntRoundVUB() : var_(-1), val_(-1) {} // Copy constructor CglMixIntRoundVUB(const CglMixIntRoundVUB& source) { var_ = source.var_; val_ = source.val_; } // Assignment operator CglMixIntRoundVUB& operator=(const CglMixIntRoundVUB& rhs) { if (this != &rhs) { var_ = rhs.var_; val_ = rhs.val_; } return *this; } // Destructor ~CglMixIntRoundVUB() {} // Query and set functions int getVar() const { return var_; } double getVal() const { return val_; } void setVar(const int v) { var_ = v; } void setVal(const double v) { val_ = v; } }; //============================================================================= // Class to store variable lower bounds (VLB). // It is the same as the class to store variable upper bounds typedef CglMixIntRoundVUB CglMixIntRoundVLB; //============================================================================= /** Mixed Integer Rounding Cut Generator Class */ // Reference: // Hugues Marchand and Laurence A. Wolsey // Aggregation and Mixed Integer Rounding to Solve MIPs // Operations Research, 49(3), May-June 2001. // Also published as CORE Dicusion Paper 9839, June 1998. class CglMixedIntegerRounding : public CglCutGenerator { friend void CglMixedIntegerRoundingUnitTest(const OsiSolverInterface * siP, const std::string mpdDir); private: //--------------------------------------------------------------------------- // Enumeration constants that describe the various types of rows enum RowType { // The row type of this row is NOT defined yet. ROW_UNDEFINED, /** After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the other is a continous, and the RHS is zero.*/ ROW_VARUB, /** After the row is flipped to 'L', the row has exactly two variables: one is positive binary and the other is a continous, and the RHS is zero.*/ ROW_VARLB, /** The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous, and the RHS is zero.*/ ROW_VAREQ, // The row contains continuous and integer variables; // the total number of variables is at least 2 ROW_MIX, // The row contains only continuous variables ROW_CONT, // The row contains only integer variables ROW_INT, // The row contains other types of rows ROW_OTHER }; public: /**@name Generate Cuts */ //@{ /** Generate Mixed Integer Rounding cuts for the model data contained in si. The generated cuts are inserted in the collection of cuts cs. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} //--------------------------------------------------------------------------- /**@name Constructors and destructors */ //@{ /// Default constructor CglMixedIntegerRounding (); /// Alternate Constructor CglMixedIntegerRounding (const int maxaggr, const bool multiply, const int criterion, const int preproc = -1); /// Copy constructor CglMixedIntegerRounding ( const CglMixedIntegerRounding &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglMixedIntegerRounding & operator=( const CglMixedIntegerRounding& rhs); /// Destructor virtual ~CglMixedIntegerRounding (); /// This can be used to refresh any inforamtion virtual void refreshSolver(OsiSolverInterface * solver); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} //--------------------------------------------------------------------------- /**@name Set and get methods */ //@{ /// Set MAXAGGR_ inline void setMAXAGGR_ (int maxaggr) { if (maxaggr > 0) { MAXAGGR_ = maxaggr; } else { throw CoinError("Unallowable value. maxaggr must be > 0", "gutsOfConstruct","CglMixedIntegerRounding"); } } /// Get MAXAGGR_ inline int getMAXAGGR_ () const { return MAXAGGR_; } /// Set MULTIPLY_ inline void setMULTIPLY_ (bool multiply) { MULTIPLY_ = multiply; } /// Get MULTIPLY_ inline bool getMULTIPLY_ () const { return MULTIPLY_; } /// Set CRITERION_ inline void setCRITERION_ (int criterion) { if ((criterion >= 1) && (criterion <= 3)) { CRITERION_ = criterion; } else { throw CoinError("Unallowable value. criterion must be 1, 2 or 3", "gutsOfConstruct","CglMixedIntegerRounding"); } } /// Get CRITERION_ inline int getCRITERION_ () const { return CRITERION_; } /// Set doPreproc void setDoPreproc(int value); /// Get doPreproc bool getDoPreproc() const; //@} private: //-------------------------------------------------------------------------- // Private member methods // Construct void gutsOfConstruct (const int maxaggr, const bool multiply, const int criterion, const int preproc); // Delete void gutsOfDelete(); // Copy void gutsOfCopy (const CglMixedIntegerRounding& rhs); // Do preprocessing. // It determines the type of each row. It also identifies the variable // upper bounds and variable lower bounds. // It may change sense and RHS for ranged rows void mixIntRoundPreprocess(const OsiSolverInterface& si); // Determine the type of a given row. RowType determineRowType(const OsiSolverInterface& si, const int rowLen, const int* ind, const double* coef, const char sense, const double rhs) const; // Generate MIR cuts void generateMirCuts( const OsiSolverInterface& si, const double* xlp, const double* colUpperBound, const double* colLowerBound, const CoinPackedMatrix& matrixByRow, const double* LHS, const double* coefByRow, const int* colInds, const int* rowStarts, const int* rowLengths, //const CoinPackedMatrix& matrixByCol, const double* coefByCol, const int* rowInds, const int* colStarts, const int* colLengths, OsiCuts& cs ) const; // Copy row selected to CoinPackedVector void copyRowSelected( const int iAggregate, const int rowSelected, std::set& setRowsAggregated, int* listRowsAggregated, double* xlpExtra, const char sen, const double rhs, const double lhs, const CoinPackedMatrix& matrixByRow, CoinPackedVector& rowToAggregate, double& rhsToAggregate) const; // Select a row to aggregate bool selectRowToAggregate( const OsiSolverInterface& si, const CoinPackedVector& rowAggregated, const double* colUpperBound, const double* colLowerBound, const std::set& setRowsAggregated, const double* xlp, const double* coefByCol, const int* rowInds, const int* colStarts, const int* colLengths, int& rowSelected, int& colSelected ) const; // Aggregation heuristic. // Combines one or more rows of the original matrix void aggregateRow( const int colSelected, CoinPackedVector& rowToAggregate, double rhs, CoinPackedVector& rowAggregated, double& rhsAggregated ) const; // Choose the bound substitution based on the criteria defined by the user inline bool isLowerSubst(const double inf, const double aj, const double xlp, const double LB, const double UB) const; // Bound substitution heuristic bool boundSubstitution( const OsiSolverInterface& si, const CoinPackedVector& rowAggregated, const double* xlp, const double* xlpExtra, const double* colUpperBound, const double* colLowerBound, CoinPackedVector& mixedKnapsack, double& rhsMixedKnapsack, double& sStar, CoinPackedVector& contVariablesInS ) const; // c-MIR separation heuristic bool cMirSeparation ( const OsiSolverInterface& si, const CoinPackedMatrix& matrixByRow, const CoinPackedVector& rowAggregated, const int* listRowsAggregated, const char* sense, const double* RHS, //const double* coefByRow, //const int* colInds, const int* rowStarts, //const int* rowLengths, const double* xlp, const double sStar, const double* colUpperBound, const double* colLowerBound, const CoinPackedVector& mixedKnapsack, const double& rhsMixedKnapsack, const CoinPackedVector& contVariablesInS, OsiRowCut& flowCut ) const; // function to create one c-MIR inequality void cMirInequality( const int numInt, const double delta, const double numeratorBeta, const int *knapsackIndices, const double* knapsackElements, const double* xlp, const double sStar, const double* colUpperBound, const std::set& setC, CoinPackedVector& cMIR, double& rhscMIR, double& sCoef, double& violation) const; // function to compute G inline double functionG( const double d, const double f ) const; // function to print statistics (used only in debug mode) void printStats( std::ofstream & fout, const bool hasCut, const OsiSolverInterface& si, const CoinPackedVector& rowAggregated, const double& rhsAggregated, const double* xlp, const double* xlpExtra, const int* listRowsAggregated, const int* listColsSelected, const int level, const double* colUpperBound, const double* colLowerBound ) const; private: //--------------------------------------------------------------------------- // Private member data // Maximum number of rows to aggregate int MAXAGGR_; // Flag that indicates if an aggregated row is also multiplied by -1 bool MULTIPLY_; // The criterion to use in the bound substitution int CRITERION_; // Tolerance used for numerical purposes double EPSILON_; /// There is no variable upper bound or variable lower bound defined int UNDEFINED_; // If violation of a cut is greater that this number, the cut is accepted double TOLERANCE_; /** Controls the preprocessing of the matrix to identify rows suitable for cut generation.
  • -1: preprocess according to solver settings;
  • 0: Do preprocessing only if it has not yet been done;
  • 1: Do preprocessing.
Default value: -1 **/ int doPreproc_; // The number of rows of the problem. int numRows_; // The number columns of the problem. int numCols_; // Indicates whether preprocessing has been done. bool doneInitPre_; // The array of CglMixIntRoundVUBs. CglMixIntRoundVUB* vubs_; // The array of CglMixIntRoundVLBs. CglMixIntRoundVLB* vlbs_; // Array with the row types of the rows in the model. RowType* rowTypes_; // The indices of the rows of the initial matrix int* indRows_; // The number of rows of type ROW_MIX int numRowMix_; // The indices of the rows of type ROW_MIX int* indRowMix_; // The number of rows of type ROW_CONT int numRowCont_; // The indices of the rows of type ROW_CONT int* indRowCont_; // The number of rows of type ROW_INT int numRowInt_; // The indices of the rows of type ROW_INT int* indRowInt_; // The number of rows of type ROW_CONT that have at least one variable // with variable upper or lower bound int numRowContVB_; // The indices of the rows of type ROW_CONT that have at least one variable // with variable upper or lower bound int* indRowContVB_; // Sense of rows (modified if ranges) char * sense_; // RHS of rows (modified if ranges) double * RHS_; }; //############################################################################# // A function that tests the methods in the CglMixedIntegerRounding class. The // only reason for it not to be a member method is that this way it doesn't // have to be compiled into the library. And that's a gain, because the // library should be compiled with optimization on, but this method should be // compiled with debugging. void CglMixedIntegerRoundingUnitTest(const OsiSolverInterface * siP, const std::string mpdDir); #endif Cgl-0.58.9/src/CglMixedIntegerRounding/Makefile.in0000644000076600007660000005454112240340055020360 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/CglMixedIntegerRounding 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglMixedIntegerRounding_la_LIBADD = am_libCglMixedIntegerRounding_la_OBJECTS = CglMixedIntegerRounding.lo \ CglMixedIntegerRoundingTest.lo libCglMixedIntegerRounding_la_OBJECTS = \ $(am_libCglMixedIntegerRounding_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 = $(libCglMixedIntegerRounding_la_SOURCES) DIST_SOURCES = $(libCglMixedIntegerRounding_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglMixedIntegerRounding # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglMixedIntegerRounding.la # List all source files for this library, including headers libCglMixedIntegerRounding_la_SOURCES = CglMixedIntegerRounding.cpp CglMixedIntegerRounding.hpp CglMixedIntegerRoundingTest.cpp # This is for libtool (on Windows) libCglMixedIntegerRounding_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglMixedIntegerRounding.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/CglMixedIntegerRounding/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglMixedIntegerRounding/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglMixedIntegerRounding.la: $(libCglMixedIntegerRounding_la_OBJECTS) $(libCglMixedIntegerRounding_la_DEPENDENCIES) $(CXXLINK) $(libCglMixedIntegerRounding_la_LDFLAGS) $(libCglMixedIntegerRounding_la_OBJECTS) $(libCglMixedIntegerRounding_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglMixedIntegerRounding.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglMixedIntegerRoundingTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglOddHole/0000755000076600007660000000000012377555671013555 5ustar coincoinCgl-0.58.9/src/CglOddHole/CglOddHole.cpp0000644000076600007660000005423212130104734016204 0ustar coincoin// $Id: CglOddHole.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "OsiRowCutDebugger.hpp" #include "CglOddHole.hpp" //#define CGL_DEBUG // We may want to sort cut typedef struct {double dj;double element; int sequence;} double_double_int_triple; class double_double_int_triple_compare { public: bool operator() (double_double_int_triple x , double_double_int_triple y) const { return ( x.dj < y.dj); } }; //------------------------------------------------------------------------------- // Generate three cycle cuts //------------------------------------------------------------------- void CglOddHole::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info) { // Get basic problem information int nRows=si.getNumRows(); int nCols=si.getNumCols(); const CoinPackedMatrix * rowCopy = si.getMatrixByRow(); // Could do cliques and extra OSL cliques // For moment just easy ones // If no information exists then get a list of suitable rows // If it does then suitable rows are subset of information CglOddHole temp; int * checkRow = new int[nRows]; int i; if (!suitableRows_) { for (i=0;igetIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * collower = si.getColLower(); const double * colupper = si.getColUpper(); int * suitable = temp.suitableRows_; // At present I am using new and delete as easier to see arrays in debugger int * fixed = new int[nCols]; // mark fixed columns for (i=0;ionetol_) { solution[i]=1.0; fixed[i]=+1; } } else { //mark as fixed even if not (can not intersect any interesting rows) solution[i]=0.0; fixed[i]=3; } } // first do packed const double * rowlower = si.getRowLower(); const double * rowupper = si.getRowUpper(); for (i=0;i1.001) suitable[i]=-1; for (k=rowStart[i]; konOptimalPath(si)) debugger = NULL; #else const OsiRowCutDebugger * debugger = NULL; #endif temp.generateCuts(debugger, *rowCopy,solution, si.getReducedCost(),cs,suitable,fixed,info,true); // now cover //if no >= then skip bool doCover=false; int nsuitable=0; for (i=0;i1.001) doCover=true; for (k=rowStart[i]; k1.1) { suitable[i]=-1; //say no good } else { nsuitable++; } } } if (doCover&&nsuitable) temp.generateCuts(debugger, *rowCopy,solution,si.getReducedCost(), cs,suitable,fixed,info,false); delete [] checkRow; delete [] solution; delete [] fixed; } void CglOddHole::generateCuts(const OsiRowCutDebugger * /*debugger*/, const CoinPackedMatrix & rowCopy, const double * solution, const double * dj, OsiCuts & cs, const int * suitableRow, const int * fixedColumn, const CglTreeInfo info, bool packed) { CoinPackedMatrix columnCopy = rowCopy; columnCopy.reverseOrdering(); // Get basic problem information int nRows=columnCopy.getNumRows(); int nCols=columnCopy.getNumCols(); const int * column = rowCopy.getIndices(); const CoinBigIndex * rowStart = rowCopy.getVectorStarts(); const int * rowLength = rowCopy.getVectorLengths(); const int * row = columnCopy.getIndices(); const CoinBigIndex * columnStart = columnCopy.getVectorStarts(); const int * columnLength = columnCopy.getVectorLengths(); // we need only look at suitable rows and variables with unsatisfied 0-1 // lookup from true row to compressed matrix int * mrow = new int[nRows]; // lookup from true column to compressed int * lookup = new int[nCols]; // number of columns in compressed matrix int nSmall=0; int i; //do lookup from true sequence to compressed int n=0; for (i=0;i0) { mrow[i]=n++; } else { mrow[i]=-1; } } for (i=0;i (malloc(maxels*sizeof(double))); // arc i.e. j which can be reached from i int * to= reinterpret_cast (malloc(maxels*sizeof(int))); //original row for each arc int * rowfound=reinterpret_cast (malloc(maxels*sizeof(int))); // start of each column int * starts=new int[2*nSmall+1]; starts[0]=0; // useful array for marking if already connected int * mark =new int[nSmall2]; memset(mark,0,nSmall2*sizeof(int)); n=0; //number of elements in matrix for (i=0;i=0) { // column in compressed matrix int k; double dd=1.0000001-solution[i]; mark[icol]=1; // reallocate if matrix reached size limit if (n+nCols>maxels) { maxels*=2; cost=reinterpret_cast (realloc(cost,maxels*sizeof(double))); to=reinterpret_cast (realloc(to,maxels*sizeof(int))); rowfound=reinterpret_cast (realloc(rowfound,maxels*sizeof(int))); } // get all other connected variables for (k=columnStart[i];k=0) { int j; for (j=rowStart[irow];j=0&&!mark[kcol]) { cost[n]=dd-solution[jcol]; to[n]=kcol; rowfound[n++]=irow;//original row mark[kcol]=1; } } } } starts[icol+1]=n; // zero out markers for next column mark[icol]=0; for (k=starts[icol];k=nSmall) abort(); mark[to[k]]=0; } } } //if cover then change sign - otherwise make sure positive if (packed) { for (i=0;imaxels) { maxels=2*n; cost=reinterpret_cast (realloc(cost,maxels*sizeof(double))); to=reinterpret_cast (realloc(to,maxels*sizeof(int))); rowfound=reinterpret_cast (realloc(rowfound,maxels*sizeof(int))); } /* copy and make bipartite*/ for (i=0;irandomDouble(); } } else { CoinSeedRandom(13579); for (i=0;i (malloc(maxcuts*sizeof(double))); // to clean (should not be needed) int * clean = new int[nSmall2]; int * candidate = new int[CoinMax(nSmall2,nCols)]; double * element = new double[nCols]; // in case we want to sort double_double_int_triple * sortit = new double_double_int_triple [nCols]; memset(mark,0,nSmall2*sizeof(int)); int * countcol = new int[nCols]; memset(countcol,0,nCols*sizeof(int)); int bias = packed ? 0 : 1; //amount to add before halving // If nSmall large then should do a randomized subset // Improvement 1 int icol; for (icol=0;icol=nSmall) { jjcol=jcol-nSmall; } else { jjcol=jcol; } #ifdef CGL_DEBUG printf(" %d",jjcol); #endif if (mark[jjcol]) { // good=false; // probably means this is from another cycle (will have been found) // one of cycles must be zero cost // printf("variable already on chain!\n"); } else { mark[jjcol]=1; clean[nclean++]=jjcol; candidate[ii++]=jcol; #ifdef CGL_DEBUG assert (ii<=nSmall2); #endif } } #ifdef CGL_DEBUG printf("\n"); #endif for (j=0;j0;k--) { int jk,kk=candidate[k]; int ix=0; for (jk=starts[kk];jk>1; double rhs=nrow2; if (!packed) rhs++; // +1 for cover ii=0; for (k=0;k>1; if (ihalf) { element[ii]=ihalf; sum+=solution[jcol]*element[ii]; /*printf("%d %g %g\n",jcol,element[ii],sumall[jcol]);*/ candidate[ii++]=jcol; } countcol[jcol]=0; } } #ifdef CGL_DEBUG printf("\n"); #endif OsiRowCut rc; double violation=0.0; if (packed) { violation = sum-rhs; rc.setLb(-COIN_DBL_MAX); rc.setUb(rhs); } else { // other way for cover violation = rhs-sum; rc.setUb(COIN_DBL_MAX); rc.setLb(rhs); } if (violation (ii) * minimumViolationPer_>violation|| ii>maximumEntries_) { #ifdef CGL_DEBUG printf("why no cut\n"); #endif if (packed) { // sort and see if we can get down to length // relax by taking out ones with solution 0.0 nincut=ii; for (k=0;k (realloc(hash,maxcuts*sizeof(double))); } hash[ncuts++]=value; rc.setRow(ii,candidate,element); #ifdef CGL_DEBUG printf("sum %g rhs %g %d\n",sum,rhs,ii); if (debugger) assert(!debugger->invalidCut(rc)); #endif cs.insert(rc); } } } /* end of adding cut */ } } } delete [] countcol; delete [] element; delete [] candidate; delete [] sortit; delete [] clean; delete [] path; delete [] stack; free(hash); delete [] check; delete [] mark; delete [] starts; delete [] lookup; delete [] mrow; free(rowfound); free(to); free(cost); } // Create a list of rows which might yield cuts // The possible parameter is a list to cut down search void CglOddHole::createRowList( const OsiSolverInterface & si, const int * possible) { // Get basic problem information int nRows=si.getNumRows(); const CoinPackedMatrix * rowCopy = si.getMatrixByRow(); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); int rowIndex; delete [] suitableRows_; numberRows_=nRows; const double * rowElements = rowCopy->getElements(); const double * rowupper = si.getRowUpper(); const double * rowlower = si.getRowLower(); const double * collower = si.getColLower(); const double * colupper = si.getColUpper(); suitableRows_=new int[nRows]; if (possible) { memcpy(suitableRows_,possible,nRows*sizeof(int)); } else { int i; for (i=0;iepsilon_) { // could allow general integer variables but unlikely if (!si.isBinary(thisCol) ) { goodRow=false; break; } if (fabs(rowElements[i]-1.0)>epsilon_) { goodRow=false; break; } } else { rhs1 -= collower[thisCol]*rowElements[i]; rhs2 -= collower[thisCol]*rowElements[i]; } } if (fabs(rhs1-1.0)>epsilon_&&fabs(rhs2-1.0)>epsilon_) { goodRow=false; } if (goodRow) { suitableRows_[rowIndex]=1; } else { suitableRows_[rowIndex]=0; } } } } /// This version passes in a list - 1 marks possible void CglOddHole::createRowList(int numberRows, const int * whichRow) { suitableRows_=new int [numberRows]; numberRows_=numberRows; memcpy(suitableRows_,whichRow,numberRows*sizeof(int)); } // Create a list of extra row cliques which may not be in matrix // At present these are classical cliques void CglOddHole::createCliqueList(int numberCliques, const int * cliqueStart, const int * cliqueMember) { numberCliques_=numberCliques; startClique_=new int[numberCliques_+1]; memcpy(startClique_,cliqueStart,(numberCliques_+1)*sizeof(int)); int length=startClique_[numberCliques_]; member_=new int[length]; memcpy(member_,cliqueMember,length*sizeof(int)); } // Returns how many rows might give three cycle cuts int CglOddHole::numberPossible() { int i,n=0; for (i=0;i1.0e-8&&value<=0.5) minimumViolation_=value; } // Minimum violation per entry double CglOddHole::getMinimumViolationPer() const { return minimumViolationPer_; } void CglOddHole::setMinimumViolationPer(double value) { if (value>1.0e-8&&value<=0.25) minimumViolationPer_=value; } // Maximum number of entries in a cut int CglOddHole::getMaximumEntries() const { return maximumEntries_; } void CglOddHole::setMaximumEntries(int value) { if (value>2) maximumEntries_=value; } // This can be used to refresh any inforamtion void CglOddHole::refreshSolver(OsiSolverInterface * ) { } Cgl-0.58.9/src/CglOddHole/Makefile.am0000644000076600007660000000317611621724114015575 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglOddHole # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglOddHole.la # List all source files for this library, including headers libCglOddHole_la_SOURCES = CglOddHole.cpp CglOddHole.hpp CglOddHoleTest.cpp # This is for libtool (on Windows) libCglOddHole_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglOddHole.hpp Cgl-0.58.9/src/CglOddHole/CglOddHole.hpp0000644000076600007660000001124012130104734016201 0ustar coincoin// $Id: CglOddHole.hpp 1123 2013-04-06 20:47:24Z stefan $ // 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 CglOddHole_H #define CglOddHole_H #include #include "CglCutGenerator.hpp" /** Odd Hole Cut Generator Class */ class CglOddHole : public CglCutGenerator { friend void CglOddHoleUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /**@name Generate Cuts */ //@{ /** Generate odd hole cuts for the model of the solver interface, si. This looks at all rows of type sum x(i) <= 1 (or == 1) (x 0-1) and sees if there is an odd cycle cut. See Grotschel, Lovasz and Schrijver (1988) for method. This is then lifted by using the corresponding Chvatal cut i.e. Take all rows in cycle and add them together. RHS will be odd so weaken all odd coefficients so 1.0 goes to 0.0 etc - then constraint is sum even(j)*x(j) <= odd which can be replaced by sum (even(j)/2)*x(j) <= (odd-1.0)/2. A similar cut can be generated for sum x(i) >= 1. Insert the generated cuts into OsiCut, cs. This is only done for rows with unsatisfied 0-1 variables. If there are many of these it will be slow. Improvements would do a randomized subset and also speed up shortest path algorithm used. */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Create Row List */ //@{ /// Create a list of rows which might yield cuts /// this is to speed up process /// The possible parameter is a list to cut down search void createRowList( const OsiSolverInterface & si, const int * possible=NULL); /// This version passes in a list - 1 marks possible void createRowList(int numberRows, const int * whichRow); //@} /**@name Create Clique List */ //@{ /// Create a list of extra row cliques which may not be in matrix /// At present these are classical cliques void createCliqueList(int numberCliques, const int * cliqueStart, const int * cliqueMember); //@} /**@name Number Possibilities */ //@{ /// Returns how many rows might give odd hole cuts int numberPossible(); //@} /**@name Gets and Sets */ //@{ /// Minimum violation double getMinimumViolation() const; void setMinimumViolation(double value); /// Minimum violation per entry double getMinimumViolationPer() const; void setMinimumViolationPer(double value); /// Maximum number of entries in a cut int getMaximumEntries() const; void setMaximumEntries(int value); //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglOddHole (); /// Copy constructor CglOddHole ( const CglOddHole &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglOddHole & operator=( const CglOddHole& rhs); /// Destructor virtual ~CglOddHole (); /// This can be used to refresh any inforamtion virtual void refreshSolver(OsiSolverInterface * solver); //@} private: // Private member methods /**@name Private methods */ //@{ /// Generate cuts from matrix copy and solution /// If packed true then <=1 rows, otherwise >=1 rows. void generateCuts(const OsiRowCutDebugger * debugger, const CoinPackedMatrix & rowCopy, const double * solution, const double * dj, OsiCuts & cs, const int * suitableRow, const int * fixedColumn,const CglTreeInfo info, bool packed); //@} // Private member data /**@name Private member data */ //@{ /// list of suitableRows int * suitableRows_; /// start of each clique int * startClique_; /// clique members int * member_; /// epsilon double epsilon_; /// 1-epsilon double onetol_; /// Minimum violation double minimumViolation_; /// Minimum violation per entry double minimumViolationPer_; /// Maximum number of entries in a cut int maximumEntries_; /// number of rows when suitability tested int numberRows_; /// number of cliques int numberCliques_; //@} }; //############################################################################# /** A function that tests the methods in the CglOddHole class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglOddHoleUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglOddHole/CglOddHoleTest.cpp0000644000076600007660000000573512130104734017050 0ustar coincoin// $Id: CglOddHoleTest.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CoinPackedMatrix.hpp" #include "CglOddHole.hpp" //-------------------------------------------------------------------------- // test EKKsolution methods. void CglOddHoleUnitTest( const OsiSolverInterface * baseSiP, const std::string mpsDir ) { CoinRelFltEq eq(0.000001); // Test default constructor { CglOddHole aGenerator; } // Test copy & assignment { CglOddHole rhs; { CglOddHole bGenerator; CglOddHole cGenerator(bGenerator); rhs=bGenerator; } } // test on simple case { const int nRows=3; const int nCols=3; const int nEls=6; const double elem[]={1.0,1.0,1.0,1.0,1.0,1.0}; const int row[]={0,1,0,2,1,2}; const CoinBigIndex start[]={0,2,4}; const int len[]={2,2,2}; CoinPackedMatrix matrix(true,nRows,nCols,nEls,elem,row,start,len); const double sol[]={0.5,0.5,0.5}; const double dj[]={0,0,0}; const int which[]={1,1,1}; const int fixed[]={0,0,0}; OsiCuts cs; CglOddHole test1; CglTreeInfo info; info.randomNumberGenerator=NULL; test1.generateCuts(NULL,matrix,sol,dj,cs,which,fixed,info,true); CoinPackedVector check; int index[] = {0,1,2}; double el[] = {1,1,1}; check.setVector(3,index,el); //assert (cs.sizeRowCuts()==2); assert (cs.sizeRowCuts()==1); // sort Elements in increasing order CoinPackedVector rpv=cs.rowCut(0).row(); rpv.sortIncrIndex(); assert (check==rpv); } // Testcase /u/rlh/osl2/mps/scOneInt.mps // Model has 3 continous, 2 binary, and 1 general // integer variable. { OsiSolverInterface * siP = baseSiP->clone(); std::string fn = mpsDir+"scOneInt"; siP->readMps(fn.c_str(),"mps"); #if 0 CglOddHole cg; int nCols=siP->getNumCols(); // Test the siP methods for detecting // variable type int numCont=0, numBinary=0, numIntNonBinary=0, numInt=0; for (int thisCol=0; thisColisContinuous(thisCol) ) numCont++; if ( siP->isBinary(thisCol) ) numBinary++; if ( siP->isIntegerNonBinary(thisCol) ) numIntNonBinary++; if ( siP->isInteger(thisCol) ) numInt++; } assert(numCont==3); assert(numBinary==2); assert(numIntNonBinary==1); assert(numInt==3); // Test initializeCutGenerator siP->initialSolve(); assert(xstar !=NULL); for (i=0; igetNumRows(); for (i=0; igetMatrixByRow()->getVectorSize(i); assert(vectorsize==2); } kccg.cleanUpCutGenerator(complement,xstar); #endif delete siP; } } Cgl-0.58.9/src/CglOddHole/Makefile.in0000644000076600007660000005400312240340055015575 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/CglOddHole 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglOddHole_la_LIBADD = am_libCglOddHole_la_OBJECTS = CglOddHole.lo CglOddHoleTest.lo libCglOddHole_la_OBJECTS = $(am_libCglOddHole_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 = $(libCglOddHole_la_SOURCES) DIST_SOURCES = $(libCglOddHole_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglOddHole # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglOddHole.la # List all source files for this library, including headers libCglOddHole_la_SOURCES = CglOddHole.cpp CglOddHole.hpp CglOddHoleTest.cpp # This is for libtool (on Windows) libCglOddHole_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglOddHole.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/CglOddHole/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglOddHole/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglOddHole.la: $(libCglOddHole_la_OBJECTS) $(libCglOddHole_la_DEPENDENCIES) $(CXXLINK) $(libCglOddHole_la_LDFLAGS) $(libCglOddHole_la_OBJECTS) $(libCglOddHole_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglOddHole.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglOddHoleTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglDuplicateRow/0000755000076600007660000000000012377555671014641 5ustar coincoinCgl-0.58.9/src/CglDuplicateRow/CglDuplicateRow.cpp0000644000076600007660000026353512306374722020377 0ustar coincoin// $Id: CglDuplicateRow.cpp 1200 2014-03-07 16:54:42Z forrest $ // Copyright (C) 2004, 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 //#define PRINT_DEBUG //#define CGL_DEBUG #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedMatrix.hpp" #include "CoinFinite.hpp" #include "OsiRowCutDebugger.hpp" #include "CglDuplicateRow.hpp" #include "CglStored.hpp" //------------------------------------------------------------------- // Generate duplicate row column cuts //------------------------------------------------------------------- void CglDuplicateRow::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info) { #ifdef CGL_DEBUG const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&debugger->onOptimalPath(si)) { printf("On optimal path\n"); } #endif // Don't do in tree ? if (info.inTree) { // but do any stored cuts if (storedCuts_) storedCuts_->generateCuts(si,cs,info); return; } if ((mode_&3)!=0) { generateCuts12(si,cs,info); } else if ((mode_&4)!=0) { generateCuts4(si,cs,info); } else { assert ((mode_&8)!=0); generateCuts8(si,cs,info); } } void CglDuplicateRow::generateCuts12(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info) { int numberColumns = matrix_.getNumCols(); CoinPackedVector ubs; // Column copy const double * element = matrix_.getElements(); const int * row = matrix_.getIndices(); const CoinBigIndex * columnStart = matrix_.getVectorStarts(); const int * columnLength = matrix_.getVectorLengths(); // Row copy const double * elementByRow = matrixByRow_.getElements(); const int * column = matrixByRow_.getIndices(); const CoinBigIndex * rowStart = matrixByRow_.getVectorStarts(); const int * rowLength = matrixByRow_.getVectorLengths(); const double * columnLower = si.getColLower(); const double * columnUpper = si.getColUpper(); int nFree=0; int nOut=0; int nFixed=0; int i; int numberRows=matrix_.getNumRows(); const double * rowLower = si.getRowLower(); const double * rowUpper = si.getRowUpper(); int * effectiveRhs = CoinCopyOfArray(rhs_,numberRows); int * effectiveLower = CoinCopyOfArray(lower_,numberRows); double * effectiveRhs2 = new double [numberRows]; /* For L or G rows - compute effective lower we have to raech */ // mark bad rows - also used for domination for (i=0;i1.0e20) { LorG=2; rhs=rowLower[i]; } int j; for (j=rowStart[i];j0.0) { double bound=columnLower[iColumn]; if (bound>-1.0e20) rhs -= bound*value; else LorG=-1; } else { double bound=columnUpper[iColumn]; if (bound<1.0e20) rhs -= bound*value; else LorG=-1; } } else if (LorG==2) { // need highest contribution if (value<0.0) { double bound=columnLower[iColumn]; if (bound>-1.0e20) rhs -= bound*value; else LorG=-2; } else { double bound=columnUpper[iColumn]; if (bound<1.0e20) rhs -= bound*value; else LorG=-2; } } if (duplicate!=-3) { if (value!=1.0) { duplicate=-3; rhs_[i]=-1000000; //break; } else if (!si.isInteger(iColumn)) { duplicate=-5; } } } duplicate_[i]=duplicate; if (!LorG) { effectiveRhs2[i]=0.0; } else if (LorG<0) { // weak effectiveRhs2[i]=-COIN_DBL_MAX; } else if (LorG==1) { effectiveRhs2[i]=rhs; } else { effectiveRhs2[i]=rhs; } } double * colUpper2 = CoinCopyOfArray(columnUpper,numberColumns); if (!info.pass&&(mode_&2)!=0) { // First look at duplicate or dominated columns double * random = new double[numberRows]; double * sort = new double[numberColumns+1]; if (info.randomNumberGenerator) { const CoinThreadRandom * randomGenerator = info.randomNumberGenerator; for (i=0;i1.0e20) random[i]=0.0; else random[i] = randomGenerator->randomDouble(); } } else { for (i=0;i1.0e20) random[i]=0.0; else random[i] = CoinDrand48(); } } int * which = new int[numberColumns]; int nPossible=0; for ( i=0;ilastValue) { if (i-last<=maximumDominated_&&i>last+1) { // look to see if dominated for (int j=last;j1.0e20) ? element[jj] : -element[jj]; rowGeJ[nGeJ++]=iRow; } } double objValueJ = objective[jColumn]*direction; for (int k=j+1;k0.0) continue; int nEqualK=0; // -2 no good, -1 J dominates K, 0 unknown or equal, 1 K dominates J int dominate=0; // mark int kk; for (kk=0;kk1.0e20) ? element[kk] : -element[kk]; double valueJ = elementGeJ[iRow]; mark[iRow]=0; if (valueJ==valueK) { // equal } else if (valueJ>valueK) { // J would dominate K if (dominate==1) { // no good dominate=-2; break; } else { dominate=-1; } } else { // K would dominate J if (dominate==-1) { // no good dominate=-2; break; } else { dominate=1; } } } } kk=0; if (dominate!=-2) { // unmark and check for (;kkvalueK) { // J would dominate K if (dominate==1) { // no good dominate=-2; break; } else { dominate=-1; } } else { // K would dominate J if (dominate==-1) { // no good dominate=-2; break; } else { dominate=1; } } } mark[iRow]=0; } } // just unmark rest for (;kkobjValueK&&dominate==1) { // say K dominates assert (colUpper2[jColumn]); dominate=1; } else { dominate=0; } if (dominate) { // see if both can be 1 bool canFix=false; for (int jj=0;jj0.0) { minSum += lo*elValue; maxSum += up*elValue; } else { maxSum += lo*elValue; minSum += up*elValue; } } } if (minSum+value>rowUpper[iRow]+1.0e-5) canFix=true; else if (maxSum+valueeffectiveRhs2[iRow]+1.0e-4) { canFix=true; break; } } else { // >= row double valueK = element[kk] + elementGeJ[iRow]; if (valueK0) ? jColumn : kColumn; nFixed++; assert (!columnLower[iColumn]); colUpper2[iColumn]=0.0; ubs.insert(iColumn,0.0); if (iColumn==jColumn) break; // no need to carry on on jColumn } else { int iDominated = (dominate>0) ? jColumn : kColumn; int iDominating = (dominate<0) ? jColumn : kColumn; double els[]={1.0,-1.0}; int inds[2]; inds[0]=iDominating; inds[1]=iDominated; if (!storedCuts_) storedCuts_ = new CglStored(); storedCuts_->addCut(0.0,COIN_DBL_MAX,2,inds,els); } } } } for (jj=0;jjsizeRowCuts() : 0; if (nFixed||numberCuts) printf("** %d fixed and %d cuts from domination\n",nFixed,numberCuts); #endif } delete [] effectiveRhs2; bool infeasible=false; // if we were just doing columns - mark all as bad if ((mode_&1)==0) { for (i=0;i (element[jj]*value); effectiveRhs[iRow] -= static_cast (element[jj]*value); effectiveLower[iRow] -= static_cast (element[jj]*value); } } } for ( i=0;i=0&&element[jj]>effectiveRhs[iRow]) fixed=true; } if (fixed) { nFixed++; colUpper2[i]=columnLower[i]; ubs.insert(i,columnLower[i]); } else { nFree++; } } } // See if anything odd char * check = new char[numberColumns]; memset(check,0,numberColumns); int * which2 = new int[numberColumns]; for (i=0;i (rowUpper[i]); effectiveLower[i] = static_cast (CoinMax(0.0,rowLower[i])); bool goodRow=true; for (int j=rowStart[i];j (value); effectiveLower[i] -= static_cast (value); } else { goodRow=false; } } } if (goodRow) duplicate_[i] = -1; // can have continuous variables now else duplicate_[i] = -3; } else { duplicate_[i] = -3; } } if (duplicate_[i]==-1) { if (effectiveRhs[i]>0) { // leave } else if (effectiveRhs[i]==0) { duplicate_[i]=-2; } else { duplicate_[i]=-3; // leave unless >=1 row if (effectiveLower[i]==1&&rhs_[i]<0.0) duplicate_[i]=-4; } } else { effectiveRhs[i]=-1000; } } // Look at <= rows for (i=0;i=nn&&effectiveLower[i]==rhs_[i]&&effectiveLower[k]==rhs_[k]) { abort(); } } else if (nnsame==nn&&nn2>nn&&effectiveLower[i]==rhs_[i]&&rhs_[i]<=rhs_[k]) { if (logLevel_) printf("row %d strict superset of row %d, fix some in row %d\n", k,i,k); // treat k as duplicate duplicate_[k]=i; // set check for k for ( j=rowStart[k];jnn&&effectiveLower[i]<=0&&rhs_[k]<=rhs_[i]) { if (logLevel_) printf("row %d slack subset of row %d, drop row %d\n", i,k,i); // treat i as duplicate duplicate_[i]=k; } } } } } for (k=0;k=1 rows for (i=0;inn) { // k redundant if (logLevel_) printf("row %d slack superset of row %d, drop row %d\n", k,i,k); // treat k as duplicate duplicate_[k]=i; } else if (nn21.0e30) { if (logLevel_) { printf("Cover row %d %g <= ",i,rowLower[i]); printf("(%d,%g) (%d,%g) ",column0,element0,column1,element1); printf(" <= %g\n",rowUpper[i]); } effectiveRhs[nPossible++]=i; } else { // not at present //printf("NON Cover row %d %g <= ",i,rowLower[i]); //printf("(%d,%g) (%d,%g) ",column0,element0,column1,element1); //printf(" <= %g\n",rowUpper[i]); } } } } if (nPossible) { int * check2 = new int [numberColumns]; CoinFillN(check2,numberColumns,-1); for (int iPossible=0;iPossible1) #endif printf("***Make %d %d %d >=2 and take out rows %d %d %d\n", columnB1,column0,column1, i,k,check2[columnB1]); OsiRowCut rc; rc.setLb(2.0); rc.setUb(COIN_DBL_MAX); int index[3]; double element[3]={1.0,1.0,1.0}; index[0]=column0; index[1]=column1; index[2]=columnB1; rc.setRow(3,index,element,false); cs.insert(rc); // drop rows duplicate_[i]=-2; duplicate_[k]=-2; duplicate_[check2[columnB1]]=-2; } } } for (k=0;k>1; } } } else { duplicate_[i]=-1; } } delete [] effectiveRhs; delete [] effectiveLower; if (logLevel_) printf("%d free (but %d fixed this time), %d out of rhs, DP size %d, %d rows\n", nFree,nFixed,nOut,sizeDynamic_,nRow); if (nFixed) { OsiColCut cc; cc.setUbs(ubs); cc.setEffectiveness(100.0); cs.insert(cc); } if (infeasible) { // generate infeasible cut and return OsiRowCut rc; rc.setLb(COIN_DBL_MAX); rc.setUb(0.0); cs.insert(rc); } } void CglDuplicateRow::generateCuts4(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo ) { int numberColumns = matrix_.getNumCols(); // Column copy const double * element = matrix_.getElements(); const int * row = matrix_.getIndices(); const CoinBigIndex * columnStart = matrix_.getVectorStarts(); const int * columnLength = matrix_.getVectorLengths(); const double * columnLower = si.getColLower(); const double * columnUpper = si.getColUpper(); int nFixed=0; int numberRows=matrix_.getNumRows(); const double * rowLower = si.getRowLower(); const double * rowUpper = si.getRowUpper(); bool infeasible=false; // try more complicated domination int * originalColumns = new int [numberColumns]; int * originalRows = new int [2*numberRows]; int * rowCount = originalRows+numberRows; memset(rowCount,0,numberRows*sizeof(int)); memset(originalRows,0,numberRows*sizeof(int)); unsigned char * rowFlag = new unsigned char[numberRows]; unsigned char * columnFlag = new unsigned char[2*numberColumns]; double * newBound = new double[numberColumns]; double * trueLower = new double[numberColumns]; double * effectiveRhs = new double [2*numberRows]; double *rhs2 = effectiveRhs+numberRows; // first take out fixed stuff memset(rhs2,0,numberRows*sizeof(double)); memset(rowFlag,0,numberRows); memset(columnFlag,0,numberColumns); int nCol2=0; for (int i=0;i-1.0e20) { for (int jj=columnStart[i];jjlo) { int add=0; if (si.isInteger(i)) { columnFlag[nCol2]|=2; if (up>lo+1.5) { add=1; // only allow one general columnFlag[nCol2]|=4; } } else { add=1; } newBound[nCol2]=up-lo; trueLower[nCol2]=lo; originalColumns[nCol2++]=i; for (int jj=columnStart[i];jj1||!nInt) flag=8; // don't look at for now if (rowLower[i]==rowUpper[i]) flag |= 1; else if (rowLower[i]>-1.0e20&&rowUpper[i]<1.0e20) flag |=8; else if (rowUpper[i]>1.0e20) flag |= 2; if ((flag&8)==0) { rowCount[nRow2]=rowCount[i]; originalRows[nRow2++]=i; } } CoinSort_2(rowCount,rowCount+nRow2,originalRows); for (int i=0;i1.0e20) flag |= 2; rowFlag[i]=flag; } if (nRow2&&nCol2) { CoinPackedMatrix small(matrix_,nRow2,originalRows, nCol2,originalColumns); // Column copy small.removeGaps(); double * element = small.getMutableElements(); const int * row = small.getIndices(); const CoinBigIndex * columnStart = small.getVectorStarts(); //const int * columnLength = small.getVectorLengths(); for (int i=0;i=2&&nRowStart<0) nRowStart=nRowLook; if (n>MAX_IN_BASE) break; } // cut back nRow2 int nnRow2=nRowLook; for (nnRow2=0;nnRow2MAX_IN_COMP) break; } nRow2=nnRow2; nRowStart=CoinMax(0,nRowStart); unsigned char * mark = columnFlag+nCol2; memset(mark,0,nCol2); /* at most 3 0-1 integers - if all 0-1 then see if same allowed if one other then get bounds */ double loC0[4]; double upC0[4]; int allowed0[8]; double loC1[4]; double upC1[4]; int allowed1[8]; for (int i=nRowStart;iloRhs-tolerance) allowed0[put]=1; else allowed0[put]=0; } } upRhs = effectiveRhs[k]; loRhs = ((rowFlag[k]&1)!=0) ? effectiveRhs[k] : -1.0e30; tolerance = CoinMax(1.0e-5,fabs(upRhs)*1.0e-10); for (int j0=0;j0<2;j0++) { for (int j1=0;j1<2;j1++) { double value = element1[0]*j0+element1[1]*j1; int put = j0+2*j1; if (valueloRhs-tolerance) allowed1[put]=1; else allowed1[put]=0; } } /* interesting cases are when - one forces fixing (but probably found in probing) and of two is zero and of two forces fixing two same - this is probably only one */ int intersect[4]; bool same=true; bool tighter0=true; bool tighter1=true; bool feasible=false; bool redundant=true; for (int j=0;j<4;j++) { intersect[j]=allowed0[j]&allowed1[j]; if (intersect[j]0.0) printf(" +"); else printf(" "); } int iColumn=column0[j]; if ((columnFlag[iColumn]&2)==0) printf("%g*X%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else if ((columnFlag[iColumn]&(2+4))==2) printf("%g*B%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else printf("%g*I%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); } if ((rowFlag[i]&1)!=0) printf(" == "); else printf(" <= "); printf("%g\n",effectiveRhs[i]); printf("Comp %d (orig %d) ",k,originalRows[k]); for (int j=0;j0.0) printf(" +"); else printf(" "); } int iColumn=column1[j]; if ((columnFlag[iColumn]&2)==0) printf("%g*X%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else if ((columnFlag[iColumn]&(2+4))==2) printf("%g*B%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else printf("%g*I%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); } if ((rowFlag[k]&1)!=0) printf(" == "); else printf(" <= "); printf("%g\n",effectiveRhs[k]); } /* end debug print */ #endif #ifdef CGL_INVESTIGATE printf("**same %c redundant %c feasible %c tight %c,%c fixed %d,%d\n", same ? 'Y' : 'N', redundant ? 'Y' : 'N', feasible ? 'Y' : 'N', tighter0 ? 'Y' : 'N', tighter1 ? 'Y' : 'N', fixed[0],fixed[1]); #endif if (!feasible) { #ifdef CGL_INVESTIGATE printf("QQ infeasible\n"); #endif infeasible=true; } else if (fixed[0]||fixed[1]) { #ifdef CGL_INVESTIGATE printf("QQ fixed\n"); #endif for (int k=0;k<2;k++) { if (fixed[k]) { int iColumn=column0[k]; int kColumn=originalColumns[iColumn]; #ifdef CGL_INVESTIGATE printf("true bounds %g %g\n",columnLower[kColumn], columnUpper[kColumn]); #endif double lo; if (fixed[k]>0) { lo=1.0; } else { lo=0.0; } if ((columnFlag[iColumn]&1)==0) { columnFlag[iColumn] |= 16; trueLower[iColumn] += lo; newBound[iColumn] = 0.0; for (int jj=columnStart[iColumn];jjloRhs-tolerance) allowed0[put]=1; else allowed0[put]=0; } } } upRhs = effectiveRhs[k]; loRhs = ((rowFlag[k]&1)!=0) ? effectiveRhs[k] : -1.0e30; tolerance = CoinMax(1.0e-5,fabs(upRhs)*1.0e-10); for (int j0=0;j0<2;j0++) { for (int j1=0;j1<2;j1++) { for (int j2=0;j2<2;j2++) { double value = element1[0]*j0+element1[1]*j1 +element1[2]*j2; int put = j0+2*j1+4*j2; if (valueloRhs-tolerance) allowed1[put]=1; else allowed1[put]=0; } } } /* interesting cases are when - one forces fixing (but probably found in probing) and of two is zero and of two forces fixing two same - this is probably only one */ int intersect[8]; bool same=true; bool tighter0=true; bool tighter1=true; bool feasible=false; bool redundant=true; for (int j=0;j<8;j++) { intersect[j]=allowed0[j]&allowed1[j]; if (intersect[j]0.0) printf(" +"); else printf(" "); } int iColumn=column0[j]; if ((columnFlag[iColumn]&2)==0) printf("%g*X%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else if ((columnFlag[iColumn]&(2+4))==2) printf("%g*B%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else printf("%g*I%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); } if ((rowFlag[i]&1)!=0) printf(" == "); else printf(" <= "); printf("%g\n",effectiveRhs[i]); printf("Comp %d (orig %d) ",k,originalRows[k]); for (int j=0;j0.0) printf(" +"); else printf(" "); } int iColumn=column1[j]; if ((columnFlag[iColumn]&2)==0) printf("%g*X%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else if ((columnFlag[iColumn]&(2+4))==2) printf("%g*B%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else printf("%g*I%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); } if ((rowFlag[k]&1)!=0) printf(" == "); else printf(" <= "); printf("%g\n",effectiveRhs[k]); } /* end debug print */ #endif #ifdef CGL_INVESTIGATE printf("**same3 %c redundant %c feasible %c tight %c,%c fixed %d,%d,%d\n", same ? 'Y' : 'N', redundant ? 'Y' : 'N', feasible ? 'Y' : 'N', tighter0 ? 'Y' : 'N', tighter1 ? 'Y' : 'N', fixed[0],fixed[1],fixed[2]); #endif if (!feasible) { #ifdef CGL_INVESTIGATE printf("QQ infeasible\n"); #endif infeasible=true; } else if (fixed[0]||fixed[1]||fixed[2]) { #ifdef CGL_INVESTIGATE printf("QQ fixed\n"); #endif for (int k=0;k<3;k++) { if (fixed[k]) { int iColumn=column0[k]; int kColumn=originalColumns[iColumn]; #ifdef CGL_INVESTIGATE printf("true bounds %g %g\n",columnLower[kColumn], columnUpper[kColumn]); #endif double lo; if (fixed[k]>0) { lo=1.0; } else { lo=0.0; } if ((columnFlag[iColumn]&1)==0) { columnFlag[iColumn] |= 16; trueLower[iColumn] += lo; newBound[iColumn] = 0.0; for (int jj=columnStart[iColumn];jj0.0) { valueLo=value; valueHi=value+gap0; } else { valueLo=value+gap0; valueHi=value; } if (valueLoloRhs-tolerance) allowed0[put]=1; else allowed0[put]=0; if (valueLo0.0) { loC0[put]=(loRhs-valueLo)/el0[2]; } else { upC0[put]=bound-((valueLo-loRhs)/el0[2]); } } if (valueHi>upRhs+tolerance) { if (gap0>0.0) { upC0[put]=bound-((valueHi-upRhs)/el0[2]); } else { loC0[put]=(upRhs-valueHi)/el0[2]; } } } } upRhs = effectiveRhs[k]; loRhs = ((rowFlag[k]&1)!=0) ? effectiveRhs[k] : -1.0e30; tolerance = CoinMax(1.0e-5,fabs(upRhs)*1.0e-10); for (int j0=0;j0<2;j0++) { for (int j1=0;j1<2;j1++) { double value = el1[0]*j0+el1[1]*j1; int put = j0+2*j1; double valueLo,valueHi; if (gap1>0.0) { valueLo=value; valueHi=value+gap1; } else { valueLo=value+gap1; valueHi=value; } if (valueLoloRhs-tolerance) allowed1[put]=1; else allowed1[put]=0; if (valueLo0.0) { loC1[put]=(loRhs-valueLo)/el1[2]; } else { upC1[put]=bound-((valueLo-loRhs)/el1[2]); } } if (valueHi>upRhs+tolerance) { if (gap1>0.0) { upC1[put]=bound-((valueHi-upRhs)/el1[2]); } else { loC1[put]=(upRhs-valueHi)/el1[2]; } } } } /* interesting cases are when - one forces fixing (but probably found in probing) and of two is zero and of two forces fixing two same - this is probably only one */ int intersect[4]; bool same=true; bool tighter0=true; bool tighter1=true; bool feasible=false; bool redundant=true; int count=nInt; for (int j=0;j<(1< lo0 %g lo1 %g up0 %g up1 %g", jj,loC0[jj],loC1[jj],upC0[jj],upC1[jj]); #endif if (intersect[jj]) { #ifdef CGL_INVESTIGATE printf("\n"); #endif newLo=CoinMin(newLo,CoinMax(loC0[jj],loC1[jj])); newUp=CoinMax(newUp,CoinMin(upC0[jj],upC1[jj])); } else { #ifdef CGL_INVESTIGATE printf(" INF\n"); #endif loC0[jj]=0.0; loC1[jj]=0.0; upC0[jj]=bound; upC1[jj]=bound; } } } else { for (int jj=0;jj<2;jj++) { for (int jj1=0;jj1<2;jj1++) { int k=jj+2*jj1; #ifdef CGL_INVESTIGATE printf("first int at %d, second at %d -> lo0 %g lo1 %g up0 %g up1 %g", jj,jj1,loC0[k],loC1[k],upC0[k],upC1[k]); #endif if (intersect[k]) { #ifdef CGL_INVESTIGATE printf("\n"); #endif newLo=CoinMin(newLo,CoinMax(loC0[k],loC1[k])); newUp=CoinMax(newUp,CoinMin(upC0[k],upC1[k])); } else { #ifdef CGL_INVESTIGATE printf(" INF\n"); #endif loC0[k]=0.0; loC1[k]=0.0; upC0[k]=bound; upC1[k]=bound; } } } } if (newLo>0.0||newUp1.0e-8) same=false; if (fabs(upC0[jj]-upC1[jj])>1.0e-8) same=false; if (loC0[jj]upC1[jj]+1.0e-12) { tighter0=false; redundant=false; } if (loC1[jj]upC0[jj]+1.0e-12) { tighter1=false; redundant=false; } if (fabs(newLo-loC0[jj])>1.0e-12) redundant=false; if (fabs(newLo-loC1[jj])>1.0e-12) redundant=false; if (fabs(newUp-upC0[jj])>1.0e-12) redundant=false; if (fabs(newUp-upC1[jj])>1.0e-12) redundant=false; } if (same||redundant||!feasible||fixed[0]||fixed[1]|| tighter0||tighter1) { #ifdef CGL_INVESTIGATE /* start debug print */ { printf("Base %d (orig %d) ",i,originalRows[i]); for (int j=0;j0.0) printf(" +"); else printf(" "); } int iColumn=column0[j]; if ((columnFlag[iColumn]&2)==0) printf("%g*X%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else if ((columnFlag[iColumn]&(2+4))==2) printf("%g*B%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else printf("%g*I%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); } if ((rowFlag[i]&1)!=0) printf(" == "); else printf(" <= "); printf("%g\n",effectiveRhs[i]); printf("Comp %d (orig %d) ",k,originalRows[k]); for (int j=0;j0.0) printf(" +"); else printf(" "); } int iColumn=column1[j]; if ((columnFlag[iColumn]&2)==0) printf("%g*X%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else if ((columnFlag[iColumn]&(2+4))==2) printf("%g*B%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); else printf("%g*I%d(%d) (<=%g)",value,iColumn,originalColumns[iColumn],newBound[iColumn]); } if ((rowFlag[k]&1)!=0) printf(" == "); else printf(" <= "); printf("%g\n",effectiveRhs[k]); } /* end debug print */ #endif #ifdef CGL_INVESTIGATE printf("**same %c redundant %c feasible %c tight %c,%c fixed %d,%d\n", same ? 'Y' : 'N', redundant ? 'Y' : 'N', feasible ? 'Y' : 'N', tighter0 ? 'Y' : 'N', tighter1 ? 'Y' : 'N', fixed[0],fixed[1]); #endif //if (nInt>1) //continue; if (!feasible) { #ifdef CGL_INVESTIGATE printf("QQ infeasible\n"); #endif infeasible=true; } else if (fixed[0]||fixed[1]) { #ifdef CGL_INVESTIGATE printf("QQ fixed\n"); #endif for (int k=0;k<2;k++) { if (fixed[k]) { int iColumn=col[k]; int kColumn=originalColumns[iColumn]; #ifdef CGL_INVESTIGATE printf("true bounds %g %g\n",columnLower[kColumn], columnUpper[kColumn]); #endif double lo; if (fixed[k]>0) { lo=1.0; } else { lo=0.0; } if ((columnFlag[iColumn]&1)==0) { columnFlag[iColumn] |= 16; trueLower[iColumn] += lo; newBound[iColumn] = 0.0; for (int jj=columnStart[iColumn];jj0.0&&el1[2]>0.0&& el0[0]>0.0&&el1[0]>0.0&& (rowFlag[k]&1)==0&& (rowFlag[i]&1)==0) { // bounds same at 0 and 1 double up0 = (effectiveRhs[i]-el0[0])/el0[2]; double up1 = (effectiveRhs[k]-el1[0])/el1[2]; if (up00.0) up0=bound0; else lo0=CoinMax(0.0,bound0); double rhs1 =effectiveRhs[k]-el1[0]*value0; double lo1=0.0; double up1=1.0e30; double bound1=rhs1/el1[2]; if (el1[2]>0.0) up1=bound1; else lo1=CoinMax(0.0,bound1); if (fabs(lo0-lo1)>1.0e-8|| fabs(up0-up1)>1.0e-8*(1.0+fabs(up1))) { if (lo0>lo1+1.0e-8) { if (up0up1+1.0e-8) { which=-2; break; } } else if (lo0up0+1.0e-8) { which=-2; break; } } else { if (up1up0+1.0e-8) { // 0 tighter if (which==1) { which=-2; break; } else { which=-1; } } } } } if (which==0) { duplicate_[k]=-2; #ifdef CGL_INVESTIGATE printf("QQ discard one same same k\n"); #endif } else if (which==-1) { duplicate_[k]=-2; #ifdef CGL_INVESTIGATE printf("QQ discard one (i tighter) k\n"); #endif } else if (which==1) { duplicate_[i]=-2; #ifdef CGL_INVESTIGATE printf("QQ discard one (k tighter) i\n"); #endif } else { printf("QQ Can't decide what to do nint==1\n"); } } else { printf("QQ Don't know what to do nint==1\n"); } } } else { if ((rowFlag[k]&1)==0&&(rowFlag[i]&1)==0) { int which=0; for (int i0=0;i0<=10;i0++) { double value0=0.05*i0; for (int i1=0;i1<=10;i1++) { double value1=0.05*i1; double rhs0 =effectiveRhs[i]-el0[0]*value0 -el0[1]*value1; double lo0=0.0; double up0=1.0e30; double bound0=rhs0/el0[2]; if (el0[2]>0.0) up0=bound0; else lo0=CoinMax(0.0,bound0); double rhs1 =effectiveRhs[k]-el1[0]*value0 -el1[1]*value1; double lo1=0.0; double up1=1.0e30; double bound1=rhs1/el1[2]; if (el1[2]>0.0) up1=bound1; else lo1=CoinMax(0.0,bound1); if (fabs(lo0-lo1)>1.0e-8|| fabs(up0-up1)>1.0e-8*(1.0+fabs(up1))) { if (lo0>lo1+1.0e-8) { if (up0up1+1.0e-8) { which=-2; break; } } else if (lo0up0+1.0e-8) { which=-2; break; } } else { if (up1up0+1.0e-8) { // 0 tighter if (which==1) { which=-2; break; } else { which=-1; } } } } } if (which==-2) break; } if (which==0) { duplicate_[k]=-2; #ifdef CGL_INVESTIGATE printf("QQ discard one same same k\n"); #endif } else if (which==-1) { duplicate_[k]=-2; #ifdef CGL_INVESTIGATE printf("QQ discard one (i tighter) k\n"); #endif } else if (which==1) { duplicate_[i]=-2; #ifdef CGL_INVESTIGATE printf("QQ discard one (k tighter) i\n"); #endif } else { printf("QQ Can't decide what to do nint==2\n"); } } else { #ifdef CGL_INVESTIGATE printf("QQ Don't know what to do nint==2\n"); #endif } } } } } } } } } for (int j=0;jcolumnLower[kColumn]+1.0e-7) { nFixed++; lbs.insert(kColumn,lower); //xx->setColLower(kColumn,lower); } if (uppersetColUpper(kColumn,upper); } } else { // integer if (lower>columnLower[kColumn]+1.0e-7) { nFixed++; lower = ceil(lower); //xx->setColLower(kColumn,lower); lbs.insert(kColumn,lower); } if (uppersetColUpper(kColumn,upper); ubs.insert(kColumn,upper); } } if (lower>upper+1.0e-7) infeasible=true; //printf("Bounds for %d are %g and %g, were %g %g\n", // kColumn, // xx->getColLower()[kColumn], // xx->getColUpper()[kColumn], // si.getColLower()[kColumn], // si.getColUpper()[kColumn]); } } //if (!infeasible) { //si.writeMps("si"); //xx->writeMps("xx"); //xx->resolve(); //assert (xx->isProvenOptimal()); //printf("obj value %g %g\n",si.getObjValue(),xx->getObjValue()); //} //delete xx; // Move duplicate flags int * temp = reinterpret_cast(effectiveRhs); for (int i=0;iiColumn2) { return false; } else { where1++; where2++; } } if (where1==row1.end_) return false; else return true; } }; static int * lexSort(int numberCliques, int * cliqueStart, int * entry) { CglOneRow * rows = new CglOneRow [numberCliques]; for (int i=0;iiValue||position[kClique]jFirst) { // mark all apart from lowest number as duplicate and move on // use cliqueType lastDone =jClique-1; for (jClique=jFirst;jClique<=lastDone;jClique++) { int kClique = which [jClique]; if (kClique!=iLowest) { statusClique[kClique]=-2; nDup++; nSave += cliqueStart[kClique+1]-cliqueStart[kClique]; } } } } } #if 1 for (int jClique=0;jClique10 printf("clique %d is subset of %d\n",kClique,iClique); printf("Kclique %d ",kClique); for (int j=cliqueStart[kClique];jiValue||position[kClique]jFirst) { // mark all apart from lowest number as duplicate and move on // use cliqueType lastDone =jClique-1; for (jClique=jFirst;jClique<=lastDone;jClique++) { int kClique = which [jClique]; if (kClique!=iLowest) { statusClique[kClique]=-2; nDup++; nSave += cliqueStart[kClique+1]-cliqueStart[kClique]; } } } } } #if 0 for (int jClique=0;jCliqueentry[cliqueStart[iClique+1]-1]) { statusClique[iClique]=numberIntegers; continue; } } if (iValuekValue) continue; // not a candidate // See if subset (remember duplicates have gone) if (cliqueStart[iClique+1]-position[iClique]> cliqueStart[kClique+1]-cliqueStart[kClique]) { // could be subset ? int offset = cliqueStart[iClique]-position[kClique]; int j; bool subset=true; // what about different fixes bool odd=false; for (j=cliqueStart[kClique];j1) printf("clique %d is subset of %d\n",kClique,iClique); if (!ppp&&false) { ppp=true; printf("Kclique %d ",kClique); for (int j=cliqueStart[kClique];jgetIndices(); const double * elementByRow = rowCopy->getElements(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * lower = si.getColLower(); const double * upper = si.getColUpper(); const double * rowLower = si.getRowLower(); const double * rowUpper = si.getRowUpper(); // Find 0-1 variables int numberIntegers=0; int numberColumns=si.getNumCols(); int * backward = new int [numberColumns]; for (int i=0;i (floor(upperValue+1.0e-5)); int iLower = static_cast (ceil(lowerValue-1.0e-5)); int state=0; if (upperValue<1.0e6) { if (iUpper==1) state=1; else if (iUpper==0) state=2; else if (iUpper<0) state=3; if (fabs(static_cast (iUpper)-upperValue)>1.0e-9) state =-1; } if (!state&&lowerValue>-1.0e6) { if (-iLower==1-numberP1) state=-1; else if (-iLower==-numberP1) state=-2; else if (-iLower<-numberP1) state=-3; if (fabs(static_cast (iLower)-lowerValue)>1.0e-9) state =-1; } if (numberP1<2) state=-1; if (good&&state>0) { if (abs(state)==3) { // infeasible printf("FFF Infeasible\n");; feasible=false; break; } else if (abs(state)==2) { // we can fix all //numberFixed += numberP1+numberM1; printf("FFF can fix %d\n",numberP1); } else { for (j=0;j=0&&fixed[i01]==-1) { ubs.insert(i,0.0); nFixed++; } } for (iRow=0;iRow=0) fixed[iClique]=iRow; } int * dup2 = new int [2*numberRows]; int * used2 = dup2+numberRows; int * used = dups+numberCliques; for (iRow=0;iRow=0) { dup2[iRow] = dups[iClique]; int which = used[iClique]; if (which>=0&&whichgetMatrixByCol(); matrix_.removeGaps(); matrix_.orderMatrix(); matrixByRow_ = *solver->getMatrixByRow(); int numberRows=matrix_.getNumRows(); rhs_ = new int[numberRows]; duplicate_ = new int[numberRows]; lower_ = new int[numberRows]; const double * columnLower = solver->getColLower(); const double * rowLower = solver->getRowLower(); const double * rowUpper = solver->getRowUpper(); // Row copy const double * elementByRow = matrixByRow_.getElements(); const int * column = matrixByRow_.getIndices(); const CoinBigIndex * rowStart = matrixByRow_.getVectorStarts(); const int * rowLength = matrixByRow_.getVectorLengths(); int iRow; int numberGood=0; int markBad = -(solver->getNumCols()+1); for (iRow=0;iRow (floor(rowUpper[iRow])); // check elements bool good=true; for (int j=rowStart[iRow];jisInteger(iColumn)) good=false; double value = elementByRow[j]; if (floor(value)!=value||value<1.0) { good=false; } } if (good) { lower_[iRow] = static_cast (CoinMax(0.0,ceil(rowLower[iRow]))); if (iRhs>=lower_[iRow]) { rhs_[iRow]=iRhs; numberGood++; } else { // infeasible ? lower_[iRow]=markBad; rhs_[iRow]=markBad; } } else { lower_[iRow]=markBad; rhs_[iRow]=markBad; } } else if (rowUpper[iRow]>1.0e30&&rowLower[iRow]==1.0) { // may be OK to look for dominated in >=1 rows // check elements bool good=true; for (int j=rowStart[iRow];jisInteger(iColumn)) good=false; double value = elementByRow[j]; if (floor(value)!=value||value<1.0) { good=false; } if (columnLower[iColumn]!=0.0) good=false; } if (good) { lower_[iRow] = 1; } } } } /** Fix variables and find duplicate/dominated rows for the model of the solver interface, si. This is a very simple minded idea but I (JJF) am using it in a project so thought I might as well add it. It should really be called before first solve and I may modify CBC to allow for that. This is designed for problems with few rows and many integer variables where the rhs are <= or == and all coefficients and rhs are small integers. If effective rhs is K then we can fix all variables with coefficients > K to their lower bounds (effective rhs just means original with variables with nonzero lower bounds subtracted out). If one row is a subset of another and the effective rhs are same we can fix some variables and then the two rows are identical. This version does deletions and fixings and may return stored cuts for dominated columns */ CglStored * CglDuplicateRow::outDuplicates( OsiSolverInterface * solver) { CglTreeInfo info; info.level = 0; info.pass = 0; int numberRows = solver->getNumRows(); info.formulation_rows = numberRows; info.inTree = false; info.strengthenRow= NULL; info.pass = 0; OsiCuts cs; generateCuts(*solver,cs,info); // Get rid of duplicate rows int * which = new int[numberRows]; int numberDrop=0; for (int iRow=0;iRow=0) which[numberDrop++]=iRow; } if (numberDrop) { solver->deleteRows(numberDrop,which); } delete [] which; // see if we have any column cuts int numberColumnCuts = cs.sizeColCuts() ; const double * columnLower = solver->getColLower(); const double * columnUpper = solver->getColUpper(); for (int k = 0;klbs() ; const CoinPackedVector & ubs = thisCut->ubs() ; int j ; int n ; const int * which ; const double * values ; n = lbs.getNumElements() ; which = lbs.getIndices() ; values = lbs.getElements() ; for (j = 0;jcolumnLower[iColumn]) solver->setColLower(iColumn,values[j]) ; } n = ubs.getNumElements() ; which = ubs.getIndices() ; values = ubs.getElements() ; for (j = 0;jsetColUpper(iColumn,values[j]) ; } } return storedCuts_; } // Create C++ lines to get to current state std::string CglDuplicateRow::generateCpp( FILE * fp) { CglDuplicateRow other; fprintf(fp,"0#include \"CglDuplicateRow.hpp\"\n"); fprintf(fp,"3 CglDuplicateRow duplicateRow;\n"); if (logLevel_!=other.logLevel_) fprintf(fp,"3 duplicateRow.setLogLevel(%d);\n",logLevel_); else fprintf(fp,"4 duplicateRow.setLogLevel(%d);\n",logLevel_); if (maximumRhs_!=other.maximumRhs_) fprintf(fp,"3 duplicateRow.setMaximumRhs(%d);\n",maximumRhs_); else fprintf(fp,"4 duplicateRow.setMaximumRhs(%d);\n",maximumRhs_); if (maximumDominated_!=other.maximumDominated_) fprintf(fp,"3 duplicateRow.setMaximumDominated(%d);\n",maximumDominated_); else fprintf(fp,"4 duplicateRow.setMaximumDominated(%d);\n",maximumDominated_); if (mode_!=other.mode_) fprintf(fp,"3 duplicateRow.setMode(%d);\n",mode_); else fprintf(fp,"4 duplicateRow.setMode(%d);\n",mode_); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 duplicateRow.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 duplicateRow.setAggressiveness(%d);\n",getAggressiveness()); return "duplicateRow"; } Cgl-0.58.9/src/CglDuplicateRow/CglDuplicateRow.hpp0000644000076600007660000001305712130104734020361 0ustar coincoin// $Id: CglDuplicateRow.hpp 1123 2013-04-06 20:47:24Z stefan $ // Copyright (C) 2004, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef CglDuplicateRow_H #define CglDuplicateRow_H #include #include "CglCutGenerator.hpp" class CglStored; /** DuplicateRow Cut Generator Class */ class CglDuplicateRow : public CglCutGenerator { public: /**@name Generate Cuts */ //@{ /** Fix variables and find duplicate/dominated rows for the model of the solver interface, si. This is a very simple minded idea but I (JJF) am using it in a project so thought I might as well add it. It should really be called before first solve and I may modify CBC to allow for that. This is designed for problems with few rows and many integer variables where the rhs are <= or == and all coefficients and rhs are small integers. If effective rhs is K then we can fix all variables with coefficients > K to their lower bounds (effective rhs just means original with variables with nonzero lower bounds subtracted out). If one row is a subset of another and the effective rhs are same we can fix some variables and then the two rows are identical. The generator marks identical rows so can be taken out in solve */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); private: /// Does work for modes 1,2 void generateCuts12( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /// Does work for mode 4 void generateCuts4( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /// Does work for mode 8 void generateCuts8( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); public: /** Fix variables and find duplicate/dominated rows for the model of the solver interface, si. This is a very simple minded idea but I (JJF) am using it in a project so thought I might as well add it. It should really be called before first solve and I may modify CBC to allow for that. This is designed for problems with few rows and many integer variables where the rhs are <= or == and all coefficients and rhs are small integers. If effective rhs is K then we can fix all variables with coefficients > K to their lower bounds (effective rhs just means original with variables with nonzero lower bounds subtracted out). If one row is a subset of another and the effective rhs are same we can fix some variables and then the two rows are identical. This version does deletions and fixings and may return stored cuts for dominated columns */ CglStored * outDuplicates( OsiSolverInterface * solver); //@} /**@name Get information on size of problem */ //@{ /// Get duplicate row list, -1 means still in, -2 means out (all fixed), k>= means same as row k inline const int * duplicate() const { return duplicate_;} /// Size of dynamic program inline int sizeDynamic() const { return sizeDynamic_;} /// Number of rows in original problem inline int numberOriginalRows() const { return matrix_.getNumRows();} //@} /**@name Get information on size of problem */ //@{ /// logLevel inline int logLevel() const { return logLevel_;} inline void setLogLevel(int value) { logLevel_ = value;} //@} /**@name We only check for duplicates amongst rows with effective rhs <= this */ //@{ /// Get inline int maximumRhs() const { return maximumRhs_;} /// Set inline void setMaximumRhs(int value) { maximumRhs_=value;} //@} /**@name We only check for dominated amongst groups of columns whose size <= this */ //@{ /// Get inline int maximumDominated() const { return maximumDominated_;} /// Set inline void setMaximumDominated(int value) { maximumDominated_=value;} //@} /**@name gets and sets */ //@{ /// Get mode inline int mode() const { return mode_;} /// Set mode inline void setMode(int value) { mode_=value;} //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglDuplicateRow (); /// Useful constructor CglDuplicateRow (OsiSolverInterface * solver); /// Copy constructor CglDuplicateRow ( const CglDuplicateRow & rhs); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglDuplicateRow & operator=( const CglDuplicateRow& rhs); /// Destructor virtual ~CglDuplicateRow (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); /// This can be used to refresh any information virtual void refreshSolver(OsiSolverInterface * solver); //@} protected: // Protected member data /**@name Protected member data */ //@{ /// Matrix CoinPackedMatrix matrix_; /// Matrix by row CoinPackedMatrix matrixByRow_; /// Possible rhs (if 0 then not possible) int * rhs_; /// Marks duplicate rows int * duplicate_; /// To allow for <= rows int * lower_; /// Stored cuts if we found dominance cuts CglStored * storedCuts_; /// Check dominated columns if less than this number of candidates int maximumDominated_; /// Check duplicates if effective rhs <= this int maximumRhs_; /// Size of dynamic program int sizeDynamic_; /// 1 do rows, 2 do columns, 3 do both int mode_; /// Controls print out int logLevel_; //@} }; #endif Cgl-0.58.9/src/CglDuplicateRow/Makefile.am0000644000076600007660000000321611621724114016654 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglDuplicateRow # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglDuplicateRow.la # List all source files for this library, including headers libCglDuplicateRow_la_SOURCES = CglDuplicateRow.cpp CglDuplicateRow.hpp # This is for libtool (on Windows) libCglDuplicateRow_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglDuplicateRow.hpp Cgl-0.58.9/src/CglDuplicateRow/Makefile.in0000644000076600007660000005400712240340055016665 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/CglDuplicateRow 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglDuplicateRow_la_LIBADD = am_libCglDuplicateRow_la_OBJECTS = CglDuplicateRow.lo libCglDuplicateRow_la_OBJECTS = $(am_libCglDuplicateRow_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 = $(libCglDuplicateRow_la_SOURCES) DIST_SOURCES = $(libCglDuplicateRow_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglDuplicateRow # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglDuplicateRow.la # List all source files for this library, including headers libCglDuplicateRow_la_SOURCES = CglDuplicateRow.cpp CglDuplicateRow.hpp # This is for libtool (on Windows) libCglDuplicateRow_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglDuplicateRow.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/CglDuplicateRow/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglDuplicateRow/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglDuplicateRow.la: $(libCglDuplicateRow_la_OBJECTS) $(libCglDuplicateRow_la_DEPENDENCIES) $(CXXLINK) $(libCglDuplicateRow_la_LDFLAGS) $(libCglDuplicateRow_la_OBJECTS) $(libCglDuplicateRow_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglDuplicateRow.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglRedSplit2/0000755000076600007660000000000012377555671014047 5ustar coincoinCgl-0.58.9/src/CglRedSplit2/CglRedSplit2.cpp0000644000076600007660000025341612130104734016775 0ustar coincoin// Last edit: 04/03/10 // // Name: CglRedSplit2.cpp // Author: Giacomo Nannicini // Singapore University of Technology and Design // Singapore // email: nannicini@sutd.edu.sg // based on CglRedSplit by Francois Margot // Date: 03/09/09 //----------------------------------------------------------------------------- // Copyright (C) 2010, Giacomo Nannicini and others. All Rights Reserved. #include #include #include #include #include #include #include /* Debug output */ //#define RS2_TRACE /* Print optimal tableau and basis */ //#define RS2_TRACETAB /* Use LAPACK instead of own code for solving linear systems */ //#define RS2_USE_LAPACK // Sparse for intNonBasic 0,1,2 #define RS_FAST_INT 2 // Sparse for contNonBasic 0,1,2 #define RS_FAST_CONT 2 // Sparse for workNonBasic 0,1,2 #define RS_FAST_WORK 2 #include "CoinPragma.hpp" #include "OsiSolverInterface.hpp" #include "CglRedSplit2.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinIndexedVector.hpp" #include "OsiRowCutDebugger.hpp" #include "CoinFactorization.hpp" #include "CoinFinite.hpp" #define TINY 1e-20 #define rs2round(x) (floor((x)+0.5)) //------------------------------------------------------------------- // Generate Reduce-and-Split cuts //------------------------------------------------------------------- #ifdef RS2_USE_LAPACK extern "C" void dgesv_( const int * , const int * , double * , const int * , int * , double * , const int * , int * ); #endif /***************************************************************************/ // Utility functions and definitions for sorting struct sortElement{ int index; double cost; }; // Return -1 if firstE has lower cost or same cost but lower index int rs2_compareElements(const void* firstE, const void* secondE){ const struct sortElement* a = static_cast(firstE); const struct sortElement* b = static_cast(secondE); if (a->cost < b->cost) return -1; else if (a->cost > b->cost) return 1; else if (a->index < b->index) return -1; else if (a->index > b->index) return 1; return 0; } /***************************************************************************/ // Returns (value - floor) but allowing for small errors; // taken from the CglGomory cut generator inline double CglRedSplit2::rs_above_integer(const double value) const { double value2=floor(value); double value3=rs2round(value); if (fabs(value3-value)< param.getEPS() * (fabs(value3)+1.0)) return 0.0; return value-value2; } /* rs_above_integer */ /**********************************************************/ void CglRedSplit2::rs_allocmatINT(int ***v, int m, int n) { *v = reinterpret_cast (calloc (m, sizeof(int *))); if (*v == NULL) { printf("###ERROR: INTEGER matrix allocation failed\n"); exit(1); } for (int i = 0; i < m; ++i) { (*v)[i] = reinterpret_cast (calloc (n, sizeof(int))); if ((*v)[i] == NULL) { printf("###ERROR: INTEGER matrix allocation failed\n"); exit(1); } } } /* rs_allocmatINT */ /**********************************************************/ void CglRedSplit2::rs_deallocmatINT(int ***v, int m) { for (int i = 0; i < m; ++i) { free(reinterpret_cast ((*v)[i])); } free(reinterpret_cast (*v)); } /* rs_deallocmatINT */ /**********************************************************/ void CglRedSplit2::rs_allocmatDBL(double ***v, int m, int n) { *v = reinterpret_cast (calloc (m, sizeof(double *))); if (*v == NULL) { printf("###ERROR: DOUBLE matrix allocation failed\n"); exit(1); } for (int i = 0; i < m; ++i){ (*v)[i] = reinterpret_cast (calloc (n, sizeof(double))); if ((*v)[i] == NULL) { printf("###ERROR: DOUBLE matrix allocation failed\n"); exit(1); } } } /* rs_allocmatDBL */ /**********************************************************/ void CglRedSplit2::rs_deallocmatDBL(double ***v, int m) { for (int i = 0; i < m; ++i){ free(reinterpret_cast ((*v)[i])); } free(reinterpret_cast (*v)); } /* rs_deallocmatDBL */ /**********************************************************/ void CglRedSplit2::rs_printvecINT(const char *vecstr, const int *x, int n) const { int num, fromto, upto, j, i; num = (n/10) + 1; printf("%s :\n", vecstr); for(j=0; j big) { big = temp; } } if (big == 0.0) { return false; } vv[i-1]=1.0/big; } for (j = 1; j <= n; ++j){ for (i=1;i= big) { big = dum; imax = i; } } if (j != imax) { for (k=1;k<=n;k++) { dum=a[imax-1][k-1]; a[imax-1][k-1]=a[j-1][k-1]; a[j-1][k-1]=dum; } *d = -(*d); vv[imax-1]=vv[j-1]; } indx[j-1]=imax; if (a[j-1][j-1] == 0.0) a[j-1][j-1]=TINY; if (j != n) { dum=1.0/(a[j-1][j-1]); for (i=j+1;i<=n;i++) a[i-1][j-1] *= dum; } } return ret; } /***************************************************************************/ // from Numerical Recipes in C: backward substitution void CglRedSplit2::lubksb(double **a, int n, int *indx, double *b) const { int i,ii=0,ip,j; double sum; for (i = 1; i <= n; ++i){ ip=indx[i-1]; sum=b[ip-1]; b[ip-1]=b[i-1]; if (ii) for (j=ii;j<=i-1;j++) sum -= a[i-1][j-1]*b[j-1]; else if (sum) ii=i; b[i-1]=sum; } for (i=n;i>=1;i--) { sum=b[i-1]; for (j=i+1;j<=n;j++) sum -= a[i-1][j-1]*b[j-1]; b[i-1]=sum/a[i-1][i-1]; } } /***************************************************************************/ double CglRedSplit2::compute_norm_change(double oldnorm, const int* list, int numElemList, const double* multipliers) const { double newnorm = 0; double accumulator; for (int j = 0; j < nTab; ++j){ accumulator = 0; for (int i = 0; i < numElemList; ++i){ accumulator += multipliers[i]*workNonBasicTab[list[i]][j]; } newnorm += accumulator*accumulator; } return (newnorm-oldnorm); } /***************************************************************************/ int CglRedSplit2::sort_rows_by_nonzeroes(struct sortElement* array, int rowIndex, int maxRows, int whichTab) const { // Note: this function only takes into account rows which share at least // a nonzero column with the row that we want to reduce (rowIndex). int counter = 0; int numZeroCost = 0; for (int i = 0; i < mTab; ++i){ if (!checkTime()){ break; } if (numZeroCost == maxRows){ // We found enough rows with cost equal to zero, i.e. "perfect" rows // No need to continue! counter = numZeroCost; break; } if ((i != rowIndex) && (norm[i] > param.getNormIsZero())){ // sort rows by number of nonzeros on nonbasic columns. // check if they have at least one nonzero in the same place, // otherwise skip bool match = false; for (int j = 0; j < nTab; ++j){ if ((fabs(workNonBasicTab[rowIndex][j]) > param.getEPS_COEFF()) && (fabs(workNonBasicTab[i][j]) > param.getEPS_COEFF())){ match = true; break; } } if (!match) continue; array[counter].index = i; array[counter].cost = 0; // whichTab = 0 means only intNonBasicTab, 1 means only // workNonBasicTab, 2 means both if (whichTab == 0 || whichTab == 2){ for (int j = 0; j < card_intNonBasicVar; ++j){ if ((fabs(intNonBasicTab[rowIndex][j]) <= param.getEPS_COEFF()) && (fabs(intNonBasicTab[i][j]) > param.getEPS_COEFF())){ array[counter].cost += 1; } } } if (whichTab == 1 || whichTab == 2){ for (int j = 0; j < nTab; ++j){ if ((fabs(workNonBasicTab[rowIndex][j]) <= param.getEPS_COEFF()) && (fabs(workNonBasicTab[i][j]) > param.getEPS_COEFF())){ array[counter].cost += 1; } } } if (array[counter].cost == 0){ array[counter] = array[numZeroCost]; array[numZeroCost].index = i; array[numZeroCost].cost = 0; numZeroCost++; } counter++; } } if (counter > maxRows){ qsort(array, counter, sizeof(struct sortElement), rs2_compareElements); } return counter; } /***************************************************************************/ int CglRedSplit2::sort_rows_by_nonzeroes_greedy(struct sortElement* array, int rowIndex, int maxRows, int whichTab) const{ int counter = 0; counter = sort_rows_by_nonzeroes(array, rowIndex, maxRows, whichTab); if (counter > maxRows){ int i, j; // vector of positions of zero elements int* z_int = NULL; int* z_cont = NULL; // whichTab = 0 means only intNonBasicTab, 1 means only // workNonBasicTab, 2 means both if (whichTab == 0 || whichTab == 2) z_int = new int[card_intNonBasicVar]; if (whichTab == 1 || whichTab == 2) z_cont = new int[nTab]; // number of elements in the vectors above int numz_int = 0; int numz_cont = 0; // compute initial vector of nonzeroes if (whichTab == 0 || whichTab == 2){ for (j = 0; j < card_intNonBasicVar; ++j){ if (fabs(intNonBasicTab[rowIndex][j]) <= param.getEPS_COEFF()){ z_int[numz_int++] = j; } } } if (whichTab == 1 || whichTab == 2){ for (j = 0; j < nTab; ++j){ if (fabs(workNonBasicTab[rowIndex][j]) <= param.getEPS_COEFF()){ z_cont[numz_cont++] = j; } } } int numSorted = counter; counter = 1; // store the minimum number of nz introduced by one row int minNz; // and the position of that row int rowMinNz; // maximum number of nonzero that can be introduced double maxNz; int currentNz; while (counter < maxRows && counter < numSorted){ if (!checkTime()){ break; } // initialize minNz to a large value minNz = numz_int + numz_cont;; maxNz = array[counter].cost + array[counter-1].cost; rowMinNz = counter; for (i = counter; i < numSorted && array[i].cost < maxNz; ++i){ int ii = array[i].index; // pick the row which introduces the smallest // number of nonzeros on the nonbasic integer columns currentNz = 0; for (j = 0; j < numz_int; ++j){ if ((fabs(intNonBasicTab[ii][z_int[j]]) > param.getEPS_COEFF())){ currentNz++; } } for (j = 0; j < numz_cont; ++j){ if ((fabs(workNonBasicTab[ii][z_cont[j]]) > param.getEPS_COEFF())){ currentNz++; } } array[i].cost = currentNz; if (currentNz < minNz){ rowMinNz = i; minNz = currentNz; } if (currentNz == 0){ // perfect matching, no need to look further break; } } // update introduced nonzeroes by the selected row; // first, put the row in the correct position in the array int swap1 = array[rowMinNz].index; double swap2 = array[rowMinNz].cost; array[rowMinNz] = array[counter]; array[counter].index = swap1; array[counter].cost = swap2; // now count how many nonzeroes were introduces, and update // the vectors z_int and z_cont accordingly for (j = 0; j < numz_int; ++j){ if (fabs(intNonBasicTab[swap1][z_int[j]]) > param.getEPS_COEFF()){ z_int[j] = z_int[numz_int-1]; numz_int--; } } for (j = 0; j < numz_cont; ++j){ if (fabs(workNonBasicTab[swap1][z_cont[j]]) > param.getEPS_COEFF()){ z_cont[j] = z_cont[numz_cont-1]; numz_cont--; } } counter++; } if (z_int) delete[] z_int; if (z_cont) delete[] z_cont; } return counter; } /***************************************************************************/ int CglRedSplit2::sort_rows_by_cosine(struct sortElement* array, int rowIndex, int maxRows, int whichTab) const { // whichTab == 0 means only integer nonbasic variables, whichTab == // 1 means only workTab, whichTab == 2 means both int counter = 0; double initnorm = 0.0; if (whichTab == 0 || whichTab == 2){ #if RS_FAST_INT == 0 initnorm += rs_dotProd(intNonBasicTab[rowIndex], intNonBasicTab[rowIndex], card_intNonBasicVar); #elif RS_FAST_INT == 1 initnorm += rs_dotProd(intNonBasicTab[rowIndex], intNonBasicTab[rowIndex], card_intNonBasicVar); double value = rs_sparseDotProd(intNonBasicTab[rowIndex], intNonBasicTab[rowIndex], pi_mat[rowIndex]+mTab, pi_mat[rowIndex]+mTab); assert (value==initnorm); #else initnorm = rs_sparseDotProd(intNonBasicTab[rowIndex], intNonBasicTab[rowIndex], pi_mat[rowIndex]+mTab, pi_mat[rowIndex]+mTab); #endif } if (whichTab == 1 || whichTab == 2){ initnorm += norm[rowIndex]; } #if RS_FAST_WORK int workOffset = mTab+card_intNonBasicVar+card_contNonBasicVar+2; #endif for (int i = 0; i < mTab; ++i){ if ((i != rowIndex) && (norm[i] > param.getNormIsZero())){ if (!checkTime()){ break; } array[counter].index = i; array[counter].cost = 0; if (whichTab == 0 || whichTab == 2){ #if RS_FAST_INT == 0 array[counter].cost -= fabs(rs_dotProd(intNonBasicTab[rowIndex], intNonBasicTab[i], card_intNonBasicVar)); #elif RS_FAST == 1 array[counter].cost -= fabs(rs_dotProd(intNonBasicTab[rowIndex], intNonBasicTab[i], card_intNonBasicVar)); double value = -fabs(rs_sparseDotProd(intNonBasicTab[rowIndex], intNonBasicTab[i], pi_mat[rowIndex]+mTab, pi_mat[i]+mTab)); assert (value==array[counter].cost); #else array[counter].cost = -fabs(rs_sparseDotProd(intNonBasicTab[rowIndex], intNonBasicTab[i], pi_mat[rowIndex]+mTab, pi_mat[i]+mTab)); #endif } if (whichTab == 1 || whichTab == 2){ #if RS_FAST_WORK == 0 array[counter].cost -= fabs(rs_dotProd(workNonBasicTab[rowIndex], workNonBasicTab[i], nTab)); #elif RS_FAST_WORK == 1 double value = array[counter].cost; array[counter].cost -= fabs(rs_dotProd(workNonBasicTab[rowIndex], workNonBasicTab[i], nTab)); value -= fabs(rs_sparseDotProd(workNonBasicTab[rowIndex], workNonBasicTab[i], pi_mat[rowIndex]+workOffset, pi_mat[i]+workOffset)); assert (value==array[counter].cost); #else array[counter].cost -= fabs(rs_sparseDotProd(workNonBasicTab[rowIndex], workNonBasicTab[i], pi_mat[rowIndex]+workOffset, pi_mat[i]+workOffset)); #endif } // Now divide by the two norms double denom = 0.0; if (whichTab == 0 || whichTab == 2){ #if RS_FAST_INT == 0 denom += initnorm*rs_dotProd(intNonBasicTab[i], intNonBasicTab[i], card_intNonBasicVar); #elif RS_FAST == 1 denom += initnorm*rs_dotProd(intNonBasicTab[i], intNonBasicTab[i], card_intNonBasicVar); double value = initnorm*rs_sparseDotProd(intNonBasicTab[i], intNonBasicTab[i], pi_mat[i]+mTab, pi_mat[i]+mTab); assert (value==denom); #else denom = initnorm*rs_sparseDotProd(intNonBasicTab[i], intNonBasicTab[i], pi_mat[i]+mTab, pi_mat[i]+mTab); #endif } if (whichTab == 1 || whichTab == 2){ denom += initnorm*norm[i]; } array[counter].cost /= sqrt(denom); if (array[counter].cost != 0.0){ counter++; } } } if (counter >= maxRows){ qsort(array, counter, sizeof(struct sortElement), rs2_compareElements); } return counter; } /***************************************************************************/ int CglRedSplit2::get_list_rows_reduction(int rowIndex, int maxRowsReduction, int* list, const double* norm, CglRedSplit2Param::RowSelectionStrategy selectionStrategy) const{ #ifdef RS2_TRACE printf("Obtaining list of rows with column strategy %d\n", selectionStrategy); #endif struct sortElement* array = new struct sortElement[mTab]; int counter = 0; int i, j; // Look in CglRedSplit2Param for a description of each strategy if (selectionStrategy == CglRedSplit2Param::RS1){ counter = sort_rows_by_nonzeroes(array, rowIndex, maxRowsReduction-1, 0); } else if (selectionStrategy == CglRedSplit2Param::RS2){ counter = sort_rows_by_nonzeroes(array, rowIndex, maxRowsReduction-1, 1); } else if (selectionStrategy == CglRedSplit2Param::RS3){ counter = sort_rows_by_nonzeroes(array, rowIndex, maxRowsReduction-1, 2); } else if (selectionStrategy == CglRedSplit2Param::RS4){ // compute the *true* number of nonzeroes that we introduce // on the integer nonbasics counter = sort_rows_by_nonzeroes_greedy(array, rowIndex, maxRowsReduction-1, 0); } else if (selectionStrategy == CglRedSplit2Param::RS5){ // compute the *true* number of nonzeroes that we introduce // on the working set (continuous nonbasics) counter = sort_rows_by_nonzeroes_greedy(array, rowIndex, maxRowsReduction-1, 1); } else if (selectionStrategy == CglRedSplit2Param::RS6){ // compute the *true* number of nonzeroes that we introduce // on all the nonbasics: intNonBasicVar and workNonBasicVar counter = sort_rows_by_nonzeroes_greedy(array, rowIndex, maxRowsReduction-1, 2); } else if (selectionStrategy == CglRedSplit2Param::RS7){ // sort rows by cosine of the angle in the space of the nonbasic integer // and nonbasic continuous (working set) columns, wrt row rowIndex counter = sort_rows_by_cosine(array, rowIndex, maxRowsReduction-1, 2); } else if (selectionStrategy == CglRedSplit2Param::RS8){ // sort rows by cosine of the angle in the space of the // nonbasic continuous (working set) columns, wrt row rowIndex counter = sort_rows_by_cosine(array, rowIndex, maxRowsReduction-1, 1); } list[0] = rowIndex; j = 1; for (i = 0; i < counter && j < maxRowsReduction; ++i){ list[j] = array[i].index; j++; } delete[] array; return j; } /***************************************************************************/ void CglRedSplit2::fill_workNonBasicTab(CglRedSplit2Param::ColumnSelectionStrategy strategy, const int* ignore_list){ // Sort continuous non basic variables by reduced cost and choose the // columns we will work with. // We can choose among several strategies; these are described in // CglRedSplit2Param.hpp. int i, j; if (strategy == CglRedSplit2Param::CS_ALLCONT){ // select all continuous nonbasic columns for (i = 0; i < mTab; ++i){ memcpy(workNonBasicTab[i], contNonBasicTab[i], card_contNonBasicVar*sizeof(double)); } nTab = card_contNonBasicVar; } else{ // Begin by sorting all continuous nonbasic columns by increasing // reduced cost (except those in the ingore_list) struct sortElement* array = new struct sortElement[card_contNonBasicVar]; int pos = 0, iter = 0; for (i = 0; i < card_contNonBasicVar; ++i){ if (ignore_list != NULL){ iter = 0; while (ignore_list[iter] >= 0 && ignore_list[iter] != contNonBasicVar[i]){ iter++; } if (ignore_list[iter] == contNonBasicVar[i]){ continue; } } array[pos].index = i; // We take absolute value of reduced costs because sign could be // positive or negative depending on minimization/maximization, // and which bound the variable is at (upper/lower). if (contNonBasicVar[i] < ncol) array[pos].cost = fabs(reducedCost[contNonBasicVar[i]]); else array[pos].cost = fabs(rowPrice[contNonBasicVar[i]-ncol]); pos++; } qsort(array,pos,sizeof(struct sortElement),rs2_compareElements); nTab = 0; int card_contNonBasicVar = pos; // Now choose the variables. These strategies are described in // CglRedSplit2Param.hpp. // CS1, CS2 and CS3 are the 3 partitions of C-3P: each one // contains one third of the variables, sorted by reduced costs if (strategy == CglRedSplit2Param::CS1){ for (i = 0; i < card_contNonBasicVar/3; ++i){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } else if (strategy == CglRedSplit2Param::CS2){ for (i = card_contNonBasicVar/3; i < 2*card_contNonBasicVar/3; ++i){ if (!checkTime()){ break; } for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } else if (strategy == CglRedSplit2Param::CS3){ for (i = 2*card_contNonBasicVar/3; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } // CS4, CS5, CS6, CS7 and CS8 are the 5 partitions of C-5P; each // one contains 1/5 of the variables, sorted by increasing reduced // cost: first set has smallest reduced costs, and so on. else if (strategy == CglRedSplit2Param::CS4){ for (i = 0; i < card_contNonBasicVar/5; ++i){ if (!checkTime()){ break; } for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } else if (strategy == CglRedSplit2Param::CS5){ for (i = card_contNonBasicVar/5; i < 2*card_contNonBasicVar/5; ++i){ if (!checkTime()){ break; } for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } else if (strategy == CglRedSplit2Param::CS6){ for (i = 2*card_contNonBasicVar/5; i < 3*card_contNonBasicVar/5; ++i){ if (!checkTime()){ break; } for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } else if (strategy == CglRedSplit2Param::CS7){ for (i = 3*card_contNonBasicVar/5; i < 4*card_contNonBasicVar/5; ++i){ if (!checkTime()){ break; } for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } else if (strategy == CglRedSplit2Param::CS8){ for (i = 4*card_contNonBasicVar/5; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } // CS9 and CS10 are the 2 partitions of I-2P-2/3; this is a // partition with interleaving pattern XX--X- on the 2/3 of the // variables with smallest reduced cost else if (strategy == CglRedSplit2Param::CS9){ int pat; for (i = 0; i < 2*card_contNonBasicVar/3; ++i){ if (!checkTime()){ break; } pat = i%6; if (pat == 0 || pat == 1 || pat == 4){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS10){ int pat; for (i = 0; i < 2*card_contNonBasicVar/3; ++i){ if (!checkTime()){ break; } pat = i%6; if (pat == 2 || pat == 3 || pat == 5){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } // CS11 and CS12 are the 2 partitions of I-2P-4/5; partition with // interleaving pattern X---XXX- on 4/5 of the vars with smallest // reduced cost else if (strategy == CglRedSplit2Param::CS11){ int pat; for (i = 0; i < 4*card_contNonBasicVar/5; ++i){ if (!checkTime()){ break; } pat = i%8; if (pat == 0 || pat == 4 || pat == 5 || pat == 6){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS12){ int pat; for (i = 0; i < 4*card_contNonBasicVar/5; ++i){ if (!checkTime()){ break; } pat = i%8; if (pat == 1 || pat == 2 || pat == 3 || pat == 7){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } // CS13, and CS14 are the 2 partitions of I-2P-1/2; interleaving // partition with pattern X--X on 1/2 of the variables else if (strategy == CglRedSplit2Param::CS13){ for (i = 0; i < card_contNonBasicVar/2; ++i){ if (!checkTime()){ break; } if (i%4 == 0 || i%4 == 3){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS14){ for (i = 0; i < card_contNonBasicVar/2; ++i){ if (!checkTime()){ break; } if (i%4 == 1 || i%4 == 2){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } // CS15, CS16 and CS17 are the 3 partitions of I-3P; interleaving // partition with pattern X-/ on all the variables else if (strategy == CglRedSplit2Param::CS15){ for (i = 0; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } if (i%3 == 0){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS16){ for (i = 0; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } if (i%3 == 1){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS17){ for (i = 0; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } if (i%3 == 2){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } // CS18, CS19, CS20, CS21 are the 4 partitions of I-4P; // interleaving partition with pattern X-X/\\-/ on all the // variables else if (strategy == CglRedSplit2Param::CS18){ int pat; for (i = 0; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } pat = i%8; if (pat == 0 || pat == 2){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS19){ int pat; for (i = 0; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } pat = i%8; if (pat == 1 || pat == 6){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS20){ int pat; for (i = 0; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } pat = i%8; if (pat == 3 || pat == 7){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } else if (strategy == CglRedSplit2Param::CS21){ int pat; for (i = 0; i < card_contNonBasicVar; ++i){ if (!checkTime()){ break; } pat = i%8; if (pat == 4 || pat == 5){ for (j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = contNonBasicTab[j][array[i].index]; } nTab++; } } } delete[] array; } // create sparse work stuff for(i=0; i param.getNormIsZero()) { // Obtain the list of rows that should be used to reduce row k numUsedRows = get_list_rows_reduction(k, maxRowsReduction, list, norm, rowSelectionStrategy); #ifdef RS2_TRACE rs_printvecINT("rows used for reduction", list, numUsedRows); #endif if (numUsedRows <= 1){ // This means that the list only contains the current row; // Thus, no rows were selected for reduction. Skip. continue; } // Note: the list must have size maxRowsReduction. // Now prepare the linear system according to the paper for (i = 0; i < numUsedRows; ++i){ for (j = 0; j < numUsedRows; ++j){ #ifdef RS2_USE_LAPACK A[i*numUsedRows+j] = 0; #else A[i][j] = 0; #endif if (list[i] != k && list[j] != k){ for (h = 0; h < nTab; ++h){ #ifdef RS2_USE_LAPACK A[i*numUsedRows+j]+=workNonBasicTab[list[i]][h]*workNonBasicTab[list[j]][h]; #else A[i][j]+=workNonBasicTab[list[i]][h]*workNonBasicTab[list[j]][h]; #endif } if (resolveWithNormalization && i == j){ // Penalize the norm of lambda, i.e. the solution #ifdef RS2_USE_LAPACK A[i*numUsedRows+j] += norm[k]*param.getNormalization(); #else A[i][j] += norm[k]*param.getNormalization(); #endif } } } if (list[i] == k){ b[i] = 1; #ifdef RS2_USE_LAPACK A[i*numUsedRows+i] = 1; #else A[i][i] = 1; #endif } else{ b[i] = 0; for (h = 0; h < nTab; ++h){ b[i] -= workNonBasicTab[list[i]][h]*workNonBasicTab[k][h]; } } } // Linear system has been written, now solve it #ifdef RS2_USE_LAPACK int info = 0; int h = 1; dgesv_(&numUsedRows, &h, A, &numUsedRows, indexlu, b, &numUsedRows, &info); if (info) continue; #else // LU decomposition if (!ludcmp(A, numUsedRows, indexlu, &tmpnumlu, tmpveclu)){ // numerical error: exit continue; } // Backward substitution lubksb(A, numUsedRows, indexlu, b); #endif // Check the 1-norm of the solution double sumnorm = 0.0; for (i = 0; i < numUsedRows; ++i){ b[i] = rs2round(b[i]); sumnorm += fabs(b[i]); if (sumnorm > param.getMaxSumMultipliers()){ break; } } #ifdef RS2_TRACE rs_printvecDBL("multipliers", b, numUsedRows); printf("sumnorm: %f\n", sumnorm); #endif if (sumnorm == 1){ // The optimal solution has lambda_k = 1 and all the rest is zero; // so we cannot reduce any coefficient, let's skip this continue; } else if (!resolveWithNormalization && sumnorm > param.getMaxSumMultipliers()){ // The norm of lambda is too large, resolve with normalization // (note that we do not want to do this more than once) resolveWithNormalization = true; k--; continue; } resolveWithNormalization = false; if (sumnorm > param.getMaxSumMultipliers()){ // If we got this far, even resolving did not help, so we skip continue; } double deltaNorm = compute_norm_change(norm[k], list, numUsedRows, b); if (deltaNorm <= -norm[k]*param.getMinNormReduction()){ for (i = 0; i < numUsedRows; ++i){ pi_mat[k][list[i]] = (int)(b[i]); } numRedRows++; } } /* if (norm[k] > param.getNormIsZero()) */ } /*for (k = 0; k < mTab; ++k) */ delete[] b; delete[] list; delete[] indexlu; delete[] tmpveclu; #ifdef RS2_USE_LAPACK delete[] A; #else rs_deallocmatDBL(&A, maxRowsReduction); #endif #ifdef RS2_TRACE sum_norms = 0; for(i=0; i f0) { row[locind] = - ((1-f) * f0); } else { row[locind] = -(f*f0compl); } } for(i=0; i param.getEPS_ELIM()) { int upto = rowStart[i] + rowLength[i]; for(j=rowStart[i]; j param.getEPS_COEFF()) { min_val = CoinMin(min_val, val); nelem++; } } if((max_val < param.getMAXDYN() * min_val) && (max_val >= min_val)) { return 1; } #ifdef RS2_TRACE printf("CglRedSplit2::check_dynamism(): max_val: %6.6f min_val: %6.6f dynamism: %g\n", max_val, min_val, max_val/min_val); #endif return 0; } /* row_scale_factor */ /************************************************************************/ int CglRedSplit2::generate_packed_row(const double *lclXlp, double *row, int *rowind, double *rowelem, int *card_row, double & rhs) { int i; double value; int max_support = param.getMAX_SUPP_ABS() + (static_cast(ncol*param.getMAX_SUPP_REL())); if(!check_dynamism(row)) { #ifdef RS2_TRACE printf("CglRedSplit2::generate_packed_row(): Cut discarded (bad dynamism)\n"); #endif return(0); } *card_row = 0; for(i=0; i param.getEPS_COEFF()) { rowind[*card_row] = i; rowelem[*card_row] = value; (*card_row)++; if(*card_row > max_support) { #ifdef RS2_TRACE printf("CglRedSplit2::generate_packed_row(): Cut discarded (too many non zero)\n"); #endif return(0); } } else { if (value > 0.0) { rhs -= value * colLower[i]; } else { rhs -= value * colUpper[i]; } } } value = 0; for(i=0; i<(*card_row); i++) { value += lclXlp[rowind[i]] * rowelem[i]; } if(value > rhs) { value = value-rhs; if(value < param.getMINVIOL()) { #ifdef RS2_TRACE printf("CglRedSplit2::generate_packed_row(): Cut discarded: violation: %12.10f\n", value); #endif return(0); } } return(1); } /* generate_packed_row */ /************************************************************************/ bool CglRedSplit2::rs_are_different_vectors(const int *vect1, const int *vect2, const int dim) { int i; for(i=0; i(&si); if(solver == NULL) { printf("### WARNING: CglRedSplit2::generateCuts(): no solver available.\n"); return; } if(!solver->optimalBasisIsAvailable()) { printf("### WARNING: CglRedSplit2::generateCuts(): no optimal basis available.\n"); return; } // Reset some members of CglRedSplit2 card_intBasicVar = 0; card_intBasicVar_frac = 0; card_intNonBasicVar = 0; card_contNonBasicVar = 0; card_nonBasicAtUpper = 0; card_nonBasicAtLower = 0; numRedRows = 0; startTime = CoinCpuTime(); // Get basic problem information from solver ncol = solver->getNumCols(); nrow = solver->getNumRows(); colLower = solver->getColLower(); colUpper = solver->getColUpper(); rowLower = solver->getRowLower(); rowUpper = solver->getRowUpper(); rowRhs = solver->getRightHandSide(); reducedCost = solver->getReducedCost(); rowPrice = solver->getRowPrice(); objective = solver->getObjCoefficients(); xlp = solver->getColSolution(); rowActivity = solver->getRowActivity(); byRow = solver->getMatrixByRow(); solver->enableFactorization(); generateCuts(&cs, param.getMaxNumCuts()); solver->disableFactorization(); } /* generateCuts */ /************************************************************************/ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda) { int i; is_integer = new int[ncol]; compute_is_integer(); int *cstat = new int[ncol]; int *rstat = new int[nrow]; solver->getBasisStatus(cstat, rstat); // 0: free 1: basic // 2: upper 3: lower int *basis_index = new int[nrow]; // basis_index[i] = // index of pivot var in row i // (slack if number >= ncol) #ifdef RS2_TRACETAB rs_printvecINT("cstat", cstat, ncol); rs_printvecINT("rstat", rstat, nrow); #endif solver->getBasics(basis_index); cv_intBasicVar = new int[ncol]; cv_intBasicVar_frac = new int[ncol]; intBasicVar = new int[ncol]; intNonBasicVar = new int[ncol]; contNonBasicVar = new int[ncol+nrow]; nonBasicAtUpper = new int[ncol+nrow]; nonBasicAtLower = new int[ncol+nrow]; double dist_int; for(i=0; i param.getAway()) && (dist_int < 1 - param.getAway())) { cv_intBasicVar_frac[i] = 1; card_intBasicVar_frac++; // intBasicVar_frac computed below, // as order must be according to selected rows } card_intBasicVar++; cv_intBasicVar[i] = 1; } break; case 2: // Non basic at upper bound: must be flipped and shifted // so that it becomes non negative with lower bound 0 // It is assumed that bounds for integer variables have been // tightend so that non basic integer structural variables // have integer values nonBasicAtUpper[card_nonBasicAtUpper] = i; card_nonBasicAtUpper++; if(is_integer[i]) { intNonBasicVar[card_intNonBasicVar] = i; card_intNonBasicVar++; } else { contNonBasicVar[card_contNonBasicVar] = i; card_contNonBasicVar++; } break; case 3 : // non basic at lower bound: must be shifted so that it becomes // non negative with lower bound 0 // It is assumed that bounds for integer variables have been // tightend so that they are integer nonBasicAtLower[card_nonBasicAtLower] = i; card_nonBasicAtLower++; if(is_integer[i]) { intNonBasicVar[card_intNonBasicVar] = i; card_intNonBasicVar++; } else { contNonBasicVar[card_contNonBasicVar] = i; card_contNonBasicVar++; } break; default: // free variable ? Don't know how to handle printf("### ERROR: CglRedSplit2::generateCuts(): cstat[%d]: %d\n", i, cstat[i]); exit(1); break; } } // Use this instead of rowRhs to allow for ranges double *effective_rhs = new double[nrow]; for(i=0; i= ncol || cv_intBasicVar[basis_index[ind_row]] != 1) { // If basic variable is not an integer variable, skip continue; } origRow[card_intBasicVar] = ind_row; // row used in generation intBasicVar[card_intBasicVar] = basis_index[ind_row]; if (cv_intBasicVar_frac[basis_index[ind_row]] == 1){ // row is fractional intBasicVar_frac[card_intBasicVar_frac] = basis_index[ind_row]; cv_fracRowsTab[card_intBasicVar] = 1; } // obtain row of simplex tableau solver->getBInvARow(ind_row, z, slack); rhsTab[card_rowTab] = xlp[basis_index[ind_row]]; int nonzeroes = 0; int ii; for(ii=0; ii TINY) nonzeroes++; } for(ii=0; ii TINY) nonzeroes++; } #if RS_FAST_INT > 0 || RS_FAST_CONT > 0 || RS_FAST_WORK > 0 if(nonzeroes < param.getMaxNonzeroesTab()) { #endif // The number of nonzeroes is small enough, we keep the row card_rowTab++; card_intBasicVar++; if (cv_intBasicVar_frac[basis_index[ind_row]] == 1) card_intBasicVar_frac++; #if RS_FAST_INT > 0 || RS_FAST_CONT > 0 || RS_FAST_WORK > 0 } #endif } #if RS_FAST_INT == 0 && RS_FAST_CONT == 0 && RS_FAST_WORK == 0 rs_allocmatINT(&pi_mat, mTab, mTab); #else // Allow for sparse info (and for work) rs_allocmatINT(&pi_mat, mTab, mTab+ card_intNonBasicVar+2*card_contNonBasicVar+3); for (int i=0;i TINY) intSparse[++n]=j; } intSparse[0]=n; n=0; values=contNonBasicTab[i]; for (int j=0;jgetElements(); const int *rowStart = byRow->getVectorStarts(); const int *indices = byRow->getIndices(); const int *rowLength = byRow->getVectorLengths(); CglRedSplit2Param::ColumnSelectionStrategy columnSelection; CglRedSplit2Param::RowSelectionStrategy rowSelection; int numRows; int maxNumComputedCuts = param.getMaxNumComputedCuts(); int* bufflambda = lambda; OsiCuts* buffcs = cs; // quality of cuts struct sortElement* quality = NULL; if (maxNumCuts < maxNumComputedCuts){ // user wants the generator to generate several cuts and select only best if (lambda != NULL){ bufflambda = new int[maxNumComputedCuts*nrow]; } if (cs != NULL){ buffcs = new OsiCuts(); } quality = new struct sortElement[maxNumComputedCuts]; } int initNumCuts = 0; if (buffcs != NULL){ initNumCuts = buffcs->sizeRowCuts(); } // reset vector of lambdas if (bufflambda != NULL){ if (maxNumCuts < maxNumComputedCuts){ memset(bufflambda, 0, maxNumComputedCuts*nrow*sizeof(int)); } else{ memset(bufflambda, 0, maxNumCuts*nrow*sizeof(int)); } } int numCuts = 0; std::vector listColSel = param.getColumnSelectionStrategy(); std::vector listRowSel = param.getRowSelectionStrategy(); std::vector listNumRows = param.getNumRowsReduction(); #if 0 double work= listColSel.size()*listNumRows.size()*listRowSel.size()*nDiag; work *= mTab*(card_intNonBasicVar+card_contNonBasicVar); printf("listColSel %d listNumRows %d listRowSel %d mTab %d intNon %d contnon %d - %d generate_rows and dense ops %g\n", listColSel.size(),listNumRows.size(),listRowSel.size(),mTab, card_intNonBasicVar,card_contNonBasicVar, listColSel.size()*listNumRows.size()*listRowSel.size()*nDiag,work); #endif for (unsigned int coliter = 0; coliter < listColSel.size(); ++coliter){ if (!checkTime() || numCuts >= maxNumComputedCuts){ break; } columnSelection = listColSel[coliter]; #ifdef RS2_TRACE printf("Filling workNonBasicTab with column strategy %d\n", columnSelection); #endif // select the columns fill_workNonBasicTab(columnSelection); for (unsigned int nriter = 0; nriter < listNumRows.size(); ++nriter){ if (!checkTime() || numCuts >= maxNumComputedCuts){ break; } numRows = listNumRows[nriter]; #ifdef RS2_TRACE printf("Applying reduction algorithm with %d rows\n", numRows); #endif for (unsigned int rowiter = 0; rowiter < listRowSel.size(); ++rowiter){ if (!checkTime() || numCuts >= maxNumComputedCuts){ break; } rowSelection = listRowSel[rowiter]; #ifdef RS2_TRACE printf("Reducing norms with row strategy %d\n", rowSelection); #endif // new iteration: reinitialize pi_mat for(i=0; i 0.0) { adjust += fabs(tabrowrhs) * param.getEPS_RELAX_REL(); } rc.setUb(tabrowrhs + adjust); // relax the constraint slightly buffcs->insertIfNotDuplicate(rc, CoinAbsFltEq(param.getEPS())); numCuts = buffcs->sizeRowCuts() - initNumCuts; } else{ numCuts++; } } } } } } } } } if (maxNumCuts < maxNumComputedCuts){ // select best cuts and copy them back if (numCuts > maxNumCuts){ qsort(quality, numCuts, sizeof(struct sortElement), rs2_compareElements); } // also delete temp data if (buffcs){ for (int i = 0; i < numCuts && i < maxNumCuts; ++i){ cs->insertIfNotDuplicate(buffcs->rowCut(quality[i].index), CoinAbsFltEq(param.getEPS_COEFF())); } delete buffcs; } if (bufflambda){ for (int i = 0; i < numCuts && i < maxNumCuts; ++i){ memcpy(lambda + (i*nrow), bufflambda + (quality[i].index*nrow), sizeof(int)*nrow); } delete[] bufflambda; } if (numCuts > maxNumCuts){ numCuts = maxNumCuts; } } delete[] cstat; delete[] rstat; delete[] basis_index; delete[] slack; delete[] z; delete[] effective_rhs; delete[] row; delete[] rowind; delete[] rowelem; delete[] origRow; delete[] cv_intBasicVar; delete[] cv_intBasicVar_frac; delete[] cv_fracRowsTab; delete[] intBasicVar; delete[] intBasicVar_frac; delete[] intNonBasicVar; delete[] contNonBasicVar; delete[] nonBasicAtUpper; delete[] nonBasicAtLower; delete[] is_integer; rs_deallocmatDBL(&contNonBasicTab, mTab); rs_deallocmatDBL(&workNonBasicTab, mTab); rs_deallocmatDBL(&intNonBasicTab, mTab); rs_deallocmatINT(&pi_mat, mTab); delete[] rhsTab; delete[] norm; return numCuts; } /* generateCuts */ /***********************************************************************/ void CglRedSplit2::setParam(const CglRedSplit2Param &source) { param = source; } /* setParam */ /***********************************************************************/ void CglRedSplit2::compute_is_integer() { int i; for(i=0; iisInteger(i)) { is_integer[i] = 1; } else { if((colUpper[i] - colLower[i] < param.getEPS()) && (rs_above_integer(colUpper[i]) < param.getEPS())) { // continuous variable fixed to an integer value is_integer[i] = 1; } else { is_integer[i] = 0; } } } } /* compute_is_integer */ /***********************************************************************/ void CglRedSplit2::print() const { rs_printvecINT("intBasicVar_frac", intBasicVar_frac, card_intBasicVar_frac); rs_printmatINT("pi_mat", pi_mat, card_intBasicVar_frac, card_intBasicVar_frac); rs_printvecINT("intNonBasicVar", intNonBasicVar, card_intNonBasicVar); rs_printmatDBL("intNonBasicTab", intNonBasicTab, card_intBasicVar_frac, card_intNonBasicVar); rs_printvecINT("contNonBasicVar", contNonBasicVar, card_contNonBasicVar); rs_printmatDBL("contNonBasicTab", contNonBasicTab, card_intBasicVar_frac, card_contNonBasicVar); rs_printvecINT("nonBasicAtLower", nonBasicAtLower, card_nonBasicAtLower); rs_printvecINT("nonBasicAtUpper", nonBasicAtUpper, card_nonBasicAtUpper); } /* print */ /***********************************************************************/ void CglRedSplit2::printOptTab(OsiSolverInterface *lclSolver) const { int i; int *cstat = new int[ncol]; int *rstat = new int[nrow]; lclSolver->getBasisStatus(cstat, rstat); // 0: free 1: basic // 2: upper 3: lower int *basis_index = new int[nrow]; // basis_index[i] = // index of pivot var in row i // (slack if number >= ncol) lclSolver->getBasics(basis_index); double *z = new double[ncol]; // workspace to get row of the tableau double *slack = new double[nrow]; // workspace to get row of the tableau double *slack_val = new double[nrow]; for(i=0; igetReducedCost(); const double *dual = lclSolver->getRowPrice(); const double *solution = lclSolver->getColSolution(); rs_printvecINT("cstat", cstat, ncol); rs_printvecINT("rstat", rstat, nrow); rs_printvecINT("basis_index", basis_index, nrow); rs_printvecDBL("solution", solution, ncol); rs_printvecDBL("slack_val", slack_val, nrow); rs_printvecDBL("reduced_costs", rc, ncol); rs_printvecDBL("dual solution", dual, nrow); printf("Optimal Tableau:\n"); for(i=0; igetBInvARow(i, z, slack); int ii; for(ii=0; iigetObjValue()); delete[] cstat; delete[] rstat; delete[] basis_index; delete[] slack; delete[] z; delete[] slack_val; } /* printOptTab */ /*********************************************************************/ CglRedSplit2::CglRedSplit2() : CglCutGenerator(), nrow(0), ncol(0), card_intBasicVar(0), card_intBasicVar_frac(0), card_intNonBasicVar(0), card_contNonBasicVar(0), card_nonBasicAtUpper(0), card_nonBasicAtLower(0), cv_intBasicVar(0), cv_intBasicVar_frac(0), cv_fracRowsTab(0), intBasicVar(0), intBasicVar_frac(0), intNonBasicVar(0), contNonBasicVar(0), nonBasicAtUpper(0), nonBasicAtLower(0), mTab(0), nTab(0), pi_mat(0), contNonBasicTab(0), intNonBasicTab(0), rhsTab(0) { } /*********************************************************************/ CglRedSplit2::CglRedSplit2(const CglRedSplit2Param &RS_param) : CglCutGenerator(), nrow(0), ncol(0), card_intBasicVar(0), card_intBasicVar_frac(0), card_intNonBasicVar(0), card_contNonBasicVar(0), card_nonBasicAtUpper(0), card_nonBasicAtLower(0), cv_intBasicVar(0), cv_intBasicVar_frac(0), cv_fracRowsTab(0), intBasicVar(0), intBasicVar_frac(0), intNonBasicVar(0), contNonBasicVar(0), nonBasicAtUpper(0), nonBasicAtLower(0), mTab(0), nTab(0), pi_mat(0), contNonBasicTab(0), intNonBasicTab(0), rhsTab(0) { param = RS_param; } /*********************************************************************/ CglRedSplit2::CglRedSplit2 (const CglRedSplit2 & source) : CglCutGenerator(source), param(source.param), nrow(0), ncol(0), card_intBasicVar(0), card_intBasicVar_frac(0), card_intNonBasicVar(0), card_contNonBasicVar(0), card_nonBasicAtUpper(0), card_nonBasicAtLower(0), cv_intBasicVar(NULL), cv_intBasicVar_frac(NULL), cv_fracRowsTab(NULL), intBasicVar(NULL), intBasicVar_frac(NULL), intNonBasicVar(NULL), contNonBasicVar(NULL), nonBasicAtUpper(NULL), nonBasicAtLower(NULL), mTab(0), nTab(0), pi_mat(NULL), contNonBasicTab(NULL), intNonBasicTab(NULL), rhsTab(NULL) { } /*********************************************************************/ CglCutGenerator * CglRedSplit2::clone() const { return new CglRedSplit2(*this); } /*********************************************************************/ CglRedSplit2::~CglRedSplit2 () {} /*********************************************************************/ CglRedSplit2 & CglRedSplit2::operator=(const CglRedSplit2 &source) { if (this != &source) { CglCutGenerator::operator=(source); param = source.param; } return *this; } /*********************************************************************/ // Returns true if needs optimal basis to do cuts bool CglRedSplit2::needsOptimalBasis() const { return true; } /************************************************************************/ int CglRedSplit2::generateMultipliers(const OsiSolverInterface &si, int* lambda, int maxNumMultipliers, int* basicVariables, OsiCuts* cs) { solver = const_cast(&si); if(solver == NULL) { printf("### WARNING: CglRedSplit2::generateCuts(): no solver available.\n"); return 0; } if(!solver->optimalBasisIsAvailable()) { printf("### WARNING: CglRedSplit2::generateCuts(): no optimal basis available.\n"); return 0; } // Reset some members of CglRedSplit2 card_intBasicVar = 0; card_intBasicVar_frac = 0; card_intNonBasicVar = 0; card_contNonBasicVar = 0; card_nonBasicAtUpper = 0; card_nonBasicAtLower = 0; numRedRows = 0; startTime = CoinCpuTime(); // Get basic problem information from solver ncol = solver->getNumCols(); nrow = solver->getNumRows(); colLower = solver->getColLower(); colUpper = solver->getColUpper(); rowLower = solver->getRowLower(); rowUpper = solver->getRowUpper(); rowRhs = solver->getRightHandSide(); reducedCost = solver->getReducedCost(); rowPrice = solver->getRowPrice(); objective = solver->getObjCoefficients(); xlp = solver->getColSolution(); rowActivity = solver->getRowActivity(); byRow = solver->getMatrixByRow(); solver->enableFactorization(); if (basicVariables != NULL){ solver->getBasics(basicVariables); } int numMultipliers = generateCuts(cs, maxNumMultipliers, lambda); solver->disableFactorization(); return numMultipliers; } /* generateMultipliers */ /***********************************************************************/ int CglRedSplit2::tiltLandPcut(const OsiSolverInterface* si, double* landprow, double landprhs, int rownumber, const double* xbar, const int* newnonbasics, OsiRowCut* cs, int* lambda){ solver = const_cast(si); if(solver == NULL) { printf("### WARNING: CglRedSplit2::tiltLandPcut(): no solver available.\n"); return 0; } // Reset some members of CglRedSplit2 card_intBasicVar = 0; card_intBasicVar_frac = 0; card_intNonBasicVar = 0; card_contNonBasicVar = 0; card_nonBasicAtUpper = 0; card_nonBasicAtLower = 0; numRedRows = 0; startTime = CoinCpuTime(); // Get basic problem information from solver ncol = solver->getNumCols(); nrow = solver->getNumRows(); colLower = solver->getColLower(); colUpper = solver->getColUpper(); rowLower = solver->getRowLower(); rowUpper = solver->getRowUpper(); rowRhs = solver->getRightHandSide(); reducedCost = solver->getReducedCost(); rowPrice = solver->getRowPrice(); objective = solver->getObjCoefficients(); xlp = solver->getColSolution(); rowActivity = solver->getRowActivity(); byRow = solver->getMatrixByRow(); int i; is_integer = new int[ncol]; compute_is_integer(); int *cstat = new int[ncol]; int *rstat = new int[nrow]; solver->getBasisStatus(cstat, rstat); // 0: free 1: basic // 2: upper 3: lower int *basis_index = new int[nrow]; // basis_index[i] = // index of pivot var in row i // (slack if number >= ncol) #ifdef RS2_TRACETAB rs_printvecINT("cstat", cstat, ncol); rs_printvecINT("rstat", rstat, nrow); #endif solver->getBasics(basis_index); cv_intBasicVar = new int[ncol]; cv_intBasicVar_frac = new int[ncol]; intBasicVar = new int[ncol]; intNonBasicVar = new int[ncol]; contNonBasicVar = new int[ncol+nrow]; nonBasicAtUpper = new int[ncol+nrow]; nonBasicAtLower = new int[ncol+nrow]; double dist_int; for(i=0; i param.getAway()) && (dist_int < 1 - param.getAway())) { cv_intBasicVar_frac[i] = 1; card_intBasicVar_frac++; // intBasicVar_frac computed below, // as order must be according to selected rows } card_intBasicVar++; cv_intBasicVar[i] = 1; } break; case 2: // Non basic at upper bound: must be flipped and shifted // so that it becomes non negative with lower bound 0 // It is assumed that bounds for integer variables have been // tightend so that non basic integer structural variables // have integer values nonBasicAtUpper[card_nonBasicAtUpper] = i; card_nonBasicAtUpper++; if(is_integer[i]) { intNonBasicVar[card_intNonBasicVar] = i; card_intNonBasicVar++; } else { contNonBasicVar[card_contNonBasicVar] = i; card_contNonBasicVar++; } break; case 3 : // non basic at lower bound: must be shifted so that it becomes // non negative with lower bound 0 // It is assumed that bounds for integer variables have been // tightend so that they are integer nonBasicAtLower[card_nonBasicAtLower] = i; card_nonBasicAtLower++; if(is_integer[i]) { intNonBasicVar[card_intNonBasicVar] = i; card_intNonBasicVar++; } else { contNonBasicVar[card_contNonBasicVar] = i; card_contNonBasicVar++; } break; default: // free variable ? Don't know how to handle printf("### ERROR: CglRedSplit2::generateCuts(): cstat[%d]: %d\n", i, cstat[i]); exit(1); break; } } // Use this instead of rowRhs to allow for ranges double *effective_rhs = new double[nrow]; for(i=0; i= 0){ // this means that the source row is in the given simplex tableau mTab = card_intBasicVar; } else{ // source row is an extra row, so we need extra space mTab = card_intBasicVar + 1; } nTab = card_contNonBasicVar; rhsTab = new double[mTab]; cv_fracRowsTab = new int[mTab]; memset(cv_fracRowsTab, 0, mTab*sizeof(int)); int card_rowTab = 0; int extraColumns = 0; while (newnonbasics[extraColumns] >= 0){ extraColumns++; } rs_allocmatDBL(&contNonBasicTab, mTab, card_contNonBasicVar); rs_allocmatDBL(&workNonBasicTab, mTab, card_contNonBasicVar + extraColumns); rs_allocmatDBL(&intNonBasicTab, mTab, card_intNonBasicVar); norm = new double[mTab]; intBasicVar_frac = new int[ncol]; card_intBasicVar = 0; // recompute in pivot order card_intBasicVar_frac = 0; // write L&P row as first row rhsTab[card_rowTab] = landprhs; // flip row: L&P flips the nonbasic at upper bound, but we don't want this for (int ii=0; ii= ncol || ind_row == rownumber) { continue; } if(cv_intBasicVar[basis_index[ind_row]] == 1) { // row used in generation intBasicVar[card_intBasicVar] = basis_index[ind_row]; if (cv_intBasicVar_frac[basis_index[ind_row]] == 1){ // row is fractional intBasicVar_frac[card_intBasicVar_frac] = basis_index[ind_row]; card_intBasicVar_frac++; cv_fracRowsTab[card_intBasicVar] = 1; } card_intBasicVar++; int ii; rhsTab[card_rowTab] = xlp[basis_index[ind_row]]; solver->getBInvARow(ind_row, z, slack); for(ii=0; iigetElements(); const int *rowStart = byRow->getVectorStarts(); const int *indices = byRow->getIndices(); const int *rowLength = byRow->getVectorLengths(); CglRedSplit2Param::ColumnSelectionStrategy columnSelection; CglRedSplit2Param::RowSelectionStrategy rowSelection; int numRows; int generatedCuts = 0; std::vector listColSel = param.getColumnSelectionStrategyLAP(); std::vector listRowSel = param.getRowSelectionStrategyLAP(); std::vector listNumRows = param.getNumRowsReductionLAP(); for (unsigned int coliter = 0; coliter < listColSel.size(); ++coliter){ if (!checkTime()){ break; } columnSelection = listColSel[coliter]; #ifdef RS2_TRACE printf("Filling workNonBasicTab with column strategy %d\n", columnSelection); #endif nTab = 0; // select the columns if (columnSelection != CglRedSplit2Param::CS_LAP_NONBASICS){ fill_workNonBasicTab(columnSelection, newnonbasics); } fill_workNonBasicTab(newnonbasics, xbar, param.getColumnScalingStrategyLAP()); for (unsigned int nriter = 0; nriter < listNumRows.size(); ++nriter){ if (!checkTime()){ break; } numRows = listNumRows[nriter]; #ifdef RS2_TRACE printf("Applying reduction algorithm with %d rows\n", numRows); #endif for (unsigned int rowiter = 0; rowiter < listRowSel.size(); ++rowiter){ if (!checkTime()){ break; } rowSelection = listRowSel[rowiter]; #ifdef RS2_TRACE printf("Reducing norms with row strategy %d\n", rowSelection); #endif // new iteration: reinitialize pi_mat for(i=0; isetRow(card_row, rowind, rowelem); cs->setLb(-param.getINFINIT()); double adjust = param.getEPS_RELAX_ABS(); if(param.getEPS_RELAX_REL() > 0.0) { adjust += fabs(tabrowrhs) * param.getEPS_RELAX_REL(); } cs->setUb(tabrowrhs + adjust); if (lambda){ // Modify the initial disjunction by adding the new // coefficients for (int k = 1; k < mTab; ++k){ lambda[intBasicVar[k-1]] += pi_mat[i][k]; } } generatedCuts++; } } } } } } delete[] cstat; delete[] rstat; delete[] basis_index; delete[] slack; delete[] z; delete[] effective_rhs; delete[] row; delete[] rowind; delete[] rowelem; delete[] cv_intBasicVar_frac; delete[] cv_fracRowsTab; delete[] intBasicVar; delete[] intBasicVar_frac; delete[] intNonBasicVar; delete[] contNonBasicVar; delete[] nonBasicAtUpper; delete[] nonBasicAtLower; delete[] is_integer; rs_deallocmatDBL(&contNonBasicTab, mTab); rs_deallocmatDBL(&workNonBasicTab, mTab); rs_deallocmatDBL(&intNonBasicTab, mTab); rs_deallocmatINT(&pi_mat, pi_mat_rows); delete[] rhsTab; delete[] norm; return generatedCuts; } /* tiltLandPcut */ /***************************************************************************/ void CglRedSplit2::fill_workNonBasicTab(const int* newnonbasics, const double* xbar, CglRedSplit2Param::ColumnScalingStrategy scaling){ // See CglRedSplit2Param.hpp for a description of the strategies int i = 0; int currvar, colpos; #ifdef RS2_TRACE while (newnonbasics[i] >= 0){ printf("Newnonbasic[%d]: %d\n", i, newnonbasics[i]); i++; } i = 0; #endif // In workNonBasicTab, we write the new nonbasic columns given by the // Lift & Project algorithm, scaled by the value of the fractional solution. while (newnonbasics[i] >= 0){ currvar = newnonbasics[i]; if (currvar < ncol && solver->isInteger(currvar)){ for (colpos = 0; colpos < card_intNonBasicVar; ++colpos){ if (intNonBasicVar[colpos] == currvar){ #ifdef RS2_TRACE printf("Found int nonbasic at pos %d: %d %d\n", colpos, intNonBasicVar[colpos], currvar); #endif break; } } double factor = 1.0; if (scaling == CglRedSplit2Param::SC_LINEAR){ if (fabs(xbar[currvar]) > factor){ factor = fabs(xbar[currvar]); } } else if (scaling == CglRedSplit2Param::SC_LINEAR_BOUNDED){ if (fabs(xbar[currvar]) > factor){ factor = fabs(xbar[currvar]); } if (factor < param.getColumnScalingBoundLAP()){ factor = param.getColumnScalingBoundLAP(); } } else if (scaling == CglRedSplit2Param::SC_LOG_BOUNDED){ if (log(fabs(xbar[currvar])) > factor){ factor = log(fabs(xbar[currvar])); } if (factor < param.getColumnScalingBoundLAP()){ factor = param.getColumnScalingBoundLAP(); } } else if (scaling == CglRedSplit2Param::SC_UNIFORM){ factor = param.getColumnScalingBoundLAP(); } else if (scaling == CglRedSplit2Param::SC_UNIFORM_NZ){ if (fabs(xbar[currvar]) > param.getEPS()){ factor = param.getColumnScalingBoundLAP(); } } for (int j = 0; j < mTab; ++j){ workNonBasicTab[j][nTab] = intNonBasicTab[j][colpos]*factor; } nTab++; } else{ for (colpos = 0; colpos < card_contNonBasicVar; ++colpos){ if (contNonBasicVar[colpos] == currvar){ #ifdef RS2_TRACE printf("Found cont nonbasic at pos %d: %d %d\n", colpos, contNonBasicVar[colpos], currvar); #endif break; } } double factor = 1.0; if (scaling == CglRedSplit2Param::SC_LINEAR){ if (fabs(xbar[currvar]) > factor){ factor = fabs(xbar[currvar]); } } else if (scaling == CglRedSplit2Param::SC_LINEAR_BOUNDED){ if (fabs(xbar[currvar]) > factor){ factor = fabs(xbar[currvar]); } if (factor < param.getColumnScalingBoundLAP()){ factor = param.getColumnScalingBoundLAP(); } } else if (scaling == CglRedSplit2Param::SC_LOG_BOUNDED){ if (log(fabs(xbar[currvar])) > factor){ factor = log(fabs(xbar[currvar])); } if (factor < param.getColumnScalingBoundLAP()){ factor = param.getColumnScalingBoundLAP(); } } else if (scaling == CglRedSplit2Param::SC_UNIFORM){ factor = param.getColumnScalingBoundLAP(); } else if (scaling == CglRedSplit2Param::SC_UNIFORM_NZ){ if (fabs(xbar[currvar]) > param.getEPS()){ factor = param.getColumnScalingBoundLAP(); } } for (int j = 0; j < mTab; ++j){ #ifdef RS2_TRACE printf("Col %d Row %d: %f, xbar %f\n", colpos, j, contNonBasicTab[j][colpos], xbar[currvar]); #endif workNonBasicTab[j][nTab] = contNonBasicTab[j][colpos]*factor; } nTab++; } i++; } #ifdef RS2_TRACE printf("Printing workNonBasicTab:\n"); #endif #if RS_FAST_WORK int workOffset = mTab+card_intNonBasicVar+card_contNonBasicVar+2; #endif for (i = 0; i < mTab; ++i) { #ifdef RS2_TRACE for (int j = 0; j < nTab; ++j){ printf("%.6f ", workNonBasicTab[i][j]); } printf("\n"); #endif #if RS_FAST_WORK == 0 norm[i] = rs_dotProd(workNonBasicTab[i], workNonBasicTab[i], nTab); #elif RS_FAST_WORK == 1 norm[i] = rs_dotProd(workNonBasicTab[i], workNonBasicTab[i], nTab); double value = rs_sparseDotProd(workNonBasicTab[i], workNonBasicTab[i], pi_mat[i]+workOffset, pi_mat[i]+workOffset); assert (value==norm[i]); #else norm[i] = rs_sparseDotProd(workNonBasicTab[i], workNonBasicTab[i], pi_mat[i]+workOffset, pi_mat[i]+workOffset); #endif } } /* fill_workNonBasicTab */ /***********************************************************************/ Cgl-0.58.9/src/CglRedSplit2/CglRedSplit2.hpp0000644000076600007660000004472612130104734017004 0ustar coincoin// Last edit: 04/03/10 // // Name: CglRedSplit2.hpp // Author: Giacomo Nannicini // Singapore University of Technology and Design // Singapore // email: nannicini@sutd.edu.sg // based on CglRedSplit by Francois Margot // Date: 03/09/09 //----------------------------------------------------------------------------- // Copyright (C) 2010, Giacomo Nannicini and others. All Rights Reserved. #ifndef CglRedSplit2_H #define CglRedSplit2_H #include "CglCutGenerator.hpp" #include "CglRedSplit2Param.hpp" #include "CoinWarmStartBasis.hpp" #include "CoinHelperFunctions.hpp" #include "CoinTime.hpp" /** Reduce-and-Split Cut Generator Class; See method generateCuts(). Based on the papers "Practical strategies for generating rank-1 split cuts in mixed-integer linear programming" by G. Cornuejols and G. Nannicini, published on Mathematical Programming Computation, and "Combining Lift-and-Project and Reduce-and-Split" by E. Balas, G. Cornuejols, T. Kis and G. Nannicini, published on INFORMS Journal on Computing. Part of this code is based on CglRedSplit by F. Margot. */ class CglRedSplit2 : public CglCutGenerator { friend void CglRedSplit2UnitTest(const OsiSolverInterface * siP, const std::string mpdDir); public: /**@name generateCuts */ //@{ /** Generate Reduce-and-Split Mixed Integer Gomory cuts for the model of the solver interface si. Insert the generated cuts into OsiCuts cs. This generator currently works only with the Lp solvers Clp or Cplex9.0 or higher. It requires access to the optimal tableau and optimal basis inverse and makes assumptions on the way slack variables are added by the solver. The Osi implementations for Clp and Cplex verify these assumptions. When calling the generator, the solver interface si must contain an optimized problem and information related to the optimal basis must be available through the OsiSolverInterface methods (si->optimalBasisIsAvailable() must return 'true'). It is also essential that the integrality of structural variable i can be obtained using si->isInteger(i). Reduce-and-Split cuts are a class of split cuts. We compute linear combinations of the rows of the simplex tableau, trying to reduce some of the coefficients on the nonbasic continuous columns. We have a large number of heuristics to choose which coefficients should be reduced, and by using which rows. The paper explains everything in detail. Note that this generator can potentially generate a huge number of cuts, depending on how it is parametered. Default parameters should be good for most situations; if you want to go heavy on split cuts, use more row selection strategies or a different number of rows in the linear combinations. Again, look at the paper for details. If you want to generate a small number of cuts, default parameters are not the best choice. A combination of Reduce-and-Split with Lift & Project is described in the paper "Combining Lift-and-Project and Reduce-and-Split". The Reduce-and-Split code for the implementation used in that paper is included here. This generator does not generate the same cuts as CglRedSplit, therefore both generators can be used in conjunction. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /// Return true if needs optimal basis to do cuts (will return true) virtual bool needsOptimalBasis() const; // Generate the row multipliers computed by Reduce-and-Split from the // given OsiSolverInterface. The multipliers are written in lambda; // lambda should be of size nrow*maxNumMultipliers. We generate at most // maxNumMultipliers m-vectors of row multipliers, and return the number // of m-vectors that were generated. // If the caller wants to know which variables are basic in each row // (same order as lambda), basicVariables should be non-NULL (size nrow). // This method can also generate the cuts corresponding to the multipliers // returned; it suffices to pass non-NULL OsiCuts. // This method is not needed by the typical user; however, it is useful // in the context of generating Lift & Project cuts. int generateMultipliers(const OsiSolverInterface& si, int* lambda, int maxNumMultipliers, int* basicVariables = NULL, OsiCuts* cs = NULL); // Try to improve a Lift & Project cut, by employing the // Reduce-and-Split procedure. We start from a row of a L&P tableau, // and generate a cut trying to reduce the coefficients on the // nonbasic variables. Note that this L&P tableau will in general // have nonbasic variables which are nonzero in the point that we // want to cut off, so we should be careful. Arguments: // OsiSolverInterface which contains the simplex tableau, initial // row from which the cut is derived, row rhs, row number of the // source row (if it is in the simplex tableau; otherwise, a // negative number; needed to avoid using duplicate rows), point // that we want to cut off (note: this is NOT a basic solution for // the OsiSolverInterace!), list of variables which are basic in // xbar but are nonbasic in the OsiSolverInterface. The computed cut // is written in OsiRowCut* cs. Finally, if a starting disjunction // is provided in the vector lambda (of size ncols, i.e. a // disjunction on the structural variables), the disjunction is // modified according to the cut which is produced. int tiltLandPcut(const OsiSolverInterface* si, double* row, double rowRhs, int rownumber, const double* xbar, const int* newnonbasics, OsiRowCut* cs, int* lambda = NULL); //@} /**@name Public Methods */ //@{ // Set the parameters to the values of the given CglRedSplit2Param object. void setParam(const CglRedSplit2Param &source); // Return the CglRedSplit2Param object of the generator. inline CglRedSplit2Param& getParam() {return param;} /// Print some of the data members; used for debugging void print() const; /// Print the current simplex tableau void printOptTab(OsiSolverInterface *solver) const; //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglRedSplit2(); /// Constructor with specified parameters CglRedSplit2(const CglRedSplit2Param &RS_param); /// Copy constructor CglRedSplit2(const CglRedSplit2 &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglRedSplit2 & operator=(const CglRedSplit2& rhs); /// Destructor virtual ~CglRedSplit2 (); //@} private: // Private member methods /**@name Private member methods */ //@{ // Method generating the cuts after all CglRedSplit2 members are // properly set. This does the actual work. Returns the number of // generated cuts (or multipliers). // Will generate cuts if cs != NULL, and will generate multipliers // if lambda != NULL. int generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda = NULL); /// Compute the fractional part of value, allowing for small error. inline double rs_above_integer(const double value) const; /// Fill workNonBasicTab, depending on the column selection strategy. /// Accepts a list of variables indices that should be ignored; by /// default, this list is empty (it is only used by Lift & Project). /// The list ignore_list contains -1 as the last element. /// Note that the implementation of the ignore_list is not very efficient /// if the list is long, so it should be used only if its short. void fill_workNonBasicTab(CglRedSplit2Param::ColumnSelectionStrategy strategy, const int* ignore_list = NULL); /// Fill workNonBasicTab, alternate version for Lift & Project: also /// reduces columns which are now nonbasic but are basic in xbar. /// This function should be called only when CglRedSplit2 is used in /// conjunction with CglLandP to generate L&P+RS cuts. void fill_workNonBasicTab(const int* newnonbasics, const double* xbar, CglRedSplit2Param::ColumnScalingStrategy scaling); /// Reduce rows of workNonBasicTab, i.e. compute integral linear /// combinations of the rows in order to reduce row coefficients on /// workNonBasicTab void reduce_workNonBasicTab(int numRows, CglRedSplit2Param::RowSelectionStrategy rowSelectionStrategy, int maxIterations); /// Generate a linear combination of the rows of the current LP /// tableau, using the row multipliers stored in the matrix pi_mat /// on the row of index index_row void generate_row(int index_row, double *row); /// Generate a mixed integer Gomory cut, when all non basic /// variables are non negative and at their lower bound. int generate_cgcut(double *row, double *rhs); /// Use multiples of the initial inequalities to cancel out the coefficients /// of the slack variables. void eliminate_slacks(double *row, const double *elements, const int *start, const int *indices, const int *rowLength, const double *rhs, double *rowrhs); /// Change the sign of the coefficients of the continuous non basic /// variables at their upper bound. void flip(double *row); /// Change the sign of the coefficients of the continuous non basic /// variables at their upper bound and do the translations restoring /// the original bounds. Modify the right hand side /// accordingly. void unflip(double *row, double *rowrhs); /// Returns 1 if the row has acceptable max/min coeff ratio. /// Compute max_coeff: maximum absolute value of the coefficients. /// Compute min_coeff: minimum absolute value of the coefficients /// larger than EPS_COEFF. /// Return 0 if max_coeff/min_coeff > MAXDYN. int check_dynamism(double *row); /// Generate the packed cut from the row representation. int generate_packed_row(const double *xlp, double *row, int *rowind, double *rowelem, int *card_row, double & rhs); // Compute entries of is_integer. void compute_is_integer(); // Check that two vectors are different. bool rs_are_different_vectors(const int *vect1, const int *vect2, const int dim); // allocate matrix of integers void rs_allocmatINT(int ***v, int m, int n); // deallocate matrix of integers void rs_deallocmatINT(int ***v, int m); // allocate matrix of doubles void rs_allocmatDBL(double ***v, int m, int n); // deallocate matrix of doubles void rs_deallocmatDBL(double ***v, int m); // print a vector of integers void rs_printvecINT(const char *vecstr, const int *x, int n) const; // print a vector of doubles void rs_printvecDBL(const char *vecstr, const double *x, int n) const; // print a matrix of integers void rs_printmatINT(const char *vecstr, const int * const *x, int m, int n) const; // print a matrix of doubles void rs_printmatDBL(const char *vecstr, const double * const *x, int m, int n) const; // dot product double rs_dotProd(const double *u, const double *v, int dim) const; double rs_dotProd(const int *u, const double *v, int dim) const; // From Numerical Recipes in C: LU decomposition int ludcmp(double **a, int n, int *indx, double *d, double* vv) const; // from Numerical Recipes in C: backward substitution void lubksb(double **a, int n, int *indx, double *b) const; // Check if the linear combination given by listOfRows with given multipliers // improves the norm of row #rowindex; note: multipliers are rounded! // Returns the difference with respect to the old norm (if negative there is // an improvement, if positive norm increases) double compute_norm_change(double oldnorm, const int* listOfRows, int numElemList, const double* multipliers) const; // Compute the list of rows that should be used to reduce row #rowIndex int get_list_rows_reduction(int rowIndex, int numRowsReduction, int* list, const double* norm, CglRedSplit2Param::RowSelectionStrategy rowSelectionStrategy) const; // Sorts the rows by increasing number of nonzeroes with respect to a given // row (rowIndex), on the nonbasic variables (whichTab == 0 means only // integer, whichTab == 1 means only workTab, whichTab == 2 means both). // The array for sorting must be allocated (and deleted) by caller. // Corresponds to BRS1 in the paper. int sort_rows_by_nonzeroes(struct sortElement* array, int rowIndex, int maxRows, int whichTab) const; // Greedy variant of the previous function; slower but typically // more effective. Corresponds to BRS2 in the paper. int sort_rows_by_nonzeroes_greedy(struct sortElement* array, int rowIndex, int maxRows, int whichTab) const; // Sorts the rows by decreasing absolute value of the cosine of the // angle with respect to a given row (rowIndex), on the nonbasic // variables (whichTab == 0 means only integer, whichTab == 1 means // only workTab, whichTab == 2 means both). The array for sorting // must be allocated (and deleted) by caller. Very effective // strategy in practice. Corresponds to BRS3 in the paper. int sort_rows_by_cosine(struct sortElement* array, int rowIndex, int maxRows, int whichTab) const; // Did we hit the time limit? inline bool checkTime() const{ if ((CoinCpuTime() - startTime) < param.getTimeLimit()){ return true; } return false; } //@} // Private member data /**@name Private member data */ //@{ /// Object with CglRedSplit2Param members. CglRedSplit2Param param; /// Number of rows ( = number of slack variables) in the current LP. int nrow; /// Number of structural variables in the current LP. int ncol; /// Number of rows which have been reduced int numRedRows; /// Lower bounds for structural variables const double *colLower; /// Upper bounds for structural variables const double *colUpper; /// Lower bounds for constraints const double *rowLower; /// Upper bounds for constraints const double *rowUpper; /// Righ hand side for constraints (upper bound for ranged constraints). const double *rowRhs; /// Reduced costs for columns const double *reducedCost; /// Row price const double *rowPrice; /// Objective coefficients const double* objective; /// Number of integer basic structural variables int card_intBasicVar; /// Number of integer basic structural variables that are fractional in the /// current lp solution (at least param.away_ from being integer). int card_intBasicVar_frac; /// Number of integer non basic structural variables in the /// current lp solution. int card_intNonBasicVar; /// Number of continuous non basic variables (structural or slack) in the /// current lp solution. int card_contNonBasicVar; /// Number of continuous non basic variables (structural or slack) in the /// current working set for coefficient reduction int card_workNonBasicVar; /// Number of non basic variables (structural or slack) at their /// upper bound in the current lp solution. int card_nonBasicAtUpper; /// Number of non basic variables (structural or slack) at their /// lower bound in the current lp solution. int card_nonBasicAtLower; /// Characteristic vector for integer basic structural variables int *cv_intBasicVar; /// Characteristic vector for integer basic structural variables /// with non integer value in the current lp solution. int *cv_intBasicVar_frac; /// Characteristic vector for rows of the tableau selected for reduction /// with non integer value in the current lp solution int *cv_fracRowsTab; /// List of integer structural basic variables /// (in order of pivot in selected rows for cut generation). int *intBasicVar; /// List of integer structural basic variables with fractional value /// (in order of pivot in selected rows for cut generation). int *intBasicVar_frac; /// List of integer structural non basic variables. int *intNonBasicVar; /// List of continuous non basic variables (structural or slack). // slacks are considered continuous (no harm if this is not the case). int *contNonBasicVar; /// List of non basic variables (structural or slack) at their /// upper bound. int *nonBasicAtUpper; /// List of non basic variables (structural or slack) at their lower /// bound. int *nonBasicAtLower; /// Number of rows in the reduced tableau (= card_intBasicVar). int mTab; /// Number of columns in the reduced tableau (= card_contNonBasicVar) int nTab; /// Tableau of multipliers used to alter the rows used in generation. /// Dimensions: mTab by mTab. Initially, pi_mat is the identity matrix. int **pi_mat; /// Simplex tableau for continuous non basic variables (structural or slack). /// Only rows used for generation. /// Dimensions: mTab by card_contNonBasicVar. double **contNonBasicTab; /// Current tableau for continuous non basic variables (structural or slack). /// Only columns used for coefficient reduction. /// Dimensions: mTab by card_workNonBasicVar. double **workNonBasicTab; /// Simplex tableau for integer non basic structural variables. /// Only rows used for generation. // Dimensions: mTab by card_intNonBasicVar. double **intNonBasicTab; /// Right hand side of the tableau. /// Only rows used for generation. double *rhsTab; /// Norm of rows in workNonBasicTab; needed for faster computations double *norm; /// Characteristic vectors of structural integer variables or continuous /// variables currently fixed to integer values. int *is_integer; /// Pointer on solver. Reset by each call to generateCuts(). OsiSolverInterface *solver; /// Pointer on point to separate. Reset by each call to generateCuts(). const double *xlp; /// Pointer on row activity. Reset by each call to generateCuts(). const double *rowActivity; /// Pointer on matrix of coefficient ordered by rows. /// Reset by each call to generateCuts(). const CoinPackedMatrix *byRow; /// Time at which cut computations began. /// Reset by each call to generateCuts(). double startTime; //@} }; //############################################################################# /** A function that tests some of the methods in the CglRedSplit2 class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglRedSplit2UnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglRedSplit2/Makefile.am0000644000076600007660000000333712130104734016062 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglRedSplit2 # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglRedSplit2.la # List all source files for this library, including headers libCglRedSplit2_la_SOURCES = \ CglRedSplit2.cpp CglRedSplit2.hpp \ CglRedSplit2Test.cpp \ CglRedSplit2Param.cpp CglRedSplit2Param.hpp # This is for libtool (on Windows) libCglRedSplit2_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglRedSplit2.hpp CglRedSplit2Param.hpp Cgl-0.58.9/src/CglRedSplit2/Makefile.in0000644000076600007660000005436512240340055016102 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/CglRedSplit2 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglRedSplit2_la_LIBADD = am_libCglRedSplit2_la_OBJECTS = CglRedSplit2.lo CglRedSplit2Test.lo \ CglRedSplit2Param.lo libCglRedSplit2_la_OBJECTS = $(am_libCglRedSplit2_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 = $(libCglRedSplit2_la_SOURCES) DIST_SOURCES = $(libCglRedSplit2_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglRedSplit2 # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglRedSplit2.la # List all source files for this library, including headers libCglRedSplit2_la_SOURCES = \ CglRedSplit2.cpp CglRedSplit2.hpp \ CglRedSplit2Test.cpp \ CglRedSplit2Param.cpp CglRedSplit2Param.hpp # This is for libtool (on Windows) libCglRedSplit2_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglRedSplit2.hpp CglRedSplit2Param.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/CglRedSplit2/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglRedSplit2/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglRedSplit2.la: $(libCglRedSplit2_la_OBJECTS) $(libCglRedSplit2_la_DEPENDENCIES) $(CXXLINK) $(libCglRedSplit2_la_LDFLAGS) $(libCglRedSplit2_la_OBJECTS) $(libCglRedSplit2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglRedSplit2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglRedSplit2Param.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglRedSplit2Test.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglRedSplit2/CglRedSplit2Param.cpp0000644000076600007660000004024612130104734017751 0ustar coincoin// Name: CglRedSplit2Param.hpp // Author: Giacomo Nannicini // Singapore University of Technology and Design // Singapore // email: nannicini@sutd.edu.sg // Date: 03/09/09 //----------------------------------------------------------------------------- // Copyright (C) 2010, Giacomo Nannicini and others. All Rights Reserved. #include #include #include #include #include #include #include "CoinPragma.hpp" #include "CglRedSplit2Param.hpp" /***********************************************************************/ void CglRedSplit2Param::setAway(double value) { if (value > 0.0 && value <= 0.5) away_ = value; } /***********************************************************************/ void CglRedSplit2Param::setEPS_ELIM(double eps_el) { if(eps_el >= 0) EPS_ELIM = eps_el; } /* setEPS_ELIM */ /***********************************************************************/ void CglRedSplit2Param::setEPS_RELAX_ABS(double eps_ra) { if(eps_ra >= 0) EPS_RELAX_ABS = eps_ra; } /* setEPS_RELAX_ABS */ /***********************************************************************/ void CglRedSplit2Param::setEPS_RELAX_REL(double eps_rr) { if(eps_rr >= 0) EPS_RELAX_REL = eps_rr; } /* setEPS_RELAX_REL */ /***********************************************************************/ void CglRedSplit2Param::setMAXDYN(double value) { if (value > 1.0) { MAXDYN = value; } else { printf("### WARNING: CglRedSplit2::setMAXDYN(): value: %f ignored\n", value); } } /* setMAXDYN */ /***********************************************************************/ void CglRedSplit2Param::setMINVIOL(double value) { if (value > 0.0 && value <= 0.1) { MINVIOL = value; } else { printf("### WARNING: CglRedSplit2Param::setMINVIOL(): value: %f ignored\n", value); } } /* setMINVIOL */ /***********************************************************************/ void CglRedSplit2Param::setMAX_SUPP_REL(double value) { if (value > 0.0 && value <= 0.1) { MINVIOL = value; } else { printf("### WARNING: CglRedSplit2Param::setMINVIOL(): value: %f ignored\n", value); } } /* setMAX_SUPP_REL */ /***********************************************************************/ void CglRedSplit2Param::setUSE_INTSLACKS(int value) { USE_INTSLACKS = value; } /* setUSE_INTSLACKS */ /***********************************************************************/ void CglRedSplit2Param::setNormIsZero(double value) { if (value > 0.0 && value <= 1) { normIsZero_ = value; } else { printf("### WARNING: CglRedSplit2Param::setNormIsZero(): value: %f ignored\n", value); } } /* setNormIsZero */ /***********************************************************************/ void CglRedSplit2Param::setMinNormReduction(double value) { if (value > 0.0 && value <= 1) { minNormReduction_ = value; } else { printf("### WARNING: CglRedSplit2Param::setMinNormReduction(): value: %f ignored\n", value); } } /* setMinNormReduction */ /***********************************************************************/ void CglRedSplit2Param::setMaxSumMultipliers(int value) { if (value > 1) { maxSumMultipliers_ = value; } else { printf("### WARNING: CglRedSplit2Param::setMaxSumMultipliers(): value: %d ignored\n", value); } } /* setMaxSumMultipliers */ /***********************************************************************/ void CglRedSplit2Param::setNormalization(double value) { if (value >= 0) { normalization_ = value; } else { printf("### WARNING: CglRedSplit2Param::setNormalization(): value: %f ignored\n", value); } } /* setNormalization */ /***********************************************************************/ void CglRedSplit2Param::addNumRowsReduction(int value) { if (value >= 0) { numRowsReduction_.push_back(value); } else { printf("### WARNING: CglRedSplit2Param::addNumRowsReduction(): value: %d ignored\n", value); } } /* addNumRowsReduction */ /***********************************************************************/ void CglRedSplit2Param::addColumnSelectionStrategy(ColumnSelectionStrategy value) { if (value != CS_ALL && value != CS_BEST && value != CS_LAP_NONBASICS) { columnSelectionStrategy_.push_back(value); } else if (value == CS_ALL) { // CS_ALL means all strategies. columnSelectionStrategy_.push_back(CS1); columnSelectionStrategy_.push_back(CS2); columnSelectionStrategy_.push_back(CS3); columnSelectionStrategy_.push_back(CS4); columnSelectionStrategy_.push_back(CS5); columnSelectionStrategy_.push_back(CS6); columnSelectionStrategy_.push_back(CS7); columnSelectionStrategy_.push_back(CS8); columnSelectionStrategy_.push_back(CS9); columnSelectionStrategy_.push_back(CS10); columnSelectionStrategy_.push_back(CS11); columnSelectionStrategy_.push_back(CS12); columnSelectionStrategy_.push_back(CS13); columnSelectionStrategy_.push_back(CS14); columnSelectionStrategy_.push_back(CS15); columnSelectionStrategy_.push_back(CS16); columnSelectionStrategy_.push_back(CS17); columnSelectionStrategy_.push_back(CS18); columnSelectionStrategy_.push_back(CS19); columnSelectionStrategy_.push_back(CS20); columnSelectionStrategy_.push_back(CS21); } else if (value == CS_BEST){ // Select C-5P, I-2P-2/3, I-2P-4/5, I-3P columnSelectionStrategy_.push_back(CS4); columnSelectionStrategy_.push_back(CS5); columnSelectionStrategy_.push_back(CS6); columnSelectionStrategy_.push_back(CS7); columnSelectionStrategy_.push_back(CS8); columnSelectionStrategy_.push_back(CS9); columnSelectionStrategy_.push_back(CS10); columnSelectionStrategy_.push_back(CS11); columnSelectionStrategy_.push_back(CS12); columnSelectionStrategy_.push_back(CS18); columnSelectionStrategy_.push_back(CS19); columnSelectionStrategy_.push_back(CS20); columnSelectionStrategy_.push_back(CS21); } } /* addColumnSelectionStrategy */ /***********************************************************************/ void CglRedSplit2Param::addRowSelectionStrategy(RowSelectionStrategy value) { if (value != RS_ALL && value != RS_BEST){ rowSelectionStrategy_.push_back(value); } else if (value == RS_ALL){ rowSelectionStrategy_.push_back(RS1); rowSelectionStrategy_.push_back(RS2); rowSelectionStrategy_.push_back(RS3); rowSelectionStrategy_.push_back(RS4); rowSelectionStrategy_.push_back(RS5); rowSelectionStrategy_.push_back(RS6); rowSelectionStrategy_.push_back(RS7); rowSelectionStrategy_.push_back(RS8); } else if (value == RS_BEST){ rowSelectionStrategy_.push_back(RS7); rowSelectionStrategy_.push_back(RS8); } } /* addRowSelectionStrategy */ /***********************************************************************/ void CglRedSplit2Param::addNumRowsReductionLAP(int value) { if (value >= 0) { numRowsReductionLAP_.push_back(value); } else { printf("### WARNING: CglRedSplit2Param::addNumRowsReductionLAP(): value: %d ignored\n", value); } } /* addNumRowsReductionLAP */ /***********************************************************************/ void CglRedSplit2Param::addColumnSelectionStrategyLAP(ColumnSelectionStrategy value) { if (value != CS_ALL && value != CS_BEST) { columnSelectionStrategyLAP_.push_back(value); } else if (value == CS_BEST){ columnSelectionStrategyLAP_.push_back(CS1); } else{ printf("### WARNING: CglRedSplit2Param::addColumnSelectionStrategyLAP(): value: %d ignored\n", value); } } /* addColumnSelectionStrategyLAP */ /***********************************************************************/ void CglRedSplit2Param::addRowSelectionStrategyLAP(RowSelectionStrategy value) { if (value != RS_ALL && value != RS_BEST){ rowSelectionStrategyLAP_.push_back(value); } else if (value == RS_BEST){ rowSelectionStrategyLAP_.push_back(RS8); } else{ printf("### WARNING: CglRedSplit2Param::addRowSelectionStrategyLAP(): value: %d ignored\n", value); } } /* addRowSelectionStrategyLAP */ /***********************************************************************/ void CglRedSplit2Param::setTimeLimit(double value) { if (value >= 0.0){ timeLimit_ = value; } else { timeLimit_ = 0.0; } } /* setTimeLimit */ /***********************************************************************/ void CglRedSplit2Param::setMaxNumCuts(int value) { if (value >= 0){ maxNumCuts_ = value; } else { printf("### WARNING: CglRedSplit2Param::maxNumCuts(): value: %d ignored\n", value); } } /* setMaxNumCuts */ /***********************************************************************/ void CglRedSplit2Param::setMaxNumComputedCuts(int value) { if (value >= 0){ maxNumComputedCuts_ = value; } else { printf("### WARNING: CglRedSplit2Param::maxNumComputedCuts(): value: %d ignored\n", value); } } /* setMaxNumComputedCuts */ /***********************************************************************/ void CglRedSplit2Param::setMaxNonzeroesTab(int value) { if (value >= 0){ maxNonzeroesTab_ = value; } else { printf("### WARNING: CglRedSplit2Param::maxNonzeroesTab(): value: %d ignored\n", value); } } /* setMaxNumComputedCuts */ /***********************************************************************/ void CglRedSplit2Param::setColumnScalingStrategyLAP(ColumnScalingStrategy value) { columnScalingStrategyLAP_ = value; } /* setColumnScalingStrategyLAP */ /***********************************************************************/ void CglRedSplit2Param::setColumnScalingBoundLAP(double value) { if (value >= 0){ columnScalingBoundLAP_ = value; } else { printf("### WARNING: CglRedSplit2Param::columnScalingBoundLAP(): value: %f ignored\n", value); } } /* setColumnScalingBoundLAP */ /***********************************************************************/ void CglRedSplit2Param::setSkipGomory(int value) { if (value >= 0 && value <= 1){ skipGomory_ = value; } else{ printf("### WARNING: CglRedSplit2Param::skipGomory(): value: %d ignored\n", value); } } /***********************************************************************/ CglRedSplit2Param::CglRedSplit2Param(bool use_default_strategies, double eps, double eps_coeff, double eps_elim, double eps_relax_abs, double eps_relax_rel, double max_dyn, double min_viol, int max_supp_abs, double max_supp_rel, int use_int_slacks, double norm_zero, double minNormReduction, int maxSumMultipliers, double normalization, double away, double timeLimit, int maxNumCuts, int maxNumComputedCuts, int maxNonzeroesTab, double columnScalingBoundLAP, int skipGomory) : CglParam(COIN_DBL_MAX, eps, eps_coeff, max_supp_abs), EPS_ELIM(eps_elim), EPS_RELAX_ABS(eps_relax_abs), EPS_RELAX_REL(eps_relax_rel), MAXDYN(max_dyn), MINVIOL(min_viol), MAX_SUPP_REL(max_supp_rel), USE_INTSLACKS(use_int_slacks), normIsZero_(norm_zero), minNormReduction_(minNormReduction), maxSumMultipliers_(maxSumMultipliers), normalization_(normalization), away_(away), columnScalingBoundLAP_(columnScalingBoundLAP), timeLimit_(timeLimit), maxNumCuts_(maxNumCuts), maxNumComputedCuts_(maxNumComputedCuts), maxNonzeroesTab_(maxNonzeroesTab), skipGomory_(skipGomory) { if (use_default_strategies) { addNumRowsReduction(5); addColumnSelectionStrategy(CglRedSplit2Param::CS_BEST); addRowSelectionStrategy(CglRedSplit2Param::RS_BEST); addNumRowsReductionLAP(3); addColumnSelectionStrategyLAP(CglRedSplit2Param::CS1); addRowSelectionStrategyLAP(CglRedSplit2Param::RS8); setColumnScalingStrategyLAP(CglRedSplit2Param::SC_UNIFORM_NZ); } } /***********************************************************************/ CglRedSplit2Param::CglRedSplit2Param(const CglParam &source, bool use_default_strategies, double eps_elim, double eps_relax_abs, double eps_relax_rel, double max_dyn, double min_viol, double max_supp_rel, int use_int_slacks, double norm_zero, double minNormReduction, int maxSumMultipliers, double normalization, double away, double timeLimit, int maxNumCuts, int maxNumComputedCuts, int maxNonzeroesTab, double columnScalingBoundLAP, int skipGomory) : CglParam(source), EPS_ELIM(eps_elim), EPS_RELAX_ABS(eps_relax_abs), EPS_RELAX_REL(eps_relax_rel), MAXDYN(max_dyn), MINVIOL(min_viol), MAX_SUPP_REL(max_supp_rel), USE_INTSLACKS(use_int_slacks), normIsZero_(norm_zero), minNormReduction_(minNormReduction), maxSumMultipliers_(maxSumMultipliers), normalization_(normalization), away_(away), columnScalingBoundLAP_(columnScalingBoundLAP), timeLimit_(timeLimit), maxNumCuts_(maxNumCuts), maxNumComputedCuts_(maxNumComputedCuts), maxNonzeroesTab_(maxNonzeroesTab), skipGomory_(skipGomory) { if (use_default_strategies) { addNumRowsReduction(5); addColumnSelectionStrategy(CglRedSplit2Param::CS_BEST); addRowSelectionStrategy(CglRedSplit2Param::RS_BEST); addNumRowsReductionLAP(3); addColumnSelectionStrategyLAP(CglRedSplit2Param::CS1); addRowSelectionStrategyLAP(CglRedSplit2Param::RS8); setColumnScalingStrategyLAP(CglRedSplit2Param::SC_UNIFORM_NZ); } } /***********************************************************************/ CglRedSplit2Param::CglRedSplit2Param(const CglRedSplit2Param &source) : CglParam(source), EPS_ELIM(source.EPS_ELIM), EPS_RELAX_ABS(source.EPS_RELAX_ABS), EPS_RELAX_REL(source.EPS_RELAX_REL), MAXDYN(source.MAXDYN), MINVIOL(source.MINVIOL), MAX_SUPP_REL(source.MAX_SUPP_REL), USE_INTSLACKS(source.USE_INTSLACKS), normIsZero_(source.normIsZero_), minNormReduction_(source.minNormReduction_), maxSumMultipliers_(source.maxSumMultipliers_), normalization_(source.normalization_), away_(source.away_), numRowsReduction_(source.numRowsReduction_), columnSelectionStrategy_(source.columnSelectionStrategy_), rowSelectionStrategy_(source.rowSelectionStrategy_), numRowsReductionLAP_(source.numRowsReductionLAP_), columnSelectionStrategyLAP_(source.columnSelectionStrategyLAP_), rowSelectionStrategyLAP_(source.rowSelectionStrategyLAP_), columnScalingStrategyLAP_(source.columnScalingStrategyLAP_), columnScalingBoundLAP_(source.columnScalingBoundLAP_), timeLimit_(source.timeLimit_), maxNumCuts_(source.maxNumCuts_), maxNumComputedCuts_(source.maxNumComputedCuts_), maxNonzeroesTab_(source.maxNonzeroesTab_), skipGomory_(source.skipGomory_) {} /***********************************************************************/ CglRedSplit2Param* CglRedSplit2Param::clone() const { return new CglRedSplit2Param(*this); } /***********************************************************************/ CglRedSplit2Param& CglRedSplit2Param::operator=(const CglRedSplit2Param &rhs) { if(this != &rhs) { CglParam::operator=(rhs); EPS_ELIM = rhs.EPS_ELIM; EPS_RELAX_ABS = rhs.EPS_RELAX_ABS; EPS_RELAX_REL = rhs.EPS_RELAX_REL; MAXDYN = rhs.MAXDYN; MINVIOL = rhs.MINVIOL; MAX_SUPP_REL = rhs.MAX_SUPP_REL; USE_INTSLACKS = rhs.USE_INTSLACKS; normIsZero_ = rhs.normIsZero_; minNormReduction_ = rhs.minNormReduction_; maxSumMultipliers_ = rhs.maxSumMultipliers_; normalization_ = rhs.normalization_; away_ = rhs.away_; numRowsReduction_ = rhs.numRowsReduction_; columnSelectionStrategy_ = rhs.columnSelectionStrategy_; rowSelectionStrategy_ = rhs.rowSelectionStrategy_; numRowsReductionLAP_ = rhs.numRowsReductionLAP_; columnSelectionStrategyLAP_ = rhs.columnSelectionStrategyLAP_; rowSelectionStrategyLAP_ = rhs.rowSelectionStrategyLAP_; columnScalingStrategyLAP_ = rhs.columnScalingStrategyLAP_; columnScalingBoundLAP_ = rhs.columnScalingBoundLAP_; timeLimit_ = rhs.timeLimit_; maxNumCuts_ = rhs.maxNumCuts_; maxNumComputedCuts_ = rhs.maxNumComputedCuts_; maxNonzeroesTab_ = rhs.maxNonzeroesTab_; skipGomory_ = rhs.skipGomory_; } return *this; } /***********************************************************************/ CglRedSplit2Param::~CglRedSplit2Param() {} Cgl-0.58.9/src/CglRedSplit2/CglRedSplit2Param.hpp0000644000076600007660000004606312130104734017761 0ustar coincoin// Name: CglRedSplit2Param.hpp // Author: Giacomo Nannicini // Singapore University of Technology and Design // Singapore // email: nannicini@sutd.edu.sg // Date: 03/09/09 //----------------------------------------------------------------------------- // Copyright (C) 2010, Giacomo Nannicini and others. All Rights Reserved. #ifndef CglRedSplit2Param_H #define CglRedSplit2Param_H #include "CglParam.hpp" #include /**@name CglRedSplit2 Parameters */ //@{ /** Class collecting parameters the Reduced-and-split cut generator. An important thing to note is that the cut generator allows for the selection of a number of strategies that can be combined together. By default, a selection that typically yields a good compromise between speed and cut strenght is made. The selection can be changed by resetting the default choices (see the functions whose name starts with "reset") or by setting the parameter use_default_strategies to false in the constructors. After this, the chosen strategies can be added to the list by using the functions whose name starts with "add". All strategies will be combined together: if we choose 3 row selection strategies, 2 column selection strategies, and 2 possible numbers of rows, we end up with a total of 3*2*2 combinations. For a detailed explanation of the parameters and their meaning, see the paper by Cornuejols and Nannicini: "Practical strategies for generating rank-1 split cuts in mixed-integer linear programming", on Mathematical Programming Computation. Parameters of the generator are listed below. - MAXDYN: Maximum ratio between largest and smallest non zero coefficients in a cut. See method setMAXDYN(). - EPS_ELIM: Precision for deciding if a coefficient is zero when eliminating slack variables. See method setEPS_ELIM(). - MINVIOL: Minimum violation for the current basic solution in a generated cut. See method setMINVIOL(). - EPS_RELAX_ABS: Absolute relaxation of cut rhs. - EPS_RELAX_REL: Relative relaxation of cut rhs. - MAX_SUPP_ABS: Maximum cut support (absolute). - MAX_SUPP_REL: Maximum cut support (relative): the formula to compute maximum cut support is MAX_SUPP_ABS + ncol*MAX_SUPP_REL. - USE_INTSLACKS: Use integer slacks to generate cuts. (not implemented). See method setUSE_INTSLACKS(). - normIsZero: Norm of a vector is considered zero if smaller than this value. See method setNormIsZero(). - minNormReduction: a cut is generated if the new norm of the row on the continuous nonbasics is reduced by at least this factor (relative reduction). - away: Look only at basic integer variables whose current value is at least this value from being integer. See method setAway(). - maxSumMultipliers: maximum sum (in absolute value) of row multipliers - normalization: normalization factor for the norm of lambda in the coefficient reduction algorithm (convex min problem) - numRowsReduction: Maximum number of rows in the linear system for norm reduction. - columnSelectionStrategy: parameter to select which columns should be used for coefficient reduction. - rowSelectionStrategy: parameter to select which rows should be used for coefficient reduction. - timeLimit: Time limit (in seconds) for cut generation. - maxNumCuts: Maximum number of cuts that can be returned at each pass; we could generate more cuts than this number (see below) - maxNumComputedCuts: Maximum number of cuts that can be computed by the generator at each pass - maxNonzeroesTab : Rows of the simplex tableau with more than this number of nonzeroes will not be considered for reduction. Only works if RS_FAST_* are defined in CglRedSplit2. - skipGomory: Skip traditional Gomory cuts, i.e. GMI cuts arising from a single row of the tableau (instead of a combination). Default is 1 (true), because we assume that they are generated by a traditional Gomory generator anyway. */ //@} class CglRedSplit2Param : public CglParam { public: /** Enumerations for parameters */ /** Row selection strategies; same names as in the paper */ enum RowSelectionStrategy{ /* Pick rows that introduce the fewest nonzeroes on integer nonbasics */ RS1, /* Pick rows that introduce the fewest nonzeroes on the set of working continuous nonbasics */ RS2, /* Pick rows that introduce the fewest nonzeroes on both integer and working continuous nonbasics */ RS3, /* Same as RS0 but with greedy algorithm */ RS4, /* Same as RS1 but with greedy algorithm */ RS5, /* Same as RS2 but with greedy algorithm */ RS6, /* Pick rows with smallest angle in the space of integer and working continuous nonbasics */ RS7, /* Pick rows with smallest angle in the space of working continuous nonbasics */ RS8, /* Use all strategies */ RS_ALL, /* Use best ones - that is, RS8 and RS7 */ RS_BEST }; /** Column selection strategies; again, look them up in the paper. */ enum ColumnSelectionStrategy{ /* C-3P */ CS1, CS2, CS3, /* C-5P */ CS4, CS5, CS6, CS7, CS8, /* I-2P-2/3 */ CS9, CS10, /* I-2P-4/5 */ CS11, CS12, /* I-2P-1/2 */ CS13, CS14, /* I-3P */ CS15, CS16, CS17, /* I-4P */ CS18, CS19, CS20, CS21, /* Use all strategies up to this point */ CS_ALL, /* Use best strategies (same effect as CS_ALL, because it turns out that using all strategies is the best thing to do) */ CS_BEST, /* Optimize over all continuous nonbasic columns; this does not give good results, but we use it for testing Lift & Project + RedSplit */ CS_ALLCONT, /* Lift & Project specific strategy: only select variables which are nonbasic in the tableau but are basic in the point to cut off. This strategy cannot be used outside L&P. It is not very effective even with L&P, but is left here for testing.*/ CS_LAP_NONBASICS }; /** Scaling strategies for new nonbasic columns for Lift & Project; * "factor" is the value of columnScalingBoundLAP_ */ enum ColumnScalingStrategy{ /* No scaling */ SC_NONE, /* Multiply by |xbar[i]| where xbar[i] is the value of the corresponding component of the point that we want to cut off */ SC_LINEAR, /* Multiply by min(factor,|xbar[i]|) */ SC_LINEAR_BOUNDED, /* Multiply by min(factor,log(|xbar[i]|)) */ SC_LOG_BOUNDED, /* Multiply all new nonbasics by factor */ SC_UNIFORM, /* Multiply only nonzero coefficients by factor */ SC_UNIFORM_NZ }; /**@name Set/get methods */ //@{ /** Set away, the minimum distance from being integer used for selecting rows for cut generation; all rows whose pivot variable should be integer but is more than away from integrality will be selected; Default: 0.005 */ virtual void setAway(double value); /// Get value of away inline double getAway() const {return away_;} /** Set the value of EPS_ELIM, epsilon for values of coefficients when eliminating slack variables; Default: 0.0 */ void setEPS_ELIM(double value); /** Get the value of EPS_ELIM */ double getEPS_ELIM() const {return EPS_ELIM;} /** Set EPS_RELAX_ABS */ virtual void setEPS_RELAX_ABS(double eps_ra); /** Get value of EPS_RELAX_ABS */ inline double getEPS_RELAX_ABS() const {return EPS_RELAX_ABS;} /** Set EPS_RELAX_REL */ virtual void setEPS_RELAX_REL(double eps_rr); /** Get value of EPS_RELAX_REL */ inline double getEPS_RELAX_REL() const {return EPS_RELAX_REL;} // Set the maximum ratio between largest and smallest non zero // coefficients in a cut. Default: 1e6. virtual void setMAXDYN(double value); /** Get the value of MAXDYN */ inline double getMAXDYN() const {return MAXDYN;} /** Set the value of MINVIOL, the minimum violation for the current basic solution in a generated cut. Default: 1e-3 */ virtual void setMINVIOL(double value); /** Get the value of MINVIOL */ inline double getMINVIOL() const {return MINVIOL;} /** Maximum absolute support of the cutting planes. Default: INT_MAX. Aliases for consistency with our naming scheme. */ inline void setMAX_SUPP_ABS(int value) {setMAX_SUPPORT(value);} inline int getMAX_SUPP_ABS() const {return MAX_SUPPORT;} /** Maximum relative support of the cutting planes. Default: 0.0. The maximum support is MAX_SUPP_ABS + MAX_SUPPREL*ncols. */ inline void setMAX_SUPP_REL(double value); inline double getMAX_SUPP_REL() const {return MAX_SUPP_REL;} /** Set the value of USE_INTSLACKS. Default: 0 */ virtual void setUSE_INTSLACKS(int value); /** Get the value of USE_INTSLACKS */ inline int getUSE_INTSLACKS() const {return USE_INTSLACKS;} /** Set the value of normIsZero, the threshold for considering a norm to be 0; Default: 1e-5 */ virtual void setNormIsZero(double value); /** Get the value of normIsZero */ inline double getNormIsZero() const {return normIsZero_;} /** Set the value of minNormReduction; Default: 0.1 */ virtual void setMinNormReduction(double value); /** Get the value of normIsZero */ inline double getMinNormReduction() const {return minNormReduction_;} /** Set the value of maxSumMultipliers; Default: 10 */ virtual void setMaxSumMultipliers(int value); /** Get the value of maxSumMultipliers */ inline int getMaxSumMultipliers() const {return maxSumMultipliers_;} /** Set the value of normalization; Default: 0.0001 */ virtual void setNormalization(double value); /** Get the value of normalization */ inline double getNormalization() const {return normalization_;} /** Set the value of numRowsReduction, max number of rows that are used * for each row reduction step. In particular, the linear system will * involve a numRowsReduction*numRowsReduction matrix */ virtual void addNumRowsReduction(int value); /// get the value inline std::vector getNumRowsReduction() const {return numRowsReduction_;} /// reset inline void resetNumRowsReduction() {numRowsReduction_.clear();} /** Add the value of columnSelectionStrategy */ virtual void addColumnSelectionStrategy(ColumnSelectionStrategy value); /// get the value inline std::vector getColumnSelectionStrategy() const {return columnSelectionStrategy_;} /// reset inline void resetColumnSelectionStrategy(){columnSelectionStrategy_.clear();} /** Set the value for rowSelectionStrategy, which changes the way we choose * the rows for the reduction step */ virtual void addRowSelectionStrategy(RowSelectionStrategy value); /// get the value inline std::vector getRowSelectionStrategy() const {return rowSelectionStrategy_;}; /// reset inline void resetRowSelectionStrategy() {rowSelectionStrategy_.clear();} /** Set the value of numRowsReductionLAP, max number of rows that are used * for each row reduction step during Lift & Project. * In particular, the linear system will involve a * numRowsReduction*numRowsReduction matrix */ virtual void addNumRowsReductionLAP(int value); /// get the value inline std::vector getNumRowsReductionLAP() const {return numRowsReductionLAP_;} /// reset inline void resetNumRowsReductionLAP() {numRowsReductionLAP_.clear();} /** Add the value of columnSelectionStrategyLAP */ virtual void addColumnSelectionStrategyLAP(ColumnSelectionStrategy value); /// get the value inline std::vector getColumnSelectionStrategyLAP() const {return columnSelectionStrategyLAP_;} /// reset inline void resetColumnSelectionStrategyLAP(){columnSelectionStrategyLAP_.clear();} /** Set the value for rowSelectionStrategyLAP, which changes the way we * choose the rows for the reduction step */ virtual void addRowSelectionStrategyLAP(RowSelectionStrategy value); /// get the value inline std::vector getRowSelectionStrategyLAP() const {return rowSelectionStrategyLAP_;}; /// reset inline void resetRowSelectionStrategyLAP() {rowSelectionStrategyLAP_.clear();} /** Set the value for columnScalingStrategyLAP, which sets the way nonbasic * columns that are basic in the fractional point to cut off are scaled */ virtual void setColumnScalingStrategyLAP(ColumnScalingStrategy value); /// get the value inline ColumnScalingStrategy getColumnScalingStrategyLAP() const {return columnScalingStrategyLAP_; }; /** Set the value for the bound in the column scaling factor */ virtual void setColumnScalingBoundLAP(double value); /// get the value inline double getColumnScalingBoundLAP() const {return columnScalingBoundLAP_;}; /** Set the value of the time limit for cut generation (in seconds) */ virtual void setTimeLimit(double value); /// get the value inline double getTimeLimit() const {return timeLimit_;} /** Set the value for the maximum number of cuts that can be returned */ virtual void setMaxNumCuts(int value); /// get the value inline int getMaxNumCuts() const {return maxNumCuts_;} /** Set the value for the maximum number of cuts that can be computed */ virtual void setMaxNumComputedCuts(int value); /// get the value inline int getMaxNumComputedCuts() const {return maxNumComputedCuts_;} /** Set the value for the maximum number of nonzeroes in a row of * the simplex tableau for the row to be considered */ virtual void setMaxNonzeroesTab(int value); /// get the value inline int getMaxNonzeroesTab() const {return maxNonzeroesTab_;} /** Set the value of skipGomory: should we skip simple Gomory cuts, * i.e. GMI cuts derived from a single row of the simple tableau? * This is 1 (true) by default: we only generate cuts from linear * combinations of at least two rows. */ virtual void setSkipGomory(int value); /// get the value inline int getSkipGomory() const {return skipGomory_;} //@} /**@name Constructors and destructors */ //@{ /// Default constructor. If use_default_strategies is true, we add /// to the list of strategies the default ones. If is false, the /// list of strategies is left empty (must be populated before usage!). CglRedSplit2Param(bool use_default_strategies = true, double eps = 1e-12, double eps_coeff = 1e-11, double eps_elim = 0.0, double eps_relax_abs = 1e-11, double eps_relax_rel = 1e-13, double max_dyn = 1e6, double min_viol = 1e-3, int max_supp_abs = 1000, double max_supp_rel = 0.1, int use_int_slacks = 0, double norm_zero = 1e-5, double minNormReduction = 0.1, int maxSumMultipliers = 10, double normalization = 0.0001, double away = 0.005, double timeLimit = 60, int maxNumCuts = 10000, int maxNumComputedCuts = 10000, int maxNonzeroesTab = 1000, double columnScalingBoundLAP = 5.0, int skipGomory = 1); /// Constructor from CglParam. If use_default_strategies is true, we /// add to the list of strategies the default ones. If is false, the /// list of strategies is left empty (must be populated before /// usage!). CglRedSplit2Param(const CglParam &source, bool use_default_strategies = true, double eps_elim = 0.0, double eps_relax_abs = 1e-11, double eps_relax_rel = 1e-13, double max_dyn = 1e6, double min_viol = 1e-3, double max_supp_rel = 0.1, int use_int_slacks = 0, double norm_zero = 1e-5, double minNormReduction = 0.1, int maxSumMultipliers = 10, double normalization = 0.0001, double away = 0.005, double timeLimit = 60, int maxNumCuts = 10000, int maxNumComputedCuts = 10000, int maxNonzeroesTab = 1000, double columnScalingBoundLAP = 5.0, int skipGomory = 1); /// Copy constructor CglRedSplit2Param(const CglRedSplit2Param &source); /// Clone virtual CglRedSplit2Param* clone() const; /// Assignment operator virtual CglRedSplit2Param& operator=(const CglRedSplit2Param &rhs); /// Destructor virtual ~CglRedSplit2Param(); //@} protected: /**@name Parameters */ //@{ /** Epsilon for value of coefficients when eliminating slack variables. Default: 0.0. */ double EPS_ELIM; /** Value added to the right hand side of each generated cut to relax it. Default: 1e-11 */ double EPS_RELAX_ABS; /** For a generated cut with right hand side rhs_val, EPS_RELAX_EPS * fabs(rhs_val) is used to relax the constraint. Default: 1e-13 */ double EPS_RELAX_REL; // Maximum ratio between largest and smallest non zero // coefficients in a cut. Default: 1e6. double MAXDYN; /// Minimum violation for the current basic solution in a generated cut. /// Default: 1e-3. double MINVIOL; /// Maximum support - relative part of the formula double MAX_SUPP_REL; /// Use integer slacks to generate cuts if USE_INTSLACKS = 1. Default: 0. int USE_INTSLACKS; /// Norm of a vector is considered zero if smaller than normIsZero; /// Default: 1e-5. double normIsZero_; /// Minimum reduction to accept a new row. double minNormReduction_; /// Maximum sum of the vector of row multipliers to generate a cut int maxSumMultipliers_; /// Normalization factor for the norm of lambda in the quadratic /// minimization problem that is solved during the coefficient reduction step double normalization_; /// Use row only if pivot variable should be integer but is more /// than away_ from being integer. Default: 0.005 double away_; /// Maximum number of rows to use for the reduction of a given row. std::vector numRowsReduction_; /// Column selection method std::vector columnSelectionStrategy_; /// Row selection method std::vector rowSelectionStrategy_; /// Maximum number of rows to use for the reduction during Lift & Project std::vector numRowsReductionLAP_; /// Column selection method for Lift & Project std::vector columnSelectionStrategyLAP_; /// Row selection method for Lift & Project std::vector rowSelectionStrategyLAP_; /// Column scaling strategy for the nonbasics columns that were basic in /// the point that we want to cut off (Lift & Project only) ColumnScalingStrategy columnScalingStrategyLAP_; /// Minimum value for column scaling (Lift & Project only) double columnScalingBoundLAP_; /// Time limit double timeLimit_; /// Maximum number of returned cuts int maxNumCuts_; /// Maximum number of computed cuts int maxNumComputedCuts_; /// Maximum number of nonzeroes in tableau row for reduction int maxNonzeroesTab_; /// Skip simple Gomory cuts int skipGomory_; //@} }; #endif Cgl-0.58.9/src/CglRedSplit2/CglRedSplit2Test.cpp0000644000076600007660000000416312130104734017626 0ustar coincoin#include #include #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglRedSplit2.hpp" void CglRedSplit2UnitTest(const OsiSolverInterface *baseSiP, const std::string mpsDir) { // Test default constructor { CglRedSplit2 aGenerator; } // Test copy & assignment { CglRedSplit2 rhs; { CglRedSplit2 bGenerator; CglRedSplit2 cGenerator(bGenerator); rhs=bGenerator; } } // Test get/set methods { CglRedSplit2 getset; CglRedSplit2Param gsparam = getset.getParam(); double geps = 1.1 * gsparam.getEPS(); gsparam.setEPS(geps); double geps2 = gsparam.getEPS(); assert(geps == geps2); double gepse = 1.1 * gsparam.getEPS_ELIM(); gsparam.setEPS_ELIM(gepse); double gepse2 = gsparam.getEPS_ELIM(); assert(gepse == gepse2); double gmv = 1.1 * gsparam.getMINVIOL(); gsparam.setMINVIOL(gmv); double gmv2 = gsparam.getMINVIOL(); assert(gmv == gmv2); } // Test generateCuts { CglRedSplit2 gct; OsiSolverInterface *siP = baseSiP->clone(); std::string fn = mpsDir+"p0033"; std::string fn2 = mpsDir+"p0033.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(),"mps"); siP->initialSolve(); double lpRelax = siP->getObjValue(); OsiCuts cs; gct.getParam().setMAX_SUPPORT(34); gct.generateCuts(*siP, cs); int nRowCuts = cs.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cs); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); std::cout<<"Initial LP value: "< #include #include #include #include #include "CoinPragma.hpp" #include "CglSimpleRounding.hpp" #include "CoinPackedVector.hpp" #include "CoinSort.hpp" #include "CoinPackedMatrix.hpp" //------------------------------------------------------------- void CglSimpleRounding::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo /*info*/) { int nRows=si.getNumRows(); // number of rows in the coefficient matrix int nCols=si.getNumCols(); // number of columns in the coefficient matrix int rowIndex; // index into the constraint matrix stored in row // order CoinPackedVector irow; // "integer row": working space to hold the integer // <= inequality derived from the rowIndex-th // constraint double b=0; // working space for the rhs of integer <= inequality bool * negative= new bool[nCols]; // negative[i]= true if coefficient of the // ith variable is negative and false // otherwise int k; // dummy iterator variable for ( k=0; kgetVector(rowIndex), irow, b, negative)) { // Reset local data for the next iteration of the rowIndex-loop for(k=0; k=0) { xInt = new int[irow.getNumElements()]; double dxInt; // a double version of xInt for error trapping #ifdef CGL_DEBUG printf("The (double) coefficients and their integer-ized counterparts:\n"); #endif for (k=0; k (dxInt+0.5); // Need to add the 0.5 // so that a dxInt=9.999 will give a xInt=1 #ifdef CGL_DEBUG printf("%g %g \n",irow.getElements()[k],dxInt); #endif } } else { // If overflow is detected, one warning message is printed and // the row is skipped. #ifdef CGL_DEBUG printf("SimpleRounding: Warning: Overflow detected \n"); printf(" on %i of vars in processing row %i. Row skipped.\n", -power, rowIndex); #endif // reset local data for next iteration for(k=0; k epsilon_){ // if the cut and row are different. OsiRowCut rc; rc.setRow(cut.getNumElements(),cut.getIndices(),cut.getElements()); rc.setLb(-COIN_DBL_MAX); rc.setUb(cutRhs); cs.insert(rc); #ifdef CGL_DEBUG printf("Row %i had a simple rounding cut:\n",rowIndex); printf("Cut size: %i Cut rhs: %g Index Element \n", cut.getNumElements(), cutRhs); for (k=0; kepsilon_){ // and the continuous variable has a finite lower bound if (collower[matrixRow.getIndices()[i]] > -si.getInfinity()){ // then replace the variable with its lower bound. b=b-(sign*matrixRow.getElements()[i]*collower[matrixRow.getIndices()[i]]); } else return 0; } // else the coefficient is essentially an explicitly stored zero; do // nothing } // else: the variable is integer else{ // if the integer variable is fixed, net it out of the integer inequality if (colupper[matrixRow.getIndices()[i]]- collower[matrixRow.getIndices()[i]]< epsilon_){ b=b-(sign*matrixRow.getElements()[i]*colupper[matrixRow.getIndices()[i]]); } // else the variable is a free integer variable and it becomes // part of the integer inequality else { irow.insert(matrixRow.getIndices()[i],sign*matrixRow.getElements()[i]); } } } // if there are no free integer variables, then abandon this row; if(irow.getNumElements() == 0){ return 0; } // Store the values and the signs of the coefficients separately. // irow.elements stores the absolute values of the coefficients // negative indicates the sign. // Note: after this point b is essentially the effecitve rhs of a le // contraint { const int s = irow.getNumElements(); const int * indices = irow.getIndices(); double * elements = irow.getElements(); for(i=0; i 0 ); int i; // loop iterator int maxPower=0; // maximum power of 10 used to convert any x[i] to an // integer // this is the number we are after. int power = 0; // power of 10 used to convert a particular x[i] to an // integer #ifdef OLD_MULT double intPart; // the integer part of the number #endif double fracPart; // the fractional part of the number // we keep multiplying by 10 until the fractional part is 0 // (well, really just until the factional part is less than // dataTol) // JJF - code seems to fail sometimes as multiplying by 10 - so // definition of dataTol changed - see header file const double multiplier[16]={1.0,1.0e1,1.0e2,1.0e3,1.0e4,1.0e5, 1.0e6,1.0e7,1.0e8,1.0e9,1.0e10,1.0e11, 1.0e12,1.0e13,1.0e14,1.0e15}; // Loop through every element in the array in x for (i=0; i2147483647) { #ifdef CGL_DEBUG printf("Overflow %g => %g, power %d\n",x[i],scaledValue,power); #endif return -1; } #endif #ifdef CGL_DEBUG printf("The smallest power of 10 to make %g integral = %i\n",x[i],power); #endif // keep track of the largest power needed so that at the end of the for // loop // x[i]*10**maxPower will be integral for all i if (maxPower < power) maxPower=power; } return maxPower; } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglSimpleRounding::CglSimpleRounding () : CglCutGenerator(), epsilon_(1.0e-08) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglSimpleRounding::CglSimpleRounding ( const CglSimpleRounding & source) : CglCutGenerator(source), epsilon_(source.epsilon_) { // Nothing to do here } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglSimpleRounding::clone() const { return new CglSimpleRounding(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglSimpleRounding::~CglSimpleRounding () { // Nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglSimpleRounding & CglSimpleRounding::operator=( const CglSimpleRounding& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); epsilon_=rhs.epsilon_; } return *this; } // Create C++ lines to get to current state std::string CglSimpleRounding::generateCpp( FILE * fp) { CglSimpleRounding other; fprintf(fp,"0#include \"CglSimpleRounding.hpp\"\n"); fprintf(fp,"3 CglSimpleRounding simpleRounding;\n"); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 simpleRounding.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 simpleRounding.setAggressiveness(%d);\n",getAggressiveness()); return "simpleRounding"; } Cgl-0.58.9/src/CglSimpleRounding/CglSimpleRounding.hpp0000644000076600007660000001243212231270555021256 0ustar coincoin// $Id: CglSimpleRounding.hpp 1150 2013-10-21 18:24:45Z tkr $ // 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 CglSimpleRounding_H #define CglSimpleRounding_H #include #include "CglCutGenerator.hpp" #include "CoinPackedMatrix.hpp" /** Simple Rounding Cut Generator Class This class generates simple rounding cuts via the following method: For each contraint, attempt to derive a <= inequality in all integer variables by netting out any continuous variables. Divide the resulting integer inequality through by the greatest common denomimator (gcd) of the lhs coefficients. Round down the rhs. Warning: Use with careful attention to data precision. (Reference: Nemhauser and Wolsey, Integer and Combinatorial Optimization, 1988, pg 211.) */ class CglSimpleRounding : public CglCutGenerator { friend void CglSimpleRoundingUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /**@name Generate Cuts */ //@{ /** Generate simple rounding cuts for the model accessed through the solver interface. Insert generated cuts into the cut set cs. */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglSimpleRounding (); /// Copy constructor CglSimpleRounding ( const CglSimpleRounding &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglSimpleRounding & operator=( const CglSimpleRounding& rhs); /// Destructor virtual ~CglSimpleRounding (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} private: // Private member methods /**@name Private methods */ //@{ /// Derive a <= inequality in integer variables from the rowIndex-th constraint bool deriveAnIntegerRow( const OsiSolverInterface & si, int rowIndex, const CoinShallowPackedVector & matrixRow, CoinPackedVector & irow, double & b, bool * negative) const; /** Given a vector of doubles, x, with size elements and a positive tolerance, dataTol, this method returns the smallest power of 10 needed so that x[i]*10**power "is integer" for all i=0,...,size-1. ** change of definition of dataTol so that it refers to original data, not to scaled data as that seems to lead to problems. So if xScaled is x[i]*10**power and xInt is rounded(xScaled) then fabs(xScaled-xInt) <= dataTol*10**power. This means that dataTol should be smaller - say 1.0e-12 rather tahn 1.0e-8 Returns -number of times overflowed if the power is so big that it will cause overflow (i.e. integer stored will be bigger than 2**31). Test in cut generator. */ int power10ToMakeDoubleAnInt( int size, // the length of the vector x const double * x, double dataTol ) const; // the precision of the data, i.e. the positive // epsilon, which is equivalent to zero /**@name Greatest common denominators methods */ //@{ /// Returns the greatest common denominator of two positive integers, a and b. inline int gcd(int a, int b) const; /** Returns the greatest common denominator of a vector of positive integers, vi, of length n. */ inline int gcdv(int n, const int * const vi) const; //@} //@} /**@name Private member data */ //@{ /// A value within an epsilon_ neighborhood of 0 is considered to be 0. double epsilon_; //@} }; //------------------------------------------------------------------- // Returns the greatest common denominator of two // positive integers, a and b, found using Euclid's algorithm //------------------------------------------------------------------- int CglSimpleRounding::gcd(int a, int b) const { if(a > b) { // Swap a and b int temp = a; a = b; b = temp; } int remainder = b % a; if (remainder == 0) return a; else return gcd(remainder,a); } //------------------------------------------------------------------- // Returns the greatest common denominator of a vector of // positive integers, vi, of length n. //------------------------------------------------------------------- int CglSimpleRounding::gcdv(int n, const int* const vi) const { if (n==0) abort(); if (n==1) return vi[0]; int retval=gcd(vi[0], vi[1]); for (int i=2; i #include "CoinPragma.hpp" #include "CglSimpleRounding.hpp" #include //-------------------------------------------------------------------------- // test the simple rounding cut generators methods. void CglSimpleRoundingUnitTest( const OsiSolverInterface * baseSiP, const std::string mpsDir ) { // Test default constructor { CglSimpleRounding cg; } // Test copy & assignment { CglSimpleRounding rhs; { CglSimpleRounding cg; CglSimpleRounding cgC(cg); rhs=cg; } } // Test gcd and gcdn { CglSimpleRounding cg; int v = cg.gcd(122,356); assert(v==2); v=cg.gcd(356,122); assert(v==2); v=cg.gcd(54,67); assert(v==1); v=cg.gcd(67,54); assert(v==1); v=cg.gcd(485,485); assert(v==485); v=cg.gcd(17*13,17*23); assert( v==17); v=cg.gcd(17*13*5,17*23); assert( v==17); v=cg.gcd(17*13*23,17*23); assert(v==17*23); int a[4] = {12, 20, 32, 400}; v= cg.gcdv(4,a); assert(v== 4); int b[4] = {782, 4692, 51, 2754}; v= cg.gcdv(4,b); assert(v== 17); int c[4] = {50, 40, 30, 10}; v= cg.gcdv(4,c); assert(v== 10); } // Test generate cuts method on exmip1.5.mps { CglSimpleRounding cg; OsiSolverInterface * siP = baseSiP->clone(); std::string fn = mpsDir+"exmip1.5.mps"; siP->readMps(fn.c_str(),""); OsiCuts cuts; cg.generateCuts(*siP,cuts); // there should be 3 cuts int nRowCuts = cuts.sizeRowCuts(); assert(nRowCuts==3); // get the last "sr"=simple rounding cut that was derived OsiRowCut srRowCut2 = cuts.rowCut(2); CoinPackedVector srRowCutPV2 = srRowCut2.row(); // this is what the last cut should look like: i.e. the "solution" const int solSize = 2; int solCols[solSize]={2,3}; double solCoefs[solSize]={5.0, 4.0}; OsiRowCut solRowCut; solRowCut.setRow(solSize,solCols,solCoefs); solRowCut.setLb(-COIN_DBL_MAX); solRowCut.setUb(2.0); // Test for equality between the derived cut and the solution cut // Note: testing two OsiRowCuts are equal invokes testing two // CoinPackedVectors are equal which invokes testing two doubles // are equal. Usually not a good idea to test that two doubles are equal, // but in this cut the "doubles" represent integer values. Also allow that // different solvers have different orderings in packed vectors, which may // not match the ordering defined for solRowCut. assert(srRowCut2.OsiCut::operator==(solRowCut)) ; assert(srRowCut2.row().isEquivalent(solRowCut.row())) ; assert(srRowCut2.lb() == solRowCut.lb()) ; assert(srRowCut2.ub() == solRowCut.ub()) ; delete siP; } // Test generate cuts method on p0033 { CglSimpleRounding cg; OsiSolverInterface * siP = baseSiP->clone(); std::string fn = mpsDir+"p0033"; siP->readMps(fn.c_str(),"mps"); OsiCuts cuts; cg.generateCuts(*siP,cuts); // p0033 is the optimal solution to p0033 int objIndices[14] = { 0, 6, 7, 9, 13, 17, 18, 22, 24, 25, 26, 27, 28, 29 }; CoinPackedVector p0033(14,objIndices,1.0); // test that none of the generated cuts // chops off the optimal solution int nRowCuts = cuts.sizeRowCuts(); OsiRowCut rcut; CoinPackedVector rpv; int i; for (i=0; iinitialSolve(); double lpRelaxBefore=siP->getObjValue(); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("Final LP min=%f\n\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); delete siP; } } Cgl-0.58.9/src/CglStored.hpp0000644000076600007660000000632312130104734014165 0ustar coincoin// $Id: CglStored.hpp 1123 2013-04-06 20:47:24Z stefan $ // 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 CglStored_H #define CglStored_H #include #include "CglCutGenerator.hpp" class CoinWarmStartBasis; class CglTreeProbingInfo; /** Stored Cut Generator Class */ class CglStored : public CglCutGenerator { public: /**@name Generate Cuts */ //@{ /** Generate Mixed Integer Stored cuts for the model of the solver interface, si. Insert the generated cuts into OsiCut, cs. This generator just looks at previously stored cuts and inserts any that are violated by enough */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Change criterion on whether to include cut. Violations of more than this will be added to current cut list (default 1.0e-5) */ //@{ /// Set inline void setRequiredViolation(double value) { requiredViolation_=value;} /// Get inline double getRequiredViolation() const { return requiredViolation_;} /// Takes over ownership of probing info inline void setProbingInfo(CglTreeProbingInfo * info) { probingInfo_ = info;} //@} /**@name Cut stuff */ //@{ /// Add cuts void addCut(const OsiCuts & cs); /// Add a row cut void addCut(const OsiRowCut & cut); /// Add a row cut from a packed vector void addCut(double lb, double ub, const CoinPackedVector & vector); /// Add a row cut from elements void addCut(double lb, double ub, int size, const int * colIndices, const double * elements); inline int sizeRowCuts() const { return cuts_.sizeRowCuts();} const OsiRowCut * rowCutPointer(int index) const { return cuts_.rowCutPtr(index);} /// Save stuff void saveStuff(double bestObjective, const double * bestSolution, const double * lower, const double * upper); /// Best solution (or NULL) inline const double * bestSolution() const { return bestSolution_;} /// Best objective double bestObjective() const; /// Tight lower bounds const double * tightLower() const { return bounds_;} /// Tight upper bounds const double * tightUpper() const { return bounds_+numberColumns_;} //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglStored (int numberColumns=0); /// Copy constructor CglStored (const CglStored & rhs); /// Constructor from file CglStored (const char * fileName); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglStored & operator=(const CglStored& rhs); /// Destructor virtual ~CglStored (); //@} protected: // Protected member methods // Protected member data /**@name Protected member data */ //@{ /// Only add if more than this requiredViolation double requiredViolation_; /// Pointer to probing information CglTreeProbingInfo * probingInfo_; /// Cuts OsiCuts cuts_; /// Number of columns in model int numberColumns_; /// Best solution (objective at end) double * bestSolution_; /// Tight bounds double * bounds_; //@} }; #endif Cgl-0.58.9/src/CglPreProcess/0000755000076600007660000000000012377555671014324 5ustar coincoinCgl-0.58.9/src/CglPreProcess/CglPreProcess.cpp0000644000076600007660000060166512306374722017545 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). #include #include #include #include #include #include #include "CoinPragma.hpp" #include "CglPreProcess.hpp" #include "CglMessage.hpp" #include "OsiRowCut.hpp" #include "OsiColCut.hpp" #include "OsiRowCutDebugger.hpp" #include "CglStored.hpp" #include "CglCutGenerator.hpp" #include "CoinTime.hpp" #include "CoinSort.hpp" #include "CoinBuild.hpp" #include "CoinHelperFunctions.hpp" #include "CoinWarmStartBasis.hpp" #include "CglProbing.hpp" #include "CglDuplicateRow.hpp" #include "CglClique.hpp" //#define COIN_DEVELOP 1 #ifdef COIN_DEVELOP static int whichMps=0; char nameMps[50]; #endif OsiSolverInterface * CglPreProcess::preProcess(OsiSolverInterface & model, bool makeEquality, int numberPasses) { // Tell solver we are in Branch and Cut model.setHintParam(OsiDoInBranchAndCut,true,OsiHintDo) ; // Default set of cut generators CglProbing generator1; generator1.setUsingObjective(true); generator1.setMaxPass(3); generator1.setMaxProbeRoot(model.getNumCols()); generator1.setMaxElements(100); generator1.setMaxLookRoot(50); generator1.setRowCuts(3); // Add in generators addCutGenerator(&generator1); OsiSolverInterface * newSolver = preProcessNonDefault(model,makeEquality ? 1 : 0,numberPasses); // Tell solver we are not in Branch and Cut model.setHintParam(OsiDoInBranchAndCut,false,OsiHintDo) ; if (newSolver) newSolver->setHintParam(OsiDoInBranchAndCut,false,OsiHintDo) ; return newSolver; } static void outSingletons(int & nCol, int & nRow, int * startCol, int * row, double * element, int * startRow, int *column) { int iRow,iCol; bool singletons=false; int * countRow = new int [nRow]; int * countCol = new int [nCol]; int * temp = new int[nRow]; // make row copy memset(countRow,0,nRow*sizeof(int)); memset(countCol,0,nCol*sizeof(int)); for (iCol=0;iCol1); temp[iRow]=newNrow; newNrow++; } } int newNcol=0; int nEl=0; int iNext=0; for (iCol=0;iCol1); int end = start+countCol[iCol]; countCol[iCol]=newNcol; int j; for ( j=start;j=0); row[nEl]=iRow; if (element) element[nEl]=element[j]; nEl++; } newNcol++; startCol[newNcol]=nEl; } } newNrow=0; nEl=0; iNext=0; for (iRow=0;iRow1) { int end = start+countRow[iRow]; int j; for ( j=start;j=0); column[nEl++]=iCol; } newNrow++; startRow[newNrow]=nEl; } } nRow=newNrow; nCol=newNcol; } delete [] countCol; delete [] countRow; delete [] temp; } static int makeIntegers2(OsiSolverInterface * model,int mode) { // See whether we should make variables integer const double *objective = model->getObjCoefficients() ; const double *lower = model->getColLower() ; const double *upper = model->getColUpper() ; const double *rowLower = model->getRowLower() ; const double *rowUpper = model->getRowUpper() ; int numberRows = model->getNumRows() ; double * rhs = new double [numberRows]; int * count = new int [numberRows]; int iColumn; bool makeAll = (mode>1); int numberColumns = model->getNumCols() ; // Column copy of matrix const double * element = model->getMatrixByCol()->getElements(); const int * row = model->getMatrixByCol()->getIndices(); const CoinBigIndex * columnStart = model->getMatrixByCol()->getVectorStarts(); const int * columnLength = model->getMatrixByCol()->getVectorLengths(); // Row copy CoinPackedMatrix matrixByRow(*model->getMatrixByRow()); //const double * elementByRow = matrixByRow.getElements(); const int * column = matrixByRow.getIndices(); const CoinBigIndex * rowStart = matrixByRow.getVectorStarts(); const int * rowLength = matrixByRow.getVectorLengths(); int numberIntegers=1; int totalNumberIntegers=0; while (numberIntegers) { memset(rhs,0,numberRows*sizeof(double)); memset(count,0,numberRows*sizeof(int)); int currentNumber=0; for (iColumn=0;iColumnisInteger(iColumn)) { currentNumber++; for (CoinBigIndex j=start;j1.0e-10) rhs[iRow] = COIN_DBL_MAX; } } else { for (CoinBigIndex j=start;jgetObjSense() ; int numberObj=0; int numberEq=0; int numberEqI=0; int numberZero=0; int numberNonZero=0; if (false) { for (iColumn=0;iColumnlower[iColumn]) { if (!model->isInteger(iColumn)) { CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; int nC=0; for (CoinBigIndex j=start;j1) { nC++; } } if (nC>2) { for (CoinBigIndex j=start;j1) count[iRow]=999999; } } } } } } int * newInts = new int[numberColumns]; // Columns to zap int nColumnZap=0; int * columnZap = new int[numberColumns]; char * noGoodColumn = new char [numberColumns]; memset(noGoodColumn,0,numberColumns); int nNew=0; for (iColumn=0;iColumnlower[iColumn]) { double objValue = objective[iColumn]*direction; bool thisGood=true; if ((objValue||makeAll)&&!model->isInteger(iColumn)) { if (objValue) { numberObj++; } else if (columnLength[iColumn]==1) { continue; // don't bother with singletons } CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; if (objValue>=0.0) { // wants to be as low as possible if (lower[iColumn]<-1.0e10||fabs(lower[iColumn]-floor(lower[iColumn]+0.5))>1.0e-10) { thisGood=false; } else if (upper[iColumn]<1.0e10&&fabs(upper[iColumn]-floor(upper[iColumn]+0.5))>1.0e-10) { thisGood=false; } bool singletonRow=true; bool equality=false; int nC=0; int xxxx=0; bool badCount=false; for (CoinBigIndex j=start;j1) { singletonRow=false; //printf("col %d row%d element %g - row count %d\n",iColumn,iRow,element[j],count[iRow]); if (count[iRow]==999999) badCount=true; if (element[j]==1.0) { if ((xxxx&1)==0) xxxx |= 1; else xxxx = 15; } else { if ((xxxx&2)==0) xxxx |= 2; else xxxx = 15; } nC++; } else if (rowLower[iRow]==rowUpper[iRow]) { equality=true; } double rhsValue = rhs[iRow]; double lowerValue = rowLower[iRow]; double upperValue = rowUpper[iRow]; if (rhsValue<1.0e20) { if(lowerValue>-1.0e20) lowerValue -= rhsValue; if(upperValue<1.0e20) upperValue -= rhsValue; } if (fabs(rhsValue)>1.0e20||fabs(rhsValue-floor(rhsValue+0.5))>1.0e-10 ||fabs(element[j])!=1.0) { // no good thisGood=false; break; } if (element[j]>0.0) { if (lowerValue>-1.0e20&&fabs(lowerValue-floor(lowerValue+0.5))>1.0e-10) { // no good thisGood=false; break; } } else { if (upperValue<1.0e20&&fabs(upperValue-floor(upperValue+0.5))>1.0e-10) { // no good thisGood=false; break; } } } if (!model->isInteger(iColumn)&&false) printf("%d has %d rows with >1 - state network %s interaction %s\n",iColumn,nC,xxxx>3 ? "bad" : "good", badCount ? "too much" : "ok"); // If not good here then mark rows if (!thisGood) { for (CoinBigIndex j=start;jstart+1&&!equality) thisGood=false; // Can we make equality if (end==start+1&&!equality&&false) { numberEq++; int iRow = row[start]; if (element[start]>0.0) model->setRowUpper(iRow,rowLower[iRow]); else model->setRowLower(iRow,rowUpper[iRow]); } } else { // wants to be as high as possible if (upper[iColumn]>1.0e10||fabs(upper[iColumn]-floor(upper[iColumn]+0.5))>1.0e-10) { thisGood=false; } else if (lower[iColumn]>-1.0e10&&fabs(lower[iColumn]-floor(lower[iColumn]+0.5))>1.0e-10) { thisGood=false; } bool singletonRow=true; bool equality=false; for (CoinBigIndex j=start;j1) { singletonRow=false; thisGood=false; } else if (rowLower[iRow]==rowUpper[iRow]) { equality=true; } double rhsValue = rhs[iRow]; double lowerValue = rowLower[iRow]; double upperValue = rowUpper[iRow]; if (rhsValue<1.0e20) { if(lowerValue>-1.0e20) lowerValue -= rhsValue; if(upperValue<1.0e20) upperValue -= rhsValue; } if (fabs(rhsValue)>1.0e20||fabs(rhsValue-floor(rhsValue+0.5))>1.0e-10 ||fabs(element[j])!=1.0) { // no good thisGood=false; break; } if (element[j]<0.0) { if (lowerValue>-1.0e20&&fabs(lowerValue-floor(lowerValue+0.5))>1.0e-10) { // no good thisGood=false; break; } } else { if (upperValue<1.0e20&&fabs(upperValue-floor(upperValue+0.5))>1.0e-10) { // no good thisGood=false; break; } } } if (!singletonRow&&end>start+1&&!equality) thisGood=false; // If not good here then mark rows if (!thisGood) { for (CoinBigIndex j=start;jsetRowUpper(iRow,rowLower[iRow]); else model->setRowLower(iRow,rowUpper[iRow]); } } } else if (objValue) { CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; if (end==start+1) { int iRow = row[start]; if (rowUpper[iRow]>rowLower[iRow]&&!count[iRow]) { if (fabs(rhs[iRow])>1.0e20||fabs(rhs[iRow]-floor(rhs[iRow]+0.5))>1.0e-10 ||fabs(element[start])!=1.0) { // no good } else if (false) { numberEqI++; if (element[start]*objValue>0.0) model->setRowUpper(iRow,rowLower[iRow]); else model->setRowLower(iRow,rowUpper[iRow]); } } } } if (!thisGood) { if (objValue) allGood=false; // look at again columnZap[nColumnZap++]=iColumn; } else if (makeAll&&!model->isInteger(iColumn)&& upper[iColumn]-lower[iColumn]<10) { newInts[nNew++] = iColumn; } } } // Rows to look at int * rowLook = new int[numberRows]; while (nColumnZap) { int nRowLook=0; for (int i=0;ilower[iColumn]&& !model->isInteger(iColumn)) { if (!noGoodColumn[iColumn]) { noGoodColumn[iColumn]=1; columnZap[nColumnZap++]=iColumn; } } } } } } delete [] rowLook; delete [] noGoodColumn; delete [] columnZap; // Final look for (iColumn=0;iColumnlower[iColumn]&& !model->isInteger(iColumn)&&objective[iColumn]) { CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; for (CoinBigIndex j=start;jsetInteger(iColumn); if (objValue) numberNonZero++; else numberZero++; } else if (objValue) { // unable to fix all with obj allGood=false; } } } delete [] newInts; // Can we look at remainder and make any integer if (makeAll&&false) { int nLook=0; int nEl=0; for (iColumn=0;iColumnlower[iColumn]&&!model->isInteger(iColumn)) { CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; bool possible=true; int n=0; for (CoinBigIndex j=start;j1) { if (count[iRow]==999999) { possible=false; break; } else { n++; } } } if (possible) { nLook++; nEl+=n; } } } if (nLook) { int * startC = new int [nLook+1]; int * back = new int [nLook]; int * row2 = new int[nEl]; double * element2 = new double [nEl]; int * backRow = new int [numberRows]; int jRow; for (jRow=0;jRowlower[iColumn]&&!model->isInteger(iColumn)) { CoinBigIndex start = columnStart[iColumn]; CoinBigIndex end = start + columnLength[iColumn]; bool possible=true; int n=0; for (CoinBigIndex j=start;j1) { if (count[iRow]==999999) { possible=false; break; } else { n++; } } } if (!n) possible=false; // may be done later if (possible) { back[nLook]=iColumn; for (CoinBigIndex j=start;j1) { int jRow=backRow[iRow]; if (jRow<0) { // new row backRow[iRow]=nRow; jRow=nRow; nRow++; } element2[nEl]=element[j]; row2[nEl++]=jRow; } } nLook++; startC[nLook]=nEl; } } } // Redo nCol nCol=nLook; delete [] backRow; int * startRow = new int [nRow+1]; int * column2 = new int [nEl]; // take out singletons and do row copy outSingletons(nCol, nRow, startC, row2, element2, startRow, column2); // Decompose int * rowBlock = new int[nRow]; int * stack = new int [nRow]; for (int iRow=0;iRow=0) { if (element2[j]==1.0) { if ((type&1)==0) type |=1; else type=7; } else { assert (element2[j]==-1.0); if ((type&2)==0) type |=2; else type=7; } row2B[nElB++]=iRow; } } if (type!=3) network=false; nColB++; startCB[nColB]=nElB; assert (startCB[nColB]>startCB[nColB-1]+1); } else { whichCol[i]=-1; } } // See if network bool goodInteger=false; if (!network) { // take out singletons outSingletons(nColB, nRowB, startCB, row2B, NULL, startRowC, column2C); // See if totally balanced; int * split = new int [nRowB]; int * best = new int[nRowB]; int * current = new int [nRowB]; int * size = new int [nRowB]; { memset(size,0,nRowB*sizeof(int)); for (i=0;i=0;j--) { if (current[j]>best[j]) { better=true; break; } else if (current[j]=0); // swap for (i=0;i0&&best[i]=0) { whichRow[iRow]=newSet+1+nRowB; } } nSet += nMore; memset(size,0,nSet*sizeof(int)); for (i=0;i=nRowB) { // has 1 - correct it iSet -= nRowB; } else { // 0 part of split set or not split iSet=current[iSet]; } whichRow[i]=iSet; size[iSet]++; } } nLeft--; } if (nSet0;i--) { int j; for (j=startCC[i];jiRow&&!split[jRow]) { // bad goodInteger=false; break; } } } } } if (!goodInteger) break; for (j=startCC[i];jsetInteger(iBack); } } } delete [] startRowC; delete [] column2C; delete [] startCB; delete [] row2B; delete [] startCC; delete [] row2C; delete [] whichRow; delete [] whichCol; } delete [] startRow; delete [] column2; delete [] element2; delete [] startC; delete [] row2; delete [] back; } } numberIntegers=numberNonZero; if (allGood&&numberObj) { #ifdef COIN_DEVELOP int numberPossible = 0; #endif for (iColumn=0;iColumnlower[iColumn]&&objective[iColumn]&&!model->isInteger(iColumn)) { #ifdef COIN_DEVELOP numberPossible++; #endif if (upper[iColumn]<=lower[iColumn]+10) { model->setInteger(iColumn); numberIntegers++; } } } #ifdef COIN_DEVELOP printf("ZZZZYY CglPreProcess analysis says all (%d) continuous with costs could be made integer - %d were\n",numberPossible,numberIntegers-numberNonZero); #endif } #ifdef COIN_DEVELOP if (numberZero) printf("ZZZZYY %d continuous with zero cost were made integer\n",numberZero); #endif numberIntegers += numberZero; #ifdef COIN_DEVELOP if (numberEq||numberEqI) printf("ZZZZYY %d rows made equality from continuous, %d from integer\n",numberEq,numberEqI); #endif totalNumberIntegers += numberIntegers; if (!makeAll) numberIntegers=0; } delete [] rhs; delete [] count; return (totalNumberIntegers); } //#define CGL_WRITEMPS #ifdef CGL_WRITEMPS extern double * debugSolution; extern int debugNumberColumns; static int mpsNumber=0; static void writeDebugMps(const OsiSolverInterface * solver, const char * where, OsiPresolve * pinfo) { mpsNumber++; char name[20]; sprintf(name,"presolve%2.2d.mps",mpsNumber); printf("saving %s from %s\n",name,where); solver->writeMpsNative(name,NULL,NULL,0,1,0); if (pinfo&&debugSolution) { int n = solver->getNumCols(); if (noriginalColumns(); if (!original) { printf("No original columns\n"); abort(); } for (int i=0;iclone(); const double * lower = newSolver->getColLower(); const double * upper = newSolver->getColUpper(); for (int i = 0; iisInteger(i)) { double value = floor(debugSolution[i]+0.5); if (valueupper[i]) { printf("Bad value %d - %g %g %g\n",i,lower[i],debugSolution[i], upper[i]); } else { newSolver->setColLower(i,value); newSolver->setColUpper(i,value); } } } printf("Starting solve %d\n",mpsNumber); newSolver->resolve(); printf("Ending solve %d - status %s obj %g\n",mpsNumber, newSolver->isProvenOptimal() ? "ok" : "bad", newSolver->getObjValue()); delete newSolver; } } #else #define writeDebugMps(x,y,z) #endif OsiSolverInterface * CglPreProcess::preProcessNonDefault(OsiSolverInterface & model, int makeEquality, int numberPasses, int tuning) { #if 0 bool rcdActive = true ; std::string modelName ; model.getStrParam(OsiProbName,modelName) ; std::cout << " Attempting to activate row cut debugger for " << modelName << " ... " ; writeDebugMps(&model,"IPP:preProcessNonDefault",0) ; model.activateRowCutDebugger(modelName.c_str()) ; if (model.getRowCutDebugger()) std::cout << "on optimal path." << std::endl ; else if (model.getRowCutDebuggerAlways()) std::cout << "not on optimal path." << std::endl ; else { std::cout << "failure." << std::endl ; rcdActive = false ; } if (rcdActive) { const OsiRowCutDebugger *debugger = model.getRowCutDebuggerAlways() ; std::cout << " Optimal solution is:" << std::endl ; debugger->printOptimalSolution(model) ; } # endif originalModel_ = & model; numberSolvers_ = numberPasses; model_ = new OsiSolverInterface * [numberSolvers_]; modifiedModel_ = new OsiSolverInterface * [numberSolvers_]; presolve_ = new OsiPresolve * [numberSolvers_]; for (int i=0;iclone(); CoinPackedMatrix matrixByRow(*originalModel_->getMatrixByRow()); int numberRows = originalModel_->getNumRows(); if (rowType_) assert (numberRowType_==numberRows); int numberColumns = originalModel_->getNumCols(); //int originalNumberColumns=numberColumns; int minimumLength = 5; int numberModifiedPasses=10; if (numberPasses<=1) numberModifiedPasses=1; // lightweight preprocessing else if (numberPasses<=2) numberModifiedPasses=2; // fairly lightweight preprocessing if (tuning>=10000) { numberModifiedPasses=(tuning-10000)/10000; tuning %= 10000; //minimumLength = tuning; } //bool heavyProbing = (tuning&1)!=0; int makeIntegers = (tuning&6)>>1; // See if we want to do initial presolve int doInitialPresolve = (tuning&8)>>3; if (numberSolvers_<2) doInitialPresolve=0; // We want to add columns int numberSlacks=0; int * rows = new int[numberRows]; double * element =new double[numberRows]; int iRow; int numberCliques=0; int * which = new int[numberColumns]; // Statistics int totalP1=0,totalM1=0; int numberFixed=0; // May just find it is infeasible bool feasible=true; // Row copy const double * elementByRow = matrixByRow.getElements(); const int * column = matrixByRow.getIndices(); const CoinBigIndex * rowStart = matrixByRow.getVectorStarts(); const int * rowLength = matrixByRow.getVectorLengths(); const double * lower = originalModel_->getColLower(); const double * upper = originalModel_->getColUpper(); const double * rowLower = originalModel_->getRowLower(); const double * rowUpper = originalModel_->getRowUpper(); // Clean bounds int iColumn; for (iColumn=0;iColumnisInteger(iColumn)) { double lo = CoinMax(lower[iColumn],ceil(lower[iColumn]-1.0e-6)); if (lo>lower[iColumn]) originalModel_->setColLower(iColumn,lo); double up = CoinMin(upper[iColumn],floor(upper[iColumn]+1.0e-6)); if (upsetColUpper(iColumn,up); if (lo>up) feasible=false; } } bool allToGub = makeEquality==5; if (allToGub) makeEquality=3; // Initialize random seed CoinThreadRandom randomGenerator(987654321); bool justOnesWithObj=false; if (makeEquality==2||makeEquality==3||makeEquality==4) { int iRow, iColumn; int numberIntegers = 0; for (iColumn=0;iColumnisInteger(iColumn)) numberIntegers++; } // Look for possible SOS int numberSOS=0; int * mark = new int[numberColumns]; CoinFillN(mark,numberColumns,-1); int numberOverlap=0; int numberInSOS=0; // See if worthwhile creating accumulation variables int firstOther=numberRows; int * whichRow = new int[numberRows]; for (iRow=0;iRowisInteger(iColumn)||lower[iColumn]) { goodRow=false; break; } if (mark[iColumn]>=0) { overlap=true; numberOverlap++; } } if (goodRow) { if (!overlap) { // mark all for (int j=rowStart[iRow];j=5) { firstOther--; whichRow[firstOther]=iRow; } } } } if (makeEquality==2&&false) { if(numberOverlap||numberIntegers>numberInSOS+1) { // try just ones with costs CoinFillN(mark,numberColumns,-1); numberOverlap=0; numberInSOS=0; bool allCostsInSOS=true; const double *objective = originalModel_->getObjCoefficients() ; for (iRow=0;iRow=5) { bool goodRow=true; bool overlap=false; int nObj=0; for (int j=rowStart[iRow];jisInteger(iColumn)||lower[iColumn]) { goodRow=false; } if (objective[iColumn]) nObj++; if (mark[iColumn]>=0) { overlap=true; numberOverlap++; } } if (nObj&&nObj>=rowLength[iRow]-1) { if (goodRow) { if (!overlap) { // mark all for (int j=rowStart[iRow];j=0) nGoodObj++; else nBadObj++; } } if (nBadObj*10(startModel_->getMatrixByCol()); // Column copy const int * row = matrixByColumn->getIndices(); const CoinBigIndex * columnStart = matrixByColumn->getVectorStarts(); const int * columnLength = matrixByColumn->getVectorLengths(); double * columnElements = matrixByColumn->getMutableElements(); int * rowCount = new int[numberRows]; memset(rowCount,0,numberRows*sizeof(int)); double * rowValue = new double [numberRows]; int numberY=0; int numberElements=0; int numberSOS=0; for (int kRow=firstOther;kRow0) { if (value!=rowValue[jRow]) rowCount[jRow]=-1; // no good else rowCount[jRow]++; } else if (!rowCount[jRow]) { whichRow[n++]=jRow; rowCount[jRow]=1; rowValue[jRow]=value; } } } } int bestRow=-1; int bestCount=4; for (j=0;j=5) { numberY++; numberElements+=count; } if (count>bestCount) { // possible bestRow=jRow; bestCount=count; } } if (bestRow>=0) { numberSOS++; numberY++; numberElements+=bestCount; } } if (numberY) { // Some may be duplicates // make sure ordered matrixByRow.orderMatrix(); elementByRow = matrixByRow.getElements(); column = matrixByRow.getIndices(); rowStart = matrixByRow.getVectorStarts(); rowLength = matrixByRow.getVectorLengths(); CoinBigIndex * newStart = new CoinBigIndex[numberY+1]; int * newColumn = new int [numberElements]; double * newValue = new double [numberElements]; double * hash = new double [numberY]; double * hashColumn = new double [numberColumns]; int i; for (i=0;igetColSolution(),numberColumns*sizeof(double)); memset(rowCount,0,numberRows*sizeof(int)); // List of SOS entries to zero out CoinBigIndex * where = new CoinBigIndex[numberColumns]; numberY=0; numberElements=0; int numberElementsY=0; newStart[0]=0; for (int kRow=firstOther;kRow0) { if (value!=rowValue[jRow]) rowCount[jRow]=-1; // no good else rowCount[jRow]++; } else if (!rowCount[jRow]) { whichRow[n++]=jRow; rowCount[jRow]=1; rowValue[jRow]=value; assert (value); } } } } for (i=0;i=5) { //assert (countsaveNumberY) rowCount[iRow]=-1000; } delete [] hash; delete [] hashColumn; matrixByColumn->cleanMatrix(); // Now add rows double * rhs = new double[numberY]; memset(rhs,0,numberY*sizeof(double)); startModel_->addRows(numberY,newStart,newColumn,newValue,rhs,rhs); delete [] rhs; delete [] newStart; delete [] newColumn; delete [] newValue; delete [] where; // Redo matrix CoinPackedMatrix add(true,rowY,columnY,valueY,numberElementsY); delete [] valueY; delete [] rowY; delete [] columnY; const int * row = add.getIndices(); const CoinBigIndex * columnStart = add.getVectorStarts(); //const int * columnLength = add.getVectorLengths(); double * columnElements = add.getMutableElements(); double * lo = new double [numberY]; double * up = new double [numberY]; for (i=0;iaddCols(numberY,columnStart,row,columnElements,lo,up,NULL); delete [] lo; delete [] up; for (i=0;isetInteger(i+numberColumns); CoinWarmStartBasis* basis = dynamic_cast (startModel_->getWarmStart()) ; if (basis) { for (i=0;isetArtifStatus(i+numberRows,CoinWarmStartBasis::atLowerBound); basis->setStructStatus(i+numberColumns,CoinWarmStartBasis::basic); } startModel_->setWarmStart(basis); delete basis; } startModel_->setColSolution(newSolution); delete [] newSolution; writeDebugMps(startModel_,"start",NULL); if (numberElements<10*CoinMin(numberColumns,100*numberY)) { handler_->message(CGL_ADDED_INTEGERS,messages_) <getHintParam(OsiDoDualInResolve, saveTakeHint,saveStrength); startModel_->setHintParam(OsiDoDualInResolve,false,OsiHintTry); startModel_->resolve(); numberIterationsPre_ += startModel_->getIterationCount(); startModel_->setHintParam(OsiDoDualInResolve,saveTakeHint,saveStrength); } else { // not such a good idea? delete startModel_; startModel_=NULL; } } delete [] rowValue; delete [] rowCount; } if (makeEquality==4) { makeEquality=0; #if 1 // Try and make continuous variables integer // make clone if (!startModel_) startModel_ = originalModel_->clone(); makeInteger(); #endif } delete [] whichRow; delete [] mark; if (numberSOS) { if (makeEquality==2) { if(numberOverlap||numberIntegers>numberInSOS+1) { handler_->message(CGL_PROCESS_SOS2,messages_) <getColLower(); upper = originalModel_->getColUpper(); rowLower = originalModel_->getRowLower(); rowUpper = originalModel_->getRowUpper(); } // See if all + 1 bool allPlusOnes=true; int nPossible=0; int numberMadeEquality=0; for (iRow=0;iRowisBinary(iColumn)) { good = false; possibleSlack=false; //break; } else { numberTotal++; } if (fabs(value-floor(value+0.5))>1.0e-12) possibleSlack=false;; if (fabs(value)!=1.0) { good=false; allPlus=false; } else if (value>0.0) { which[numberP1++]=iColumn; } else { numberM1++; which[numberColumns-numberM1]=iColumn; allPlus=false; } } if (possibleSlack) { if(upperValue>1.0e20&&lowerValue>-1.0e12) { possibleSlack = (fabs(lowerValue-floor(lowerValue+0.5))<1.0e-12); } else if(lowerValue<-1.0e20&&upperValue<1.0e12) { possibleSlack = (fabs(upperValue-floor(upperValue+0.5))<1.0e-12); } else { possibleSlack=false; } } if (allPlus) nPossible++; int iUpper = static_cast (floor(upperValue+1.0e-5)); int iLower = static_cast (ceil(lowerValue-1.0e-5)); int state=0; if (upperValue<1.0e6) { if (iUpper==1-numberM1) state=1; else if (iUpper==-numberM1) state=2; else if (iUpper<-numberM1) state=3; if (fabs((static_cast (iUpper))-upperValue)>1.0e-9) state =-1; } if (!state&&lowerValue>-1.0e6) { if (-iLower==1-numberP1) state=-1; else if (-iLower==-numberP1) state=-2; else if (-iLower<-numberP1) state=-3; if (fabs((static_cast (iLower))-lowerValue)>1.0e-9) state =-1; } if (good&&state>0) { if (abs(state)==3) { // infeasible feasible=false; break; } else if (abs(state)==2) { // we can fix all numberFixed += numberP1+numberM1; int i; if (state>0) { // fix all +1 at 0, -1 at 1 for (i=0;isetColUpper(which[i],0.0); for (i=0;isetColLower(which[numberColumns-i-1],1.0); } else { // fix all +1 at 1, -1 at 0 for (i=0;isetColLower(which[i],1.0); for (i=0;isetColUpper(which[numberColumns-i-1],0.0); } } else { if (!makeEquality||(makeEquality==-1&&numberM1+numberP10) { totalP1 += numberP1; totalM1 += numberM1; } else { totalP1 += numberM1; totalM1 += numberP1; } } } if (possibleSlack&&makeEquality==-2&&(!good||state<=0)) { if (numberTotalnumberRows; delete [] which; if (!feasible) { handler_->message(CGL_INFEASIBLE,messages_) <message(CGL_CLIQUES,messages_) <(totalP1+totalM1))/ (static_cast (numberCliques)) <message(CGL_FIXED,messages_) <message(CGL_SLACKS,messages_) <clone(); } for (int i=0;i=numberRows) { // just a slack not a clique upperValue=COIN_DBL_MAX; iRow -= numberRows; } CoinPackedVector column(1,&iRow,&value); startModel_->addCol(column,lowerValue,upperValue,objValue); // set integer startModel_->setInteger(numberColumns+i); if (value >0) startModel_->setRowLower(iRow,rowUpper[iRow]); else startModel_->setRowUpper(iRow,rowLower[iRow]); } } else if (!startModel_) { // make clone anyway so can tighten bounds startModel_ = originalModel_->clone(); } // move objective to integers or to aggregated lower = startModel_->getColLower(); upper = startModel_->getColUpper(); rowLower = startModel_->getRowLower(); rowUpper = startModel_->getRowUpper(); matrixByRow = CoinPackedMatrix(*startModel_->getMatrixByRow()); elementByRow = matrixByRow.getElements(); column = matrixByRow.getIndices(); rowStart = matrixByRow.getVectorStarts(); rowLength = matrixByRow.getVectorLengths(); char * marked = new char [numberColumns]; memset(marked,0,numberColumns); numberRows=startModel_->getNumRows(); numberColumns=startModel_->getNumCols(); //CoinPackedMatrix * matrixByColumn = const_cast(startModel_->getMatrixByCol()); // Column copy //const int * row = matrixByColumn->getIndices(); //const CoinBigIndex * columnStart = matrixByColumn->getVectorStarts(); //const int * columnLength = startModel_->getMatrixByCol()->getVectorLengths(); //const double * columnElements = matrixByColumn->getElements(); double * obj = CoinCopyOfArray(startModel_->getObjCoefficients(),numberColumns); double offset; int numberMoved=0; startModel_->getDblParam(OsiObjOffset,offset); for (iRow=0;iRowlower[iColumn]) { if (startModel_->isInteger(iColumn)) { #if 0 if (columnLength[iColumn]==1) { if (value==1.0) { } } if (value!=floor(value+0.5)) allInteger=false; if (allInteger&&fabs(value)<1.0e8) { if (!multiple) multiple = static_cast (fabs(value)); else if (multiple>0) multiple = gcd(multiple,static_cast (fabs(value))); } else { allInteger=false; } #endif } else { numberContinuous++; } if (value>0.0) { if (nPlus>0&&value!=valuePlus) { nPlus = - numberColumns; } else if (!nPlus) { nPlus=1; iPlus=iColumn; valuePlus=value; } else { nPlus++; } } else { if (nMinus>0&&value!=valueMinus) { nMinus = - numberColumns; } else if (!nMinus) { nMinus=1; iMinus=iColumn; valueMinus=value; } else { nMinus++; } } } else { rhs -= lower[iColumn]*value; } } if (((nPlus==1&&startModel_->isInteger(iPlus)&&nMinus>0)|| (nMinus==1&&startModel_->isInteger(iMinus)&&nPlus>0))&&numberContinuous&&true) { int jColumn; double multiplier; if (nPlus==1) { jColumn = iPlus; multiplier = fabs(valuePlus/valueMinus); rhs /= -valueMinus; } else { jColumn = iMinus; multiplier = fabs(valueMinus/valuePlus); rhs /= valuePlus; } double smallestPos=COIN_DBL_MAX; double smallestNeg=-COIN_DBL_MAX; for (CoinBigIndex j=rowStart[iRow];jlower[iColumn]) { if (objValue>=0.0) smallestPos=CoinMin(smallestPos,objValue); else smallestNeg=CoinMax(smallestNeg,objValue); } } } if (smallestPos>0.0) { double move=0.0; if(smallestNeg==-COIN_DBL_MAX) move=smallestPos; else if (smallestPos==COIN_DBL_MAX) move=smallestNeg; if (move) { // can move objective numberMoved++; #ifdef COIN_DEVELOP if (rhs) printf("ZZZ on col %d move %g offset %g\n", jColumn,move,move*rhs); #endif offset += move*rhs; for (CoinBigIndex j=rowStart[iRow];jlower[iColumn]) { obj[iColumn] -= move; } } else { obj[jColumn] += move*multiplier; } } } } } } #ifdef COIN_DEVELOP if (numberMoved) printf("ZZZ %d costs moved\n",numberMoved); #endif startModel_->setDblParam(OsiObjOffset,offset); startModel_->setObjective(obj); delete [] obj; delete [] marked; delete [] rows; delete [] element; if (makeIntegers) { makeIntegers2(startModel_,makeIntegers); } int infeas=0; OsiSolverInterface * startModel2 = startModel_; // Do we want initial presolve if (doInitialPresolve) { assert (doInitialPresolve==1); OsiSolverInterface * presolvedModel; OsiSolverInterface * oldModel = startModel2; OsiPresolve * pinfo = new OsiPresolve(); int presolveActions=0; // Allow dual stuff on integers // Allow stuff which may not unroll cleanly presolveActions=1+16; if ((tuning&32)!=0) presolveActions |= 32; // Do not allow all +1 to be tampered with //if (allPlusOnes) //presolveActions |= 2; // allow transfer of costs // presolveActions |= 4; // If trying for SOS don't allow some transfers if (makeEquality==2||makeEquality==3) presolveActions |= 8; pinfo->setPresolveActions(presolveActions); if (prohibited_) assert (numberProhibited_==oldModel->getNumCols()); int saveLogLevel = oldModel->messageHandler()->logLevel(); if (saveLogLevel==1) oldModel->messageHandler()->setLogLevel(0); std::string solverName; oldModel->getStrParam(OsiSolverName,solverName); // Extend if you want other solvers to keep solution bool keepSolution=solverName=="clp"; // Should not be hardwired tolerance - temporary fix #ifndef CGL_PREPROCESS_TOLERANCE #define CGL_PREPROCESS_TOLERANCE 1.0e-7 #endif // So standalone version can switch off double feasibilityTolerance = ((tuning&1024)==0) ? CGL_PREPROCESS_TOLERANCE : 1.0e-4; presolvedModel = pinfo->presolvedModel(*oldModel,feasibilityTolerance,true,5,prohibited_,keepSolution,rowType_); oldModel->messageHandler()->setLogLevel(saveLogLevel); if (presolvedModel) { presolvedModel->messageHandler()->setLogLevel(saveLogLevel); //presolvedModel->writeMps("new"); writeDebugMps(presolvedModel,"ordinary",pinfo); // update prohibited and rowType update(pinfo,presolvedModel); if (!presolvedModel->getNumRows()) { doInitialPresolve=0; delete presolvedModel; delete pinfo; } else { model_[0]=presolvedModel; presolve_[0]=pinfo; modifiedModel_[0]=presolvedModel->clone(); startModel2 = modifiedModel_[0]; } } else { infeas=1; doInitialPresolve=0; delete presolvedModel; delete pinfo; } } // tighten bounds /* Virtuous solvers may require a refresh via initialSolve if this call is ever changed to give a nonzero value to the (default) second parameter. Previous actions may have made significant changes to the constraint system. Safe as long as tightenPrimalBounds doesn't ask for the current solution. */ if (!infeas&&true) { // may be better to just do at end writeDebugMps(startModel2,"before",NULL); infeas = tightenPrimalBounds(*startModel2); writeDebugMps(startModel2,"after",NULL); } if (infeas) { handler_->message(CGL_INFEASIBLE,messages_) <initialSolve(); assert (newSolver->isProvenOptimal()); //printf("new size %d rows, %d columns\n", // newSolver->getNumRows(),newSolver->getNumCols()); } } { // Give a hint to do dual bool saveTakeHint; OsiHintStrength saveStrength; startModel2->getHintParam(OsiDoDualInInitial, saveTakeHint,saveStrength); startModel2->setHintParam(OsiDoDualInInitial,true,OsiHintTry); startModel2->initialSolve(); numberIterationsPre_ += startModel2->getIterationCount(); // double check if (!startModel2->isProvenOptimal()) { if (!startModel2->isProvenDualInfeasible()) { // Do presolves bool saveHint; OsiHintStrength saveStrength; startModel2->getHintParam(OsiDoPresolveInInitial,saveHint,saveStrength); startModel2->setHintParam(OsiDoPresolveInInitial,true,OsiHintTry); startModel2->setHintParam(OsiDoDualInInitial,false,OsiHintTry); startModel2->initialSolve(); numberIterationsPre_ += startModel2->getIterationCount(); if (!startModel2->isProvenDualInfeasible()) { CoinWarmStart * empty = startModel2->getEmptyWarmStart(); startModel2->setWarmStart(empty); delete empty; startModel2->setHintParam(OsiDoDualInInitial,true,OsiHintTry); startModel2->initialSolve(); numberIterationsPre_ += startModel2->getIterationCount(); } startModel2->setHintParam(OsiDoPresolveInInitial,saveHint,saveStrength); } } startModel2->setHintParam(OsiDoDualInInitial,saveTakeHint,saveStrength); } if (!startModel2->isProvenOptimal()) { if (!startModel2->isProvenDualInfeasible()) { handler_->message(CGL_INFEASIBLE,messages_)<< CoinMessageEol ; #ifdef COIN_DEVELOP startModel2->writeMps("infeas"); #endif } else { handler_->message(CGL_UNBOUNDED,messages_)<< CoinMessageEol ; } return NULL; } reducedCostFix(*startModel2); if (!numberSolvers_) { // just fix OsiSolverInterface * newModel = modified(startModel2,false,numberChanges,0,numberModifiedPasses); if (startModel_!=originalModel_) delete startModel_; if (startModel2!=startModel_) delete startModel2; startModel_=newModel; returnModel=startModel_; } else { OsiSolverInterface * presolvedModel; OsiSolverInterface * oldModel = startModel2; if (doInitialPresolve) oldModel = modifiedModel_[0]; //CglDuplicateRow dupCuts(oldModel); //dupCuts.setLogLevel(1); // If +1 try duplicate rows #define USECGLCLIQUE 512 if ((options_&8)!=0) tuning &= ~USECGLCLIQUE; if ((options_&4)!=0) allPlusOnes=false; if (allPlusOnes||(tuning&USECGLCLIQUE)!=0) { #if 1 // put at beginning int nAdd= ((tuning&(64+USECGLCLIQUE))==64+USECGLCLIQUE&&allPlusOnes) ? 2 : 1; CglCutGenerator ** temp = generator_; generator_ = new CglCutGenerator * [numberCutGenerators_+nAdd]; memcpy(generator_+nAdd,temp,numberCutGenerators_*sizeof(CglCutGenerator *)); delete[] temp ; numberCutGenerators_+=nAdd; if (nAdd==2||(tuning&USECGLCLIQUE)!=0) { CglClique * cliqueGen=new CglClique(false,true); cliqueGen->setStarCliqueReport(false); cliqueGen->setRowCliqueReport(false); if ((tuning&USECGLCLIQUE)==0) cliqueGen->setMinViolation(-2.0); else cliqueGen->setMinViolation(-3.0); generator_[0]=cliqueGen; } if (allPlusOnes) { CglDuplicateRow * dupCuts =new CglDuplicateRow(oldModel); if ((tuning&256)!=0) dupCuts->setMaximumDominated(numberColumns); generator_[nAdd-1]=dupCuts; } #else CglDuplicateRow dupCuts(oldModel); addCutGenerator(&dupCuts); #endif } for (int iPass=doInitialPresolve;iPassgetColLower(); const double * columnUpper = oldModel->getColUpper(); const CoinPackedMatrix * rowCopy = oldModel->getMatrixByRow(); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * rowElements = rowCopy->getElements(); const CoinPackedMatrix * columnCopy = oldModel->getMatrixByCol(); //const int * row = columnCopy->getIndices(); //const CoinBigIndex * columnStart = columnCopy->getVectorStarts(); const int * columnLength = columnCopy->getVectorLengths(); //const double * columnElements = columnCopy->getElements(); const double * rowLower = oldModel->getRowLower(); const double * rowUpper = oldModel->getRowUpper(); const double * objective = oldModel->getObjCoefficients(); double direction = oldModel->getObjSense(); int numberRows = oldModel->getNumRows(); for (int iRow=0;iRow1.0e20)) { CoinBigIndex start = rowStart[iRow]; int iColumn1 = column[start]; int iColumn2 = column[start+1]; double value1 = rowElements[start]; double value2 = rowElements[start+1]; double upper; if (rowLower[iRow]<-1.0e20) { if (rowUpper[iRow]<1.0e20) upper = rowUpper[iRow]; else continue; // free row } else { upper = - rowLower[iRow]; value1=-value1; value2=-value2; } //for now just singletons bool integer1 = oldModel->isInteger(iColumn1); bool integer2 = oldModel->isInteger(iColumn2); int debug=0; if (columnLength[iColumn1]==1) { if (integer1) { debug=0;// no good } else if (integer2) { // possible debug=1; } } else if (columnLength[iColumn2]==1) { if (integer2) { debug=-1; // print and skip } else if (integer1) { // possible debug=1; double valueD = value1; value1 = value2; value2 = valueD; int valueI = iColumn1; iColumn1 = iColumn2; iColumn2 = valueI; bool valueB = integer1; integer1 = integer2; integer2 = valueB; } } if (debug&&0) { printf("%d %d elements%selement %g and %d %d elements%selement %g <= %g\n", iColumn1,columnLength[iColumn1],integer1 ? " (integer) " : " ",value1, iColumn2,columnLength[iColumn2],integer2 ? " (integer) " : " ",value2, upper); } if (debug>0) { if (value1>0.0&&objective[iColumn1]*direction<0.0) { // will push as high as possible so make == // highest effective rhs if (value2>0) upper -= value2 * columnLower[iColumn2]; else upper -= value2 * columnUpper[iColumn2]; if (columnUpper[iColumn1]>1.0e20|| columnUpper[iColumn1]*value1>=upper) { //printf("looks possible\n"); // make equality if (rowLower[iRow]<-1.0e20) oldModel->setRowLower(iRow,rowUpper[iRow]); else oldModel->setRowUpper(iRow,rowLower[iRow]); } else { // may be able to make integer // may just be better to use to see objective integral if (upper==floor(upper)&&value2==floor(value2)&& value1==floor(value1)&&objective[iColumn1]==floor(objective[iColumn1])) oldModel->setInteger(iColumn1); //printf("odd3\n"); } } else if (value1<0.0&&objective[iColumn1]*direction>0.0) { //printf("odd4\n"); } else { //printf("odd2\n"); } } else if (debug<0) { //printf("odd1\n"); } } } } OsiPresolve * pinfo = new OsiPresolve(); int presolveActions=0; // Allow dual stuff on integers // Allow stuff which may not unroll cleanly presolveActions=1+16; // Do not allow all +1 to be tampered with //if (allPlusOnes) //presolveActions |= 2; // allow transfer of costs // presolveActions |= 4; // If trying for SOS don't allow some transfers if (makeEquality==2||makeEquality==3) presolveActions |= 8; pinfo->setPresolveActions(presolveActions); if (prohibited_) assert (numberProhibited_==oldModel->getNumCols()); /* VIRTUOUS but possible bad for performance At this point, the solution is most likely stale: we may have added cuts as we left the previous call to modified(), or we may have changed row bounds in VUB analysis just above. Continuous presolve doesn't need a solution unless we want it to transform the current solution to match the presolved model. */ int saveLogLevel = oldModel->messageHandler()->logLevel(); if (saveLogLevel==1) oldModel->messageHandler()->setLogLevel(0); std::string solverName; oldModel->getStrParam(OsiSolverName,solverName); // Extend if you want other solvers to keep solution bool keepSolution=solverName=="clp"; presolvedModel = pinfo->presolvedModel(*oldModel,CGL_PREPROCESS_TOLERANCE,true,5, prohibited_,keepSolution,rowType_); oldModel->messageHandler()->setLogLevel(saveLogLevel); if (!presolvedModel) { returnModel=NULL; delete pinfo; break; } presolvedModel->messageHandler()->setLogLevel(saveLogLevel); // update prohibited and rowType update(pinfo,presolvedModel); writeDebugMps(presolvedModel,"ordinary2",pinfo); model_[iPass]=presolvedModel; presolve_[iPass]=pinfo; if (!presolvedModel->getNumRows()) { // was returnModel=oldModel; returnModel=presolvedModel; numberSolvers_=iPass+1; break; // model totally solved } bool constraints = iPassgetHintParam(OsiDoDualInInitial, saveTakeHint,saveStrength); //if (iPass) presolvedModel->setHintParam(OsiDoDualInInitial,false,OsiHintTry); presolvedModel->initialSolve(); numberIterationsPre_ += presolvedModel->getIterationCount(); presolvedModel->setHintParam(OsiDoDualInInitial,saveTakeHint,saveStrength); if (!presolvedModel->isProvenOptimal()) { writeDebugMps(presolvedModel,"bad2",NULL); CoinWarmStartBasis *slack = dynamic_cast(presolvedModel->getEmptyWarmStart()) ; presolvedModel->setWarmStart(slack); delete slack ; presolvedModel->resolve(); if (!presolvedModel->isProvenOptimal()) { returnModel=NULL; //printf("infeasible\n"); break; } else { //printf("feasible on second try\n"); } } // maybe we can fix some int numberFixed = reducedCostFix(*presolvedModel); #ifdef COIN_DEVELOP if (numberFixed) printf("%d variables fixed on reduced cost\n",numberFixed); #endif OsiSolverInterface * newModel = modified(presolvedModel,constraints,numberChanges,iPass-doInitialPresolve,numberModifiedPasses); returnModel=newModel; if (!newModel) { break; } modifiedModel_[iPass]=newModel; oldModel=newModel; writeDebugMps(newModel,"ordinary3",NULL); if (!numberChanges&&!numberFixed) { #ifdef COIN_DEVELOP printf("exiting after pass %d of %d\n",iPass,numberSolvers_); #endif numberSolvers_=iPass+1; break; } } } if (returnModel) { if (returnModel->getNumRows()) { // tighten bounds int infeas = tightenPrimalBounds(*returnModel); if (infeas) { delete returnModel; for (int iPass=0;iPassmessage(CGL_INFEASIBLE,messages_) <getNumCols(); for (iColumn=0;iColumnisInteger(iColumn)) numberIntegers++; } } if ((makeEquality==2||makeEquality==3)&&numberCliques&&returnModel) { int iRow, iColumn; int numberColumns = returnModel->getNumCols(); int numberRows = returnModel->getNumRows(); const double * objective = returnModel->getObjCoefficients(); // get row copy const CoinPackedMatrix * matrix = returnModel->getMatrixByRow(); const double * element = matrix->getElements(); const int * column = matrix->getIndices(); const CoinBigIndex * rowStart = matrix->getVectorStarts(); const int * rowLength = matrix->getVectorLengths(); const double * rowLower = returnModel->getRowLower(); const double * rowUpper = returnModel->getRowUpper(); const double * columnLower = returnModel->getColLower(); // Look for possible SOS int numberSOS=0; int * mark = new int[numberColumns]; int * sosRow = new int [numberRows]; CoinZeroN(sosRow,numberRows); CoinFillN(mark,numberColumns,-1); int numberOverlap=0; int numberInSOS=0; for (iRow=0;iRowisInteger(iColumn)||columnLower[iColumn]) { goodRow=false; break; } if (mark[iColumn]>=0&&!allToGub) { goodRow=false; numberOverlap++; } if (objective[iColumn]) nObj++; } if (goodRow&&justOnesWithObj) { if (!nObj||nObjnumberInSOS+1)) { handler_->message(CGL_PROCESS_SOS2,messages_) <message(CGL_PROCESS_SOS1,messages_) <getMatrixByCol(); const int * row = columnCopy->getIndices(); const CoinBigIndex * columnStart = columnCopy->getVectorStarts(); const int * columnLength = columnCopy->getVectorLengths(); const double * columnElements = columnCopy->getElements(); const double * objective = returnModel->getObjCoefficients(); int * numberInRow = new int [numberRows]; double * sort = new double[numberColumns]; int * which = new int[numberColumns]; for (int iSOS =0;iSOS=n-1) { // See how many different int i; for ( i=0;ilast+CoinMax(fabs(last)*1.0e-8,1.0e-5)) { nDiff++; } last = sort[i]; } if (nDiff>numberDifferent) { numberDifferent = nDiff; bestRow=iRow; } } } if (numberObj>=n-1||bestRow<0) { int i; for ( i=0;ilast+CoinMax(fabs(last)*1.0e-8,1.0e-5)) { nDiff++; } last = sort[i]; } if (nDiff>numberDifferent) { numberDifferent = nDiff; bestRow=numberRows; } } if (bestRow>=0) { // if not objective - recreate if (bestRowmessage(CGL_PROCESS_STATS2,messages_) <getNumRows()<getNumCols() <getNumElements() <getNumRows(); int numberCuts=0; for (int i=0;i0) numberCuts++; } if (numberCuts) { CglStored stored; int * whichRow = new int[numberRows]; // get row copy const CoinPackedMatrix * rowCopy = returnModel->getMatrixByRow(); const int * column = rowCopy->getIndices(); const int * rowLength = rowCopy->getVectorLengths(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const double * rowLower = returnModel->getRowLower(); const double * rowUpper = returnModel->getRowUpper(); const double * element = rowCopy->getElements(); int iRow,nDelete=0; for (iRow=0;iRowdeleteRows(nDelete,whichRow); delete [] whichRow; cuts_ = stored; } } } #if 0 if (returnModel) { int numberColumns = returnModel->getNumCols(); int numberRows = returnModel->getNumRows(); int * del = new int [CoinMax(numberColumns,numberRows)]; int * original = new int [numberColumns]; int nDel=0; for (int i=0;iisInteger(i)) del[nDel++]=i; } int nExtra=0; if (nDel&&nDel!=numberColumns&&(options_&1)!=0&&false) { OsiSolverInterface * yyyy = returnModel->clone(); int nPass=0; while (nDel&&nPass<10) { nPass++; OsiSolverInterface * xxxx = yyyy->clone(); int nLeft=0; for (int i=0;i=0) original[nLeft++]=kOrig; } assert (nLeft==numberColumns-nDel); xxxx->deleteCols(nDel,del); numberColumns = xxxx->getNumCols(); const CoinPackedMatrix * rowCopy = xxxx->getMatrixByRow(); numberRows = rowCopy->getNumRows(); const int * column = rowCopy->getIndices(); const int * rowLength = rowCopy->getVectorLengths(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const double * rowLower = xxxx->getRowLower(); const double * rowUpper = xxxx->getRowUpper(); const double * element = rowCopy->getElements(); const CoinPackedMatrix * columnCopy = xxxx->getMatrixByCol(); const int * columnLength = columnCopy->getVectorLengths(); nDel=0; // Could do gcd stuff on ones with costs for (int i=0;iisInteger(iColumn)) { double mult =1.0/fabs(element[k]); if (rowLower[i]<-1.0e20) { double value = rowUpper[i]*mult; if (fabs(value-floor(value+0.5))<1.0e-8) { del[nDel++]=i; if (columnLength[iColumn]==1) { xxxx->setInteger(iColumn); int kOrig=original[iColumn]; returnModel->setInteger(kOrig); } } } else if (rowUpper[i]>1.0e20) { double value = rowLower[i]*mult; if (fabs(value-floor(value+0.5))<1.0e-8) { del[nDel++]=i; if (columnLength[iColumn]==1) { xxxx->setInteger(iColumn); int kOrig=original[iColumn]; returnModel->setInteger(kOrig); } } } else { double value = rowUpper[i]*mult; if (rowLower[i]==rowUpper[i]&& fabs(value-floor(value+0.5))<1.0e-8) { del[nDel++]=i; xxxx->setInteger(iColumn); int kOrig=original[iColumn]; returnModel->setInteger(kOrig); } } } } else { // only if all singletons bool possible=false; if (rowLower[i]<-1.0e20) { double value = rowUpper[i]; if (fabs(value-floor(value+0.5))<1.0e-8) possible=true; } else if (rowUpper[i]>1.0e20) { double value = rowLower[i]; if (fabs(value-floor(value+0.5))<1.0e-8) possible=true; } else { double value = rowUpper[i]; if (rowLower[i]==rowUpper[i]&& fabs(value-floor(value+0.5))<1.0e-8) possible=true; } if (possible) { for (CoinBigIndex j=rowStart[i]; jisInteger(iColumn)) { xxxx->setInteger(iColumn); int kOrig=original[iColumn]; returnModel->setInteger(kOrig); } } del[nDel++]=i; } } } } if (nDel) { xxxx->deleteRows(nDel,del); } if (nDel!=numberRows) { nDel=0; for (int i=0;iisInteger(i)) { del[nDel++]=i; nExtra++; } } } delete yyyy; yyyy=xxxx->clone(); } numberColumns = yyyy->getNumCols(); numberRows = yyyy->getNumRows(); if (!numberColumns||!numberRows) { printf("All gone\n"); int numberColumns = returnModel->getNumCols(); for (int i=0;iisInteger(i)); } // Would need to check if original bounds integer //yyyy->writeMps("noints"); delete yyyy; printf("Creating simplified model with %d rows and %d columns - %d extra integers\n", numberRows,numberColumns,nExtra); } delete [] del; delete [] original; //exit(2); } #endif return returnModel; } /* Tightens primal bounds to make dual and branch and cutfaster. Unless fixed, bounds are slightly looser than they could be. Returns non-zero if problem infeasible Fudge for branch and bound - put bounds on columns of factor * largest value (at continuous) - should improve stability in branch and bound on infeasible branches (0.0 is off) */ int CglPreProcess::tightenPrimalBounds(OsiSolverInterface & model,double factor) { // Get a row copy in standard format CoinPackedMatrix copy = *model.getMatrixByRow(); // get matrix data pointers const int * column = copy.getIndices(); const CoinBigIndex * rowStart = copy.getVectorStarts(); const int * rowLength = copy.getVectorLengths(); double * element = copy.getMutableElements(); int numberChanged=1,iPass=0; double large = model.getInfinity()*0.1; // treat bounds > this as infinite int numberInfeasible=0; int totalTightened = 0; double tolerance; model.getDblParam(OsiPrimalTolerance,tolerance); int numberColumns=model.getNumCols(); const double * colLower = model.getColLower(); const double * colUpper = model.getColUpper(); // New and saved column bounds double * newLower = new double [numberColumns]; memcpy(newLower,colLower,numberColumns*sizeof(double)); double * newUpper = new double [numberColumns]; memcpy(newUpper,colUpper,numberColumns*sizeof(double)); double * columnLower = new double [numberColumns]; memcpy(columnLower,colLower,numberColumns*sizeof(double)); double * columnUpper = new double [numberColumns]; memcpy(columnUpper,colUpper,numberColumns*sizeof(double)); int iRow, iColumn; // If wanted - tighten column bounds using solution if (factor) { /* Callers need to ensure that the solution is fresh */ const double * solution = model.getColSolution(); double largest=0.0; if (factor>0.0) { assert (factor>1.0); for (iColumn=0;iColumntolerance) { largest = CoinMax(largest,fabs(solution[iColumn])); } } largest *= factor; } else { // absolute largest = - factor; } for (iColumn=0;iColumntolerance) { newUpper[iColumn] = CoinMin(columnUpper[iColumn],largest); newLower[iColumn] = CoinMax(columnLower[iColumn],-largest); } } } int numberRows = model.getNumRows(); const double * rowLower = model.getRowLower(); const double * rowUpper = model.getRowUpper(); #ifndef NDEBUG double large2= 1.0e10*large; #endif #define MAXPASS 10 // Loop round seeing if we can tighten bounds // Would be faster to have a stack of possible rows // and we put altered rows back on stack int numberCheck=-1; while(numberChanged>numberCheck) { numberChanged = 0; // Bounds tightened this pass if (iPass==MAXPASS) break; iPass++; for (iRow = 0; iRow < numberRows; iRow++) { if (rowLower[iRow]>-large||rowUpper[iRow] 0.0) { if (newUpper[iColumn] >= large) { ++infiniteUpper; } else { maximumUp += newUpper[iColumn] * value; } if (newLower[iColumn] <= -large) { ++infiniteLower; } else { maximumDown += newLower[iColumn] * value; } } else if (value<0.0) { if (newUpper[iColumn] >= large) { ++infiniteLower; } else { maximumDown += newUpper[iColumn] * value; } if (newLower[iColumn] <= -large) { ++infiniteUpper; } else { maximumUp += newLower[iColumn] * value; } } } // Build in a margin of error maximumUp += 1.0e-8*fabs(maximumUp); maximumDown -= 1.0e-8*fabs(maximumDown); double maxUp = maximumUp+infiniteUpper*1.0e31; double maxDown = maximumDown-infiniteLower*1.0e31; if (maxUp <= rowUpper[iRow] + tolerance && maxDown >= rowLower[iRow] - tolerance) { // Row is redundant - make totally free } else { if (maxUp < rowLower[iRow] -100.0*tolerance || maxDown > rowUpper[iRow]+100.0*tolerance) { // problem is infeasible - exit at once numberInfeasible++; break; } double lower = rowLower[iRow]; double upper = rowUpper[iRow]; for (j = rStart; j < rEnd; ++j) { double value=element[j]; iColumn = column[j]; double nowLower = newLower[iColumn]; double nowUpper = newUpper[iColumn]; if (value > 0.0) { // positive value if (lower>-large) { if (!infiniteUpper) { assert(nowUpper < large2); newBound = nowUpper + (lower - maximumUp) / value; // relax if original was large if (fabs(maximumUp)>1.0e8) newBound -= 1.0e-12*fabs(maximumUp); } else if (infiniteUpper==1&&nowUpper>large) { newBound = (lower -maximumUp) / value; // relax if original was large if (fabs(maximumUp)>1.0e8) newBound -= 1.0e-12*fabs(maximumUp); } else { newBound = -COIN_DBL_MAX; } if (newBound > nowLower + 1.0e-12&&newBound>-large) { // Tighten the lower bound newLower[iColumn] = newBound; numberChanged++; // check infeasible (relaxed) if (nowUpper - newBound < -100.0*tolerance) { numberInfeasible++; } // adjust double now; if (nowLower<-large) { now=0.0; infiniteLower--; } else { now = nowLower; } maximumDown += (newBound-now) * value; nowLower = newBound; } } if (upper - large2); newBound = nowLower + (upper - maximumDown) / value; // relax if original was large if (fabs(maximumDown)>1.0e8) newBound += 1.0e-12*fabs(maximumDown); } else if (infiniteLower==1&&nowLower<-large) { newBound = (upper - maximumDown) / value; // relax if original was large if (fabs(maximumDown)>1.0e8) newBound += 1.0e-12*fabs(maximumDown); } else { newBound = COIN_DBL_MAX; } if (newBound < nowUpper - 1.0e-12&&newBoundlarge) { now=0.0; infiniteUpper--; } else { now = nowUpper; } maximumUp += (newBound-now) * value; nowUpper = newBound; } } } else { // negative value if (lower>-large) { if (!infiniteUpper) { assert(nowLower < large2); newBound = nowLower + (lower - maximumUp) / value; // relax if original was large if (fabs(maximumUp)>1.0e8) newBound += 1.0e-12*fabs(maximumUp); } else if (infiniteUpper==1&&nowLower<-large) { newBound = (lower -maximumUp) / value; // relax if original was large if (fabs(maximumUp)>1.0e8) newBound += 1.0e-12*fabs(maximumUp); } else { newBound = COIN_DBL_MAX; } if (newBound < nowUpper - 1.0e-12&&newBoundlarge) { now=0.0; infiniteLower--; } else { now = nowUpper; } maximumDown += (newBound-now) * value; nowUpper = newBound; } } if (upper 1.0e8) newBound -= 1.0e-12*fabs(maximumDown); } else if (infiniteLower==1&&nowUpper>large) { newBound = (upper - maximumDown) / value; // relax if original was large if (fabs(maximumDown)>1.0e8) newBound -= 1.0e-12*fabs(maximumDown); } else { newBound = -COIN_DBL_MAX; } if (newBound > nowLower + 1.0e-12&&newBound>-large) { // Tighten the lower bound newLower[iColumn] = newBound; numberChanged++; // check infeasible (relaxed) if (nowUpper - newBound < -100.0*tolerance) { numberInfeasible++; } // adjust double now; if (nowLower<-large) { now=0.0; infiniteUpper--; } else { now = nowLower; } maximumUp += (newBound-now) * value; nowLower = newBound; } } } } } } } totalTightened += numberChanged; if (iPass==1) numberCheck=numberChanged>>4; if (numberInfeasible) break; } if (!numberInfeasible) { // Set bounds slightly loose unless integral - now tighter double useTolerance = 1.0e-5; for (iColumn=0;iColumncolumnLower[iColumn]) { double lower = newLower[iColumn]; double upper = newUpper[iColumn]; if (model.isInteger(iColumn)) { if (fabs(lower-floor(lower+0.5))<1.0e-5) lower=floor(lower+0.5); else lower = ceil(lower); if (fabs(upper-floor(upper+0.5))<1.0e-5) upper=floor(upper+0.5); else upper = floor(upper); if (lower>upper) numberInfeasible++; } else { if (fabs(upper)<1.0e-8&&fabs(lower)<1.0e-8) { lower=0.0; upper=0.0; } else { // Relax unless integral if (fabs(lower-floor(lower+0.5))>1.0e-9) lower -= useTolerance; else lower = floor(lower+0.5); lower=CoinMax(columnLower[iColumn],lower); if (fabs(upper-floor(upper+0.5))>1.0e-9) upper += useTolerance; else upper = floor(upper+0.5); upper=CoinMin(columnUpper[iColumn],upper); } } model.setColLower(iColumn,lower); model.setColUpper(iColumn,upper); newLower[iColumn]=lower; newUpper[iColumn]=upper; } } if (!numberInfeasible) { // check common bad formulations int numberChanges=0; for (iRow = 0; iRow < numberRows; iRow++) { if (rowLower[iRow]>-large||rowUpper[iRow]newLower[iColumn]) { if (model.isInteger(iColumn)) { numberInteger++; //whichInteger=iColumn; } largest = CoinMax(largest,fabs(value)); if (value > 0.0) { if (newUpper[iColumn] >= large) { ++infiniteUpper; } else { maximumUp += newUpper[iColumn] * value; } if (newLower[iColumn] <= -large) { ++infiniteLower; } else { maximumDown += newLower[iColumn] * value; } } else if (value<0.0) { if (newUpper[iColumn] >= large) { ++infiniteLower; } else { maximumDown += newUpper[iColumn] * value; } if (newLower[iColumn] <= -large) { ++infiniteUpper; } else { maximumUp += newLower[iColumn] * value; } } } else { // fixed sumFixed += newLower[iColumn]*value; } } // Adjust maximumUp += sumFixed; maximumDown += sumFixed; // For moment just when all one sign and ints //maximumUp += 1.0e-8*fabs(maximumUp); //maximumDown -= 1.0e-8*fabs(maximumDown); double gap = 0.0; if ((rowLower[iRow]>maximumDown&&largest>rowLower[iRow]-maximumDown)&& ((maximumUp<=rowUpper[iRow]&&!infiniteUpper)||rowUpper[iRow]>=1.0e30)) { gap = rowLower[iRow]-maximumDown; if (infiniteLower) gap=0.0; // switch off } else if ((maximumUp>rowUpper[iRow]&&largest>maximumUp-rowUpper[iRow])&& ((maximumDown>=rowLower[iRow]&&!infiniteLower)||rowLower[iRow]<=-1.0e30)) { gap = -(maximumUp-rowUpper[iRow]); if (infiniteUpper) gap=0.0; // switch off } if (fabs(gap)>1.0e-8) { for (j = rStart;j < rEnd; ++j) { double value=element[j]; iColumn = column[j]; double difference = newUpper[iColumn]-newLower[iColumn]; if (difference>0.0&&difference<=1.0) { double newValue=value; if (value*gap>0.0&&model.isInteger(iColumn)) { if (fabs(value*difference) > fabs(gap)) { // No need for it to be larger than newValue = gap/difference; } if (fabs(value-newValue)>1.0e-12) { numberChanges++; // BUT variable may have bound double rhsAdjust=0.0; if (gap>0.0) { // rowLower if (value>0.0) { // new value is based on going up from lower bound if (colLower[iColumn]) rhsAdjust = colLower[iColumn]*(value-newValue); } else { // new value is based on going down from upper bound if (colUpper[iColumn]) rhsAdjust = colUpper[iColumn]*(value-newValue); } } else { // rowUpper if (value<0.0) { // new value is based on going up from lower bound if (colLower[iColumn]) rhsAdjust = colLower[iColumn]*(value-newValue); } else { // new value is based on going down from upper bound if (colUpper[iColumn]) rhsAdjust = colUpper[iColumn]*(value-newValue); } } if (rhsAdjust) { #ifdef CLP_INVESTIGATE printf("FFor column %d bounds %g, %g on row %d bounds %g, %g coefficient was changed from %g to %g with rhs adjustment of %g\n", iColumn,colLower[iColumn],colUpper[iColumn], iRow,rowLower[iRow],rowUpper[iRow], value,newValue,rhsAdjust); #endif if (rowLower[iRow]>-1.0e20) model.setRowLower(iRow,rowLower[iRow]-rhsAdjust); if (rowUpper[iRow]<1.0e20) model.setRowUpper(iRow,rowUpper[iRow]-rhsAdjust); #ifdef CLP_INVESTIGATE printf("FFor column %d bounds %g, %g on row %d bounds %g, %g coefficient was changed from %g to %g with rhs adjustment of %g\n", iColumn,colLower[iColumn],colUpper[iColumn], iRow,rowLower[iRow],rowUpper[iRow], value,newValue,rhsAdjust); #endif } element[j]=newValue; handler_->message(CGL_ELEMENTS_CHANGED2,messages_) <numberColumns()==numberColumns) { const double * optimal = debugger->optimalSolution(); double sum=0.0; for (int jj = rStart;jj < rEnd; ++jj) { double value=element[j]; int jColumn = column[jj]; sum += value*optimal[jColumn]; } assert (sum>=rowLower[iRow]-1.0e7&&sum<=rowUpper[iRow]+1.0e-7); } #endif } } } } } } } if (numberChanges) { handler_->message(CGL_ELEMENTS_CHANGED1,messages_) <message(CGL_INFEASIBLE,messages_) <getHintParam(OsiDoPresolveInInitial,saveHint,saveStrength); bool saveHint2; OsiHintStrength saveStrength2; originalModel_->getHintParam(OsiDoDualInInitial, saveHint2,saveStrength2); OsiSolverInterface * clonedCopy=NULL; double saveObjectiveValue = modelIn.getObjValue(); if (!modelIn.isProvenOptimal()) { CoinWarmStartBasis *slack = dynamic_cast(modelIn.getEmptyWarmStart()) ; modelIn.setWarmStart(slack); delete slack ; modelIn.resolve(); } if (modelIn.isProvenOptimal()) { #if COIN_DEVELOP>1 whichMps++; sprintf(nameMps,"start_%d",whichMps); modelIn.writeMps(nameMps); printf("Mps file %s saved in %s at line %d\n", nameMps,__FILE__,__LINE__); #endif OsiSolverInterface * modelM = &modelIn; // If some cuts add back rows if (cuts_.sizeRowCuts()) { clonedCopy = modelM->clone(); modelM=clonedCopy; int numberRowCuts = cuts_.sizeRowCuts() ; // add in CoinBuild build; for (int k = 0;krow().getNumElements(); const int * columnCut = thisCut->row().getIndices(); const double * elementCut = thisCut->row().getElements(); double lower = thisCut->lb(); double upper = thisCut->ub(); build.addRow(n,columnCut,elementCut,lower,upper); } modelM->addRows(build); // basis is wrong CoinWarmStartBasis empty; modelM->setWarmStart(&empty); } for (int iPass=numberSolvers_-1;iPass>=0;iPass--) { OsiSolverInterface * model = model_[iPass]; if (model->getNumCols()) { CoinWarmStartBasis* basis = dynamic_cast (modelM->getWarmStart()) ; if (basis) { model->setWarmStart(basis); delete basis; } int numberColumns = modelM->getNumCols(); const double * solutionM = modelM->getColSolution(); const double * columnLower2 = model->getColLower(); const double * columnUpper2 = model->getColUpper(); const double * columnLower = modelM->getColLower(); const double * columnUpper = modelM->getColUpper(); int iColumn; for (iColumn=0;iColumnisInteger(iColumn)) { double value = solutionM[iColumn]; double value2 = floor(value+0.5); // if test fails then empty integer if (fabs(value-value2)<1.0e-3) { model->setColLower(iColumn,value2); model->setColUpper(iColumn,value2); } else { #ifdef COIN_DEVELOP printf("NPASS=%d, ipass %d var %d values %g %g %g\n", numberSolvers_,iPass,iColumn,model->getColLower()[iColumn], value,model->getColUpper()[iColumn]); #endif } } else if (columnUpper[iColumn]==columnLower[iColumn]) { if (columnUpper2[iColumn]>columnLower2[iColumn]&&!model->isInteger(iColumn)) { model->setColUpper(iColumn,columnLower[iColumn]); } } } } int numberColumns = modelM->getNumCols(); const double * solutionM = modelM->getColSolution(); int iColumn; // Give a hint to do primal //model->setHintParam(OsiDoPresolveInInitial,true,OsiHintTry); model->setHintParam(OsiDoDualInInitial,false,OsiHintTry); // clean /* VIRTUOUS - I am not happy here (JJF) - This was put in for Special Ordered Sets of type 2 Previous loop has likely made nontrivial bound changes, hence invalidated solution. Why do we need this? We're about to do an initialSolve, which will overwrite solution. Perhaps belongs in same guarded block with following feasibility check? If this is necessary for clp, solution should be acquired before bounds changes. */ if (0) { int numberColumns = model->getNumCols(); const double * lower = model->getColLower(); const double * upper = model->getColUpper(); double * solution = CoinCopyOfArray(model->getColSolution(),numberColumns); int i; for ( i=0;isetColSolution(solution); delete [] solution; } #ifdef COIN_DEVELOP { int numberColumns = model->getNumCols(); int numberRows = model->getNumRows(); const double * lower = model->getColLower(); const double * upper = model->getColUpper(); const double * rowLower = model->getRowLower(); const double * rowUpper = model->getRowUpper(); #ifndef NDEBUG double primalTolerance=1.0e-8; #endif // Column copy const CoinPackedMatrix * matrix = model->getMatrixByCol(); const double * element = matrix->getElements(); const int * row = matrix->getIndices(); const CoinBigIndex * columnStart = matrix->getVectorStarts(); const int * columnLength = matrix->getVectorLengths(); double * rowActivity = new double[numberRows]; memset(rowActivity,0,numberRows*sizeof(double)); int i; for ( i=0;iupper[i]) { value=upper[i]; } assert (upper[i]>=lower[i]); assert ((fabs(value)<1.0e20)); if (value) { for (j=columnStart[i]; jrowUpper[i]) { if (rowActivity[i]>rowUpper[i]+1000.0*primalTolerance) { feasible=false; printf("Bad row %d %g <= %g <= %g\n", i,rowLower[i],rowActivity[i],rowUpper[i]); } rowActivity[i]=rowUpper[i]; } } assert (feasible); } #endif { int numberFixed=0; int numberColumns = model->getNumCols(); const double * columnLower = model->getColLower(); const double * columnUpper = model->getColUpper(); int iColumn; for (iColumn=0;iColumn2000&&numberFixednumberColumns) { model->setHintParam(OsiDoPresolveInInitial,true,OsiHintTry); } } model->initialSolve(); numberIterationsPost_ += model->getIterationCount(); if (!model->isProvenOptimal()) { #ifdef COIN_DEVELOP whichMps++; sprintf(nameMps,"bad2_%d",whichMps); model->writeMps(nameMps); printf("Mps file %s saved in %s at line %d\n", nameMps,__FILE__,__LINE__); printf("bad unwind in postprocess\n"); OsiSolverInterface * temp = model->clone(); temp->setDblParam(OsiDualObjectiveLimit,1.0e30); temp->setHintParam(OsiDoReducePrint,false,OsiHintTry); temp->initialSolve(); if (temp->isProvenOptimal()) { printf("Was infeasible on objective limit\n"); } delete temp; #endif } else { #if COIN_DEVELOP>1 whichMps++; sprintf(nameMps,"good2_%d",whichMps); model->writeMps(nameMps); printf("Mps file %s saved in %s at line %d\n", nameMps,__FILE__,__LINE__); #endif } const int * originalColumns = presolve_[iPass]->originalColumns(); const double * columnLower = modelM->getColLower(); const double * columnUpper = modelM->getColUpper(); OsiSolverInterface * modelM2; if (iPass) modelM2 = modifiedModel_[iPass-1]; else modelM2 = startModel_; const double * solutionM2 = modelM2->getColSolution(); const double * columnLower2 = modelM2->getColLower(); const double * columnUpper2 = modelM2->getColUpper(); double primalTolerance; modelM->getDblParam(OsiPrimalTolerance,primalTolerance); /* clean up status for any bound alterations made by preprocess which postsolve won't understand. Could move inside OsiPresolve but some people might object */ CoinWarmStartBasis *presolvedBasis = dynamic_cast(model->getWarmStart()) ; assert (presolvedBasis); int numberChanged=0; // Have to use free as superBasic does not exist for (iColumn=0;iColumngetStructStatus(iColumn)) { case CoinWarmStartBasis::basic: case CoinWarmStartBasis::isFree: break; case CoinWarmStartBasis::atLowerBound: if (solutionM[iColumn]>columnLower2[jColumn]+primalTolerance) { presolvedBasis->setStructStatus(iColumn,CoinWarmStartBasis::isFree); numberChanged++; } break; case CoinWarmStartBasis::atUpperBound: if (solutionM[iColumn]setStructStatus(iColumn,CoinWarmStartBasis::isFree); numberChanged++; } break; } } if (numberChanged) model->setWarmStart(presolvedBasis); delete presolvedBasis; presolve_[iPass]->postsolve(true); // and fix values for (iColumn=0;iColumnisInteger(jColumn)) { if (columnUpper[iColumn]==columnLower[iColumn]) { if (columnUpper2[jColumn]>columnLower2[jColumn]&&!modelM2->isInteger(jColumn)) { double value = solutionM[iColumn]; value = CoinMax(value,columnLower[iColumn]); value = CoinMin(value,columnUpper[iColumn]); #ifdef COIN_DEVELOP printf ("assuming %d fixed to solution of %g (was %g) - bounds %g %g, old bounds and sol %g %g\n", jColumn,value,solutionM2[jColumn],columnLower2[jColumn],columnUpper2[jColumn], columnLower[iColumn],columnUpper[iColumn]); #endif modelM2->setColUpper(jColumn,value); } } else { #if 0 if (columnUpper2[jColumn]>columnLower2[jColumn]&&!modelM2->isInteger(jColumn)) { double value = solutionM[iColumn]; value = CoinMax(value,columnLower[iColumn]); value = CoinMin(value,columnUpper[iColumn]); printf ("assuming %d not fixed to solution of %g (was %g) - bounds %g %g, old bounds and sol %g %g\n", jColumn,value,solutionM2[jColumn],columnLower2[jColumn],columnUpper2[jColumn], columnLower[iColumn],columnUpper[iColumn]); } #endif } } else { // integer - dupcol bounds may be odd so use solution double value = floor(solutionM2[jColumn]+0.5); if (valuesetColLower(jColumn,value); } else if (value>columnUpper2[jColumn]) { //printf("changing upper bound for %d from %g to %g to allow feasibility\n", // jColumn,columnUpper2[jColumn],value); modelM2->setColUpper(jColumn,value); } } } if (deleteStuff) { delete modifiedModel_[iPass];; delete model_[iPass];; delete presolve_[iPass]; modifiedModel_[iPass]=NULL; model_[iPass]=NULL; presolve_[iPass]=NULL; } modelM = modelM2; } // should be back to startModel_; OsiSolverInterface * model = originalModel_; // Use number of columns in original int numberColumns = model->getNumCols(); const double * solutionM = modelM->getColSolution(); int iColumn; const double * columnLower2 = model->getColLower(); const double * columnUpper2 = model->getColUpper(); const double * columnLower = modelM->getColLower(); const double * columnUpper = modelM->getColUpper(); int numberBadValues = 0; CoinWarmStartBasis* basis = dynamic_cast (modelM->getWarmStart()) ; if (basis) { model->setWarmStart(basis); delete basis; } for (iColumn=0;iColumnisInteger(iColumn)) { double value = solutionM[iColumn]; double value2 = floor(value+0.5); // if test fails then empty integer if (fabs(value-value2)<1.0e-3) { value2 = CoinMax(CoinMin(value2,columnUpper[iColumn]),columnLower[iColumn]); model->setColLower(iColumn,value2); model->setColUpper(iColumn,value2); } else { #ifdef COIN_DEVELOP printf("NPASS=%d, ipass end var %d values %g %g %g\n", numberSolvers_,iColumn,model->getColLower()[iColumn], value,model->getColUpper()[iColumn]); #endif numberBadValues++; } } else if (columnUpper[iColumn]==columnLower[iColumn]) { if (columnUpper2[iColumn]>columnLower2[iColumn]&&!model->isInteger(iColumn)) { model->setColUpper(iColumn,columnLower[iColumn]); } } } if(numberBadValues) { const CoinPackedMatrix * columnCopy = model->getMatrixByCol(); const int * row = columnCopy->getIndices(); const CoinBigIndex * columnStart = columnCopy->getVectorStarts(); const int * columnLength = columnCopy->getVectorLengths(); const double * element = columnCopy->getElements(); int numberRows = model->getNumRows(); double * rowActivity = new double[numberRows]; memset(rowActivity,0,numberRows*sizeof(double)); double * solution = CoinCopyOfArray(solutionM,numberColumns); for ( iColumn=0;iColumnisInteger(iColumn)) { double value2 = floor(value+0.5); // if test fails then empty integer if (fabs(value-value2)<1.0e-3) value = value2; } solution[iColumn] = value; for (CoinBigIndex j=columnStart[iColumn]; jgetRowLower(); const double * rowUpper = model->getRowUpper(); //const double * columnLower = model->getColLower(); //const double * columnUpper = model->getColUpper(); const double * objective = model->getObjCoefficients(); double direction = model->getObjSense(); int numberCheck=0; double tolerance; model->getDblParam(OsiPrimalTolerance,tolerance); tolerance *= 10.0; for ( iColumn=0;iColumnisInteger(iColumn)) { double value2 = floor(value); // See if empty integer if (value!=value2) { numberCheck++; int allowed=0; // can we go up double movement = value2+1.0-value; CoinBigIndex j; bool good=true; for (j=columnStart[iColumn]; j-1.0e20&&rowUpper[iRow]<1.0e20) printf("odd row with both bounds %d %g %g - element %g\n", iRow,rowLower[iRow],rowUpper[iRow],element[j]); #endif double newActivity = rowActivity[iRow] + movement*element[j]; if (newActivity>rowUpper[iRow]+tolerance|| newActivityrowUpper[iRow]+tolerance|| newActivity0.0) allowed=2; else allowed=1; } if(allowed==1) value2++; movement = value2-value; solution[iColumn]=value2; model->setColLower(iColumn,value2); model->setColUpper(iColumn,value2); for (j=columnStart[iColumn]; jsetColSolution(solution); delete [] rowActivity; delete [] solution; } } else { // infeasible for (int iPass=numberSolvers_-1;iPass>=0;iPass--) { delete modifiedModel_[iPass];; delete model_[iPass];; delete presolve_[iPass]; modifiedModel_[iPass]=NULL; model_[iPass]=NULL; presolve_[iPass]=NULL; } // Back to startModel_; OsiSolverInterface * model = originalModel_; // Use number of columns in original int numberColumns = model->getNumCols(); const double * columnLower = model->getColLower(); int iColumn; for (iColumn=0;iColumnisInteger(iColumn)) model->setColUpper(iColumn,columnLower[iColumn]); } } delete clonedCopy; originalModel_->setHintParam(OsiDoPresolveInInitial,true,OsiHintTry); originalModel_->setHintParam(OsiDoDualInInitial,false,OsiHintTry); { int numberFixed=0; int numberColumns = originalModel_->getNumCols(); const double * columnLower = originalModel_->getColLower(); const double * columnUpper = originalModel_->getColUpper(); int iColumn; for (iColumn=0;iColumninitialSolve(); //printf("Time with basis %g seconds, %d iterations\n",CoinCpuTime()-time1,originalModel_->getIterationCount()); if (numberColumns<10000||numberFixed==numberColumns) { CoinWarmStart * empty = originalModel_->getEmptyWarmStart(); originalModel_->setWarmStart(empty); delete empty; } } //double time1 = CoinCpuTime(); originalModel_->initialSolve(); numberIterationsPost_ += originalModel_->getIterationCount(); //printf("Time without basis %g seconds, %d iterations\n",CoinCpuTime()-time1,originalModel_->getIterationCount()); double objectiveValue = originalModel_->getObjValue(); double testObj = 1.0e-8*CoinMax(fabs(saveObjectiveValue), fabs(objectiveValue))+1.0e-4; if (!originalModel_->isProvenOptimal()) { #ifdef COIN_DEVELOP whichMps++; sprintf(nameMps,"bad3_%d",whichMps); originalModel_->writeMps(nameMps); printf("Mps file %s saved in %s at line %d\n", nameMps,__FILE__,__LINE__); printf("bad end unwind in postprocess\n"); #endif handler_->message(CGL_POST_INFEASIBLE,messages_) <testObj &&deleteStuff ) { handler_->message(CGL_POST_CHANGED,messages_) <setHintParam(OsiDoDualInInitial,saveHint2,saveStrength2); originalModel_->setHintParam(OsiDoPresolveInInitial,saveHint,saveStrength); } //------------------------------------------------------------------- // 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; } /* Return model with useful modifications. If constraints true then adds any x+y=1 or x-y=0 constraints If NULL infeasible */ OsiSolverInterface * CglPreProcess::modified(OsiSolverInterface * model, bool constraints, int & numberChanges, int iBigPass, int numberPasses) { OsiSolverInterface * newModel = model->clone(); int numberRows = newModel->getNumRows(); CglUniqueRowCuts twoCuts(numberRows); int numberColumns = newModel->getNumCols(); int number01Integers=0; int iColumn; for (iColumn=0;iColumnisBinary(iColumn)) number01Integers++; } OsiRowCut ** whichCut = new OsiRowCut * [numberRows+1]; memset(whichCut, 0, (numberRows+1)*sizeof(OsiRowCut *)); numberChanges=0; CoinThreadRandom randomGenerator; CglTreeProbingInfo info(model); info.level = 0; info.pass = 0; info.formulation_rows = numberRows; info.inTree = false; info.options = !numberProhibited_ ? 0 : 2; info.randomNumberGenerator=&randomGenerator; info.strengthenRow= whichCut; #ifdef HEAVY_PROBING // See if user asked for heavy probing bool heavyProbing=false; for (int iGenerator=0;iGenerator (generator_[iGenerator]); if (probingCut&&probingCut->getMaxPassRoot()>1) { heavyProbing=true; break; } } #endif bool feasible=true; int firstGenerator=0; int lastGenerator=numberCutGenerators_; for (int iPass=0;iPass=0) { //char name[20]; //sprintf(name,"prex%2.2d.mps",iGenerator); //newModel->writeMpsNative(name, NULL, NULL,0,1,0); // refresh as model may have changed generator_[iGenerator]->refreshSolver(newModel); // skip duplicate rows except once dupRow = dynamic_cast (generator_[iGenerator]); cliqueGen = dynamic_cast (generator_[iGenerator]); if ((dupRow||cliqueGen)&&(iPass/*||iBigPass*/)) continue; probingCut = dynamic_cast (generator_[iGenerator]); if (!probingCut) { generator_[iGenerator]->generateCuts(*newModel,cs,info); } else { info.options=64; probingCut->setMode(4); probingCut->generateCutsAndModify(*newModel,cs,&info); } #if 1 //def CLIQUE_ANALYSIS if (probingCut) { //printf("ordinary probing\n"); info.analyze(*newModel); } #endif // If CglDuplicate may give us useless rows if (dupRow) { numberFromCglDuplicate = dupRow->numberOriginalRows(); duplicate = dupRow->duplicate(); if (cs.sizeRowCuts()) { // add to twoCuts (may be more, but ....) int numberRowCuts = cs.sizeRowCuts() ; for (int k = 0;kclone(); numberRows=copySolver->getNumRows(); copySolver->applyCuts(cs); //static int kk=0; //char name[20]; //kk++; //sprintf(name,"matrix%d",kk); //printf("writing matrix %s\n",name); //copySolver->writeMps(name); CglDuplicateRow dupCuts(copySolver); dupCuts.setMode(8); OsiCuts cs2; dupCuts.generateCuts(*copySolver,cs2,info); // -1 not used, -2 delete, -3 not clique const int * duplicate = dupCuts.duplicate(); // -1 not used, >=0 earliest row affected const int * used = duplicate+numberRows+n; int numberDrop=0; int * drop = new int[numberRows]; for (int iRow=0;iRow=numberRows;iRow--) { #if 1 int earliest = used[iRow]; while (earliest>=numberRows) { if (duplicate[earliest]==-2) earliest = used[earliest]; else break; } #else int earliest=0; #endif if (duplicate[iRow]==-2||earliest==-1||earliest>=numberRows) { cs.eraseRowCut(iRow-numberRows); nOther++; } } n -= nOther; int newNumberRows = numberRows-numberDrop+n; bool special = (cliqueGen->getMinViolation()==-3.0); printf("could drop %d rows - current nrows %d other %d - new nrows %d\n", numberDrop,numberRows,nOther,newNumberRows); if (n<=numberDrop||special) { printf("Dropping rows current nrows %d - new nrows %d\n", numberRows,newNumberRows); if (newNumberRows>numberRows) { // need new array delete [] whichCut; whichCut = new OsiRowCut * [newNumberRows+1]; CoinZeroN(whichCut,newNumberRows); info.strengthenRow= whichCut; } newModel->deleteRows(numberDrop,drop); // may be able to delete some added cliques newModel->applyCuts(cs); numberRows=newModel->getNumRows(); newModel->resolve(); #if 0 int numberRows2=copySolver->getNumRows(); const double * rowLower = copySolver->getRowLower(); const double * rowUpper = copySolver->getRowUpper(); const CoinPackedMatrix * matrixByRow = copySolver->getMatrixByRow(); // Row copy const double * elementByRow = matrixByRow->getElements(); const int * column = matrixByRow->getIndices(); const CoinBigIndex * rowStart = matrixByRow->getVectorStarts(); const int * rowLength = matrixByRow->getVectorLengths(); const double * solution = newModel->getColSolution(); for (int iRow=0;iRowrowLower[iRow]-1.0e-4&&sumgetNumCols()); } // out for now - think about cliques if(!generator1.snapshot(*newModel,NULL,false)) { generator1.createCliques(*newModel,2,1000,true); // To get special stuff info.pass=4; CoinZeroN(whichCut,numberRows); generator1.setMode(4); generator1.generateCutsAndModify(*newModel,cs,&info); #ifdef CLIQUE_ANALYSIS printf("special probing\n"); info.analyze(*newModel); #endif } else { feasible=false; } #endif } // check changes // first are any rows strengthened by cuts int iRow; for (iRow=0;iRow=0) { numberDrop++; newModel->setRowBounds(iRow,-COIN_DBL_MAX,COIN_DBL_MAX); } } const double * columnLower = newModel->getColLower(); const double * columnUpper = newModel->getColUpper(); if ((numberStrengthened||numberDrop)&&feasible) { /* Deleting all rows and rebuilding invalidates everything, initialSolve will be required. */ needResolve = true ; rebuilt = true ; // Easier to recreate entire matrix const CoinPackedMatrix * rowCopy = newModel->getMatrixByRow(); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * rowElements = rowCopy->getElements(); const double * rowLower = newModel->getRowLower(); const double * rowUpper = newModel->getRowUpper(); CoinBuild build; // For basis char * keepRow = new char [numberRows]; for (iRow=0;iRow-1.0e20||rowUpper[iRow]<1.0e20) { #if 0 if (thisCut) { printf("Cut on row %d\n",iRow); thisCut->print(); } #endif if (!thisCut) { // put in old row int start=rowStart[iRow]; int kInt=-1; double newValue=0.0; if (!iPass&&!iBigPass) { // worthwhile seeing if odd gcd int end = start + rowLength[iRow]; double rhsAdjustment=0.0; int nPosInt=0; int nNegInt=0; // Find largest integer coefficient int k; for ( k = start; k < end; ++k) { CoinBigIndex j = column[k]; if (columnUpper[j]>columnLower[j]) { if (newModel->isInteger(j)) { if (rowElements[k]>0.0) nPosInt++; else nNegInt++; } else { break; // no good } } else { rhsAdjustment += columnLower[j]*rowElements[k]; } } if (k==end) { // see if singleton coefficient can be strengthened if ((nPosInt==1&&nNegInt>1)||(nNegInt==1&&nPosInt>1)) { double lo; double up; if (rowLower[iRow]>-1.0e20) lo = rowLower[iRow]-rhsAdjustment; else lo=-COIN_DBL_MAX; if(rowUpper[iRow]<1.0e20) up = rowUpper[iRow]-rhsAdjustment; else up=COIN_DBL_MAX; double multiplier=1.0; if (nNegInt==1) { // swap signs multiplier=lo; lo=-up; up=-multiplier; multiplier=-1.0; } bool possible=true; double singletonValue=0; double scale = 4.0*5.0*6.0; int kGcd=-1; double smallestSum = 0.0; double largestSum = 0.0; for ( k = start; k < end; ++k) { CoinBigIndex j = column[k]; double value=multiplier*rowElements[k]; if (columnUpper[j]>columnLower[j]) { if (value>0.0) { // singleton kInt=j; if (columnUpper[j]-columnLower[j]!=1.0) { possible = false; break; } else { singletonValue=value; } } else { if (columnLower[j]>-1.0e10) smallestSum += value*columnLower[j]; else smallestSum = -COIN_DBL_MAX; if (columnUpper[j]<-1.0e10) largestSum += value*columnUpper[j]; else largestSum = COIN_DBL_MAX; value *=-scale; if (fabs(value-floor(value+0.5))>1.0e-12) { possible=false; break; } else { int kVal = static_cast (floor(value+0.5)); if (kGcd>0) kGcd = gcd(kGcd,kVal); else kGcd=kVal; } } } } if (possible) { double multiple = (static_cast (kGcd))/scale; int interesting=0; double saveLo=lo; double saveUp=up; #ifdef CLP_INVESTIGATE double nearestLo0=lo; double nearestLo1=lo; #endif double nearestUp0=up; double nearestUp1=up; // adjust rhs for singleton if (lo!=-COIN_DBL_MAX) { // singleton at lb lo -= columnLower[kInt]*singletonValue; double exact = lo/multiple; if (fabs(exact-floor(exact+0.5))>1.0e-4) { interesting +=1; #ifdef CLP_INVESTIGATE nearestLo0 = ceil(exact)*multiple; #endif } // singleton at ub lo -= singletonValue; exact = lo/multiple; if (fabs(exact-floor(exact+0.5))>1.0e-4) { interesting +=2; #ifdef CLP_INVESTIGATE nearestLo1 = ceil(exact)*multiple; #endif } } if (up!=COIN_DBL_MAX) { // singleton at lb up -= columnLower[kInt]*singletonValue; double exact = up/multiple; if (fabs(exact-floor(exact+0.5))>1.0e-4) { interesting +=4; nearestUp0 = floor(exact)*multiple; } // singleton at ub up -= singletonValue; exact = up/multiple; if (fabs(exact-floor(exact+0.5))>1.0e-4) { interesting +=8; nearestUp1 = floor(exact)*multiple; } } if (interesting) { #ifdef CLP_INVESTIGATE printf("Row %d interesting %d lo,up %g,%g singleton %d value %g bounds %g,%g - gcd %g\n",iRow,interesting,saveLo,saveUp,kInt,singletonValue, columnLower[kInt],columnUpper[kInt],multiple); printf("Orig lo,up %g,%g %d\n",rowLower[iRow],rowUpper[iRow],end-start); for ( k = start; k < end; ++k) { CoinBigIndex j = column[k]; double value=multiplier*rowElements[k]; printf(" (%d, %g - bds %g, %g)",j,value, columnLower[j],columnUpper[j]); } printf("\n"); #endif if(columnLower[kInt]) { #ifdef CLP_INVESTIGATE printf("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\n"); //think #endif interesting=0; } newValue = singletonValue; #ifdef CLP_INVESTIGATE double newLoRhs = rowLower[iRow]; double newUpRhs = rowUpper[iRow]; if ((interesting&3)!=0) { newLoRhs = nearestLo0; newValue = nearestLo0-nearestLo1; } #endif if (saveLo==saveUp&&((interesting&5)==5||(interesting&10)==10)) { #ifdef CLP_INVESTIGATE printf("INFEAS? "); #endif interesting=0; //ninfeas++; } if ((interesting&12)) { #ifdef CLP_INVESTIGATE double value2 = newValue; newUpRhs = nearestUp0; #endif newValue = nearestUp0-nearestUp1; #ifdef CLP_INVESTIGATE if (newValue!=value2) { printf("??? old newvalue %g ",newValue); } #endif } #ifdef CLP_INVESTIGATE printf("guess is new lo %g, new up %g, new value %g\n", newLoRhs,newUpRhs,newValue); #endif } // Just do mzzv11 case double exact = singletonValue/multiple; if (fabs(exact-floor(exact+0.5))<1.0e-5) interesting &= ~2; if (!smallestSum&&interesting==2&&!saveLo&&saveUp>1.0e20) { newValue = multiple*floor(exact); newValue *= multiplier; #ifdef CLP_INVESTIGATE printf("New coefficient for %d will be %g\n",kInt,newValue); #endif } else { // don't do kInt=-1; } } else { kInt=-1; } } } // endgcd } int length = rowLength[iRow]; if (kInt<0) { build.addRow(length,column+start,rowElements+start, rowLower[iRow],rowUpper[iRow]); } else { double * els = CoinCopyOfArray(rowElements+start,length); if (fabs(newValue)>1.0e-13) { for ( int k = 0; k < length; ++k) { int j = column[k+start]; if (j==kInt) { els[k] = newValue; break; } } build.addRow(length,column+start,els, rowLower[iRow],rowUpper[iRow]); } else { // strengthened to zero! #ifdef CLP_INVESTIGATE printf("CglPreProcess - element strenthened to zero!\n"); #endif int * cols = CoinCopyOfArray(column+start,length); int n=0; for ( int k = 0; k < length; ++k) { int j = cols[k]; if (j!=kInt) { els[n] = els[k]; cols[n++]=j; } } build.addRow(n,cols,els, rowLower[iRow],rowUpper[iRow]); delete [] cols; } delete [] els; } keepRow[iRow]=1; } else { // strengthens this row (should we check?) // may be worth going round again numberChangedThisPass++; int n=thisCut->row().getNumElements(); const int * columnCut = thisCut->row().getIndices(); const double * elementCut = thisCut->row().getElements(); double lower = thisCut->lb(); double upper = thisCut->ub(); if (probingCut) { int i; int nFree=0; for ( i=0;icolumnLower[iColumn]+1.0e-12) nFree++; } bool good = (n==nFree); nFree=0; int n1=rowLength[iRow]; int start=rowStart[iRow]; for ( i=0;icolumnLower[iColumn]+1.0e-12) nFree++; } if (n1!=nFree) good=false; if (good) { #if 0 printf("Original row %.8d %g <= ",iRow,rowLower[iRow]); for ( i=0;i0) { build.addRow(n,columnCut,elementCut,lower,upper); keepRow[iRow]=1; } else if (!n) { // Either infeasible or redundant if (lower<=0.0&&upper>=0.0) { // redundant - row will go } else { // infeasible! feasible=false; break; } } } } } if (rowType_) { assert (numberRowType_==numberRows); int numberRowType_=0; for (iRow=0;iRow(newModel->getWarmStart()) ; if (basis) { int n=0; for (iRow=0;iRowdeleteRows(n,del); } for (iRow=0;iRowdeleteRows(numberRows,del); newModel->addRows(build); numberRows = newModel->getNumRows(); if (basis) { assert (numberRows==basis->getNumArtificial()); newModel->setWarmStart(basis); delete basis; } if (dupRow&&cs.sizeRowCuts()) newModel->applyCuts(cs); delete [] keepRow; delete [] del; /* VIRTUOUS A solver is not required to hold these pointers constant across complete row deletion and rebuild. */ columnLower = newModel->getColLower(); columnUpper = newModel->getColUpper(); } if (!feasible) break; // now see if we have any x=y x+y=1 if (constraints) { int numberRowCuts = cs.sizeRowCuts() ; for (int k = 0;krow().getNumElements(); double lower = thisCut->lb(); double upper = thisCut->ub(); if (n==2&&lower==upper) { twoCuts.insert(*thisCut); } } } if (probingCut) { // we could look harder for infeasibilities assert (info.numberVariables()==numberColumns); int number01 = info.numberIntegers(); const cliqueEntry * entry = info.fixEntries(); const int * toZero = info.toZero(); const int * toOne = info.toOne(); const int * which = info.integerVariable(); int numberBounds=0; char * markLB = new char [number01]; memset(markLB,0,number01); char * markUB = new char [number01]; memset(markUB,0,number01); for (int k=0;k=number01) continue; if (goingToOne) { // If v -> 1 means k -> 0 we have k+v==1 int startV = toOne[v]; int endV = toZero[v+1]; for (int jv=startV;jv (sequenceInCliqueEntry(entry[jv]))) { int goingToOneV = oneFixesInCliqueEntry(entry[jv]); double lo,up; if (!goingToOneV) { lo=1.0; up=1.0; OsiRowCut thisCut; thisCut.setLb(lo); thisCut.setUb(up); double values[]={1.0,1.0}; int columns[2]; columns[0]=which[k]; columns[1]=which[v]; thisCut.setRow(2,columns,values,false); twoCuts.insertIfNotDuplicate(thisCut); } else { // means infeasible for k to go to 0 markLB[k]=1; numberBounds++; } break; } } } else { // If v -> 0 means k -> 0 we have k==v int startV = toZero[v]; int endV = toOne[v]; for (int jv=startV;jv (sequenceInCliqueEntry(entry[jv]))) { int goingToOneV = oneFixesInCliqueEntry(entry[jv]); double lo,up; if (!goingToOneV) { lo=0.0; up=0.0; OsiRowCut thisCut; thisCut.setLb(lo); thisCut.setUb(up); double values[]={1.0,-1.0}; int columns[2]; columns[0]=which[k]; columns[1]=which[v]; thisCut.setRow(2,columns,values,false); twoCuts.insertIfNotDuplicate(thisCut); } else { // means infeasible for k to go to 0 markLB[k]=1; numberBounds++; } break; } } } } start = toOne[k]; end = toZero[k+1]; // to one for (j=start;j=number01) continue; if (goingToOne) { // If v -> 1 means k -> 1 we have k==v int startV = toOne[v]; int endV = toZero[v+1]; for (int jv=startV;jv (sequenceInCliqueEntry(entry[jv]))) { int goingToOneV = oneFixesInCliqueEntry(entry[jv]); double lo,up; if (goingToOneV) { lo=0.0; up=0.0; OsiRowCut thisCut; thisCut.setLb(lo); thisCut.setUb(up); double values[]={1.0,-1.0}; int columns[2]; columns[0]=which[k]; columns[1]=which[v]; thisCut.setRow(2,columns,values,false); twoCuts.insertIfNotDuplicate(thisCut); } else { // means infeasible for k to go to 1 markUB[k]=1; numberBounds++; } break; } } } else { // If v -> 0 means k -> 1 we have k+v==1 int startV = toZero[v]; int endV = toOne[v]; for (int jv=startV;jv (sequenceInCliqueEntry(entry[jv]))) { int goingToOneV = oneFixesInCliqueEntry(entry[jv]); double lo,up; if (goingToOneV) { lo=1.0; up=1.0; OsiRowCut thisCut; thisCut.setLb(lo); thisCut.setUb(up); double values[]={1.0,1.0}; int columns[2]; columns[0]=which[k]; columns[1]=which[v]; thisCut.setRow(2,columns,values,false); twoCuts.insertIfNotDuplicate(thisCut); } else { // means infeasible for k to go to 1 markUB[k]=1; numberBounds++; } break; } } } } } if (numberBounds) { CoinPackedVector lbs; CoinPackedVector ubs; for (int k=0;keffectiveness() > 1.0) { needResolve = true ; } const CoinPackedVector & lbs = thisCut->lbs() ; const CoinPackedVector & ubs = thisCut->ubs() ; int j ; int n ; const int * which ; const double * values ; n = lbs.getNumElements() ; which = lbs.getIndices() ; values = lbs.getElements() ; for (j = 0;jcolumnLower[iColumn]&&values[j]>-1.0e20) { //printf("%d lower from %g to %g\n",iColumn,columnLower[iColumn],values[j]); newModel->setColLower(iColumn,values[j]) ; if (false) { OsiSolverInterface * xx = newModel->clone(); xx->initialSolve(); assert (xx->isProvenOptimal()); delete xx; } numberChangedThisPass++; if (columnLower[iColumn]==columnUpper[iColumn]) { numberFixed++; } else { numberBounds++; if (columnLower[iColumn]>columnUpper[iColumn]) feasible=false; } } } n = ubs.getNumElements() ; which = ubs.getIndices() ; values = ubs.getElements() ; for (j = 0;jsetColUpper(iColumn,values[j]) ; if (false) { OsiSolverInterface * xx = newModel->clone(); xx->initialSolve(); assert (xx->isProvenOptimal()); delete xx; } numberChangedThisPass++; if (columnLower[iColumn]==columnUpper[iColumn]) { numberFixed++; } else { numberBounds++; if (columnLower[iColumn]>columnUpper[iColumn]) feasible=false; } } } } numberTwo = twoCuts.sizeRowCuts()-numberTwo; numberChanges += numberTwo + numberStrengthened/10; if (numberFixed||numberTwo||numberStrengthened||numberBounds) handler_->message(CGL_PROCESS_STATS,messages_) <(newModel->getEmptyWarmStart()) ; //newModel->setWarmStart(slack); //delete slack ; newModel->initialSolve() ; } else { newModel->resolve() ; } numberIterationsPre_ += newModel->getIterationCount(); feasible = newModel->isProvenOptimal(); if (!feasible&&getCutoff()>1.0e20) { // Better double check CoinWarmStartBasis *slack = dynamic_cast(newModel->getEmptyWarmStart()) ; newModel->setWarmStart(slack); delete slack ; newModel->resolve() ; numberIterationsPre_ += newModel->getIterationCount(); feasible = newModel->isProvenOptimal(); //if (!feasible) //newModel->writeMpsNative("infeas.mps",NULL,NULL,2,1); } } if (!feasible) break; } if (!feasible) break; numberChanges += numberChangedThisPass; if (iPassrow().getNumElements(); const int * columnCut = thisCut->row().getIndices(); const double * elementCut = thisCut->row().getElements(); double lower = thisCut->lb(); double upper = thisCut->ub(); build.addRow(n,columnCut,elementCut,lower,upper); } newModel->addRows(build); if (rowType_) { // adjust int numberRows=newModel->getNumRows(); char * temp = CoinCopyOfArrayPartial(rowType_,numberRows,numberRowType_); delete [] rowType_; rowType_ = temp; for (int iRow=numberRowType_;iRowsetLogLevel(2); messages_ = CglMessage(); } // Copy constructor. CglPreProcess::CglPreProcess(const CglPreProcess & rhs) : numberSolvers_(rhs.numberSolvers_), defaultHandler_(rhs.defaultHandler_), appData_(rhs.appData_), originalColumn_(NULL), originalRow_(NULL), numberCutGenerators_(rhs.numberCutGenerators_), numberProhibited_(rhs.numberProhibited_), numberIterationsPre_(rhs.numberIterationsPre_), numberIterationsPost_(rhs.numberIterationsPost_), numberRowType_(rhs.numberRowType_), options_(rhs.options_) { if (defaultHandler_) { handler_ = new CoinMessageHandler(); handler_->setLogLevel(rhs.handler_->logLevel()); } else { handler_ = rhs.handler_; } messages_ = rhs.messages_; if (numberCutGenerators_) { generator_ = new CglCutGenerator * [numberCutGenerators_]; for (int i=0;iclone(); } } else { generator_=NULL; } if (rhs.originalModel_) { originalModel_ = rhs.originalModel_; // If no make equality then solvers are same if (rhs.originalModel_!=rhs.startModel_) { startModel_=rhs.startModel_->clone(); } else { startModel_=originalModel_; } } else { originalModel_=NULL; startModel_=NULL; } if (numberSolvers_) { model_ = new OsiSolverInterface * [numberSolvers_]; modifiedModel_ = new OsiSolverInterface * [numberSolvers_]; presolve_ = new OsiPresolve * [numberSolvers_]; for (int i=0;iclone(); modifiedModel_[i]=rhs.modifiedModel_[i]->clone(); presolve_[i]=new OsiPresolve(*rhs.presolve_[i]); } } else { model_=NULL; presolve_=NULL; } numberSOS_=rhs.numberSOS_; if (numberSOS_) { int numberTotal = rhs.startSOS_[numberSOS_]; typeSOS_= CoinCopyOfArray(rhs.typeSOS_,numberSOS_); startSOS_= CoinCopyOfArray(rhs.startSOS_,numberSOS_+1); whichSOS_= CoinCopyOfArray(rhs.whichSOS_,numberTotal); weightSOS_= CoinCopyOfArray(rhs.weightSOS_,numberTotal); } else { typeSOS_ = NULL; startSOS_ = NULL; whichSOS_ = NULL; weightSOS_ = NULL; } prohibited_ = CoinCopyOfArray(rhs.prohibited_,numberProhibited_); rowType_ = CoinCopyOfArray(rhs.rowType_,numberRowType_); cuts_ = rhs.cuts_; } // Assignment operator CglPreProcess & CglPreProcess::operator=(const CglPreProcess& rhs) { if (this!=&rhs) { gutsOfDestructor(); numberSolvers_=rhs.numberSolvers_; defaultHandler_=rhs.defaultHandler_; appData_=rhs.appData_; numberCutGenerators_=rhs.numberCutGenerators_; numberProhibited_ = rhs.numberProhibited_; numberIterationsPre_ = rhs.numberIterationsPre_; numberIterationsPost_ = rhs.numberIterationsPost_; numberRowType_ = rhs.numberRowType_; options_ = rhs.options_; if (defaultHandler_) { handler_ = new CoinMessageHandler(); handler_->setLogLevel(rhs.handler_->logLevel()); } else { handler_ = rhs.handler_; } messages_ = rhs.messages_; if (numberCutGenerators_) { generator_ = new CglCutGenerator * [numberCutGenerators_]; for (int i=0;iclone(); } } if (rhs.originalModel_) { originalModel_ = rhs.originalModel_; // If no make equality then solvers are same if (rhs.originalModel_!=rhs.startModel_) { startModel_=rhs.startModel_->clone(); } else { startModel_=originalModel_; } } else { originalModel_=NULL; startModel_=NULL; } if (numberSolvers_) { model_ = new OsiSolverInterface * [numberSolvers_]; modifiedModel_ = new OsiSolverInterface * [numberSolvers_]; presolve_ = new OsiPresolve * [numberSolvers_]; for (int i=0;iclone(); modifiedModel_[i]=rhs.modifiedModel_[i]->clone(); presolve_[i]=new OsiPresolve(*rhs.presolve_[i]); } } else { model_=NULL; presolve_=NULL; } numberSOS_=rhs.numberSOS_; if (numberSOS_) { int numberTotal = rhs.startSOS_[numberSOS_]; typeSOS_= CoinCopyOfArray(rhs.typeSOS_,numberSOS_); startSOS_= CoinCopyOfArray(rhs.startSOS_,numberSOS_+1); whichSOS_= CoinCopyOfArray(rhs.whichSOS_,numberTotal); weightSOS_= CoinCopyOfArray(rhs.weightSOS_,numberTotal); } else { typeSOS_ = NULL; startSOS_ = NULL; whichSOS_ = NULL; weightSOS_ = NULL; } prohibited_ = CoinCopyOfArray(rhs.prohibited_,numberProhibited_); rowType_ = CoinCopyOfArray(rhs.rowType_,numberRowType_); cuts_ = rhs.cuts_; } return *this; } // Destructor CglPreProcess::~CglPreProcess () { gutsOfDestructor(); } // Clears out as much as possible (except solver) void CglPreProcess::gutsOfDestructor() { if (defaultHandler_) { delete handler_; handler_ = NULL; } if (startModel_!=originalModel_) delete startModel_; startModel_=NULL; //delete originalModel_; originalModel_=NULL; int i; for (i=0;iclone(); } //############################################################################# // Set/Get Application Data // This is a pointer that the application can store into and retrieve // This field is the application to optionally define and use. //############################################################################# void CglPreProcess::setApplicationData(void * appData) { appData_ = appData; } //----------------------------------------------------------------------------- void * CglPreProcess::getApplicationData() const { return appData_; } /* Set cutoff bound on the objective function. When using strict comparison, the bound is adjusted by a tolerance to avoid accidentally cutting off the optimal solution. */ void CglPreProcess::setCutoff(double value) { // Solvers know about direction double direction = originalModel_->getObjSense(); originalModel_->setDblParam(OsiDualObjectiveLimit,value*direction); } // Get the cutoff bound on the objective function - always as minimize double CglPreProcess::getCutoff() const { double value ; originalModel_->getDblParam(OsiDualObjectiveLimit,value) ; return value * originalModel_->getObjSense() ; } // Pass in Message handler (not deleted at end) void CglPreProcess::passInMessageHandler(CoinMessageHandler * handler) { if (defaultHandler_) delete handler_; defaultHandler_=false; handler_=handler; } // Set language void CglPreProcess::newLanguage(CoinMessages::Language language) { messages_ = CglMessage(language); } // Return a pointer to the original columns (without clique slacks) const int * CglPreProcess::originalColumns() { if (!originalColumn_) createOriginalIndices(); return originalColumn_; } // Return a pointer to the original rows const int * CglPreProcess::originalRows() { if (!originalRow_) createOriginalIndices(); return originalRow_; } // create original columns and rows void CglPreProcess::createOriginalIndices() { // Find last model and presolve int iPass; for (iPass=numberSolvers_-1;iPass>=0;iPass--) { if (presolve_[iPass]) break; } int nRows,nColumns; if (iPass>=0) { nRows=model_[iPass]->getNumRows(); nColumns=model_[iPass]->getNumCols(); } else { nRows=originalModel_->getNumRows(); nColumns=originalModel_->getNumCols(); } delete [] originalColumn_; originalColumn_=new int [nColumns]; delete [] originalRow_; originalRow_ = new int[nRows]; if (iPass>=0) { memcpy(originalColumn_,presolve_[iPass]->originalColumns(), nColumns*sizeof(int)); memcpy(originalRow_,presolve_[iPass]->originalRows(), nRows*sizeof(int)); iPass--; for (;iPass>=0;iPass--) { const int * originalColumns = presolve_[iPass]->originalColumns(); int i; for (i=0;ioriginalRows(); int nRowsNow=model_[iPass]->getNumRows(); for (i=0;i=0&&iRoworiginalColumns(); int numberColumns = solver->getNumCols(); // number prohibited must stay constant int n=0; int i; for (i=0;ioriginal[i-1]); char p = prohibited_[iColumn]; if (p) n2++; prohibited_[i]=p; } assert (n==n2); numberProhibited_=numberColumns; } if (rowType_) { const int * original = pinfo->originalRows(); int numberRows = solver->getNumRows(); #ifdef COIN_DEVELOP int nMarked1=0; for (int i=0;igetNumRows();i++) { if (rowType_[i]) nMarked1++; } int nMarked2=0; int k=-1; for (int i=0;inMarked2) printf("Marked rows reduced from %d to %d\n", nMarked1,nMarked2); #endif for (int i=0;ilower[i]) numberContinuous++; if (model.isInteger(i)||fixContinuousAsWell) { if (keep) { if (keep[i]==1) { continue; // always keep } else if (keep[i]==-1) { // always fix dj[number]=-1.0e30; numberThrow++; sort[number++]=i; continue; } } double value = solution[i]; if (valueupper[number]-1.0e-8) { dj[number]=-dj[i]; sort[number++]=i; } } } CoinSort_2(dj,dj+number,sort); int numberToFix = static_cast (numberColumns *(1.0-fractionToKeep)); if (!fixContinuousAsWell) numberToFix = static_cast ((numberColumns-numberContinuous) *(1.0-fractionToKeep)); numberToFix = CoinMax(numberToFix,numberThrow); numberToFix = CoinMin(number,numberToFix); printf("%d columns fixed\n",numberToFix); for (i=0;isetColUpper(iColumn,lower[iColumn]); } else if (value>upper[number]-1.0e-8) { newModel->setColLower(iColumn,lower[iColumn]); } else { // must be a throw away on - go to lower newModel->setColUpper(iColumn,lower[iColumn]); } } return newModel; } // If we have a cutoff - fix variables int CglPreProcess::reducedCostFix(OsiSolverInterface & model) { double cutoff ; model.getDblParam(OsiDualObjectiveLimit,cutoff) ; double direction = model.getObjSense() ; cutoff *= direction; double gap = cutoff - model.getObjValue()*direction ; double tolerance; model.getDblParam(OsiDualTolerance,tolerance) ; if (gap<=0.0||fabs(cutoff)>1.0e20) return 0; gap += 100.0*tolerance; // not really but thats all we can get double integerTolerance; model.getDblParam(OsiPrimalTolerance,integerTolerance) ; int numberColumns = model.getNumCols(); const double *lower = model.getColLower() ; const double *upper = model.getColUpper() ; const double *solution = model.getColSolution() ; const double *reducedCost = model.getReducedCost() ; int numberFixed = 0 ; int iColumn; for (iColumn=0;iColumnlower[iColumn]) { double djValue = direction*reducedCost[iColumn] ; if (solution[iColumn] < lower[iColumn]+integerTolerance && djValue > gap) { model.setColUpper(iColumn,lower[iColumn]) ; numberFixed++ ; } else if (solution[iColumn] > upper[iColumn]-integerTolerance && -djValue > gap) { model.setColLower(iColumn,upper[iColumn]) ; numberFixed++ ; } } } return numberFixed; } // Pass in prohibited columns void CglPreProcess::passInProhibited(const char * prohibited,int numberColumns) { delete [] prohibited_; prohibited_ = CoinCopyOfArray(prohibited,numberColumns); numberProhibited_ = numberColumns; } /* Pass in row types 0 normal 1 cut rows - will be dropped if remain in At end of preprocess cut rows will be dropped and put into cuts */ void CglPreProcess::passInRowTypes(const char * rowTypes,int numberRows) { delete [] rowType_; rowType_ = CoinCopyOfArray(rowTypes,numberRows); numberRowType_ = numberRows; cuts_ = CglStored(); } // Make continuous variables integer void CglPreProcess::makeInteger() { // First check if we need to int numberInteger=0; { const double *lower = startModel_->getColLower() ; const double *upper = startModel_->getColUpper() ; int numberColumns = startModel_->getNumCols() ; int iColumn; int numberContinuous=0; for (iColumn=0;iColumn lower[iColumn]+1.0e-8) { if(startModel_->isInteger(iColumn)) numberInteger++; else numberContinuous++; } } if (!numberContinuous) return; } OsiSolverInterface * solver = startModel_->clone(); const double *objective = solver->getObjCoefficients() ; const double *lower = solver->getColLower() ; const double *upper = solver->getColUpper() ; int numberColumns = solver->getNumCols() ; int numberRows = solver->getNumRows(); double direction = solver->getObjSense(); int iRow,iColumn; // Row copy CoinPackedMatrix matrixByRow(*solver->getMatrixByRow()); const double * elementByRow = matrixByRow.getElements(); const int * column = matrixByRow.getIndices(); const CoinBigIndex * rowStart = matrixByRow.getVectorStarts(); const int * rowLength = matrixByRow.getVectorLengths(); // Column copy CoinPackedMatrix matrixByCol(*solver->getMatrixByCol()); const double * element = matrixByCol.getElements(); const int * row = matrixByCol.getIndices(); const CoinBigIndex * columnStart = matrixByCol.getVectorStarts(); const int * columnLength = matrixByCol.getVectorLengths(); const double * rowLower = solver->getRowLower(); const double * rowUpper = solver->getRowUpper(); char * ignore = new char [numberRows]; int * changed = new int[numberColumns]; int * which = new int[numberRows]; double * changeRhs = new double[numberRows]; memset(changeRhs,0,numberRows*sizeof(double)); memset(ignore,0,numberRows); int numberChanged=0; bool finished=false; while (!finished) { int saveNumberChanged = numberChanged; for (iRow=0;iRow lower[jColumn]+1.0e-8) { if (!solver->isInteger(jColumn)) { if (numberContinuous==0) { jColumn1=jColumn; value1=value; } else { jColumn2=jColumn; value2=value; } numberContinuous++; } else { if (fabs(value-floor(value+0.5))>1.0e-12) allIntegerCoeff=false; } } else { sumFixed += lower[jColumn]*value; } } double low = rowLower[iRow]; if (low>-1.0e20) { low -= sumFixed; if (fabs(low-floor(low+0.5))>1.0e-12) allIntegerCoeff=false; } double up = rowUpper[iRow]; if (up<1.0e20) { up -= sumFixed; if (fabs(up-floor(up+0.5))>1.0e-12) allIntegerCoeff=false; } if (!allIntegerCoeff) continue; // can't do if (numberContinuous==1) { // see if really integer // This does not allow for complicated cases if (low==up) { if (fabs(value1)>1.0e-3) { value1 = 1.0/value1; if (fabs(value1-floor(value1+0.5))<1.0e-12) { // integer changed[numberChanged++]=jColumn1; solver->setInteger(jColumn1); if (upper[jColumn1]>1.0e20) solver->setColUpper(jColumn1,1.0e20); if (lower[jColumn1]<-1.0e20) solver->setColLower(jColumn1,-1.0e20); } } } else { if (fabs(value1)>1.0e-3) { value1 = 1.0/value1; if (fabs(value1-floor(value1+0.5))<1.0e-12) { // This constraint will not stop it being integer ignore[iRow]=1; } } } } else if (numberContinuous==2) { if (low==up) { /* need general theory - for now just look at 2 cases - 1 - +- 1 one in column and just costs i.e. matching objective 2 - +- 1 two in column but feeds into G/L row which will try and minimize */ if (fabs(value1)==1.0&&value1*value2==-1.0&&!lower[jColumn1] &&!lower[jColumn2]) { int n=0; int i; double objChange=direction*(objective[jColumn1]+objective[jColumn2]); double bound = CoinMin(upper[jColumn1],upper[jColumn2]); bound = CoinMin(bound,1.0e20); for ( i=columnStart[jColumn1];i=0.0) { // see if all rows OK bool good=true; for (i=0;i0.0) { double rhs = rowLower[jRow]; if (rhs>0.0) { double ratio =rhs/value; if (fabs(ratio-floor(ratio+0.5))>1.0e-12) good=false; } } else { double rhs = rowUpper[jRow]; if (rhs<0.0) { double ratio =rhs/value; if (fabs(ratio-floor(ratio+0.5))>1.0e-12) good=false; } } } else if (rowLength[jRow]==2) { if (value>0.0) { if (rowLower[jRow]>-1.0e20) good=false; } else { if (rowUpper[jRow]<1.0e20) good=false; } } else { good=false; } } } if (good) { // both can be integer changed[numberChanged++]=jColumn1; solver->setInteger(jColumn1); if (upper[jColumn1]>1.0e20) solver->setColUpper(jColumn1,1.0e20); if (lower[jColumn1]<-1.0e20) solver->setColLower(jColumn1,-1.0e20); changed[numberChanged++]=jColumn2; solver->setInteger(jColumn2); if (upper[jColumn2]>1.0e20) solver->setColUpper(jColumn2,1.0e20); if (lower[jColumn2]<-1.0e20) solver->setColLower(jColumn2,-1.0e20); } } // clear for (i=0;i lower[iColumn]+1.0e-8&&!solver->isInteger(iColumn)) { double value; value = upper[iColumn]; if (value<1.0e20&&fabs(value-floor(value+0.5))>1.0e-12) continue; value = lower[iColumn]; if (value>-1.0e20&&fabs(value-floor(value+0.5))>1.0e-12) continue; bool integer=true; for (CoinBigIndex j=columnStart[iColumn];jsetInteger(iColumn); if (upper[iColumn]>1.0e20) solver->setColUpper(iColumn,1.0e20); if (lower[iColumn]<-1.0e20) solver->setColLower(iColumn,-1.0e20); } } } finished = numberChanged==saveNumberChanged; } delete [] which; delete [] changeRhs; delete [] ignore; //increment=0.0; if (numberChanged) { handler_->message(CGL_MADE_INTEGER,messages_) <isInteger(iColumn)&&objective[iColumn]) startModel_->setInteger(iColumn); } } delete solver; delete [] changed; } //#define BRON_TIMES #ifdef BRON_TIMES static int numberTimesX=0; #endif /* Replace cliques by more maximal cliques Returns NULL if rows not reduced by greater than cliquesNeeded*rows */ OsiSolverInterface * CglPreProcess::cliqueIt(OsiSolverInterface & model, double cliquesNeeded) const { /* Initial arrays * Candidate nodes (columns) First nIn already in Next nCandidate are candidates numberColumns-1 back to nNot are Nots * Starts * Other node * Original row (paired with other node) * CliqueIn expanded array with 1 in, 2 not, 3 out, 0 possible, -1 never * Type (for original row) */ const double *lower = model.getColLower() ; const double *upper = model.getColUpper() ; const double *rowLower = model.getRowLower() ; const double *rowUpper = model.getRowUpper() ; int numberRows = model.getNumRows() ; //int numberColumns = model.getNumCols() ; // Column copy of matrix //const double * element = model.getMatrixByCol()->getElements(); //const int * row = model.getMatrixByCol()->getIndices(); //const CoinBigIndex * columnStart = model.getMatrixByCol()->getVectorStarts(); //const int * columnLength = model.getMatrixByCol()->getVectorLengths(); // Row copy CoinPackedMatrix matrixByRow(*model.getMatrixByRow()); const double * elementByRow = matrixByRow.getElements(); const int * column = matrixByRow.getIndices(); const CoinBigIndex * rowStart = matrixByRow.getVectorStarts(); const int * rowLength = matrixByRow.getVectorLengths(); char * type = new char [numberRows]; int numberElements=0; int numberCliques=0; for (int i=0;i0.0&&rowLower[i]!=1.0)) continue; bool possible = true; CoinBigIndex start = rowStart[i]; CoinBigIndex end = start + rowLength[i]; int n=0; for (CoinBigIndex j=start;j0.0||n!=2) possible=false; if (possible) { numberElements+=n; numberCliques++; if (rowLower[i]>0.0) type[i]=1; else type[i]=0; } } OsiSolverInterface * newSolver = NULL; if (numberCliques>CoinMax(1,static_cast(cliquesNeeded*numberRows))) { #ifdef BRON_TIMES double time1 = CoinCpuTime(); #endif CglBK bk(model,type,numberElements); bk.bronKerbosch(); newSolver = bk.newSolver(model); #ifdef BRON_TIMES printf("Time %g - bron called %d times\n",CoinCpuTime()-time1,numberTimesX); #endif } delete [] type; return newSolver; } // Default constructor CglBK::CglBK() { candidates_=NULL; mark_=NULL; start_=NULL; otherColumn_=NULL; originalRow_=NULL; dominated_=NULL; cliqueMatrix_=NULL; rowType_=NULL; numberColumns_=0; numberRows_=0; numberPossible_=0; numberCandidates_=0; firstNot_=0; numberIn_=0; left_=0; lastColumn_=0; } // Useful constructor CglBK::CglBK(const OsiSolverInterface & model, const char * rowType, int numberElements) { const double *lower = model.getColLower() ; const double *upper = model.getColUpper() ; const double *rowLower = model.getRowLower() ; const double *rowUpper = model.getRowUpper() ; numberRows_ = model.getNumRows() ; numberColumns_ = model.getNumCols() ; // Column copy of matrix #ifndef NDEBUG const double * element = model.getMatrixByCol()->getElements(); #endif const int * row = model.getMatrixByCol()->getIndices(); const CoinBigIndex * columnStart = model.getMatrixByCol()->getVectorStarts(); const int * columnLength = model.getMatrixByCol()->getVectorLengths(); start_ = new CoinBigIndex[numberColumns_+1]; otherColumn_ = new int [numberElements]; candidates_ = new int [2*numberColumns_]; CoinZeroN(candidates_,2*numberColumns_); // for valgrind originalRow_ = new int [numberElements]; dominated_ = new int [numberRows_]; CoinZeroN(dominated_,numberRows_); numberElements=0; numberPossible_=0; rowType_=rowType; // Row copy CoinPackedMatrix matrixByRow(*model.getMatrixByRow()); const double * elementByRow = matrixByRow.getElements(); const int * column = matrixByRow.getIndices(); const CoinBigIndex * rowStart = matrixByRow.getVectorStarts(); const int * rowLength = matrixByRow.getVectorLengths(); #if 1 // take out duplicate doubleton rows double * sort = new double[numberRows_]; int * which = new int [numberRows_]; double * randomValues = new double [numberColumns_]; // Initialize random seed CoinThreadRandom randomGenerator(987654321); for (int i=0;icolumn[last]) { first=last; last=rowStart[i]; } int iColumn1 = column[first]; int iColumn2 = column[last]; double value = elementByRow[first]*randomValues[iColumn1]+ elementByRow[last]*randomValues[iColumn2]; sort[nSort]=value; which[nSort++]=i; } } CoinSort_2(sort,sort+nSort,which); double value=sort[0]; int nDominated=0; for (int i=1;icolumn[last1]) { first1=last1; last1=rowStart[i1]; } int iColumn11 = column[first1]; int iColumn12 = column[last1]; int first2 = rowStart[i2]; int last2 = first2+1; if (column[first2]>column[last2]) { first2=last2; last2=rowStart[i2]; } int iColumn21 = column[first2]; int iColumn22 = column[last2]; if (iColumn11==iColumn21&& iColumn12==iColumn22&& elementByRow[first1]==elementByRow[first2]&& elementByRow[last1]==elementByRow[last2]) { dominated_[i2]=1; nDominated++; } } } value=sort[i]; } //if (nDominated) //printf("%d duplicate doubleton rows!\n",nDominated); delete [] randomValues; delete [] sort; delete [] which; #endif for (int iColumn=0;iColumn=0&&!dominated_[iRow]) { assert(element[j]==1.0); CoinBigIndex r=rowStart[iRow]; assert (rowLength[iRow]==2); int kColumn = column[r]; if (kColumn==iColumn) kColumn=column[r+1]; originalRow_[numberElements]=iRow; otherColumn_[numberElements++]=kColumn; } } if (numberElements>start_[iColumn]) { candidates_[numberPossible_++]=iColumn; } } } start_[numberColumns_]=numberElements; numberCandidates_=numberPossible_; numberIn_=0; firstNot_ = numberPossible_; left_=numberPossible_; lastColumn_=-1; mark_ = new char [numberColumns_]; memset(mark_,0,numberColumns_); cliqueMatrix_=new CoinPackedMatrix(false,0.5,0.0); int n=0; for (int i=0;i=0) n++; } cliqueMatrix_->reserve(CoinMin(100,n),5*numberPossible_); } // Copy constructor . CglBK::CglBK(const CglBK & rhs) { // This only copies data in candidates_ // rest just points candidates_ = CoinCopyOfArray(rhs.candidates_,2*rhs.numberPossible_); mark_=rhs.mark_; start_=rhs.start_; otherColumn_=rhs.otherColumn_; originalRow_=rhs.originalRow_; dominated_=rhs.dominated_; cliqueMatrix_=rhs.cliqueMatrix_; rowType_=rhs.rowType_; numberColumns_=rhs.numberColumns_; numberRows_=rhs.numberRows_; numberPossible_=rhs.numberPossible_; numberCandidates_=rhs.numberCandidates_; firstNot_=rhs.firstNot_; numberIn_=rhs.numberIn_; left_=rhs.left_; lastColumn_=rhs.lastColumn_; } // Assignment operator CglBK & CglBK::operator=(const CglBK& rhs) { if (this!=&rhs) { delete [] candidates_; // This only copies data in candidates_ // rest just points candidates_ = CoinCopyOfArray(rhs.candidates_,2*numberPossible_); mark_=rhs.mark_; start_=rhs.start_; otherColumn_=rhs.otherColumn_; originalRow_=rhs.originalRow_; dominated_=rhs.dominated_; cliqueMatrix_=rhs.cliqueMatrix_; rowType_=rhs.rowType_; numberColumns_=rhs.numberColumns_; numberRows_=rhs.numberRows_; numberPossible_=rhs.numberPossible_; numberCandidates_=rhs.numberCandidates_; firstNot_=rhs.firstNot_; numberIn_=rhs.numberIn_; left_=rhs.left_; lastColumn_=rhs.lastColumn_; } return *this; } // Destructor CglBK::~CglBK () { delete [] candidates_; // only deletes if left_==-1 if (left_==-1) { delete [] mark_; delete [] start_; delete [] otherColumn_; delete [] originalRow_; delete [] dominated_; delete cliqueMatrix_; } } // For Bron-Kerbosch void CglBK::bronKerbosch() { #ifdef BRON_TIMES numberTimesX++; if ((numberTimesX%1000)==0) printf("times %d - %d candidates left\n",numberTimesX,numberCandidates_); #endif if (!numberCandidates_&&firstNot_==numberPossible_) { // mark original rows which are dominated // save if clique size >2 if (numberIn_>2) { double * elements = new double [numberIn_]; int * column = candidates_+numberPossible_; // mark those in clique for (int i=0;iappendRow(numberIn_,column,elements); delete [] elements; } } else { #if 0 int nCplusN=numberCandidates_+(numberPossible_-firstNot_); int iChoose = CoinDrand48()*nCplusN; iChoose=CoinMin(0,nCplusN-1); if (iChoose>=numberCandidates_) { iChoose -= numberCandidates_; iChoose += firstNot_; } #else for (int i=0;i=firstNot_;i--) { int iColumn = candidates_[i]; int n=0; for (int j=start_[iColumn];jnMax) { nMax=n; iChoose=i; } } if (nMaxnMax) { nMax=n; iChoose=i; } } } for (int i=0;i=bk2.firstNot_;i--) { int jColumn = newCandidates[i]; if (mark_[jColumn]) newCandidates[--firstNot]=jColumn; } bk2.firstNot_=firstNot; for (int j=start_[iColumn];jgetNumRows(); printf ("%d rows can be deleted with %d new cliques\n", nDelete,nAdd); OsiSolverInterface * newSolver = NULL; if (nDelete>nAdd) { newSolver = model.clone(); newSolver->deleteRows(nDelete,deleted); double * lower = new double [nAdd]; double * upper = new double [nAdd]; for (int i=0;igetElements(); const int * column = cliqueMatrix_->getIndices(); const CoinBigIndex * rowStart = cliqueMatrix_->getVectorStarts(); //const int * rowLength = cliqueMatrix_->getVectorLengths(); assert (cliqueMatrix_->getNumElements()==rowStart[nAdd]); newSolver->addRows(nAdd,rowStart,column,elementByRow,lower,upper); delete [] lower; delete [] upper; } delete [] deleted; // mark so everything will be deleted left_=-1; return newSolver; } static double multiplier[] = {1.23456789e2,-9.87654321}; static int hashCut (const OsiRowCut & x, int size) { int xN =x.row().getNumElements(); double xLb = x.lb(); double xUb = x.ub(); const int * xIndices = x.row().getIndices(); const double * xElements = x.row().getElements(); unsigned int hashValue; double value=1.0; if (xLb>-1.0e10) value += xLb*multiplier[0]; if (xUb<1.0e10) value += xUb*multiplier[1]; for( int j=0;jsizeof(hashValue)) { assert (sizeof(value)==2*sizeof(hashValue)); union { double d; int i[2]; } xx; xx.d = value; hashValue = (xx.i[0] + xx.i[1]); } else { assert (sizeof(value)==sizeof(hashValue)); union { double d; unsigned int i[2]; } xx; xx.d = value; hashValue = xx.i[0]; } return hashValue%(size); } static bool same (const OsiRowCut & x, const OsiRowCut & y) { int xN =x.row().getNumElements(); int yN =y.row().getNumElements(); bool identical=false; if (xN==yN) { double xLb = x.lb(); double xUb = x.ub(); double yLb = y.lb(); double yUb = y.ub(); if (fabs(xLb-yLb)<1.0e-8&&fabs(xUb-yUb)<1.0e-8) { const int * xIndices = x.row().getIndices(); const double * xElements = x.row().getElements(); const int * yIndices = y.row().getIndices(); const double * yElements = y.row().getElements(); int j; for( j=0;j1.0e-12) break; } identical = (j==xN); } } return identical; } CglUniqueRowCuts::CglUniqueRowCuts(int initialMaxSize, int hashMultiplier) { numberCuts_=0; size_ = initialMaxSize; hashMultiplier_ = hashMultiplier; int hashSize=hashMultiplier_*size_; if (size_) { rowCut_ = new OsiRowCut * [size_]; hash_ = new CglHashLink[hashSize]; } else { rowCut_ = NULL; hash_ = NULL; } for (int i=0;i=0&&sequence= 0 ) { if (j1!=sequence) { int k = hash_[ipos].next; if ( k != -1 ) ipos = k; else break; } else { found = j1; break; } } else { break; } } assert (found>=0); assert (hash_[ipos].index==sequence); // shuffle up while (hash_[ipos].next>=0) { int k = hash_[ipos].next; hash_[ipos]=hash_[k]; ipos=k; } delete cut; // move last to found numberCuts_--; if (numberCuts_) { ipos = hashCut(*rowCut_[numberCuts_],hashSize); while ( true ) { int j1 = hash_[ipos].index; if (j1!=numberCuts_) { int k = hash_[ipos].next; ipos = k; } else { // change hash_[ipos].index=found; rowCut_[found]=rowCut_[numberCuts_]; rowCut_[numberCuts_]=NULL; break; } } } assert (!rowCut_[numberCuts_]); } // Return 0 if added, 1 if not int CglUniqueRowCuts::insertIfNotDuplicate(const OsiRowCut & cut) { int hashSize= size_*hashMultiplier_; if (numberCuts_==size_) { size_ = 2*size_+100; hashSize=hashMultiplier_*size_; OsiRowCut ** temp = new OsiRowCut * [size_]; delete [] hash_; hash_ = new CglHashLink[hashSize]; for (int i=0;i= 0 ) { if ( !same(*temp[i],*temp[j1]) ) { int k = hash_[ipos].next; if ( k != -1 ) ipos = k; else break; } else { found = j1; break; } } else { break; } } if (found<0) { assert (hash_[ipos].next==-1); if (ipos==jpos) { // first hash_[ipos].index=i; } else { // find next space while ( true ) { ++lastHash_; assert (lastHash_1.0e12) bad=true; } if (bad) return 1; OsiRowCut newCut; newCut.setLb(newLb); newCut.setUb(newUb); newCut.setRow(vector); int ipos = hashCut(newCut,hashSize); int found = -1; int jpos=ipos; while ( true ) { int j1 = hash_[ipos].index; if ( j1 >= 0 ) { if ( !same(newCut,*rowCut_[j1]) ) { int k = hash_[ipos].next; if ( k != -1 ) ipos = k; else break; } else { found = j1; break; } } else { break; } } if (found<0) { assert (hash_[ipos].next==-1); if (ipos==jpos) { // first hash_[ipos].index=numberCuts_; } else { // find next space while ( true ) { ++lastHash_; assert (lastHash_setLb(newLb); newCutPtr->setUb(newUb); newCutPtr->setRow(vector); rowCut_[numberCuts_++]=newCutPtr; return 0; } else { return 1; } } else { return -1; } } // Add in cuts as normal cuts and delete void CglUniqueRowCuts::addCuts(OsiCuts & cs) { for (int i=0;i #include #include "CoinMessageHandler.hpp" #include "OsiSolverInterface.hpp" #include "CglStored.hpp" #include "OsiPresolve.hpp" #include "CglCutGenerator.hpp" //############################################################################# /** Class for preProcessing and postProcessing. While cuts can be added at any time in the tree, some cuts are actually just stronger versions of existing constraints. In this case they can replace those constraints rather than being added as new constraints. This is awkward in the tree but reasonable at the root node. This is a general process class which uses other cut generators to strengthen constraints, establish that constraints are redundant, fix variables and find relationships such as x + y == 1. Presolve will also be done. If row names existed they may be replaced by R0000000 etc */ class CglPreProcess { public: ///@name Main methods //@{ /** preProcess problem - returning new problem. If makeEquality true then <= cliques converted to ==. Presolve will be done numberPasses times. Returns NULL if infeasible This version uses default strategy. For more control copy and edit code from this function i.e. call preProcessNonDefault */ OsiSolverInterface * preProcess(OsiSolverInterface & model, bool makeEquality=false, int numberPasses=5); /** preProcess problem - returning new problem. If makeEquality true then <= cliques converted to ==. Presolve will be done numberPasses times. Returns NULL if infeasible This version assumes user has added cut generators to CglPreProcess object before calling it. As an example use coding in preProcess If makeEquality is 1 add slacks to get cliques, if 2 add slacks to get sos (but only if looks plausible) and keep sos info */ OsiSolverInterface * preProcessNonDefault(OsiSolverInterface & model, int makeEquality=0, int numberPasses=5, int tuning=0); /// Creates solution in original model void postProcess(OsiSolverInterface &model ,bool deleteStuff=true); /** Tightens primal bounds to make dual and branch and cutfaster. Unless fixed or integral, bounds are slightly looser than they could be. Returns non-zero if problem infeasible Fudge for branch and bound - put bounds on columns of factor * largest value (at continuous) - should improve stability in branch and bound on infeasible branches (0.0 is off) */ int tightenPrimalBounds(OsiSolverInterface & model,double factor=0.0); /** Fix some of problem - returning new problem. Uses reduced costs. Optional signed character array 1 always keep, -1 always discard, 0 use djs */ OsiSolverInterface * someFixed(OsiSolverInterface & model, double fractionToKeep=0.25, bool fixContinuousAsWell=false, char * keep=NULL) const; /** Replace cliques by more maximal cliques Returns NULL if rows not reduced by greater than cliquesNeeded*rows */ OsiSolverInterface * cliqueIt(OsiSolverInterface & model, double cliquesNeeded=0.0) const; /// If we have a cutoff - fix variables int reducedCostFix(OsiSolverInterface & model); //@} //--------------------------------------------------------------------------- /**@name Parameter set/get methods The set methods return true if the parameter was set to the given value, false if the value of the parameter is out of range. The get methods return the value of the parameter. */ //@{ /** Set cutoff bound on the objective function. When using strict comparison, the bound is adjusted by a tolerance to avoid accidentally cutting off the optimal solution. */ void setCutoff(double value) ; /// Get the cutoff bound on the objective function - always as minimize double getCutoff() const; /// The original solver associated with this model. inline OsiSolverInterface * originalModel() const { return originalModel_;} /// Solver after making clique equalities (may == original) inline OsiSolverInterface * startModel() const { return startModel_;} /// Copies of solver at various stages after presolve inline OsiSolverInterface * modelAtPass(int iPass) const { if (iPass>=0&&iPass=0&&iPass=0&&iPass #include //#include //#include #include "CoinPragma.hpp" #include "CglCutGenerator.hpp" #include "CoinHelperFunctions.hpp" //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglCutGenerator::CglCutGenerator () : aggressive_(0), canDoGlobalCuts_(false) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglCutGenerator::CglCutGenerator ( const CglCutGenerator & source) : aggressive_(source.aggressive_), canDoGlobalCuts_(source.canDoGlobalCuts_) { // nothing to do here } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglCutGenerator::~CglCutGenerator () { // nothing to do here } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglCutGenerator & CglCutGenerator::operator=( const CglCutGenerator& rhs) { if (this != &rhs) { aggressive_ = rhs.aggressive_; canDoGlobalCuts_ = rhs.canDoGlobalCuts_; } return *this; } bool CglCutGenerator::mayGenerateRowCutsInTree() const { return true; } // Return true if needs optimal basis to do cuts bool CglCutGenerator::needsOptimalBasis() const { return false; } #ifdef NDEBUG #undef NDEBUG #endif #if 0 //-------------------------------------------------------------------------- // test EKKsolution methods. //-------------------------------------------------------------------------- void CglCutGenerator::unitTest() { } #endif Cgl-0.58.9/src/CglParam.hpp0000644000076600007660000000457012130104734013767 0ustar coincoin// Name: CglParam.hpp // Author: Francois Margot // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // email: fmargot@andrew.cmu.edu // Date: 11/24/06 // // $Id: CglParam.hpp 1123 2013-04-06 20:47:24Z stefan $ // // This code is licensed under the terms of the Eclipse Public License (EPL). //----------------------------------------------------------------------------- // Copyright (C) 2006, Francois Margot and others. All Rights Reserved. #ifndef CglParam_H #define CglParam_H #include "CglConfig.h" #include "CoinFinite.hpp" /** Class collecting parameters for all cut generators. Each generator may have a derived class to add parameters. Each generator might also set different default values for the parameters in CglParam. */ class CglParam { public: /**@name Public Set/get methods */ //@{ /** Set INFINIT */ virtual void setINFINIT(const double inf); /** Get value of INFINIT */ inline double getINFINIT() const {return INFINIT;} /** Set EPS */ virtual void setEPS(const double eps); /** Get value of EPS */ inline double getEPS() const {return EPS;} /** Set EPS_COEFF */ virtual void setEPS_COEFF(const double eps_c); /** Get value of EPS_COEFF */ inline double getEPS_COEFF() const {return EPS_COEFF;} /** Set MAX_SUPPORT */ virtual void setMAX_SUPPORT(const int max_s); /** Get value of MAX_SUPPORT */ inline int getMAX_SUPPORT() const {return MAX_SUPPORT;} //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglParam(const double inf = COIN_DBL_MAX, const double eps = 1e-6, const double eps_c = 1e-5, const int max_s = COIN_INT_MAX); /// Copy constructor CglParam(const CglParam&); /// Clone virtual CglParam* clone() const; /// Assignment operator CglParam& operator=(const CglParam &rhs); /// Destructor virtual ~CglParam(); //@} protected: // Protected member data /**@name Protected member data */ //@{ // Value for infinity. Default: COIN_DBL_MAX. double INFINIT; // EPSILON for double comparisons. Default: 1e-6. double EPS; // Returned cuts do not have coefficients with absolute value smaller // than EPS_COEFF. Default: 1e-5. double EPS_COEFF; /** Maximum number of non zero coefficients in a generated cut; Default: COIN_INT_MAX */ int MAX_SUPPORT; //@} }; #endif Cgl-0.58.9/src/CglRedSplit/0000755000076600007660000000000012377555671013765 5ustar coincoinCgl-0.58.9/src/CglRedSplit/CglRedSplit.cpp0000644000076600007660000014660612130104734016633 0ustar coincoin// Last edit: 4/20/07 // // Name: CglRedSplit.cpp // Author: Francois Margot // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 2/6/05 // // $Id: CglRedSplit.cpp 1123 2013-04-06 20:47:24Z stefan $ //--------------------------------------------------------------------------- // Copyright (C) 2005, Francois Margot and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include #include #include #include #include //#define RS_TRACE //#define RS_TRACEALL //#define RS_TRACETAB #include "OsiSolverInterface.hpp" #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinIndexedVector.hpp" #include "OsiRowCutDebugger.hpp" #include "CoinFactorization.hpp" #include "CoinWarmStartBasis.hpp" #include "CglRedSplit.hpp" #include "CoinFinite.hpp" //------------------------------------------------------------------- // Generate Gomory Reduce-and-Split cuts //------------------------------------------------------------------- /***************************************************************************/ // Returns (value - floor) but allowing for small errors inline double CglRedSplit::rs_above_integer(double value) { double value2=floor(value); double value3=floor(value+0.5); if (fabs(value3-value)< param.getEPS() * (fabs(value3)+1.0)) return 0.0; return value-value2; } /* rs_above_integer */ /**********************************************************/ void rs_allocmatINT(int ***v, const int m, const int n) { int i; *v = reinterpret_cast (calloc (m, sizeof(int *))); if (*v == NULL) { printf("###ERROR: INTEGER matrix allocation failed\n"); exit(1); } for(i=0; i (calloc (n, sizeof(int))); if ((*v)[i] == NULL) { printf("###ERROR: INTEGER matrix allocation failed\n"); exit(1); } } } /* rs_allocmatINT */ /**********************************************************/ void rs_deallocmatINT(int ***v, const int m, const int /*n*/) { int i; for(i=0; i ((*v)[i])); } free(reinterpret_cast (*v)); } /* rs_deallocmatINT */ /**********************************************************/ void rs_allocmatDBL(double ***v, const int m, const int n) { int i; *v = reinterpret_cast (calloc (m, sizeof(double *))); if (*v == NULL) { printf("###ERROR: DOUBLE matrix allocation failed\n"); exit(1); } for(i=0; i (calloc (n, sizeof(double))); if ((*v)[i] == NULL) { printf("###ERROR: DOUBLE matrix allocation failed\n"); exit(1); } } } /* rs_allocmatDBL */ /**********************************************************/ void rs_deallocmatDBL(double ***v, const int m, const int /*n*/) { int i; for(i=0; i ((*v)[i])); } free(reinterpret_cast (*v)); } /* rs_deallocmatDBL */ /**********************************************************/ void rs_printvecINT(const char *vecstr, const int *x, const int n) { int num, fromto, upto, j, i; num = (n/10) + 1; printf("%s :\n", vecstr); for(j=0; j ((*x0)/b) ; x1 = a*(*x0 - k*b) - k*c ; if(x1 < 0) x1 = x1 + m; *x0 = x1; return(static_cast(x1)/static_cast(m)); } /* rs_genalea */ /***********************************************************************/ void CglRedSplit::update_pi_mat(int r1, int r2, int step) { int j; for(j=0; j (floor(opt_step)); int c_step = f_step + 1; double val_f = norm[r1] + f_step * f_step * norm[r2] - 2 * btb_val * f_step; double val_c = norm[r1] + c_step * c_step * norm[r2] - 2 * btb_val * c_step; if(val_f <= val_c ) { (*step) = f_step; (*reduc) = norm[r1] - val_f; } else { (*step) = c_step; (*reduc) = norm[r1] - val_c; } } /* find_step */ /***************************************************************************/ int CglRedSplit::test_pair(int r1, int r2, double *norm) { int step; double reduc; find_step(r1, r2, &step, &reduc, norm); if(reduc/norm[r1] >= param.getMinReduc()) { update_pi_mat(r1, r2, step); update_redTab(r1, r2, step); norm[r1] = rs_dotProd(contNonBasicTab[r1], contNonBasicTab[r1], nTab); #ifdef RS_TRACEALL printf("Use %d and %d for reduction (step: %d)\n", r1, r2, step); #endif return(1); } return(0); } /* test_pair */ /***************************************************************************/ void CglRedSplit::reduce_contNonBasicTab() { int i, j; double *norm = new double[mTab]; for(i=0; i param.getNormIsZero()) { for(j=i+1; j param.getNormIsZero()) { if((checked[i][j] < changed[i]) || (checked[i][j] < changed[j])) { if(test_pair(i, j, norm)) { changed[i] = iter+1; done = 0; } checked[i][j] = iter; if((checked[j][i] < changed[i]) || (checked[j][i] < changed[j])) { if(test_pair(j, i, norm)) { changed[j] = iter+1; done = 0; } checked[j][i] = iter; } } } } } } iter++; } #ifdef RS_TRACEALL rs_printmatDBL("contNonBasicTab", contNonBasicTab, mTab, nTab); rs_printmatINT("checked", checked, mTab, mTab); rs_printvecINT("changed", changed, mTab); rs_printvecDBL("norm", norm, mTab); rs_printmatINT("pi_mat", pi_mat, mTab, mTab); #endif sum_norms = 0; for(i=0; i f0) { row[locind] += (f-f0)/f0compl; } } for(i=0; i f0) { row[locind] = -ratf0f0compl * fcompl; } else { row[locind] = -f; } } for(i=0; i param.getEPS_ELIM()) { if(rowLower[i] > rowUpper[i] - param.getEPS()) { row[ncol+i] = 0; continue; } int upto = rowStart[i] + rowLength[i]; for(j=rowStart[i]; j param.getEPS_COEFF_LUB()) { min_val = CoinMin(min_val, val); has_lub = 1; nelem++; } } else { if(val > param.getEPS_COEFF()) { min_val = CoinMin(min_val, val); nelem++; } } } double retval = 1; if(norm > 100 * nelem) { retval = 10 * sqrt(norm / nelem); } if(norm < 0.5 * nelem) { retval = 0.5 * sqrt(norm / nelem); } if((retval < 0.02) || (retval > 50)) { return(-1); } if(has_lub) { if((max_val > param.getEPS_COEFF_LUB()) && (max_val < param.getMAXDYN_LUB() * min_val) && (max_val >= min_val)) { return(retval); } } else { if((max_val > param.getEPS_COEFF()) && (max_val < param.getMAXDYN() * min_val) && (max_val >= min_val)) { return(retval); } } #ifdef RS_TRACE printf("CglRedSplit::scale_row(): max_val: %6.6f min_val: %6.6f\n", max_val, min_val); #endif return(-1); } /* row_scale_factor */ /************************************************************************/ int CglRedSplit::generate_packed_row(const double *lclXlp, double *row, int *rowind, double *rowelem, int *card_row, double & rhs) { int i; double scale_f = row_scale_factor(row); double value; if(scale_f < 0) { #ifdef RS_TRACE printf("CglRedSplit::generate_packed_row(): Cut discarded (bad numerical behavior)\n"); #endif return(0); } *card_row = 0; rhs /= scale_f; for(i=0; i param.getEPS_COEFF()) { rowind[*card_row] = i; rowelem[*card_row] = value; (*card_row)++; if(*card_row > param.getMAX_SUPPORT()) { #ifdef RS_TRACE printf("CglRedSplit::generate_packed_row(): Cut discarded (too many non zero)\n"); #endif return(0); } } else { if((value > 0.0) && (!low_is_lub[i])) { rhs -= value * colLower[i]; } else if((value < 0.0) && (!up_is_lub[i])) { rhs -= value * colUpper[i]; } else if(fabs(value) > param.getEPS_COEFF_LUB()) { // take anyway rowind[*card_row] = i; rowelem[*card_row] = value; (*card_row)++; if(*card_row > param.getMAX_SUPPORT()) { #ifdef RS_TRACE printf("CglRedSplit::generate_packed_row(): Cut discarded since too many non zero coefficients\n"); #endif return(0); } } } } value = 0; for(i=0; i<(*card_row); i++) { value += lclXlp[rowind[i]] * rowelem[i]; } if(value > rhs) { value -= rhs; if(value < param.getMINVIOL()) { #ifdef RS_TRACE printf("CglRedSplit::generate_packed_row(): Cut discarded: violation: %12.10f\n", value); #endif return(0); } } return(1); } /* generate_packed_row */ // TO BE REMOVED /***********************************************************************/ void CglRedSplit::setLimit(int limit) { if (limit>0) param.setMAX_SUPPORT(limit); } /* setLimit */ /***********************************************************************/ int CglRedSplit::getLimit() const { return param.getMAX_SUPPORT(); } /* getLimit */ /***********************************************************************/ void CglRedSplit::setAway(double value) { if (value>0.0 && value<=0.5) param.setAway(value); } /***********************************************************************/ double CglRedSplit::getAway() const { return param.getAway(); } /***********************************************************************/ void CglRedSplit::setMaxTab(double value) { if (value > 10) { param.setMaxTab(value); } else { printf("### WARNING: CglRedSplit::setMaxTab(): value: %f ignored\n", value); } } /***********************************************************************/ double CglRedSplit::getMaxTab() const { return param.getMaxTab(); } /***********************************************************************/ void CglRedSplit::setLUB(double value) { if (value > 0.0) { param.setLUB(value); } else { printf("### WARNING: CglRedSplit::setLUB(): value: %f ignored\n", value); } } /* setLUB */ /***********************************************************************/ double CglRedSplit::getLUB() const { return param.getLUB(); } /* getLUB */ /***********************************************************************/ void CglRedSplit::setEPS(double value) { if (value>0.0 && value<=0.1) { param.setEPS(value); } else { printf("### WARNING: CglRedSplit::setEPS(): value: %f ignored\n", value); } } /* setEPS */ /***********************************************************************/ double CglRedSplit::getEPS() const { return param.getEPS(); } /* getEPS */ /***********************************************************************/ void CglRedSplit::setEPS_COEFF(double value) { if (value > 0.0 && value <= 0.1) { param.setEPS_COEFF(value); } else { printf("### WARNING: CglRedSplit::setEPS_COEFF(): value: %f ignored\n", value); } } /* setEPS_COEFF */ /***********************************************************************/ double CglRedSplit::getEPS_COEFF() const { return param.getEPS_COEFF(); } /* getEPS_COEFF */ /***********************************************************************/ void CglRedSplit::setEPS_COEFF_LUB(double value) { if (value > 0.0 && value <= 0.1) { param.setEPS_COEFF_LUB(value); } else { printf("### WARNING: CglRedSplit::setEPS_COEFF_LUB(): value: %f ignored\n", value); } } /* setEPS_COEFF_LUB */ /***********************************************************************/ double CglRedSplit::getEPS_COEFF_LUB() const { return param.getEPS_COEFF_LUB(); } /* getEPS_COEFF_LUB */ /***********************************************************************/ void CglRedSplit::setEPS_RELAX(double value) { if (value > 0.0 && value <= 0.1) { param.setEPS_RELAX_ABS(value); } else { printf("### WARNING: CglRedSplit::setEPS_RELAX(): value: %f ignored\n", value); } } /* setEPS_RELAX */ /***********************************************************************/ double CglRedSplit::getEPS_RELAX() const { return param.getEPS_RELAX_ABS(); } /* getEPS_RELAX */ /***********************************************************************/ void CglRedSplit::setNormIsZero(double value) { if (value>0.0 && value<=1) { param.setNormIsZero(value); } else { printf("### WARNING: CglRedSplit::setNormIsZero(): value: %f ignored\n", value); } } /* setNormIsZero */ /***********************************************************************/ double CglRedSplit::getNormIsZero() const { return param.getNormIsZero(); } /* getNormIsZero */ /***********************************************************************/ void CglRedSplit::setMinReduc(double value) { if (value>0.0 && value<=1) { param.setMinReduc(value); } else { printf("### WARNING: CglRedSplit::MinReduc(): value: %f ignored\n", value); } } /* setMinReduc */ /***********************************************************************/ double CglRedSplit::getMinReduc() const { return param.getMinReduc(); } /* getMinReduc */ /************************************************************************/ void CglRedSplit::set_given_optsol(const double *given_sol, int card_sol) { given_optsol = given_sol; card_given_optsol = card_sol; } /* set_given_optsol */ /************************************************************************/ void CglRedSplit::check_optsol(const int calling_place, const double *lclXlp, const double *slack_val, const int do_flip) { if(card_given_optsol != ncol) { printf("### ERROR: CglRedSplit(): card_given_optsol: %d ncol: %d\n", card_given_optsol, ncol); exit(1); } int i; double *ck_slack = new double[nrow]; #ifdef RS_TRACEALL print(); #endif byRow->timesMinor(given_optsol, ck_slack); int irow; for(irow=0; irow ck_rhs + param.getEPS())) { printf("### ERROR: CglRedSplit::check_optsol(): Cut %d cuts given_optsol\n", irow); rs_printvecDBL("ck_row", ck_row, ncol+nrow); printf("lhs: %f rhs: %f calling_place: %d\n", ck_lhs, ck_rhs, calling_place); exit(1); } } delete[] ck_slack; delete[] ck_row; } /* check_optsol */ /************************************************************************/ void CglRedSplit::check_optsol(const int calling_place, const double * /*lclXlp*/, const double *slack_val, const double *ck_row, const double ck_rhs, const int cut_number, const int do_flip) { if(card_given_optsol != ncol) { printf("### ERROR: CglRedSplit(): card_given_optsol: %d ncol: %d\n", card_given_optsol, ncol); exit(1); } double *cpy_row = new double[ncol+nrow]; double *ck_slack = new double[nrow]; #ifdef RS_TRACEALL print(); #endif int i, irow; for(i=0; itimesMinor(given_optsol, ck_slack); for(irow=0; irow ck_rhs + adjust_rhs + param.getEPS()) { printf("### ERROR: CglRedSplit::check_optsol(): Cut %d cuts given_optsol\n", cut_number); rs_printvecDBL("cpy_row", cpy_row, ncol+nrow); printf("lhs: %f rhs: %f calling_place: %d\n", ck_lhs, ck_rhs + adjust_rhs, calling_place); exit(1); } delete[] cpy_row; delete[] ck_slack; } /* check_optsol */ /************************************************************************/ bool CglRedSplit::rs_are_different_vectors(const int *vect1, const int *vect2, const int dim) { int i; for(i=0; i 1e-6) { printf("### ERROR: rs_are_different_vectors(): vect1[%d]: %12.8f vect2[%d]: %12.8f\n", i, vect1[i], i, vect2[i]); return(0); } } return(1); } /* rs_are_different_vectors */ /************************************************************************/ bool CglRedSplit::rs_are_different_matrices(const CoinPackedMatrix *mat1, const CoinPackedMatrix *mat2, const int nmaj, const int /*nmin*/) { const int *matStart1 = mat1->getVectorStarts(); const double *matElements1 = mat1->getElements(); const int *matIndices1 = mat1->getIndices(); const int *matRowLength1 = mat1->getVectorLengths(); const int *matStart2 = mat2->getVectorStarts(); const double *matElements2 = mat2->getElements(); const int *matIndices2 = mat2->getIndices(); const int *matRowLength2 = mat2->getVectorLengths(); int i, j; for(i=0; i 1e-6) { printf("### ERROR: rs_are_different_matrices(): matElements1[%d]: %12.8f matElements2[%d]: %12.8f\n", j, matElements1[j], j, matElements2[j]); return(1); } } } return(0); } /* rs_are_different_matrices */ /************************************************************************/ void CglRedSplit::generateCuts(const OsiSolverInterface &si, OsiCuts & cs, const CglTreeInfo ) { solver = const_cast(&si); if(solver == NULL) { printf("### WARNING: CglRedSplit::generateCuts(): no solver available.\n"); return; } if(!solver->optimalBasisIsAvailable()) { printf("### WARNING: CglRedSplit::generateCuts(): no optimal basis available.\n"); return; } // Reset some members of CglRedSplit card_intBasicVar_frac = 0; card_intNonBasicVar = 0; card_contNonBasicVar = 0; card_nonBasicAtUpper = 0; card_nonBasicAtLower = 0; // Get basic problem information from solver ncol = solver->getNumCols(); nrow = solver->getNumRows(); colLower = solver->getColLower(); colUpper = solver->getColUpper(); rowLower = solver->getRowLower(); rowUpper = solver->getRowUpper(); rowRhs = solver->getRightHandSide(); xlp = solver->getColSolution(); rowActivity = solver->getRowActivity(); colType = NULL; byRow = solver->getMatrixByRow(); solver->enableFactorization(); generateCuts(cs); solver->disableFactorization(); } /* generateCuts */ /************************************************************************/ void CglRedSplit::generateCuts(OsiCuts &cs) { int i; low_is_lub = new int[ncol]; up_is_lub = new int[ncol]; is_integer = new int[ncol]; compute_is_lub(); compute_is_integer(); int *cstat = new int[ncol]; int *rstat = new int[nrow]; solver->getBasisStatus(cstat, rstat); // 0: free 1: basic // 2: upper 3: lower int *basis_index = new int[nrow]; // basis_index[i] = // index of pivot var in row i // (slack if number >= ncol) #ifdef RS_TRACETAB rs_printvecINT("cstat", cstat, ncol); rs_printvecINT("rstat", rstat, nrow); #endif solver->getBasics(basis_index); cv_intBasicVar_frac = new int[ncol]; intBasicVar_frac = new int[ncol]; intNonBasicVar = new int[ncol]; contNonBasicVar = new int[ncol+nrow]; nonBasicAtUpper = new int[ncol+nrow]; nonBasicAtLower = new int[ncol+nrow]; double dist_int; for(i=0; i param.getAway()) && (dist_int < 1 - param.getAway())) { cv_intBasicVar_frac[i] = 1; card_intBasicVar_frac++; // intBasicVar_frac computed below, // as order must be according to selected rows } break; case 2: // Non basic at upper bound: must be flipped and shifted // so that it becomes non negative with lower bound 0 // It is assumed that bounds for integer variables have been // tightend so that non basic integer structural variables // have integer values nonBasicAtUpper[card_nonBasicAtUpper] = i; card_nonBasicAtUpper++; if(is_integer[i]) { intNonBasicVar[card_intNonBasicVar] = i; card_intNonBasicVar++; } else { contNonBasicVar[card_contNonBasicVar] = i; card_contNonBasicVar++; } break; case 3 : // non basic at lower bound: must be shifted so that it becomes // non negative with lower bound 0 // It is assumed that bounds for integer variables have been // tightend so that they are integer nonBasicAtLower[card_nonBasicAtLower] = i; card_nonBasicAtLower++; if(is_integer[i]) { intNonBasicVar[card_intNonBasicVar] = i; card_intNonBasicVar++; } else { contNonBasicVar[card_contNonBasicVar] = i; card_contNonBasicVar++; } break; default: // free variable ? Don't know how to handle printf("### ERROR: CglRedSplit::generateCuts(): cstat[%d]: %d\n", i, cstat[i]); exit(1); break; } } for(i=0; i (card_contNonBasicVar); double nc3 = nc * nc * nc; if(nc3 > param.getMaxTab()) { new_mTab = static_cast (sqrt(param.getMaxTab()/card_contNonBasicVar)); } else { #if defined(_MSC_VER) new_mTab = static_cast (pow(param.getMaxTab(), 1./3.)); #else new_mTab = static_cast (cbrt(param.getMaxTab())); #endif } if(new_mTab == 0) { delete[] cstat; delete[] rstat; delete[] basis_index; delete[] cv_intBasicVar_frac; delete[] intBasicVar_frac; delete[] intNonBasicVar; delete[] contNonBasicVar; delete[] nonBasicAtUpper; delete[] nonBasicAtLower; delete[] low_is_lub; delete[] up_is_lub; delete[] is_integer; return; // no cuts can be generated } int start = 0; // first row for selecting intBasicVar_frac, if too many. // Removing rows used for generation whose pivot is some // var in intBasicVar_frac is valid since the corresponding // column in the optimal tableau is a column of the // identity matrix if(new_mTab < card_intBasicVar_frac) { // Remove some of the rows used for generation. // Poor randomness; could do better if needed int seed = card_intBasicVar_frac; start = static_cast (nrow * rs_genalea(&seed)); #ifdef RS_TRACE printf("CglRedSlpit::generateCuts(): mTab: %d new_mTab: %d\n", card_intBasicVar_frac, new_mTab); #endif card_intBasicVar_frac = new_mTab; } double *slack_val = new double[nrow]; for(i=0; igetRightHandSide(); if(rs_are_different_vectors(rowRhs, solver_rhs, nrow)) { printf("### ERROR: CglRedSplit::generateCuts(): rowRhs[%d]: %12.f solver_rhs[%d]: %12.f\n", i, rowRhs[i], i, solver_rhs[i]); exit(1); } #endif double *z = new double[ncol]; // workspace to get row of the tableau double *slack = new double[nrow]; // workspace to get row of the tableau #ifdef RS_TRACETAB printOptTab(solver); #endif mTab = card_intBasicVar_frac; nTab = card_contNonBasicVar; rhsTab = new double[mTab]; int card_rowTab = 0; rs_allocmatDBL(&contNonBasicTab, mTab, nTab); rs_allocmatDBL(&intNonBasicTab, mTab, card_intNonBasicVar); card_intBasicVar_frac = 0; // recompute in pivot order for(i=0; i nrow) { ind_row -= nrow; } if(basis_index[ind_row] >= ncol) { continue; } if(cv_intBasicVar_frac[basis_index[ind_row]] == 1) { // row used in generation intBasicVar_frac[card_intBasicVar_frac] = basis_index[ind_row]; card_intBasicVar_frac++; rhsTab[card_rowTab] = xlp[basis_index[ind_row]]; solver->getBInvARow(ind_row, z, slack); int ii; for(ii=0; iigetElements(); const int *rowStart = byRow->getVectorStarts(); const int *indices = byRow->getIndices(); const int *rowLength = byRow->getVectorLengths(); for(i=0; i 0.0) { adjust += fabs(tabrowrhs) * param.getEPS_RELAX_REL(); } rc.setUb(tabrowrhs + adjust); // relax the constraint slightly cs.insertIfNotDuplicate(rc, CoinAbsFltEq(param.getEPS_COEFF())); } } } delete[] cstat; delete[] rstat; delete[] basis_index; delete[] slack; delete[] z; delete[] slack_val; delete[] row; delete[] rowind; delete[] rowelem; delete[] cv_intBasicVar_frac; delete[] intBasicVar_frac; delete[] intNonBasicVar; delete[] contNonBasicVar; delete[] nonBasicAtUpper; delete[] nonBasicAtLower; delete[] low_is_lub; delete[] up_is_lub; delete[] is_integer; rs_deallocmatDBL(&contNonBasicTab, mTab, nTab); rs_deallocmatDBL(&intNonBasicTab, mTab, card_intNonBasicVar); rs_deallocmatINT(&pi_mat, mTab, mTab); delete[] rhsTab; //return(cs.sizeRowCuts()); } /* generateCuts */ /***********************************************************************/ void CglRedSplit::setParam(const CglRedSplitParam &source) { param = source; } /* setParam */ /***********************************************************************/ void CglRedSplit::compute_is_lub() { int i; for(i=0; i param.getLUB()) { up_is_lub[i] = 1; } if(fabs(colLower[i]) > param.getLUB()) { low_is_lub[i] = 1; } } } /* compute_is_lub */ /***********************************************************************/ void CglRedSplit::compute_is_integer() { int i; if(colType != NULL) { for(i=0; iisInteger(i)) { is_integer[i] = 1; } else { if((colUpper[i] - colLower[i] < param.getEPS()) && (rs_above_integer(colUpper[i]) < param.getEPS())) { // continuous variable fixed to an integer value is_integer[i] = 1; } else { is_integer[i] = 0; } } } } } /* compute_is_integer */ /***********************************************************************/ void CglRedSplit::print() const { rs_printvecINT("intBasicVar_frac", intBasicVar_frac, card_intBasicVar_frac); rs_printmatINT("pi_mat", pi_mat, card_intBasicVar_frac, card_intBasicVar_frac); rs_printvecINT("intNonBasicVar", intNonBasicVar, card_intNonBasicVar); rs_printmatDBL("intNonBasicTab", intNonBasicTab, card_intBasicVar_frac, card_intNonBasicVar); rs_printvecINT("contNonBasicVar", contNonBasicVar, card_contNonBasicVar); rs_printmatDBL("contNonBasicTab", contNonBasicTab, card_intBasicVar_frac, card_contNonBasicVar); rs_printvecINT("nonBasicAtLower", nonBasicAtLower, card_nonBasicAtLower); rs_printvecINT("nonBasicAtUpper", nonBasicAtUpper, card_nonBasicAtUpper); } /* print */ /***********************************************************************/ void CglRedSplit::printOptTab(OsiSolverInterface *lclSolver) const { int i; int *cstat = new int[ncol]; int *rstat = new int[nrow]; lclSolver->getBasisStatus(cstat, rstat); // 0: free 1: basic // 2: upper 3: lower int *basis_index = new int[nrow]; // basis_index[i] = // index of pivot var in row i // (slack if number >= ncol) lclSolver->getBasics(basis_index); double *z = new double[ncol]; // workspace to get row of the tableau double *slack = new double[nrow]; // workspace to get row of the tableau double *slack_val = new double[nrow]; for(i=0; igetReducedCost(); const double *dual = lclSolver->getRowPrice(); const double *solution = lclSolver->getColSolution(); rs_printvecINT("cstat", cstat, ncol); rs_printvecINT("rstat", rstat, nrow); rs_printvecINT("basis_index", basis_index, nrow); rs_printvecDBL("solution", solution, ncol); rs_printvecDBL("slack_val", slack_val, nrow); rs_printvecDBL("reduced_costs", rc, ncol); rs_printvecDBL("dual solution", dual, nrow); printf("Optimal Tableau:\n"); for(i=0; igetBInvARow(i, z, slack); int ii; for(ii=0; iigetObjValue()); delete[] cstat; delete[] rstat; delete[] basis_index; delete[] slack; delete[] z; delete[] slack_val; } /* printOptTab */ /*********************************************************************/ CglRedSplit::CglRedSplit() : CglCutGenerator(), nrow(0), ncol(0), card_intBasicVar_frac(0), card_intNonBasicVar(0), card_contNonBasicVar(0), card_nonBasicAtUpper(0), card_nonBasicAtLower(0), cv_intBasicVar_frac(0), intBasicVar_frac(0), intNonBasicVar(0), contNonBasicVar(0), nonBasicAtUpper(0), nonBasicAtLower(0), mTab(0), nTab(0), pi_mat(0), contNonBasicTab(0), intNonBasicTab(0), rhsTab(0), given_optsol(0), card_given_optsol(0) {} /*********************************************************************/ CglRedSplit::CglRedSplit(const CglRedSplitParam &RS_param) : CglCutGenerator(), nrow(0), ncol(0), card_intBasicVar_frac(0), card_intNonBasicVar(0), card_contNonBasicVar(0), card_nonBasicAtUpper(0), card_nonBasicAtLower(0), cv_intBasicVar_frac(0), intBasicVar_frac(0), intNonBasicVar(0), contNonBasicVar(0), nonBasicAtUpper(0), nonBasicAtLower(0), mTab(0), nTab(0), pi_mat(0), contNonBasicTab(0), intNonBasicTab(0), rhsTab(0), given_optsol(0), card_given_optsol(0) { param = RS_param; } /*********************************************************************/ CglRedSplit::CglRedSplit (const CglRedSplit & source) : CglCutGenerator(source), param(source.param), nrow(0), ncol(0), card_intBasicVar_frac(0), card_intNonBasicVar(0), card_contNonBasicVar(0), card_nonBasicAtUpper(0), card_nonBasicAtLower(0), cv_intBasicVar_frac(NULL), intBasicVar_frac(NULL), intNonBasicVar(NULL), contNonBasicVar(NULL), nonBasicAtUpper(NULL), nonBasicAtLower(NULL), mTab(0), nTab(0), pi_mat(NULL), contNonBasicTab(NULL), intNonBasicTab(NULL), rhsTab(NULL), given_optsol(source.given_optsol), card_given_optsol(source.card_given_optsol) {} /*********************************************************************/ CglCutGenerator * CglRedSplit::clone() const { return new CglRedSplit(*this); } /*********************************************************************/ CglRedSplit::~CglRedSplit () {} /*********************************************************************/ CglRedSplit & CglRedSplit::operator=(const CglRedSplit &source) { if (this != &source) { CglCutGenerator::operator=(source); param = source.param; given_optsol = source.given_optsol; card_given_optsol = source.card_given_optsol; } return *this; } /*********************************************************************/ // Returns true if needs optimal basis to do cuts bool CglRedSplit::needsOptimalBasis() const { return true; } /*********************************************************************/ // Create C++ lines to get to current state std::string CglRedSplit::generateCpp(FILE * fp) { CglRedSplit other; fprintf(fp,"0#include \"CglRedSplit.hpp\"\n"); fprintf(fp,"3 CglRedSplit redSplit;\n"); if (param.getMAX_SUPPORT()!=other.param.getMAX_SUPPORT()) fprintf(fp,"3 redSplit.setLimit(%d);\n",param.getMAX_SUPPORT()); else fprintf(fp,"4 redSplit.setLimit(%d);\n",param.getMAX_SUPPORT()); if (param.getAway()!=other.param.getAway()) fprintf(fp,"3 redSplit.setAway(%g);\n",param.getAway()); else fprintf(fp,"4 redSplit.setAway(%g);\n",param.getAway()); if (param.getLUB()!=other.param.getLUB()) fprintf(fp,"3 redSplit.setLUB(%g);\n",param.getLUB()); else fprintf(fp,"4 redSplit.setLUB(%g);\n",param.getLUB()); if (param.getEPS()!=other.param.getEPS()) fprintf(fp,"3 redSplit.set.EPS(%g);\n",param.getEPS()); else fprintf(fp,"4 redSplit.setEPS(%g);\n",param.getEPS()); if (param.getEPS_COEFF()!=other.param.getEPS_COEFF()) fprintf(fp,"3 redSplit.setEPS_COEFF(%g);\n",param.getEPS_COEFF()); else fprintf(fp,"4 redSplit.set.EPS_COEFF(%g);\n",param.getEPS_COEFF()); if (param.getEPS_COEFF_LUB()!=other.param.getEPS_COEFF_LUB()) fprintf(fp,"3 redSplit.set.EPS_COEFF_LUB(%g);\n",param.getEPS_COEFF_LUB()); else fprintf(fp,"4 redSplit.set.EPS_COEFF_LUB(%g);\n",param.getEPS_COEFF_LUB()); if (param.getEPS_RELAX_ABS()!=other.param.getEPS_RELAX_ABS()) fprintf(fp,"3 redSplit.set.EPS_RELAX(%g);\n",param.getEPS_RELAX_ABS()); else fprintf(fp,"4 redSplit.set.EPS_RELAX(%g);\n",param.getEPS_RELAX_ABS()); if (param.getNormIsZero()!=other.param.getNormIsZero()) fprintf(fp,"3 redSplit.setNormIsZero(%g);\n",param.getNormIsZero()); else fprintf(fp,"4 redSplit.setNormIsZero(%g);\n",param.getNormIsZero()); if (param.getMinReduc()!=other.param.getMinReduc()) fprintf(fp,"3 redSplit.setMinReduc(%g);\n",param.getMinReduc()); else fprintf(fp,"4 redSplit.setMinReduc(%g);\n",param.getMinReduc()); if (param.getMaxTab()!=other.param.getMaxTab()) fprintf(fp,"3 redSplit.setMaxTab(%g);\n",param.getMaxTab()); else fprintf(fp,"4 redSplit.setMaxTab(%g);\n",param.getMaxTab()); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 redSplit.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 redSplit.setAggressiveness(%d);\n",getAggressiveness()); return "redSplit"; } Cgl-0.58.9/src/CglRedSplit/Makefile.am0000644000076600007660000000332411621724114016000 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglRedSplit # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglRedSplit.la # List all source files for this library, including headers libCglRedSplit_la_SOURCES = \ CglRedSplit.cpp CglRedSplit.hpp \ CglRedSplitTest.cpp \ CglRedSplitParam.cpp CglRedSplitParam.hpp # This is for libtool (on Windows) libCglRedSplit_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglRedSplit.hpp CglRedSplitParam.hpp Cgl-0.58.9/src/CglRedSplit/CglRedSplitParam.cpp0000644000076600007660000001663612130104734017613 0ustar coincoin// Name: CglRedSplitParam.cpp // Author: Francois Margot // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 11/24/06 // // $Id: CglRedSplitParam.cpp 1123 2013-04-06 20:47:24Z stefan $ //--------------------------------------------------------------------------- // Copyright (C) 2006, Francois Margot 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 "CoinPragma.hpp" #include "CglRedSplitParam.hpp" /***********************************************************************/ void CglRedSplitParam::setAway(const double value) { if (value > 0.0 && value <= 0.5) away_ = value; } /***********************************************************************/ void CglRedSplitParam::setMaxTab(const double value) { if (value > 10) { maxTab_ = value; } else { printf("### WARNING: CglRedSplitParam::setMaxTab(): value: %f ignored\n", value); } } /***********************************************************************/ void CglRedSplitParam::setLUB(const double value) { if (value > 0.0) { LUB = value; } else { printf("### WARNING: CglRedSplitParam::setLUB(): value: %f ignored\n", value); } } /* setLUB */ /***********************************************************************/ void CglRedSplitParam::setEPS_ELIM(const double eps_el) { if(eps_el >= 0) EPS_ELIM = eps_el; } /* setEPS_ELIM */ /***********************************************************************/ void CglRedSplitParam::setEPS_RELAX_ABS(const double eps_ra) { if(eps_ra >= 0) EPS_RELAX_ABS = eps_ra; } /* setEPS_RELAX_ABS */ /***********************************************************************/ void CglRedSplitParam::setEPS_RELAX_REL(const double eps_rr) { if(eps_rr >= 0) EPS_RELAX_REL = eps_rr; } /* setEPS_RELAX_REL */ /***********************************************************************/ void CglRedSplitParam::setMAXDYN(double value) { if (value > 1.0) { MAXDYN = value; } else { printf("### WARNING: CglRedSplit::setMAXDYN(): value: %f ignored\n", value); } } /* setMAXDYN */ /***********************************************************************/ void CglRedSplitParam::setMAXDYN_LUB(double value) { if (value > 1.0) { MAXDYN_LUB = value; } else { printf("### WARNING: CglRedSplit::setMAXDYN_LUB(): value: %f ignored\n", value); } } /* setMAXDYN_LUB */ /***********************************************************************/ void CglRedSplitParam::setEPS_COEFF_LUB(const double value) { if (value > 0.0 && value <= 0.1) { EPS_COEFF_LUB = value; } else { printf("### WARNING: CglRedSplitParam::setEPS_COEFF_LUB(): value: %f ignored\n", value); } } /* setEPS_COEFF_LUB */ /***********************************************************************/ void CglRedSplitParam::setMINVIOL(double value) { if (value > 0.0 && value <= 0.1) { MINVIOL = value; } else { printf("### WARNING: CglRedSplitParam::setMINVIOL(): value: %f ignored\n", value); } } /* setMINVIOL */ /***********************************************************************/ void CglRedSplitParam::setUSE_INTSLACKS(int value) { USE_INTSLACKS = value; } /* setUSE_INTSLACKS */ /***********************************************************************/ void CglRedSplitParam::setUSE_CG2(int value) { USE_CG2 = value; } /* setUSE_CG2 */ /***********************************************************************/ void CglRedSplitParam::setNormIsZero(const double value) { if (value > 0.0 && value <= 1) { normIsZero = value; } else { printf("### WARNING: CglRedSplitParam::setNormIsZero(): value: %f ignored\n", value); } } /* setNormIsZero */ /***********************************************************************/ void CglRedSplitParam::setMinReduc(const double value) { if (value > 0.0 && value <= 1) { minReduc = value; } else { printf("### WARNING: CglRedSplitParam::MinReduc(): value: %f ignored\n", value); } } /* setMinReduc */ /***********************************************************************/ CglRedSplitParam::CglRedSplitParam(const double lub, const double eps_el, const double eps_relax_abs, const double eps_relax_rel, const double max_dyn, const double max_dyn_lub, const double eps_coeff_lub, const double min_viol, const int use_int_slacks, const int use_cg2, const double norm_zero, const double min_reduc, const double away, const double max_tab) : CglParam(), LUB(lub), EPS_ELIM(eps_el), EPS_RELAX_ABS(eps_relax_abs), EPS_RELAX_REL(eps_relax_rel), MAXDYN(max_dyn), MAXDYN_LUB(max_dyn_lub), EPS_COEFF_LUB(eps_coeff_lub), MINVIOL(min_viol), USE_INTSLACKS(use_int_slacks), USE_CG2(use_cg2), normIsZero(norm_zero), minReduc(min_reduc), away_(away), maxTab_(max_tab) {} /***********************************************************************/ CglRedSplitParam::CglRedSplitParam(const CglParam &source, const double lub, const double eps_el, const double eps_ra, const double eps_rr, const double max_dyn, const double max_dyn_lub, const double eps_coeff_lub, const double min_viol, const int use_int_slacks, const int use_cg2, const double norm_zero, const double min_reduc, const double away, const double max_tab) : CglParam(source), LUB(lub), EPS_ELIM(eps_el), EPS_RELAX_ABS(eps_ra), EPS_RELAX_REL(eps_rr), MAXDYN(max_dyn), MAXDYN_LUB(max_dyn_lub), EPS_COEFF_LUB(eps_coeff_lub), MINVIOL(min_viol), USE_INTSLACKS(use_int_slacks), USE_CG2(use_cg2), normIsZero(norm_zero), minReduc(min_reduc), away_(away), maxTab_(max_tab) {} /***********************************************************************/ CglRedSplitParam::CglRedSplitParam(const CglRedSplitParam &source) : CglParam(source), LUB(source.LUB), EPS_ELIM(source.EPS_ELIM), EPS_RELAX_ABS(source.EPS_RELAX_ABS), EPS_RELAX_REL(source.EPS_RELAX_REL), MAXDYN(source.MAXDYN), MAXDYN_LUB(source.MAXDYN_LUB), EPS_COEFF_LUB(source.EPS_COEFF_LUB), MINVIOL(source.MINVIOL), USE_INTSLACKS(source.USE_INTSLACKS), USE_CG2(source.USE_CG2), normIsZero(source.normIsZero), minReduc(source.minReduc), away_(source.away_), maxTab_(source.maxTab_) {} /***********************************************************************/ CglRedSplitParam* CglRedSplitParam::clone() const { return new CglRedSplitParam(*this); } /***********************************************************************/ CglRedSplitParam& CglRedSplitParam::operator=(const CglRedSplitParam &rhs) { if(this != &rhs) { CglParam::operator=(rhs); LUB = rhs.LUB; EPS_ELIM = rhs.EPS_ELIM; EPS_RELAX_ABS = rhs.EPS_RELAX_ABS; EPS_RELAX_REL = rhs.EPS_RELAX_REL; MAXDYN = rhs.MAXDYN; MAXDYN_LUB = rhs.MAXDYN_LUB; EPS_COEFF_LUB = rhs.EPS_COEFF_LUB; MINVIOL = rhs.MINVIOL; USE_INTSLACKS = rhs.USE_INTSLACKS; USE_CG2 = rhs.USE_CG2; normIsZero = rhs.normIsZero; minReduc = rhs.minReduc; away_ = rhs.away_; maxTab_ = rhs.maxTab_; } return *this; } /***********************************************************************/ CglRedSplitParam::~CglRedSplitParam() {} Cgl-0.58.9/src/CglRedSplit/Makefile.in0000644000076600007660000005432512240340055016014 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/CglRedSplit 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglRedSplit_la_LIBADD = am_libCglRedSplit_la_OBJECTS = CglRedSplit.lo CglRedSplitTest.lo \ CglRedSplitParam.lo libCglRedSplit_la_OBJECTS = $(am_libCglRedSplit_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 = $(libCglRedSplit_la_SOURCES) DIST_SOURCES = $(libCglRedSplit_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglRedSplit # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglRedSplit.la # List all source files for this library, including headers libCglRedSplit_la_SOURCES = \ CglRedSplit.cpp CglRedSplit.hpp \ CglRedSplitTest.cpp \ CglRedSplitParam.cpp CglRedSplitParam.hpp # This is for libtool (on Windows) libCglRedSplit_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglRedSplit.hpp CglRedSplitParam.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/CglRedSplit/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglRedSplit/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglRedSplit.la: $(libCglRedSplit_la_OBJECTS) $(libCglRedSplit_la_DEPENDENCIES) $(CXXLINK) $(libCglRedSplit_la_LDFLAGS) $(libCglRedSplit_la_OBJECTS) $(libCglRedSplit_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglRedSplit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglRedSplitParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglRedSplitTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglRedSplit/CglRedSplit.hpp0000644000076600007660000003565212130104734016636 0ustar coincoin// Last edit: 4/20/07 // // Name: CglRedSplit.hpp // Author: Francois Margot // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // email: fmargot@andrew.cmu.edu // Date: 2/6/05 // // $Id: CglRedSplit.hpp 1123 2013-04-06 20:47:24Z stefan $ //----------------------------------------------------------------------------- // Copyright (C) 2005, Francois Margot and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef CglRedSplit_H #define CglRedSplit_H #include "CglCutGenerator.hpp" #include "CglRedSplitParam.hpp" /** Gomory Reduce-and-Split Cut Generator Class; See method generateCuts(). Based on the paper by K. Anderson, G. Cornuejols, Yanjun Li, "Reduce-and-Split Cuts: Improving the Performance of Mixed Integer Gomory Cuts", Management Science 51 (2005). */ class CglRedSplit : public CglCutGenerator { friend void CglRedSplitUnitTest(const OsiSolverInterface * siP, const std::string mpdDir); public: /**@name generateCuts */ //@{ /** Generate Reduce-and-Split Mixed Integer Gomory cuts for the model of the solver interface si. Insert the generated cuts into OsiCuts cs. Warning: This generator currently works only with the Lp solvers Clp or Cplex9.0 or higher. It requires access to the optimal tableau and optimal basis inverse and makes assumptions on the way slack variables are added by the solver. The Osi implementations for Clp and Cplex verify these assumptions. When calling the generator, the solver interface si must contain an optimized problem and information related to the optimal basis must be available through the OsiSolverInterface methods (si->optimalBasisIsAvailable() must return 'true'). It is also essential that the integrality of structural variable i can be obtained using si->isInteger(i). Reduce-and-Split cuts are variants of Gomory cuts: Starting from the current optimal tableau, linear combinations of the rows of the current optimal simplex tableau are used for generating Gomory cuts. The choice of the linear combinations is driven by the objective of reducing the coefficients of the non basic continuous variables in the resulting row. Note that this generator might not be able to generate cuts for some solutions violating integrality constraints. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /// Return true if needs optimal basis to do cuts (will return true) virtual bool needsOptimalBasis() const; //@} /**@name Public Methods */ //@{ // Set the parameters to the values of the given CglRedSplitParam object. void setParam(const CglRedSplitParam &source); // Return the CglRedSplitParam object of the generator. inline CglRedSplitParam getParam() const {return param;} // Compute entries of low_is_lub and up_is_lub. void compute_is_lub(); // Compute entries of is_integer. void compute_is_integer(); /// Set given_optsol to the given optimal solution given_sol. /// If given_optsol is set using this method, /// the code will stop as soon as /// a generated cut is violated by the given solution; exclusively /// for debugging purposes. void set_given_optsol(const double *given_sol, const int card_sol); /// Print some of the data members void print() const; /// Print the current simplex tableau void printOptTab(OsiSolverInterface *solver) const; //@} /**@name Public Methods (soon to be obsolete)*/ //@{ //************************************************************ // TO BE REMOVED /** Set limit, the maximum number of non zero coefficients in generated cut; Default: 50 */ void setLimit(int limit); /** Get value of limit */ int getLimit() const; /** Set away, the minimum distance from being integer used for selecting rows for cut generation; all rows whose pivot variable should be integer but is more than away from integrality will be selected; Default: 0.05 */ void setAway(double value); /// Get value of away double getAway() const; /** Set the value of LUB, value considered large for the absolute value of a lower or upper bound on a variable; Default: 1000 */ void setLUB(double value); /** Get the value of LUB */ double getLUB() const; /** Set the value of EPS, epsilon for double computations; Default: 1e-7 */ void setEPS(double value); /** Get the value of EPS */ double getEPS() const; /** Set the value of EPS_COEFF, epsilon for values of coefficients; Default: 1e-8 */ void setEPS_COEFF(double value); /** Get the value of EPS_COEFF */ double getEPS_COEFF() const; /** Set the value of EPS_COEFF_LUB, epsilon for values of coefficients for variables with absolute value of lower or upper bound larger than LUB; Default: 1e-13 */ void setEPS_COEFF_LUB(double value); /** Get the value of EPS_COEFF_LUB */ double getEPS_COEFF_LUB() const; /** Set the value of EPS_RELAX, value used for relaxing the right hand side of each generated cut; Default: 1e-8 */ void setEPS_RELAX(double value); /** Get the value of EPS_RELAX */ double getEPS_RELAX() const; /** Set the value of normIsZero, the threshold for considering a norm to be 0; Default: 1e-5 */ void setNormIsZero(double value); /** Get the value of normIsZero */ double getNormIsZero() const; /** Set the value of minReduc, threshold for relative norm improvement for performing a reduction; Default: 0.05 */ void setMinReduc(double value); /// Get the value of minReduc double getMinReduc() const; /** Set the maximum allowed value for (mTab * mTab * CoinMax(mTab, nTab)) where mTab is the number of rows used in the combinations and nTab is the number of continuous non basic variables. The work of the generator is proportional to (mTab * mTab * CoinMax(mTab, nTab)). Reducing the value of maxTab makes the generator faster, but weaker. Default: 1e7. */ void setMaxTab(double value); /// Get the value of maxTab double getMaxTab() const; // END TO BE REMOVED //************************************************************ //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglRedSplit(); /// Constructor with specified parameters CglRedSplit(const CglRedSplitParam &RS_param); /// Copy constructor CglRedSplit (const CglRedSplit &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglRedSplit & operator=( const CglRedSplit& rhs); /// Destructor virtual ~CglRedSplit (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); //@} private: // Private member methods /**@name Private member methods */ //@{ // Method generating the cuts after all CglRedSplit members are properly set. void generateCuts(OsiCuts & cs); /// Compute the fractional part of value, allowing for small error. inline double rs_above_integer(double value); /// Perform row r1 of pi := row r1 of pi - step * row r2 of pi. void update_pi_mat(int r1, int r2, int step); /// Perform row r1 of tab := row r1 of tab - step * row r2 of tab. void update_redTab(int r1, int r2, int step); /// Find optimal integer step for changing row r1 by adding to it a /// multiple of another row r2. void find_step(int r1, int r2, int *step, double *reduc, double *norm); /// Test if an ordered pair of rows yields a reduction. Perform the /// reduction if it is acceptable. int test_pair(int r1, int r2, double *norm); /// Reduce rows of contNonBasicTab. void reduce_contNonBasicTab(); /// Generate a row of the current LP tableau. void generate_row(int index_row, double *row); /// Generate a mixed integer Chvatal-Gomory cut, when all non basic /// variables are non negative and at their lower bound. int generate_cgcut(double *row, double *rhs); /// Generate a mixed integer Chvatal-Gomory cut, when all non basic /// variables are non negative and at their lower bound (different formula) int generate_cgcut_2(int basic_ind, double *row, double *rhs); /// Use multiples of the initial inequalities to cancel out the coefficients /// of the slack variables. void eliminate_slacks(double *row, const double *elements, const int *start, const int *indices, const int *rowLength, const double *rhs, double *rowrhs); /// Change the sign of the coefficients of the continuous non basic /// variables at their upper bound. void flip(double *row); /// Change the sign of the coefficients of the continuous non basic /// variables at their upper bound and do the translations restoring /// the original bounds. Modify the right hand side /// accordingly. void unflip(double *row, double *rowrhs, double *slack_val); /// Return the scale factor for the row. /// Compute max_coeff: maximum absolute value of the coefficients. /// Compute min_coeff: minimum absolute value of the coefficients /// larger than EPS_COEFF. /// Return -1 if max_coeff < EPS_COEFF or if max_coeff/min_coeff > MAXDYN /// or MAXDYN_LUB (depending if the row has a non zero coeff. for a variable /// with large lower/upper bound) */. double row_scale_factor(double *row); /// Generate the packed cut from the row representation. int generate_packed_row(const double *xlp, double *row, int *rowind, double *rowelem, int *card_row, double & rhs); /// Check that the generated cuts do not cut a given optimal solution. void check_optsol(const int calling_place, const double *xlp, const double *slack_val, const int do_flip); /// Check that the generated cuts do not cut a given optimal solution. void check_optsol(const int calling_place, const double *xlp, const double *slack_val, const double *ck_row, const double ck_rhs, const int cut_number, const int do_flip); // Check that two vectors are different. bool rs_are_different_vectors(const int *vect1, const int *vect2, const int dim); // Check that two vectors are different. bool rs_are_different_vectors(const double *vect1, const double *vect2, const int dim); // Check that two matrices are different. bool rs_are_different_matrices(const CoinPackedMatrix *mat1, const CoinPackedMatrix *mat2, const int nmaj, const int nmin); //@} // Private member data /**@name Private member data */ //@{ /// Object with CglRedSplitParam members. CglRedSplitParam param; /// Number of rows ( = number of slack variables) in the current LP. int nrow; /// Number of structural variables in the current LP. int ncol; /// Lower bounds for structural variables const double *colLower; /// Upper bounds for structural variables const double *colUpper; /// Lower bounds for constraints const double *rowLower; /// Upper bounds for constraints const double *rowUpper; /// Righ hand side for constraints (upper bound for ranged constraints). const double *rowRhs; /// Number of integer basic structural variables that are fractional in the /// current lp solution (at least param.away_ from being integer). int card_intBasicVar_frac; /// Number of integer non basic structural variables in the /// current lp solution. int card_intNonBasicVar; /// Number of continuous non basic variables (structural or slack) in the /// current lp solution. int card_contNonBasicVar; /// Number of non basic variables (structural or slack) at their /// upper bound in the current lp solution. int card_nonBasicAtUpper; /// Number of non basic variables (structural or slack) at their /// lower bound in the current lp solution. int card_nonBasicAtLower; /// Characteristic vector for integer basic structural variables /// with non integer value in the current lp solution. int *cv_intBasicVar_frac; /// List of integer structural basic variables /// (in order of pivot in selected rows for cut generation). int *intBasicVar_frac; /// List of integer structural non basic variables. int *intNonBasicVar; /// List of continuous non basic variables (structural or slack). // slacks are considered continuous (no harm if this is not the case). int *contNonBasicVar; /// List of non basic variables (structural or slack) at their /// upper bound. int *nonBasicAtUpper; /// List of non basic variables (structural or slack) at their lower /// bound. int *nonBasicAtLower; /// Number of rows in the reduced tableau (= card_intBasicVar_frac). int mTab; /// Number of columns in the reduced tableau (= card_contNonBasicVar) int nTab; /// Tableau of multipliers used to alter the rows used in generation. /// Dimensions: mTab by mTab. Initially, pi_mat is the identity matrix. int **pi_mat; /// Current tableau for continuous non basic variables (structural or slack). /// Only rows used for generation. /// Dimensions: mTab by nTab. double **contNonBasicTab; /// Current tableau for integer non basic structural variables. /// Only rows used for generation. // Dimensions: mTab by card_intNonBasicVar. double **intNonBasicTab; /// Right hand side of the tableau. /// Only rows used for generation. double *rhsTab ; /// Given optimal solution that should not be cut; only for debug. const double *given_optsol; /// Number of entries in given_optsol. int card_given_optsol; /// Characteristic vectors of structural integer variables or continuous /// variables currently fixed to integer values. int *is_integer; /// Characteristic vector of the structural variables whose lower bound /// in absolute value is larger than LUB. int *low_is_lub; /// Characteristic vector of the structural variables whose upper bound /// in absolute value is larger than LUB. int *up_is_lub; /// Pointer on solver. Reset by each call to generateCuts(). OsiSolverInterface *solver; /// Pointer on point to separate. Reset by each call to generateCuts(). const double *xlp; /// Pointer on row activity. Reset by each call to generateCuts(). const double *rowActivity; /// Pointer on column type. Reset by each call to generateCuts(). const char *colType; /// Pointer on matrix of coefficient ordered by rows. /// Reset by each call to generateCuts(). const CoinPackedMatrix *byRow; //@} }; //############################################################################# /** A function that tests the methods in the CglRedSplit class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglRedSplitUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglRedSplit/CglRedSplitTest.cpp0000644000076600007660000000553712130104734017470 0ustar coincoin// // Name: CglRedSplit.cpp // Author: Francois Margot // Tepper School of Business // Carnegie Mellon University, Pittsburgh, PA 15213 // Date: 2/6/05 // // $Id: CglRedSplitTest.cpp 1123 2013-04-06 20:47:24Z stefan $ //--------------------------------------------------------------------------- // Copyright (C) 2005, Francois Margot and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include #include #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglRedSplit.hpp" void CglRedSplitUnitTest(const OsiSolverInterface *baseSiP, const std::string mpsDir) { // Test default constructor { CglRedSplit aGenerator; } // Test copy & assignment { CglRedSplit rhs; { CglRedSplit bGenerator; CglRedSplit cGenerator(bGenerator); rhs=bGenerator; } } // Test get/set methods { CglRedSplit getset; CglRedSplitParam gsparam = getset.getParam(); double geps = 10 * gsparam.getEPS(); gsparam.setEPS(geps); double geps2 = gsparam.getEPS(); assert(geps == geps2); double gepse = 10 * gsparam.getEPS_ELIM(); gsparam.setEPS_ELIM(gepse); double gepse2 = gsparam.getEPS_ELIM(); assert(gepse == gepse2); double gmv = 10 * gsparam.getMINVIOL(); gsparam.setMINVIOL(gmv); double gmv2 = gsparam.getMINVIOL(); assert(gmv == gmv2); int gucg = gsparam.getUSE_CG2(); gucg = 1 - gucg; gsparam.setUSE_CG2(gucg); int gucg2 = gsparam.getUSE_CG2(); assert(gucg == gucg2); } // Test generateCuts { CglRedSplit gct; OsiSolverInterface *siP = baseSiP->clone(); std::string fn = mpsDir+"p0033"; std::string fn2 = mpsDir+"p0033.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(),"mps"); siP->initialSolve(); double lpRelax = siP->getObjValue(); OsiCuts cs; gct.getParam().setMAX_SUPPORT(34); gct.getParam().setUSE_CG2(1); // gct.getParam().setUSE_CG2(1); gct.generateCuts(*siP, cs); int nRowCuts = cs.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cs); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); std::cout<<"Initial LP value: "<0 if we want to save info 0 if we don't and -1 if is to be used */ virtual int initializeFixing(const OsiSolverInterface * ) {return 0;} }; /** Derived class to pick up probing info. */ typedef struct { //unsigned int oneFixed:1; // nonzero if variable to 1 fixes all //unsigned int sequence:31; // variable (in matrix) (but also see cliqueRow_) unsigned int fixes; } cliqueEntry; class CglTreeProbingInfo : public CglTreeInfo { public: /// Default constructor CglTreeProbingInfo (); /// Constructor from model CglTreeProbingInfo (const OsiSolverInterface * model); /// Copy constructor CglTreeProbingInfo ( const CglTreeProbingInfo &); /// Clone virtual CglTreeInfo * clone() const; /// Assignment operator CglTreeProbingInfo & operator=( const CglTreeProbingInfo& rhs); /// Destructor virtual ~CglTreeProbingInfo (); OsiSolverInterface * analyze(const OsiSolverInterface & si, int createSolver=0); /** Take action if cut generator can fix a variable (toValue -1 for down, +1 for up) Returns true if still room, false if not */ virtual bool fixes(int variable, int toValue, int fixedVariable,bool fixedToLower); /** Initalizes fixing arrays etc - returns >0 if we want to save info 0 if we don't and -1 if is to be used */ virtual int initializeFixing(const OsiSolverInterface * model) ; /// Fix entries in a solver using implications int fixColumns(OsiSolverInterface & si) const; /// Fix entries in a solver using implications for one variable int fixColumns(int iColumn, int value, OsiSolverInterface & si) const; /// Packs down entries int packDown(); /// Generate cuts from implications void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info) const; /// Entries for fixing variables inline cliqueEntry * fixEntries() { convert(); return fixEntry_;} /// Starts of integer variable going to zero inline int * toZero() { convert(); return toZero_;} /// Starts of integer variable going to one inline int * toOne() { convert(); return toOne_;} /// List of 0-1 integer variables inline int * integerVariable() const { return integerVariable_;} /// Backward look up inline int * backward() const { return backward_;} /// Number of variables inline int numberVariables() const { return numberVariables_;} /// Number of 0-1 variables inline int numberIntegers() const { return numberIntegers_;} private: /// Converts to ordered void convert(); protected: /// Entries for fixing variables cliqueEntry * fixEntry_; /// Starts of integer variable going to zero int * toZero_; /// Starts of integer variable going to one int * toOne_; /// List of 0-1 integer variables int * integerVariable_; /// Backward look up int * backward_; /// Entries for fixing variable when collecting int * fixingEntry_; /// Number of variables int numberVariables_; /// Number of 0-1 variables int numberIntegers_; /// Maximum number in fixEntry_ int maximumEntries_; /// Number entries in fixingEntry_ (and fixEntry_) or -2 if correct style int numberEntries_; }; inline int sequenceInCliqueEntry(const cliqueEntry & cEntry) { return cEntry.fixes&0x7fffffff;} inline void setSequenceInCliqueEntry(cliqueEntry & cEntry,int sequence) { cEntry.fixes = sequence|(cEntry.fixes&0x80000000);} inline bool oneFixesInCliqueEntry(const cliqueEntry & cEntry) { return (cEntry.fixes&0x80000000)!=0;} inline void setOneFixesInCliqueEntry(cliqueEntry & cEntry,bool oneFixes) { cEntry.fixes = (oneFixes ? 0x80000000 : 0)|(cEntry.fixes&0x7fffffff);} #endif Cgl-0.58.9/src/CglZeroHalf/0000755000076600007660000000000012377555671013751 5ustar coincoinCgl-0.58.9/src/CglZeroHalf/CglZeroHalfTest.cpp0000644000076600007660000000472412237743656017461 0ustar coincoin// $Id: CglZeroHalfTest.cpp 1155 2013-11-10 17:51:42Z tkr $ // Copyright (C) 2010, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglZeroHalf.hpp" //#include "CglKnapsackCover.hpp" #include //-------------------------------------------------------------------------- // test the zero half cut generators methods. void CglZeroHalfUnitTest( const OsiSolverInterface * baseSiP, const std::string mpsDir ) { // Test default constructor { CglZeroHalf cg; } // Test copy & assignment { CglZeroHalf rhs; { CglZeroHalf cg; CglZeroHalf cgC(cg); rhs=cg; } } // Test generate cuts method on lseu { CglZeroHalf cg; OsiSolverInterface * siP = baseSiP->clone(); std::string fn = mpsDir+"lseu.mps"; siP->readMps(fn.c_str(),""); // test if there if (!siP->getNumRows()) { printf("** Unable to find lseu in %s\n", mpsDir.c_str()); return; } siP->initialSolve(); cg.refreshSolver(siP); OsiCuts cuts; cg.generateCuts(*siP,cuts); // lseu is the optimal solution to lseu // Optimal IP solution to lseu int objIndices[13]={0,1,6,13,26,33,38,43,50,52,63,65,85}; CoinPackedVector lseu(13,objIndices,1.0); // test that none of the generated cuts // chops off the optimal solution int nRowCuts = cuts.sizeRowCuts(); OsiRowCut rcut; CoinPackedVector rpv; int i; for (i=0; igetObjValue(); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("Final LP min=%f\n\n",lpRelaxAfter); #endif printf("Zero cuts %d\n",nRowCuts); if (!(lpRelaxBefore < lpRelaxAfter)){ printf("***Warning: Bound did not improve after addition of cut.\n"); printf("***This can happen, but is generally not expected\n"); }else{ printf("Good zero %s\n",fn.c_str()); } delete siP; } } Cgl-0.58.9/src/CglZeroHalf/Cgl012cut.hpp0000644000076600007660000004136012231270555016112 0ustar coincoin// $Id: Cgl012cut.hpp 1150 2013-10-21 18:24:45Z tkr $ // Copyright (C) 2010, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). /** @file 012cut.h Include file for C coded 0-1/2 separator */ #ifndef CGL012CUT #define CGL012CUT #include #include #include #define CGL_NEW_SHORT #ifndef CGL_NEW_SHORT typedef /* arc */ struct arc_st { int len; /* length of the arc */ struct node_st *head; /* head node */ } arc; typedef /* node */ struct node_st { arc *first; /* first outgoing arc */ int dist; /* tentative shortest path length */ struct node_st *parent; /* parent pointer */ struct node_st *next; /* next node in queue */ struct node_st *prev; /* previous node in queue */ int status; /* status of node */ int temp; /* for temporary labels */ int index; /* index of the node in the graph */ } node; #endif typedef struct { int length; // Length of arc int to; // To node } cgl_arc; typedef struct { cgl_arc * firstArc; // First outgoing arc int parentNode; // Parent node in shortest path int index; // Which node I am int distanceBack; // Distance back to source } cgl_node; typedef struct { int nnodes; // Number of nodes in graph int narcs; // Number of arcs in graph cgl_node * nodes; cgl_arc * arcs; } cgl_graph; /* #define PRINT */ /* #define PRINT_CUTS */ #define REDUCTION typedef struct { int mr; /* number of rows in the ILP matrix */ int mc; /* number of columns in the ILP matrix */ int mnz; /* number of nonzero's in the ILP matrix */ int *mtbeg; /* starting position of each row in arrays mtind and mtval */ int *mtcnt; /* number of entries of each row in arrays mtind and mtval */ int *mtind; /* column indices of the nonzero entries of the ILP matrix */ int *mtval; /* values of the nonzero entries of the ILP matrix */ int *vlb; /* lower bounds on the variables */ int *vub; /* upper bounds on the variables */ int *mrhs; /* right hand sides of the constraints */ char *msense; /* senses of the constraints: 'L', 'G' or 'E' */ const double *xstar; /* current optimal solution of the LP relaxation */ } ilp; typedef struct { int mr; /* number of rows in the parity ILP matrix */ int mc; /* number of columns in the parity ILP matrix */ int mnz; /* number of 1's in the parity ILP matrix */ int *mtbeg; /* starting position of each row in arrays mtind and mtval */ int *mtcnt; /* number of entries of each row in arrays mtind and mtval */ int *mtind; /* column indices of the 1's of the parity ILP matrix */ short int *mrhs; /* right hand side parity of the constraints */ double *xstar; /* current optimal solution of the LP relaxation */ double *slack; /* slack of the constraints w.r.t. xstar */ short int *row_to_delete; /* flag for marking rows not to be considered */ short int *col_to_delete; /* flag for marking columns not to be considered */ int *gcd; /* greatest common divisor of each row in the input ILP matrix */ short int *possible_weak; /* possible weakening types of each column */ short int *type_even_weak; /* type of even weakening of each column (lower or upper bound weakening) */ short int *type_odd_weak; /* type of odd weakening of each column (lower or upper bound weakening) */ double *loss_even_weak; /* loss for the even weakening of each column */ double *loss_odd_weak; /* loss for the odd weakening of each column */ double *min_loss_by_weak; /* minimum loss for the weakening of each column */ } parity_ilp; typedef struct { int nweak; /* number of variables weakened */ int *var; /* list of variables weakened */ short int *type; /* type of weakening (lower or upper bound weakening) */ } info_weak; typedef struct { int endpoint1, endpoint2; /* endpoints of the edge */ double weight; /* edge weight */ short int parity; /* edge parity (even or odd) */ int constr; /* constraint associated with the edge */ info_weak *weak; /* weakening information */ } edge; typedef struct { int nnodes; /* number of nodes */ int nedges; /* number of edges */ int *nodes; /* indexes of the ILP columns corresponding to the nodes */ int *ind; /* indexes of the nodes corresponding to the ILP columns */ edge **even_adj_list; /* pointers to the even edges */ edge **odd_adj_list; /* pointers to the odd edges */ } separation_graph; #ifndef CGL_NEW_SHORT typedef struct { int nnodes; /* number of nodes */ int narcs; /* number of arcs */ node *nodes; /* array of the nodes - see "types_db.h" */ arc *arcs; /* array of the arcs - see "types_db.h" */ } auxiliary_graph; #else typedef struct { int nnodes; /* number of nodes */ int narcs; /* number of arcs */ cgl_node *nodes; /* array of the nodes - see "types_db.h" */ cgl_arc *arcs; /* array of the arcs - see "types_db.h" */ } auxiliary_graph; #endif typedef struct { long dist; /* distance from/to root */ int pred; /* index of the predecessor */ } short_path_node; typedef struct { double weight; /* overall weight of the cycle */ int length; /* number of edges in the cycle */ edge **edge_list; /* list of edges in the cycle */ } cycle; typedef struct { int cnum; /* overall number of cycles */ cycle **list; /* pointers to the cycles in the list */ } cycle_list; typedef struct { int n_of_constr; /* number of constraints combined to get the cut */ int *constr_list; /* list of the constraints combined */ short int *in_constr_list; /* flag saying whether a given constraint is in the list of constraints of the cut (IN) or not (OUT) */ int cnzcnt; /* overall number of nonzero's in the cut */ int *cind; /* column indices of the nonzero entries of the cut */ int *cval; /* values of the nonzero entries of the cut */ int crhs; /* right hand side of the cut */ char csense; /* sense of the cut: 'L', 'G' or 'E' */ double violation; /* violation of the cut w.r.t. the current LP solution */ } cut; typedef struct { int cnum; /* overall number of cuts */ cut **list; /* pointers to the cuts in the list */ } cut_list; typedef struct { int n_of_constr; /* number of constraints combined to get the cut */ int *constr_list; /* list of the constraints combined */ int code; /* identifier of the cut */ int n_it_violated; /* number of consecutive iterations (starting from the last and going backward) in which the cut was violated by the LP solution */ int it_found; /* iteration in which the cut was separated */ double score; /* score of the cut, used to choose wich cut should be added to the current LP (if any) */ } pool_cut; typedef struct { int cnum; /* overall number of cuts */ pool_cut **list; /* pointers to the cuts in the list */ int *ncod; /* number of cuts with a given code in the pool */ } pool_cut_list; typedef struct { int *ccoef; /* coefficients of the cut */ int crhs; /* right hand side of the cut */ int pool_index; /* index of the cut in the pool */ double score; /* cut score (to be maximized) */ } select_cut; typedef struct { int n_it_zero; /* number of consecutive iterations (starting from the last and going backward) in which each variable took the value 0 in the LP solution */ } log_var; /** 012Cut Generator Class This class is to make Cgl01cut thread safe etc */ class Cgl012Cut { public: /**@name Generate Cuts */ //@{ int sep_012_cut( /* INPUT parameters: */ int mr, /* number of rows in the ILP matrix */ int mc, /* number of columns in the ILP matrix */ int mnz, /* number of nonzero's in the ILP matrix */ int *mtbeg, /* starting position of each row in arrays mtind and mtval */ int *mtcnt, /* number of entries of each row in arrays mtind and mtval */ int *mtind, /* column indices of the nonzero entries of the ILP matrix */ int *mtval, /* values of the nonzero entries of the ILP matrix */ int *vlb, /* lower bounds on the variables */ int *vub, /* upper bounds on the variables */ int *mrhs, /* right hand sides of the constraints */ char *msense, /* senses of the constraints: 'L', 'G' or 'E' */ const double *xstar, /* current optimal solution of the LP relaxation */ bool aggressive, /* flag asking whether as many cuts as possible are required on output (TRUE) or not (FALSE) */ /* OUTPUT parameters (the memory for the vectors is allocated INTERNALLY by the procedure: if some memory is already allocated, it is FREED): */ int *cnum, /* number of violated 0-1/2 cuts identified by the procedure */ int *cnzcnt, /* overall number of nonzero's in the cuts */ int **cbeg, /* starting position of each cut in arrays cind and cval */ int **ccnt, /* number of entries of each cut in arrays cind and cval */ int **cind, /* column indices of the nonzero entries of the cuts */ int **cval, /* values of the nonzero entries of the cuts */ int **crhs, /* right hand sides of the cuts */ char **csense /* senses of the cuts: 'L', 'G' or 'E' */ /* NOTE that all the numerical input/output vectors are INTEGER (with the exception of xstar), since the procedure is intended to work with pure ILP's, and that the ILP matrix has to be given on input in ROW format. */ ); void ilp_load( int mr, /* number of rows in the ILP matrix */ int mc, /* number of columns in the ILP matrix */ int mnz, /* number of nonzero's in the ILP matrix */ int *mtbeg, /* starting position of each row in arrays mtind and mtval */ int *mtcnt, /* number of entries of each row in arrays mtind and mtval */ int *mtind, /* column indices of the nonzero entries of the ILP matrix */ int *mtval, /* values of the nonzero entries of the ILP matrix */ int *vlb, /* lower bounds on the variables */ int *vub, /* upper bounds on the variables */ int *mrhs, /* right hand sides of the constraints */ char *msense /* senses of the constraints: 'L', 'G' or 'E' */ ); void free_ilp(); /* alloc_parity_ilp: allocate the memory for the parity ILP data structure */ void alloc_parity_ilp( int mr, /* number of rows in the ILP matrix */ int mc, /* number of columns in the ILP matrix */ int mnz /* number of nonzero's in the ILP matrix */ ); void free_parity_ilp(); void initialize_log_var(); /* free_log_var */ void free_log_var(); private: /* best_weakening: find the best upper/lower bound weakening of a set of variables */ int best_weakening( int n_to_weak, /* number of variables to weaken */ int *vars_to_weak, /* indices of the variables to weaken */ short int original_parity, /* original parity of the constraint to weaken */ double original_slack, /* original slack of the constraint to weaken */ double *best_even_slack, /* best possible slack of a weakened constraint with even right-hand-side */ double *best_odd_slack, /* best possible slack of a weakened constraint with odd right-hand-side */ info_weak **info_even_weak, /* weakening information about the best possible even weakened constraint */ info_weak **info_odd_weak, /* weakening information about the best possible odd weakened constraint */ short int only_odd, /* flag which tells whether only an odd weakening is of interest (TRUE) or both weakenings are (FALSE) */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ); /* best_cut: find the coefficients, the rhs and the violation of the best possible cut that can be obtained by weakening a given set of coefficients to even and a rhs to odd, dividing by 2 and rounding */ short int best_cut( int *ccoef, /* vector of the coefficients */ int *crhs, /* pointer to rhs value */ double *violation, /* violation of the cut */ short int update, /* TRUE/FALSE: if TRUE, the new ccoef and crhs are given on output */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ); /* get_cut: extract a hopefully violated cut from an odd cycle of the separation graph */ cut *get_cut( cycle *s_cyc /* shortest odd cycles identified in the separation graph */ ); /* update_log_var: update the log information for the problem variables */ void update_log_var(); /* basic_separation: try to identify violated 0-1/2 cuts by using the original procedure described in Caprara and Fischetti's MP paper */ cut_list *basic_separation(); /* score_by_moving: compute the score of the best cut obtainable from the current local search solution by inserting/deleting a constraint */ double score_by_moving( int i, /* constraint to be moved */ short int itype, /* type of move - ADD or DEL */ double thresh /* minimum value of an interesting score */ ); /* modify_current: update the current local search solution by inserting/ deleting a constraint */ void modify_current( int i, /* constraint to be moved */ short int itype /* type of move - ADD or DEL */ ); /* best neighbour: find the cut to be added/deleted from the current solution among those allowed by the tabu rules */ short int best_neighbour(cut_list *out_cuts /* list of the violated cuts found */); /* add_tight_constraint: initialize the current cut by adding a tight constraint to it */ void add_tight_constraint(); /* tabu_012: try to identify violated 0-1/2 cuts by a simple tabu search procedure adapted from that used by Battiti and Protasi for finding large cliques */ cut_list *tabu_012(); /* initialize: initialize the data structures for local search */ void initialize(); /* restart: perform a restart of the search - IMPORTANT: in the current implementation vector last_moved is not cleared at restart */ void restart(short int failure /* flag forcing the restart if some trouble occurred */); void print_constr(int i /* constraint to be printed */); void print_parity_ilp(); /* get_parity_ilp: construct an internal data structure containing all the information which can be useful for 0-1/2 cut separation */ void get_parity_ilp(); /* initialize_sep_graph: allocate and initialize the data structure to contain the information associated with a separation graph */ separation_graph *initialize_sep_graph(); void print_cut(cut *v_cut); /* get_ori_cut_coef: get the coefficients of a cut, before dividing by 2 and rounding, starting from the list of the constraints combined to get the cut */ short int get_ori_cut_coef( int n_of_constr, /* number of constraints combined */ int *constr_list, /* list of the constraints combined */ int *ccoef, /* cut left hand side coefficients */ int *crhs, /* cut right hand side */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ); /* define_cut: construct a cut data structure from a vector of coefficients and a right-hand-side */ cut *define_cut( int *ccoef, /* coefficients of the cut */ int crhs /* right hand side of the cut */ ); /* cut_score: define the score of a (violated) cut */ double cut_score( int *ccoef, /* cut left hand side coefficients */ int crhs, /* cut right hand side */ double viol, /* cut violation */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ); /* get_current_cut: return a cut data type with the information about the current cut of the search procedure */ cut *get_current_cut(); /* print_cur_cut: display cur_cut on output */ void print_cur_cut(); void print_cut_list(cut_list *cuts); //@} public: /**@name Constructors and destructors */ //@{ /// Default constructor Cgl012Cut (); /// Copy constructor Cgl012Cut ( const Cgl012Cut &); /// Assignment operator Cgl012Cut & operator=( const Cgl012Cut& rhs); /// Destructor virtual ~Cgl012Cut (); //@} private: // Private member methods /**@name Private methods */ //@{ //@} /**@name Private member data */ //@{ ilp *inp_ilp; /* input ILP data structure */ parity_ilp *p_ilp; /* parity ILP data structure */ int iter; double gap; double maxgap; int errorNo; int sep_iter; /* number of the current separation iteration */ log_var **vlog; /* information about the value attained by the variables in the last iterations, used to possibly set to 0 some coefficient > 0 in a cut to be added */ bool aggr; /* flag saying whether as many cuts as possible are required from the separation procedure (TRUE) or not (FALSE) */ //@} }; #endif Cgl-0.58.9/src/CglZeroHalf/Makefile.am0000644000076600007660000000340312252027611015761 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 1166 2013-12-11 09:25:29Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglZeroHalf # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglZeroHalf.la # List all source files for this library, including headers libCglZeroHalf_la_SOURCES = \ CglZeroHalf.cpp CglZeroHalf.hpp \ Cgl012cut.cpp Cgl012cut.hpp \ CglZeroHalfTest.cpp # This is for libtool libCglZeroHalf_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation 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 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = CglZeroHalf.hpp Cgl012cut.hpp Cgl-0.58.9/src/CglZeroHalf/CglZeroHalf.hpp0000644000076600007660000000704112130104734016575 0ustar coincoin// $Id: CglZeroHalf.hpp 1123 2013-04-06 20:47:24Z stefan $ // Copyright (C) 2010, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef CglZeroHalf_H #define CglZeroHalf_H #include #include "CglCutGenerator.hpp" #include "CoinPackedMatrix.hpp" #include "Cgl012cut.hpp" /** Zero Half Cut Generator Class This class generates zero half cuts via the following method: See - G. Andreello, A. Caprara, M. Fischetti, “Embedding Cuts in a Branch and Cut Framework: a Computational Study with {0,1/2}-Cuts”, INFORMS Journal on Computing 19(2), 229-238, 2007. */ class CglZeroHalf : public CglCutGenerator { friend void CglZeroHalfUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /**@name Generate Cuts */ //@{ /** Generate zero half cuts for the model accessed through the solver interface. Insert generated cuts into the cut set cs. */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Sets and Gets */ //@{ /// Get flags inline int getFlags() const { return flags_;} /// Set flags inline void setFlags(int value) { flags_ = value;} //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglZeroHalf (); /// Copy constructor CglZeroHalf ( const CglZeroHalf &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglZeroHalf & operator=( const CglZeroHalf& rhs); /// Destructor virtual ~CglZeroHalf (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); /// This can be used to refresh any information virtual void refreshSolver(OsiSolverInterface * solver); //@} private: // Private member methods /**@name Private methods */ //@{ //@} /**@name Private member data */ //@{ /// number of rows in the ILP matrix int mr_; /// number of columns in the ILP matrix int mc_; /// number of nonzero's in the ILP matrix int mnz_; /// starting position of each row in arrays mtind and mtval int *mtbeg_; /// number of entries of each row in arrays mtind and mtval int *mtcnt_; /// column indices of the nonzero entries of the ILP matrix int *mtind_; /// values of the nonzero entries of the ILP matrix int *mtval_; /// lower bounds on the variables int *vlb_; /// upper bounds on the variables int *vub_; /// right hand sides of the constraints int *mrhs_; /// senses of the constraints: 'L', 'G' or 'E' char *msense_; /// Cgl012Cut object to make thread safe Cgl012Cut cutInfo_; /** Flags 1 bit - global cuts */ int flags_; //@} }; /// A simple Dijkstra shortest path - make better later #ifndef CGL_NEW_SHORT void cglShortestPath(cgl_graph * graph, int source, int maximumLength); #else void cglShortestPath(auxiliary_graph * graph, int source, int maximumLength); #endif //############################################################################# /** A function that tests the methods in the CglZeroHalf class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglZeroHalfUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglZeroHalf/Makefile.in0000644000076600007660000005436612252027611016010 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/CglZeroHalf 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglZeroHalf_la_LIBADD = am_libCglZeroHalf_la_OBJECTS = CglZeroHalf.lo Cgl012cut.lo \ CglZeroHalfTest.lo libCglZeroHalf_la_OBJECTS = $(am_libCglZeroHalf_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 = $(libCglZeroHalf_la_SOURCES) DIST_SOURCES = $(libCglZeroHalf_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglZeroHalf # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglZeroHalf.la # List all source files for this library, including headers libCglZeroHalf_la_SOURCES = \ CglZeroHalf.cpp CglZeroHalf.hpp \ Cgl012cut.cpp Cgl012cut.hpp \ CglZeroHalfTest.cpp # This is for libtool libCglZeroHalf_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation 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 'include/coin' includecoindir = $(includedir)/coin includecoin_HEADERS = CglZeroHalf.hpp Cgl012cut.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/CglZeroHalf/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglZeroHalf/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglZeroHalf.la: $(libCglZeroHalf_la_OBJECTS) $(libCglZeroHalf_la_DEPENDENCIES) $(CXXLINK) $(libCglZeroHalf_la_LDFLAGS) $(libCglZeroHalf_la_OBJECTS) $(libCglZeroHalf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cgl012cut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglZeroHalf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglZeroHalfTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglZeroHalf/Cgl012cut.cpp0000644000076600007660000034412012130104734016076 0ustar coincoin// $Id: Cgl012cut.cpp 1123 2013-04-06 20:47:24Z stefan $ // Copyright (C) 2010, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). /** @file 012cut.c Definition file for C coded 0-1/2 separator */ #include "CoinFinite.hpp" #include "CoinTime.hpp" #include "Cgl012cut.hpp" #include "CglZeroHalf.hpp" int MAX_CUTS = 1000; //#define PRINT_TABU //#define PRINT_CUTS //#define PRINT_TIME //#define TIME /* #define TIME */ #undef TIME #define TRUE 1 #define FALSE 0 #define ODD 1 #define EVEN 0 #define NONE -1 #define BOTH 2 #define IN 1 #define OUT 0 #define ADD 1 #define DEL 0 #define LOWER_BOUND 0 #define UPPER_BOUND 1 #define EPS 0.0001 /* small tolerance */ //#define EPS 0.000001 /* small tolerance */ #define ZERO 0.000001 /* estimated accuracy for doubles */ //#define ZERO 0.0001 /* estimated accuracy for doubles */ #define INF 1000000000.0 #define IINF 1000000000 #define MAX_SLACK 1.0 #define MAX_LOSS 1.0 #define MAX_CYCLE_WEIGHT 1.0 #define MIN_VIOLATION 0.001 #define MIN_SCORE_RANGE 10.0 #define MAX_SCORE_RANGE ZERO /* 1.0 */ #define ISCALE 10000 //#define MAX_CUTS 10 #define MAX_CUT_POOL 10000 #define MAX_CUT_COD 10000 #define MAX_ITER_POOL 100 #define CLEAN_THRESH 0.9 #define MANY_IT_ZERO 10 #define mod2(I) ( I % 2 == 0 ? 0 : 1 ) #ifdef TIME static float tot_basic_sep_time = 0.0; /* total time spent for basic separation */ static float avg_basic_sep_time; /* average time per iteration spent for basic separation */ static float total_time = 0.0; /* total time spent in the separation */ static float prep_time = 0.0; /* time spent for the definition of the parity ILP data structure */ static float weak_time = 0.0; /* time spent for the construction of the separation graph by weakening */ static float aux_time = 0.0; /* time spent for the definition of the auxiliary graph */ static float path_time = 0.0; /* time spent in the computation of the shortest paths */ static float cycle_time = 0.0; /* time spent in the determination of the shortest cycles */ static float cut_time = 0.0; /* time spent in the determination of the violated cuts */ static float bw_time = 0.0; /* time spent in best_weakening */ static float coef_time = 0.0; /* time spent in the initial computation of coef in get_cut */ static float pool_time = 0.0; /* time spent for the addition and extraction of cuts from the pool */ static int cut_ncalls = 0; /* number of calls to get_cut */ static float tabu_time = 0.0; /* time spent within tabu search */ float ti, tf, td, tti, ttf, tsi, tsf, tii, tff, tpi, tpf, ttabi, ttabf; void second_(float *t) {*t=CoinCpuTime();} #endif /* #endif */ /* global data structures */ #define CGGGGG #ifndef CGGGGG static ilp *inp_ilp; /* input ILP data structure */ static parity_ilp *p_ilp; /* parity ILP data structure */ #endif #ifdef PRINT_CUTS /* utility subroutines */ void print_int_vect(char *s,int *v,int n) { int i; printf("integer vector %s:",s); for ( i = 0; i < n; i++ ) printf(" %d",v[i]); printf("\n"); } void print_short_int_vect(char *s,short int *v,int n) { int i; printf("short integer vector %s:",s); for ( i = 0; i < n; i++ ) printf(" %d",v[i]); printf("\n"); } void print_double_vect(char *s,double *v,int n) { int i; printf("double vector %s:",s); for ( i = 0; i < n; i++ ) printf(" %f",v[i]); printf("\n"); } #endif void alloc_error(char *s) { printf("\n Warning: Not enough memory to allocate %s\n",s); printf("\n Cannot proceed with 0-1/2 cut separation\n"); exit(FALSE); } /* double2int: compute the integer equivalent of a double */ int double2int(double x) { if ( x > IINF ) return (IINF); if ( x < - IINF ) return (- IINF); if ( x < ZERO && x > - ZERO ) return(0); if ( x > 0.0 ) return(static_cast (x + ZERO)); return(static_cast (x - ZERO)); } /* gcd: compute the greatest common divisor of two integers */ int gcd(int a,int b) { int c; if ( a < 0 ) a = - a; if ( b < 0 ) b = - b; if ( a < b ) { c = a; a = b; b = c; } while ( b != 0 ) { c = a % b; a = b; b = c; } return(a); } /* ILP data structures subroutines */ /* ilp_load: load the input ILP into an internal data structure */ void Cgl012Cut::ilp_load( int mr, /* number of rows in the ILP matrix */ int mc, /* number of columns in the ILP matrix */ int mnz, /* number of nonzero's in the ILP matrix */ int *mtbeg, /* starting position of each row in arrays mtind and mtval */ int *mtcnt, /* number of entries of each row in arrays mtind and mtval */ int *mtind, /* column indices of the nonzero entries of the ILP matrix */ int *mtval, /* values of the nonzero entries of the ILP matrix */ int *vlb, /* lower bounds on the variables */ int *vub, /* upper bounds on the variables */ int *mrhs, /* right hand sides of the constraints */ char *msense /* senses of the constraints: 'L', 'G' or 'E' */ ) { inp_ilp = reinterpret_cast (calloc(1,sizeof(ilp))); if ( inp_ilp == NULL ) alloc_error(const_cast("inp_ilp")); inp_ilp->mr = mr; inp_ilp->mc = mc; inp_ilp->mnz = mnz; inp_ilp->mtbeg = mtbeg; inp_ilp->mtcnt = mtcnt; inp_ilp->mtind = mtind; inp_ilp->mtval = mtval; inp_ilp->vlb = vlb; inp_ilp->vub = vub; inp_ilp->mrhs = mrhs; inp_ilp->msense = msense; } void Cgl012Cut::free_ilp() { free(inp_ilp); inp_ilp=NULL; } #ifdef PRINT_CUTS void Cgl012Cut::print_constr(int i /* constraint to be printed */) { printf("\n content of constraint %d: nzcnt = %d, rhs = %d, sense = %c, slack = %f\n", i, inp_ilp->mtcnt[i], inp_ilp->mrhs[i], inp_ilp->msense[i], p_ilp->slack[i]); print_int_vect(const_cast("ind"),inp_ilp->mtind + inp_ilp->mtbeg[i],inp_ilp->mtcnt[i]); print_int_vect(const_cast("val"),inp_ilp->mtval + inp_ilp->mtbeg[i],inp_ilp->mtcnt[i]); } #endif /* alloc_parity_ilp: allocate the memory for the parity ILP data structure */ void Cgl012Cut::alloc_parity_ilp( int mr, /* number of rows in the ILP matrix */ int mc, /* number of columns in the ILP matrix */ int mnz /* number of nonzero's in the ILP matrix */ ) { p_ilp = reinterpret_cast (calloc(1,sizeof(parity_ilp))); if ( p_ilp == NULL ) alloc_error(const_cast("p_ilp")); p_ilp->mtbeg = reinterpret_cast (calloc(mr,sizeof(int))); if ( p_ilp->mtbeg == NULL ) alloc_error(const_cast("p_ilp->mtbeg")); p_ilp->mtcnt = reinterpret_cast (calloc(mr,sizeof(int))); if ( p_ilp->mtcnt == NULL ) alloc_error(const_cast("p_ilp->mtcnt")); p_ilp->mtind = reinterpret_cast (calloc(mnz,sizeof(int))); if ( p_ilp->mtind == NULL ) alloc_error(const_cast("p_ilp->mtind")); p_ilp->mrhs = reinterpret_cast (calloc(mr,sizeof(short int))); if ( p_ilp->mrhs== NULL ) alloc_error(const_cast("p_ilp->mrhs")); p_ilp->xstar = reinterpret_cast (calloc(mc,sizeof(double))); if ( p_ilp->xstar== NULL ) alloc_error(const_cast("p_ilp->xstar")); p_ilp->slack = reinterpret_cast (calloc(mr,sizeof(double))); if ( p_ilp->slack == NULL ) alloc_error(const_cast("p_ilp->slack")); p_ilp->row_to_delete = reinterpret_cast (calloc(mr,sizeof(short int))); if ( p_ilp->row_to_delete == NULL ) alloc_error(const_cast("p_ilp->row_to_delete")); p_ilp->col_to_delete = reinterpret_cast (calloc(mc,sizeof(short int))); if ( p_ilp->col_to_delete == NULL ) alloc_error(const_cast("p_ilp->col_to_delete")); p_ilp->gcd = reinterpret_cast (calloc(mr,sizeof(int))); if ( p_ilp->gcd == NULL ) alloc_error(const_cast("p_ilp->gcd")); p_ilp->possible_weak = reinterpret_cast (calloc(mc,sizeof(short int))); if ( p_ilp->possible_weak == NULL ) alloc_error(const_cast("p_ilp->possible_weak")); p_ilp->type_even_weak = reinterpret_cast (calloc(mc,sizeof(short int))); if ( p_ilp->type_even_weak == NULL ) alloc_error(const_cast("p_ilp->type_even_weak")); p_ilp->type_odd_weak = reinterpret_cast (calloc(mc,sizeof(short int))); if ( p_ilp->type_odd_weak == NULL ) alloc_error(const_cast("p_ilp->type_odd_weak")); p_ilp->loss_even_weak = reinterpret_cast (calloc(mc,sizeof(double))); if ( p_ilp->loss_even_weak == NULL ) alloc_error(const_cast("p_ilp->loss_even_weak")); p_ilp->loss_odd_weak = reinterpret_cast (calloc(mc,sizeof(double))); if ( p_ilp->loss_odd_weak == NULL ) alloc_error(const_cast("p_ilp->loss_odd_weak")); p_ilp->min_loss_by_weak = reinterpret_cast (calloc(mc,sizeof(double))); if ( p_ilp->min_loss_by_weak == NULL ) alloc_error(const_cast("p_ilp->min_loss_by_weak")); p_ilp->mr=mr; p_ilp->mc=mc; p_ilp->mnz=mnz; } #ifdef PRINT_CUTS void Cgl012Cut::print_parity_ilp() { printf("\n content of parity_ilp data structure: mc = %d, mr = %d, mnz = %d\n", p_ilp->mc,p_ilp->mr,p_ilp->mnz); print_int_vect(const_cast("mtbeg"),p_ilp->mtbeg,p_ilp->mr); print_int_vect(const_cast("mtcnt"),p_ilp->mtcnt,p_ilp->mr); print_int_vect(const_cast("mtind"),p_ilp->mtind,p_ilp->mnz); print_short_int_vect(const_cast("mrhs"),p_ilp->mrhs,p_ilp->mr); print_double_vect(const_cast("xstar"),p_ilp->xstar,p_ilp->mc); print_double_vect(const_cast("slack"),p_ilp->slack,p_ilp->mr); print_short_int_vect(const_cast("row_to_delete"),p_ilp->row_to_delete,p_ilp->mr); print_short_int_vect(const_cast("col_to_delete"),p_ilp->col_to_delete,p_ilp->mc); print_int_vect(const_cast("gcd"),p_ilp->gcd,p_ilp->mr); print_short_int_vect(const_cast("possible_weak"),p_ilp->possible_weak,p_ilp->mc); print_short_int_vect(const_cast("type_even_weak"),p_ilp->type_even_weak,p_ilp->mc); print_short_int_vect(const_cast("type_odd_weak"),p_ilp->type_odd_weak,p_ilp->mc); print_double_vect(const_cast("loss_even_weak"),p_ilp->loss_even_weak,p_ilp->mc); print_double_vect(const_cast("loss_odd_weak"),p_ilp->loss_odd_weak,p_ilp->mc); print_double_vect(const_cast("min_loss_by_weak"),p_ilp->min_loss_by_weak,p_ilp->mc); } #endif void Cgl012Cut::free_parity_ilp() { if (p_ilp) { free(p_ilp->mtbeg); free(p_ilp->mtcnt); free(p_ilp->mtind); free(p_ilp->mrhs); free(p_ilp->xstar); free(p_ilp->slack); free(p_ilp->row_to_delete); free(p_ilp->col_to_delete); free(p_ilp->gcd); free(p_ilp->possible_weak); free(p_ilp->type_even_weak); free(p_ilp->type_odd_weak); free(p_ilp->loss_even_weak); free(p_ilp->loss_odd_weak); free(p_ilp->min_loss_by_weak); free(p_ilp); p_ilp=NULL; } } /* alloc_info_weak: allocate memory for the weakening info data structure */ info_weak *alloc_info_weak(int nweak /* number of variables to be weakened */) { info_weak *i_weak; i_weak = reinterpret_cast (calloc(1,sizeof(info_weak))); if ( i_weak == NULL ) alloc_error(const_cast("i_weak")); if ( nweak > 0 ) { i_weak->var = reinterpret_cast (calloc(nweak,sizeof(int))); if ( i_weak->var == NULL ) alloc_error(const_cast("i_weak->var")); i_weak->type = reinterpret_cast (calloc(nweak,sizeof(short int))); if ( i_weak->type == NULL ) alloc_error(const_cast("i_weak->type")); } return(i_weak); } #ifdef PRINT_CUTS void print_info_weak(info_weak *i_weak) { printf("\n content of info_weak: nweak = %d\n",i_weak->nweak); if ( i_weak->nweak > 0 ) { print_int_vect(const_cast("var"),i_weak->var,i_weak->nweak); print_short_int_vect(const_cast("type"),i_weak->type,i_weak->nweak); } } #endif void free_info_weak(info_weak *i_weak) { if ( i_weak->nweak > 0 ) { free(i_weak->var); free(i_weak->type); } free(i_weak); } /* get_parity_ilp: construct an internal data structure containing all the information which can be useful for 0-1/2 cut separation */ void Cgl012Cut::get_parity_ilp() { int i, j, h, ij, aij, cnti, cnttot, begi, begh, ofsj, gcdi, ubj, lbj; double slacki, xstarj, loss_upper, loss_lower; short int parity_col_removed, equalih; /* allocate the memory for the parity ILP data structure */ //alloc_parity_ilp(inp_ilp->mr,inp_ilp->mc,inp_ilp->mnz); p_ilp->mr = inp_ilp->mr; p_ilp->mc = inp_ilp->mc; /* mark the variables equal to their lower/upper bound */ parity_col_removed = 0; for ( j = 0; j < inp_ilp->mc; j++ ) { xstarj = p_ilp->xstar[j] = inp_ilp->xstar[j]; ubj = inp_ilp->vub[j]; lbj = inp_ilp->vlb[j]; if ( xstarj > static_cast (ubj - ZERO) ) { /* variable at its upper bound */ p_ilp->col_to_delete[j] = TRUE; if ( mod2(ubj) == ODD ) { p_ilp->possible_weak[j] = ODD; p_ilp->type_odd_weak[j] = UPPER_BOUND; p_ilp->loss_odd_weak[j] = 0.0; if ( parity_col_removed == EVEN ) parity_col_removed = ODD; else parity_col_removed = EVEN; } else { p_ilp->possible_weak[j] = EVEN; p_ilp->type_even_weak[j] = UPPER_BOUND; p_ilp->loss_even_weak[j] = 0.0; } p_ilp->min_loss_by_weak[j] = 0.0; } else if ( xstarj < static_cast (lbj) + ZERO ) { /* variable at its lower bound */ p_ilp->col_to_delete[j] = TRUE; if ( mod2(lbj) == ODD ) { p_ilp->possible_weak[j] = ODD; p_ilp->type_odd_weak[j] = LOWER_BOUND; p_ilp->loss_odd_weak[j] = 0.0; p_ilp->min_loss_by_weak[j] = 0.0; if ( parity_col_removed == EVEN ) parity_col_removed = ODD; else parity_col_removed = EVEN; } else { p_ilp->possible_weak[j] = EVEN; p_ilp->type_even_weak[j] = LOWER_BOUND; p_ilp->loss_even_weak[j] = 0.0; p_ilp->min_loss_by_weak[j] = 0.0; } p_ilp->min_loss_by_weak[j] = 0.0; } else { /* variable neither at its lower nor at its upper bound */ p_ilp->col_to_delete[j] = FALSE; loss_upper = static_cast (ubj) - xstarj; loss_lower = xstarj - static_cast (lbj); if ( ( loss_upper > MAX_LOSS ) && ( loss_lower > MAX_LOSS ) ) /* no weakening for the variable */ p_ilp->possible_weak[j] = NONE; else if ( loss_upper > MAX_LOSS ) { /* lower weakening only */ if ( mod2(lbj) == EVEN ) { p_ilp->possible_weak[j] = EVEN; p_ilp->type_even_weak[j] = LOWER_BOUND; p_ilp->loss_even_weak[j] = loss_lower; } else { p_ilp->possible_weak[j] = ODD; p_ilp->type_odd_weak[j] = LOWER_BOUND; p_ilp->loss_odd_weak[j] = loss_lower; } } else if ( loss_lower > MAX_LOSS ) { /* upper weakening only */ if ( mod2(ubj) == EVEN ) { p_ilp->possible_weak[j] = EVEN; p_ilp->type_even_weak[j] = UPPER_BOUND; p_ilp->loss_even_weak[j] = loss_upper; } else { p_ilp->possible_weak[j] = ODD; p_ilp->type_odd_weak[j] = UPPER_BOUND; p_ilp->loss_odd_weak[j] = loss_upper; } } else if ( mod2(ubj) == mod2(lbj) ) { /* lower and upper bound have the same parity: choose the best weakening */ if ( mod2(ubj) == EVEN ) { p_ilp->possible_weak[j] = EVEN; if ( loss_lower <= loss_upper ) { p_ilp->type_even_weak[j] = LOWER_BOUND; p_ilp->loss_even_weak[j] = loss_lower; } else { p_ilp->type_even_weak[j] = UPPER_BOUND; p_ilp->loss_even_weak[j] = loss_upper; } } else { p_ilp->possible_weak[j] = ODD; if ( loss_lower <= loss_upper ) { p_ilp->type_odd_weak[j] = LOWER_BOUND; p_ilp->loss_odd_weak[j] = loss_lower; } else { p_ilp->type_odd_weak[j] = UPPER_BOUND; p_ilp->loss_odd_weak[j] = loss_upper; } } } else { /* lower and upper bound have different parities: consider both weakenings */ p_ilp->possible_weak[j] = BOTH; if ( mod2(ubj) == EVEN ) { p_ilp->type_even_weak[j] = UPPER_BOUND; p_ilp->loss_even_weak[j] = loss_upper; p_ilp->type_odd_weak[j] = LOWER_BOUND; p_ilp->loss_odd_weak[j] = loss_lower; } else { p_ilp->type_even_weak[j] = LOWER_BOUND; p_ilp->loss_even_weak[j] = loss_lower; p_ilp->type_odd_weak[j] = UPPER_BOUND; p_ilp->loss_odd_weak[j] = loss_upper; } } if ( loss_upper > loss_lower ) p_ilp->min_loss_by_weak[j] = loss_lower; else p_ilp->min_loss_by_weak[j] = loss_upper; } } /* scan the constraints and delete those which are trivially useless in the 0-1/2 cut separation */ cnttot = 0; for ( i = 0; i < inp_ilp->mr; i++ ) { begi = inp_ilp->mtbeg[i]; /* compute the row slack and the GCD of the entries of the row */ slacki = static_cast (inp_ilp->mrhs[i]); gcdi = inp_ilp->mrhs[i]; for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) { ij = begi + ofsj; j = inp_ilp->mtind[ij]; aij = inp_ilp->mtval[ij]; slacki -= static_cast (aij ) * ( inp_ilp->xstar[j] ); gcdi = gcd(gcdi,aij); } if ( inp_ilp->msense[i] == 'G' ) slacki = -slacki; if ( slacki < -ZERO || ( inp_ilp->msense[i] == 'E' && slacki > ZERO ) ) { #ifdef COIN_DEVELOP printf("\n Warning: constraint %d in the model is violated:\n",i); printf("\n 0-1/2 cut separation is not possible\n"); printf("\nnumber of nonzero's %d\n",inp_ilp->mtcnt[i]); printf("nonzero's (col,coef,xstar) "); for (ofsj=0;ofsjmtcnt[i];ofsj++) printf("(%d,%d,%f) ", inp_ilp->mtind[begi+ofsj], inp_ilp->mtval[begi+ofsj], inp_ilp->xstar[inp_ilp->mtind[begi+ofsj]]); printf("\n"); printf("sense %c and rhs %d and slack %.5e\n",inp_ilp->msense[i],inp_ilp->mrhs[i], slacki); #endif //exit(0); slacki = INF; } p_ilp->slack[i] = slacki; /* mark the rows with slack greater than the maximum allowed */ if ( slacki > MAX_SLACK - EPS ) p_ilp->row_to_delete[i] = TRUE; else p_ilp->row_to_delete[i] = FALSE; /* store the odd entries in the (possibly scaled) row i */ //if ( gcdi != 1 ) //printf("Warning: constraint %d with nonprime coefficients\n",i); p_ilp->gcd[i] = gcdi; p_ilp->mrhs[i] = mod2(( inp_ilp->mrhs[i] / gcdi )); p_ilp->mtbeg[i] = cnttot; cnti = 0; for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) { ij = begi + ofsj; j = inp_ilp->mtind[ij]; aij = mod2(( inp_ilp->mtval[ij] / gcdi )); if ( aij == ODD ) { if ( ! p_ilp->col_to_delete[j] ) { p_ilp->mtind[cnttot] = j; cnti++; cnttot++; } else if ( p_ilp->possible_weak[j] == ODD ) { if ( p_ilp->mrhs[i] == EVEN ) p_ilp->mrhs[i] = ODD; else p_ilp->mrhs[i] = EVEN; } } } p_ilp->mtcnt[i] = cnti; if ( cnti == 0 ) /* (scaled) row with even entries only */ p_ilp->row_to_delete[i] = TRUE; else { if ( cnti == 1 && slacki < EPS ) { /* the row could be deleted */ #ifdef PRINT printf("get_parity_ilp: row %d could be deleted since it\n",i); printf("has only one odd entry and is tight, but it is not ...\n"); #endif } } } p_ilp->mnz = cnttot; #ifdef REDUCTION /* remove identical rows in the parity matrix */ /* very trivial implementation */ for ( i = 0; i < p_ilp->mr; i++ ) for ( h = i+1; h < p_ilp->mr; h++ ) if ( ( p_ilp->mrhs[i] == p_ilp->mrhs[h] ) && ( p_ilp->mtcnt[i] == p_ilp->mtcnt[h] ) && ( ! p_ilp->row_to_delete[i] ) && ( ! p_ilp->row_to_delete[h] ) ) { begi = p_ilp->mtbeg[i]; begh = p_ilp->mtbeg[h]; equalih = TRUE; for ( ofsj = 0; ofsj < p_ilp->mtcnt[i]; ofsj++ ) /* the check assumes the indexes of the columns associated with each row are ordered in p_ilp->mtind[] ... */ if ( p_ilp->mtind[begi+ofsj] != p_ilp->mtind[begh+ofsj] ) { equalih = FALSE; break; } if ( equalih ) { if ( p_ilp->slack[h] > p_ilp->slack[i] ) p_ilp->row_to_delete[h] = TRUE; else p_ilp->row_to_delete[i] = TRUE; } } /* check for the existence of separate connected components in the parity matrix row intersection graph */ /* not implemented so far - if ever, the availability of the parity matrix in column form also would be really convenient */ #endif } /* separation graph subroutines */ #define SG_EDGE_INDEX(s_graph,J,K) ( ((J) < (K)) ? ( (s_graph->nnodes * (J)) - (((J)+1)*(J)/2) + (K) - (J) -1 ) : ( (s_graph->nnodes * (K)) - (((K)+1)*(K)/2) + (J) - (K) -1 ) ) /* initialize_sep_graph: allocate and initialize the data structure to contain the information associated with a separation graph */ separation_graph *Cgl012Cut::initialize_sep_graph() { int maxnodes, maxedges, nnodes, j, jk; int *nodes, *ind; separation_graph *s_graph; s_graph = reinterpret_cast (calloc(1,sizeof(separation_graph))); if ( s_graph == NULL ) alloc_error(const_cast("s_graph")); maxnodes = p_ilp->mc + 1; nnodes = 0; nodes = reinterpret_cast (calloc(maxnodes,sizeof(int))); if ( nodes == NULL ) alloc_error(const_cast("nodes")); ind = reinterpret_cast (calloc(maxnodes,sizeof(int))); if ( ind == NULL ) alloc_error(const_cast("ind")); for ( j = 0; j < p_ilp->mc; j++ ) if ( ! p_ilp->col_to_delete[j] ) { /* variable not removed from the separation problem */ nodes[nnodes] = j; ind[j] = nnodes; nnodes++; } /* take into account the special node */ nodes[nnodes] = maxnodes - 1; ind[maxnodes-1] = nnodes; nnodes++; s_graph->nnodes = nnodes; s_graph->nedges = 0; s_graph->nodes = reinterpret_cast (malloc(nnodes*sizeof(int))); if ( s_graph->nodes == NULL ) alloc_error(const_cast("s_graph->nodes")); for ( j = 0; j < nnodes; j++ ) s_graph->nodes[j] = nodes[j]; free(nodes); s_graph->ind = reinterpret_cast (malloc(maxnodes*sizeof(int))); if ( s_graph->ind == NULL ) alloc_error(const_cast("s_graph->ind")); for ( j = 0; j < maxnodes; j++ ) s_graph->ind[j] = ind[j]; free(ind); maxedges = (nnodes * (nnodes - 1)) / 2; s_graph->even_adj_list = reinterpret_cast (malloc(maxedges*sizeof(edge *))); if ( s_graph->even_adj_list == NULL ) alloc_error(const_cast("s_graph->even_adj_list")); s_graph->odd_adj_list = reinterpret_cast (malloc(maxedges*sizeof(edge *))); if ( s_graph->odd_adj_list == NULL ) alloc_error(const_cast("s_graph->odd_adj_list")); for ( jk = 0; jk < maxedges; jk++ ) s_graph->even_adj_list[jk] = s_graph->odd_adj_list[jk] = NULL; return(s_graph); } /* update_weight_sep_graph: consider a new edge obtained from the (weakened) parity ILP and (possibly) add it to the separation graph */ separation_graph *update_weight_sep_graph( int j, int k, /* endpoints of the new edge */ double weight, /* weight of the new edge */ short int parity, /* parity of the new edge */ int i, /* constraint associated with the new edge */ info_weak *i_weak, /* information associated with the weakening */ separation_graph *s_graph /* separation graph to be updated */ ) { int indj, indk, indjk; edge *old_edge, *new_edge; indj = s_graph->ind[j]; indk = s_graph->ind[k]; indjk = SG_EDGE_INDEX(s_graph,indj,indk); if ( parity == EVEN ) old_edge = s_graph->even_adj_list[indjk]; else old_edge = s_graph->odd_adj_list[indjk]; if ( old_edge == NULL ) { /* edge is not in the graph */ new_edge = reinterpret_cast (calloc(1,sizeof(edge))); if ( new_edge == NULL ) alloc_error(const_cast("new_edge")); new_edge->endpoint1 = indj; new_edge->endpoint2 = indk; new_edge->weight = weight; new_edge->parity = parity; new_edge->constr = i; new_edge->weak = i_weak; (s_graph->nedges)++; if ( parity == EVEN ) s_graph->even_adj_list[indjk] = new_edge; else s_graph->odd_adj_list[indjk] = new_edge; } else { /* edge is already in the graph */ if ( old_edge->weight > weight ) { /* replace the old edge */ old_edge->weight = weight; old_edge->constr = i; free_info_weak(old_edge->weak); old_edge->weak = i_weak; } else { /* keep the old edge */ free_info_weak(i_weak); } } return(s_graph); } #ifdef PRINT_CUTS void print_edge(edge *e) { printf("\n content of edge: endpoint1 = %d, endpoint2 = %d, weight = %f, parity = %d, constr = %d\n", e->endpoint1,e->endpoint2,e->weight,e->parity,e->constr); print_info_weak(e->weak); } #endif void free_edge(edge *e) { if ( e->weak != NULL ) free_info_weak(e->weak); free(e); } #ifdef PRINT_CUTS void print_sep_graph(separation_graph *s_graph) { int nnodes, maxedges, jk; nnodes = s_graph->nnodes; maxedges = (nnodes * (nnodes - 1)) / 2; printf("\n content of separation_graph: nnodes = %d, nedges = %d\n", nnodes, s_graph->nedges); print_int_vect(const_cast("nodes"),s_graph->nodes,nnodes); print_int_vect(const_cast("ind"),s_graph->ind,nnodes); for ( jk = 0; jk < maxedges; jk++ ) { if ( s_graph->even_adj_list[jk] != NULL ) print_edge(s_graph->even_adj_list[jk]); if ( s_graph->odd_adj_list[jk] != NULL ) print_edge(s_graph->odd_adj_list[jk]); } } #endif void free_sep_graph(separation_graph *s_graph) { int nnodes, maxedges, jk; nnodes = s_graph->nnodes; maxedges = (nnodes * (nnodes - 1)) / 2; for ( jk = 0; jk < maxedges; jk++ ) { if ( s_graph->even_adj_list[jk] != NULL ) free_edge(s_graph->even_adj_list[jk]); if ( s_graph->odd_adj_list[jk] != NULL ) free_edge(s_graph->odd_adj_list[jk]); } free(s_graph->nodes); free(s_graph->ind); free(s_graph->even_adj_list); free(s_graph->odd_adj_list); free(s_graph); } /* auxiliary graph subroutines - depend on the shortest path code used */ #ifndef CGL_NEW_SHORT // will error if we get here #include "Cgldikbd.c" #endif #define AG_TWIN1(J) 2 * J #define AG_TWIN2(J) 2 * J + 1 #define AG_MATE(J) 2 * static_cast ( J / 2 ) + ( J % 2 == EVEN ? 1 : 0 ) #define AG_TYPE(J,K) ( (J % 2) == (K % 2) ? EVEN : ODD ) #define SG_ORIG(J) static_cast (J / 2) /* define_aux_graph: construct the auxiliary graph for the shortest path computation - the data structure is based on that used by Cherkassky, Goldberg and Radzik's shortest path codes */ auxiliary_graph *define_aux_graph(separation_graph *s_graph /* input separation graph */) { int j, k, indjk, auxj1, auxj2, auxk1, auxk2, noutj, totoutj, narcs; edge *s_edge; auxiliary_graph *a_graph; a_graph = reinterpret_cast (calloc(1,sizeof(auxiliary_graph))); if ( a_graph == NULL ) alloc_error(const_cast("a_graph")); a_graph->nnodes = 2 * s_graph->nnodes; a_graph->narcs = 4 * s_graph->nedges; #ifndef CGL_NEW_SHORT a_graph->nodes = reinterpret_cast (calloc((a_graph->nnodes + 1),sizeof(node))); #else a_graph->nodes = reinterpret_cast (calloc((a_graph->nnodes + 1),sizeof(cgl_node))); #endif if ( a_graph->nodes == NULL ) alloc_error(const_cast("a_graph->nodes")); #ifndef CGL_NEW_SHORT a_graph->arcs = reinterpret_cast (calloc(((a_graph->narcs) + 1),sizeof(arc))); #else a_graph->arcs = reinterpret_cast (calloc(((a_graph->narcs) + 1),sizeof(cgl_arc))); #endif if ( a_graph->arcs == NULL ) alloc_error(const_cast("a_graph->arcs")); narcs = 0; for ( j = 0; j < s_graph->nnodes; j++ ) { /* count the number of edges incident with j in the separation graph */ totoutj = 0; for ( k = 0; k < s_graph->nnodes; k++ ) if ( k != j ) { indjk = SG_EDGE_INDEX(s_graph,j,k); if ( s_graph->even_adj_list[indjk] != NULL ) totoutj++; if ( s_graph->odd_adj_list[indjk] != NULL ) totoutj++; } auxj1 = AG_TWIN1(j); auxj2 = AG_TWIN2(j); a_graph->nodes[auxj1].index = auxj1; a_graph->nodes[auxj2].index = auxj2; #ifndef CGL_NEW_SHORT a_graph->nodes[auxj1].first = &(a_graph->arcs[narcs]); a_graph->nodes[auxj2].first = &(a_graph->arcs[narcs+totoutj]); #else a_graph->nodes[auxj1].firstArc = &(a_graph->arcs[narcs]); a_graph->nodes[auxj2].firstArc = &(a_graph->arcs[narcs+totoutj]); #endif /* add the edges as arcs outgoing from j to the auxiliary graph */ noutj = 0; for ( k = 0; k < s_graph->nnodes; k++ ) { if ( k != j ) { auxk1 = AG_TWIN1(k); auxk2 = AG_TWIN2(k); indjk = SG_EDGE_INDEX(s_graph,j,k); s_edge = s_graph->even_adj_list[indjk]; if ( s_edge != NULL ) { /* there is an even edge between j and k */ #ifndef CGL_NEW_SHORT a_graph->arcs[narcs].len = a_graph->arcs[narcs+totoutj].len = (int) (s_edge->weight * ISCALE); a_graph->arcs[narcs].head = &(a_graph->nodes[auxk1]); a_graph->arcs[narcs+totoutj].head = &(a_graph->nodes[auxk2]); #else a_graph->arcs[narcs].length = a_graph->arcs[narcs+totoutj].length = static_cast (s_edge->weight * ISCALE); a_graph->arcs[narcs].to = auxk1; a_graph->arcs[narcs+totoutj].to = auxk2; #endif narcs++; noutj++; } s_edge = s_graph->odd_adj_list[indjk]; if ( s_edge != NULL ) { /* there is an odd edge between j and k */ #ifndef CGL_NEW_SHORT a_graph->arcs[narcs].len = a_graph->arcs[narcs+totoutj].len = (int) (s_edge->weight * ISCALE); a_graph->arcs[narcs].head = &(a_graph->nodes[auxk2]); a_graph->arcs[narcs+totoutj].head = &(a_graph->nodes[auxk1]); #else a_graph->arcs[narcs].length = a_graph->arcs[narcs+totoutj].length = static_cast (s_edge->weight * ISCALE); a_graph->arcs[narcs].to = auxk2; a_graph->arcs[narcs+totoutj].to = auxk1; #endif /* this looks really useless - to be removed ... if ( noutj == 0 ) { a_graph->nodes[auxj1].first = &(a_graph->arcs[narcs]); a_graph->nodes[auxj2].first = &(a_graph->arcs[narcs+totoutj]); } ... */ narcs++; noutj++; } } } narcs += totoutj; } #ifndef CGL_NEW_SHORT a_graph->nodes[a_graph->nnodes].first = &(a_graph->arcs[narcs]); #else a_graph->nodes[a_graph->nnodes].firstArc = &(a_graph->arcs[narcs]); #endif return(a_graph); } /* cancel_node_aux_graph: remove the node j in the separation graph from the auxiliary graph - all the outgoing arc lengths are set to a large value */ auxiliary_graph *cancel_node_aux_graph( int j, /* index of the node in the separation graph */ auxiliary_graph *a_graph /* auxiliary graph to be updated */ ) { int auxj1, auxj2; #ifndef CGL_NEW_SHORT arc *arc_ptr; #else cgl_arc *arc_ptr; #endif auxj1 = AG_TWIN1(j); auxj2 = AG_TWIN2(j); #ifndef CGL_NEW_SHORT for ( arc_ptr = a_graph->nodes[auxj1].first; arc_ptr < a_graph->nodes[auxj1+1].first; arc_ptr++ ) (*arc_ptr).len = ISCALE; for ( arc_ptr = a_graph->nodes[auxj2].first; arc_ptr < a_graph->nodes[auxj2+1].first; arc_ptr++ ) (*arc_ptr).len = ISCALE; #else for ( arc_ptr = a_graph->nodes[auxj1].firstArc; arc_ptr < a_graph->nodes[auxj1+1].firstArc; arc_ptr++ ) (*arc_ptr).length = ISCALE; for ( arc_ptr = a_graph->nodes[auxj2].firstArc; arc_ptr < a_graph->nodes[auxj2+1].firstArc; arc_ptr++ ) (*arc_ptr).length = ISCALE; #endif return(a_graph); } #ifdef PRINT_CUTS #ifndef CGL_NEW_SHORT void print_node(node *n) { printf("\n content of node (addr = %d): first = %d, dist = %d, parent = %d, next = %d, prev = %d, status = %d\n", (int)n,(int)(*n).first,(*n).dist,(int)(*n).parent,(int)(*n).next,(int)(*n).prev, (*n).status); } void print_arc(arc *a) { printf("\n content of arc (addr = %d): len = %d, head = %d\n", (int)a,(*a).len,(int)(*a).head); } void print_node_vect(char *s,node *v,int n) { int i; printf("node vector %s:",s); for ( i = 0; i < n; i++ ) print_node(&v[i]); printf("\n"); } void print_arc_vect(char *s,arc *v,int n) { int i; printf("arc vector %s:",s); for ( i = 0; i < n; i++ ) print_arc(&v[i]); printf("\n"); } #else void print_node(cgl_node *n) { printf("\n content of node (addr = %p): first = %p, dist = %d, parent = %p\n", reinterpret_cast(n), reinterpret_cast((*n).firstArc), (*n).distanceBack, static_cast((*n).parentNode)); } void print_arc(cgl_arc *a) { printf("\n content of arc (addr = %p): len = %d, head = %d\n", reinterpret_cast(a),(*a).length,static_cast((*a).to)); } void print_node_vect(char *s,cgl_node *v,int n) { int i; printf("node vector %s:",s); for ( i = 0; i < n; i++ ) print_node(&v[i]); printf("\n"); } void print_arc_vect(char *s,cgl_arc *v,int n) { int i; printf("arc vector %s:",s); for ( i = 0; i < n; i++ ) print_arc(&v[i]); printf("\n"); } #endif void print_aux_graph(auxiliary_graph *a_graph) { printf("\n content of auxiliary graph: nnodes = %d, narcs = %d\n", a_graph->nnodes,a_graph->narcs); print_node_vect(const_cast("nodes"),a_graph->nodes,a_graph->nnodes); print_arc_vect(const_cast("nodes"),a_graph->arcs,a_graph->narcs); } #endif void free_aux_graph(auxiliary_graph *a_graph) { free(a_graph->nodes); free(a_graph->arcs); free(a_graph); } /* odd cycles management subroutines */ /* simple_cycle: check whether a given cycle is simple (and therefore may correspond to a non-dominated ineq.) */ short int simple_cycle(cycle *s_cyc /* cycle to be checked */) { int i, e, maxnodes; int *cnt; maxnodes = 0; for ( e = 0; e < s_cyc->length; e++ ) { if (!s_cyc->edge_list[e]) { // bad maxnodes=-1; abort();//break; } i = s_cyc->edge_list[e]->endpoint1; if ( i > maxnodes ) maxnodes = i; i = s_cyc->edge_list[e]->endpoint2; if ( i > maxnodes ) maxnodes = i; } if (maxnodes<0) return FALSE; cnt = reinterpret_cast (calloc(maxnodes+1,sizeof(int))); if ( cnt == NULL ) alloc_error(const_cast("cnt")); //for ( i = 0; i <= maxnodes; i++ ) cnt[i] = 0; for ( e = 0; e < s_cyc->length; e++ ) { i = s_cyc->edge_list[e]->endpoint1; cnt[i]++; if ( cnt[i] > 2 ) { free(cnt); return(FALSE); } i = s_cyc->edge_list[e]->endpoint2; cnt[i]++; if ( cnt[i] > 2 ) { free(cnt); return(FALSE); } } free(cnt); return(TRUE); } /* same_cycle: check whether two cycles are identical (assumes the first nodes of the cycles coincide) */ short int same_cycle(cycle *s_cyc1, cycle *s_cyc2 /* cycles to be compared */) { int e, eb; short int same; if ( s_cyc1->length != s_cyc2->length ) return(FALSE); /* check the cycles in the same direction ... */ same = TRUE; for ( e = 0; e < s_cyc1->length; e++ ) { if ( s_cyc1->edge_list[e] != s_cyc2->edge_list[e] ) { same = FALSE; break; } } if ( same ) return(TRUE); /* ... and in reverse direction */ same = TRUE; for ( e = 0, eb = s_cyc2->length - 1; e < s_cyc1->length; e++, eb-- ) { if ( s_cyc1->edge_list[e] != s_cyc2->edge_list[eb] ) { same = FALSE; break; } } if ( same ) return(TRUE); return(FALSE); } #ifdef PRINT_CUTS void print_cycle(cycle *s_cycle) { int e; printf("\n content of cycle: weight = %f, length = %d\n", s_cycle->weight,s_cycle->length); for ( e = 0; e < s_cycle->length; e++ ) print_edge(s_cycle->edge_list[e]); } #endif void free_cycle(cycle *s_cycle) { free(s_cycle->edge_list); free(s_cycle); } /* initialize_cycle_list: allocate and initialize the cycle list data structure */ cycle_list *initialize_cycle_list(int max_cyc /* maximum number of cycles in the list */) { cycle_list *s_cycle_list; s_cycle_list = reinterpret_cast (calloc(1,sizeof(cycle_list))); if ( s_cycle_list == NULL ) alloc_error(const_cast("s_cycle_list")); s_cycle_list->cnum = 0; s_cycle_list->list = reinterpret_cast (calloc(max_cyc,sizeof(cycle *))); if ( s_cycle_list->list == NULL ) alloc_error(const_cast("s_cycle_list->list")); return(s_cycle_list); } /* add_cycle_to_list: add a new cycle to the cycle list data structure (if not already in the list) */ cycle_list *add_cycle_to_list( cycle *s_cycle, /* pointer to the cycle to be added to the list */ cycle_list *s_cycle_list /* input cycle list to be updated */ ) { int c; if ( ! simple_cycle(s_cycle) ) { free_cycle(s_cycle); return(s_cycle_list); } for ( c = 0; c < s_cycle_list->cnum; c++ ) if ( same_cycle(s_cycle,s_cycle_list->list[c]) ) { free_cycle(s_cycle); return(s_cycle_list); } s_cycle_list->list[s_cycle_list->cnum] = s_cycle; (s_cycle_list->cnum)++; return(s_cycle_list); } void free_cycle_list(cycle_list *s_cycle_list) { int c; for ( c = 0; c < s_cycle_list->cnum; c++ ) free_cycle(s_cycle_list->list[c]); free(s_cycle_list->list); free(s_cycle_list); } #ifdef PRINT_CUTS void print_cycle_list(cycle_list *s_cycle_list) { int c; printf("\n content of cycle_list: cnum = %d\n",s_cycle_list->cnum); for ( c = 0; c < s_cycle_list->cnum; c++ ) print_cycle(s_cycle_list->list[c]); } #endif /* get_shortest_odd_cycle_list: computation of the shortest odd cycles visiting a certain node in the separation graph, and each other possible intermediate node, using the auxiliary graph data structure for the shortest path computation - all the cycles in the list are different from each other */ cycle_list *get_shortest_odd_cycle_list( int j, /* first node to be visited by the odd cycle */ separation_graph *s_graph, /* current separation graph */ auxiliary_graph *a_graph /* auxiliary graph for the shortest path computation */ ) { int source, sink, curr, pred, totedges, k, t, kt; double weight; #ifndef CGL_NEW_SHORT //node *source_ptr, *sink_ptr, *first_ptr; #else //cgl_node *source_ptr, *sink_ptr, *first_ptr; #endif edge *curr_edge; short_path_node *forw_arb, *backw_arb; cycle *s_cycle; cycle_list *s_cycle_list; #ifdef TIME second_(&tsi); #endif s_cycle_list = initialize_cycle_list((a_graph->nnodes)-2); source = AG_TWIN1(j); sink = AG_TWIN2(j); //source_ptr = &(a_graph->nodes[source]); //sink_ptr = &(a_graph->nodes[sink]); //first_ptr = &(a_graph->nodes[0]); /* compute the shortest path arborescence rooted at source and the shortest path arborescence rooted at sink (that comes for free due to symmetry) and store them (the path information is hidden into aux_graph) */ #ifdef TIME second_(&ti); #endif #ifndef CGL_NEW_SHORT { int nNodes = a_graph->nnodes; int nArcs = a_graph->narcs; cgl_arc * arcs = new cgl_arc [nArcs]; for (int i=0;iarcs[i].len; arcs[i].to=a_graph->arcs[i].head->index; } cgl_node * nodes = new cgl_node[nNodes+1]; for (int i=0;inodes[i].first-a_graph->arcs; nodes[i].firstArc=arcs+iArc; nodes[i].index=i; } int iArc = a_graph->nodes[nNodes].first-a_graph->arcs; nodes[nNodes].firstArc=arcs+iArc; cgl_graph graph; graph.nnodes=nNodes; graph.narcs=nArcs; graph.nodes=nodes; graph.arcs=arcs; cglShortestPath(&graph,source,ISCALE); dikbd(a_graph->nnodes,first_ptr,source_ptr,ISCALE); for ( k = 0; k < a_graph->nnodes; k++ ) { if ( a_graph->nodes[k].parent != NULL ) { int distance1 = a_graph->nodes[k].dist; int distance2 = graph.nodes[k].distanceBack; assert (distance1==distance2); } else { // printf("null parent %d\n",k); } } } #else cglShortestPath(a_graph,source,ISCALE); #endif #ifdef TIME second_(&tf); path_time += tf - ti; #endif forw_arb = reinterpret_cast (calloc(a_graph->nnodes,sizeof(short_path_node))); if ( forw_arb == NULL ) alloc_error(const_cast("forw_arb")); for ( k = 0; k < a_graph->nnodes; k++ ) { #ifndef CGL_NEW_SHORT if ( a_graph->nodes[k].parent != NULL ) { forw_arb[k].dist = a_graph->nodes[k].dist; forw_arb[k].pred = a_graph->nodes[k].parent->index; } #else if ( a_graph->nodes[k].parentNode >=0 ) { forw_arb[k].dist = a_graph->nodes[k].distanceBack; forw_arb[k].pred = a_graph->nodes[k].parentNode; } #endif else { forw_arb[k].dist = COIN_INT_MAX; forw_arb[k].pred = NONE; } } backw_arb = reinterpret_cast (calloc(a_graph->nnodes,sizeof(short_path_node))); if ( backw_arb == NULL ) alloc_error(const_cast("backw_arb")); for ( k = 0; k < a_graph->nnodes; k++ ) { #ifndef CGL_NEW_SHORT if ( a_graph->nodes[k].parent != NULL ) { backw_arb[AG_MATE(k)].dist = a_graph->nodes[k].dist; backw_arb[AG_MATE(k)].pred = AG_MATE(a_graph->nodes[k].parent->index); } #else if ( a_graph->nodes[k].parentNode >=0) { backw_arb[AG_MATE(k)].dist = a_graph->nodes[k].distanceBack; backw_arb[AG_MATE(k)].pred = AG_MATE(a_graph->nodes[k].parentNode); } #endif else { backw_arb[AG_MATE(k)].dist = COIN_INT_MAX; backw_arb[AG_MATE(k)].pred = NONE; } } #ifdef USELESS /* compute second the shortest path anti-arborescence rooted at sink (which coincides with the arborescence since aux_graph is symmetrical) and store it */ #ifdef TIME second_(&ti); #endif cc = dikbd(a_graph->nnodes,first_ptr,sink_ptr,ISCALE); #ifdef TIME second_(&tf); path_time += tf - ti; #endif backw_arb = (short_path_node *) calloc(a_graph->nnodes,sizeof(short_path_node)); if ( backw_arb == NULL ) alloc_error("backw_arb"); for ( k = 0; k < a_graph->nnodes; k++ ) { backw_arb[k].dist = a_graph->nodes[k].dist; backw_arb[k].pred = a_graph->nodes[k].parent->index; } #endif /* consider each possible intermediate node in aux_graph */ for ( k = 0; k < s_graph->nnodes; k++ ) { if ( k != j ) { for ( t = 1; t <= 2; t++ ) { if ( t == 1 ) kt = AG_TWIN1(k); else kt = AG_TWIN2(k); weight = (static_cast (forw_arb[kt].dist + backw_arb[kt].dist)) / (static_cast (ISCALE)); if ( weight < MAX_CYCLE_WEIGHT + EPS ) { totedges = 0; /* count how many edges are in the forward path from source ... */ curr = kt; do { if (curr<0) { totedges=-1; break; } curr = forw_arb[curr].pred; totedges++; } while ( curr != source ); if (totedges>=0) { /* ... and in the backward path to sink */ curr = kt; do { if (curr<0) { totedges=-1; break; } curr = backw_arb[curr].pred; totedges++; } while ( curr != sink ); } if (totedges>0) { s_cycle = reinterpret_cast (calloc(1,sizeof(cycle))); if ( s_cycle == NULL ) alloc_error(const_cast("s_cycle")); s_cycle->weight = weight; s_cycle->length = totedges; s_cycle->edge_list = reinterpret_cast (calloc(totedges,sizeof(edge *))); if ( s_cycle->edge_list == NULL ) alloc_error(const_cast("s_cycle->edge_list")); /* define the set of edges corresponding to the paths in sep_graph */ totedges = 0; /* forward path from source ... */ curr = kt; do { pred = forw_arb[curr].pred; if ( AG_TYPE(pred,curr) == EVEN ) curr_edge = s_graph->even_adj_list [SG_EDGE_INDEX(s_graph,SG_ORIG(curr),SG_ORIG(pred))]; else curr_edge = s_graph->odd_adj_list [SG_EDGE_INDEX(s_graph,SG_ORIG(curr),SG_ORIG(pred))]; s_cycle->edge_list[totedges] = curr_edge; curr = pred; totedges++; } while ( curr != source ); /* ... and backward path to sink */ curr = kt; do { pred = backw_arb[curr].pred; if ( AG_TYPE(pred,curr) == EVEN ) curr_edge = s_graph->even_adj_list [SG_EDGE_INDEX(s_graph,SG_ORIG(curr),SG_ORIG(pred))]; else curr_edge = s_graph->odd_adj_list [SG_EDGE_INDEX(s_graph,SG_ORIG(curr),SG_ORIG(pred))]; s_cycle->edge_list[totedges] = curr_edge; curr = pred; totedges++; } while ( curr != sink ); /* insert the new cycle in the list */ s_cycle_list = add_cycle_to_list(s_cycle,s_cycle_list); } } } } } free(forw_arb); free(backw_arb); #ifdef TIME second_(&tsf); cycle_time += tsf - tsi; #endif return(s_cycle_list); } /* cut management subroutines */ /* initialize_cut_list: allocate and initialize the cut list data structure */ cut_list *initialize_cut_list(int max_cut /* maximum number of cuts in the list */) { cut_list *cuts; cuts = reinterpret_cast (calloc(1,sizeof(cut_list))); if ( cuts == NULL ) alloc_error(const_cast("cuts")); cuts->cnum = 0; cuts->list = reinterpret_cast (calloc(max_cut,sizeof(cut *))); return(cuts); } #ifdef PRINT_CUTS void Cgl012Cut::print_cut(cut *v_cut) { printf("\n content of cut: n_of_constr = %d, cnzcnt = %d, crhs = %d, csense = %c, violation = %f\n", v_cut->n_of_constr,v_cut->cnzcnt,v_cut->crhs,v_cut->csense,v_cut->violation); print_int_vect(const_cast("cind"),v_cut->cind,v_cut->cnzcnt); print_int_vect(const_cast("cval"),v_cut->cval,v_cut->cnzcnt); if ( v_cut->constr_list != NULL ) print_int_vect(const_cast("constr_list"),v_cut->constr_list,v_cut->n_of_constr); if ( v_cut->in_constr_list != NULL ) print_short_int_vect(const_cast("in_constr_list"),v_cut->in_constr_list,inp_ilp->mr); ; } void Cgl012Cut::print_cut_list(cut_list *cuts) { int c; printf("\n content of cut_list: cnum = %d\n",cuts->cnum); for ( c = 0; c < cuts->cnum; c++ ) print_cut(cuts->list[c]); } #endif void free_cut(cut *v_cut) { if ( v_cut->constr_list != NULL ) free(v_cut->constr_list); if ( v_cut->in_constr_list != NULL ) free(v_cut->in_constr_list); if ( v_cut->cind != NULL ) free(v_cut->cind); if ( v_cut->cval != NULL ) free(v_cut->cval); free(v_cut); } void free_cut_list(cut_list *cuts) { int c; for ( c = 0; c < cuts->cnum; c++ ) if ( cuts->list[c] != NULL ) free_cut(cuts->list[c]); free(cuts->list); free(cuts); } /* get_ori_cut_coef: get the coefficients of a cut, before dividing by 2 and rounding, starting from the list of the constraints combined to get the cut */ short int Cgl012Cut::get_ori_cut_coef( int n_of_constr, /* number of constraints combined */ int *constr_list, /* list of the constraints combined */ int *ccoef, /* cut left hand side coefficients */ int *crhs, /* cut right hand side */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ) { int h, i, begi, gcdi, ofsj; double tot_slack; /* fast check of the possible violation of the cut */ if ( only_viol ) { tot_slack = 0.0; for ( h = 0; h < n_of_constr; h++ ) { tot_slack += p_ilp->slack[constr_list[h]]; if ( tot_slack > MAX_SLACK - EPS ) return(FALSE); } } //for ( j = 0; j < inp_ilp->mc; j++ ) //ccoef[j] = 0; memset(ccoef,0,inp_ilp->mc*sizeof(int)); (*crhs) = 0; for ( h = 0; h < n_of_constr; h++ ) { i = constr_list[h]; begi = inp_ilp->mtbeg[i]; gcdi = p_ilp->gcd[i]; if ( inp_ilp->msense[i] != 'G' ) { if ( gcdi == 1 ) { for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) ccoef[inp_ilp->mtind[begi+ofsj]] += inp_ilp->mtval[begi+ofsj]; (*crhs) += inp_ilp->mrhs[i]; } else { for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) ccoef[inp_ilp->mtind[begi+ofsj]] += inp_ilp->mtval[begi+ofsj] / gcdi; (*crhs) += inp_ilp->mrhs[i] / gcdi; } } else { if ( gcdi == 1 ) { for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) ccoef[inp_ilp->mtind[begi+ofsj]] -= inp_ilp->mtval[begi+ofsj]; (*crhs) -= inp_ilp->mrhs[i]; } else { for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) ccoef[inp_ilp->mtind[begi+ofsj]] -= inp_ilp->mtval[begi+ofsj] / gcdi; (*crhs) -= inp_ilp->mrhs[i] / gcdi; } } } return(TRUE); } /* best_cut: find the coefficients, the rhs and the violation of the best possible cut that can be obtained by weakening a given set of coefficients to even and a rhs to odd, dividing by 2 and rounding */ short int Cgl012Cut::best_cut( int *ccoef, /* vector of the coefficients */ int *crhs, /* pointer to rhs value */ double *violation, /* violation of the cut */ short int update, /* TRUE/FALSE: if TRUE, the new ccoef and crhs are given on output */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ) { int j, n_to_weak; short int original_parity; double original_slack, best_even_slack, best_odd_slack; int *vars_to_weak; info_weak *info_even_weak, *info_odd_weak; /* choose the best weakening for the variables whose coefficient is not odd - this hopefully produces a stronger cut than that associated with the weakened inequalities to define the edges */ vars_to_weak = reinterpret_cast (calloc(inp_ilp->mc,sizeof(int))); if ( vars_to_weak == NULL ) alloc_error(const_cast("vars_to_weak")); n_to_weak = 0; original_slack = 0.0; for ( j = 0; j < inp_ilp->mc; j++ ) { if ( ccoef[j] != 0 ) { if ( mod2(ccoef[j]) == ODD ) { vars_to_weak[n_to_weak] = j; n_to_weak++; } original_slack -= inp_ilp->xstar[j] * static_cast (ccoef[j]); } } original_slack += static_cast (*crhs); if ( original_slack > MAX_SLACK - EPS ) { free(vars_to_weak); return(FALSE); } original_parity = mod2(*crhs); if ( best_weakening(n_to_weak,vars_to_weak, original_parity,original_slack, &best_even_slack,&best_odd_slack, &info_even_weak,&info_odd_weak, TRUE,only_viol) == ODD ) { *violation = ( 1.0 - best_odd_slack ) / 2.0; if ( ! update ) { /* new ccoef and rhs are not required on output */ free(vars_to_weak); free_info_weak(info_odd_weak); return(TRUE); } /* update ccoef and crhs according to the best odd weakening */ for ( j = 0; j < n_to_weak; j++ ) if ( info_odd_weak->type[j] == LOWER_BOUND ) { ccoef[vars_to_weak[j]]--; *crhs -= inp_ilp->vlb[vars_to_weak[j]]; } else { ccoef[vars_to_weak[j]]++; *crhs += inp_ilp->vub[vars_to_weak[j]]; } /* compute and check the correctness of the cut coefficients */ for ( j = 0; j < inp_ilp->mc; j++ ) { if ( mod2(ccoef[j]) == ODD ) { printf("!!! Error 2 in weakening a cut !!!\n"); exit(0); } if ( ccoef[j] != 0 ) ccoef[j] /= 2; } if ( mod2(*crhs) == EVEN ) { printf("!!! Error 1 in weakening a cut !!!\n"); exit(0); } *crhs = (*crhs - 1) / 2; free(vars_to_weak); free_info_weak(info_odd_weak); return(TRUE); } else { free(vars_to_weak); return(FALSE); } } /* define_cut: construct a cut data structure from a vector of coefficients and a right-hand-side */ cut *Cgl012Cut::define_cut( int *ccoef, /* coefficients of the cut */ int crhs /* right hand side of the cut */ ) { int cnzcnt, j; cut *v_cut; v_cut = reinterpret_cast (calloc(1,sizeof(cut))); if ( v_cut == NULL ) alloc_error(const_cast("v_cut")); v_cut->crhs = crhs; cnzcnt = 0; for ( j = 0; j < inp_ilp->mc; j++ ) if ( ccoef[j] != 0 ) cnzcnt++; v_cut->cnzcnt = cnzcnt; v_cut->csense = 'L'; v_cut->cind = reinterpret_cast (calloc(cnzcnt,sizeof(int))); if ( v_cut->cind == NULL ) alloc_error(const_cast("v_cut->cind")); v_cut->cval = reinterpret_cast (calloc(cnzcnt,sizeof(int))); if ( v_cut->cval == NULL ) alloc_error(const_cast("v_cut->cval")); cnzcnt = 0; v_cut->violation = 0.0; for ( j = 0; j < inp_ilp->mc; j++ ) if ( ccoef[j] != 0 ) { v_cut->cind[cnzcnt] = j; v_cut->cval[cnzcnt] = ccoef[j]; v_cut->violation += inp_ilp->xstar[j] * static_cast (ccoef[j]); cnzcnt++; } v_cut->violation -= static_cast (crhs); return(v_cut); } /* get_cut: extract a hopefully violated cut from an odd cycle of the separation graph */ cut *Cgl012Cut::get_cut( cycle *s_cyc /* shortest odd cycles identified in the separation graph */ ) { int i, e, crhs; short int ok; /* short int original_parity; */ double violation; /* double original_slack, best_even_slack, best_odd_slack; */ int *ccoef /*, *vars_to_weak */ ; /* info_weak *info_even_weak, *info_odd_weak; */ cut *v_cut; int ncomb; int *comb; short int *flag_comb; #ifndef CGGGGG static int iter = 0; static double gap, maxgap = 0.0; #endif #ifdef TIME second_(&tsi); cut_ncalls++; #endif /* compute the cut obtained by adding-up all the constraints corresponding to edges in the cycle, in their non-weak form */ #ifdef TIME second_(&tii); #endif ccoef = reinterpret_cast (calloc(inp_ilp->mc,sizeof(int))); if ( ccoef == NULL ) alloc_error(const_cast("ccoef")); ncomb = 0; comb = reinterpret_cast (calloc(inp_ilp->mr,sizeof(int))); if ( comb == NULL ) alloc_error(const_cast("comb")); flag_comb = reinterpret_cast (calloc(inp_ilp->mr,sizeof(short int))); if ( flag_comb == NULL ) alloc_error(const_cast("flag_comb")); #if 0 // no need to as calloc used for ( i = 0; i < inp_ilp->mr; i++ ) flag_comb[i] = OUT; for ( j = 0; j < inp_ilp->mc; j++ ) ccoef[j] = 0; #endif crhs = 0; for ( e = 0; e < s_cyc->length; e++ ) { i = (s_cyc->edge_list[e])->constr; if ( i >= 0 ) { /* the edge is not associated with a bound constraint */ comb[ncomb] = i; ncomb++; flag_comb[i] = IN; } } ok = get_ori_cut_coef(ncomb,comb,ccoef,&crhs,TRUE); #ifdef TIME second_(&tff); coef_time += tff - tii; #endif ok = ok && best_cut(ccoef,&crhs,&violation,TRUE,TRUE); if ( ! ok ) { free(ccoef); free(comb); free(flag_comb); #ifdef TIME second_(&tsf); cut_time += tsf - tsi; #endif return(NULL); } v_cut = define_cut(ccoef,crhs); iter++; if ( v_cut->violation > violation + EPS || v_cut->violation < violation - EPS ) { //printf("Error in violation check\n"); //printf("v_cut->violation %f violation %f gap %f maxgap (previous) %f\n", // v_cut->violation,violation,v_cut->violation-violation,maxgap); //printf("iter %d\n",iter); //exit(0); free_cut(v_cut); free(ccoef); free(comb); free(flag_comb); errorNo=1; return(NULL); } gap = v_cut->violation - violation; if ( gap < 0.0 ) gap = -gap; if ( gap > maxgap ) maxgap = gap; v_cut->n_of_constr = ncomb; v_cut->constr_list = comb; v_cut->in_constr_list = flag_comb; free(ccoef); #ifdef TIME second_(&tsf); cut_time += tsf - tsi; #endif return(v_cut); } /* cut_score: define the score of a (violated) cut */ double Cgl012Cut::cut_score( int *ccoef, /* cut left hand side coefficients */ int crhs, /* cut right hand side */ double viol, /* cut violation */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ) { int j, norm; /* very simple score: violation divided/multiplied by the lhs norm */ if ( only_viol && viol < MIN_VIOLATION ) return(-INF); norm = 0; for ( j = 0; j < p_ilp->mc; j++ ) { if ( ccoef[j] != 0 ) norm += ccoef[j] * ccoef[j]; } if ( viol > 0.0 ) return (viol / sqrt(static_cast (norm))); else return (viol * sqrt(static_cast (norm))); } /* same_cut: check whether two cuts are identical - not too clever (assumes the sparse coefficients are sorted by column index) */ short int same_cut(cut *cut1, cut *cut2 /* cuts to be compared */) { int j; if ( cut1->cnzcnt != cut2->cnzcnt ) return(FALSE); if ( cut1->crhs != cut2->crhs ) return(FALSE); if ( cut1->csense != cut2->csense ) return(FALSE); for ( j = 0; j < cut1->cnzcnt; j++ ) { if ( cut1->cind[j] != cut2->cind[j] ) return(FALSE); if ( cut1->cval[j] != cut2->cval[j] ) return(FALSE); } return(TRUE); } /* add_cut_to_list: adds a cut to a list after checking that a copy of the same cut is not already in the list - no checking is made about cuts dominating each other or implied by other cuts in the list plus the constraints of the original problem */ cut_list *add_cut_to_list( cut *v_cut, /* pointer to the violated cut to be added to the list */ cut_list *cuts /* input cut list to be updated */ ) { int c; for ( c = 0; c < cuts->cnum; c++ ) { if ( same_cut(v_cut,cuts->list[c]) ) { free_cut(v_cut); return(cuts); } } cuts->list[cuts->cnum] = v_cut; cuts->cnum++; return(cuts); } /* getcuts: pick the 0-1/2 cuts in the list and give them on output */ void getcuts( cut_list *cuts, /* input cut list */ int *cnum, /* number of violated 0-1/2 cuts identified by the procedure */ int *cnzcnt, /* overall number of nonzero's in the cuts */ int **cbeg, /* starting position of each cut in arrays cind and cval */ int **ccnt, /* number of entries of each cut in arrays cind and cval */ int **cind, /* column indices of the nonzero entries of the cuts */ int **cval, /* values of the nonzero entries of the cuts */ int **crhs, /* right hand sides of the cuts */ char **csense /* senses of the cuts: 'L', 'G' or 'E' */ ) { int i, ofsj, count; cut *cut_ptr; /* allocate the memory for the output vectors */ (*cnum) = cuts->cnum; (*cnzcnt) = 0; for ( i = 0; i < cuts->cnum; i++ ) (*cnzcnt) += (cuts->list[i])->cnzcnt; /* if ( (*cbeg) != NULL ) free(*cbeg); */ (*cbeg) = reinterpret_cast (calloc((*cnum),sizeof(int))); if ( (*cbeg) == NULL ) alloc_error(const_cast("*cbeg")); /* if ( (*ccnt) != NULL ) free(*ccnt); */ (*ccnt) = reinterpret_cast (calloc((*cnum),sizeof(int))); if ( (*ccnt) == NULL ) alloc_error(const_cast("*ccnt")); /* if ( (*crhs) != NULL ) free(*crhs); */ (*crhs) = reinterpret_cast (calloc((*cnum),sizeof(int))); if ( (*crhs) == NULL ) alloc_error(const_cast("*crhs")); /* if ( (*csense) != NULL ) free(*csense); */ (*csense) = reinterpret_cast (calloc((*cnum),sizeof(char))); if ( (*csense) == NULL ) alloc_error(const_cast("*csense")); /* if ( (*cind) != NULL ) free(*cind); */ (*cind) = reinterpret_cast (calloc((*cnzcnt),sizeof(int))); if ( (*cind) == NULL ) alloc_error(const_cast("*cind")); /* if ( (*cval) != NULL ) free(*cval); */ (*cval) = reinterpret_cast (calloc((*cnzcnt),sizeof(int))); if ( (*cval) == NULL ) alloc_error(const_cast("*cval")); /* transfer the cuts information into the output data structures */ count = 0; for ( i = 0; i < cuts->cnum; i++ ) { cut_ptr = cuts->list[i]; (*cbeg)[i] = count; (*ccnt)[i] = cut_ptr->cnzcnt; (*crhs)[i] = cut_ptr->crhs; (*csense)[i] = cut_ptr->csense; for ( ofsj = 0; ofsj < cut_ptr->cnzcnt; ofsj++ ) { (*cind)[count] = cut_ptr->cind[ofsj]; (*cval)[count] = cut_ptr->cval[ofsj]; count++; } } } /* actual separation subroutines */ /* best_weakening: find the best upper/lower bound weakening of a set of variables */ int Cgl012Cut::best_weakening( int n_to_weak, /* number of variables to weaken */ int *vars_to_weak, /* indices of the variables to weaken */ short int original_parity, /* original parity of the constraint to weaken */ double original_slack, /* original slack of the constraint to weaken */ double *best_even_slack, /* best possible slack of a weakened constraint with even right-hand-side */ double *best_odd_slack, /* best possible slack of a weakened constraint with odd right-hand-side */ info_weak **info_even_weak, /* weakening information about the best possible even weakened constraint */ info_weak **info_odd_weak, /* weakening information about the best possible odd weakened constraint */ short int only_odd, /* flag which tells whether only an odd weakening is of interest (TRUE) or both weakenings are (FALSE) */ short int only_viol /* flag which tells whether only an inequality of slack smaller than MAX_SLACK is of interest (TRUE) otherwise (FALSE) */ ) { int nweak, cntweak, ofsl, l; short int flag_even, flag_odd, ok_even, ok_odd; double best_even_e, best_even_o, best_odd_e, best_odd_o; short int *type_even_weak, *type_odd_weak, *switch_even_weak, *switch_odd_weak; #ifdef TIME second_(&tii); #endif type_even_weak = reinterpret_cast (calloc(p_ilp->mc,sizeof(short int))); if (type_even_weak == NULL ) alloc_error(const_cast("type_even_weak")); switch_even_weak = reinterpret_cast (calloc(p_ilp->mc,sizeof(short int))); if (switch_even_weak == NULL ) alloc_error(const_cast("switch_even_weak")); type_odd_weak = reinterpret_cast (calloc(p_ilp->mc,sizeof(short int))); if (type_odd_weak == NULL ) alloc_error(const_cast("type_odd_weak")); switch_odd_weak = reinterpret_cast (calloc(p_ilp->mc,sizeof(short int))); if (switch_odd_weak == NULL ) alloc_error(const_cast("switch_odd_weak")); if ( original_parity == EVEN ) { (*best_even_slack) = original_slack; (*best_odd_slack) = INF; } else { (*best_odd_slack) = original_slack; (*best_even_slack) = INF; } nweak = 0; for ( ofsl = 0; ofsl < n_to_weak; ofsl++ ) { l = vars_to_weak[nweak]; if ( p_ilp->possible_weak[l] == NONE ) { free(type_even_weak); free(type_odd_weak); free(switch_even_weak); free(switch_odd_weak); #ifdef TIME second_(&tff); bw_time += tff - tii; #endif return(NONE); } else if ( p_ilp->possible_weak[l] == EVEN ) { /* only even weakening of l is possible */ (*best_even_slack) += p_ilp->loss_even_weak[l]; type_even_weak[nweak] = p_ilp->type_even_weak[l]; switch_even_weak[nweak] = FALSE; (*best_odd_slack) += p_ilp->loss_even_weak[l]; type_odd_weak[nweak] = p_ilp->type_even_weak[l]; switch_odd_weak[nweak] = FALSE; } else if ( p_ilp->possible_weak[l] == ODD ) { /* only odd weakening of l is possible */ best_even_e = (*best_even_slack); best_odd_o = (*best_odd_slack); (*best_even_slack) = best_odd_o + p_ilp->loss_odd_weak[l]; type_even_weak[nweak] = p_ilp->type_odd_weak[l]; switch_even_weak[nweak] = TRUE; (*best_odd_slack) = best_even_e + p_ilp->loss_odd_weak[l]; type_odd_weak[nweak] = p_ilp->type_odd_weak[l]; switch_odd_weak[nweak] = TRUE; } else { /* both weakenings of l are possible */ best_even_e = (*best_even_slack) + p_ilp->loss_even_weak[l]; best_even_o = (*best_odd_slack) + p_ilp->loss_odd_weak[l]; best_odd_e = (*best_odd_slack) + p_ilp->loss_even_weak[l]; best_odd_o = (*best_even_slack) + p_ilp->loss_odd_weak[l]; if ( best_even_e <= best_even_o ) { (*best_even_slack) = best_even_e; type_even_weak[nweak] = p_ilp->type_even_weak[l]; switch_even_weak[nweak] = FALSE; } else { (*best_even_slack) = best_even_o; type_even_weak[nweak] = p_ilp->type_odd_weak[l]; switch_even_weak[nweak] = TRUE; } if ( best_odd_e <= best_odd_o ) { (*best_odd_slack) = best_odd_e; type_odd_weak[nweak] = p_ilp->type_even_weak[l]; switch_odd_weak[nweak] = FALSE; } else { (*best_odd_slack) = best_odd_o; type_odd_weak[nweak] = p_ilp->type_odd_weak[l]; switch_odd_weak[nweak] = TRUE; } } if ( ( only_viol ) && ( (*best_even_slack) > MAX_SLACK - EPS ) && ( (*best_odd_slack) > MAX_SLACK - EPS ) ) { free(type_even_weak); free(type_odd_weak); free(switch_even_weak); free(switch_odd_weak); #ifdef TIME second_(&tff); bw_time += tff - tii; #endif return(NONE); } nweak++; } /* construct the weakening vectors associated with the best even and odd pairs (if the associated slack is not too big) */ if ( (! only_odd) && ( ( (*best_even_slack) <= MAX_SLACK - EPS ) || ( (! only_viol) && (*best_even_slack) <= INF - EPS ) ) ) { ok_even = TRUE; (*info_even_weak) = alloc_info_weak(nweak); (*info_even_weak)->nweak = nweak; flag_even = EVEN; cntweak = nweak; for ( ofsl = n_to_weak - 1; ofsl >= 0; ofsl-- ) { cntweak--; (*info_even_weak)->var[cntweak] = vars_to_weak[ofsl]; if ( flag_even == EVEN ) { (*info_even_weak)->type[cntweak] = type_even_weak[cntweak]; if ( switch_even_weak[cntweak] ) flag_even = ODD; } else { (*info_even_weak)->type[cntweak] = type_odd_weak[cntweak]; if ( switch_odd_weak[cntweak] ) flag_even = EVEN; } } } else ok_even = FALSE; if ( ( (*best_odd_slack) <= MAX_SLACK - EPS ) || ( (! only_viol) && (*best_odd_slack) <= INF - EPS ) ) { ok_odd = TRUE; (*info_odd_weak) = alloc_info_weak(nweak); (*info_odd_weak)->nweak = nweak; flag_odd = ODD; cntweak = nweak; for ( ofsl = n_to_weak - 1; ofsl >= 0; ofsl-- ) { cntweak--; (*info_odd_weak)->var[cntweak] = vars_to_weak[ofsl]; if ( flag_odd == EVEN ) { (*info_odd_weak)->type[cntweak] = type_even_weak[cntweak]; if ( switch_even_weak[cntweak] ) flag_odd = ODD; } else { (*info_odd_weak)->type[cntweak] = type_odd_weak[cntweak]; if ( switch_odd_weak[cntweak] ) flag_odd = EVEN; } } } else ok_odd = FALSE; free(type_even_weak); free(type_odd_weak); free(switch_even_weak); free(switch_odd_weak); #ifdef TIME second_(&tff); bw_time += tff - tii; #endif if ( ok_odd && ok_even ) return(BOTH); if ( ok_even ) return(EVEN); if ( ok_odd ) return(ODD); return(NONE); } /* basic_separation: try to identify violated 0-1/2 cuts by using the original procedure described in Caprara and Fischetti's MP paper */ cut_list *Cgl012Cut::basic_separation() { int i, j, k, l, begi, special, ofsj, ofsk, ofsl, n_to_weak, c; short int parity, original_parity, ok_weak; double weight, original_slack, best_even_slack, best_odd_slack; int *vars_to_weak; info_weak *info_even_weak, *info_odd_weak, *i_weak; separation_graph *sep_graph; auxiliary_graph *aux_graph; cycle_list *short_cycle_list; cut *violated_cut; cut_list *out_cuts; /* construct the separation graph by the standard weakening procedure */ #ifdef PRINT print_parity_ilp(); #endif #ifdef TIME second_(&td); #endif #ifdef PRINT_TIME printf("... time elapsed at the beginning of basic_separation: %f\n",td - tti); #endif #ifdef TIME second_(&td); #endif #ifdef PRINT_TIME printf("... time elapsed before initialize_sep_graph: %f\n",td - tti); #endif sep_graph = initialize_sep_graph(); special = p_ilp->mc; #ifdef TIME second_(&td); #endif #ifdef PRINT_TIME printf("... time elapsed before weakening: %f\n",td - tti); #endif /* edges associated with actual constraints in the ILP */ for ( i = 0; i < p_ilp->mr; i++ ) { if ( ! p_ilp->row_to_delete[i] ) { begi = p_ilp->mtbeg[i]; if ( p_ilp->mtcnt[i] == 1 ) { /* row with one odd entry only: edge j -- special */ weight = p_ilp->slack[i]; if ( weight < MAX_SLACK - EPS ) { j = p_ilp->mtind[begi]; parity = p_ilp->mrhs[i]; i_weak = alloc_info_weak(0); sep_graph = update_weight_sep_graph (j,special,weight,parity,i,i_weak,sep_graph); } } else if ( p_ilp->mtcnt[i] == 2 ) { /* row with two odd entries only: edge j -- k */ weight = p_ilp->slack[i]; if ( weight < MAX_SLACK - EPS ) { j = p_ilp->mtind[begi]; k = p_ilp->mtind[begi+1]; parity = p_ilp->mrhs[i]; i_weak = alloc_info_weak(0); sep_graph = update_weight_sep_graph (j,k,weight,parity,i,i_weak,sep_graph); } } else { /* row with three or more odd entries: weakening for all 1's pairs */ for ( ofsj = 0; ofsj < p_ilp->mtcnt[i]; ofsj++ ) { for ( ofsk = ofsj + 1; ofsk < p_ilp->mtcnt[i]; ofsk++ ) { /* edge(s) j -- k */ j = p_ilp->mtind[begi+ofsj]; k = p_ilp->mtind[begi+ofsk]; original_slack = p_ilp->slack[i]; original_parity = p_ilp->mrhs[i]; n_to_weak = 0; vars_to_weak = reinterpret_cast (calloc(inp_ilp->mc,sizeof(int))); if ( vars_to_weak == NULL ) alloc_error(const_cast("vars_to_weak")); for ( ofsl = 0; ofsl < p_ilp->mtcnt[i]; ofsl++ ) if ( ofsl != ofsj && ofsl != ofsk ) { l = p_ilp->mtind[begi+ofsl]; vars_to_weak[n_to_weak] = l; n_to_weak++; } ok_weak = best_weakening(n_to_weak,vars_to_weak, original_parity,original_slack, &best_even_slack,&best_odd_slack, &info_even_weak,&info_odd_weak, FALSE,TRUE); free(vars_to_weak); if ( ok_weak == NONE ) goto EXITJK; if ( ok_weak == BOTH || ok_weak == EVEN ) { if ( best_even_slack < MAX_SLACK - EPS ) { weight = best_even_slack; parity = EVEN; sep_graph = update_weight_sep_graph (j,k,weight,parity,i,info_even_weak,sep_graph); } } if ( ok_weak == BOTH || ok_weak == ODD ) { if ( best_odd_slack < MAX_SLACK - EPS ) { weight = best_odd_slack; parity = ODD; sep_graph = update_weight_sep_graph (j,k,weight,parity,i,info_odd_weak,sep_graph); } } EXITJK:; } } } } } /* edges associated with the bound constraints (probably useless but necessary in some cases */ for ( j = 0; j < p_ilp->mc; j++ ) { if ( ! p_ilp->col_to_delete[j] ) { weight = p_ilp->xstar[j] - inp_ilp->vlb[j]; if ( weight < MAX_SLACK - EPS ) { parity = mod2(inp_ilp->vlb[j]); i_weak = alloc_info_weak(0); sep_graph = update_weight_sep_graph (j,special,weight,parity,NONE,i_weak,sep_graph); } weight = inp_ilp->vub[j] - p_ilp->xstar[j]; if ( weight < MAX_SLACK - EPS ) { parity = mod2(inp_ilp->vub[j]); i_weak = alloc_info_weak(0); sep_graph = update_weight_sep_graph (j,special,weight,parity,NONE,i_weak,sep_graph); } } } #ifdef TIME second_(&tf); weak_time += tf - ti; #endif /* construct the auxiliary graph for the shortest path computation and compute the smallest cost odd cycle visiting each node - this part is strongly dependent on the data structure used by the shortest path subroutine used */ #ifdef PRINT print_sep_graph(sep_graph); #endif #ifdef TIME second_(&ti); #endif #ifdef TIME second_(&td); #endif #ifdef PRINT_TIME printf("... time elapsed before define_aux_graph: %f\n",td - tti); #endif aux_graph = define_aux_graph(sep_graph); #ifdef TIME second_(&tf); aux_time += tf - ti; #endif #ifdef PRINT print_aux_graph(aux_graph); #endif /* exit(1); */ #ifdef TIME second_(&td); #endif #ifdef PRINT_TIME printf("... time elapsed before cycles and cuts: %f\n",td - tti); printf("%d nodes on list\n",sep_graph->nnodes); #endif out_cuts = initialize_cut_list(MAX_CUTS); for ( j = 0; j < sep_graph->nnodes; j++ ) { short_cycle_list = get_shortest_odd_cycle_list(j,sep_graph,aux_graph); if ( short_cycle_list == NULL ) goto EXIT_NODE; #ifdef PRINT print_cycle_list(short_cycle_list); #endif for ( c = 0; c < short_cycle_list->cnum; c++ ) { violated_cut = get_cut(short_cycle_list->list[c]); if ( violated_cut == NULL ) { if (!errorNo) continue; else break; } #ifdef PRINT print_cut(violated_cut); #endif if ( violated_cut->violation > MIN_VIOLATION + EPS ) { /* violated 0-1/2 cut found */ out_cuts = add_cut_to_list(violated_cut,out_cuts); if ( out_cuts->cnum >= MAX_CUTS ) { free_cycle_list(short_cycle_list); goto EXIT_CUTS; } } else free_cut(violated_cut); } /* remove the current node from the auxiliary graph */ EXIT_NODE: aux_graph = cancel_node_aux_graph(j,aux_graph); free_cycle_list(short_cycle_list); } EXIT_CUTS: free_sep_graph(sep_graph); free_aux_graph(aux_graph); #ifdef PRINT_CUTS print_cut_list(out_cuts); #endif #ifdef TIME second_(&td); #endif #ifdef PRINT_TIME printf("... time elapsed at the end of basic_separation: %f\n",td - tti); #endif return(out_cuts); } /* 012cut: main procedure for 0-1/2 cut separation first release: Aug 12 1996 last revision: Jun 10 1997 */ /* static data structures for log information about separation */ #ifndef CGGGGG static int sep_iter = 0; /* number of the current separation iteration */ //#define POOL #ifdef POOL static pool_cut_list *pool = NULL; /* information about the cuts separated so far, used to decide when they should be added to the current LP */ #endif static log_var **vlog = NULL; /* information about the value attained by the variables in the last iterations, used to possibly set to 0 some coefficient > 0 in a cut to be added */ static bool aggr; /* flag saying whether as many cuts as possible are required from the separation procedure (TRUE) or not (FALSE) */ #endif /* include the reactive local search heuristic */ //was #include "Cgltabu_012.c" //start include "Cgltabu_012.c" #define MAX_TABU_ITER 100 #define NUM_HASH_ENTRIES MAX_CUT_POOL /* initial length of the tabu list */ #define IN_PROHIB_PERIOD 3 #define MAX_TIME_FACTOR 3 /* data structure for the current local search solution */ typedef struct { int n_of_constr; /* number of constraints in the current cut */ short int *in_constr_list; /* flag saying whether a given constraint is in the list of constraints of the cut (IN) or not (OUT) */ int *non_weak_coef; /* coefficients of the cut before weakening */ int non_weak_rhs; /* coefficient of the rhs before weakening */ double slack_sum; /* sum of the slacks of the constraints in the cut */ double min_weak_loss; /* minimum loss by weakening the non even coefficients */ int one_norm; /* 1-norm of the lhs, i.e. sum of the absolute values of the coefficients */ short int ok; /* logical flag telling whether the cut could be weakened to a 0-1/2 cut or not - if false the two fields below have no meaning */ int *coef; /* actual coefficients of the cut */ int rhs; /* actual rhs of the cut */ double violation; /* violation of the cut */ } tabu_cut; /* data structure for the hash table used in memory reaction */ typedef struct h_e { int n_of_el; /* number of components to be considered */ short int *flag_vect; /* vector of flags for the components */ int last_vis; /* last iteration when this element was visited */ struct h_e *next; /* pointer to the next element in the hash chain */ } hash_element; typedef hash_element **hash_table; /* global variables for local search */ int n; /* number of variables in the ILP */ int m; /* number of constraints in the ILP */ int it; /* number of tabu search iterations so far */ tabu_cut *cur_cut; /* information about the current cut in local search */ int *last_moved; /* last iteration when a given constraint was added/ deleted from the list of constraints of the cut */ int last_it_add; /* last iteration when a cut was added to the list */ int last_it_restart; /* last iteration when a restart was performed */ int prohib_period; /* current prohibition period */ int last_prohib_period_mod; /* last iteration where prohibition period was modified */ hash_table hash_tab; /* hash table */ int A; /* parameter A in Battiti and Protasi */ int B; /* parameter B in Battiti and Protasi */ float elapsed_time; /* time elapsed since the beginning of the current tabu search call */ /* clear_cur_cut: clear the current solution (no constraint in the cut) */ void clear_cur_cut() { int i, j; cur_cut->n_of_constr = 0; cur_cut->rhs = 0; cur_cut->non_weak_rhs = 0; cur_cut->violation = 0.0; cur_cut->slack_sum = 0.0; cur_cut->min_weak_loss = 0.0; cur_cut->one_norm = 0; for ( j = 0; j < n; j++ ) { cur_cut->coef[j] = 0; cur_cut->non_weak_coef[j] = 0; } for ( i = 0; i < m; i++ ) { cur_cut->in_constr_list[i] = OUT; } cur_cut->ok = FALSE; } /* initialize_cur_cut: allocate the memory for cur_cut */ void initialize_cur_cut() { cur_cut = reinterpret_cast (calloc(1,sizeof(tabu_cut))); if ( cur_cut == NULL ) alloc_error(const_cast("cur_cut")); cur_cut->coef = reinterpret_cast (calloc(n,sizeof(int))); if ( cur_cut->coef == NULL ) alloc_error(const_cast("cur_cut->coef")); cur_cut->non_weak_coef = reinterpret_cast (calloc(n,sizeof(int))); if ( cur_cut->non_weak_coef == NULL ) alloc_error(const_cast("cur_cut->non_weak_coef")); cur_cut->in_constr_list = reinterpret_cast (calloc(m,sizeof(short int))); if ( cur_cut->in_constr_list == NULL ) alloc_error(const_cast("cur_cut->in_constr_list")); clear_cur_cut(); } /* free_cur_cut: free the memory for cur_cut */ void free_cur_cut() { free(cur_cut->coef); free(cur_cut->non_weak_coef); free(cur_cut->in_constr_list); free(cur_cut); } #ifdef PRINT_TABU /* print_cur_cut: display cur_cut on output */ void Cgl012Cut::print_cur_cut() { int i, j; printf("iteration %d prohib_period %d\n",it,prohib_period); printf("\n content of cur_cut data structure: n_of_constr = %d, ok = %d\n", cur_cut->n_of_constr, cur_cut->ok); for ( i = 0; i < m; i++ ) if ( cur_cut->in_constr_list[i] == IN ) printf("constr. %d\n",i); /* printf(" list of constraints:\n"); for ( i = 0; i < m; i++ ) if ( cur_cut->in_constr_list[i] == IN ) print_constr(i); print_int_vect("non_weak_coef",cur_cut->non_weak_coef,n); printf(" non_weak_rhs = %d\n",cur_cut->non_weak_rhs); print_int_vect("coef",cur_cut->coef,n); printf(" rhs = %d\n",cur_cut->rhs); */ for ( j = 0 /* , viol = - (double) cur_cut->rhs */ ; j < n; j++ ) if ( ( p_ilp->xstar[j] > ZERO || p_ilp->xstar[j] < -ZERO ) && cur_cut->non_weak_coef[j] != 0 ) { printf("var. %d xstar %f non_weak_coef %d coef %d\n", j, p_ilp->xstar[j], cur_cut->non_weak_coef[j], cur_cut->coef[j]); /* viol += p_ilp->xstar[j] * cur_cut->coef[j]; */ } printf("rhs %d viol %f slack_sum %f min_weak_loss %f one_norm %d\n", cur_cut->rhs, cur_cut->violation, cur_cut->slack_sum, cur_cut->min_weak_loss, cur_cut->one_norm); } #endif /* same_short_vect: check whether two short int vectors have the same content */ short int same_short_vect( int n_of_el, /* number of components in the vectors */ short int *vec_1, short int *vec_2 /* vectors to be checked */ ) { int i; for ( i = 0; i < n_of_el; i++ ) if ( vec_1[i] != vec_2[i] ) return(FALSE); return(TRUE); } /* initialize_hash_table: allocate the memory for the hash table */ void initialize_hash_table() { int i; hash_tab = reinterpret_cast (calloc(NUM_HASH_ENTRIES,sizeof(hash_element *))); if ( hash_tab == NULL ) alloc_error(const_cast("hash_tab")); for ( i = 0; i < NUM_HASH_ENTRIES; i++ ) hash_tab[i] = NULL; } /* clear_hash_table: clear the current hash table */ void clear_hash_table() { int i; hash_element *hash_ptr, *hash_el; for ( i = 0; i < NUM_HASH_ENTRIES; i++ ) { if ( hash_tab[i] != NULL ) { hash_ptr = hash_tab[i]; do { hash_el = hash_ptr->next; free(hash_ptr->flag_vect); free(hash_ptr); hash_ptr = hash_el; } while ( hash_ptr != NULL ); hash_tab[i] = NULL; } } } /* free_hash_table: deallocate the memory for the hash table */ void free_hash_table() { clear_hash_table(); free(hash_tab); } /* hash_addr: compute the hash address associated with the current cut */ int hash_addr( int n_of_el, /* number of elements to be considered */ short int *flag_vect /* vector of flags for the elements */ ) { int i, addr; /* very simple algorithm: just add-up the squared indices of the IN elements */ addr = 0; for ( i = 0; i < n_of_el; i++ ) if ( flag_vect[i] == IN ) addr += i * i; return(addr % NUM_HASH_ENTRIES); } /* hash_search: search for the current cut in the hash list of all cuts - if found return TRUE and update the last iteration the cut was found */ short int hash_search(int *cyc_len /* length of the cycle if the current cut is found */) { int addr; hash_element *hash_el; addr = hash_addr(m,cur_cut->in_constr_list); hash_el = hash_tab[addr]; while ( hash_el != NULL ) { if ( same_short_vect(m,cur_cut->in_constr_list,hash_el->flag_vect) ) { *cyc_len = it - hash_el->last_vis; hash_el->last_vis = it; return(TRUE); } hash_el = hash_el->next; } return(FALSE); } /* hash_insert: insert a new cut in the hash list of all cuts */ void hash_insert() { int addr, i; hash_element *hash_el, *hash_ptr; addr = hash_addr(m,cur_cut->in_constr_list); hash_el = reinterpret_cast (calloc(1,sizeof(hash_element))); if ( hash_el == NULL ) alloc_error(const_cast("hash_el")); hash_el->n_of_el = m; hash_el->last_vis = it; hash_el->next = NULL; hash_el->flag_vect = reinterpret_cast (calloc(m,sizeof(short int))); if ( hash_el->flag_vect == NULL ) alloc_error(const_cast("hash_el->flag_vect")); for ( i = 0; i < m; i++ ) hash_el->flag_vect[i] = cur_cut->in_constr_list[i]; if ( hash_tab[addr] == NULL ) hash_tab[addr] = hash_el; else { hash_ptr = hash_tab[addr]; while ( hash_ptr->next != NULL ) { #if 0 /* this check can be omitted to save time */ if ( same_short_vect(m,cur_cut->in_constr_list,hash_ptr->flag_vect) ) { printf("attempt to insert in the hash an already present cut\n"); exit(0); } #endif hash_ptr = hash_ptr->next; } hash_ptr->next = hash_el; } } /* increase_prohib_period: implemented as in Battiti and Protasi */ void increase_prohib_period() { if ( prohib_period * 1.1 > prohib_period + 1 ) if ( prohib_period * 1.1 < m - 2 ) prohib_period = static_cast (prohib_period*1.1); else prohib_period = m - 2; else if ( prohib_period + 1 < m - 2 ) prohib_period += 1; else prohib_period = m - 2; last_prohib_period_mod = it; } /* decrease_prohib_period: implemented as in Battiti and Protasi */ void decrease_prohib_period() { if ( prohib_period * 0.9 < prohib_period - 1 ) if ( prohib_period * 0.9 > IN_PROHIB_PERIOD ) prohib_period = static_cast (prohib_period* 0.9); else prohib_period = IN_PROHIB_PERIOD; else if ( prohib_period - 1 > IN_PROHIB_PERIOD ) prohib_period -= 1; else prohib_period = IN_PROHIB_PERIOD; last_prohib_period_mod = it; } /* allowed: check if moving (adding/deleting) a given constraint is not a tabu move */ short int allowed(int i /* constraint to be checked */) { if ( last_moved[i] < it - prohib_period ) { if ( cur_cut->in_constr_list[i] == IN ) { if ( cur_cut->n_of_constr > 1 ) return(TRUE); else return(FALSE); } else { if ( cur_cut->n_of_constr < m - 1 ) return(TRUE); else return(FALSE); } } else return(FALSE); } /* in_cur_cut: check whether a given constraint is in the list of constraints defining the current cut */ short int in_cur_cut(int i /* constraint to be checked */) { if ( cur_cut->in_constr_list[i] == OUT ) return(FALSE); else return(TRUE); } /* tabu_score: define the score of a potential new cut */ double tabu_score( int *ccoef, /* cut left hand side coefficients */ int crhs, /* cut right hand side */ double viol, /* cut violation */ double norm /* cut norm - 1-norm is used below */ ) { /* very simple score: violation divided/multiplied by the lhs 1-norm */ if ( norm == 0 ) norm = 1; if ( viol > 0.0 ) return (viol / norm); else return (viol * norm); } /* score_by_moving: compute the score of the best cut obtainable from the current local search solution by inserting/deleting a constraint */ double Cgl012Cut::score_by_moving( int i, /* constraint to be moved */ short int itype, /* type of move - ADD or DEL */ double thresh /* minimum value of an interesting score */ ) { #define PENALTY_NON_WEAKABLE -1.0 #define FAST_SCORE_EVAL 1 int j, begi, gcdi, ofsj, ij, crhs, one_norm, support_inter; short int flag_gt, ok; double slack_sum, weak_loss, score, viol; int *new_coef, *ccoef; begi = inp_ilp->mtbeg[i]; gcdi = p_ilp->gcd[i]; /* fast check - optimistic evaluation of the score */ slack_sum = cur_cut->slack_sum; if ( itype == ADD ) slack_sum += p_ilp->slack[i] / static_cast (gcdi); else slack_sum -= p_ilp->slack[i] / static_cast (gcdi); viol = ( 1.0 - slack_sum ) / 2.0; score = tabu_score(NULL,0,viol,1.0); /* printf("Score estimate 1 %f Threshold %f\n",score,thresh); */ if ( score < thresh + ZERO ) { return (score); } /* discard the cuts that have empty support intersection with the current one */ support_inter = 0; for ( ofsj = 0, ij = begi; ofsj < inp_ilp->mtcnt[i]; ofsj++, ij++ ) if ( cur_cut->non_weak_coef[inp_ilp->mtind[ij]] !=0 ) support_inter++; if ( support_inter == 0 ) return(-INF); /* compute the new cut coefficients and rhs (before weakening) */ new_coef = reinterpret_cast (calloc(inp_ilp->mtcnt[i],sizeof(int))); if ( new_coef == NULL ) alloc_error(const_cast("new_coef")); if ( ( itype == ADD && inp_ilp->msense[i] != 'G' ) || ( itype == DEL && inp_ilp->msense[i] == 'G' ) ) flag_gt = 1; else flag_gt = -1; if ( flag_gt == 1 ) { if ( gcdi == 1 ) { for ( ofsj = 0, ij = begi; ofsj < inp_ilp->mtcnt[i]; ofsj++, ij++ ) { j = inp_ilp->mtind[ij]; new_coef[ofsj] = cur_cut->non_weak_coef[j] + inp_ilp->mtval[ij]; } crhs = cur_cut->non_weak_rhs + inp_ilp->mrhs[i]; } else { for ( ofsj = 0, ij = begi; ofsj < inp_ilp->mtcnt[i]; ofsj++, ij++ ) { j = inp_ilp->mtind[ij]; new_coef[ofsj] = cur_cut->non_weak_coef[j] + inp_ilp->mtval[ij] / gcdi; } crhs = cur_cut->non_weak_rhs + inp_ilp->mrhs[i] / gcdi; } } else { if ( gcdi == 1 ) { for ( ofsj = 0, ij= begi; ofsj < inp_ilp->mtcnt[i]; ofsj++, ij++ ) { j = inp_ilp->mtind[ij]; new_coef[ofsj] = cur_cut->non_weak_coef[j] - inp_ilp->mtval[ij]; } crhs = cur_cut->non_weak_rhs - inp_ilp->mrhs[i]; } else { for ( ofsj = 0, ij = begi; ofsj < inp_ilp->mtcnt[i]; ofsj++, ij++ ) { j = inp_ilp->mtind[ij]; new_coef[ofsj] = cur_cut->non_weak_coef[j] - inp_ilp->mtval[ij] / gcdi; } crhs = cur_cut->non_weak_rhs - inp_ilp->mrhs[i] / gcdi; } } /* other - relatively fast - check by optimistic evaluation of the cut score */ weak_loss = cur_cut->min_weak_loss; one_norm = cur_cut->one_norm; for ( ofsj = 0, ij = begi; ofsj < inp_ilp->mtcnt[i]; ofsj++, ij++ ) { j = inp_ilp->mtind[ij]; if ( cur_cut->coef[j] > 0 ) one_norm -= cur_cut->coef[j]; else one_norm += cur_cut->coef[j]; if ( new_coef[ofsj] >= 2 ) one_norm += new_coef[ofsj] / 2; else one_norm -= new_coef[ofsj] / 2; if ( mod2(cur_cut->non_weak_coef[j]) == ODD ) { if ( mod2(new_coef[ofsj]) == EVEN ) weak_loss -= p_ilp->min_loss_by_weak[j]; } else { if ( mod2(new_coef[ofsj]) == ODD ) weak_loss += p_ilp->min_loss_by_weak[j]; } } viol = ( 1.0 - slack_sum - weak_loss ) / 2.0; score = tabu_score(NULL,0,viol,static_cast (one_norm)); /* printf("Score estimate 2 %f Threshold %f\n",score,thresh); */ if ( score < thresh + ZERO || FAST_SCORE_EVAL ) { free(new_coef); return (score); } /* get the actual cut coefficients and the violation of the best cut obtainable trough weakening */ ccoef = reinterpret_cast (calloc(n,sizeof(int))); if ( ccoef == NULL ) alloc_error(const_cast("ccoef")); for ( j = 0; j < n; j++ ) ccoef[j] = cur_cut->non_weak_coef[j]; for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) { ij = begi + ofsj; j = inp_ilp->mtind[ij]; ccoef[j] = new_coef[ofsj]; } ok = best_cut(ccoef,&crhs,&viol,FALSE,FALSE); if ( ok ) score = tabu_score(ccoef,crhs,viol,static_cast (one_norm)); else { viol = ( - slack_sum - weak_loss ) / 2.0; score = PENALTY_NON_WEAKABLE + tabu_score(ccoef,crhs,viol,static_cast (one_norm)); } /* printf("Score actual %f Threshold %f\n",score,thresh); */ free(new_coef); free(ccoef); return(score); } /* modify_current: update the current local search solution by inserting/ deleting a constraint */ void Cgl012Cut::modify_current( int i, /* constraint to be moved */ short int itype /* type of move - ADD or DEL */ ) { int j, begi, gcdi, ofsj, ij; short int flag_gt; if ( itype == ADD ) { cur_cut->n_of_constr++; cur_cut->in_constr_list[i] = IN; } else { cur_cut->n_of_constr--; cur_cut->in_constr_list[i] = OUT; } last_moved[i] = it; /* compute the new cut coefficients and rhs (before weakening) */ if ( ( itype == ADD && inp_ilp->msense[i] != 'G' ) || ( itype == DEL && inp_ilp->msense[i] == 'G' ) ) flag_gt = 1; else flag_gt = -1; begi = inp_ilp->mtbeg[i]; gcdi = p_ilp->gcd[i]; for ( ofsj = 0; ofsj < inp_ilp->mtcnt[i]; ofsj++ ) { ij = begi + ofsj; j = inp_ilp->mtind[ij]; /* the '*' and '/' operations can be saved by writing some more code ... */ cur_cut->non_weak_coef[j] += flag_gt * (inp_ilp->mtval[ij] / gcdi); } cur_cut->non_weak_rhs += flag_gt * (inp_ilp->mrhs[i] / gcdi); if ( itype == ADD ) cur_cut->slack_sum += p_ilp->slack[i] / static_cast (gcdi); else cur_cut->slack_sum -= p_ilp->slack[i] / static_cast (gcdi); /* get the best possible cut */ cur_cut->min_weak_loss = 0.0; for ( j = 0; j < n; j++ ) { cur_cut->coef[j] = cur_cut->non_weak_coef[j]; if ( mod2(cur_cut->coef[j]) == ODD ) cur_cut->min_weak_loss += p_ilp->min_loss_by_weak[j]; } cur_cut->rhs = cur_cut->non_weak_rhs; cur_cut->ok = best_cut(cur_cut->coef,&cur_cut->rhs,&cur_cut->violation,TRUE,FALSE); cur_cut->one_norm = 0; for ( j = 0; j < n; j++ ) { if ( cur_cut->coef[j] > 0 ) cur_cut->one_norm += cur_cut->coef[j]; else cur_cut->one_norm -= cur_cut->coef[j]; } } /* get_current_cut: return a cut data type with the information about the current cut of the search procedure */ cut *Cgl012Cut::get_current_cut() { int i, j, nz; /*double viol;*/ cut *cut_ptr; cut_ptr = reinterpret_cast (calloc(1,sizeof(cut))); if ( cut_ptr == NULL ) alloc_error(const_cast("cut_ptr")); cut_ptr->crhs = cur_cut->rhs; cut_ptr->csense = 'L'; /* count the number of nonzeroes in the cut */ for ( j = 0, nz = 0; j < n; j++ ) if ( cur_cut->coef[j] != 0 ) nz++; cut_ptr->cnzcnt = nz; cut_ptr->cind = reinterpret_cast (calloc(nz,sizeof(int))); if ( cut_ptr->cind == NULL ) alloc_error(const_cast("cut_ptr->cind")); cut_ptr->cval = reinterpret_cast (calloc(nz,sizeof(int))); if ( cut_ptr->cval == NULL ) alloc_error(const_cast("cut_ptr->cval")); nz = 0; /*viol = 0.0;*/ for ( j = 0; j < n; j++ ) { if ( cur_cut->coef[j] != 0 ) { cut_ptr->cind[nz] = j; cut_ptr->cval[nz] = cur_cut->coef[j]; nz++; /* viol += p_ilp->xstar[j] * (double) cur_cut->coef[j]; */ } } /* viol -= (double) cur_cut->rhs; */ /* cut_ptr->violation = viol; */ cut_ptr->violation = cur_cut->violation; cut_ptr->n_of_constr = 0; cut_ptr->constr_list = reinterpret_cast (calloc(inp_ilp->mr,sizeof(int))); if ( cut_ptr->constr_list == NULL ) alloc_error(const_cast("cut_ptr->constr_list")); cut_ptr->in_constr_list = reinterpret_cast (calloc(inp_ilp->mr,sizeof(short int))); if ( cut_ptr->in_constr_list == NULL ) alloc_error(const_cast("cut_ptr->in_constr_list")); for ( i = 0; i < m; i++ ) { if ( cur_cut->in_constr_list[i] == IN ) { cut_ptr->in_constr_list[i] = IN; cut_ptr->constr_list[cut_ptr->n_of_constr] = i; (cut_ptr->n_of_constr)++; } else cut_ptr->in_constr_list[i] = OUT; } return(cut_ptr); } /* best neighbour: find the cut to be added/deleted from the current solution among those allowed by the tabu rules */ short int Cgl012Cut::best_neighbour(cut_list *out_cuts /* list of the violated cuts found */) { int i, ibest; short int itype, itypebest=-1; double score, max_score; cut *new_cut; /* cycle through all the constraints in your problem ... */ max_score = -INF; ibest = NONE; for ( i = 0; i < m; i++ ) { if ( ! p_ilp->row_to_delete[i] && allowed(i) ) { if ( in_cur_cut(i) ) { /* constraint i is in the current set of constraints (those defining the current cut) */ itype = DEL; } else { /* constraint i is not in the current set of constraints (those defining the current cut) */ itype = ADD; } score = score_by_moving(i,itype,max_score); if ( score > max_score ) { /* best cut found in this iteration: store it */ ibest = i; itypebest = itype; max_score = score; } } } /* for ( i = 0; i < m; i++ ) */ if ( ibest == NONE ) { #ifdef PRINT_TABU printf("No move could be performed by best_neighbour\n"); #endif return(TRUE); } modify_current(ibest,itypebest); if ( cur_cut->violation > MIN_VIOLATION + EPS ) { #ifdef PRINT_TABU printf("... adding the current cut to the output list - it = %d viol = %f\n",it, cur_cut->violation); #endif new_cut = get_current_cut(); out_cuts = add_cut_to_list(new_cut,out_cuts); last_it_add = it; } return(FALSE); } /* memory_reaction: perform the long term reaction by cheching whether the current solution has already been visited or the best solution has not been updated for too many iterations */ void memory_reaction() { int cycle_length; if ( hash_search(&cycle_length) ) { if ( cycle_length < 2 * ( m - 1 ) ) { increase_prohib_period(); return; } } else hash_insert(); if ( it - last_prohib_period_mod > B ) decrease_prohib_period(); } /* add_tight_constraint: initialize the current cut by adding a tight constraint to it */ void Cgl012Cut::add_tight_constraint() { int i, ntight; double smin=COIN_DBL_MAX; abort(); int *tight; ntight = 0; tight = reinterpret_cast (calloc(m,sizeof(int))); if ( tight == NULL ) alloc_error(const_cast("tight")); for ( i = 0; i < m; i++ ) { /* search for the tightest constraint never added to cut */ if ( last_moved[i] < 0 && p_ilp->slack[i] < smin ) { if ( p_ilp->slack[i] < ZERO ) { /* tight constraint */ smin = ZERO; tight[ntight] = i; ntight++; } else { /* best constraint so far */ smin = p_ilp->slack[i]; tight[0] = i; ntight = 1; } } } if ( ntight > 0 ) i = tight[rand() % ntight]; /* if all constraints have already been in cur_cut choose first at random */ else i = rand() % m; free(tight); modify_current(i,ADD); } /* initialize: initialize the data structures for local search */ void Cgl012Cut::initialize() { int i; m = inp_ilp->mr; n = inp_ilp->mc; it = 0; last_it_add = 0; last_it_restart = 0; last_prohib_period_mod = 0; prohib_period = IN_PROHIB_PERIOD; initialize_cur_cut(); last_moved = reinterpret_cast (calloc(m,sizeof(int))); if ( last_moved == NULL ) alloc_error(const_cast("last_moved")); for ( i = 0; i < m; i++ ) { last_moved[i] = -COIN_INT_MAX; } initialize_hash_table(); add_tight_constraint(); A = m; B = 10 * m; } /* restart: perform a restart of the search - IMPORTANT: in the current implementation vector last_moved is not cleared at restart */ void Cgl012Cut::restart(short int failure /* flag forcing the restart if some trouble occurred */) { if ( failure || ( it - last_it_add > A && it - last_it_restart > A ) ) { /* perform restart */ last_it_restart = it; prohib_period = IN_PROHIB_PERIOD; last_prohib_period_mod = it; clear_hash_table(); clear_cur_cut(); add_tight_constraint(); } } /* free_memory: free the memory used by local search */ void free_memory() { free_cur_cut(); free(last_moved); free_hash_table(); } /* tabu_012: try to identify violated 0-1/2 cuts by a simple tabu search procedure adapted from that used by Battiti and Protasi for finding large cliques */ cut_list *Cgl012Cut::tabu_012() { short int failure; cut_list *out_cuts; out_cuts = initialize_cut_list(MAX_CUTS); initialize(); it = 0; do { memory_reaction(); failure = best_neighbour(out_cuts); #ifdef PRINT_TABU print_cur_cut(); #endif it++; restart(failure); } while ( out_cuts->cnum < MAX_CUTS && it < MAX_TABU_ITER ); free_memory(); #ifdef PRINT_TABU printf("Number of violated cuts found by Tabu Search %d\n",out_cuts->cnum); printf("Tabu Search timings: best_neighbour %f score_by_moving %f coefficient %f best_cut %f\n", time_best_neigh, time_scor_by_mov, time_coef, time_best_cut); #endif return(out_cuts); } //end include "Cgltabu_012.c" #ifdef POOL /* same_pool_cut: check whether two pool cuts are in fact the same cut */ short int same_pool_cut(pool_cut *p_cut1, pool_cut *p_cut2) { int c; if ( p_cut1->n_of_constr != p_cut2->n_of_constr ) return(FALSE); if ( p_cut1->code != p_cut2->code ) return(FALSE); /* assumes constr_list is sorted for increasing/decreasing constraint index */ for ( c = 1; c < p_cut1->n_of_constr; c++ ) if ( p_cut1->constr_list[c] != p_cut2->constr_list[c] ) return(FALSE); return(TRUE); } /* free_pool_cut: free the memory for a non-empty pool cut */ void free_pool_cut(pool_cut *p_cut) { if ( p_cut == NULL ) return; if ( p_cut->constr_list != NULL ) free(p_cut->constr_list); free(p_cut); } /* initialize_pool: initialize the pool data structure */ void initialize_pool() { pool = (pool_cut_list *) calloc(1,sizeof(pool_cut_list)); if ( pool == NULL ) alloc_error(const_cast("pool")); pool->cnum = 0; pool->list = (pool_cut **) calloc(MAX_CUT_POOL,sizeof(pool_cut *)); if ( pool->list == NULL ) alloc_error(const_cast("pool->list")); pool->ncod = (int *) calloc(MAX_CUT_COD,sizeof(int)); if ( pool->ncod == NULL ) alloc_error(const_cast("pool->ncod")); } /* free_pool: free the memory used by the pool */ void free_pool() { int c; if ( pool == NULL ) return; for ( c = 0; c < pool->cnum; c++ ) free_pool_cut(pool->list[c]); free(pool); } /* clean_pool: remove form the pool the cuts which are inactive since a large number of iterations */ void clean_pool() { int c, d; /* the pool compression could be implemented more efficiently */ for ( c = 0; c < pool->cnum; c++ ) { if ( pool->list[c]->it_found > MAX_ITER_POOL ) { free_pool_cut(pool->list[c]); pool->list[c] = NULL; for ( d = c ; d < pool->cnum; d++ ) pool->list[d] = pool->list[d + 1]; (pool->cnum)--; } } } /* insert_cut_in_pool: add a cut to the pool if there is space */ void insert_cut_in_pool(pool_cut *p_cut) { if ( pool->cnum == MAX_CUT_POOL ) { #ifdef COIN_DEVELOP printf("Warning: pool is full and separated cuts cannot be added\n"); #endif return; } pool->list[pool->cnum] = p_cut; (pool->cnum)++; (pool->ncod[p_cut->code])++; } /* cut_is_in_pool: check whether a given cut is already in the pool */ short int cut_is_in_pool(cut *v_cut) { int c, i, cod; short int equal; short int *flag_v; pool_cut *p_cut; /* print_cut(v_cut); printf("checking for a cut in the pool ...\n"); */ cod = hash_addr(inp_ilp->mr,v_cut->in_constr_list); if ( pool->ncod[cod] == 0 ) return(FALSE); /* trivial sequential search */ /* printf("... sequential search needed ...\n"); */ flag_v = (short int *) calloc(inp_ilp->mr,sizeof(short int)); if ( flag_v == NULL ) alloc_error(const_cast("flag_v")); for ( c = 0; c < pool->cnum; c++ ) { if ( pool->list[c]->code != cod ) continue; p_cut = pool->list[c]; equal = TRUE; for ( i = 0; i < inp_ilp->mr; i++ ) flag_v[i] = OUT; for ( i = 0; i < p_cut->n_of_constr; i++ ) flag_v[p_cut->constr_list[i]] = IN; for ( i = 0; i < inp_ilp->mr; i++ ) { if ( v_cut->in_constr_list[i] != flag_v[i] ) { equal = FALSE; break; } } if ( equal ) { free(flag_v); /* printf("... cut was in the pool!\n"); */ return(TRUE); } } return(FALSE); } /* good_pool_cut: check whether the current cut is worth adding to the pool */ short int good_pool_cut(cut *v_cut) { /* no check performed */ return(TRUE); } /* add_cuts_to_pool: add the cuts separated to the pool structure */ void add_cuts_to_pool(cut_list *out_cuts) { int i, c; cut *v_cut; pool_cut *p_cut; /* float ti, tf, tti, ttf; */ /* static float tcutis = 0.0, taddcut = 0.0; */ /* second_(&tti); */ if ( pool == NULL ) initialize_pool(); if ( pool->cnum >= MAX_CUT_POOL * CLEAN_THRESH ) clean_pool(); for ( i = 0; i < out_cuts->cnum; i++ ) { v_cut = out_cuts->list[i]; /* second_(&ti); */ if ( cut_is_in_pool(v_cut) ) { /* second_(&tf); */ /* tcutis += tf - ti; */ continue; } else { /* second_(&tf); */ /* tcutis += tf - ti; */ } if ( good_pool_cut(v_cut) ) { /* add the cut to the pool list */ p_cut = (pool_cut *) calloc(1,sizeof(pool_cut)); if ( p_cut == NULL ) alloc_error(const_cast("p_cut")); p_cut->n_of_constr = v_cut->n_of_constr; p_cut->constr_list = (int *) calloc(v_cut->n_of_constr,sizeof(int)); if ( p_cut->constr_list == NULL ) alloc_error(const_cast("p_cut->constr_list")); for ( c = 0; c < v_cut->n_of_constr; c++ ) p_cut->constr_list[c] = v_cut->constr_list[c]; p_cut->code = hash_addr(inp_ilp->mr,v_cut->in_constr_list); p_cut->n_it_violated = 0; p_cut->it_found = sep_iter; insert_cut_in_pool(p_cut); } } /* second_(&ttf); */ /* taddcut += ttf - tti; */ /* printf("add_cuts_to_pool: tcutis %f taddcut %f\n",tcutis,taddcut); */ } /* interesting_var: decides whether a variable is relevant in the separation or not */ short int interesting_var(int j /* variable to be evaluated */) { /* return ( vlog[j]->n_it_zero < MANY_IT_ZERO ); */ /* if ( aggr ) return (TRUE); */ return( ! p_ilp->col_to_delete[j] ); } /* get_cuts_from_pool: select from the pool a convenient set of violated constraints to be added to the current LP */ static double max_score_ever = ZERO; /* maximum score of a violated cut during the whole cutting plane procedure */ #define MIN_CUT_SCORE ( max_score_ever / MIN_SCORE_RANGE ) #define MAX_CUT_SCORE ( max_score_ever / MAX_SCORE_RANGE ) #define MIN_IT_VIOL 2 cut_list *get_cuts_from_pool( short int after_sep /* flag telling whether the pool is searched after a new separation in which case only new cuts are checked */ ) { int c, crhs, j, k, l, maxc, n_interest_var; double viol, score, maxscore, min_cut_score, max_cut_score; short int ok; int *interest_var, *ccoef; short int *added; pool_cut *p_cut; select_cut **best_var_cut; cut *a_cut; cut_list *add_cuts; /* float ti, tf, tti, ttf; */ /* static float tgetcut = 0.0, talloc = 0.0, tgetcoef = 0.0, tbestcut = 0.0, tscore = 0.0, tupdbest = 0.0, tadd = 0.0; */ /* second_(&tti); */ if ( pool == NULL ) { add_cuts = initialize_cut_list(1); return(add_cuts); } /* in the current implementation, the cut with best score with nonzero coefficient for each "interesting" variable is added to the current LP, provided the cut satisfies some requirements (violation, depth, etc.) */ /* define the set of the interesting variables */ interest_var = (int *) calloc(p_ilp->mc,sizeof(int)); if ( interest_var == NULL ) alloc_error(const_cast("interest_var")); n_interest_var = 0; for ( j = 0; j < p_ilp->mc; j++ ) { if ( interesting_var(j) ) { interest_var[n_interest_var] = j; n_interest_var++; } } best_var_cut = (select_cut **) calloc(n_interest_var,sizeof(select_cut *)); if ( best_var_cut == NULL ) alloc_error(const_cast("best_var_cut")); for ( k = 0; k < n_interest_var; k++ ) { best_var_cut[k] = (select_cut *) calloc(1,sizeof(select_cut)); if ( best_var_cut[k] == NULL ) alloc_error(const_cast("best_var_cut[k]")); best_var_cut[k]->ccoef = (int *) calloc(p_ilp->mc,sizeof(int)); if ( best_var_cut[k]->ccoef == NULL ) alloc_error(const_cast("best_var_cut[k]->ccoef")); best_var_cut[k]->score = -INF; } /* find the cuts with the best scores and the list of the cuts violated by the current fractional point */ maxscore = -INF; ccoef = (int *) calloc(p_ilp->mc,sizeof(int)); if ( ccoef == NULL ) alloc_error(const_cast("ccoef")); /* second_(&tf); */ /* talloc += tf - tti; */ min_cut_score = MIN_CUT_SCORE; max_cut_score = MAX_CUT_SCORE; for ( c = 0; c < pool->cnum; c++ ) { p_cut = pool->list[c]; /* if a new separation was made before the call check only new cuts */ if ( after_sep && p_cut->it_found != sep_iter ) continue; /* determine the actual coefficients of the cut */ /* second_(&ti); */ ok = get_ori_cut_coef(p_cut->n_of_constr,p_cut->constr_list, ccoef,&crhs,TRUE); /* second_(&tf); */ /* tgetcoef += tf - ti; */ /* second_(&ti); */ ok = ok && best_cut(ccoef,&crhs,&viol,TRUE,TRUE); /* second_(&tf); */ /* tbestcut += tf - ti; */ if ( ok && viol > MIN_VIOLATION ) { (p_cut->n_it_violated)++; /* second_(&ti); */ score = cut_score(ccoef,crhs,viol,TRUE); if ( score > maxscore ) { maxscore = score; maxc = c; } /* second_(&tf); */ /* tscore += tf - ti; */ if ( ! aggr ) { if ( score < min_cut_score ) continue; if ( score < max_cut_score && p_cut->n_it_violated < MIN_IT_VIOL ) continue; } /* second_(&ti); */ for ( k = 0; k < n_interest_var; k++ ) { j = interest_var[k]; if ( ccoef[j] != 0 && best_var_cut[k]->score < score ) { best_var_cut[k]->score = score; for ( l = 0; l < p_ilp->mc; l++ ) best_var_cut[k]->ccoef[l] = ccoef[l]; best_var_cut[k]->crhs = crhs; best_var_cut[k]->pool_index = c; } } /* second_(&tf); */ /* tupdbest += tf - ti; */ } else p_cut->n_it_violated = 0; } free(ccoef); /* printf("maxscore of a cut : %f ever: %f\n",maxscore,max_score_ever); */ if ( maxscore > max_score_ever ) max_score_ever = maxscore; /* second_(&ti); */ add_cuts = initialize_cut_list(n_interest_var); added = (short int *) calloc(pool->cnum,sizeof(short int)); if ( added == NULL ) alloc_error(const_cast("added")); for ( c = 0; c < pool->cnum; c++ ) added[c] = FALSE; for ( k = 0; k < n_interest_var; k++ ) { j = interest_var[k]; if ( ! added[best_var_cut[k]->pool_index] && best_var_cut[k]->score >= MIN_CUT_SCORE ) { /* add the cut to the cut list on output */ a_cut = define_cut(best_var_cut[k]->ccoef,best_var_cut[k]->crhs); add_cuts = add_cut_to_list(a_cut,add_cuts); added[best_var_cut[k]->pool_index] = TRUE; } free(best_var_cut[k]->ccoef); free(best_var_cut[k]); } free(best_var_cut); free(interest_var); free(added); /* second_(&tf); */ /* tadd += tf - ti; */ /* second_(&ttf); */ /* tgetcut += ttf - tti; */ /* printf("get_cuts_from_pool: talloc %f tgetcoef %f tbestcut %f tscore %f tupdbest %f tadd %f tgetcut %f\n",talloc,tgetcoef,tbestcut,tscore,tupdbest,tadd,tgetcut); */ return(add_cuts); } #endif /* initialize_log_var: initialize the log information for the problem variables */ void Cgl012Cut::initialize_log_var() { int j; if (!vlog) { if (p_ilp->mc) { vlog = reinterpret_cast (calloc(p_ilp->mc,sizeof(log_var *))); if ( vlog == NULL ) alloc_error(const_cast("vlog")); for ( j = 0; j < p_ilp->mc; j++ ) { vlog[j] = reinterpret_cast (calloc(1,sizeof(log_var))); if ( vlog[j] == NULL ) alloc_error(const_cast("vlog[j]")); vlog[j]->n_it_zero = 0; } } } else { // just initialize counts for ( j = 0; j < p_ilp->mc; j++ ) { vlog[j]->n_it_zero = 0; } } } /* free_log_var */ void Cgl012Cut::free_log_var() { if (vlog) { int j; for ( j = 0; j < p_ilp->mc; j++ ) free(vlog[j]); free(vlog); vlog=NULL; } } /* update_log_var: update the log information for the problem variables */ void Cgl012Cut::update_log_var() { int j; /* so far one counts only the number of consecutive iterations with 0 value for each variable */ if ( vlog == NULL ) initialize_log_var(); for ( j = 0; j < p_ilp->mc; j++ ) { if ( p_ilp->xstar[j] < ZERO && p_ilp->xstar[j] > - ZERO ) vlog[j]->n_it_zero++; else vlog[j]->n_it_zero = 0; } } /* the final implementation should use the following additional functions: init_sep_012_cut: defines the inp_ilp and p_ilp data structures and initializes pool and vlog sep_012_cut: updates inp_ilp and p_ilp, performs separation and pool management kill_sep_012_cut: frees all the permanent memory (inp_ilp, p_ilp, pool, vlog, etc.) */ int Cgl012Cut::sep_012_cut( /* INPUT parameters: */ int mr, /* number of rows in the ILP matrix */ int mc, /* number of columns in the ILP matrix */ int mnz, /* number of nonzero's in the ILP matrix */ int *mtbeg, /* starting position of each row in arrays mtind and mtval */ int *mtcnt, /* number of entries of each row in arrays mtind and mtval */ int *mtind, /* column indices of the nonzero entries of the ILP matrix */ int *mtval, /* values of the nonzero entries of the ILP matrix */ int *vlb, /* lower bounds on the variables */ int *vub, /* upper bounds on the variables */ int *mrhs, /* right hand sides of the constraints */ char *msense, /* senses of the constraints: 'L', 'G' or 'E' */ const double *xstar, /* current optimal solution of the LP relaxation */ bool aggressive, /* flag asking whether as many cuts as possible are required on output (TRUE) or not (FALSE) */ /* OUTPUT parameters (the memory for the vectors is allocated INTERNALLY by the procedure: if some memory is already allocated, it is FREED): */ int *cnum, /* number of violated 0-1/2 cuts identified by the procedure */ int *cnzcnt, /* overall number of nonzero's in the cuts */ int **cbeg, /* starting position of each cut in arrays cind and cval */ int **ccnt, /* number of entries of each cut in arrays cind and cval */ int **cind, /* column indices of the nonzero entries of the cuts */ int **cval, /* values of the nonzero entries of the cuts */ int **crhs, /* right hand sides of the cuts */ char **csense /* senses of the cuts: 'L', 'G' or 'E' */ /* NOTE that all the numerical input/output vectors are INTEGER (with the exception of xstar), since the procedure is intended to work with pure ILP's, and that the ILP matrix has to be given on input in ROW format. */ ) { #ifdef TIME float tbasi, tbasf; #endif errorNo=0; cut_list *out_cuts, *add_cuts; #ifdef TIME second_(&tti); #endif aggr = aggressive; /* load the input ILP into an internal data structure */ //ilp_load(mr,mc,mnz,mtbeg,mtcnt,mtind,mtval, // vlb,vub,mrhs,msense); inp_ilp->xstar = xstar; /* construct an internal data structure containing all the information which can be useful for 0-1/2 cut separation - this may in fact be done only at the first call of the separation procedure */ #ifdef TIME second_(&ti); #endif get_parity_ilp(); /* print_double_vect("xstar",p_ilp->xstar,p_ilp->mc); print_parity_ilp(); */ #ifdef TIME second_(&tf); prep_time += tf - ti; #endif if ( p_ilp->mnz == 0 ) { #ifdef COIN_DEVELOP printf("Warning: no significant constraint for 0-1/2 cut separation\n"); printf("... end separation\n"); #endif //free_ilp(); //free_parity_ilp(); #ifdef TIME second_(&ttf); total_time += ttf - tti; #endif return(FALSE); } /* print_double_vect("xstar",p_ilp->xstar,p_ilp->mc); */ sep_iter++; update_log_var(); #ifdef POOL /* search for possible violated cuts in the pool */ #ifdef TIME second_(&tpi); #endif add_cuts = get_cuts_from_pool(FALSE); #ifdef TIME second_(&tpf); pool_time += tpf - tpi; #ifdef PRINT_TIME printf("... time elapsed at the end of get_cuts_from_pool: %f\n",tpf - tti); #endif #endif if ( add_cuts->cnum == 0 ) { free_cut_list(add_cuts); } else { /* printf("Violated cuts found in the pool - no separation procedure used\n"); */ goto free_memory; } #endif /* try to identify violated 0-1/2 cuts by using the original procedure described in Caprara and Fischetti's MP paper */ #ifdef TIME second_(&tbasi); #endif out_cuts = basic_separation(); #ifdef TIME second_(&tbasf); tot_basic_sep_time += tbasf - tbasi; avg_basic_sep_time = tot_basic_sep_time / (float) sep_iter; #endif //#define TABU_SEARCH #ifdef TABU_SEARCH /* try to identify violated cuts by tabu search if none was found */ if ( out_cuts->cnum == 0 ) { free_cut_list(out_cuts); #ifdef TIME second_(&ttabi); #endif out_cuts = tabu_012(); #ifdef TIME second_(&ttabf); tabu_time += ttabf - ttabi; #endif } #endif #ifdef POOL /* add the cuts separated to the pool */ #ifdef TIME second_(&tpi); #endif add_cuts_to_pool(out_cuts); free_cut_list(out_cuts); /* select from the pool a convenient set of violated constraints to be added to the current LP */ add_cuts = get_cuts_from_pool(TRUE); #ifdef TIME second_(&tpf); pool_time += tpf - tpi; #ifdef PRINT_TIME printf("... time elapsed at the end of get_cuts_from_pool: %f\n",tpf - tti); #endif #endif #else /* give on output the cuts separated */ add_cuts = out_cuts; #endif //free_ilp(); //free_parity_ilp(); #ifdef TIME second_(&ttf); total_time += ttf - tti; #endif if ( add_cuts->cnum > 0 ) { getcuts(add_cuts,cnum,cnzcnt,cbeg,ccnt,cind,cval,crhs,csense); /* print_cut_list(add_cuts); */ free_cut_list(add_cuts); return(TRUE); } else { free_cut_list(add_cuts); return(FALSE); } } #ifdef TIME /* print_times: print the timings of the separation procedure */ void print_times() { printf("... separation timings \n"); printf("times total: %f prep: %f weak: %f aux: %f path: %f cycle: %f cut: %f (%d calls) bw: %f coef: %f pool: %f tabu: %f\n", total_time, prep_time, weak_time, aux_time, path_time, cycle_time, cut_time, cut_ncalls, bw_time, coef_time, pool_time, tabu_time); } #endif //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- Cgl012Cut::Cgl012Cut () : inp_ilp(NULL), p_ilp(NULL), iter(0), gap(0.0), maxgap(0.0), errorNo(0), sep_iter(0), vlog(NULL), aggr(true) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- Cgl012Cut::Cgl012Cut (const Cgl012Cut & rhs) : inp_ilp(NULL), p_ilp(NULL), iter(rhs.iter), gap(rhs.gap), maxgap(rhs.maxgap), errorNo(rhs.errorNo), sep_iter(rhs.sep_iter), vlog(NULL), aggr(rhs.aggr) { if (rhs.p_ilp||rhs.vlog||inp_ilp) abort(); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- Cgl012Cut::~Cgl012Cut () { free_log_var(); free_parity_ilp(); free_ilp(); } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- Cgl012Cut & Cgl012Cut::operator=( const Cgl012Cut& rhs) { if (this != &rhs) { if (rhs.p_ilp||rhs.vlog||inp_ilp) abort(); free_log_var(); free_parity_ilp(); free_ilp(); #if 0 inp_ilp = reinterpret_cast (calloc(1,sizeof(ilp))); if ( inp_ilp == NULL ) alloc_error(const_cast("inp_ilp")); inp_ilp->mr = rhs.inp_ilp->mr; inp_ilp->mc = rhs.inp_ilp->mc; inp_ilp->mnz = rhs.inp_ilp->mnz; inp_ilp->mtbeg = rhs.inp_ilp->mtbeg; inp_ilp->mtcnt = rhs.inp_ilp->mtcnt; inp_ilp->mtind = rhs.inp_ilp->mtind; inp_ilp->mtval = rhs.inp_ilp->mtval; inp_ilp->vlb = rhs.inp_ilp->vlb; inp_ilp->vub = rhs.inp_ilp->vub; inp_ilp->mrhs = rhs.inp_ilp->mrhs; inp_ilp->msense = rhs.inp_ilp->msense; #endif iter = rhs.iter; gap = rhs.gap; maxgap = rhs.maxgap; errorNo = rhs.errorNo; sep_iter = rhs.sep_iter; aggr = rhs.aggr; } return *this; } Cgl-0.58.9/src/CglZeroHalf/CglZeroHalf.cpp0000644000076600007660000003421212130104734016570 0ustar coincoin// $Id: CglZeroHalf.cpp 1123 2013-04-06 20:47:24Z stefan $ // Copyright (C) 2010, 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 "CoinPragma.hpp" #include "CglZeroHalf.hpp" #include "CoinPackedVector.hpp" #include "CoinSort.hpp" #include "CoinPackedMatrix.hpp" //------------------------------------------------------------- void CglZeroHalf::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info) { if (mnz_) { int cnum=0,cnzcnt=0; int *cbeg=NULL, *ccnt=NULL,*cind=NULL,*cval=NULL,*crhs=NULL; char *csense=NULL; const double * solution = si.getColSolution(); if ((flags_&1)==0) { // redo bounds const double * columnLower = si.getColLower(); const double * columnUpper = si.getColUpper(); int numberColumns = si.getNumCols(); for (int iColumn=0;iColumn (ceil(lo)); double up = columnUpper[iColumn]; if (up>COIN_INT_MAX) up=COIN_INT_MAX; iup= static_cast (floor(up)); vlb_[iColumn]=ilo; vub_[iColumn]=iup; } } } if (true) { cutInfo_.sep_012_cut(mr_,mc_,mnz_, mtbeg_,mtcnt_, mtind_, mtval_, vlb_, vub_, mrhs_, msense_, solution, info.inTree ? false : true, &cnum,&cnzcnt, &cbeg,&ccnt,&cind,&cval,&crhs,&csense); } else { int k = 4*mr_+2*mnz_; int * temp = new int[k]; int * mtbeg = temp; int * mtcnt = mtbeg + mr_; int * mtind = mtcnt+mr_; int * mtval = mtind+mnz_; int * mrhs = mtval+mnz_; char * msense = reinterpret_cast (mrhs+mr_); int i; k=0; int kel=0; for (i=0;ikel2) { mtcnt[k]=kel-kel2; mtbeg[k]=kel2; mrhs[k]=rhs; msense[k++]=msense_[i]; } } if (kel) { cutInfo_.sep_012_cut(k,mc_,kel, mtbeg,mtcnt, mtind, mtval, vlb_, vub_, mrhs, msense, solution, info.inTree ? false : true, &cnum,&cnzcnt, &cbeg,&ccnt,&cind,&cval,&crhs,&csense); } delete [] temp; } if (cnum) { // add cuts double * element = new double[mc_]; for (int i=0;i1.0e-6) cs.insert(rc); //else //printf("violation of %g\n",violation); } delete [] element; free(cbeg); free(ccnt); free(cind); free(cval); free(crhs); free(csense); } } } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglZeroHalf::CglZeroHalf () : CglCutGenerator(), mr_(0), mc_(0), mnz_(0), mtbeg_(NULL), mtcnt_(NULL), mtind_(NULL), mtval_(NULL), vlb_(NULL), vub_(NULL), mrhs_(NULL), msense_(NULL), flags_(0) { // nothing to do here } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglZeroHalf::CglZeroHalf ( const CglZeroHalf & source) : CglCutGenerator(source), mtbeg_(NULL), mtcnt_(NULL), mtind_(NULL), mtval_(NULL), vlb_(NULL), vub_(NULL), mrhs_(NULL), msense_(NULL), flags_(source.flags_) { mr_ = source.mr_; mc_ = source.mc_; mnz_ = source.mnz_; if (mr_) { mtbeg_ = CoinCopyOfArray(source.mtbeg_,mr_); mtcnt_ = CoinCopyOfArray(source.mtcnt_,mr_); mtind_ = CoinCopyOfArray(source.mtind_,mnz_); mtval_ = CoinCopyOfArray(source.mtval_,mnz_); vlb_ = CoinCopyOfArray(source.vlb_,mc_); vub_ = CoinCopyOfArray(source.vub_,mc_); mrhs_ = CoinCopyOfArray(source.mrhs_,mr_); msense_ = CoinCopyOfArray(source.msense_,mr_); } } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglZeroHalf::clone() const { return new CglZeroHalf(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglZeroHalf::~CglZeroHalf () { delete [] mtbeg_; delete [] mtcnt_; delete [] mtind_; delete [] mtval_; delete [] vlb_; delete [] vub_; delete [] mrhs_; delete [] msense_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglZeroHalf & CglZeroHalf::operator=( const CglZeroHalf& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); delete [] mtbeg_; delete [] mtcnt_; delete [] mtind_; delete [] mtval_; delete [] vlb_; delete [] vub_; delete [] mrhs_; delete [] msense_; mr_ = rhs.mr_; mc_ = rhs.mc_; mnz_ = rhs.mnz_; flags_ = rhs.flags_; cutInfo_=Cgl012Cut(); if (mr_) { mtbeg_ = CoinCopyOfArray(rhs.mtbeg_,mr_); mtcnt_ = CoinCopyOfArray(rhs.mtcnt_,mr_); mtind_ = CoinCopyOfArray(rhs.mtind_,mnz_); mtval_ = CoinCopyOfArray(rhs.mtval_,mnz_); vlb_ = CoinCopyOfArray(rhs.vlb_,mc_); vub_ = CoinCopyOfArray(rhs.vub_,mc_); mrhs_ = CoinCopyOfArray(rhs.mrhs_,mr_); msense_ = CoinCopyOfArray(rhs.msense_,mr_); } else { mtbeg_ = NULL; mtcnt_ = NULL; mtind_ = NULL; mtval_ = NULL; vlb_ = NULL; vub_ = NULL; mrhs_ = NULL; msense_ = NULL; } } return *this; } void CglZeroHalf::refreshSolver(OsiSolverInterface * solver) { if (!solver||!solver->getNumRows()) return; // no solver delete [] mtbeg_; delete [] mtcnt_; delete [] mtind_; delete [] mtval_; delete [] vlb_; delete [] vub_; delete [] mrhs_; delete [] msense_; mr_ = 0; mc_ = 0; mnz_ = 0; mtbeg_ = NULL; mtcnt_ = NULL; mtind_ = NULL; mtval_ = NULL; vlb_ = NULL; vub_ = NULL; mrhs_ = NULL; msense_ = NULL; cutInfo_.free_log_var(); cutInfo_.free_parity_ilp(); cutInfo_.free_ilp(); CoinPackedMatrix rowCopy(*solver->getMatrixByRow()); const int * column = rowCopy.getIndices(); const CoinBigIndex * rowStart = rowCopy.getVectorStarts(); const int * rowLength = rowCopy.getVectorLengths(); const double * rowElements = rowCopy.getElements(); const double * columnLower = solver->getColLower(); const double * columnUpper = solver->getColUpper(); const double * rowLower = solver->getRowLower(); const double * rowUpper = solver->getRowUpper(); int iColumn,iRow; // count number of possible int numberColumns = solver->getNumCols(); int numberRows = solver->getNumRows(); vlb_ = new int [numberColumns]; vub_ = new int [numberColumns]; for (iColumn=0;iColumnisInteger(iColumn)) { double lo = columnLower[iColumn]; if (lo<-COIN_INT_MAX) lo=-COIN_INT_MAX; ilo= static_cast (ceil(lo)); double up = columnUpper[iColumn]; if (up>COIN_INT_MAX) up=COIN_INT_MAX; iup= static_cast (floor(up)); } else { ilo=COIN_INT_MAX; iup=-COIN_INT_MAX; } vlb_[iColumn]=ilo; vub_[iColumn]=iup; } for (iRow=0;iRow0); for (CoinBigIndex j=rowStart[iRow]; j1.0e-30) { // not integer coefficient good=false; break; } } } double lo = rowLower[iRow]; double up = rowUpper[iRow]; int iType=1; double rhs=1.0e20; if (lo>-1.0e20) { if (fabs(lo-floor(lo+0.5))>1.0e-12) { // not integer coefficient good=false; } rhs=fabs(lo); if (up<1.0e20) { rhs=CoinMax(fabs(lo),fabs(up)); if (lo!=up) iType=2; // ranged so make copy if (fabs(up-floor(up+0.5))>1.0e-12) { // not integer coefficient good=false; } } } else if (up<1.0e20) { rhs=fabs(up); if (up<1.0e20) { if (fabs(up-floor(up+0.5))>1.0e-12) { // not integer coefficient good=false; } } } if (good&&rhs0); for (CoinBigIndex j=rowStart[iRow]; j1.0e-12) { // not integer coefficient good=false; break; } } } double lo = rowLower[iRow]; double up = rowUpper[iRow]; int iType=1; double rhs=1.0e20; if (lo>-1.0e20) { if (fabs(lo-floor(lo+0.5))>1.0e-30) { // not integer coefficient good=false; } rhs=fabs(lo); if (up<1.0e20) { rhs=CoinMax(fabs(lo),fabs(up)); if (lo!=up) iType=2; // ranged so make copy if (fabs(up-floor(up+0.5))>1.0e-12) { // not integer coefficient good=false; } } } else if (up<1.0e20) { rhs=fabs(up); if (up<1.0e20) { if (fabs(up-floor(up+0.5))>1.0e-12) { // not integer coefficient good=false; } } } if (good&&rhs (floor(value+0.5)); if (iValue) { mtind_[mnz_]=jColumn; mtval_[mnz_++]=iValue; } } mtcnt_[mr_]=mnz_-mtbeg_[mr_]; if (iType==1) { if (lo>-1.0e20) { mrhs_[mr_]=static_cast (floor(lo+0.5)); msense_[mr_]='G'; } else { mrhs_[mr_]=static_cast (floor(up+0.5)); msense_[mr_]='L'; } mr_++; } else { // ranged! mrhs_[mr_]=static_cast (floor(lo+0.5)); msense_[mr_]='G'; int k = mnz_-mtbeg_[mr_]; mr_++; mtbeg_[mr_]=mnz_; memcpy(mtind_+mnz_,mtind_+mnz_-k,k*sizeof(int)); memcpy(mtval_+mnz_,mtval_+mnz_-k,k*sizeof(int)); mnz_+= mtcnt_[mr_-1]; mtcnt_[mr_]=mnz_-mtbeg_[mr_]; mrhs_[mr_]=static_cast (floor(up+0.5)); msense_[mr_]='L'; mr_++; } } } cutInfo_.ilp_load(mr_,mc_,mnz_,mtbeg_,mtcnt_,mtind_,mtval_, vlb_,vub_,mrhs_,msense_); cutInfo_.alloc_parity_ilp(mr_,mc_,mnz_); cutInfo_.initialize_log_var(); } else { // no good delete [] vlb_; delete [] vub_; vlb_ = NULL; vub_ = NULL; mr_=0; mnz_=0; } } // Create C++ lines to get to current state std::string CglZeroHalf::generateCpp( FILE * fp) { CglZeroHalf other; fprintf(fp,"0#include \"CglZeroHalf.hpp\"\n"); fprintf(fp,"3 CglZeroHalf zeroHalf;\n"); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 zeroHalf.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 zeroHalf.setAggressiveness(%d);\n",getAggressiveness()); return "zeroHalf"; } #include #include //bool operator() (cgl_node * x, cgl_node * y) { bool best(cgl_node * x, cgl_node * y) { return (x->distanceBack>y->distanceBack); } #ifndef CGL_NEW_SHORT void cglShortestPath(cgl_graph * graph, int source, int maximumLength) #else void cglShortestPath(auxiliary_graph * graph, int source, int maximumLength) #endif { int numberNodes=graph->nnodes; #define HEAP #ifndef HEAP int * candidate = new int [numberNodes]; #endif cgl_node * nodes = graph->nodes; int i; for ( i=0;i nodes_; for ( i=0;i0) { #ifdef HEAP cgl_node * bestNode = nodes_.front(); int iNode = bestNode->index; std::pop_heap(nodes_.begin(), nodes_.end(), best); nodes_.pop_back(); if (nodes[iNode].distanceBack==COIN_INT_MAX) break; numberCandidates--; #else int best=-1; int bestDistance=COIN_INT_MAX; for (i=0;ito; int dist = arc->length; if (thisDistance+dist #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglTwomir.hpp" void CglTwomirUnitTest(const OsiSolverInterface *baseSiP, const std::string mpsDir) { // Test default constructor { CglTwomir aGenerator; } // Test copy & assignment { CglTwomir rhs; { CglTwomir bGenerator; CglTwomir cGenerator(bGenerator); rhs=bGenerator; } } // Test get/set methods { CglTwomir getset; int gtmin = getset.getTmin() + 1; int gtmax = getset.getTmax() + 1; getset.setMirScale(gtmin, gtmax); double gtmin2 = getset.getTmin(); double gtmax2 = getset.getTmax(); assert(gtmin == gtmin2); assert(gtmax == gtmax2); int gamax = 2 * getset.getAmax() + 1; getset.setAMax(gamax); int gamax2 = getset.getAmax(); assert(gamax == gamax2); } // Test generateCuts { CglTwomir gct; OsiSolverInterface *siP = baseSiP->clone(); std::string fn = mpsDir+"capPlan1"; std::string fn2 = mpsDir+"capPlan1.mps"; FILE *in_f = fopen(fn2.c_str(), "r"); if(in_f == NULL) { std::cout<<"Can not open file "<readMps(fn.c_str(),"mps"); siP->initialSolve(); double lpRelax = siP->getObjValue(); OsiCuts cs; gct.generateCuts(*siP, cs); int nRowCuts = cs.sizeRowCuts(); std::cout<<"There are "< 0); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cs); siP->resolve(); double lpRelaxAfter= siP->getObjValue(); std::cout<<"Initial LP value: "< #include #include #include #include #include #include "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CoinPackedVector.hpp" #include "CoinPackedMatrix.hpp" #include "CoinIndexedVector.hpp" #include "OsiRowCutDebugger.hpp" #include "CoinFactorization.hpp" #include "CoinWarmStartBasis.hpp" #include "CoinFinite.hpp" #include "CoinPackedMatrix.hpp" #include "OsiRowCutDebugger.hpp" #include "CoinWarmStartBasis.hpp" #include "CglTwomir.hpp" class CoinWarmStartBasis; #define COIN_HAS_CLP_TWOMIR #ifdef COIN_HAS_CLP_TWOMIR #include "OsiClpSolverInterface.hpp" #endif #undef DGG_DEBUG_DGG //#define DGG_DEBUG_DGG 1 //#define CGL_DEBUG //#define CGL_DEBUG_ZERO #define q_max data->cparams.q_max #define q_min data->cparams.q_min #define t_max data->cparams.t_max #define t_min data->cparams.t_min #define a_max data->cparams.a_max #define max_elements data->cparams.max_elements #ifdef CGL_DEBUG // Declarations and defines for debug build. #define talk true namespace { const OsiSolverInterface *six ; } void write_cut( DGG_constraint_t *cut){ //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! printf("2mir_test: cut: !!!!!!!!!!!!!!!!!!!!!!!***********************************\n"); for (int i=0; inz; i++) { printf(" %12.10f x[%d] ", cut->coeff[i],cut->index[i]);} printf(" >= %12.10f \n", cut->rhs); } void testus( DGG_constraint_t *cut){ //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // const OsiRowCutDebugger debugg(*six, "flugpl.mps"); const OsiRowCutDebugger debugg(*six, "egout.mps"); const OsiRowCutDebugger *debugger = &debugg; if (debugger&&!debugger->onOptimalPath(*six)) return; OsiRowCut rowcut; rowcut.setRow(cut->nz, cut->index, cut->coeff); rowcut.setUb(DBL_MAX); rowcut.setLb(cut->rhs); if(debugger->invalidCut(rowcut)){ write_cut(cut); //assert(0); } } #else // CGL_DEBUG #define talk false #endif // CGL_DEBUG //------------------------------------------------------------------- // Generate cuts //------------------------------------------------------------------- void CglTwomir::generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info ) { # ifdef CGL_DEBUG //!!!!!!!!!!!!!!!!!! six = &si; # endif const double * colUpper = si.getColUpper(); const double * colLower = si.getColLower(); const OsiSolverInterface * useSolver; #ifdef COIN_HAS_CLP_TWOMIR double * objective = NULL; OsiClpSolverInterface * clpSolver = dynamic_cast(originalSolver_); int numberOriginalRows; int numberColumns=si.getNumCols(); int twomirType=0; if (!clpSolver) { #endif useSolver=&si; // Temp - check if free variables int ncol = useSolver->getNumCols(); int numberFree=0; for (int i=0;i1.0e20) numberFree++; } if (numberFree) { #ifdef COIN_DEVELOP if (!info.inTree&&!info.pass) printf("CglTwoMir - %d free variables - returning\n",numberFree); #endif return; } #ifdef COIN_HAS_CLP_TWOMIR } else { useSolver = originalSolver_; assert (twomirType_); // check simplex is plausible if (!clpSolver->getNumRows()||numberColumns!=clpSolver->getNumCols()) { delete originalSolver_; originalSolver_=si.clone(); clpSolver = dynamic_cast(originalSolver_); assert (clpSolver); useSolver = originalSolver_; } ClpSimplex * simplex = clpSolver->getModelPtr(); numberOriginalRows = simplex->numberRows(); int numberRows = si.getNumRows(); assert (numberOriginalRows<=numberRows); // only do if different (unless type 2x) twomirType = twomirType_%10; int whenToDo = twomirType_/10; if (whenToDo==2 ||(numberRows>numberOriginalRows && whenToDo==1 && (info.options&512)==0) || ((info.options&1024)!=0 && (info.options&512)==0)) { // bounds const double * solution = si.getColSolution(); memcpy(simplex->columnLower(),colLower,numberColumns*sizeof(double)); memcpy(simplex->columnUpper(),colUpper,numberColumns*sizeof(double)); for (int i=0;i1.0e20) { double lower=-COIN_DBL_MAX; double upper=COIN_DBL_MAX; if (solution[i]>0.0) lower=-1.0e10; else upper=1.0e10; originalSolver_->setColLower(i,lower); originalSolver_->setColUpper(i,upper); } } double * obj = simplex->objective(); objective = CoinCopyOfArray(obj,numberColumns); const double * pi = si.getRowPrice(); const CoinPackedMatrix * rowCopy = si.getMatrixByRow(); const int * column = rowCopy->getIndices(); const CoinBigIndex * rowStart = rowCopy->getVectorStarts(); const int * rowLength = rowCopy->getVectorLengths(); const double * rowElements = rowCopy->getElements(); const double * rowLower = si.getRowLower(); const double * rowUpper = si.getRowUpper(); int numberCopy; int numberAdd; double * rowLower2 = NULL; double * rowUpper2 = NULL; int * column2 = NULL; CoinBigIndex * rowStart2 = NULL; double * rowElements2 = NULL; char * copy = new char [numberRows-numberOriginalRows]; memset(copy,0,numberRows-numberOriginalRows); if (twomirType==2) { numberCopy=0; numberAdd=0; for (int iRow=numberOriginalRows;iRow0.5) obj[i] -= randomNumber*0.001*fabs(obj[i]); else obj[i] += randomNumber*0.001*fabs(obj[i]); } } #endif if (numberCopy) { clpSolver->addRows(numberCopy, rowStart2,column2,rowElements2, rowLower2,rowUpper2); delete [] rowLower2 ; delete [] rowUpper2 ; delete [] column2 ; delete [] rowStart2 ; delete [] rowElements2 ; } delete [] copy; memcpy(simplex->primalColumnSolution(),si.getColSolution(), numberColumns*sizeof(double)); CoinWarmStart * warmstart = si.getWarmStart(); CoinWarmStartBasis* warm = dynamic_cast(warmstart); warm->resize(simplex->numberRows(),numberColumns); clpSolver->setBasis(*warm); delete warm; simplex->setDualObjectiveLimit(COIN_DBL_MAX); simplex->setLogLevel(0); clpSolver->resolve(); //printf("Trying - %d its status %d objs %g %g - with offset %g\n", // simplex->numberIterations(),simplex->status(), // simplex->objectiveValue(),si.getObjValue(),simplex->objectiveValue()+offset); //simplex->setLogLevel(0); if (simplex->status()) { //printf("BAD status %d\n",simplex->status()); //clpSolver->writeMps("clp"); //si.writeMps("si"); delete [] objective; objective=NULL; useSolver=&si; } } } #endif useSolver->getStrParam(OsiProbName,probname_) ; int numberRowCutsBefore = cs.sizeRowCuts(); DGG_list_t cut_list; DGG_list_init (&cut_list); DGG_data_t* data = DGG_getData(reinterpret_cast (useSolver)); // Note that the lhs variables are hash defines to data->cparams.* q_max = q_max_; q_min = q_min_; t_max = t_max_; t_min = t_min_; a_max = a_max_; max_elements = info.inTree ? max_elements_ : max_elements_root_; data->gomory_threshold = info.inTree ? away_ : awayAtRoot_; if (!info.inTree) { //const CoinPackedMatrix * columnCopy = useSolver->getMatrixByCol(); //int numberColumns=columnCopy->getNumCols(); if (!info.pass||(info.options&32)!=0) { max_elements=useSolver->getNumCols(); //} else { //int numberRows=columnCopy.getNumRows(); //int numberElements=columnCopy->getNumElements(); //if (max_elements>500&&numberElements>10*numberColumns) //max_elements=numberColumns; } } if (!do_mir_) t_max = t_min - 1; if (!do_2mir_) q_max = q_min - 1; if (do_tab_ && info.level < 1 && info.pass < 6) DGG_generateTabRowCuts( &cut_list, data, reinterpret_cast (useSolver) ); if (do_form_) DGG_generateFormulationCuts( &cut_list, data, reinterpret_cast (useSolver), info.formulation_rows, randomNumberGenerator_); #ifdef CGL_DEBUG const OsiRowCutDebugger debugg(si,probname_.c_str()) ; const OsiRowCutDebugger *debugger = &debugg; if (debugger&&!debugger->onOptimalPath(si)) debugger = NULL; else {if(talk) printf ("2mir_test: debug success\n");} #endif int i; for ( i=0; inznz; i++) { if (!cut->coeff[i]) nZero++; } #ifdef CGL_DEBUG_ZERO if (nZero) { printf("Cut "); for( int i=0; i < cut->nz; i++) { printf("%d %g ",cut->index[i],cut->coeff[i]); } printf("\n"); } #endif if (nZero) { #ifdef CGL_DEBUG_ZERO printf("TwoMir cut had %d zero coefficients!\n",nZero); #endif } else { #ifdef CBC_CHECK_CUT double rhs = cut->rhs; int * cutIndex = cut->index; double * packed = cut->coeff; int i,number2=cut->nz; int number=0; double largest=0.0; double smallest=1.0e30; const double *colUpper = useSolver->getColUpper(); const double *colLower = useSolver->getColLower(); bool goodCut=true; for (i=0;i0.0) rhs -= value*colUpper[iColumn]; else rhs += value*colLower[iColumn]; } else { // throw away goodCut=false; break; } } else { int iColumn = cutIndex[i]; if (colUpper[iColumn]!=colLower[iColumn]) { largest=CoinMax(largest,value); smallest=CoinMin(smallest,value); cutIndex[number]=cutIndex[i]; packed[number++]=packed[i]; } else { // fixed so subtract out rhs -= packed[i]*colLower[iColumn]; } } } if (largest<5.0e9*smallest&&goodCut) { rowcut.setRow(number, cutIndex, packed); rowcut.setUb(COIN_DBL_MAX); rowcut.setLb(rhs); cs.insert(rowcut); } #else rowcut.setRow(cut->nz, cut->index, cut->coeff); rowcut.setUb(DBL_MAX); rowcut.setLb(cut->rhs); cs.insert(rowcut); #endif } #ifdef CGL_DEBUG if (debugger) { if (debugger->invalidCut(rowcut)) { write_cut(cut); printf ("2mir_test: debug failed, mayday, mayday **********************************\n");} //assert(0); } //assert(!debugger->invalidCut(rowcut)); #endif } } for ( i=0; irow().getNumElements(); if (length<=max_elements_) cs.rowCutPtr(i)->setGloballyValid(); } } #ifdef COIN_HAS_CLP_TWOMIR if (objective) { int numberRowCutsAfter = cs.sizeRowCuts(); ClpSimplex * simplex = clpSolver->getModelPtr(); memcpy(simplex->objective(),objective,numberColumns*sizeof(double)); delete [] objective; // take out locally useless cuts const double * solution = si.getColSolution(); double primalTolerance = 1.0e-7; for (int k = numberRowCutsAfter - 1; k >= numberRowCutsBefore; k--) { const OsiRowCut * thisCut = cs.rowCutPtr(k) ; double sum = 0.0; int n = thisCut->row().getNumElements(); const int * column = thisCut->row().getIndices(); const double * element = thisCut->row().getElements(); assert (n); for (int i = 0; i < n; i++) { double value = element[i]; sum += value * solution[column[i]]; } if (sum > thisCut->ub() + primalTolerance) { sum = sum - thisCut->ub(); } else if (sum < thisCut->lb() - primalTolerance) { sum = thisCut->lb() - sum; } else { sum = 0.0; } if (!sum) { // take out cs.eraseRowCut(k); } } #ifdef CLP_INVESTIGATE2 printf("OR %p pass %d inTree %c - %d cuts (but %d deleted)\n", originalSolver_,info.pass,info.inTree?'Y':'N', numberRowCutsAfter-numberRowCutsBefore, numberRowCutsAfter-cs.sizeRowCuts()); #endif } int numberRowCutsAfter = cs.sizeRowCuts(); if (!info.inTree) { for (int i=numberRowCutsBefore;isetGloballyValid(); } } if (twomirType==2) { // back to original int numberRows = clpSolver->getNumRows(); if (numberRows>numberOriginalRows) { int numberDelete = numberRows-numberOriginalRows; int * delRow = new int [numberDelete]; for (int i=0;ideleteRows(numberDelete,delRow); delete [] delRow; } } #endif } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglTwomir::CglTwomir () : CglCutGenerator(), probname_(), randomNumberGenerator_(987654321),originalSolver_(NULL), away_(0.0005),awayAtRoot_(0.0005),twomirType_(0), do_mir_(true), do_2mir_(true), do_tab_(true), do_form_(true), t_min_(1), t_max_(1), q_min_(1), q_max_(1), a_max_(2),max_elements_(50000), max_elements_root_(50000),form_nrows_(0) {} //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglTwomir::CglTwomir (const CglTwomir & source) : CglCutGenerator(source), randomNumberGenerator_(source.randomNumberGenerator_), originalSolver_(NULL), away_(source.away_), awayAtRoot_(source.awayAtRoot_), twomirType_(source.twomirType_), do_mir_(source.do_mir_), do_2mir_(source.do_2mir_), do_tab_(source.do_tab_), do_form_(source.do_form_), t_min_(source.t_min_), t_max_(source.t_max_), q_min_(source.q_min_), q_max_(source.q_max_), a_max_(source.a_max_), max_elements_(source.max_elements_), max_elements_root_(source.max_elements_root_), form_nrows_(source.form_nrows_) { probname_ = source.probname_ ; if (source.originalSolver_) originalSolver_ = source.originalSolver_->clone(); } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglTwomir::clone() const { return new CglTwomir(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglTwomir::~CglTwomir () { delete originalSolver_; } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglTwomir & CglTwomir::operator=(const CglTwomir& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); randomNumberGenerator_ = rhs.randomNumberGenerator_; away_=rhs.away_; awayAtRoot_=rhs.awayAtRoot_; twomirType_ = rhs.twomirType_; delete originalSolver_; if (rhs.originalSolver_) originalSolver_ = rhs.originalSolver_->clone(); else originalSolver_=NULL; do_mir_=rhs.do_mir_; do_2mir_=rhs.do_2mir_; do_tab_=rhs.do_tab_; do_form_=rhs.do_form_; t_min_=rhs.t_min_; t_max_=rhs.t_max_; q_min_=rhs.q_min_; q_max_=rhs.q_max_; a_max_=rhs.a_max_; max_elements_=rhs.max_elements_; max_elements_root_ = rhs.max_elements_root_; form_nrows_=rhs.form_nrows_; } return *this; } // Pass in a copy of original solver (clone it) void CglTwomir::passInOriginalSolver(OsiSolverInterface * solver) { delete originalSolver_; if (solver) { if (!twomirType_) twomirType_=1; originalSolver_ = solver->clone(); originalSolver_->setHintParam(OsiDoDualInResolve, false, OsiHintDo); // Temp - check if free variables const double *colUpper = originalSolver_->getColUpper(); const double *colLower = originalSolver_->getColLower(); int ncol = originalSolver_->getNumCols(); int numberFree=0; for (int i=0;i1.0e20) numberFree++; } if (numberFree) printf("CglTwoMir - %d free variables - take care\n",numberFree); } else { twomirType_=0; originalSolver_=NULL; } } int DGG_freeData( DGG_data_t *data ) { free(data->info); free(data->lb); free(data->ub); free(data->x); free(data->rc); free(data); return 0; } DGG_data_t* DGG_getData(const void *osi_ptr ) { DGG_data_t *data = NULL; const OsiSolverInterface *si = reinterpret_cast (osi_ptr); data = reinterpret_cast (malloc( sizeof(DGG_data_t)) ); /* retrieve basis information */ CoinWarmStart *startbasis = si->getWarmStart(); const CoinWarmStartBasis *basis = dynamic_cast(startbasis); /* retrieve bounds information */ const double *colUpper = si->getColUpper(); const double *colLower = si->getColLower(); const double *rowUpper = si->getRowUpper(); const double *rowLower = si->getRowLower(); const double *redCost = si->getReducedCost(); const double *dualVal = si->getRowPrice(); /* retrieve current optimal solution */ const double *colSolut = si->getColSolution(); /* retrieve the matrix in row format */ const CoinPackedMatrix *rowMatrixPtr = si->getMatrixByRow(); const int *rowBeg = 0, *rowCnt = 0, *rowInd = 0; const double *rowMat; rowBeg = rowMatrixPtr->getVectorStarts(); rowCnt = rowMatrixPtr->getVectorLengths(); rowMat = rowMatrixPtr->getElements(); rowInd = rowMatrixPtr->getIndices(); /* set number of columns and number of rows */ data->ncol = si->getNumCols(); data->nrow = si->getNumRows(); /* set ninteger */ data->ninteger = 0; /* allocate memory for the arrays in 'data' */ data->info = reinterpret_cast (malloc( sizeof(int)*(data->ncol+data->nrow)) ); data->lb = reinterpret_cast (malloc( sizeof(double)*(data->ncol+data->nrow)) ); data->ub = reinterpret_cast (malloc( sizeof(double)*(data->ncol+data->nrow)) ); data->x = reinterpret_cast (malloc( sizeof(double)*(data->ncol+data->nrow)) ); data->rc = reinterpret_cast (malloc( sizeof(double)*(data->ncol+data->nrow)) ); memset(data->info, 0, sizeof(int)*(data->ncol+data->nrow)); /* set parameters for column variables */ data->nbasic_col = 0; for(int i=0; i < data->ncol; i++){ /* is variable basic */ if ( basis->getStructStatus(i) == CoinWarmStartBasis::basic ){ data->nbasic_col++; DGG_setIsBasic(data,i); } #if DGG_DEBUG_DGG { int error = 0; if ( basis->getStructStatus(i) != CoinWarmStartBasis::basic ) if ( fabs(colSolut[i] - colUpper[i]) > DGG_BOUND_THRESH ) if ( fabs(colSolut[i] - colLower[i]) > DGG_BOUND_THRESH ){ fprintf(stdout, "WARNING!!!! : "); fprintf(stdout, "variable %d non-basic, lb = %f, ub = %f, x = %f\n", i, colLower[i], colUpper[i], colSolut[i]); error+=1; } if (error) fprintf(stdout, "\nFOUND %d errors. BYE.\n", error); } #endif /* set variable bounds*/ data->lb[i] = colLower[i]; data->ub[i] = colUpper[i]; /* is variable integer */ if ( si->isInteger(i) ){ data->ninteger++; DGG_setIsInteger(data,i); /* tighten variable bounds*/ data->lb[i] = ceil(colLower[i]); data->ub[i] = floor(colUpper[i]); } /* set x value */ data->x[i] = colSolut[i]; /* WARNING: remember to set rc!! Its not set!! */ data->rc[i] = redCost[i]; } /* set parameters for row variables */ /* slack variables (row variables) work as follows: for a ranged constraint, b_dw < ax < b_up, define a variable s so that 1) if b_up is not infinity: ax + s = b_up, 0 < s < b_up - b_dw 2) if b_up is infinity: ax - s = b_dw, 0 < s < b_up - b_dw */ { int i,j; double activity; data->nbasic_row = 0; for(i=0, j=data->ncol; i < data->nrow; i++, j++){ /* check if the row is an equality constraint */ if ( fabs( rowUpper[i] - rowLower[i] ) <= DGG_BOUND_THRESH ) DGG_setEqualityConstraint(data,j); /* check if the row is bounded above/below and define variable bounds */ if ( rowUpper[i] < COIN_DBL_MAX ) DGG_setIsConstraintBoundedAbove(data,j); if ( rowLower[i] > -1*COIN_DBL_MAX ) DGG_setIsConstraintBoundedBelow(data,j); data->lb[j] = 0.0; if (DGG_isConstraintBoundedAbove(data,j) && DGG_isConstraintBoundedBelow(data,j)) data->ub[j] = rowUpper[i] - rowLower[i]; else data->ub[j] = COIN_DBL_MAX; /* compute row activity. for this we need to go to the row in question, and multiply all the coefficients times their respective variables. For the moment, we will store the inverse of this value in the 'x' field (since it is in fact a partial computation of it) */ { int k; activity = 0.0; for(k=rowBeg[i]; k < rowBeg[i]+rowCnt[i]; k++) activity += rowMat[k]*colSolut[rowInd[k]]; } /* compute x value */ if ( DGG_isConstraintBoundedAbove(data,j) ) data->x[j] = rowUpper[i] - activity; else data->x[j] = activity - rowLower[i]; if ( data->x[j] < -DGG_NULL_SLACK ){ #if DGG_DEBUG_DGG int k; double norm = 0.0, min = DBL_MAX, amin = DBL_MAX, max = DBL_MIN; printf("** warning: row %d has negative slack!\n", i); for(k=rowBeg[i]; k < rowBeg[i]+rowCnt[i]; k++){ norm += rowMat[k]*rowMat[k]; if ( fabs(rowMat[k]) < amin ) amin = fabs(rowMat[k]); if ( rowMat[k] < min ) min = rowMat[k]; if ( rowMat[k] > max ) max = rowMat[k]; } norm = sqrt(norm); printf("min = %f amin = %f max = %f\n", min, amin, max); printf("rlower = %f activity = %f\n", rowLower[i], activity); printf("norm = %f (b-ax) = %f\n", norm, (rowLower[i] - activity)); printf("steepn = %f\n", (rowLower[i] - activity)/norm); #endif } data->rc[j] = dualVal[i]; #if DGG_DEBUG_SOLVER DGG_IF_EXIT( !DGG_isConstraintBoundedAbove(data,j) && !DGG_isConstraintBoundedBelow(data,j), 1, "some row is not bounded above or below"); #endif /* is variable basic */ if ( basis->getArtifStatus(i) == CoinWarmStartBasis::basic ){ data->nbasic_row++; DGG_setIsBasic(data,j); } /* is variable integer. For this we need to go to the row in question, and check that the rhs is integer, and that all of the coefficients and variables participating in the constraint are also integer. */ { int k; if( DGG_isConstraintBoundedAbove(data,j)) { if ( frac_part(rowUpper[i]) > DGG_INTEGRALITY_THRESH ) goto DONE_ROW; } else if ( frac_part(rowLower[i]) > DGG_INTEGRALITY_THRESH ) goto DONE_ROW; for(k=rowBeg[i]; k < rowBeg[i]+rowCnt[i]; k++) if ( frac_part(rowMat[k]) > DGG_INTEGRALITY_THRESH || !DGG_isInteger(data, rowInd[k])) goto DONE_ROW; DGG_setIsInteger(data, j); data->ninteger++; } DONE_ROW:; /* set variable bounds: careful!! Later, remember to adjust the INFINITY to a DGG standard (to deal with neq solvers). */ /* WARNING: remember to set rc!! Its not set!! */ } } /* CLEANUP */ delete basis; return data; } DGG_constraint_t* DGG_getSlackExpression(const void *osi_ptr, DGG_data_t* data, int row_index) { DGG_constraint_t *row = 0; int i,j; /* retrieve the matrix in row format */ const OsiSolverInterface *si = reinterpret_cast (osi_ptr); const CoinPackedMatrix *rowMatrixPtr = si->getMatrixByRow(); const int *rowBeg = 0, *rowCnt = 0, *rowInd = 0; const double *rowMat; const double *rowUpper; const double *rowLower; row = DGG_newConstraint(data->ncol); rowBeg = rowMatrixPtr->getVectorStarts(); rowCnt = rowMatrixPtr->getVectorLengths(); rowMat = rowMatrixPtr->getElements(); rowInd = rowMatrixPtr->getIndices(); rowUpper = si->getRowUpper(); rowLower = si->getRowLower(); #if DGG_DEBUG_DGG if ( row_index < 0 || row_index > data->nrow ) DGG_THROW(0, "bad row index"); #endif /* copy the information into the row ADT */ row->nz = rowCnt[row_index]; for(j=0, i=rowBeg[row_index]; i < rowBeg[row_index]+rowCnt[row_index]; i++, j++){ row->coeff[j] = rowMat[i]; row->index[j] = rowInd[i]; if (DGG_isConstraintBoundedAbove (data, data->ncol + row_index)) row->coeff[j] = -row->coeff[j]; } row->sense = '?'; if ( DGG_isConstraintBoundedAbove(data, data->ncol + row_index) ) row->rhs = rowUpper[row_index]; else row->rhs = -rowLower[row_index]; return row; } int DGG_getTableauConstraint( int index, const void *osi_ptr, DGG_data_t *data, DGG_constraint_t* tabrow, const int * colIsBasic, const int * /*rowIsBasic*/, CoinFactorization & factorization, int mode ) { #if DGG_DEBUG_DGG /* ensure that the index corresponds to a basic variable */ if ( !DGG_isBasic(data, index) ) DGG_THROW(1, "index is non-basic"); /* ensure that the index corresponds to a column variable */ if ( index < 0 || index > (data->ncol - 1) ) DGG_THROW(1, "index not a column variable"); #endif /* obtain pointer to solver interface */ const OsiSolverInterface *si = reinterpret_cast (osi_ptr); DGG_TEST(!si, 1, "null OsiSolverInterfave"); /* obtain address of the LP matrix */ const CoinPackedMatrix *colMatrixPtr = si->getMatrixByCol(); const int* colBeg = colMatrixPtr->getVectorStarts(); const int* colCnt = colMatrixPtr->getVectorLengths(); const int* colInd = colMatrixPtr->getIndices(); const double* colMat = colMatrixPtr->getElements(); /* obtain row right-hand-sides */ const double *rowUpper = si->getRowUpper(); const double *rowLower = si->getRowLower(); /* allocate memory for constraint in non-sparse form */ int nz = 0; double *value = NULL, rhs = 0.0; value = reinterpret_cast(malloc(sizeof(double)*(data->nrow+data->ncol))); memset(value, 0, sizeof(double)*(data->nrow+data->ncol)); /* obtain the tableau row coefficients for all variables */ /* note: we could speed this up by only computing non-basic variables */ { int i, j, cnt = 0; double one = 1.0; CoinIndexedVector work; CoinIndexedVector array; work.reserve(data->nrow); array.reserve(data->nrow); array.setVector(1,&colIsBasic[index],&one); factorization.updateColumnTranspose ( &work, &array ); int * arrayRows = array.getIndices(); double *arrayElements = array.denseVector(); cnt = array.getNumElements(); /* compute column (structural) variable coefficients */ for(j = 0; j < data->ncol; j++) { value[j] = 0.0; for(i=colBeg[j]; i < colBeg[j]+colCnt[j]; i++) value[j] += colMat[i]*arrayElements[ colInd[i] ]; } #if DGG_DEBUG_SOLVER /* check pivot */ if ( fabs(value[index] - 1.0) > DGG_INTEGRALITY_THRESH ) DGG_THROW(1, "pivot is not one"); #endif /* compute row variable (slack/logical) variable coefficients */ for(j = 0; j < cnt; j++){ if ( DGG_isEqualityConstraint(data,data->ncol + arrayRows[j]) && !mode ) value[ data->ncol + arrayRows[j] ] = 0.0; else if ( DGG_isConstraintBoundedAbove(data, data->ncol + arrayRows[j]) ) value[ data->ncol + arrayRows[j] ] = arrayElements[ arrayRows[j] ]; else value[ data->ncol + arrayRows[j] ] = -1*arrayElements[ arrayRows[j] ]; } /* compute rhs */ rhs = 0.0; for(i=0; i < cnt; i++){ if ( DGG_isConstraintBoundedAbove(data,data->ncol + arrayRows[i]) ) rhs += arrayElements[arrayRows[i]]*rowUpper[arrayRows[i]]; else rhs += arrayElements[arrayRows[i]]*rowLower[arrayRows[i]]; } /* free 'work' and 'array' ?? do the empty functions do it?? they are not cleared in CglGomory. Is that due to a mistake? Is it done on purpose? */ /* work.empty(); array.empty(); */ } /* count non-zeroes */ nz = 0; int j; for( j=0; jncol+data->nrow; j++){ if ( fabs(value[j]) > DGG_MIN_TABLEAU_COEFFICIENT ) nz += 1; } /* put in sparse constraint format */ /* technical issue: should we let max_nz == nz or should we instead set max_nz == (nrow+ncol). The advantage of the latter approach is that later, when we substitute the slacks, the denser column will not require us to re-allocate memory */ tabrow->max_nz = nz; if (tabrow->coeff) free(tabrow->coeff); if (tabrow->index) free(tabrow->index); tabrow->coeff = reinterpret_cast (malloc(sizeof(double)*nz)); tabrow->index = reinterpret_cast (malloc(sizeof(int)*nz)); tabrow->nz = 0; for( j = 0; j < data->ncol + data->nrow; j++) if ( fabs(value[j]) > DGG_MIN_TABLEAU_COEFFICIENT ){ tabrow->coeff[tabrow->nz] = value[j]; tabrow->index[tabrow->nz] = j; tabrow->nz += 1; } tabrow->sense = 'E'; tabrow->rhs = rhs; /* CLEANUP */ free(value); return 0; } int DGG_getFormulaConstraint( int da_row, const void *osi_ptr, DGG_data_t *data, DGG_constraint_t* form_row ) { /* ensure that the da_row corresponds to a row */ if ( data->nrow <= da_row || 0> da_row) DGG_THROW(1, "row out of range..."); /* obtain pointer to solver interface */ const OsiSolverInterface *si = reinterpret_cast (osi_ptr); //DGG_TEST(!si, 1, "null OsiSolverInterfave"); /* obtain address of the LP matrix */ const CoinPackedMatrix *rowMatrixPtr = si->getMatrixByRow(); const int* rowBeg = rowMatrixPtr->getVectorStarts(); const int* rowCnt = rowMatrixPtr->getVectorLengths(); const int* rowInd = rowMatrixPtr->getIndices(); const double* rowMat = rowMatrixPtr->getElements(); /* obtain row right-hand-sides */ const double *rowUpper = si->getRowUpper(); const double *rowLower = si->getRowLower(); int nz = rowCnt[da_row]; form_row->nz = nz; form_row->max_nz = nz+1; int i; for( i=0; i < nz; i++) form_row->coeff[i] = rowMat[rowBeg[da_row]+i]; for( i=0; i < nz; i++) form_row->index[i] = rowInd[rowBeg[da_row]+i]; if ( DGG_isConstraintBoundedAbove(data,data->ncol + da_row) ){ form_row->rhs = rowUpper[da_row]; form_row->sense = 'L'; } else{ form_row->rhs = rowLower[da_row]; form_row->sense = 'G'; } if ( DGG_isEqualityConstraint(data,data->ncol + da_row) ) form_row->sense = 'E'; /* now add slack/surplus if there is one */ if ( DGG_isEqualityConstraint(data,data->ncol + da_row) == 0 ){ form_row->index[nz] = data->ncol + da_row; if ( DGG_isConstraintBoundedAbove(data, data->ncol + da_row) ) form_row->coeff[nz] = 1; else form_row->coeff[nz] = -1; form_row->nz +=1; } return 0; } //--------------------------------------------------------------- //--------------------------------------------------------------- //--------------------------------------------------------------- //--------------------------------------------------------------- //--------------------------------------------------------------- /******************** CONSTRAINT ADTs *****************************************/ DGG_constraint_t* DGG_newConstraint(int max_arrays) { DGG_constraint_t *c = NULL; if (max_arrays <= 0) return NULL; c = reinterpret_cast (malloc(sizeof(DGG_constraint_t))); c->nz = 0; c->max_nz = max_arrays; c->rhs = 0.0; c->sense = '?'; c->coeff = NULL; c->index = NULL; c->coeff = reinterpret_cast(malloc(sizeof(double)*max_arrays)); c->index = reinterpret_cast(malloc(sizeof(int)*max_arrays)); return c; } void DGG_freeConstraint(DGG_constraint_t *c) { if (c == NULL) return; if (c->coeff) free(c->coeff); if (c->index) free(c->index); free(c); } DGG_constraint_t *DGG_copyConstraint(DGG_constraint_t* c) { DGG_constraint_t *nc = NULL; if (!c || c->max_nz <= 0) return nc; nc = DGG_newConstraint(c->max_nz); if (nc == NULL) return nc; nc->nz = c->nz; nc->rhs = c->rhs; nc->sense = c->sense; memcpy(nc->coeff, c->coeff, sizeof(double)*nc->nz); memcpy(nc->index, c->index, sizeof(int)*nc->nz); return nc; } void DGG_scaleConstraint(DGG_constraint_t *c, int t) { int i; c->rhs *= t; if (t < 0){ if (c->sense == 'G') c->sense = 'L'; else if (c->sense == 'L') c->sense = 'G'; } for(i=0; inz; i++) c->coeff[i] *= t; } void DGG_list_init (DGG_list_t *l) { l->n = 0; l->c = NULL; l->ctype = NULL; l->alpha = NULL; } void DGG_list_free(DGG_list_t *l) { if (l->c != NULL) free (l->c); if (l->ctype != NULL) free (l->ctype); if (l->alpha != NULL) free (l->alpha); } int DGG_list_addcut (DGG_list_t *l, DGG_constraint_t *cut, int ctype, double alpha) { l->n ++; l->c = reinterpret_cast(realloc (l->c, l->n * sizeof(DGG_constraint_t *))); l->ctype = reinterpret_cast(realloc (l->ctype, l->n * sizeof (int))); l->alpha = reinterpret_cast(realloc (l->alpha, l->n * sizeof (double))); if (l->c == NULL || l->ctype == NULL || l->alpha == NULL){ printf ("No memory, bailing out\n"); return -1; } l->c[l->n - 1] = cut; l->ctype[l->n - 1] = ctype; l->alpha[l->n - 1] = alpha; return 0; } void DGG_list_delcut (DGG_list_t *l, int i) { if (i >= l->n && i < 0) return; DGG_freeConstraint (l->c[i]); l->c[i] = l->c[l->n - 1]; l->ctype[i] = l->ctype[l->n - 1]; l->alpha[i] = l->alpha[l->n - 1]; l->n --; } /******************* CONSTRAINT MANIPULATION **********************************/ /* VARIABLES CLOSE TO UPPER BOUNDS: we will substitute: x' = (u - x); hence the constraint will change from ax ~ b to -ax' ~ b - au note: the new bounds of x' will be, 0 <= x' <= u - l VARIABLES CLOSE TO LOWER BOUNDS: we will substitute: x' = (x - l); hence, the constraint will change from ax ~ b to ax' ~ b - al. note: some variable lower bounds may have changed when doing the complement in the previous stage - this must be taken into account. note: the new bounds of x' will be, 0 <= x' <= u - l */ int DGG_transformConstraint( DGG_data_t *data, double **x_out, double **rc_out, char **isint_out, DGG_constraint_t *constraint ) { double half; double *px = reinterpret_cast (malloc( sizeof(double)*constraint->max_nz )); double *rc = reinterpret_cast (malloc( sizeof(double)*constraint->max_nz )); char *pi = reinterpret_cast (malloc( sizeof(char) *constraint->max_nz )); { int i, idx; for(i=0; i < constraint->nz; i++){ idx = constraint->index[i]; px[i] = data->x[idx]; rc[i] = data->rc[idx]; pi[i] = static_cast(DGG_isInteger(data, idx)); half = (data->ub[idx] - data->lb[idx]) / 2; if ( data->ub[idx] - data->x[idx] < half ){ px[i] = data->ub[idx] - data->x[idx]; if (fabs(px[i]) <= DGG_BOUND_THRESH) px[i] = 0.0; constraint->rhs -= constraint->coeff[i]*data->ub[idx]; constraint->coeff[i] *= -1; } else { px[i] = data->x[idx] - data->lb[idx]; if (fabs(px[i]) <= DGG_BOUND_THRESH) px[i] = 0.0; constraint->rhs -= constraint->coeff[i]*data->lb[idx]; } } } *x_out = px; *rc_out = rc; *isint_out = pi; #if DGG_DEBUG_DGG DGG_TEST(DGG_isConstraintViolated(data, constraint), 1, "bad transformation"); #endif return 0; } int DGG_unTransformConstraint( DGG_data_t *data, DGG_constraint_t *constraint ) { int i, idx; double half; for(i=0; i < constraint->nz; i++){ idx = constraint->index[i]; half = (data->ub[idx] - data->lb[idx]) / 2; if ( data->ub[idx] - data->x[idx] < half ){ constraint->rhs -= constraint->coeff[i]*data->ub[idx]; constraint->coeff[i] *= -1; } else constraint->rhs += constraint->coeff[i]*data->lb[idx]; } return 0; } int DGG_substituteSlacks( const void *solver_ptr, DGG_data_t *data, DGG_constraint_t *cut ) { int i,j, lnz; double *lcut, lrhs; DGG_constraint_t *row=NULL; /* lcut will store all the column coefficients. allocate space and init. */ lcut = reinterpret_cast(malloc(sizeof(double)*data->ncol)); memset(lcut, 0, sizeof(double)*data->ncol); /* initialize lrhs */ lrhs = cut->rhs; /* set coefficients in lcut */ /* technical: we could speed this up by re-using allocated memory for row->coeff and row->index */ for(i=0; i < cut->nz; i++){ if ( cut->index[i] < data->ncol ) lcut[ cut->index[i] ] += cut->coeff[i]; else{ row = DGG_getSlackExpression(solver_ptr, data, (cut->index[i] - data->ncol)); for(j=0; j < row->nz; j++) lcut[ row->index[j] ] += row->coeff[j]*cut->coeff[i]; lrhs -= row->rhs*cut->coeff[i]; DGG_freeConstraint(row); } } /* count nz in new constraint */ lnz = 0; for(i=0; i < data->ncol; i++) if ( fabs(lcut[i]) > DGG_MIN_TABLEAU_COEFFICIENT ) lnz += 1; /* free row->coeff and row->index, and re-allocate */ free(cut->coeff); cut->coeff = 0; free(cut->index); cut->index = 0; cut->nz = lnz; cut->max_nz = lnz; if (lnz) { cut->coeff = reinterpret_cast (malloc( sizeof(double)*lnz )); cut->index = reinterpret_cast (malloc( sizeof(int)*lnz )); } /* set new constraint */ lnz = 0; for(i=0; i < data->ncol; i++){ if ( fabs(lcut[i]) > DGG_MIN_TABLEAU_COEFFICIENT ){ cut->coeff[lnz] = lcut[i]; cut->index[lnz] = i; lnz += 1; } } cut->rhs = lrhs; free(lcut); return 0; } int DGG_nicefyConstraint( const void * /*solver_ptr*/, DGG_data_t *data, DGG_constraint_t *cut) { double min_coef = COIN_DBL_MAX, max_coef = COIN_DBL_MIN; DGG_TEST(cut->sense == 'L', 1, "can't nicefy an L constraint"); int i; for( i=0; inz; i++) // first clean out noise if( fabs(cut->coeff[i]) < DGG_NICEFY_MIN_ABSVALUE) cut->coeff[i] = 0; for( i=0; inz; i++){ if( DGG_isInteger(data, cut->index[i])){// look at integral vars. double aht = ABOV(cut->coeff[i]); double ub = data->ub[ cut->index[i]]; if(aht < DGG_NICEFY_MIN_FIX){// coefficient = integer + epsylon cut->coeff[i] = floor( cut->coeff[i]); double ahtu = aht * ub; if(ahturhs -= ahtu;// safely remove the fractional part else cut->coeff[i] += DGG_NICEFY_MIN_FIX; // inflate the fractional part } else if (1-aht < DGG_NICEFY_MIN_FIX) // coefficient = integer - epsylon cut->coeff[i] = ceil( cut->coeff[i]); }// done with integers else // now look at continuous variables if ( cut->coeff[i] < DGG_NICEFY_MIN_ABSVALUE) // delete all negative and noise cut->coeff[i] = 0.0; else if(cut->coeff[i] < DGG_NICEFY_MIN_FIX) {// coefficient = epsylon double au = cut->coeff[i] * data->ub[ cut->index[i]]; if(aucoeff[i] = 0.0; cut->rhs -= au; } else cut->coeff[i] = DGG_NICEFY_MIN_FIX; // inflate the coefficient }// done with continuous variables too double abs_coef = fabs(cut->coeff[i]); min_coef = DGG_MIN(min_coef, abs_coef); max_coef = DGG_MAX(max_coef, abs_coef); } cut->sense = 'G'; /* if ( max_coef > DGG_NICEFY_MAX_RATIO*min_coef ) // kill the cut if numbers are all over the place cut->nz = 0; */ return 0; } /******************* CUT GENERATION *******************************************/ int DGG_generateTabRowCuts( DGG_list_t *cut_list, DGG_data_t *data, const void *solver_ptr ) { int k, rval = 0; DGG_constraint_t *base = NULL; int nc = cut_list->n; base = DGG_newConstraint(data->ncol + data->nrow); if(talk) printf ("2mir_test: generating tab row cuts\n"); /* allocate memory for basic column/row indicators */ int *rowIsBasic = 0, *colIsBasic = 0; rowIsBasic = reinterpret_cast(malloc(sizeof(int)*data->nrow)); colIsBasic = reinterpret_cast(malloc(sizeof(int)*data->ncol)); /* initialize the IsBasic arrays with -1 / 1 values indicating where the basic rows and columns are. NOTE: WE could do this only once and keep it in osi_data at the expense of space!! */ int i; for( i=0; incol; i++){ if ( DGG_isBasic(data,i) ) colIsBasic[i] = 1; else colIsBasic[i] = -1; } for( i=0; inrow; i++){ if ( DGG_isBasic(data,i+data->ncol) ) rowIsBasic[i] = 1; else rowIsBasic[i] = -1; } /* obtain factorization */ CoinFactorization factorization; /* obtain address of the LP matrix */ const OsiSolverInterface *si = reinterpret_cast (solver_ptr); const CoinPackedMatrix *colMatrixPtr = si->getMatrixByCol(); rval = factorization.factorize(*colMatrixPtr, rowIsBasic, colIsBasic); /* 0 = okay. -1 = singular. -2 = too many in basis. -99 = memory. */ DGG_TEST2(rval, 1, "factorization error = %d", rval); for(k=0; kncol; k++){ if (!(DGG_isBasic(data, k) && DGG_isInteger(data,k))) continue; double frac = frac_part (data->x[k]); if (frac < data->gomory_threshold || frac > 1-data->gomory_threshold) continue; base->nz = 0; rval = DGG_getTableauConstraint(k, solver_ptr, data, base, colIsBasic,rowIsBasic,factorization,0); DGG_CHECKRVAL(rval, rval); if (base->nz == 0){ printf ("2mir_test: why does constraint not exist ?\n"); continue; } if (base->nz > 500) continue; rval = DGG_generateCutsFromBase(base, cut_list, data, solver_ptr); DGG_CHECKRVAL(rval, rval); } free(rowIsBasic); free(colIsBasic); if(talk) printf ("2mir_test: generated %d tab cuts\n", cut_list->n - nc); fflush (stdout); DGG_freeConstraint(base); return rval; } int DGG_generateFormulationCuts( DGG_list_t *cut_list, DGG_data_t *data, const void *solver_ptr, int nrows, CoinThreadRandom & generator) { int k, rval = 0; DGG_constraint_t *base = NULL; int num_rows = (data->nrow < nrows) ? data->nrow : nrows; int nc = cut_list->n; base = DGG_newConstraint(data->ncol + data->nrow); if(talk) printf ("2mir_test: generating form row cuts %d\n", num_rows); for(k=0; knz = 0; rval = DGG_getFormulaConstraint(k, solver_ptr, data, base); DGG_CHECKRVAL1(rval, rval); //printf ("generating formulation for row %d\n", k); rval = DGG_generateFormulationCutsFromBase(base, data->x[data->ncol+k], cut_list, data, solver_ptr, generator); DGG_CHECKRVAL1(rval, rval); if (base->nz == 0){ #ifdef COIN_DEVELOP printf ("why does constraint not exist ?\n"); #endif continue; } } CLEANUP: if(talk) printf ("2mir_test: generated %d form cuts\n", cut_list->n - nc); fflush (stdout); DGG_freeConstraint(base); return rval; } int DGG_generateFormulationCutsFromBase( DGG_constraint_t *base, double slack, DGG_list_t *cut_list, DGG_data_t *data, const void *solver_ptr, CoinThreadRandom & generator) { int i, p, rval; int int_skala; double skala; int num_inlist = 0; int* skala_list = reinterpret_cast (malloc( sizeof(int)*base->nz )); char *isint = NULL; double *xout = NULL, *rcout = NULL; DGG_constraint_t *scaled_base = NULL; int tot_int = 0; double prob_choose = 0.0; rval = DGG_transformConstraint(data, &xout, &rcout, &isint, base); DGG_CHECKRVAL1(rval, rval); for(p = 0; p < base->nz; p++) if(isint[p]) tot_int ++; if (tot_int == 0) goto CLEANUP; prob_choose = 5.0/tot_int; for(p = 0; p < base->nz; p++) { if(isint[p]) if(generator.randomDouble() < prob_choose){ if(xout[p]<0.01) continue; skala =fabs(base->coeff[p]); if(skala<0.01) continue; // check if slack is too large if (fabs(slack/skala) > 0.5) continue; scaled_base = DGG_copyConstraint(base); DGG_CHECKRVAL1((scaled_base == NULL),-1); if(base->sense == 'L') { skala = -skala; scaled_base->sense = 'G'; } int_skala = int(100*skala); for(i = 0; i< num_inlist; i++) if(int_skala == skala_list[i]) goto END_LOOP; skala_list[num_inlist++] = int_skala; scaled_base->rhs = base->rhs/skala; for(i = 0; inz; i++) scaled_base->coeff[i] = base->coeff[i] / skala; rval = DGG_unTransformConstraint(data, scaled_base); DGG_CHECKRVAL1(rval, rval); rval = DGG_generateCutsFromBase(scaled_base, cut_list, data, solver_ptr); DGG_CHECKRVAL1(rval, rval); END_LOOP: DGG_freeConstraint(scaled_base); scaled_base = NULL; } } CLEANUP: if (isint) free(isint); if (xout) free(xout); if (rcout) free(rcout); if (skala_list) free(skala_list); if (scaled_base != NULL) DGG_freeConstraint (scaled_base); return rval; } int DGG_generateCutsFromBase( DGG_constraint_t *orig_base, DGG_list_t *cut_list, DGG_data_t *data, const void *solver_ptr ) { int rval = 0; int t; double *x = NULL, *rc = NULL; char *isint = NULL; DGG_constraint_t *base = NULL; bool not_nicefied = true; int new_pos = cut_list->n; // DGG_constraint_t *keep_origbase = DGG_copyConstraint(orig_base); //for debug only ------ if (orig_base->sense == 'L') return 0; if (orig_base->nz == 0) return 0; rval = DGG_transformConstraint(data, &x, &rc, &isint, orig_base); double frac = frac_part(orig_base->rhs); //printf ("frac = %.7f, r %.7f, fr %.7f\n", frac, orig_base->rhs, floor(orig_base->rhs)); if (rval || frac < data->gomory_threshold || frac > 1-data->gomory_threshold){ free (x); free (rc); free (isint); return 0; } int min_t = t_min; int min_q = q_min; if (orig_base->sense == 'G' && min_t < 1) min_t = 1; if (orig_base->sense == 'G' && min_q < 1) min_q = 1; if (min_q > 0 && min_t > 0 ) { not_nicefied = false; rval = DGG_nicefyConstraint(solver_ptr, data, orig_base); DGG_CHECKRVAL(rval, rval); if (orig_base->nz == 0){ if(talk) printf ("2mir_test: Nicefy returns empty constraint\n"); rval = 0; goto CLEANUP; } } for(t = min_t; t <= t_max ; t++){ if (t == 0) continue; base = DGG_copyConstraint(orig_base); DGG_TEST(!base, 1, "error making copy of base"); DGG_scaleConstraint (base, t); if(not_nicefied){ rval = DGG_nicefyConstraint(solver_ptr, data, base); DGG_CHECKRVAL(rval, rval); if (base->nz == 0){ if(talk) printf ("2mir_test: Nicefy returns empty constraint\n"); goto MIR_DONE; } } if ( DGG_isBaseTrivial(data, base) ) goto MIR_DONE; rval = DGG_addMirToList(base, isint, x, cut_list, data, orig_base); DGG_CHECKRVAL(rval, rval); MIR_DONE: DGG_freeConstraint(base); } for( t = min_q; t <= q_max; t++ ){ if (t == 0) continue; base = DGG_copyConstraint(orig_base); DGG_TEST(!base, 1, "error making copy of base"); DGG_scaleConstraint (base, t); if(not_nicefied){ rval = DGG_nicefyConstraint(solver_ptr, data, base); DGG_CHECKRVAL(rval, rval); if (base->nz == 0){ if(talk) printf ("2mir_test: Nicefy returns empty constraint\n"); goto TWOMIR_DONE; } } if ( DGG_isBaseTrivial(data, base) ) goto TWOMIR_DONE; rval = DGG_add2stepToList(base, isint, x, rc, cut_list, data, orig_base); DGG_CHECKRVAL(rval, rval); TWOMIR_DONE: DGG_freeConstraint(base); } int i; for ( i = cut_list->n-1; i>=new_pos; i--){ DGG_constraint_t *lcut = cut_list->c[i]; rval = DGG_unTransformConstraint(data, lcut); DGG_CHECKRVAL(rval, rval); rval = DGG_substituteSlacks(solver_ptr, data, lcut); DGG_CHECKRVAL(rval, rval); if ( !DGG_isCutDesirable(lcut, data) ){ DGG_list_delcut (cut_list, i); continue; } //else testus(lcut);//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /* if ( data->opt_x && DGG_cutsOffPoint(data->opt_x, lcut) ){ //DGG_cutDisplay_sparse(data, data->opt_x, lcut, stdout); DGG_TEST(1,1, "new cut is infeasible for optimal solution\n"); } */ } CLEANUP: if (x) free(x); if (rc) free (rc); if (isint) free(isint); return 0; } int DGG_addMirToList ( DGG_constraint_t *base, char *isint, double * /*x*/, DGG_list_t *list, DGG_data_t * /*data*/, DGG_constraint_t * /*orig_base*/ ) { int rval = 0; DGG_constraint_t *cut = NULL; rval = DGG_buildMir(isint, base, &cut); DGG_CHECKRVAL(rval, rval); DGG_list_addcut(list, cut, DGG_TMIR_CUT, 0.0); return 0; } int DGG_add2stepToList ( DGG_constraint_t *base, char *isint, double * /*x*/, double *rc, DGG_list_t *list, DGG_data_t *data, DGG_constraint_t * /*orig_base*/ ) { int rval; DGG_constraint_t *cut = NULL; int i; double norm_val, best_norm_val, best_norm_alpha=-1.0; double rc_val, best_rc_val, best_rc_alpha=-1.0; double vht, bht, alpha; best_rc_val = best_norm_val = COIN_DBL_MAX; bht = ABOV(base->rhs); double best_rc = 0; for(i=0; inz; i++) if (isint[i]) best_rc = CoinMax(best_rc, fabs(rc[i])); double rc_cutoff = best_rc / 10; for(i=0; inz; i++){ if (!isint[i]) continue; if (fabs(rc[i]) <= rc_cutoff) continue; //too unimportant vht = ABOV(base->coeff[i]); if(vht >= bht) continue; // too big if(vht < bht/a_max) continue; // too small alpha = vht; int kk = 1; while ( !DGG_is2stepValid(alpha, bht) && bht/alpha <= a_max) { alpha = vht/kk; kk++; if (kk>1000) break; } if ( !DGG_is2stepValid(alpha, bht) ) continue; rval = DGG_build2step(alpha, isint, base, &cut); DGG_CHECKRVAL(rval, rval); rc_val = COIN_DBL_MAX; // this gives a lower bound on obj. fn. improvement for(i=0; inz; i++) if(cut->coeff[i]> 1E-6){ rc_val = CoinMin(rc_val, fabs(rc[i])/cut->coeff[i]); } rc_val *= cut->rhs; norm_val = 0; // this is the square of the L2 norm for(i=0; inz; i++) if(cut->coeff[i]> 1E-6){ norm_val += (cut->coeff[i]*cut->coeff[i]); } norm_val /= cut->rhs * cut->rhs; if (rc_val < best_rc_val ) { best_rc_val = rc_val; best_rc_alpha = alpha; } if (norm_val < best_norm_val ) { best_norm_val = norm_val; best_norm_alpha = alpha; } DGG_freeConstraint(cut); } if( best_rc_val> 1E-6 && best_rc_alpha != -1.0){ rval = DGG_build2step(best_rc_alpha, isint, base, &cut); DGG_CHECKRVAL(rval, rval); DGG_list_addcut(list, cut, DGG_2STEP_CUT, best_rc_alpha); } else if (best_norm_alpha != -1.0){ rval = DGG_build2step(best_norm_alpha, isint, base, &cut); DGG_CHECKRVAL(rval, rval); DGG_list_addcut(list, cut, DGG_2STEP_CUT, best_norm_alpha); } return 0; } int DGG_buildMir( char *isint, DGG_constraint_t *base, DGG_constraint_t **cut_out ) { int i, lnz = 0; double b = (base->rhs); double bht = ABOV(b); double bup = ceil(b); DGG_constraint_t *tmir = NULL; DGG_TEST( base->sense == 'L', 1, "this form not valid for L"); DGG_TEST( base->nz == 0, 1, "base must have some coefficients\n"); tmir = DGG_newConstraint( base->nz ); tmir->sense = 'G'; tmir->rhs = bht * bup; for(i=0; inz; i++){ double v = base->coeff[i]; if (!isint[i]) { if (v > 0.0) tmir->coeff[lnz] = v; else tmir->coeff[lnz] = 0.0; } else { double vht = ABOV(v); DGG_IF_EXIT( vht<0, 1, "negative vht"); tmir->coeff[lnz] = bht * floor(v) + DGG_MIN(bht,vht); } tmir->index[lnz] = base->index[i]; lnz += 1; } tmir->nz = lnz; *cut_out = tmir; return 0; } int DGG_build2step( double alpha, char *isint, DGG_constraint_t *base, DGG_constraint_t **cut_out ) { DGG_constraint_t *tmir = 0; int i, lnz = 0; double vht, bht, bup, rho, tau, k; double b = (base->rhs); DGG_TEST( base->sense == 'L', 1, "this form not valid for L"); DGG_TEST( base->nz == 0, 1, "base must have some coefficients\n"); bht = ABOV(b); bup = ceil(b); tau = ceil(bht/alpha); rho = bht - alpha*floor(bht/alpha); /* ensure bht > alpha > 0 */ DGG_TEST3( (bht <= alpha) || (alpha <= 0.0), 1, "bad alpha (%f) / bht (%f) pair", alpha, bht); /* ensure that we are not in a limiting case */ DGG_TEST( DGG_is_a_multiple_of_b(alpha, bht), 1, "can't generate simple 2mir in limiting case"); /* ensure that rho is not zero */ DGG_TEST2( rho < DGG_MIN_RHO, 1, "rho (%f) too small", rho); /* initialize constraint */ tmir = DGG_newConstraint( base->nz ); tmir->rhs = bup*tau*rho; tmir->sense = 'G'; /* compute cut coefficients */ for(i=0; inz; i++){ double v = base->coeff[i]; if (!isint[i]) { if (v > 0.0) tmir->coeff[lnz] = v; else tmir->coeff[lnz] = 0.0; } else { vht = v - floor(v); DGG_IF_EXIT( vht < 0.0, 1, "negative vht"); k = DGG_MIN(tau-1,floor(vht/alpha)); tmir->coeff[lnz] = floor(v)*tau*rho + k*rho + DGG_MIN(rho,vht-k*alpha); } tmir->index[lnz] = base->index[i]; lnz += 1; } tmir->nz = lnz; *cut_out = tmir; return 0; } /******************* TEST / DEBUGGING ROUTINES ********************************/ /* DGG_is2stepValid: checks that: bht > alpha > 0 (1/alpha) >= tau > (bht/alpha) */ int DGG_is2stepValid(double alpha, double bht) { /* d */ double tau; /* ensure that alpha is not null or negative */ if ( alpha < DGG_MIN_ALPHA ) return 0; /* compute tau and tau_lim */ tau = ceil( bht / alpha ); /* make sure alpha is not a divisor of bht */ if ( DGG_is_a_multiple_of_b(alpha, bht) ) return 0; /* page 15, definition 12 */ /* check if alpha is admissible for simple-2-step-tmir */ if ( (bht > alpha) && (alpha > 0.0) ) if ( (1/alpha) >= tau ) return 1; /* not admissible */ return 0; } /* checks that its worth doing a 1MIR on the constraint. More precisely, - Is the RHS null? - Are there any integer variables set at fractional values? */ int DGG_isBaseTrivial(DGG_data_t *d, DGG_constraint_t* c) { /* is rhs sufficiently fractional */ if ( frac_part(ABOV(c->rhs)) < d->gomory_threshold ) return 1; if ( (1.0 - frac_part(ABOV(c->rhs))) < d->gomory_threshold ) return 1; return 0; } /* tests lhs vs rhs of a constraint */ int DGG_isConstraintViolated(DGG_data_t *d, DGG_constraint_t *c) { double lhs = DGG_cutLHS(c, d->x); double rhs = c->rhs; /* compare LHS and RHS */ if (c->sense == 'G') if ( lhs > (rhs - DGG_NULL_SLACK) ) return 0; if (c->sense == 'L') if ( lhs < (rhs + DGG_NULL_SLACK) ) return 0; if (c->sense == 'E') if ( fabs(lhs - rhs) < DGG_NULL_SLACK ) return 0; return 0; } double DGG_cutLHS(DGG_constraint_t *c, double *x) { int i; double lhs = 0.0; for(i=0; i < c->nz; i++) lhs += c->coeff[i]*x[c->index[i]]; return lhs; } int DGG_isCutDesirable(DGG_constraint_t *c, DGG_data_t *d) { double lhs, rhs; lhs = DGG_cutLHS(c, d->x); rhs = c->rhs; if (c->nz > 500) return 0; /* if the cut is not violated, return 0 */ if (c->sense == 'G') if ( lhs > (rhs - DGG_NULL_SLACK) ) return 0; if (c->sense == 'L') if ( lhs < (rhs + DGG_NULL_SLACK) ) return 0; if (c->sense == 'E') if ( fabs(lhs - rhs) < DGG_NULL_SLACK ) return 0; return 1; } /******************** SIMPLE MACROS AND FUNCTIONS *****************************/ int DGG_is_even(double vht, double bht, int tau, int q) { double v2 = V2I(bht, tau, q); if ( vht > v2 ) return 1; return 0; } double frac_part(double value) { return value-floor(value); } int DGG_is_a_multiple_of_b(double a, double b) { double c = b/a; if ( (b - a*floor(c)) < DGG_MIN_RHO ) return 1; return 0; } int DGG_cutsOffPoint(double *x, DGG_constraint_t *cut) { int i; double LHS = 0.0; for(i=0; i < cut->nz; i++) LHS += cut->coeff[i]*(x[ cut->index[i] ]); //fprintf(stdout, "LHS = %f, SENSE = %c, RHS = %f\n", LHS, cut->sense, cut->rhs); if ( cut->sense == 'E' ) if ( fabs(LHS - cut->rhs) > DGG_NULL_SLACK ) goto BAD; if (cut->sense == 'G' ) if ( (cut->rhs - LHS) > DGG_NULL_SLACK ) goto BAD; if (cut->sense == 'L' ) if ( (LHS - cut->rhs) > DGG_NULL_SLACK ) goto BAD; return 0; BAD: fprintf(stdout, "LHS = %f, SENSE = %c, RHS = %f\n", LHS, cut->sense, cut->rhs); DGG_TEST(1, 1, "found a bad cut!"); return 0; } // Returns true if needs optimal basis to do cuts bool CglTwomir::needsOptimalBasis() const { return true; } // Away stuff void CglTwomir::setAway(double value) { if (value>0.0&&value<=0.5) away_=value; } double CglTwomir::getAway() const { return away_; } // Away stuff at root void CglTwomir::setAwayAtRoot(double value) { if (value>0.0&&value<=0.5) awayAtRoot_=value; } double CglTwomir::getAwayAtRoot() const { return awayAtRoot_; } // This can be used to refresh any information void CglTwomir::refreshSolver(OsiSolverInterface * solver) { if (originalSolver_) { delete originalSolver_; originalSolver_ = solver->clone(); } } // Create C++ lines to get to current state std::string CglTwomir::generateCpp( FILE * fp) { CglTwomir other; fprintf(fp,"0#include \"CglTwomir.hpp\"\n"); fprintf(fp,"3 CglTwomir twomir;\n"); if (t_min_!=other.t_min_||t_max_!=other.t_max_) fprintf(fp,"3 twomir.setMirScale(%d,%d);\n",t_min_,t_max_); else fprintf(fp,"4 twomir.setMirScale(%d,%d);\n",t_min_,t_max_); if (q_min_!=other.q_min_||q_max_!=other.q_max_) fprintf(fp,"3 twomir.setTwomirScale(%d,%d);\n",q_min_,q_max_); else fprintf(fp,"4 twomir.setTwomirScale(%d,%d);\n",q_min_,q_max_); if (do_mir_!=other.do_mir_||do_2mir_!=other.do_2mir_|| do_tab_!=other.do_tab_||do_form_!=other.do_form_) fprintf(fp,"3 twomir.setCutTypes(%s,%s,%s,%s);\n", do_mir_ ? "true" : "false", do_2mir_ ? "true" : "false", do_tab_ ? "true" : "false", do_form_ ? "true" : "false"); else fprintf(fp,"4 twomir.setCutTypes(%s,%s,%s,%s);\n", do_mir_ ? "true" : "false", do_2mir_ ? "true" : "false", do_tab_ ? "true" : "false", do_form_ ? "true" : "false"); if (a_max_!=other.a_max_) fprintf(fp,"3 twomir.setAMax(%d);\n",a_max_); else fprintf(fp,"4 twomir.setAMax(%d);\n",a_max_); if (max_elements_!=other.max_elements_) fprintf(fp,"3 twomir.setMaxElements(%d);\n",max_elements_); else fprintf(fp,"4 twomir.setMaxElements(%d);\n",max_elements_); if (max_elements_root_!=other.max_elements_root_) fprintf(fp,"3 twomir.setMaxElementsRoot(%d);\n",max_elements_root_); else fprintf(fp,"4 twomir.setMaxElementsRoot(%d);\n",max_elements_root_); if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 twomir.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 twomir.setAggressiveness(%d);\n",getAggressiveness()); return "twomir"; } Cgl-0.58.9/src/CglTwomir/Makefile.in0000644000076600007660000005406712240340055015552 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@ @COIN_HAS_OSICLP_TRUE@am__append_1 = $(OSICLP_CFLAGS) subdir = src/CglTwomir 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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCglTwomir_la_LIBADD = am_libCglTwomir_la_OBJECTS = CglTwomir.lo CglTwomirTest.lo libCglTwomir_la_OBJECTS = $(am_libCglTwomir_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 = $(libCglTwomir_la_SOURCES) DIST_SOURCES = $(libCglTwomir_la_SOURCES) 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)$(includecoindir)" 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 ######################################################################## # libCglTwomir # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglTwomir.la # List all source files for this library, including headers libCglTwomir_la_SOURCES = CglTwomir.cpp CglTwomir.hpp CglTwomirTest.cpp # This is for libtool (on Windows) libCglTwomir_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)/..` $(COINUTILS_CFLAGS) \ $(OSI_CFLAGS) $(am__append_1) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglTwomir.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/CglTwomir/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/CglTwomir/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-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libCglTwomir.la: $(libCglTwomir_la_OBJECTS) $(libCglTwomir_la_DEPENDENCIES) $(CXXLINK) $(libCglTwomir_la_LDFLAGS) $(libCglTwomir_la_OBJECTS) $(libCglTwomir_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglTwomir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CglTwomirTest.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)$(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-libtool clean-noinstLTLIBRARIES \ 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-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 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-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 # 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: Cgl-0.58.9/src/CglTwomir/CglTwomir.hpp0000644000076600007660000004435512130104734016124 0ustar coincoin// $Id: CglTwomir.hpp 1123 2013-04-06 20:47:24Z stefan $ // 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). #ifndef CglTwomir_H #define CglTwomir_H #include #include "CglCutGenerator.hpp" #include "CoinFactorization.hpp" typedef struct { int nz; /* current length of arrays index[] and coeff[] */ int max_nz; /* max length of arrays index[] and coeff[] */ double *coeff; /* coefficient of each variable in the constraint */ int *index; /* index of the variable (value in 0 ... nrow+ncol) */ double rhs; /* rhs of the constraint */ char sense; /* ?? is it necessary */ } DGG_constraint_t; typedef struct{ int n; DGG_constraint_t **c; int *ctype; double *alpha; } DGG_list_t; /******************** BASIS INFORMATION ADTs **********************************/ typedef struct{ int q_min; int q_max; int t_min; int t_max; int a_max; int max_elements; } cutParams; typedef struct { double gomory_threshold; /* factional variable must be this away from int */ int ncol, /* number of columns in LP */ nrow, /* number of constaints in LP */ ninteger; /* number of integer variables in LP */ int nbasic_col, /* number of basic columns in the LP */ nbasic_row; /* number of basic rows in the LP */ /* the following arrays are all of size (ncol+nrow) */ int *info; /* description of each variable (see below) */ double *lb; /* specifies the lower bound (if any) of each variable */ double *ub; /* specifies the upper bound (if any) of each variable */ double *x; /* current solution */ double *rc; /* current reduced cost */ double *opt_x; cutParams cparams; } DGG_data_t; /* the following macros allow us to decode the info of the DGG_data type. The encoding is as follows, bit 1 : if the variable is basic or not (non-basic). bit 2 : if the variable is integer or or not (rational). bit 3 : if the variable is structural or not (artifical). bit 4 : if the variable is non-basic and at its upper bound (else if non-basic at lower bound). */ #define DGG_isBasic(data,idx) ((data->info[idx])&1) #define DGG_isInteger(data,idx) ((data->info[idx] >> 1)&1) #define DGG_isStructural(data,idx) ((data->info[idx] >> 2)&1) #define DGG_isEqualityConstraint(data,idx) ((data->info[idx] >> 3)&1) #define DGG_isNonBasicAtUB(data,idx) ((data->info[idx] >> 4)&1) #define DGG_isNonBasicAtLB(data,idx) ((data->info[idx] >> 5)&1) #define DGG_isConstraintBoundedAbove(data,idx) ((data->info[idx] >> 6)&1) #define DGG_isConstraintBoundedBelow(data,idx) ((data->info[idx] >> 7)&1) #define DGG_setIsBasic(data,idx) ((data->info[idx]) |= 1) #define DGG_setIsInteger(data,idx) ((data->info[idx]) |= (1<<1)) #define DGG_setIsStructural(data,idx) ((data->info[idx]) |= (1<<2)) #define DGG_setEqualityConstraint(data,idx) ((data->info[idx]) |= (1<<3)) #define DGG_setIsNonBasicAtUB(data,idx) ((data->info[idx]) |= (1<<4)) #define DGG_setIsNonBasicAtLB(data,idx) ((data->info[idx]) |= (1<<5)) #define DGG_setIsConstraintBoundedAbove(data,idx) ((data->info[idx]) |= (1<<6)) #define DGG_setIsConstraintBoundedBelow(data,idx) ((data->info[idx]) |= (1<<7)) class CoinWarmStartBasis; /** Twostep MIR Cut Generator Class */ class CglTwomir : public CglCutGenerator { friend void CglTwomirUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /// Problem name std::string probname_; /**@name Generate Cuts */ //@{ /** Generate Two step MIR cuts either from the tableau rows or from the formulation rows */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /// Return true if needs optimal basis to do cuts (will return true) virtual bool needsOptimalBasis() const; /**@name Change criterion on which scalings to use (default = 1,1,1,1) */ //@{ /// Set void setMirScale (int tmin, int tmax) {t_min_ = tmin; t_max_ = tmax;} void setTwomirScale (int qmin, int qmax) {q_min_ = qmin; q_max_ = qmax;} void setAMax (int a) {a_max_ = a;} void setMaxElements (int n) {max_elements_ = n;} void setMaxElementsRoot (int n) {max_elements_root_ = n;} void setCutTypes (bool mir, bool twomir, bool tab, bool form) { do_mir_ = mir; do_2mir_ = twomir; do_tab_ = tab; do_form_ = form;} void setFormulationRows (int n) {form_nrows_ = n;} /// Get int getTmin() const {return t_min_;} int getTmax() const {return t_max_;} int getQmin() const {return q_min_;} int getQmax() const {return q_max_;} int getAmax() const {return a_max_;} int getMaxElements() const {return max_elements_;} int getMaxElementsRoot() const {return max_elements_root_;} int getIfMir() const { return do_mir_;} int getIfTwomir() const { return do_2mir_;} int getIfTableau() const { return do_tab_;} int getIfFormulation() const { return do_form_;} //@} /**@name Change criterion on which variables to look at. All ones more than "away" away from integrality will be investigated (default 0.05) */ //@{ /// Set away void setAway(double value); /// Get away double getAway() const; /// Set away at root void setAwayAtRoot(double value); /// Get away at root double getAwayAtRoot() const; /// Return maximum length of cut in tree virtual int maximumLengthOfCutInTree() const { return max_elements_;} //@} /**@name Change way TwoMir works */ //@{ /// Pass in a copy of original solver (clone it) void passInOriginalSolver(OsiSolverInterface * solver); /// Returns original solver inline OsiSolverInterface * originalSolver() const { return originalSolver_;} /// Set type - 0 normal, 1 add original matrix one, 2 replace inline void setTwomirType(int type) { twomirType_=type;} /// Return type inline int twomirType() const { return twomirType_;} //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglTwomir (); /// Copy constructor CglTwomir (const CglTwomir &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglTwomir & operator=(const CglTwomir& rhs); /// Destructor virtual ~CglTwomir (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); /// This can be used to refresh any inforamtion virtual void refreshSolver(OsiSolverInterface * solver); //@} private: // Private member data /**@name Private member data */ //@{ /// Threadsafe random number generator CoinThreadRandom randomNumberGenerator_; /// Original solver OsiSolverInterface * originalSolver_; /// Only investigate if more than this away from integrality double away_; /// Only investigate if more than this away from integrality (at root) double awayAtRoot_; /// Type - 0 normal, 1 add original matrix one, 2 replace int twomirType_; bool do_mir_; bool do_2mir_; bool do_tab_; bool do_form_; int t_min_; /// t_min - first value of t to use for tMIR inequalities int t_max_; /// t_max - last value of t to use for tMIR inequalities int q_min_; /// q_min - first value of t to use for 2-Step tMIR inequalities int q_max_; /// q_max - last value of t to use for 2-Step tMIR inequalities int a_max_; /// a_max - maximum value of bhat/alpha int max_elements_; /// Maximum number of elements in cut int max_elements_root_; /// Maximum number of elements in cut at root int form_nrows_; //number of rows on which formulation cuts will be generated //@} }; //############################################################################# /* #include #include #include #include #include #include #include */ /******************** DEBUG DEFINITIONS ***************************************/ #define DGG_DEBUG_DGG 1 #define DGG_TRACE_ERRORS 0 #define DGG_DISPLAY 0 #define DGG_AUTO_CHECK_CUT_OFF_OPTIMAL 1 /******************** CONFIGURATION DEFAULTS **********************************/ #define DGG_DEFAULT_METHOD 2 #define DGG_DEFAULT_TMIN 1 #define DGG_DEFAULT_TMAX 1 #define DGG_DEFAULT_TAUMIN 2 #define DGG_DEFAULT_TAUMAX 6 #define DGG_DEFAULT_MAX_CUTS 500 #define DGG_DEFAULT_IMPROVEMENT_THRESH 0.001 #define DGG_DEFAULT_NBELOW_THRESH INT_MAX #define DGG_DEFAULT_NROOT_ROUNDS 2 #define DGG_DEFAULT_NEGATIVE_SCALED_TWOSTEPS 0 #define DGG_DEFAULT_ALPHA_RULE 0 #define DGG_DEFAULT_CUT_INC 250 #define DGG_DEFAULT_CUT_FORM 0 #define DGG_DEFAULT_NICEFY 0 #define DGG_DEFAULT_ONLY_DELAYED 0 #define DGG_DEFAULT_DELAYED_FREQ 9999999 #define DGG_DEFAULT_LPROWS_FREQ 9999999 #define DGG_DEFAULT_WHICH_FORMULATION_CUTS 2 /******************** SOLVER CONFIGURATION DEFINITIONS ************************/ #define DGG_OSI 0 #define DGG_CPX 1 #define DGG_QSO 2 /* determines the solver to be used */ #define DGG_SOLVER DGG_OSI /* adds checking routines to make sure solver works as expected */ #define DGG_DEBUG_SOLVER 0 /* turn off screen output from solver */ #define DGG_SOLVER_SCREEN_FLAG 0 /******************** CUT DEFINITIONS *****************************************/ /* internal names for cut types */ #define DGG_TMIR_CUT 1 #define DGG_2STEP_CUT 2 /* internal names for alpha-selection rules */ #define DGG_ALPHA_MIN_SUM 0 #define DGG_ALPHA_RANDOM_01 1 #define DGG_ALPHA_RANDOM_COEFF 2 #define DGG_ALPHA_ALL 3 #define DGG_ALPHA_MAX_STEEP 5 /******************** PRECISION & NUMERICAL ISSUES DEFINITIONS ****************/ /* how steep a cut must be before adding it to the lp */ #define DGG_MIN_STEEPNESS 1.0e-4 #define DGG_MAX_L2NORM 1.0e7 /* 0 = min steepness, 1 = max norm */ #define DGG_NORM_CRITERIA 1 /* internal representation of +infinity */ #define UB_MAX DBL_MAX /* used to define how fractional a basic-integer variable must be before choosing to use it to generate a TMIR cut on. OSI's default is 1.0e-7 */ #define DGG_GOMORY_THRESH 0.005 #define DGG_RHS_THRESH 0.005 /* used for comparing variables to their upper bounds. OSI's default is 1.0e-7. We set it to 1.0e6 because e-7 seems too sensitive. In fact, with e-7 the problem dsbmip.mps complains. */ #define DGG_BOUND_THRESH 1.0e-6 /* used for comparing the lhs (activity) value of a tableau row with the rhs. This is only used for debugging purposes. */ #define DGG_EQUALITY_THRESH 1.0e-5 /* used for comparing a variable's lower bound to 0.0 and determining if we need to shift the variable */ #define DGG_SHIFT_THRESH 1.0e-6 /* used for determing how far from an integer is still an integer. This value is used for comparing coefficients to integers. OSI's default is 1.0e-10. */ #define DGG_INTEGRALITY_THRESH 1.0e-10 /* the min value that a coeff can have in the tableau row before being set to zero. */ #define CBC_CHECK_CUT #ifndef CBC_CHECK_CUT #define DGG_MIN_TABLEAU_COEFFICIENT 1.0e-8 #else #define DGG_MIN_TABLEAU_COEFFICIENT 1.0e-12 #endif /* smallest value rho is allowed to have for a simple 2-step MIR (ie: not an extended two-step MIR) */ #define DGG_MIN_RHO 1.0e-7 #define DGG_MIN_ALPHA 1.0e-7 /* when a slack is null: used to check if a cut is satisfied or not. */ #define DGG_NULL_SLACK 1.0e-5 /* nicefy constants */ #define DGG_NICEFY_MIN_ABSVALUE 1.0e-13 #define DGG_NICEFY_MIN_FIX 1.0e-7 #define DGG_NICEFY_MAX_PADDING 1.0e-6 #define DGG_NICEFY_MAX_RATIO 1.0e9 /******************** ERROR-CATCHING MACROS ***********************************/ #if DGG_TRACE_ERRORS > 0 #define __DGG_PRINT_LOC__(F) fprintf(((F==0)?stdout:F), " in %s (%s:%d)\n", __func__, __FILE__, __LINE__) #define DGG_THROW(A,REST...) {\ fprintf(stdout, ##REST); \ __DGG_PRINT_LOC__(stdout); \ return (A);} #define DGG_IF_EXIT(A,B,REST...) {\ if(A) {\ fprintf(stdout, ##REST); \ __DGG_PRINT_LOC__(stdout); \ exit(B);}} #define DGG_CHECKRVAL(A,B) {\ if(A) {\ __DGG_PRINT_LOC__(stdout); \ return B; } } #define DGG_CHECKRVAL1(A,B) {\ if(A) {\ __DGG_PRINT_LOC__(stdout); \ rval = B; goto CLEANUP; } } #define DGG_WARNING(A, REST...) {\ if(A) {\ fprintf(stdout, ##REST); \ __DGG_PRINT_LOC__(stdout); \ }} #define DGG_TEST(A,B,REST...) {\ if(A) DGG_THROW(B,##REST) } #define DGG_TEST2(A,B,C,REST) {DGG_TEST(A,B,C,REST) } #define DGG_TEST3(A,B,C,D,REST) {DGG_TEST(A,B,C,D,REST) } #else #define DGG_IF_EXIT(A,B,REST) {if(A) {fprintf(stdout, REST);exit(B);}} #define DGG_THROW(A,B) return(A) #define DGG_CHECKRVAL(A,B) { if(A) return(B); } #define DGG_CHECKRVAL1(A,B){ if(A) { rval = B; goto CLEANUP; } } #define DGG_TEST(A,B,REST) { if(A) return(B);} #define DGG_TEST2(A,B,REST,C) { DGG_TEST(A,B,REST) } #define DGG_TEST3(A,B,REST,C,D) { DGG_TEST(A,B,REST) } #endif /******************** SIMPLE MACROS AND FUNCTIONS *****************************/ #define DGG_MIN(a,b) ( (ab)?a:b ) #define KREM(vht,alpha,tau) (DGG_MIN( ceil(vht / alpha), tau ) - 1) #define LMIN(vht, d, bht) (DGG_MIN( floor(d*bht/bht), d)) #define ABOV(v) (v - floor(v)) #define QINT(vht,bht,tau) ( (int)floor( (vht*(tau-1))/bht ) ) #define V2I(bht,tau,i) ( ((i+1)*bht / tau) ) int DGG_is_even(double vht, double bht, int tau, int q); double frac_part(double value); int DGG_is_a_multiple_of_b(double a, double b); /* free function for DGG_data_t. Frees internal arrays and data structure */ int DGG_freeData( DGG_data_t *data ); /******************** CONSTRAINT ADTs *****************************************/ DGG_constraint_t* DGG_newConstraint(int max_arrays); void DGG_freeConstraint(DGG_constraint_t *c); DGG_constraint_t *DGG_copyConstraint(DGG_constraint_t *c); void DGG_scaleConstraint(DGG_constraint_t *c, int t); /******************** CONFIGURATION *******************************************/ void DGG_list_init (DGG_list_t *l); int DGG_list_addcut (DGG_list_t *l, DGG_constraint_t *cut, int ctype, double alpha); void DGG_list_delcut (DGG_list_t *l, int i); void DGG_list_free(DGG_list_t *l); /******************* SOLVER SPECIFIC METHODS **********************************/ DGG_data_t *DGG_getData(const void *solver_ptr); /******************* CONSTRAINT MANIPULATION **********************************/ /* DGG_transformConstraint: manipulates a constraint in the following way: packs everything in output 1 - variables at their upper bounds are substituted for their complements. This is done by adjusting the coefficients and the right hand side (simple substitution). 2 - variables with non-zero lower bounds are shifted. */ int DGG_transformConstraint( DGG_data_t *data, double **x_out, double **rc_out, char **isint_out, DGG_constraint_t *constraint ); /* DGG_unTransformConstraint : 1 - Undoes step (1) of DGG_transformConstraint 2 - Undoes step (2) of DGG_transformConstraint */ int DGG_unTransformConstraint( DGG_data_t *data, DGG_constraint_t *constraint ); /* substitutes each slack variable by the structural variables which define it. This function, hence, changes the constraint 'cut'. */ int DGG_substituteSlacks( const void *solver_ptr, DGG_data_t *data, DGG_constraint_t *cut ); int DGG_nicefyConstraint( const void *solver_ptr, DGG_data_t *data, DGG_constraint_t *cut); /******************* CUT GENERATION *******************************************/ int DGG_getFormulaConstraint( int row_idx, const void *solver_ptr, DGG_data_t *data, DGG_constraint_t* row ); int DGG_getTableauConstraint( int index, const void *solver_ptr, DGG_data_t *data, DGG_constraint_t* tabrow, const int * colIsBasic, const int * rowIsBasic, CoinFactorization & factorization, int mode ); DGG_constraint_t* DGG_getSlackExpression(const void *solver_ptr, DGG_data_t* data, int row_index); int DGG_generateTabRowCuts( DGG_list_t *list, DGG_data_t *data, const void *solver_ptr ); int DGG_generateFormulationCuts( DGG_list_t *list, DGG_data_t *data, const void *solver_ptr, int nrows, CoinThreadRandom & generator); int DGG_generateFormulationCutsFromBase( DGG_constraint_t *base, double slack, DGG_list_t *list, DGG_data_t *data, const void *solver_ptr, CoinThreadRandom & generator); int DGG_generateCutsFromBase( DGG_constraint_t *base, DGG_list_t *list, DGG_data_t *data, const void *solver_ptr ); int DGG_buildMir( char *isint, DGG_constraint_t *base, DGG_constraint_t **cut_out ); int DGG_build2step( double alpha, char *isint, DGG_constraint_t *base, DGG_constraint_t **cut_out ); int DGG_addMirToList ( DGG_constraint_t *base, char *isint, double *x, DGG_list_t *list, DGG_data_t *data, DGG_constraint_t *orig_base ); int DGG_add2stepToList ( DGG_constraint_t *base, char *isint, double *x, double *rc, DGG_list_t *list, DGG_data_t *data, DGG_constraint_t *orig_base ); /******************* CUT INFORMATION ******************************************/ double DGG_cutLHS(DGG_constraint_t *c, double *x); int DGG_isCutDesirable(DGG_constraint_t *c, DGG_data_t *d); /******************* TEST / DEBUGGING ROUTINES ********************************/ int DGG_isConstraintViolated(DGG_data_t *d, DGG_constraint_t *c); int DGG_isBaseTrivial(DGG_data_t *d, DGG_constraint_t* c); int DGG_is2stepValid(double alpha, double bht); int DGG_cutsOffPoint(double *x, DGG_constraint_t *cut); //############################################################################# /** A function that tests the methods in the CglTwomir class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglTwomirUnitTest(const OsiSolverInterface * siP, const std::string mpdDir); #endif Cgl-0.58.9/src/config_cgl_default.h0000644000076600007660000000110512377505651015546 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 CGL_VERSION "0.58.9" /* Major Version number of project */ #define CGL_VERSION_MAJOR 0 /* Minor Version number of project */ #define CGL_VERSION_MINOR 58 /* Release Version number of project */ #define CGL_VERSION_RELEASE 9 Cgl-0.58.9/src/config.h.in0000644000076600007660000000613612130104734013613 0ustar coincoin/* src/config.h.in. Generated from configure.ac by autoheader. */ /* SVN revision number of project */ #undef CGL_SVN_REV /* Version number of project */ #undef CGL_VERSION /* Major Version number of project */ #undef CGL_VERSION_MAJOR /* Minor Version number of project */ #undef CGL_VERSION_MINOR /* Release Version number of project */ #undef CGL_VERSION_RELEASE /* Define to the debug sanity check level (0 is no test) */ #undef COIN_CGL_CHECKLEVEL /* Define to the debug verbosity level (0 is no output) */ #undef COIN_CGL_VERBOSITY /* Define to 1 if the CoinUtils package is available */ #undef COIN_HAS_COINUTILS /* Define to 1 if the Osi package is available */ #undef COIN_HAS_OSI /* Define to 1 if the OsiClp package is available */ #undef COIN_HAS_OSICLP /* Define to 1 if the OsiCpx package is available */ #undef COIN_HAS_OSICPX /* Define to 1 if the OsiDyLP package is available */ #undef COIN_HAS_OSIDYLP /* Define to 1 if the OsiGlpk package is available */ #undef COIN_HAS_OSIGLPK /* Define to 1 if the OsiMsk package is available */ #undef COIN_HAS_OSIMSK /* Define to 1 if the OsiVol package is available */ #undef COIN_HAS_OSIVOL /* Define to 1 if the OsiXpr package is available */ #undef COIN_HAS_OSIXPR /* Define to 1 if the Sample package is available */ #undef COIN_HAS_SAMPLE /* 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 /* 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 Cgl-0.58.9/src/CglMessage.hpp0000644000076600007660000000174112130021364014305 0ustar coincoin// $Id: CglMessage.hpp 1113 2013-04-06 13:28:20Z stefan $ // 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 CglMessage_H #define CglMessage_H #include "CoinPragma.hpp" // This deals with Cgl messages (as against Osi messages etc) #include "CoinMessageHandler.hpp" enum CGL_Message { CGL_INFEASIBLE, CGL_CLIQUES, CGL_FIXED, CGL_PROCESS_STATS, CGL_SLACKS, CGL_PROCESS_STATS2, CGL_PROCESS_SOS1, CGL_PROCESS_SOS2, CGL_UNBOUNDED, CGL_ELEMENTS_CHANGED1, CGL_ELEMENTS_CHANGED2, CGL_MADE_INTEGER, CGL_ADDED_INTEGERS, CGL_POST_INFEASIBLE, CGL_POST_CHANGED, CGL_GENERAL, CGL_DUMMY_END }; /** This deals with Cgl messages (as against Osi messages etc) */ class CglMessage : public CoinMessages { public: /**@name Constructors etc */ //@{ /** Constructor */ CglMessage(Language language=us_en); //@} }; #endif Cgl-0.58.9/src/CglKnapsackCover/0000755000076600007660000000000012377555671014771 5ustar coincoinCgl-0.58.9/src/CglKnapsackCover/Makefile.am0000644000076600007660000000325711621724114017011 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 1040 2011-08-14 10:49:48Z stefan $ # Author: Andreas Waechter IBM 2006-04-13 AUTOMAKE_OPTIONS = foreign ######################################################################## # libCglKnapsackCover # ######################################################################## # Name of the library compiled in this directory. We don't want it to be # installed since it will be collected into the libCgl library noinst_LTLIBRARIES = libCglKnapsackCover.la # List all source files for this library, including headers libCglKnapsackCover_la_SOURCES = CglKnapsackCover.cpp CglKnapsackCover.hpp CglKnapsackCoverTest.cpp # This is for libtool (on Windows) libCglKnapsackCover_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)/..` $(COINUTILS_CFLAGS) $(OSI_CFLAGS) # This line is necessary to allow VPATH compilation DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I.. ######################################################################## # 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 = CglKnapsackCover.hpp Cgl-0.58.9/src/CglKnapsackCover/CglKnapsackCoverTest.cpp0000644000076600007660000006361012130104734021474 0ustar coincoin// $Id: CglKnapsackCoverTest.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 #ifdef NDEBUG #undef NDEBUG #endif #include #include "CoinPragma.hpp" #include "CglKnapsackCover.hpp" #include "CoinPackedMatrix.hpp" //-------------------------------------------------------------------------- void CglKnapsackCoverUnitTest( const OsiSolverInterface * baseSiP, const std::string mpsDir ) { int i; CoinRelFltEq eq(0.000001); // Test default constructor { CglKnapsackCover kccGenerator; } // Test copy & assignment { CglKnapsackCover rhs; { CglKnapsackCover kccGenerator; CglKnapsackCover cgC(kccGenerator); rhs=kccGenerator; } } // test exactSolveKnapsack { CglKnapsackCover kccg; const int n=7; double c=50; double p[n] = {70,20,39,37,7,5,10}; double w[n] = {31, 10, 20, 19, 4, 3, 6}; double z; int x[n]; int exactsol = kccg.exactSolveKnapsack(n, c, p, w, z, x); assert(exactsol==1); assert (z == 107); assert (x[0]==1); assert (x[1]==0); assert (x[2]==0); assert (x[3]==1); assert (x[4]==0); assert (x[5]==0); assert (x[6]==0); } /* // Testcase /u/rlh/osl2/mps/scOneInt.mps // Model has 3 continous, 2 binary, and 1 general // integer variable. { OsiSolverInterface * siP = baseSiP->clone(); int * complement=NULL; double * xstar=NULL; siP->readMps("../Mps/scOneInt","mps"); CglKnapsackCover kccg; int nCols=siP->getNumCols(); // Test the siP methods for detecting // variable type int numCont=0, numBinary=0, numIntNonBinary=0, numInt=0; for (int thisCol=0; thisColisContinuous(thisCol) ) numCont++; if ( siP->isBinary(thisCol) ) numBinary++; if ( siP->isIntegerNonBinary(thisCol) ) numIntNonBinary++; if ( siP->isInteger(thisCol) ) numInt++; } assert(numCont==3); assert(numBinary==2); assert(numIntNonBinary==1); assert(numInt==3); // Test initializeCutGenerator siP->initialSolve(); assert(xstar !=NULL); for (i=0; igetNumRows(); for (i=0; igetMatrixByRow()->vectorSize(i); assert(vectorsize==2); } kccg.cleanUpCutGenerator(complement,xstar); delete siP; } */ // Testcase /u/rlh/osl2/mps/tp3.mps // Models has 3 cols, 3 rows // Row 0 yields a knapsack, others do not. { // setup OsiSolverInterface * siP = baseSiP->clone(); std::string fn(mpsDir+"tp3"); siP->readMps(fn.c_str(),"mps"); // All integer variables should be binary. // Assert that this is true. for ( i = 0; i < siP->getNumCols(); i++ ) if ( siP->isInteger(i) ) assert(siP->getColUpper()[i]==1.0 && siP->isBinary(i)); OsiCuts cs; CoinPackedVector krow; double b=0; int nCols=siP->getNumCols(); int * complement=new int [nCols]; double * xstar=new double [nCols]; CglKnapsackCover kccg; // solve LP relaxation // a "must" before calling initialization siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); std::cout<<"Initial LP value: "<getObjValue(), 97.185) ); double mycs[] = {.627, .667558333333, .038}; siP->setColSolution(mycs); const double *colsol = siP->getColSolution(); int k; for (k=0; kgetRowSense()[0] == 'N' ) ? 1 : 0; const CoinShallowPackedVector reqdBySunCC = siP->getMatrixByRow()->getVector(rind) ; int deriveaknap = kccg.deriveAKnapsack(*siP, cs, krow,b,complement,xstar,rind,reqdBySunCC); assert(deriveaknap ==1); assert(complement[0]==0); assert(complement[1]==1); assert(complement[2]==1); int inx[3] = {0,1,2}; double el[3] = {161, 120, 68}; CoinPackedVector r; r.setVector(3,inx,el); assert (krow == r); //assert (b == 183.0); ????? but x1 and x2 at 1 is valid // test findGreedyCover CoinPackedVector cover,remainder; #if 0 int findgreedy = kccg.findGreedyCover( 0, krow, b, xstar, cover, remainder ); assert( findgreedy == 1 ); int coveri = cover.getNumElements(); assert( cover.getNumElements() == 2); coveri = cover.getIndices()[0]; assert( cover.getIndices()[0] == 0); assert( cover.getIndices()[1] == 1); assert( cover.getElements()[0] == 161.0); assert( cover.getElements()[1] == 120.0); assert( remainder.getNumElements() == 1); assert( remainder.getIndices()[0] == 2); assert( remainder.getElements()[0] == 68.0); // test liftCoverCut CoinPackedVector cut; double * rowupper = ekk_rowupper(model); double cutRhs = cover.getNumElements() - 1.0; kccg.liftCoverCut(b, krow.getNumElements(), cover, remainder, cut); assert ( cut.getNumElements() == 3 ); assert ( cut.getIndices()[0] == 0 ); assert ( cut.getIndices()[1] == 1 ); assert ( cut.getIndices()[2] == 2 ); assert( cut.getElements()[0] == 1 ); assert( cut.getElements()[1] == 1 ); assert( eq(cut.getElements()[2], 0.087719) ); // test liftAndUncomplementAndAdd OsiCuts cuts; kccg.liftAndUncomplementAndAdd(*siP.getRowUpper()[0],krow,b,complement,0, cover,remainder,cuts); int sizerowcuts = cuts.sizeRowCuts(); assert ( sizerowcuts== 1 ); OsiRowCut testRowCut = cuts.rowCut(0); CoinPackedVector testRowPV = testRowCut.row(); OsiRowCut sampleRowCut; const int sampleSize = 3; int sampleCols[sampleSize]={0,1,2}; double sampleElems[sampleSize]={1.0,-1.0,-0.087719}; sampleRowCut.setRow(sampleSize,sampleCols,sampleElems); sampleRowCut.setLb(-DBL_MAX); sampleRowCut.setUb(-0.087719); bool equiv = testRowPV.equivalent(sampleRowCut.row(),CoinRelFltEq(1.0e-05) ); assert ( equiv ); #endif // test find PseudoJohnAndEllisCover cover.setVector(0,NULL, NULL); remainder.setVector(0,NULL,NULL); rind = ( siP->getRowSense()[0] == 'N' ) ? 1 : 0; int findPJE = kccg.findPseudoJohnAndEllisCover( rind, krow, b, xstar, cover, remainder ); assert( findPJE == 1 ); assert ( cover.getIndices()[0] == 0 ); assert ( cover.getIndices()[1] == 2 ); assert ( cover.getElements()[0] == 161 ); assert ( cover.getElements()[1] == 68 ); assert ( remainder.getIndices()[0] == 1 ); assert ( remainder.getElements()[0] == 120 ); OsiCuts cuts; kccg.liftAndUncomplementAndAdd((*siP).getRowUpper()[rind],krow,b, complement, rind, cover,remainder,cuts); assert (cuts.sizeRowCuts() == 1 ); OsiRowCut testRowCut = cuts.rowCut(0); CoinPackedVector testRowPV = testRowCut.row(); const int sampleSize = 3; int sampleCols[sampleSize]={0,1,2}; double sampleElems[sampleSize]={1.0, -1.0, -1.0}; OsiRowCut sampleRowCut; sampleRowCut.setRow(sampleSize,sampleCols,sampleElems); sampleRowCut.setLb(-COIN_DBL_MAX); sampleRowCut.setUb(-1.0); // test for 'close enough' assert( testRowPV.isEquivalent(sampleRowCut.row(),CoinRelFltEq(1.0e-05) ) ); // Reset complement & test next row for (i=0; igetMatrixByRow()->getVector(rind) ; deriveaknap = kccg.deriveAKnapsack(*siP,cuts,krow,b,complement,xstar,rind,reqdBySunCC2); assert(deriveaknap==0); // Reset complement & test next row for (i=0; igetMatrixByRow()->getVector(2) ; deriveaknap = kccg.deriveAKnapsack(*siP,cuts,krow,b,complement,xstar,2, reqdBySunCC3); assert(deriveaknap == 0); // Clean up delete [] complement; delete [] xstar; delete siP; } #if 0 // Testcase /u/rlh/osl2/mps/tp4.mps // Models has 6 cols, 1 knapsack row and // 3 rows explicily bounding variables // Row 0 yields a knapsack cover cut // using findGreedyCover which moves the // LP objective function value. { // Setup EKKContext * env=ekk_initializeContext(); EKKModel * model = ekk_newModel(env,""); OsiSolverInterface si(model); ekk_importModel(model, "tp4.mps"); CglKnapsackCover kccg; kccg.ekk_validateIntType(si); // Solve the LP relaxation of the model and // print out ofv for sake of comparison ekk_allSlackBasis(model); ekk_crash(model,1); ekk_primalSimplex(model,1); double lpRelaxBefore=ekk_getRobjvalue(model); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif // Determine if lp sol is ip optimal // Note: no ekk_function to do this int nCols=ekk_getInumcols(model); double * optLpSol = ekk_colsol(model); int ipOpt = 1; i=0; while (i++ 1.0e-08) ipOpt = 0; } if (ipOpt){ #ifdef CGL_DEBUG printf("Lp solution is within ip optimality tolerance\n"); #endif } else { OsiSolverInterface iModel(model); OsiCuts cuts; // Test generateCuts method kccg.generateCuts(iModel,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = iModel.applyCuts(cuts); ekk_mergeBlocks(model,1); ekk_dualSimplex(model); double lpRelaxAfter=ekk_getRobjvalue(model); #ifdef CGL_DEBUG printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); // This may need to be updated as other // minimal cover finders are added assert( cuts.sizeRowCuts() == 1 ); OsiRowCut testRowCut = cuts.rowCut(0); CoinPackedVector testRowPV = testRowCut.row(); OsiRowCut sampleRowCut; const int sampleSize = 6; int sampleCols[sampleSize]={0,1,2,3,4,5}; double sampleElems[sampleSize]={1.0,1.0,1.0,1.0,0.5, 2.0}; sampleRowCut.setRow(sampleSize,sampleCols,sampleElems); sampleRowCut.setLb(-DBL_MAX); sampleRowCut.setUb(3.0); bool equiv = testRowPV.equivalent(sampleRowCut.row(),CoinRelFltEq(1.0e-05) ); assert( testRowPV.equivalent(sampleRowCut.row(),CoinRelFltEq(1.0e-05) ) ); } // Exit out of OSL ekk_deleteModel(model); ekk_endContext(env); } #endif // Testcase /u/rlh/osl2/mps/tp5.mps // Models has 6 cols, 1 knapsack row and // 3 rows explicily bounding variables // Row 0 yields a knapsack cover cut // using findGreedyCover which moves the // LP objective function value. { // Setup OsiSolverInterface * siP = baseSiP->clone(); std::string fn(mpsDir+"tp5"); siP->readMps(fn.c_str(),"mps"); // All integer variables should be binary. // Assert that this is true. for ( i = 0; i < siP->getNumCols(); i++ ) if ( siP->isInteger(i) ) assert(siP->getColUpper()[i]==1.0 && siP->isBinary(i)); CglKnapsackCover kccg; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, -51.66666666667) ); double mycs[] = {.8999999999, .899999999999, .89999999999, 1.110223e-16, .5166666666667, 0}; siP->setColSolution(mycs); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif // Determine if lp sol is 0/1 optimal int nCols=siP->getNumCols(); const double * optLpSol = siP->getColSolution(); bool ipOpt = true; i=0; while (i++ kccg.epsilon_ && optLpSol[i] < kccg.onetol_) ipOpt = false; } if (ipOpt){ #ifdef CGL_DEBUG printf("Lp solution is within ip optimality tolerance\n"); #endif } else { // set up OsiCuts cuts; CoinPackedVector krow; double b=0.0; int * complement=new int[nCols]; double * xstar=new double[nCols]; // initialize cut generator const double *colsol = siP->getColSolution(); for (i=0; igetRowSense()[0] == 'N' ) ? 1 : 0; // transform row into canonical knapsack form const CoinShallowPackedVector reqdBySunCC = siP->getMatrixByRow()->getVector(row) ; if (kccg.deriveAKnapsack(*siP, cuts, krow, b, complement, xstar, row,reqdBySunCC)){ CoinPackedVector cover, remainder; // apply greedy logic to detect violated minimal cover inequalities if (kccg.findGreedyCover(row, krow, b, xstar, cover, remainder) == 1){ // lift, uncomplements, and add cut to cut set kccg.liftAndUncomplementAndAdd((*siP).getRowUpper()[row],krow, b, complement, row, cover, remainder, cuts); } // reset optimal column solution (xstar) information in OSL const double * rowupper = siP->getRowUpper(); int k; if (fabs(b-rowupper[row]) > 1.0e-05) { for(k=0; kapplyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); assert( eq(lpRelaxAfter, -30.0) ); #ifdef CGL_DEBUG printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif // test that expected cut was detected assert( lpRelaxBefore < lpRelaxAfter ); assert( cuts.sizeRowCuts() == 1 ); OsiRowCut testRowCut = cuts.rowCut(0); CoinPackedVector testRowPV = testRowCut.row(); OsiRowCut sampleRowCut; const int sampleSize = 6; int sampleCols[sampleSize]={0,1,2,3,4,5}; double sampleElems[sampleSize]={1.0,1.0,1.0,0.25,1.0,2.0}; sampleRowCut.setRow(sampleSize,sampleCols,sampleElems); sampleRowCut.setLb(-COIN_DBL_MAX); sampleRowCut.setUb(3.0); assert(testRowPV.isEquivalent(sampleRowCut.row(),CoinRelFltEq(1.0e-05))); } delete siP; } // Testcase /u/rlh/osl2/mps/p0033 // Miplib3 problem p0033 // Test that no cuts chop off the optimal solution { // Setup OsiSolverInterface * siP = baseSiP->clone(); std::string fn(mpsDir+"p0033"); siP->readMps(fn.c_str(),"mps"); // All integer variables should be binary. // Assert that this is true. for ( i = 0; i < siP->getNumCols(); i++ ) if ( siP->isInteger(i) ) assert(siP->getColUpper()[i]==1.0 && siP->isBinary(i)); int nCols=siP->getNumCols(); CglKnapsackCover kccg; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, 2520.5717391304347) ); double mycs[] = {0, 1, 0, 0, -2.0837010502455788e-19, 1, 0, 0, 1, 0.021739130434782594, 0.35652173913043478, -6.7220534694101275e-18, 5.3125906451789717e-18, 1, 0, 1.9298798670241979e-17, 0, 0, 0, 7.8875708048320448e-18, 0.5, 0, 0.85999999999999999, 1, 1, 0.57999999999999996, 1, 0, 1, 0, 0.25, 0, 0.67500000000000004}; siP->setColSolution(mycs); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif OsiCuts cuts; // Test generateCuts method kccg.generateCuts(*siP,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); assert( eq(lpRelaxAfter, 2829.0597826086955) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); // the CoinPackedVector p0033 is the optimal // IP solution to the miplib problem p0033 int objIndices[14] = { 0, 6, 7, 9, 13, 17, 18, 22, 24, 25, 26, 27, 28, 29 }; CoinPackedVector p0033(14,objIndices,1.0); // Sanity check const double * objective=siP->getObjCoefficients(); double ofv =0 ; int r; for (r=0; rclone(); double lo=-1.0e30; double * upper = new double[ncol]; start[ncol]=nel; int last=0; for (i=0;iloadProblem(ncol,1,start,row,el1,NULL,upper,NULL,&lo,&up); // use upper for solution memset(upper,0,ncol*sizeof(double)); for (i=0;isetInteger(icol); } siP->setColSolution(upper); delete [] sol1; delete [] el1; delete [] col1; delete [] start; delete [] row; delete [] upper; CglKnapsackCover kccg; OsiCuts cuts; // Test generateCuts method kccg.generateCuts(*siP,cuts); // print out and compare to known cuts int numberCuts = cuts.sizeRowCuts(); if (numberCuts) { for (i=0;irow().getNumElements(); printf("Cut %d has %d entries, rhs %g %g =>",i,n,thisCut->lb(), thisCut->ub()); int j; const int * index = thisCut->row().getIndices(); const double * element = thisCut->row().getElements(); for (j=0;jclone(); std::string fn(mpsDir+"p0201"); siP->readMps(fn.c_str(),"mps"); // All integer variables should be binary. // Assert that this is true. for ( i = 0; i < siP->getNumCols(); i++ ) if ( siP->isInteger(i) ) assert(siP->getColUpper()[i]==1.0 && siP->isBinary(i)); const int nCols=siP->getNumCols(); CglKnapsackCover kccg; // Solve the LP relaxation of the model and // print out ofv for sake of comparisn siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, 6875.) ); double mycs[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; siP->setColSolution(mycs); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); #endif OsiCuts cuts; // Test generateCuts method kccg.generateCuts(*siP,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); assert( eq(lpRelaxAfter, 7125) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore < lpRelaxAfter ); // Optimal IP solution to p0201 int objIndices[22] = { 8, 10, 21, 38, 39, 56, 60, 74, 79, 92, 94, 110, 111, 128, 132, 146, 151,164, 166, 182,183, 200 }; CoinPackedVector p0201(22,objIndices,1.0); // Sanity check const double * objective=siP->getObjCoefficients(); double ofv =0 ; int r; for (r=0; rclone(); std::string fn(mpsDir+"nw460"); siP->readMps(fn.c_str(),"mps"); // All integer variables should be binary. // Assert that this is true. for ( i = 0; i < siP->getNumCols(); i++ ) if ( siP->isInteger(i) ) assert(siP->getColUpper()[i]==1.0 && siP->isBinary(i)); CglKnapsackCover kccg; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, -225.68951787852194) ); double mycs[] = {0.7099213482046447, 0, 0.34185802225477174, 1, 1, 0, 1, 1, 0}; siP->setColSolution(mycs); OsiCuts cuts; // Test generateCuts method kccg.generateCuts(*siP,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); assert( eq(lpRelaxAfter, -176) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif #ifdef MJS assert( lpRelaxBefore < lpRelaxAfter ); #endif int nRowCuts = cuts.sizeRowCuts(); OsiRowCut rcut; CoinPackedVector rpv; for (i=0; iclone(); std::string fn(mpsDir+"exmip1"); siP->readMps(fn.c_str(),"mps"); // All integer variables should be binary. // Assert that this is true. for ( i = 0; i < siP->getNumCols(); i++ ) if ( siP->isInteger(i) ) assert(siP->getColUpper()[i]==1.0 && siP->isBinary(i)); CglKnapsackCover kccg; // Solve the LP relaxation of the model and // print out ofv for sake of comparison siP->initialSolve(); double lpRelaxBefore=siP->getObjValue(); assert( eq(lpRelaxBefore, 3.2368421052631575) ); double mycs[] = {2.5, 0, 0, 0.6428571428571429, 0.5, 4, 0, 0.26315789473684253}; siP->setColSolution(mycs); // Test generateCuts method OsiCuts cuts; kccg.generateCuts(*siP,cuts); OsiSolverInterface::ApplyCutsReturnCode rc = siP->applyCuts(cuts); siP->resolve(); double lpRelaxAfter=siP->getObjValue(); assert( eq(lpRelaxAfter, 3.2368421052631575) ); #ifdef CGL_DEBUG printf("\n\nOrig LP min=%f\n",lpRelaxBefore); printf("\n\nFinal LP min=%f\n",lpRelaxAfter); #endif assert( lpRelaxBefore <= lpRelaxAfter ); delete siP; } #ifdef CGL_DEBUG // See what findLPMostViolatedMinCover for knapsack with 2 elements does { int nCols = 2; int row = 1; CoinPackedVector krow; double e[2] = {5,10}; int ii[2] = {0,1}; krow.setVector(nCols,ii,e); double b=11; double xstar[2] = {.2,.9}; CoinPackedVector cover; CoinPackedVector remainder; CglKnapsackCover kccg; kccg.findLPMostViolatedMinCover(nCols, row, krow, b, xstar, cover, remainder); printf("num in cover = %i\n",cover.getNumElements()); int j; for (j=0; j #include "CglCutGenerator.hpp" #include "CglTreeInfo.hpp" /** Knapsack Cover Cut Generator Class */ class CglKnapsackCover : public CglCutGenerator { friend void CglKnapsackCoverUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /** A method to set which rows should be tested for knapsack covers */ void setTestedRowIndices(int num, const int* ind); /**@name Generate Cuts */ //@{ /** Generate knapsack cover cuts for the model of the solver interface, si. Insert the generated cuts into OsiCut, cs. */ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); //@} /**@name Constructors and destructors */ //@{ /// Default constructor CglKnapsackCover (); /// Copy constructor CglKnapsackCover ( const CglKnapsackCover &); /// Clone virtual CglCutGenerator * clone() const; /// Assignment operator CglKnapsackCover & operator=( const CglKnapsackCover& rhs); /// Destructor virtual ~CglKnapsackCover (); /// Create C++ lines to get to current state virtual std::string generateCpp( FILE * fp); /// This can be used to refresh any information virtual void refreshSolver(OsiSolverInterface * solver); //@} /**@name Sets and gets */ //@{ /// Set limit on number in knapsack inline void setMaxInKnapsack(int value) { if (value>0) maxInKnapsack_ = value;} /// get limit on number in knapsack inline int getMaxInKnapsack() const {return maxInKnapsack_;} /// Switch off expensive cuts inline void switchOffExpensive() { expensiveCuts_=false;} /// Switch on expensive cuts inline void switchOnExpensive() { expensiveCuts_=true;} private: // Private member methods /**@name Private methods */ //@{ /** deriveAKnapsack returns 1 if it is able to derive a (canonical) knapsack inequality in binary variables of the form ax<=b from the rowIndex-th row in the model, returns 0 otherwise. */ int deriveAKnapsack( const OsiSolverInterface & si, OsiCuts & cs, CoinPackedVector & krow, bool treatAsLRow, double & b, int * complement, double * xstar, int rowIndex, int numberElements, const int * index, const double * element); int deriveAKnapsack( const OsiSolverInterface & si, OsiCuts & cs, CoinPackedVector & krow, double & b, int * complement, double * xstar, int rowIndex, const CoinPackedVectorBase & matrixRow); /** Find a violated minimal cover from a canonical form knapsack inequality by solving the -most- violated cover problem and postprocess to ensure minimality */ int findExactMostViolatedMinCover( int nCols, int row, CoinPackedVector & krow, double b, double * xstar, CoinPackedVector & cover, CoinPackedVector & remainder); /** Find the most violate minimum cover by solving the lp-relaxation of the most-violate-min-cover problem */ int findLPMostViolatedMinCover( int nCols, int row, CoinPackedVector & krow, double & b, double * xstar, CoinPackedVector & cover, CoinPackedVector & remainder); /// find a minimum cover by a simple greedy approach int findGreedyCover( int row, CoinPackedVector & krow, double & b, double * xstar, CoinPackedVector & cover, CoinPackedVector & remainder ); /// lift the cover inequality int liftCoverCut( double & b, int nRowElem, CoinPackedVector & cover, CoinPackedVector & remainder, CoinPackedVector & cut ); /// sequence-independent lift and uncomplement and add the resulting cut to the cut set int liftAndUncomplementAndAdd( double rowub, CoinPackedVector & krow, double & b, int * complement, int row, CoinPackedVector & cover, CoinPackedVector & remainder, OsiCuts & cs ); /// sequence-dependent lift, uncomplement and add the resulting cut to the cut set void seqLiftAndUncomplementAndAdd( int nCols, double * xstar, int * complement, int row, int nRowElem, double & b, CoinPackedVector & cover, // need not be violated CoinPackedVector & remainder, OsiCuts & cs ); /// sequence-dependent lift binary variables either up or down, uncomplement and add to the cut set void liftUpDownAndUncomplementAndAdd( int nCols, double * xstar, int * complement, int row, int nRowElem, double & b, // the following 3 packed vectors partition the krow: CoinPackedVector & fracCover, // vars have frac soln values in lp relaxation // and form cover with the vars atOne CoinPackedVector & atOne, // vars have soln value of 1 in lp relaxation // and together with fracCover form minimal (?) cover. CoinPackedVector & remainder, OsiCuts & cs ); /// find a cover using a variation of the logic found in OSL (w/o SOS) int findPseudoJohnAndEllisCover ( int row, CoinPackedVector & krow, double & b, double * xstar, CoinPackedVector & cover, CoinPackedVector & remainder); /// find a cover using the basic logic found in OSL (w/o SOS) int findJohnAndEllisCover ( int row, CoinPackedVector & krow, double & b, double * xstar, CoinPackedVector & fracCover, CoinPackedVector & atOnes, CoinPackedVector & remainder); /** A C-style implementation of the Horowitz-Sahni exact solution procedure for solving knapsack problem. (ToDo: implement the more efficient dynamic programming approach) (Reference: Martello and Toth, Knapsack Problems, Wiley, 1990, p30.) */ int exactSolveKnapsack( int n, double c, double const *pp, double const *ww, double & z, int * x); /** Creates cliques for use by probing. Only cliques >= minimumSize and < maximumSize created Can also try and extend cliques as a result of probing (root node). Returns number of cliques found. */ int createCliques( OsiSolverInterface & si, int minimumSize=2, int maximumSize=100, bool extendCliques=false); /// Delete all clique information void deleteCliques(); //@} // Private member data /**@name Private member data */ //@{ /// epsilon double epsilon_; /// Tolerance to use for violation - bigger than epsilon_ double epsilon2_; /// 1-epsilon double onetol_; /// Maximum in knapsack int maxInKnapsack_; /** which rows to look at. If specified, only these rows will be considered for generating knapsack covers. Otherwise all rows will be tried */ int numRowsToCheck_; int* rowsToCheck_; /// exactKnapsack can be expensive - this switches off some bool expensiveCuts_; /// Cliques /// **** TEMP so can reference from listing const OsiSolverInterface * solver_; int whichRow_; int * complement_; double * elements_; /// Number of cliques int numberCliques_; /// Clique type typedef struct { unsigned int equality:1; // nonzero if clique is == } cliqueType; cliqueType * cliqueType_; /// Start of each clique int * cliqueStart_; /// Entries for clique cliqueEntry * cliqueEntry_; /** Start of oneFixes cliques for a column in matrix or -1 if not in any clique */ int * oneFixStart_; /** Start of zeroFixes cliques for a column in matrix or -1 if not in any clique */ int * zeroFixStart_; /// End of fixes for a column int * endFixStart_; /// Clique numbers for one or zero fixes int * whichClique_; /// Number of columns int numberColumns_; /** For each column with nonzero in row copy this gives a clique "number". So first clique mentioned in row is always 0. If no entries for row then no cliques. If sequence > numberColumns then not in clique. */ //cliqueEntry * cliqueRow_; /// cliqueRow_ starts for each row //int * cliqueRowStart_; //@} }; //############################################################################# /** A function that tests the methods in the CglKnapsackCover class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. */ void CglKnapsackCoverUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); #endif Cgl-0.58.9/src/CglKnapsackCover/CglKnapsackCover.cpp0000644000076600007660000037531312130104734020642 0ustar coincoin// $Id: CglKnapsackCover.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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 "CoinPragma.hpp" #include "CoinHelperFunctions.hpp" #include "CglKnapsackCover.hpp" #include "CoinPackedVector.hpp" #include "CoinSort.hpp" #include "CoinPackedMatrix.hpp" #include "OsiRowCutDebugger.hpp" #define GUBCOVER 1 //#define PRINT_DEBUG //#define CGL_DEBUG 1 //----------------------------------------------------------------------------- // Generate knapsack cover cuts //------------------------------------------------------------------- void CglKnapsackCover::generateCuts(const OsiSolverInterface& si, OsiCuts& cs, const CglTreeInfo info) { // Get basic problem information int nRows=si.getNumRows(); int nCols=si.getNumCols(); // Create working space for "canonical" knapsack inequality // - krow will contain the coefficients and indices of the // (potentially complemented) variables in the knapsack inequality. // - b is the rhs of knapsack inequality. // - complement[i] is 1 if the index i in krow refers to the complement // of the variable, and 0 otherwise. CoinPackedVector krow; double b=0.0; int numberRowCutsBefore = cs.sizeRowCuts(); int * complement= new int[nCols]; complement_ = complement; #if GUBCOVER==1 elements_=new double [2*nCols]; CoinZeroN(elements_,2*nCols); #elif GUBCOVER==2 int size1=4*nCols+2*numberCliques_; int size2=2*nCols+5*numberCliques_+5; elements_=reinterpret_cast(new int [size2+size1*sizeof(double)/sizeof(int)]); CoinZeroN(elements_,2*nCols+2*numberCliques_); int * restInd = reinterpret_cast (elements_+size1); CoinFillN(restInd,nCols,-2); #endif // Create a local copy of the column solution (colsol), call it xstar, and // inititalize it. // Assumes the lp-relaxation has been solved, and the solver interface // has a meaningful colsol. double * xstar= new double[nCols]; solver_ = &si; // To allow for vub knapsacks int * thisColumnIndex = new int [nCols]; double * thisElement = new double[nCols]; int * back = new int[nCols]; const double *colsol = si.getColSolution(); int k; // For each row point to vub variable // -1 if no vub // -2 if can skip row for knapsacks int * vub = new int [nRows]; // Now vubValue are for positive coefficients and vlbValue for negative // when L row // For each column point to vub row int * vubRow = new int [nCols]; double * vubValue = new double [nRows]; // For each column point to vlb row int * vlbRow = new int [nCols]; double * vlbValue = new double [nRows]; // Take out all fixed double * effectiveUpper = new double [nRows]; double * effectiveLower = new double [nRows]; const double * colUpper = si.getColUpper(); const double * colLower = si.getColLower(); for (k=0; kcolUpper[k]) xstar[k]=colUpper[k]; else if (xstar[k]getElements(); const int * column = matrixByRow->getIndices(); const CoinBigIndex * rowStart = matrixByRow->getVectorStarts(); const int * rowLength = matrixByRow->getVectorLengths(); const double * rowUpper = si.getRowUpper(); const double * rowLower = si.getRowLower(); // Scan all rows looking for possibles for (rowIndex=0;rowIndex1.0e20) multiplier=-1.0; else if (loRhs<-1.0e20) multiplier=1.0; int numberContinuous=0; int numberBinary=0; int iCont=-1; double sum = 0.0; double valueContinuous=0.0; #ifdef PRINT_DEBUG double valueBinary=0.0; int iBinary=-1; #endif int j; for (j=start;jcolLower[iColumn]) { sum += xstar[iColumn]*value; if (vubRow[iColumn]==-2&&value*multiplier>0.0) { // binary numberBinary++; #ifdef PRINT_DEBUG valueBinary=value; iBinary=iColumn; #endif } else if (vlbRow[iColumn]==-2&&value*multiplier<0.0) { // binary numberBinary++; #ifdef PRINT_DEBUG valueBinary=value; iBinary=iColumn; #endif } else if (vubRow[iColumn]==-1) { // only use if not at bound // if (colsol[iColumn]colLower[iColumn]+1.0e-6) { // possible iCont=iColumn; numberContinuous++; valueContinuous=value; //} else { //// ** needs more thought //numberContinuous ++; //iCont=-1; //} } else { // ** needs more thought numberContinuous ++; iCont=-1; //if (colsol[iColumn]colLower[iColumn]+1.0e-6) { //// already assigned //numberContinuous ++; //iCont=-1; //} } } else { // fixed upRhs -= colLower[iColumn]*value; loRhs -= colLower[iColumn]*value; } } // see if binding effectiveUpper[rowIndex] = upRhs; effectiveLower[rowIndex] = loRhs; bool possible = false; if (fabs(sum-upRhs)<1.0e-5) { possible=true; } else { effectiveUpper[rowIndex]=COIN_DBL_MAX; } if (fabs(sum-loRhs)<1.0e-5) { possible=true; } else { effectiveLower[rowIndex]=-COIN_DBL_MAX; } if (possible&&numberBinary&&numberBinary+numberContinuous<=maxInKnapsack_) { // binding with binary if(numberContinuous==1&&iCont>=0&&numberBinary==1) { // vub #ifdef PRINT_DEBUG printf("vub/vlb (by row %d) %g <= 0-1 %g * %d + %g * %d <= %g\n", rowIndex,effectiveLower[rowIndex],valueBinary,iBinary, valueContinuous,iCont,effectiveUpper[rowIndex]); #endif if (multiplier*valueContinuous>0.0) { vubValue[rowIndex] = valueContinuous; vubRow[iCont]=rowIndex; } else { vlbValue[rowIndex] = valueContinuous; vlbRow[iCont]=rowIndex; } vub[rowIndex]=iCont; numberVub++; } else if (numberBinary>1) { // could be knapsack vub[rowIndex]=-1; } else { // no point looking at this row vub[rowIndex]=-2; } } else { if (!possible||numberBinary+numberContinuous>maxInKnapsack_) vub[rowIndex]=-2; // no point looking at this row } } // Main loop int numCheck = 0; int* toCheck = 0; if (!rowsToCheck_) { toCheck = new int[nRows]; CoinIotaN(toCheck, nRows, 0); numCheck = nRows; } else { numCheck = numRowsToCheck_; toCheck = rowsToCheck_; } // Long row int longRow =20; //15; int longRow2 =20; //15; if (!info.inTree) { longRow=25; //longRow2=20; if (!info.pass) longRow=30; } // Set up number of tries for each row int ntry; if (numberVub) ntry=4; else ntry=2; //ntry=2; // switch off for (int ii=0; ii < numCheck; ++ii){ rowIndex = toCheck[ii]; if (rowIndex < 0 || rowIndex >= nRows) continue; if (vub[rowIndex]==-2) continue; whichRow_=ii; #ifdef PRINT_DEBUG std::cout << "CGL: Processing row " << rowIndex << std::endl; #endif // Get a tight row // (want to be able to // experiment by turning this on and off) // // const double * pi=si.rowprice(); // if (fabs(pi[row]) < epsilon_){ // continue; // } ////////////////////////////////////////////////////// // Derive a "canonical" knapsack // // inequality (in binary variables) // // from the model row in mixed integer variables // ////////////////////////////////////////////////////// #ifdef CGL_DEBUG assert(!krow.getNumElements()); #endif double effectiveRhs[4]; double rhs[4]; double sign[]={0.0,0.0,-1.0,1.0}; bool rowType[] = {false,true,false,true}; effectiveRhs[0] = effectiveLower[rowIndex]; rhs[0]=rowLower[rowIndex]; effectiveRhs[2] = effectiveRhs[0]; rhs[2]= effectiveRhs[0]; effectiveRhs[1] = effectiveUpper[rowIndex]; rhs[1]=rowUpper[rowIndex]; effectiveRhs[3] = effectiveRhs[1]; rhs[3]= effectiveRhs[1]; int itry; #ifdef CGL_DEBUG int kcuts[4]; memset(kcuts,0,4*sizeof(int)); #endif for (itry=0;itry1.0e20) continue; int length = rowLength[rowIndex]; memcpy(thisColumnIndex,column+rowStart[rowIndex],length*sizeof(int)); memcpy(thisElement,elementByRow+rowStart[rowIndex], length*sizeof(double)); b=rhs[itry]; if (itry>1) { // see if we would be better off relaxing int i; // mark columns int length2=length; // for new length int numberReplaced=0; for (i=0;i=0) { iRow = vubRow[iColumn]; if (vub[iRow]==iColumn&&iRow!=rowIndex) { vubCoefficient = vubValue[iRow]; // break it out - may be able to do better if (dSign*thisCoefficient>0.0) { // we want valid lower bound on continuous if (effectiveLower[iRow]>-1.0e20&&vubCoefficient>0.0) replace=-1; else if (effectiveUpper[iRow]<1.0e20&&vubCoefficient<0.0) replace=1; // q assert (replace!=-1); // q assert (replace!=1); } else { // we want valid upper bound on continuous if (effectiveLower[iRow]>-1.0e20&&vubCoefficient<0.0) replace=-1; else if (effectiveUpper[iRow]<1.0e20&&vubCoefficient>0.0) replace=1; //assert (replace!=-1); } } } if (vlbRow[iColumn]>=0) { iRow = vlbRow[iColumn]; if (vub[iRow]==iColumn&&iRow!=rowIndex) { vubCoefficient = vlbValue[iRow]; // break it out - may be able to do better if (dSign*thisCoefficient>0.0) { // we want valid lower bound on continuous if (effectiveLower[iRow]>-1.0e20&&vubCoefficient>0.0) replace=-1; else if (effectiveUpper[iRow]<1.0e20&&vubCoefficient<0.0) replace=1; //assert (replace!=1); } else { // we want valid upper bound on continuous if (effectiveLower[iRow]>-1.0e20&&vubCoefficient<0.0) replace=-1; else if (effectiveUpper[iRow]<1.0e20&&vubCoefficient>0.0) replace=1; //q assert (replace!=-1); //assert (replace!=1); } } } if (replace) { double useRhs=0.0; numberReplaced++; if (replace<0) useRhs = effectiveLower[iRow]; else useRhs = effectiveUpper[iRow]; // now replace (just using vubRow==-2) // delete continuous thisElement[i]=0.0; double scale = thisCoefficient/vubCoefficient; // modify rhs b -= scale*useRhs; int start = rowStart[iRow]; int end = start+rowLength[iRow]; int j; for (j=start;jmaxInKnapsack_) continue; // too long } else { for (i=0;igetVector(rowIndex).getIndices(); const double * elements = si.getMatrixByRow()->getVector(rowIndex).getElements(); // for every variable in the constraint for (i=0; igetVector(rowIndex).getNumElements(); i++){ printf("%d (s=%g) %g, ",indices[i],colsol[indices[i]],elements[i]); } printf("\n"); } #endif ////////////////////////////////////////////////////// // Look for a series of // // different types of minimal covers. // // If a minimal cover is found, // // lift the associated minimal cover inequality, // // uncomplement the vars // // and add it to the cut set. // // After the last type of cover is tried, // // restore xstar values // ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// // Try to generate a violated // // minimal cover greedily from fractional vars // ////////////////////////////////////////////////////// CoinPackedVector cover, remainder; if (findGreedyCover(rowIndex, krow, b, xstar, cover, remainder) == 1){ // Lift cover inequality and add to cut set if (!liftAndUncomplementAndAdd(rowUpper[rowIndex], krow, b, complement, rowIndex, cover, remainder, cs)) { // Reset local data and continue to the next iteration // of the rowIndex-loop // I am not sure this is needed but I am just being careful for(k=0; k 0. If this is not the case, something's screwy. Exit gracefully. double lambda = sum-b; if (lambda < epsilon_) { #ifdef CGL_DEBUG if (lambda < -epsilon_) { printf("lambda < epsilon....aborting. \n"); std::cout << "lambda " << lambda << " epsilon " << epsilon_ << std::endl; abort(); } else { #endif possible=false; #ifdef CGL_DEBUG } #endif } } if (possible) { CoinPackedVector atOnes; CoinPackedVector fracCover; // different than cover int nInCover = cover.getNumElements(); const int * ind = cover.getIndices(); const double * elsIn = cover.getElements(); for (int i=0;i epsilon_) { for(k=0; knlast) { const OsiRowCutDebugger * debugger = si.getRowCutDebugger(); if (debugger&&debugger->onOptimalPath(si)) { // check cuts okay int k; for (k=nlast;kinvalidCut(rc)) { printf("itry %d, rhs %g, length %d\n",itry,rhs[itry],length); int i; for (i=0;i1) { int length = rowLength[rowIndex]; memcpy(thisColumnIndex,column+rowStart[rowIndex], length*sizeof(int)); memcpy(thisElement,elementByRow+rowStart[rowIndex], length*sizeof(double)); printf("Original row had rhs %g and length %d\n", (itry==2 ? rowLower[rowIndex] :rowUpper[rowIndex]), length); for (i=0;iinvalidCut(rc)); } } } if (itry>1&&nnow-nlast>kcuts[itry-2]) { printf("itry %d gave %d cuts as against %d for itry %d\n", itry,nnow-nlast,kcuts[itry-2],itry-2); } kcuts[itry]=nnow-nlast; nlast=nnow; } #endif } } if (!info.inTree&&((info.options&4)==4||((info.options&8)&&!info.pass))) { int numberRowCutsAfter = cs.sizeRowCuts(); for (int i=numberRowCutsBefore;isetGloballyValid(); } // Clean up: free allocated memory if (toCheck != rowsToCheck_) delete[] toCheck; delete[] xstar; delete[] complement; #ifdef GUBCOVER delete [] elements_; #endif delete [] thisColumnIndex; delete [] thisElement; delete [] back; delete [] vub; delete [] vubRow; delete [] vubValue; delete [] vlbRow; delete [] vlbValue; delete [] effectiveLower; delete [] effectiveUpper; } void CglKnapsackCover::setTestedRowIndices(int num, const int* ind) { if (rowsToCheck_) delete[] rowsToCheck_; numRowsToCheck_ = num; if (num > 0) { rowsToCheck_ = new int[num]; CoinCopyN(ind, num, rowsToCheck_); } } //------------------------------------------------------------- // Lift and uncomplement cut. Add cut to the cutset //------------------------------------------------------------------- int CglKnapsackCover::liftAndUncomplementAndAdd( double /*rowub*/, CoinPackedVector & krow, double & b, int * complement, int /*row*/, CoinPackedVector & cover, CoinPackedVector & remainder, OsiCuts & cs ) { CoinPackedVector cut; double cutRhs = cover.getNumElements() - 1.0; int goodCut=1; if (remainder.getNumElements() > 0){ // Construct lifted cover cut if (!liftCoverCut( b, krow.getNumElements(), cover, remainder, cut )) goodCut= 0; // no cut } // The cover consists of every variable in the knapsack. // There is nothing to lift, so just add cut else { cut.reserve(cover.getNumElements()); cut.setConstant(cover.getNumElements(),cover.getIndices(),1.0); } if (goodCut) { // Uncomplement the complemented variables in the cut int k; //if (fabs(b-rowub)> epsilon_) { double * elements = cut.getElements(); int * indices = cut.getIndices(); for (k=0; k=0); assert(elements[k]); assert (fabs(elements[k])>1.0e-12); } } #endif rc.setLb(-COIN_DBL_MAX); rc.setUb(cutRhs); // rc.setEffectiveness(0); // Todo: put in a more useful measure such as the violation. // Add row cut to the cut set #ifdef PRINT_DEBUG { int k; printf("cutrhs %g %d elements\n",cutRhs,cut.getNumElements()); double * elements = cut.getElements(); int * indices = cut.getIndices(); for (k=0; k()); } // nBinUnsat is a counter for the number of unsatisfied // (i.e. fractional) binary vars int nBinUnsat =0; const double * colupper = si.getColUpper(); const double * collower = si.getColLower(); // At this point, leMatrixRow and b represent a le inequality in general // variables. // To derive a canonical knapsack inequality in free binary variable, // process out the continuous & non-binary integer & fixed binary variables. // If the non-free-binary variables can be appropriately bounded, // net them out of the constraint, otherwise abandon this row and return 0. const int * indices = leMatrixRow.getIndices(); const double * elements = leMatrixRow.getElements(); // for every variable in the constraint for (i=0; iepsilon_){ // and the variable has a finite lower bound if (collower[indices[i]] > -si.getInfinity()){ // then replace the variable with its lower bound. b=b-elements[i]*collower[indices[i]]; } else { return 0; } } // note: if the coefficient is zero, the variable is not included in the // knapsack inequality. } // else the variable is a free binary var and is included in the knapsack // inequality. // note: the variable is included regardless of its solution value to the // lp relaxation. else{ krow.insert(indices[i], elements[i]); // if the binary variable is unsatified (i.e. has fractional value), // increment the counter. if(xstar[indices[i]] > epsilon_ && xstar[indices[i]] < onetol_) nBinUnsat++; // keep track of the largest and smallest elements in the knapsack // (the idea is if there is not a lot of variation in the knapsack // coefficients, it is unlikely we will find a violated minimal // cover from this knapsack so don't even bother trying) if (fabs(elements[i]) > maxKrowElement) maxKrowElement = fabs(elements[i]); if (fabs(elements[i]) < minKrowElement) minKrowElement = fabs(elements[i]); } } // If there's little variation in the knapsack coefficients, return 0. // If there are no unsatisfied binary variables, return. // If there's only one binary, return. // ToDo: but why return if 2 binary? ...there was some assumption in the // findVioMinCover..(?) // Anyway probing will probably find something if (krow.getNumElements() < 3 || nBinUnsat == 0 || maxKrowElement-minKrowElement < 1.0e-3*maxKrowElement ) { return 0; } // However if we do decide to do when count is two - look carefully if (krow.getNumElements()==2) { const int * indices = krow.getIndices(); double * elements = krow.getElements(); double sum=0.0; for(i=0; i<2; i++){ int iColumn = indices[i]; sum += elements[i]*xstar[iColumn]; } if (sum ub. // TODO: test this scenario in BCP if (b < 0 ){ OsiColCut cc; int index = krow.getIndices()[0]; const double fakeLb = colupper[index] + 1.0;; // yes, colupper. #ifdef CGL_DEBUG const double fakeUb = collower[index]; assert( fakeUb < fakeLb ); #endif cc.setLbs( 1, &index, &fakeLb); cc.setUbs( 1, &index, &fakeLb); cc.setEffectiveness(COIN_DBL_MAX); cs.insert(cc); #ifdef PRINT_DEBUG printf("Cgl: Problem is infeasible\n"); #endif } // At this point, krow and b represent a le inequality with postive // coefficients. // If any coefficient a_j > b, then x_j = 0, return 0 // If any complemented var has coef a_j > b, then x_j = 1, return 0 int fixed = 0; CoinPackedVector fixedBnd; for(i=0; i b){ fixedBnd.insert(krow.getIndices()[i],complement[krow.getIndices()[i]]); #ifdef PRINT_DEBUG printf("Variable %i being fixed to %i due to row %i.\n", krow.getIndices()[i],complement[krow.getIndices()[i]],rowIndex); #endif fixed = 1; } } // After all possible variables are fixed by adding a column cut with // equivalent lower and upper bounds, return if (fixed) { OsiColCut cc; cc.setLbs(fixedBnd); cc.setUbs(fixedBnd); cc.setEffectiveness(COIN_DBL_MAX); return 0; } return 1; } //------------------------------------------------------------------- // deriveAKnapsack - returns 1 if the method is able to // derive a cannonical knapsack inequality // in binary variables of the form ax<=b // from the rowIndex-th row of the constraint matrix. // returns 0, otherwise. // Precondition: complement must be 0'd out!!! //------------------------------------------------------------------- int CglKnapsackCover::deriveAKnapsack( const OsiSolverInterface & si, OsiCuts & cs, CoinPackedVector & krow, double & b, int * complement, double * xstar, int rowIndex, const CoinPackedVectorBase & matrixRow ) { // Get the sense of the row const char rowsense = si.getRowSense()[rowIndex]; // Skip equality and unbounded rows if (rowsense=='E' || rowsense=='N') { return 0; } bool treatAsLRow = (rowsense=='L'); const int * indices = matrixRow.getIndices(); const double * elements = matrixRow.getElements(); int numberElements = matrixRow.getNumElements(); return deriveAKnapsack( si, cs, krow, treatAsLRow, b, complement, xstar, rowIndex, numberElements, indices, elements); } //-------------------------------------------------- // Find a violated minimal cover from // a canonical form knapsack inequality by // solving the lp relaxation of the // -most- violated cover problem. // Postprocess to ensure minimality. // ----------------------------------------- int CglKnapsackCover::findLPMostViolatedMinCover( int nCols, int /*row*/, CoinPackedVector & krow, double & b, double * xstar, CoinPackedVector & cover, CoinPackedVector & remainder) { // Assumes krow and b describe a knapsack inequality in canonical form // Given a knapsack inequality sum a_jx_j <= b, and optimal lp solution // xstart, a violated minimal cover inequality exists if the following 0-1 // programming problem has an optimal objective function value (oofv) < 1 // oofv = min sum (1-xstar_j)z_j // s.t. sum a_jz_j > b // z binary // The vector z is an incidence vector, defining the cover R with the // associated cover inequality: // (sum j in R) x_j <= |R|-1 // This problem is itself a (min version of the) knapsack problem // but with a unsightly strict inequalty. // To transform transform it into a max version, // complement the z's, z_j=1-y_j. // To compensate for the strict inequality, subtract epsilon from the rhs. // oofv = (sum (1-xstar_j))- max sum (1-xstar)y_j // s.t. sum a_jy_j <= (sum over j)a_j - b (- EPSILON) // y binary // If oofv < 1, then a violated min cover inequality has // incidence vector z with elements z_j=1-y_j and rhs= num of nonzero's in // z, i.e. the number of 0's in y. // If the size of the knapsack is "small", we solve the problem exactly. // If the size of the knapsack is large, we solve the (simpler) lp relaxation // of the knapsack problem and postprocess to ensure the construction of a // minimimal cover. // We also assume that testing/probing/fixing based on the knapsack structure // is done elsewhere. Only convenient-to-do sanity checks are done here. // (We do not assume that data is integer.) double elementSum = krow.sum(); // Redundant/useless adjusted rows should have been trapped in the // transformation to the canonical form of knapsack inequality if (elementSum < b + epsilon_) { return -1; } // Order krow in nonincreasing order of coefObj_j/a_j. // (1-xstar_1)/a_1 >= (1-xstar_2)/a_2 >= ... >= (1-xstar_n)/a_n // by defining this full-storage array "ratio" to be the external sort key. double * ratio= new double[nCols]; memset(ratio, 0, (nCols*sizeof(double))); int i; for (i=0; i epsilon_ ){ ratio[krow.getIndices()[i]]= (1.0-xstar[krow.getIndices()[i]]) / (krow.getElements()[i]); } else { ratio[krow.getIndices()[i]] = 0.0; } } // ToDo: would be nice to have sortkey NOT be full-storage vector CoinDecrSolutionOrdered dso(ratio); krow.sort(dso); // Find the "critical" element index "r" in the knapsack lp solution int r = 0; double sum = krow.getElements()[0]; while ( sum <= (elementSum - b - epsilon_ ) ){ r++; sum += krow.getElements()[r]; } // Note: It is possible the r=0, and you get a violated minimal cover // if (r=0), then you've got a var with a really large coeff. compared // to the rest of the row. // r=0 says trivially that the // sum of ALL the binary vars in the row <= (cardinality of all the set -1) // Note: The cover may not be minimal if there are alternate optimals to the // maximization problem, so the cover must be post-processed to ensure // minimality. // "r" is the critical element // The lp relaxation column solution is: // y_j = 1 for j=0,...,(r-1) // y_r = (elementSum - b - sum + krow.element()[r])/krow.element()[r] // y_j = 0 for j=r+1,...,krow.getNumElements() // The number of nonzeros in the lp column solution is r+1 // if oofv to the lp knap >= 1, then no violated min cover is possible int nCover; double lpoofv=0.0; for (i=r+1; i 1.0 - epsilon_){ delete [] ratio; return -1; } else { // Partition knapsack into cover and noncover (i.e. remainder) // pieces nCover = krow.getNumElements() - r; double coverSum =0.0; cover.reserve(nCover); remainder.reserve(r); for (i=r; i b+1.0e-12){ // move the excess cover member into the set of remainders remainder.insert(cover.getIndices()[nCover-1], cover.getElements()[nCover-1]); cover.truncate(nCover-1); nCover--; oneLessCoverSum -= cover.getElements()[nCover-1]; } if (nCover<2){ #ifdef PRINT_DEBUG printf("nCover < 2...aborting\n"); abort(); #endif delete [] ratio; return -1; } #ifdef PRINT_DEBUG /* debug */ printf("\ Lp relax of most violated minimal cover: row %i has cover of size %i.\n", row,nCover); //double sumCover = 0.0; for (i=0; i nCover-1){ printf("\ \nBad cover from lp relax of most violated cover..aborting\n"); abort(); } #endif /* clean up */ delete [] ratio; return 1; } } //-------------------------------------------------- // Find a violated minimal cover from // a canonical form knapsack inequality by // solving the -most- violated cover problem // and postprocess to ensure minimality // ----------------------------------------- int CglKnapsackCover::findExactMostViolatedMinCover( int nCols, int /*row*/, CoinPackedVector & krow, double b, double * xstar, CoinPackedVector & cover, CoinPackedVector & remainder) { // assumes the row is in canonical knapsack form // A violated min.cover inequality exists if the // opt obj func value (oofv) < 1: // oofv = min sum (1-xstar_j)z_j // s.t. sum a_jz_j > b // x binary // The vector z is the incidence vector // defines the set R and the cover inequality. // (sum j in R) x_j <= |R|-1 // This is the min version of the knapsack problem. // (note that strict inequalty...bleck) // To obtain the max version, complement the z's, z_j=1-y_j and // adjust the constraint. // oofv = (sum (1-xstar_j))- max sum (1-xstar)y_j // s.t. sum a_jy_j <= (sum over j)a_j - b (- EPSILON)] // y binary // If oofv < 1, violated min cover inequality has // incidence vector z=1-y and rhs= num of nonzero's in z, i.e. // the number 0 in y. // We solve the 0-1 knapsack problem by explicit ennumeration double elementSum = krow.sum(); // Redundant/useless adjusted rows should have been trapped in // transformation to canonical form of knapsack inequality if (elementSum < b + epsilon_) { #ifdef PRINT_DEBUG printf("Redundant/useless adjusted row\n"); #endif return -1; } // Order krow in nonincreasing order of coefObj_j/a_j. // (1-xstar_1)/a_1 >= (1-xstar_2)/a_2 >= ... >= (1-xstar_n)/a_n // by defining this full-storage array "ratio" to be the external sort key. double * ratio= new double[nCols]; memset(ratio, 0, (nCols*sizeof(double))); int i; { const int * indices = krow.getIndices(); const double * elements = krow.getElements(); for (i=0; i epsilon_ ){ ratio[indices[i]]= (1.0-xstar[indices[i]]) / elements[i]; } else { ratio[indices[i]] = 0.0; } } } // ToDo: would be nice to have sortkey NOT be full-storage vector CoinDecrSolutionOrdered dso(ratio); krow.sort(dso); #ifdef CGL_DEBUG // sanity check for ( i=1; i= ratioi ); } #endif // Recall: // oofv = (sum (1-xstar_j))- max sum (1-xstar)y_j // s.t. sum a_jy_j <= (sum over j)a_j - b (- epsilon_)] // y binary double objConst = 0.0; double exactOptVal = -1.0; int * exactOptSol = new int[krow.getNumElements()]; double * p = new double[krow.getNumElements()]; double * w = new double[krow.getNumElements()]; int kk; for (kk=0; kk b){ // move the excess cover member into the set of remainders remainder.insert(cover.getIndices()[cover.getNumElements()-1], cover.getElements()[cover.getNumElements()-1]); cover.truncate(cover.getNumElements()-1); oneLessCoverElementSum -= cover.getElements()[cover.getNumElements()-1]; } #ifdef PRINT_DEBUG printf("Exact Most Violated Cover: row %i has cover of size %i.\n", row,cover.getNumElements()); //double sumCover = 0.0; for (i=0; i adjRhs, skip row. Bad knapsack. // margin = adjRhs // idea: if (possibly compl) soln >= .5 round up, else round down // they do more, but that's the essence // go through the elements { // if round down, skip // if round up, add to element to cover. adjust margin // if current element = biggest, then get next biggest // if biggest > marg, you've got a cover. stop looking // else try next element in the loop // } // (*)RLH: I'm going to sort in decreasing order of soln val // b/c var's whose soln < .5 in can. form get rounded down // and skipped. If you can get a min cover of the vars // whose soln is >= .5, I believe this gives the same as J&E. // But if not, maybe I can get something more. // (**)By checking largest value left, they ensure a minimal cover // on the unsatisfied variables // if you have a cover // sort the elements to be lifted in order of their reduced costs. // lift in this order. // ...I don't understand their lifting, so for now use sequence-indep lifting // J&E employ lifting up and down. // Here I'm including the vars at one in the cover. // Adding these vars back in may cause the minimality of the cover to lost. // So, post-processing to establish minimality is required. cover.reserve(krow.getNumElements()); remainder.reserve(krow.getNumElements()); double unsatRhs = b; // working info on unsatisfied vars CoinPackedVector unsat; unsat.reserve(krow.getNumElements()); // working info on vars with value one CoinPackedVector atOne; atOne.reserve(krow.getNumElements()); // partition the (binary) variables in the canonical knapsack // into those at zero, those at fractions, and those at one. // Note: no consideration given to whether variables are free // or fixed at binary values. // Note: continuous and integer vars have already been netted out // to derive the canonical knapsack form int i; for (i=0; i onetol_){ atOne.insert(krow.getIndices()[i],krow.getElements()[i]); unsatRhs -= krow.getElements()[i]; } else if (xstar[krow.getIndices()[i]] >= epsilon_){ unsat.insert(krow.getIndices()[i],krow.getElements()[i]) ; } else { remainder.insert(krow.getIndices()[i],krow.getElements()[i]); } } // sort the indices of the unsat var in order of decreasing solution value CoinDecrSolutionOrdered decrSol(xstar); unsat.sort(decrSol); #ifdef CGL_DEBUG // sanity check for (i=1; i= xstari ); } #endif // get the largest coefficient among the unsatisfied variables double bigCoef= 0.0; // double temp; int bigIndex = 0; for (i=0; ibigCoef){ bigCoef = unsat.getElements()[i]; bigIndex = i; } } // initialize i=0; double margin = unsatRhs; int gotCover=0; int j; // look in order through the unsatisfied vars which along with the // the max element defines a cover while (i bigCoef ){ bigCoef = temp; bigIndex = j; } } } if (bigCoef > margin+epsilon2_) gotCover = 1; i++; } // J&E approach; get first single one element that fills the margin if(gotCover){ j=i; if (j (nCover-1) && coverElementSum > unsatRhs+epsilon2_){ for (i=nCover; i b){ // move the excess cover member into the set of remainders remainder.insert(cover.getIndices()[cover.getNumElements()-1], cover.getElements()[cover.getNumElements()-1]); cover.truncate(cover.getNumElements()-1); oneLessCoverElementSum -= cover.getElements()[cover.getNumElements()-1]; } #ifdef PRINT_DEBUG if (coverXstarSum > (nCover-1) && coverElementSum > b){ printf("John and Ellis: row %i has cover of size %i.\n", row,cover.getNumElements()); //double sumCover = 0.0; for (i=0; i adjRhs, skip row. Bad knapsack. // margin = adjRhs // idea: if (possibly compl) soln >= .5 round up, else round down // they do more, but that's the essence // go through the elements { // if round down, skip // if round up, add to element to cover. adjust margin // if current element = biggest, then get next biggest // if biggest > marg, you've got a cover. stop looking // else try next element in the loop // } // (*)RLH: I'm going to sort in decreasing order of soln val // b/c var's whose soln < .5 in can. form get rounded down // and skipped. If you can get a min cover of the vars // whose soln is >= .5, I believe this gives the same as J&E. // But if not, maybe I can get something more. // (**)By checking largest value left, they ensure a minimal cover // on the unsatisfied variables // if you have a cover // sort the elements to be lifted in order of their reduced costs. // lift in this order. // They lift down on variables at one, in a sequence-dependent manner. // Partion the variables into three sets: those in the cover, those // not in the cover at value one, and those remaining. fracCover.reserve(krow.getNumElements()); remainder.reserve(krow.getNumElements()); atOne.reserve(krow.getNumElements()); double unsatRhs = b; // working info on unsatisfied vars CoinPackedVector unsat; unsat.reserve(krow.getNumElements()); // partition the (binary) variables in the canonical knapsack // into those at zero, those at fractions, and those at one. // // essentially, temporarily fix to one the free vars with lp soln value of // one by calculating the "unsatRhs". Call the result the "reduced krow". // // Note: continuous and integer vars, and variables fixed at // binary values have already been netted out // in deriving the canonical knapsack form int i; for (i=0; i onetol_){ atOne.insert(krow.getIndices()[i],krow.getElements()[i]); unsatRhs -= krow.getElements()[i]; } else if (xstar[krow.getIndices()[i]] >= epsilon_){ unsat.insert(krow.getIndices()[i],krow.getElements()[i]) ; } else { remainder.insert(krow.getIndices()[i],krow.getElements()[i]); } } // sort the indices of the unsat var in order of decreasing solution value CoinDecrSolutionOrdered decrSol(xstar); unsat.sort(decrSol); #ifdef CGL_DEBUG // sanity check for (i=1; i= xstari ); } #endif // get the largest coefficient among the unsatisfied variables double bigCoef= 0.0; // double temp; int bigIndex = 0; for (i=0; ibigCoef){ bigCoef = unsat.getElements()[i]; bigIndex = i; } } // initialize i=0; double margin = unsatRhs; int gotCover=0; int j; // look in order through the unsatisfied vars which along with the // the max element defines a cover while (i bigCoef ){ bigCoef = temp; bigIndex = j; } } } if (bigCoef > margin+epsilon2_) gotCover = 1; i++; } // J&E approach; get first single one element that fills the margin if(gotCover){ j=i; if (j unsatRhs+epsilon2_){ for (i=nCover; i b){ // move the excess cover member into the set of remainders remainder.insert(fracCover.getIndices()[fracCover.getNumElements()-1], fracCover.getElements()[fracCover.getNumElements()-1]); fracCover.truncate(fracCover.getNumElements()-1); oneLessCoverElementSum -= fracCover.getElements()[fracCover.getNumElements()-1]; } #endif #ifdef PRINT_DEBUG printf("More Exactly John and Ellis:"); printf(" row %i has -reduced--fractional- cover of size %i.\n", row,fracCover.getNumElements()); double sumFracCover = 0.0; for (i=0; i= epsilon_ && xstar[krow.getIndices()[i]] <= onetol_ && !gotCover){ greedyElementSum += krow.getElements()[i]; greedyXstarSum += xstar[krow.getIndices()[i]]; cover.insert(krow.getIndices()[i],krow.getElements()[i]); if (greedyElementSum > b+epsilon2_){ gotCover = 1; } } else{ remainder.insert(krow.getIndices()[i],krow.getElements()[i]); } } #ifdef CGL_DEBUG // sanity check int size = remainder.getNumElements()+cover.getNumElements(); int krowsize = krow.getNumElements(); assert( size==krowsize ); #endif // if no violated minimal cover was found, pack it in if ( (greedyXstarSum<=(cover.getNumElements()-1)+epsilon2_) || (!gotCover) || (cover.getNumElements() < 2)){ return -1; } #ifdef PRINT_DEBUG printf("Greedy cover: row %i has cover of size %i\n", row,cover.getNumElements()); for (i=0; iepsilon2_) { printf("At one %d\n",atOne.getNumElements()); for (i=0; i 0 ); // If there is something to lift, then calculate the lifted coefficients if (unsatRhs>0.0&&(remainder.getNumElements()+atOne.getNumElements())> 0){ // What order to lift? // Take the remainder vars in decreasing order of their // xstar solution value. Sort remainder in order of decreasing // xstar value. // Lift them "up" // (The lift "down" the variables atOne. CoinDecrSolutionOrdered dso1(xstar); remainder.sort(dso1); #if GUBCOVER==2 int nClique=0; double * weightClique2 = NULL; int * indices = NULL; int * starts = NULL; if (numberCliques_) { int nInCover = fracCover.getNumElements(); int nRest = remainder.getNumElements(); const CoinPackedMatrix * matrixByRow = solver_->getMatrixByRow(); #ifdef PRINT_DEBUG const double * elementByRow = matrixByRow->getElements(); #endif const int * column = matrixByRow->getIndices(); const CoinBigIndex * rowStart = matrixByRow->getVectorStarts(); const int * rowLength = matrixByRow->getVectorLengths(); #ifdef PRINT_DEBUG const double * rowUpper = solver_->getRowUpper(); const double * rowLower = solver_->getRowLower(); #endif int numberColumns = solver_->getNumCols(); double * els = elements_; double * els2 = els+numberColumns; double * weightClique = els2+numberColumns; weightClique2 = weightClique+numberCliques_; double * temp = weightClique2+2*numberColumns; int * count = reinterpret_cast(temp); indices = reinterpret_cast (temp+numberCliques_); int * whichClique = indices+numberColumns; for (i=rowStart[whichRow_];i=0&&!complement_[iColumn]) { //printf("Cover column %d, xstar %g ",iColumn,xstar[iColumn]); for (int j=oneFixStart_[iColumn];j ",iClique,weightClique[iClique]); double value=weightClique[iClique]; if (!value) { whichClique[nClique++] =iClique; count[iClique]=0; } count[iClique]++; value += 3.0; weightClique[iClique]=value; //printf("%g) ",weightClique[iClique]); } //printf("\n"); } } ind = remainder.getIndices(); #ifdef PRINT_DEBUG elsIn = remainder.getElements(); #endif for (i=0;i1.0e-5) value=3.0; else value=0.99; if (oneFixStart_[iColumn]>=0&&!complement_[iColumn]) { //printf("Column %d, xstar %g ",iColumn,xstar[iColumn]); for (int j=oneFixStart_[iColumn];j ",iClique,weightClique[iClique]); //printf("%g) ",weightClique[iClique]); } //printf("\n"); } } // But only look at cliques with more than one entry int nnClique=0; for (i=0;i1) whichClique[nnClique++]=iClique; else weightClique[iClique]=0.0; } nClique=nnClique; ind = fracCover.getIndices(); for (i=0;i=0&&!complement_[iColumn]) { double value=3.1; int jClique=-1; for (int j=oneFixStart_[iColumn];jvalue) { jClique=iClique; value=weightClique[iClique]; } } if (jClique>=0) { indices[iColumn]=jClique; count[jClique]=-1; } else { indices[iColumn]=-2; } } } ind = remainder.getIndices(); for (i=0;i=0&&!complement_[iColumn]) { double value=1.1; int jClique=-1; for (int j=oneFixStart_[iColumn];jvalue) { jClique=iClique; value=weightClique[iClique]; } } if (jClique>=0) { indices[iColumn]=jClique; count[jClique]=-1; } else { indices[iColumn]=-2; } } } #ifdef PRINT_DEBUG bool interesting = false; #endif nnClique=0; for (i=0;i=0) { int back = count[iClique]; if (back<0) { // first back=nnClique; count[iClique]=nnClique; whichClique[nnClique++]=iClique; current[iClique]=0; } current[iClique]++; weightClique[back] -= xstar[i]; } } assert (nnClique==nClique); CoinSort_2(weightClique,weightClique+nClique,whichClique); int n=0; for (i=0;i=0) { int back = count[iClique]; int put = current[back]; current[back]++; which[put]=iColumn; indices[iColumn]=back; nNow[back]++; // already in } } // Next remainder (maybe should split into nonzero and zero) // and add atOnes in middle // *** NEED to sort so best gub first ind = remainder.getIndices(); for (i=0;i=0) { int back = count[iClique]; int put = current[back]; current[back]++; which[put]=iColumn; indices[iColumn]=back; } } #ifdef CLP_INVESTIGATE nTry++; int k=CoinMin(nClique,4); howMany[k]++; if ((nTry%100)==0) { printf("TRY %d ",nTry); for (i=1;i<5;i++) if (howMany[i]) printf("(%d cliques -> %d) ",i,howMany[i]); printf("\n"); } #endif } } #endif // a is the part of krow corresponding to vars which have been lifted // alpha are the lifted coefficients with explicit storage of lifted zero // coefficients the a.getIndices() and alpha.getIndices() are identical CoinPackedVector a(fracCover); CoinPackedVector alpha; int i; for (i=0; i= alpha_2/a_2 >= ... >= alpha_n/a_n // by defining this full-storage array "ratio" to be the external sort key. // right now external sort key must be full-storage. double * ratio= new double[nCols]; memset(ratio, 0, (nCols*sizeof(double))); #ifdef CGL_DEBUG double alphasize = alpha.getNumElements(); double asize = a.getNumElements(); assert( alphasize == asize ); #endif for (i=0; i epsilon_ ){ ratio[a.getIndices()[i]]=alpha.getElements()[i]/a.getElements()[i]; } else { ratio[a.getIndices()[i]] = 0.0; } } CoinDecrSolutionOrdered dso2(ratio); a.sort(dso2); alpha.sort(dso2); #ifdef CGL_DEBUG // sanity check for ( i=1; i=alpha_2/a_2>=...>=alpha_n/a_n order // check if lifted var can take value 1 ratio[iColumn] = 0.0; #if GUBCOVER==2 int inClique = (nClique) ? indices[iColumn] : -3; #endif if (unsatRhs - element >= epsilon_) { #if GUBCOVER==2 if (!nClique) { #endif exactSolveKnapsack(alpha.getNumElements(), unsatRhs-element, alpha.getElements(),a.getElements(),psi_j,x); #if GUBCOVER==2 } else { // A) should sort "remainder" so strongest clique first // B) make more efficient // C) take out news in exactKnapsack // weightClique2 is 2*ncolumns // indices for (i=0;i=0) { // Do current for (i=0;i=0) { current[i]=which[k+kk]; } else { current[i]=-3; } } double offsetObj=0.0; double testRhs=unsatRhs-element; int n=0; for (i=0;i= epsilon_) { exactSolveKnapsack(n,testRhs,p,w,nowPsi_j,x); nowPsi_j += offsetObj; #ifdef FULL_GUB_PRINT printf("gub psi %g\n",nowPsi_j); #endif assert (nowPsi_j>=0.0); if (nowPsi_j>biggestPsi_j) biggestPsi_j=nowPsi_j; } else if (testRhs >= -epsilon_) { // as is nowPsi_j = offsetObj; #ifdef FULL_GUB_PRINT printf("gub psi %g (no knapsack computation)\n",nowPsi_j); #endif assert (nowPsi_j>=0.0); if (nowPsi_j>biggestPsi_j) biggestPsi_j=nowPsi_j; } else { #ifdef FULL_GUB_PRINT printf("take as zero\n"); #endif } stack[kStack]--; while (stack[kStack]<0) { stack[kStack]=nNow[kStack]-1; kStack--; if (kStack>=0) { stack[kStack]--; if (stack[kStack]>=0) { kStack=nClique-1; break; } } } } #ifdef FULL_GUB_PRINT if (fabs(biggestPsi_j-oldPsi_j)>1.0e-7) { printf("gub ** Ordinary psi %g, gub %g\n",oldPsi_j, biggestPsi_j); } #endif assert (biggestPsi_jepsilon_) { cut.insert(iColumn,cutRhs-psi_j); // assert the new coefficient is nonegative? alpha.insert(iColumn,cutRhs-psi_j); a.insert(iColumn,element); ratio[iColumn] = (cutRhs-psi_j)/element; CoinDecrSolutionOrdered dso(ratio); a.sort(dso); alpha.sort(dso); } #if GUBCOVER==2 if (inClique>=0) { int kStart =starts[inClique]; int kEnd =starts[inClique+1]; int j=nNow[inClique]; j += kStart; assert (kStartepsilon_) { nNow[inClique]++; } else { // shuffle up (some may have already gone) for (int k=j+1;k=alpha_2/a_2>=...>=alpha_n/a_n order exactSolveKnapsack(alpha.getNumElements(), unsatRhs+atOne.getElements()[j], alpha.getElements(),a.getElements(),psi_j,x); alpha.insert(atOne.getIndices()[j],psi_j-cutRhs); a.insert(atOne.getIndices()[j],atOne.getElements()[j]); // if the lifted coefficient is non-zero (i.e. psi_j != cutRhs), add it // to the cut if (fabs(psi_j-cutRhs)>epsilon_) cut.insert(atOne.getIndices()[j],psi_j-cutRhs); #ifdef CGL_DEBUG assert ( fabs(atOne.getElements()[j])> epsilon_ ); #else if ( fabs(atOne.getElements()[j])<= epsilon_ ) { // exit gracefully cutRhs = COIN_DBL_MAX; break; } #endif ratio[atOne.getIndices()[j]]=(psi_j-cutRhs)/atOne.getElements()[j]; // update cutRhs and unsatRhs cutRhs = psi_j ; unsatRhs += atOne.getElements()[j]; CoinDecrSolutionOrdered dso(ratio); a.sort(dso); alpha.sort(dso); } #if 0 for (j=firstZero; j=alpha_2/a_2>=...>=alpha_n/a_n order // check if lifted var can take value 1 if (unsatRhs - remainder.getElements()[j] < epsilon_){ psi_j = cutRhs; } else { exactSolveKnapsack(alpha.getNumElements(), unsatRhs-remainder.getElements()[j], alpha.getElements(),a.getElements(),psi_j,x); } // assert the new coefficient is nonegative? alpha.insert(remainder.getIndices()[j],cutRhs-psi_j); a.insert(remainder.getIndices()[j],remainder.getElements()[j]); // if the lifted coefficient is non-zero // (i.e. psi_j != cutRhs), add it to the cut if (fabs(cutRhs-psi_j)>epsilon_) cut.insert(remainder.getIndices()[j],cutRhs-psi_j); ratio[remainder.getIndices()[j]]= (cutRhs-psi_j)/remainder.getElements()[j]; CoinDecrSolutionOrdered dso(ratio); a.sort(dso); alpha.sort(dso); } #endif delete [] x; delete [] ratio; #if GUBCOVER==2 if (numberCliques_) { const CoinPackedMatrix * matrixByRow = solver_->getMatrixByRow(); //const double * elementByRow = matrixByRow->getElements(); const int * column = matrixByRow->getIndices(); const CoinBigIndex * rowStart = matrixByRow->getVectorStarts(); const int * rowLength = matrixByRow->getVectorLengths(); //const double * rowUpper = solver_->getRowUpper(); //const double * rowLower = solver_->getRowLower(); int numberColumns = solver_->getNumCols(); double * els = elements_; double * els2 = els+numberColumns; double * weightClique = els2+numberColumns; double * weightClique2 = weightClique+numberCliques_; double * temp=weightClique2+2*numberColumns; //int * count = reinterpret_cast(temp); int * indices = reinterpret_cast (temp+numberCliques_); //int * whichClique = indices+numberColumns; for (i=rowStart[whichRow_];igetNumCols(); #ifdef PRINT_DEBUG CoinZeroN(els,numberColumns); //temp for (i=0;i cover.getNumElements()-1, un-complement // and add it to the pool. double sum=0; for (i=0; i cutRhs+epsilon2_){ #ifdef PRINT_DEBUG printf("Sequentially lifted UpDown cover cut of "); printf("size %i derived from fracCover of size %i.\n", cut.getNumElements(), fracCover.getNumElements()); for (i=0; igetMatrixByRow(); const double * elementByRow = matrixByRow->getElements(); const int * column = matrixByRow->getIndices(); const CoinBigIndex * rowStart = matrixByRow->getVectorStarts(); const int * rowLength = matrixByRow->getVectorLengths(); int numberColumns = solver_->getNumCols(); double * els = elements_; double * els2 = els+numberColumns; for (i=0;i=0) { for (int j=oneFixStart_[iColumn];j=fabs(els2[iColumn])) { #if CGL_DEBUG if (!found) { found=true; printf("Good cut can be improved"); for (i=0;i=0); assert(elements[k]); assert (fabs(elements[k])>1.0e-12); } } #endif rc.setLb(-COIN_DBL_MAX); rc.setUb(cutRhs); // ToDo: what's the default effectiveness? // rc.setEffectiveness(1.0); // Add row cut to the cut set #ifdef PRINT_DEBUG { int k; printf("cutrhs %g %d elements\n",cutRhs,cut.getNumElements()); double * elements = cut.getElements(); int * indices = cut.getIndices(); for (k=0; k 0){ // What order to lift? // Take the to-be-lifted vars in decreasing order of their // xstar solution value. Sort remainder in order of decreasing // xstar value. CoinDecrSolutionOrdered dso1(xstar); remainder.sort(dso1); // a is the part of krow corresponding to vars which have been lifted // alpha are the lifted coefficients with explicit storage of lifted zero // coefficients the a.getIndices() and alpha.getIndices() are identical CoinPackedVector a(cover); CoinPackedVector alpha; int i; for (i=0; i= alpha_2/a_2 >= ... >= alpha_n/a_n // by defining this full-storage array "ratio" to be the external sort key. double * ratio= new double[nCols]; memset(ratio, 0, (nCols*sizeof(double))); #ifdef CGL_DEBUG int alphasize = alpha.getNumElements(); int asize = a.getNumElements(); assert( alphasize == asize ); #endif for (i=0; i epsilon_ ){ ratio[a.getIndices()[i]]=alpha.getElements()[i]/a.getElements()[i]; } else { ratio[a.getIndices()[i]] = 0.0; } } // ToDo: would be nice to have sortkey NOT be full-storage vector CoinDecrSolutionOrdered dso2(ratio); // RLH: JP, Is there a more efficient way? // The sort is identical for a and alpha, but I'm having to sort twice // here, and at every iteration in the loop below. a.sort(dso2); alpha.sort(dso2); #ifdef CGL_DEBUG // sanity check for ( i=1; i=alpha_2/a_2>=...>=alpha_n/a_n order exactSolveKnapsack(alpha.getNumElements(), b-remainder.getElements()[j], alpha.getElements(),a.getElements(),psi_j,x); alpha.insert(remainder.getIndices()[j],cutRhs-psi_j); a.insert(remainder.getIndices()[j],remainder.getElements()[j]); // if the lifted coefficient is non-zero (i.e. psi_j != cutRhs), add it // to the cut if (fabs(cutRhs-psi_j)>epsilon_) cut.insert(remainder.getIndices()[j],cutRhs-psi_j); ratio[remainder.getIndices()[j]]= (cutRhs-psi_j)/remainder.getElements()[j]; CoinDecrSolutionOrdered dso(ratio); a.sort(dso); alpha.sort(dso); } delete [] x; delete [] ratio; } // If the cut is violated, add it to the pool // if (sum over cut.getIndices()) // cut.element()*xstar > cover.getNumElements()-1, un-complement // and add it to the pool. double sum=0; int i; for (i=0; i cutRhs+epsilon2_){ #ifdef PRINT_DEBUG printf("Sequentially lifted cover cut of size %i derived from cover of size %i.\n",cut.getNumElements(), cover.getNumElements()); for (i=0; igetMatrixByRow(); const double * elementByRow = matrixByRow->getElements(); const int * column = matrixByRow->getIndices(); const CoinBigIndex * rowStart = matrixByRow->getVectorStarts(); const int * rowLength = matrixByRow->getVectorLengths(); int numberColumns = solver_->getNumCols(); double * els = elements_; double * els2 = els+numberColumns; for (i=0;i=0) { for (int j=oneFixStart_[iColumn];j=fabs(els2[iColumn])) { #if CGL_DEBUG if (!found) { found=true; printf("Good cut can be improved"); for (i=0;i=0); assert(elements[k]); assert (fabs(elements[k])>1.0e-12); } } #endif rc.setLb(-COIN_DBL_MAX); rc.setUb(cutRhs); // ToDo: what's a meaningful effectivity? // rc.setEffectiveness(1.0); #ifdef PRINT_DEBUG { int k; printf("cutrhs %g\n",cutRhs); double * elements = cut.getElements(); int * indices = cut.getIndices(); for (k=0; k=a_1>=...>=a_(nCover-1) // TODO: right now if the lifted coefficient is zero, // then it's still in the cut. // Should not carry explicit zero coefficients // Calculate the sum of the knapsack coefficients of the cover variables double sum = cover.sum(); // Define lambda to be the "cover excess". // By definition, lambda > 0. If this is not the case, something's screwy. Exit gracefully. double lambda = sum-b; if (lambda < epsilon_) { #ifdef PRINT_DEBUG printf("lambda < epsilon....aborting. \n"); std::cout << "lambda " << lambda << " epsilon " << epsilon_ << std::endl; //abort(); #else //std::cout << "lambda " << lambda << " exiting" << std::endl; #endif return 0; } // mu is vector of partial sums: // mu[i] = sum(j=0 to i) a_j where the cover is C={0,1,..,r} // mu[0] = 0, mu[1]=a_0, mu[2]=a_0+a_1, etc. // and C is assumed to be sorted in nondecreasing knapsack coefficient order. double * mu= new double[cover.getNumElements()+1]; double * muMinusLambda= new double[cover.getNumElements()+1]; memset(mu, 0, (cover.getNumElements()+1)*sizeof(double)); memset(muMinusLambda, 0, (cover.getNumElements()+1)*sizeof(double)); // mu[0] = 0, mu[1]= knapsack coef of cover element 0, etc. muMinusLambda[0]= -lambda; for(i=1; i<(cover.getNumElements()+1); i++){ mu[i]=mu[i-1]+ cover.getElements()[i-1]; muMinusLambda[i]=mu[i]-lambda; } cut.reserve(nRowElem); // the cut coefficent for the members of the cover is 1.0 cut.setConstant(cover.getNumElements(),cover.getIndices(),1.0); // if f(z) is superadditive int h; if (muMinusLambda[1] >= cover.getElements()[1]-epsilon_){ for (h=0; h(i) ); found=1; } else if (remainder.getElements()[h] < muMinusLambda[i+1]+rho[i+1]){ #ifdef CGL_DEBUG bool notE = !cut.isExistingIndex(remainder.getIndices()[h]); assert( notE ); #endif double cutCoef = i+1 - (muMinusLambda[i+1]+rho[i+1]-remainder.getElements()[h])/rho[1]; if (fabs(cutCoef)>epsilon_) cut.insert( remainder.getIndices()[h], cutCoef ); found=1; } i++; } // endwhile } // end for j not in C delete [] rho; } // end else use g delete [] muMinusLambda; delete [] mu; #ifdef GUBCOVER if (goodCut&&numberCliques_) { int n = cut.getNumElements(); const int * ind3; const double * els3; ind3 = cut.getIndices(); els3 = cut.getElements(); const CoinPackedMatrix * matrixByRow = solver_->getMatrixByRow(); const double * elementByRow = matrixByRow->getElements(); const int * column = matrixByRow->getIndices(); const CoinBigIndex * rowStart = matrixByRow->getVectorStarts(); const int * rowLength = matrixByRow->getVectorLengths(); int numberColumns = solver_->getNumCols(); double * els = elements_; double * els2 = els+numberColumns; for (i=0;i=0) { for (int j=oneFixStart_[iColumn];j=fabs(els2[iColumn])) { #if CGL_DEBUG if (!found) { found=true; printf("Good cut can be improved"); for (i=0;i= p_2/w_2 >= ... >= p_n/w_n memset(x, 0, (n)*sizeof(int)); int * xhat = new int[n+1]; memset(xhat, 0, (n+1)*sizeof(int)); int j; // set up: adding the extra element and // accounting for the FORTRAN vs C difference in indexing arrays. double * p = new double[n+2]; double * w = new double[n+2]; int ii; for (ii=1; iichat};" ii=j; double wSemiSum = w[j]; double pSemiSum = p[j]; while (wSemiSum <= chat && ii= zhat + u) goto 5: backtrack;" if (!(z >= zhat + u)) { do { // 3. perform a forward step while (w[j] <= chat){ chat = chat - w[j]; zhat = zhat + p[j]; xhat[j] = 1; j+=1; } if (j<=n) { xhat[j]= 0; j+=1; } } while(j==n); // "if (j z) { z=zhat; int k; for (k=0; k0){ i--; } // "if (no such i exists) return;" if (i==0){ delete [] p; delete [] w; delete [] xhat; return 1; } chat = chat + w[i]; zhat=zhat -p[i]; xhat[i]=0; j=i+1; // "goto 2: compute_ub;" } } //------------------------------------------------------------------- // Default Constructor //------------------------------------------------------------------- CglKnapsackCover::CglKnapsackCover () : CglCutGenerator(), epsilon_(1.0e-07), epsilon2_(1.0e-5), onetol_(1-epsilon_), maxInKnapsack_(50), numRowsToCheck_(-1), rowsToCheck_(0), expensiveCuts_(false) { numberCliques_=0; numberColumns_=0; cliqueType_=NULL; cliqueStart_=NULL; cliqueEntry_=NULL; oneFixStart_=NULL; zeroFixStart_=NULL; endFixStart_=NULL; whichClique_=NULL; canDoGlobalCuts_=true; } //------------------------------------------------------------------- // Copy constructor //------------------------------------------------------------------- CglKnapsackCover::CglKnapsackCover (const CglKnapsackCover & source) : CglCutGenerator(source), epsilon_(source.epsilon_), epsilon2_(source.epsilon2_), onetol_(source.onetol_), maxInKnapsack_(source.maxInKnapsack_), numRowsToCheck_(source.numRowsToCheck_), rowsToCheck_(0), expensiveCuts_(source.expensiveCuts_) { if (numRowsToCheck_ > 0) { rowsToCheck_ = new int[numRowsToCheck_]; CoinCopyN(source.rowsToCheck_, numRowsToCheck_, rowsToCheck_); } numberCliques_=source.numberCliques_; numberColumns_=source.numberColumns_; if (numberCliques_) { cliqueType_ = new cliqueType [numberCliques_]; CoinMemcpyN(source.cliqueType_,numberCliques_,cliqueType_); cliqueStart_ = new int [numberCliques_+1]; CoinMemcpyN(source.cliqueStart_,(numberCliques_+1),cliqueStart_); int n = cliqueStart_[numberCliques_]; cliqueEntry_ = new cliqueEntry [n]; CoinMemcpyN(source.cliqueEntry_,n,cliqueEntry_); oneFixStart_ = new int [numberColumns_]; CoinMemcpyN(source.oneFixStart_,numberColumns_,oneFixStart_); zeroFixStart_ = new int [numberColumns_]; CoinMemcpyN(source.zeroFixStart_,numberColumns_,zeroFixStart_); endFixStart_ = new int [numberColumns_]; CoinMemcpyN(source.endFixStart_,numberColumns_,endFixStart_); #ifndef NDEBUG int n2=-1; for (int i=numberColumns_-1;i>=0;i--) { if (oneFixStart_[i]>=0) { n2=endFixStart_[i]; break; } } assert (n==n2); #endif whichClique_ = new int [n]; CoinMemcpyN(source.whichClique_,n,whichClique_); } else { cliqueType_=NULL; cliqueStart_=NULL; cliqueEntry_=NULL; oneFixStart_=NULL; zeroFixStart_=NULL; endFixStart_=NULL; whichClique_=NULL; } } //------------------------------------------------------------------- // Clone //------------------------------------------------------------------- CglCutGenerator * CglKnapsackCover::clone() const { return new CglKnapsackCover(*this); } //------------------------------------------------------------------- // Destructor //------------------------------------------------------------------- CglKnapsackCover::~CglKnapsackCover () { delete[] rowsToCheck_; deleteCliques(); } //---------------------------------------------------------------- // Assignment operator //------------------------------------------------------------------- CglKnapsackCover & CglKnapsackCover::operator=(const CglKnapsackCover& rhs) { if (this != &rhs) { CglCutGenerator::operator=(rhs); epsilon_=rhs.epsilon_; epsilon2_=rhs.epsilon2_; onetol_=rhs.onetol_; maxInKnapsack_=rhs.maxInKnapsack_; delete[] rowsToCheck_; numRowsToCheck_ = rhs.numRowsToCheck_; if (numRowsToCheck_ > 0) { rowsToCheck_ = new int[numRowsToCheck_]; CoinCopyN(rhs.rowsToCheck_, numRowsToCheck_, rowsToCheck_); } else { rowsToCheck_ = 0; } expensiveCuts_ = rhs.expensiveCuts_; deleteCliques(); numberCliques_=rhs.numberCliques_; numberColumns_=rhs.numberColumns_; if (numberCliques_) { cliqueType_ = new cliqueType [numberCliques_]; CoinMemcpyN(rhs.cliqueType_,numberCliques_,cliqueType_); cliqueStart_ = new int [numberCliques_+1]; CoinMemcpyN(rhs.cliqueStart_,(numberCliques_+1),cliqueStart_); int n = cliqueStart_[numberCliques_]; cliqueEntry_ = new cliqueEntry [n]; CoinMemcpyN(rhs.cliqueEntry_,n,cliqueEntry_); oneFixStart_ = new int [numberColumns_]; CoinMemcpyN(rhs.oneFixStart_,numberColumns_,oneFixStart_); zeroFixStart_ = new int [numberColumns_]; CoinMemcpyN(rhs.zeroFixStart_,numberColumns_,zeroFixStart_); endFixStart_ = new int [numberColumns_]; CoinMemcpyN(rhs.endFixStart_,numberColumns_,endFixStart_); #ifndef NDEBUG int n2=-1; for (int i=numberColumns_-1;i>=0;i--) { if (oneFixStart_[i]>=0) { n2=endFixStart_[i]; break; } } assert (n==n2); #endif whichClique_ = new int [n]; CoinMemcpyN(rhs.whichClique_,n,whichClique_); } } return *this; } // Create C++ lines to get to current state std::string CglKnapsackCover::generateCpp( FILE * fp) { CglKnapsackCover other; fprintf(fp,"0#include \"CglKnapsackCover.hpp\"\n"); fprintf(fp,"3 CglKnapsackCover knapsackCover;\n"); if (maxInKnapsack_!=other.maxInKnapsack_) fprintf(fp,"3 knapsackCover.setMaxInKnapsack(%d);\n",maxInKnapsack_); else fprintf(fp,"4 knapsackCover.setMaxInKnapsack(%d);\n",maxInKnapsack_); if (expensiveCuts_ != other.expensiveCuts_) { if (expensiveCuts_) fprintf(fp,"3 knapsackCover.switchOnExpensive();\n"); else fprintf(fp,"3 knapsackCover.switchOffExpensive();\n"); } else { if (expensiveCuts_) fprintf(fp,"4 knapsackCover.switchOnExpensive();\n"); else fprintf(fp,"4 knapsackCover.switchOffExpensive();\n"); } if (getAggressiveness()!=other.getAggressiveness()) fprintf(fp,"3 knapsackCover.setAggressiveness(%d);\n",getAggressiveness()); else fprintf(fp,"4 knapsackCover.setAggressiveness(%d);\n",getAggressiveness()); return "knapsackCover"; } // This can be used to refresh any information void CglKnapsackCover::refreshSolver(OsiSolverInterface * solver) { #ifdef GUBCOVER deleteCliques(); if (solver->getMatrixByCol()) createCliques( *solver,2,200,false); #endif } /* Creates cliques for use by probing. Can also try and extend cliques as a result of probing (root node). Returns number of cliques found. */ int CglKnapsackCover::createCliques( OsiSolverInterface & si, int minimumSize, int maximumSize, bool /*extendCliques*/) { // Should be 0 unless you're debugging! const int logLevel = 0 ; // get rid of what is there deleteCliques(); CoinPackedMatrix matrixByRow(*si.getMatrixByRow()); int numberRows = si.getNumRows(); numberColumns_ = si.getNumCols(); numberCliques_=0; int numberEntries=0; int numberIntegers=0; int * lookup = new int[numberColumns_]; int i; for (i=0;i0.0) { which[numberP1++]=iColumn; } else { numberM1++; which[numberIntegers-numberM1]=iColumn; } } int iUpper = static_cast (floor(upperValue+1.0e-5)); int iLower = static_cast (ceil(lowerValue-1.0e-5)); int state=0; if (upperValue<1.0e6) { if (iUpper==1-numberM1) state=1; else if (iUpper==-numberM1) state=2; else if (iUpper<-numberM1) state=3; } if (!state&&lowerValue>-1.0e6) { if (-iLower==1-numberP1) state=-1; else if (-iLower==-numberP1) state=-2; else if (-iLower<-numberP1) state=-3; } if (good&&state) { if (abs(state)==3) { // infeasible numberCliques_ = -99999; break; } else if (abs(state)==2) { // we can fix all numberFixed += numberP1+numberM1; if (state>0) { // fix all +1 at 0, -1 at 1 for (i=0;i1) printf("bad clique %d +1, %d -1\n", numberP1,numberM1); length=0; } totalP1 += numberP1; totalM1 += numberM1; if (length >= minimumSize&&length= maximumSize) { // too big numberBig++; totalBig += length; } } } } if (logLevel > 0) { if (numberCliques_<0) { printf("*** Problem infeasible\n"); } else { if (numberCliques_) { if (logLevel>1) printf("%d cliques of average size %g found, %d P1, %d M1\n", numberCliques_, (static_cast(totalP1+totalM1))/ (static_cast (numberCliques_)), totalP1,totalM1); } else { if (logLevel>1) printf("No cliques found\n"); } if (numberBig) { if (logLevel>1) printf("%d large cliques ( >= %d) found, total %d\n", numberBig,maximumSize,totalBig); } if (numberFixed) { printf("%d variables fixed\n",numberFixed); } } } if (numberCliques_>0) { cliqueType_ = new cliqueType [numberCliques_]; cliqueStart_ = new int [numberCliques_+1]; cliqueEntry_ = new cliqueEntry [numberEntries]; oneFixStart_ = new int [numberColumns_]; zeroFixStart_ = new int [numberColumns_]; endFixStart_ = new int [numberColumns_]; whichClique_ = new int [numberEntries]; numberEntries=0; cliqueStart_[0]=0; for (i=0;i0.0) { which[numberP1++]=iColumn; } else { numberM1++; which[numberIntegers-numberM1]=iColumn; } } int iUpper = static_cast (floor(upperValue+1.0e-5)); int iLower = static_cast (ceil(lowerValue-1.0e-5)); int state=0; if (upperValue<1.0e6) { if (iUpper==1-numberM1) state=1; } if (!state&&lowerValue>-1.0e6) { state=-1; } if (abs(state)!=1) continue; // must have been fixed if (iLower==iUpper) { cliqueType_[numberCliques_].equality=1; } else { cliqueType_[numberCliques_].equality=0; } if (state>0) { for (i=0;i=0) { int n1=oneFixStart_[iColumn]; int n2=zeroFixStart_[iColumn]; oneFixStart_[iColumn]=numberEntries; which[iColumn]=numberEntries; numberEntries += n1; zeroFixStart_[iColumn]=numberEntries; endFixStart_[iColumn]=numberEntries; numberEntries += n2; } } // now put in for (iClique=0;iClique. 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: Cgl-0.58.9/MSVisualStudio/0000755000076600007660000000000012377555671013715 5ustar coincoinCgl-0.58.9/MSVisualStudio/v10/0000755000076600007660000000000012377555671014323 5ustar coincoinCgl-0.58.9/MSVisualStudio/v10/Cgl.sln0000644000076600007660000001212011540154466015526 0ustar coincoin Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCgl", "libCgl\libCgl.vcxproj", "{DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CglUnitTest", "CglUnitTest\CglUnitTest.vcxproj", "{2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}" 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}") = "libOsi", "..\..\..\Osi\MSVisualStudio\v10\libOsi\libOsi.vcxproj", "{7D98E2CB-876E-4F75-9F71-77D3FE87E149}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libClp", "..\..\..\Clp\MSVisualStudio\v10\libClp\libClp.vcxproj", "{4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOsiClp", "..\..\..\Clp\MSVisualStudio\v10\libOsiClp\libOsiClp.vcxproj", "{02D45875-A8CF-41B9-990B-3699C0ECFE10}" 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 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|Win32.ActiveCfg = Debug|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|Win32.Build.0 = Debug|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|x64.ActiveCfg = Debug|x64 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|x64.Build.0 = Debug|x64 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|Win32.ActiveCfg = Release|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|Win32.Build.0 = Release|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|x64.ActiveCfg = Release|x64 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|x64.Build.0 = Release|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|Win32.ActiveCfg = Debug|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|Win32.Build.0 = Debug|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|x64.ActiveCfg = Debug|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|x64.Build.0 = Debug|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Release|Win32.ActiveCfg = Release|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Release|Win32.Build.0 = Release|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Release|x64.ActiveCfg = Release|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.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 {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 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|Win32.ActiveCfg = Debug|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|Win32.Build.0 = Debug|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|x64.ActiveCfg = Debug|x64 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|x64.Build.0 = Debug|x64 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|Win32.ActiveCfg = Release|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|Win32.Build.0 = Release|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|x64.ActiveCfg = Release|x64 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|x64.Build.0 = Release|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|Win32.ActiveCfg = Debug|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|Win32.Build.0 = Debug|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|x64.ActiveCfg = Debug|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|x64.Build.0 = Debug|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|Win32.ActiveCfg = Release|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|Win32.Build.0 = Release|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|x64.ActiveCfg = Release|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal Cgl-0.58.9/MSVisualStudio/v10/CglUnitTest/0000755000076600007660000000000012377555671016530 5ustar coincoinCgl-0.58.9/MSVisualStudio/v10/CglUnitTest/CglUnitTest.vcxproj0000644000076600007660000004032712106747610022342 0ustar coincoin Debug Win32 Debug x64 Release Win32 Release x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE} CglUnitTest Win32Proj Application Unicode true Application Unicode Application Unicode true Application Unicode <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ..\..\..\src\CglClique;..\..\..\src\CglDuplicateRow;..\..\..\src\CglFlowCover;..\..\..\src\CglGomory;..\..\..\src\CglKnapsackCover;..\..\..\src\CglLandP;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglOddHole;..\..\..\src\CglPreProcess;..\..\..\src\CglProbing;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglSimpleRounding;..\..\..\src\CglTwomir;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;COIN_HAS_OSICLP;SAMPLEDIR="..\\..\\..\\..\\Data\\Sample";TESTDIR="..\\..\\..\\test\\CglTestData";%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue true Console MachineX86 $(OutDir) libCoinUtils.lib;libOsi.lib;libClp.lib;libOsiClp.lib;libCgl.lib;%(AdditionalDependencies) false MaxSpeed true ..\..\..\src\CglClique;..\..\..\src\CglDuplicateRow;..\..\..\src\CglFlowCover;..\..\..\src\CglGomory;..\..\..\src\CglKnapsackCover;..\..\..\src\CglLandP;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglOddHole;..\..\..\src\CglPreProcess;..\..\..\src\CglProbing;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglSimpleRounding;..\..\..\src\CglTwomir;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;COIN_HAS_OSICLP;SAMPLEDIR="..\\..\\..\\..\\Data\\Sample";TESTDIR="..\\..\\..\\test\\CglTestData";%(PreprocessorDefinitions) MultiThreadedDLL true Level3 ProgramDatabase true Console true true MachineX86 $(OutDir) libCoinUtils.lib;libOsi.lib;libClp.lib;libOsiClp.lib;libCgl.lib;%(AdditionalDependencies) false X64 Disabled ..\..\..\src\CglClique;..\..\..\src\CglDuplicateRow;..\..\..\src\CglFlowCover;..\..\..\src\CglGomory;..\..\..\src\CglKnapsackCover;..\..\..\src\CglLandP;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglOddHole;..\..\..\src\CglPreProcess;..\..\..\src\CglProbing;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglSimpleRounding;..\..\..\src\CglTwomir;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;COIN_HAS_OSICLP;SAMPLEDIR="..\\..\\..\\..\\Data\\Sample";TESTDIR="..\\..\\..\\test\\CglTestData";%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase true Console MachineX64 $(OutDir) libCoinUtils.lib;libOsi.lib;libClp.lib;libOsiClp.lib;libCgl.lib;%(AdditionalDependencies) false X64 MaxSpeed true ..\..\..\src\CglClique;..\..\..\src\CglDuplicateRow;..\..\..\src\CglFlowCover;..\..\..\src\CglGomory;..\..\..\src\CglKnapsackCover;..\..\..\src\CglLandP;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglOddHole;..\..\..\src\CglPreProcess;..\..\..\src\CglProbing;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglSimpleRounding;..\..\..\src\CglTwomir;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;COIN_HAS_OSICLP;SAMPLEDIR="..\\..\\..\\..\\Data\\Sample";TESTDIR="..\\..\\..\\test\\CglTestData";%(PreprocessorDefinitions) MultiThreadedDLL true Level3 ProgramDatabase true Console true true MachineX64 $(OutDir) libCoinUtils.lib;libOsi.lib;libClp.lib;libOsiClp.lib;libCgl.lib;%(AdditionalDependencies) false {4f8f7d1c-3a9e-444d-8ee9-77f33fa05994} false {02d45875-a8cf-41b9-990b-3699c0ecfe10} false {c4867f15-438d-4ff8-8388-62fbaaa9786c} false true false false false {7d98e2cb-876e-4f75-9f71-77d3fe87e149} false {dbea3904-f0b8-408a-9e1a-6497febe8c42} false Cgl-0.58.9/MSVisualStudio/v10/libCgl/0000755000076600007660000000000012377555671015517 5ustar coincoinCgl-0.58.9/MSVisualStudio/v10/libCgl/libCgl.vcxproj0000644000076600007660000014605012131314431020305 0ustar coincoin Debug Win32 Debug x64 Release Win32 Release x64 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42} libCgl StaticLibrary StaticLibrary StaticLibrary StaticLibrary <_ProjectFileVersion>10.0.30319.1 AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset ..\..\..\src\CglDuplicateRow;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglFlowCover;..\..\..\src\CglClique;..\..\..\src\CglOddHole;..\..\..\src\CglKnapsackCover;..\..\..\src\CglGomory;..\..\..\src\CglPreProcess;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglProbing;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_SCL_SECURE_NO_WARNINGS true true true Level3 true Default NDEBUG;%(PreprocessorDefinitions) 0x0409 true ..\..\..\src\CglDuplicateRow;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglFlowCover;..\..\..\src\CglClique;..\..\..\src\CglOddHole;..\..\..\src\CglKnapsackCover;..\..\..\src\CglGomory;..\..\..\src\CglPreProcess;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglProbing;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_SCL_SECURE_NO_WARNINGS _DEBUG;%(PreprocessorDefinitions) 0x0409 true X64 Default ..\..\..\src\CglDuplicateRow;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglFlowCover;..\..\..\src\CglClique;..\..\..\src\CglOddHole;..\..\..\src\CglKnapsackCover;..\..\..\src\CglGomory;..\..\..\src\CglPreProcess;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglProbing;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_SCL_SECURE_NO_WARNINGS Level3 true NDEBUG;%(PreprocessorDefinitions) 0x0409 true X64 ..\..\..\src\CglDuplicateRow;..\..\..\src\CglMixedIntegerRounding;..\..\..\src\CglMixedIntegerRounding2;..\..\..\src\CglFlowCover;..\..\..\src\CglClique;..\..\..\src\CglOddHole;..\..\..\src\CglKnapsackCover;..\..\..\src\CglGomory;..\..\..\src\CglPreProcess;..\..\..\src\CglRedSplit;..\..\..\src\CglResidualCapacity;..\..\..\src\CglProbing;..\..\..\src;..\..\..\..\Osi\src\Osi;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Clp\src;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_SCL_SECURE_NO_WARNINGS true EnableFastChecks true Level3 true ProgramDatabase Default _DEBUG;%(PreprocessorDefinitions) 0x0409 true Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks Disabled %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) EnableFastChecks MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) MaxSpeed %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) Cgl-0.58.9/MSVisualStudio/v9/0000755000076600007660000000000012377555671014253 5ustar coincoinCgl-0.58.9/MSVisualStudio/v9/Cgl.sln0000644000076600007660000001305511527572763015477 0ustar coincoin Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCgl", "libCgl\libCgl.vcproj", "{DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CglUnitTest", "CglUnitTest\CglUnitTest.vcproj", "{2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}" ProjectSection(ProjectDependencies) = postProject {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42} = {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42} {C4867F15-438D-4FF8-8388-62FBAAA9786C} = {C4867F15-438D-4FF8-8388-62FBAAA9786C} {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994} = {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994} {02D45875-A8CF-41B9-990B-3699C0ECFE10} = {02D45875-A8CF-41B9-990B-3699C0ECFE10} {7D98E2CB-876E-4F75-9F71-77D3FE87E149} = {7D98E2CB-876E-4F75-9F71-77D3FE87E149} 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}") = "libOsi", "..\..\..\Osi\MSVisualStudio\v9\libOsi\libOsi.vcproj", "{7D98E2CB-876E-4F75-9F71-77D3FE87E149}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libClp", "..\..\..\Clp\MSVisualStudio\v9\libClp\libClp.vcproj", "{4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOsiClp", "..\..\..\Clp\MSVisualStudio\v9\libOsiClp\libOsiClp.vcproj", "{02D45875-A8CF-41B9-990B-3699C0ECFE10}" 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 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|Win32.ActiveCfg = Debug|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|Win32.Build.0 = Debug|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|x64.ActiveCfg = Debug|x64 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Debug|x64.Build.0 = Debug|x64 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|Win32.ActiveCfg = Release|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|Win32.Build.0 = Release|Win32 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|x64.ActiveCfg = Release|x64 {DBEA3904-F0B8-408A-9E1A-6497FEBE8C42}.Release|x64.Build.0 = Release|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|Win32.ActiveCfg = Debug|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|Win32.Build.0 = Debug|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|x64.ActiveCfg = Debug|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Debug|x64.Build.0 = Debug|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Release|Win32.ActiveCfg = Release|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Release|Win32.Build.0 = Release|Win32 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.Release|x64.ActiveCfg = Release|x64 {2775A6EA-AAC5-4A94-BCDF-CE353DCCA7BE}.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 {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 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|Win32.ActiveCfg = Debug|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|Win32.Build.0 = Debug|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|x64.ActiveCfg = Debug|x64 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Debug|x64.Build.0 = Debug|x64 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|Win32.ActiveCfg = Release|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|Win32.Build.0 = Release|Win32 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|x64.ActiveCfg = Release|x64 {4F8F7D1C-3A9E-444D-8EE9-77F33FA05994}.Release|x64.Build.0 = Release|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|Win32.ActiveCfg = Debug|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|Win32.Build.0 = Debug|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|x64.ActiveCfg = Debug|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Debug|x64.Build.0 = Debug|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|Win32.ActiveCfg = Release|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|Win32.Build.0 = Release|Win32 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|x64.ActiveCfg = Release|x64 {02D45875-A8CF-41B9-990B-3699C0ECFE10}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal Cgl-0.58.9/MSVisualStudio/v9/CglUnitTest/0000755000076600007660000000000012377555671016460 5ustar coincoinCgl-0.58.9/MSVisualStudio/v9/CglUnitTest/CglUnitTest.vcproj0000644000076600007660000002553511475617142022112 0ustar coincoin Cgl-0.58.9/MSVisualStudio/v9/libCgl/0000755000076600007660000000000012377555671015447 5ustar coincoinCgl-0.58.9/MSVisualStudio/v9/libCgl/libCgl.vcproj0000644000076600007660000010300712131314431020040 0ustar coincoin Cgl-0.58.9/Makefile.in0000644000076600007660000007774112240340055013060 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@ # 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_1 = test DIST_COMMON = README $(am__configure_deps) \ $(srcdir)/BuildTools/Makemain.inc $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/cgl-uninstalled.pc.in \ $(srcdir)/cgl.pc.in $(top_srcdir)/configure \ $(top_srcdir)/doxydoc/doxygen.conf.in \ $(top_srcdir)/examples/Makefile.in AUTHORS config.guess \ config.sub depcomp install-sh ltmain.sh missing @HAVE_EXTERNALS_TRUE@am__append_2 = Dependencies @HAVE_EXTERNALS_TRUE@am__append_3 = .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/config.h \ $(top_builddir)/src/config_cgl.h CONFIG_CLEAN_FILES = examples/Makefile cgl.pc cgl-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 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@ CGLLIB_CFLAGS = @CGLLIB_CFLAGS@ CGLLIB_CFLAGS_INSTALLED = @CGLLIB_CFLAGS_INSTALLED@ CGLLIB_DEPENDENCIES = @CGLLIB_DEPENDENCIES@ CGLLIB_LIBS = @CGLLIB_LIBS@ CGLLIB_LIBS_INSTALLED = @CGLLIB_LIBS_INSTALLED@ CGLLIB_PCLIBS = @CGLLIB_PCLIBS@ CGLLIB_PCREQUIRES = @CGLLIB_PCREQUIRES@ CGL_SUBDIRS = @CGL_SUBDIRS@ CGL_SUBLIBS = @CGL_SUBLIBS@ CGL_SVN_REV = @CGL_SVN_REV@ 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_OSICLP_FALSE = @COIN_HAS_OSICLP_FALSE@ COIN_HAS_OSICLP_TRUE = @COIN_HAS_OSICLP_TRUE@ COIN_HAS_OSICPX_FALSE = @COIN_HAS_OSICPX_FALSE@ COIN_HAS_OSICPX_TRUE = @COIN_HAS_OSICPX_TRUE@ COIN_HAS_OSIDYLP_FALSE = @COIN_HAS_OSIDYLP_FALSE@ COIN_HAS_OSIDYLP_TRUE = @COIN_HAS_OSIDYLP_TRUE@ COIN_HAS_OSIGLPK_FALSE = @COIN_HAS_OSIGLPK_FALSE@ COIN_HAS_OSIGLPK_TRUE = @COIN_HAS_OSIGLPK_TRUE@ COIN_HAS_OSIMSK_FALSE = @COIN_HAS_OSIMSK_FALSE@ COIN_HAS_OSIMSK_TRUE = @COIN_HAS_OSIMSK_TRUE@ COIN_HAS_OSIVOL_FALSE = @COIN_HAS_OSIVOL_FALSE@ COIN_HAS_OSIVOL_TRUE = @COIN_HAS_OSIVOL_TRUE@ COIN_HAS_OSIXPR_FALSE = @COIN_HAS_OSIXPR_FALSE@ COIN_HAS_OSIXPR_TRUE = @COIN_HAS_OSIXPR_TRUE@ COIN_HAS_OSI_FALSE = @COIN_HAS_OSI_FALSE@ COIN_HAS_OSI_TRUE = @COIN_HAS_OSI_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_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@ COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ 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@ OBJEXT = @OBJEXT@ OPT_CFLAGS = @OPT_CFLAGS@ OPT_CXXFLAGS = @OPT_CXXFLAGS@ OSICLP_CFLAGS = @OSICLP_CFLAGS@ OSICLP_CFLAGS_INSTALLED = @OSICLP_CFLAGS_INSTALLED@ OSICLP_DATA = @OSICLP_DATA@ OSICLP_DATA_INSTALLED = @OSICLP_DATA_INSTALLED@ OSICLP_DEPENDENCIES = @OSICLP_DEPENDENCIES@ OSICLP_LIBS = @OSICLP_LIBS@ OSICLP_LIBS_INSTALLED = @OSICLP_LIBS_INSTALLED@ OSICPX_CFLAGS = @OSICPX_CFLAGS@ OSICPX_CFLAGS_INSTALLED = @OSICPX_CFLAGS_INSTALLED@ OSICPX_DATA = @OSICPX_DATA@ OSICPX_DATA_INSTALLED = @OSICPX_DATA_INSTALLED@ OSICPX_DEPENDENCIES = @OSICPX_DEPENDENCIES@ OSICPX_LIBS = @OSICPX_LIBS@ OSICPX_LIBS_INSTALLED = @OSICPX_LIBS_INSTALLED@ OSIDYLP_CFLAGS = @OSIDYLP_CFLAGS@ OSIDYLP_CFLAGS_INSTALLED = @OSIDYLP_CFLAGS_INSTALLED@ OSIDYLP_DATA = @OSIDYLP_DATA@ OSIDYLP_DATA_INSTALLED = @OSIDYLP_DATA_INSTALLED@ OSIDYLP_DEPENDENCIES = @OSIDYLP_DEPENDENCIES@ OSIDYLP_LIBS = @OSIDYLP_LIBS@ OSIDYLP_LIBS_INSTALLED = @OSIDYLP_LIBS_INSTALLED@ OSIGLPK_CFLAGS = @OSIGLPK_CFLAGS@ OSIGLPK_CFLAGS_INSTALLED = @OSIGLPK_CFLAGS_INSTALLED@ OSIGLPK_DATA = @OSIGLPK_DATA@ OSIGLPK_DATA_INSTALLED = @OSIGLPK_DATA_INSTALLED@ OSIGLPK_DEPENDENCIES = @OSIGLPK_DEPENDENCIES@ OSIGLPK_LIBS = @OSIGLPK_LIBS@ OSIGLPK_LIBS_INSTALLED = @OSIGLPK_LIBS_INSTALLED@ OSIMSK_CFLAGS = @OSIMSK_CFLAGS@ OSIMSK_CFLAGS_INSTALLED = @OSIMSK_CFLAGS_INSTALLED@ OSIMSK_DATA = @OSIMSK_DATA@ OSIMSK_DATA_INSTALLED = @OSIMSK_DATA_INSTALLED@ OSIMSK_DEPENDENCIES = @OSIMSK_DEPENDENCIES@ OSIMSK_LIBS = @OSIMSK_LIBS@ OSIMSK_LIBS_INSTALLED = @OSIMSK_LIBS_INSTALLED@ OSIVOL_CFLAGS = @OSIVOL_CFLAGS@ OSIVOL_CFLAGS_INSTALLED = @OSIVOL_CFLAGS_INSTALLED@ OSIVOL_DATA = @OSIVOL_DATA@ OSIVOL_DATA_INSTALLED = @OSIVOL_DATA_INSTALLED@ OSIVOL_DEPENDENCIES = @OSIVOL_DEPENDENCIES@ OSIVOL_LIBS = @OSIVOL_LIBS@ OSIVOL_LIBS_INSTALLED = @OSIVOL_LIBS_INSTALLED@ OSIXPR_CFLAGS = @OSIXPR_CFLAGS@ OSIXPR_CFLAGS_INSTALLED = @OSIXPR_CFLAGS_INSTALLED@ OSIXPR_DATA = @OSIXPR_DATA@ OSIXPR_DATA_INSTALLED = @OSIXPR_DATA_INSTALLED@ OSIXPR_DEPENDENCIES = @OSIXPR_DEPENDENCIES@ OSIXPR_LIBS = @OSIXPR_LIBS@ OSIXPR_LIBS_INSTALLED = @OSIXPR_LIBS_INSTALLED@ OSI_CFLAGS = @OSI_CFLAGS@ OSI_CFLAGS_INSTALLED = @OSI_CFLAGS_INSTALLED@ OSI_DATA = @OSI_DATA@ OSI_DATA_INSTALLED = @OSI_DATA_INSTALLED@ OSI_DEPENDENCIES = @OSI_DEPENDENCIES@ OSI_LIBS = @OSI_LIBS@ OSI_LIBS_INSTALLED = @OSI_LIBS_INSTALLED@ 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@ STRIP = @STRIP@ VERSION = @VERSION@ VPATH_DISTCLEANFILES = @VPATH_DISTCLEANFILES@ 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 # ######################################################################## SUBDIRS = src $(am__append_1) ######################################################################## # Additional files to be included in tarball # ######################################################################## # Here we need include all files that are not mentioned in other Makefiles EXTRA_DIST = examples/cgl1.cpp examples/cgl_data_test.cpp \ examples/Makefile.in $(am__append_2) ######################################################################## # Installation of the addlibs file # ######################################################################## pkgconfiglibdir = $(libdir)/pkgconfig pkgconfiglib_DATA = cgl.pc addlibsdir = $(DESTDIR)$(datadir)/coin/doc/Cgl ######################################################################## # Maintainer Stuff # ######################################################################## CLEANFILES = # Files that are generated and should be cleaned with make distclean DISTCLEANFILES = $(am__append_3) $(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 $@ cgl.pc: $(top_builddir)/config.status $(srcdir)/cgl.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ cgl-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/cgl-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 @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 cgl > $(addlibsdir)/cgl_addlibs.txt @COIN_CXX_IS_CL_TRUE@@COIN_HAS_PKGCONFIG_FALSE@ echo "-libpath:`$(CYGPATH_W) @abs_lib_dir@` libCgl.lib @CGLLIB_LIBS_INSTALLED@" > $(addlibsdir)/cgl_addlibs.txt @COIN_CXX_IS_CL_FALSE@@COIN_HAS_PKGCONFIG_FALSE@ echo -L@abs_lib_dir@ -lCgl @CGLLIB_LIBS_INSTALLED@ > $(addlibsdir)/cgl_addlibs.txt uninstall-hook: rm -f $(addlibsdir)/cgl_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: Cgl-0.58.9/ltmain.sh0000755000076600007660000057753011405215371012643 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: Cgl-0.58.9/missing0000755000076600007660000002540611405215371012405 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: Cgl-0.58.9/README0000644000076600007660000000363111507177625011676 0ustar coincoinCUT GENERATION LIBRARY README ============================= In this document, the following names are used: 1. 'coin-Cgl' is the full path to the directory in which you have dowloaded Cgl. 2. 'build' is the full path to the directory used for the installation of Cgl. It might be coin-Cgl or any other directory of your choosing. OVERVIEW ======== Welcome to the COIN-OR Cut Generator Library (Cgl). Cgl 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 others. This README file may be distributed freely. The COIN-OR Cut Generation Library is a collection of cut generators that can be used with other COIN-OR projects that make use of cuts, such as, among others, the linear solver Clp or the mixed integer linear programming solvers Cbc or BCP. Each cut generator is in a separate directory with its own maintainer. Maintainer names are listed in the AUTHORS file in the Cgl directory. For more information, see the Cgl Trac page (see below). CGL TRAC PAGE ============= https://projects.coin-or.org/Cgl INSTALLATION ============ If you have downloaded the Cgl package in the local directory coin-Cgl, please see the INSTALL file in coin-Cgl for a guide to install this package. If you have obtained Cgl by downloading another package, Cgl should be installed as part of the installation of that package. See the INSTALL file in the main directory of the package. SUPPORT ======= 1. Authors See the AUTHORS file. 2. Project Managers Robin Lougee-Heimer, robinlh@us.ibm.com Francois Margot, fmargot@andrew.cmu.edu 3. Mailing List Cgl users should use the Cgl mailing list. To subscribe, go to http://list.coin-or.org/mailman/listinfo/cgl 4. Bug Reports Bug reports should be posted to the Cgl mailing list and/or on the Cgl Trac page. Cgl-0.58.9/test/0000755000076600007660000000000012377555671012001 5ustar coincoinCgl-0.58.9/test/unitTest.cpp0000644000076600007660000003742412130104734014307 0ustar coincoin// $Id: unitTest.cpp 1123 2013-04-06 20:47:24Z stefan $ // 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). // Test individual classes or groups of classes #include "CoinPragma.hpp" #include "CglConfig.h" #include #include #include #include #include #ifdef COIN_HAS_OSICPX #include #endif #ifdef COIN_HAS_OSIXPR #include #endif #ifdef COIN_HAS_OSICLP #include #endif #ifdef COIN_HAS_OSIDYLP #include #endif #ifdef COIN_HAS_OSIGLPK #include #endif #ifdef COIN_HAS_OSIVOL #include #endif #include "CglSimpleRounding.hpp" #include "CglKnapsackCover.hpp" #include "CglOddHole.hpp" #include "CglProbing.hpp" #include "CglGomory.hpp" #include "CglLandP.hpp" #include "CglMixedIntegerRounding.hpp" #include "CglMixedIntegerRounding2.hpp" #include "CglResidualCapacity.hpp" #include "CglRedSplit.hpp" #include "CglRedSplit2.hpp" #include "CglTwomir.hpp" #include "CglClique.hpp" #include "CglFlowCover.hpp" #include "CglZeroHalf.hpp" // Function Prototypes. Function definitions is in this file. void testingMessage( const char * const msg ); // Command line parameters are directories containing data files. // You must specify both mpsDir and testDir, in order. // If not specified, then "../../Data/Sample/" and // "CglTestData/" are used int main (int argc, const char *argv[]) { // Initialize directories containing data files. std::string mpsDir; std::string testDir; const char dirsep = CoinFindDirSeparator(); if (dirsep == '/') { #ifdef SAMPLEDIR mpsDir = SAMPLEDIR "/" ; #else mpsDir = "../../Data/Sample/"; #endif #ifdef TESTDIR testDir = TESTDIR "/" ; #else testDir = "CglTestData/"; #endif } else { #ifdef SAMPLEDIR mpsDir = SAMPLEDIR "\\" ; #else mpsDir = "..\\..\\Data\\Sample\\"; #endif #ifdef TESTDIR testDir = TESTDIR "\\"; #else testDir = "CglTestData\\"; #endif } // Check for command line override if (argc >= 2) { mpsDir = argv[1]; mpsDir += dirsep; if (argc >= 3) { testDir = argv[2]; testDir += dirsep; } } #ifdef COIN_HAS_OSICPX { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglGomory with OsiCpxSolverInterface\n" ); CglGomoryUnitTest(&cpxSi,mpsDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglSimpleRounding with OsiCpxSolverInterface\n" ); CglSimpleRoundingUnitTest(&cpxSi,mpsDir); } if(0) // Test does not work with Cplex { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglKnapsackCover with OsiCpxSolverInterface\n" ); CglKnapsackCoverUnitTest(&cpxSi,mpsDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglOddHole with OsiCpxSolverInterface\n" ); CglOddHoleUnitTest(&cpxSi,mpsDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglProbing with OsiCpxSolverInterface\n" ); CglProbingUnitTest(&cpxSi,mpsDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglMixedIntegerRounding with OsiCpxSolverInterface\n" ); CglMixedIntegerRoundingUnitTest(&cpxSi, testDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglMixedIntegerRounding2 with OsiCpxSolverInterface\n" ); CglMixedIntegerRounding2UnitTest(&cpxSi, testDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglResidualCapacity with OsiCpxSolverInterface\n" ); CglResidualCapacityUnitTest(&cpxSi, testDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglRedSplit with OsiCpxSolverInterface\n" ); CglRedSplitUnitTest(&cpxSi, mpsDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglTwomir with OsiCpxSolverInterface\n" ); CglTwomirUnitTest(&cpxSi, testDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglClique with OsiCpxSolverInterface\n" ); CglCliqueUnitTest(&cpxSi, testDir); } { OsiCpxSolverInterface cpxSi; testingMessage( "Testing CglFlowCover with OsiCpxSolverInterface\n" ); CglFlowCoverUnitTest(&cpxSi, testDir); } #endif #ifdef COIN_HAS_OSIXPR { OsiXprSolverInterface xprSi; testingMessage( "Testing CglGomory with OsiXprSolverInterface\n" ); CglGomoryUnitTest(&xprSi,mpsDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglSimpleRounding with OsiXprSolverInterface\n" ); CglSimpleRoundingUnitTest(&xprSi,mpsDir); } if(0) { OsiXprSolverInterface xprSi; testingMessage( "Testing CglKnapsackCover with OsiXprSolverInterface\n" ); CglKnapsackCoverUnitTest(&xprSi,mpsDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglOddHole with OsiXprSolverInterface\n" ); CglOddHoleUnitTest(&xprSi,mpsDir); } if(0) // Does not work with Xpress { OsiXprSolverInterface xprSi; testingMessage( "Testing CglProbing with OsiXprSolverInterface\n" ); CglProbingUnitTest(&xprSi,mpsDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglMixedIntegerRounding with OsiXprSolverInterface\n" ); CglMixedIntegerRoundingUnitTest(&xprSi, testDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglMixedIntegerRounding2 with OsiXprSolverInterface\n" ); CglMixedIntegerRounding2UnitTest(&xprSi, testDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglResidualCapacity with OsiXprSolverInterface\n" ); CglResidualCapacityUnitTest(&xprSi, testDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglTwomir with OsiXprSolverInterface\n" ); CglTwomirUnitTest(&xprSi, testDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglClique with OsiXprSolverInterface\n" ); CglCliqueUnitTest(&xprSi, testDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglFlowCover with OsiXprSolverInterface\n" ); CglFlowCoverUnitTest(&xprSi, testDir); } { OsiXprSolverInterface xprSi; testingMessage( "Testing CglZeroHalf with OsiXprSolverInterface\n" ); CglZeroHalfUnitTest(&xprSi, testDir); } #endif #ifdef COIN_HAS_OSICLP { OsiClpSolverInterface clpSi; testingMessage( "Testing CglGomory with OsiClpSolverInterface\n" ); CglGomoryUnitTest(&clpSi,mpsDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglLandp with OsiClpSolverInterface\n" ); CglLandPUnitTest(&clpSi,mpsDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglSimpleRounding with OsiClpSolverInterface\n" ); CglSimpleRoundingUnitTest(&clpSi,mpsDir); } if (0) { OsiClpSolverInterface clpSi; testingMessage( "Testing CglKnapsackCover with OsiClpSolverInterface\n" ); CglKnapsackCoverUnitTest(&clpSi,mpsDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglOddHole with OsiClpSolverInterface\n" ); CglOddHoleUnitTest(&clpSi,mpsDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglProbing with OsiClpSolverInterface\n" ); CglProbingUnitTest(&clpSi,mpsDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglMixedIntegerRounding with OsiClpSolverInterface\n" ); CglMixedIntegerRoundingUnitTest(&clpSi, testDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglMixedIntegerRounding2 with OsiClpSolverInterface\n" ); CglMixedIntegerRounding2UnitTest(&clpSi, testDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglResidualCapacity with OsiClpSolverInterface\n" ); CglResidualCapacityUnitTest(&clpSi, testDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglRedSplit with OsiClpSolverInterface\n" ); CglRedSplitUnitTest(&clpSi, mpsDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglRedSplit2 with OsiClpSolverInterface\n" ); CglRedSplit2UnitTest(&clpSi, mpsDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglTwomir with OsiClpSolverInterface\n" ); CglTwomirUnitTest(&clpSi, testDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglClique with OsiClpSolverInterface\n" ); CglCliqueUnitTest(&clpSi, testDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglFlowCover with OsiClpSolverInterface\n" ); CglFlowCoverUnitTest(&clpSi, testDir); } { OsiClpSolverInterface clpSi; testingMessage( "Testing CglZeroHalf with OsiClpSolverInterface\n" ); CglZeroHalfUnitTest(&clpSi, testDir); } #endif #ifdef COIN_HAS_OSIDYLP { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglGomory with OsiDylpSolverInterface\n" ); CglGomoryUnitTest(&dylpSi,mpsDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglSimpleRounding with OsiDylpSolverInterface\n" ); CglSimpleRoundingUnitTest(&dylpSi,mpsDir); } if (0) { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglKnapsackCover with OsiDylpSolverInterface\n" ); CglKnapsackCoverUnitTest(&dylpSi,mpsDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglOddHole with OsiDylpSolverInterface\n" ); CglOddHoleUnitTest(&dylpSi,mpsDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglProbing with OsiDylpSolverInterface\n" ); CglProbingUnitTest(&dylpSi,mpsDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglMixedIntegerRounding with OsiDylpSolverInterface\n" ); CglMixedIntegerRoundingUnitTest(&dylpSi, testDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglMixedIntegerRounding2 with OsiDylpSolverInterface\n" ); CglMixedIntegerRounding2UnitTest(&dylpSi, testDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglResidualCapacity with OsiDylpSolverInterface\n" ); CglResidualCapacityUnitTest(&dylpSi, testDir); } if (0) // needs partial OsiSimplex { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglRedSplit with OsiDylpSolverInterface\n" ); CglRedSplitUnitTest(&dylpSi, mpsDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglTwomir with OsiDylpSolverInterface\n" ); CglTwomirUnitTest(&dylpSi, testDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglClique with OsiDylpSolverInterface\n" ); CglCliqueUnitTest(&dylpSi, testDir); } { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglFlowCover with OsiDylpSolverInterface\n" ); CglFlowCoverUnitTest(&dylpSi, testDir); } if (0) { OsiDylpSolverInterface dylpSi; testingMessage( "Testing CglZeroHalf with OsiDylpSolverInterface\n" ); CglZeroHalfUnitTest(&dylpSi, testDir); } #endif #ifdef COIN_HAS_OSIGLPK { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglGomory with OsiGlpkSolverInterface\n" ); CglGomoryUnitTest(&glpkSi,mpsDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglSimpleRounding with OsiGlpkSolverInterface\n" ); CglSimpleRoundingUnitTest(&glpkSi,mpsDir); } if (0) { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglKnapsackCover with OsiGlpkSolverInterface\n" ); CglKnapsackCoverUnitTest(&glpkSi,mpsDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglOddHole with OsiGlpkSolverInterface\n" ); CglOddHoleUnitTest(&glpkSi,mpsDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglProbing with OsiGlpkSolverInterface\n" ); CglProbingUnitTest(&glpkSi,mpsDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglMixedIntegerRounding with OsiGlpkSolverInterface\n" ); CglMixedIntegerRoundingUnitTest(&glpkSi, testDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglMixedIntegerRounding2 with OsiGlpkSolverInterface\n" ); CglMixedIntegerRounding2UnitTest(&glpkSi, testDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglResidualCapacity with OsiGlpkSolverInterface\n" ); CglResidualCapacityUnitTest(&glpkSi, testDir); } if (0) // needs partial OsiSimplex { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglRedSplit with OsiGlpkSolverInterface\n" ); CglRedSplitUnitTest(&glpkSi, mpsDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglTwomir with OsiGlpkSolverInterface\n" ); CglTwomirUnitTest(&glpkSi, testDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglClique with OsiGlpkSolverInterface\n" ); CglCliqueUnitTest(&glpkSi, testDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglFlowCover with OsiGlpkSolverInterface\n" ); CglFlowCoverUnitTest(&glpkSi, testDir); } { OsiGlpkSolverInterface glpkSi; testingMessage( "Testing CglZeroHalf with OsiGlpkSolverInterface\n" ); CglZeroHalfUnitTest(&glpkSi, testDir); } #endif #ifdef COIN_HAS_OSIVOL if(0) // p0033: LP not solved to optimality: Finds 2142 versus 2520 { OsiVolSolverInterface volSi; testingMessage( "Testing CglGomory with OsiVolSolverInterface\n" ); CglGomoryUnitTest(&volSi,mpsDir); } if(0) // Not expected number of cuts; might come from different solution? { OsiVolSolverInterface volSi; testingMessage( "Testing CglSimpleRounding with OsiVolSolverInterface\n" ); CglSimpleRoundingUnitTest(&volSi,mpsDir); } if(0) // tp3: LP not solved to optimality: Finds 97.1842 versus 97.185 { OsiVolSolverInterface volSi; testingMessage( "Testing CglKnapsackCover with OsiVolSolverInterface\n" ); CglKnapsackCoverUnitTest(&volSi,mpsDir); } { OsiVolSolverInterface volSi; testingMessage( "Testing CglOddHole with OsiVolSolverInterface\n" ); CglOddHoleUnitTest(&volSi,mpsDir); } if(0) // Not expected number of elements in cut; might come from different solution? { OsiVolSolverInterface volSi; testingMessage( "Testing CglProbing with OsiVolSolverInterface\n" ); CglProbingUnitTest(&volSi,mpsDir); } if(0) // Throw CoinError since solver can not handle infinite bounds { OsiVolSolverInterface volSi; testingMessage( "Testing CglMixedIntegerRounding with OsiVolSolverInterface\n" ); CglMixedIntegerRoundingUnitTest(&volSi, testDir); } if(0) // Throw CoinError since solver can not handle infinite bounds { OsiVolSolverInterface volSi; testingMessage( "Testing CglMixedIntegerRounding2 with OsiVolSolverInterface\n" ); CglMixedIntegerRounding2UnitTest(&volSi, testDir); } if(0) // Throw CoinError since solver can not handle infinite bounds { OsiVolSolverInterface volSi; testingMessage( "Testing CglResidualCapacity with OsiVolSolverInterface\n" ); CglResidualCapacityUnitTest(&volSi, testDir); } if(0) // Throw CoinError since solver can not handle infinite bounds { OsiVolSolverInterface volSi; testingMessage( "Testing CglTwomir with OsiVolSolverInterface\n" ); CglTwomirUnitTest(&volSi, testDir); } if(0) // No cuts found { OsiVolSolverInterface volSi; testingMessage( "Testing CglClique with OsiVolSolverInterface\n" ); CglCliqueUnitTest(&volSi, testDir); } if(0) // Throw CoinError since solver can not handle infinite bounds { OsiVolSolverInterface volSi; testingMessage( "Testing CglFlowCover with OsiVolSolverInterface\n" ); CglFlowCoverUnitTest(&volSi, testDir); } #endif testingMessage( "All tests completed successfully\n" ); return 0; } // Display message on stdout and stderr void testingMessage( const char * const msg ) { std::cout <. # # 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='Cgl' PACKAGE_TARNAME='cgl' PACKAGE_VERSION='0.58.9' PACKAGE_STRING='Cgl 0.58.9' PACKAGE_BUGREPORT='cgl@list.coin-or.org' ac_unique_file="src/CglMessage.hpp" 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 CGL_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 CGLLIB_CFLAGS CGLLIB_LIBS CGLLIB_PCLIBS CGLLIB_PCREQUIRES CGLLIB_DEPENDENCIES CGLLIB_CFLAGS_INSTALLED CGLLIB_LIBS_INSTALLED COIN_HAS_COINUTILS_TRUE COIN_HAS_COINUTILS_FALSE OSI_LIBS OSI_CFLAGS OSI_DATA OSI_DEPENDENCIES OSI_LIBS_INSTALLED OSI_CFLAGS_INSTALLED OSI_DATA_INSTALLED COIN_HAS_OSI_TRUE COIN_HAS_OSI_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 OSICLP_LIBS OSICLP_CFLAGS OSICLP_DATA OSICLP_DEPENDENCIES OSICLP_LIBS_INSTALLED OSICLP_CFLAGS_INSTALLED OSICLP_DATA_INSTALLED COIN_HAS_OSICLP_TRUE COIN_HAS_OSICLP_FALSE OSICPX_LIBS OSICPX_CFLAGS OSICPX_DATA OSICPX_DEPENDENCIES OSICPX_LIBS_INSTALLED OSICPX_CFLAGS_INSTALLED OSICPX_DATA_INSTALLED COIN_HAS_OSICPX_TRUE COIN_HAS_OSICPX_FALSE OSIGLPK_LIBS OSIGLPK_CFLAGS OSIGLPK_DATA OSIGLPK_DEPENDENCIES OSIGLPK_LIBS_INSTALLED OSIGLPK_CFLAGS_INSTALLED OSIGLPK_DATA_INSTALLED COIN_HAS_OSIGLPK_TRUE COIN_HAS_OSIGLPK_FALSE OSIMSK_LIBS OSIMSK_CFLAGS OSIMSK_DATA OSIMSK_DEPENDENCIES OSIMSK_LIBS_INSTALLED OSIMSK_CFLAGS_INSTALLED OSIMSK_DATA_INSTALLED COIN_HAS_OSIMSK_TRUE COIN_HAS_OSIMSK_FALSE OSIXPR_LIBS OSIXPR_CFLAGS OSIXPR_DATA OSIXPR_DEPENDENCIES OSIXPR_LIBS_INSTALLED OSIXPR_CFLAGS_INSTALLED OSIXPR_DATA_INSTALLED COIN_HAS_OSIXPR_TRUE COIN_HAS_OSIXPR_FALSE OSIVOL_LIBS OSIVOL_CFLAGS OSIVOL_DATA OSIVOL_DEPENDENCIES OSIVOL_LIBS_INSTALLED OSIVOL_CFLAGS_INSTALLED OSIVOL_DATA_INSTALLED COIN_HAS_OSIVOL_TRUE COIN_HAS_OSIVOL_FALSE OSIDYLP_LIBS OSIDYLP_CFLAGS OSIDYLP_DATA OSIDYLP_DEPENDENCIES OSIDYLP_LIBS_INSTALLED OSIDYLP_CFLAGS_INSTALLED OSIDYLP_DATA_INSTALLED COIN_HAS_OSIDYLP_TRUE COIN_HAS_OSIDYLP_FALSE CGL_SUBDIRS CGL_SUBLIBS 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 Cgl 0.58.9 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 Cgl 0.58.9:";; 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-cgl compile project Cgl 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 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-cgl-verbosity specify the debug verbosity level for project Cgl --with-cgl-checklevel specify the sanity check level for project Cgl --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-osi-lib linker flags for using package Osi --with-osi-incdir directory with header files for using package Osi --with-osi-datadir directory with data files for using package Osi --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-osiclp-lib linker flags for using package OsiClp --with-osiclp-incdir directory with header files for using package OsiClp --with-osiclp-datadir directory with data files for using package OsiClp --with-osicpx-lib linker flags for using package OsiCpx --with-osicpx-incdir directory with header files for using package OsiCpx --with-osicpx-datadir directory with data files for using package OsiCpx --with-osiglpk-lib linker flags for using package OsiGlpk --with-osiglpk-incdir directory with header files for using package OsiGlpk --with-osiglpk-datadir directory with data files for using package OsiGlpk --with-osimsk-lib linker flags for using package OsiMsk --with-osimsk-incdir directory with header files for using package OsiMsk --with-osimsk-datadir directory with data files for using package OsiMsk --with-osixpr-lib linker flags for using package OsiXpr --with-osixpr-incdir directory with header files for using package OsiXpr --with-osixpr-datadir directory with data files for using package OsiXpr --with-osivol-lib linker flags for using package OsiVol --with-osivol-incdir directory with header files for using package OsiVol --with-osivol-datadir directory with data files for using package OsiVol --with-osidylp-lib linker flags for using package OsiDyLP --with-osidylp-incdir directory with header files for using package OsiDyLP --with-osidylp-datadir directory with data files for using package OsiDyLP --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 Cgl configure 0.58.9 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 Cgl $as_me 0.58.9, 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/'` # If this project depends on external projects, the Externals file in # the source root directory contains definition of where to find those # externals. The following macro ensures that those externals are # retrieved by svn if they are not there yet. # 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 CGL_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 CGL_VERSION_MAJOR $coin_majorver _ACEOF cat >>confdefs.h <<_ACEOF #define CGL_VERSION_MINOR $coin_minorver _ACEOF cat >>confdefs.h <<_ACEOF #define CGL_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=CGL # 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 CGL_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 CGL_SVN_REV $CGL_SVN_REV _ACEOF fi fi # Capture libtool library version, if given. coin_libversion=9:9:8 # 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-cgl or --disable-debug-cgl was given. if test "${enable_debug_cgl+set}" = set; then enableval="$enable_debug_cgl" case "${enableval}" in yes) coin_debug_compile=true ;; no) coin_debug_compile=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug-cgl" >&5 echo "$as_me: error: bad value ${enableval} for --enable-debug-cgl" >&2;} { (exit 1); exit 1; }; } ;; esac else : fi; # m4_ifvaln([Cgl], 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-cgl-verbosity or --without-cgl-verbosity was given. if test "${with_cgl_verbosity+set}" = set; then withval="$with_cgl_verbosity" if test "$withval" = yes; then withval=1 fi coin_cgl_verbosity=$withval else coin_cgl_verbosity=0 fi; cat >>confdefs.h <<_ACEOF #define COIN_CGL_VERBOSITY $coin_cgl_verbosity _ACEOF # Check whether --with-cgl-checklevel or --without-cgl-checklevel was given. if test "${with_cgl_checklevel+set}" = set; then withval="$with_cgl_checklevel" if test "$withval" = yes; then withval=1 fi coin_cgl_checklevel=$withval else coin_cgl_checklevel=0 fi; cat >>confdefs.h <<_ACEOF #define COIN_CGL_CHECKLEVEL $coin_cgl_checklevel _ACEOF # m4_ifvaln([Cgl], # 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 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 ;; *-*-darwin*) comps="clang gcc" ;; *-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*) LD=link ;; 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 build with MS or intel compiler case "$CXX" in clang* ) ;; cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*) LD=link ;; 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 "$CC" 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;} ;; *gcc*) if test x"$enable_dependency_linking" = xyes; then coin_disable_shared=no else { echo "$as_me:$LINENO: WARNING: To build shared libraries with gcc on CYGWIN or MSys, use --enable-dependency-linking" >&5 echo "$as_me: WARNING: To build shared libraries with gcc on CYGWIN or MSys, use --enable-dependency-linking" >&2;} fi ;; *) { 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='cgl' VERSION='0.58.9' 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 5843 "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 cgl@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:6977:" \ "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:8044: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8048: \$? = $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:8312: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8316: \$? = $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:8416: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8420: \$? = $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:13205: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13209: \$? = $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:13309: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13313: \$? = $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:14879: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14883: \$? = $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:14983: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14987: \$? = $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:17190: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17194: \$? = $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:17458: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17462: \$? = $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:17562: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:17566: \$? = $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= #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" CGLLIB_PCLIBS="$withval $CGLLIB_PCLIBS" CGLLIB_LIBS="$withval $CGLLIB_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" CGLLIB_LIBS_INSTALLED="$withval $CGLLIB_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`" CGLLIB_CFLAGS="-I`${CYGPATH_W} $withval` $CGLLIB_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" CGLLIB_CFLAGS_INSTALLED="$COINUTILS_CFLAGS $CGLLIB_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 CglLib CGLLIB_PCREQUIRES="coinutils $CGLLIB_PCREQUIRES" CGLLIB_CFLAGS="$COINUTILS_CFLAGS $CGLLIB_CFLAGS" CGLLIB_LIBS="$COINUTILS_LIBS $CGLLIB_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" CGLLIB_PCREQUIRES="coinutils $CGLLIB_PCREQUIRES" CGLLIB_CFLAGS="$COINUTILS_CFLAGS $CGLLIB_CFLAGS" CGLLIB_LIBS="$COINUTILS_LIBS $CGLLIB_LIBS" CGLLIB_CFLAGS_INSTALLED="$COINUTILS_CFLAGS_INSTALLED $CGLLIB_CFLAGS_INSTALLED" CGLLIB_LIBS_INSTALLED="$COINUTILS_LIBS_INSTALLED $CGLLIB_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'` CGLLIB_DEPENDENCIES=`echo " $CGLLIB_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: CglLib CFLAGS are $CGLLIB_CFLAGS" >&5 echo "$as_me: CglLib CFLAGS are $CGLLIB_CFLAGS" >&6;} { echo "$as_me:$LINENO: CglLib LIBS are $CGLLIB_LIBS" >&5 echo "$as_me: CglLib LIBS are $CGLLIB_LIBS" >&6;} { echo "$as_me:$LINENO: CglLib DEPENDENCIES are $CGLLIB_DEPENDENCIES" >&5 echo "$as_me: CglLib DEPENDENCIES are $CGLLIB_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 Osi" >&5 echo $ECHO_N "checking for COIN-OR package Osi... $ECHO_C" >&6 coin_has_osi=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 = "Osi"; then coin_has_osi=skipping fi done fi if test "$coin_has_osi" != skipping; then # Check whether --with-m4_tolower(Osi) or --without-m4_tolower(Osi) was given. if test "${with_osi+set}" = set; then withval="$with_osi" if test "$withval" = no ; then coin_has_osi=skipping fi fi; fi OSI_LIBS= OSI_CFLAGS= OSI_DATA= OSI_DEPENDENCIES= OSI_PCLIBS= OSI_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osi != skipping; then # Check whether --with-m4_tolower(Osi)-lib or --without-m4_tolower(Osi)-lib was given. if test "${with_osi_lib+set}" = set; then withval="$with_osi_lib" if test "$withval" = no ; then coin_has_osi=skipping else coin_has_osi=yes OSI_LIBS="$withval" OSI_PCLIBS="$withval" CGLLIB_PCLIBS="$withval $CGLLIB_PCLIBS" CGLLIB_LIBS="$withval $CGLLIB_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 OSI_LIBS_INSTALLED="$withval" CGLLIB_LIBS_INSTALLED="$withval $CGLLIB_LIBS_INSTALLED" fi fi fi; fi if test $coin_has_osi != skipping; then # Check whether --with-m4_tolower(Osi)-incdir or --without-m4_tolower(Osi)-incdir was given. if test "${with_osi_incdir+set}" = set; then withval="$with_osi_incdir" if test "$withval" = no ; then coin_has_osi=skipping else coin_has_osi=yes OSI_CFLAGS="-I`${CYGPATH_W} $withval`" CGLLIB_CFLAGS="-I`${CYGPATH_W} $withval` $CGLLIB_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 OSI_CFLAGS_INSTALLED="$OSI_CFLAGS" CGLLIB_CFLAGS_INSTALLED="$OSI_CFLAGS $CGLLIB_CFLAGS_INSTALLED" fi fi fi; fi if test $coin_has_osi != skipping; then # Check whether --with-m4_tolower(Osi)-datadir or --without-m4_tolower(Osi)-datadir was given. if test "${with_osi_datadir+set}" = set; then withval="$with_osi_datadir" if test "$withval" = no ; then coin_has_osi=skipping else coin_has_osi=yes OSI_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 OSI_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osi = 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 "osi"; then OSI_VERSIONS=`$PKG_CONFIG --modversion "osi" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi" 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 OSI_CFLAGS="$cflags" OSI_LIBS=`$PKG_CONFIG --libs "osi" 2>/dev/null` OSI_DATA=`$PKG_CONFIG --variable=datadir "osi" 2>/dev/null` coin_has_osi=yes echo "$as_me:$LINENO: result: yes: $OSI_VERSIONS" >&5 echo "${ECHO_T}yes: $OSI_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 OSI_LIBS=`echo " $OSI_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSI_PCREQUIRES="osi" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in CglLib CGLLIB_PCREQUIRES="osi $CGLLIB_PCREQUIRES" CGLLIB_CFLAGS="$OSI_CFLAGS $CGLLIB_CFLAGS" CGLLIB_LIBS="$OSI_LIBS $CGLLIB_LIBS" else OSI_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi"` coin_has_osi=notGiven echo "$as_me:$LINENO: result: not given: $OSI_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSI_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module Osi without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module Osi 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 Osi (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package Osi (fallback)... $ECHO_C" >&6 coin_has_osi=notGiven OSI_LIBS= OSI_LIBS_INSTALLED= OSI_CFLAGS= OSI_CFLAGS_INSTALLED= OSI_DATA= OSI_DATA_INSTALLED= OSI_PCLIBS= OSI_PCREQUIRES= # initial list of dependencies is "osi", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi" # 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$OSI_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSI_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$OSI_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 OSI_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 OSI_CFLAGS="$projcflags $OSI_CFLAGS" # set LIBS variable OSI_LIBS="$projlibs $OSI_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 OSI_CFLAGS_INSTALLED="$projcflags $OSI_CFLAGS_INSTALLED" # set LIBS variable OSI_LIBS_INSTALLED="$projlibs $OSI_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osi=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSI 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 OSI_LIBS=`echo " $OSI_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSI_LIBS_INSTALLED=`echo " $OSI_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 OSI_PCREQUIRES="osi" CGLLIB_PCREQUIRES="osi $CGLLIB_PCREQUIRES" CGLLIB_CFLAGS="$OSI_CFLAGS $CGLLIB_CFLAGS" CGLLIB_LIBS="$OSI_LIBS $CGLLIB_LIBS" CGLLIB_CFLAGS_INSTALLED="$OSI_CFLAGS_INSTALLED $CGLLIB_CFLAGS_INSTALLED" CGLLIB_LIBS_INSTALLED="$OSI_LIBS_INSTALLED $CGLLIB_LIBS_INSTALLED" fi if test $coin_has_osi != notGiven && test $coin_has_osi != skipping; then COIN_HAS_OSI_TRUE= COIN_HAS_OSI_FALSE='#' else COIN_HAS_OSI_TRUE='#' COIN_HAS_OSI_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osi" >&5 echo "${ECHO_T}$coin_has_osi" >&6 fi if test $coin_has_osi != skipping && test $coin_has_osi != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSI 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) OSI_DEPENDENCIES=`echo " $OSI_LIBS" | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` CGLLIB_DEPENDENCIES=`echo " $CGLLIB_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 "$OSI_CFLAGS" ; then { echo "$as_me:$LINENO: Osi CFLAGS are $OSI_CFLAGS" >&5 echo "$as_me: Osi CFLAGS are $OSI_CFLAGS" >&6;} fi if test -n "$OSI_LIBS" ; then { echo "$as_me:$LINENO: Osi LIBS are $OSI_LIBS" >&5 echo "$as_me: Osi LIBS are $OSI_LIBS" >&6;} fi if test -n "$OSI_DEPENDENCIES" ; then { echo "$as_me:$LINENO: Osi DEPENDENCIES are $OSI_DEPENDENCIES" >&5 echo "$as_me: Osi DEPENDENCIES are $OSI_DEPENDENCIES" >&6;} fi if test -n "$OSI_DATA" ; then { echo "$as_me:$LINENO: Osi DATA is $OSI_DATA" >&5 echo "$as_me: Osi DATA is $OSI_DATA" >&6;} fi if test -n "$OSI_PCLIBS" ; then { echo "$as_me:$LINENO: Osi PCLIBS are $OSI_PCLIBS" >&5 echo "$as_me: Osi PCLIBS are $OSI_PCLIBS" >&6;} fi if test -n "$OSI_PCREQUIRES" ; then { echo "$as_me:$LINENO: Osi PCREQUIRES are $OSI_PCREQUIRES" >&5 echo "$as_me: Osi PCREQUIRES are $OSI_PCREQUIRES" >&6;} fi { echo "$as_me:$LINENO: CglLib CFLAGS are $CGLLIB_CFLAGS" >&5 echo "$as_me: CglLib CFLAGS are $CGLLIB_CFLAGS" >&6;} { echo "$as_me:$LINENO: CglLib LIBS are $CGLLIB_LIBS" >&5 echo "$as_me: CglLib LIBS are $CGLLIB_LIBS" >&6;} { echo "$as_me:$LINENO: CglLib DEPENDENCIES are $CGLLIB_DEPENDENCIES" >&5 echo "$as_me: CglLib DEPENDENCIES are $CGLLIB_DEPENDENCIES" >&6;} fi fi # Define the Makefile conditional if test $coin_has_osi != notGiven && test $coin_has_osi != skipping; then COIN_HAS_OSI_TRUE= COIN_HAS_OSI_FALSE='#' else COIN_HAS_OSI_TRUE='#' COIN_HAS_OSI_FALSE= fi if test $coin_has_osi != yes ; then { { echo "$as_me:$LINENO: error: Required package Osi not available." >&5 echo "$as_me: error: Required package Osi not available." >&2;} { (exit 1); exit 1; }; } 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= #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 # Clp can be used by CglLandP echo "$as_me:$LINENO: checking for COIN-OR package OsiClp" >&5 echo $ECHO_N "checking for COIN-OR package OsiClp... $ECHO_C" >&6 coin_has_osiclp=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 = "OsiClp"; then coin_has_osiclp=skipping fi done fi if test "$coin_has_osiclp" != skipping; then # Check whether --with-m4_tolower(OsiClp) or --without-m4_tolower(OsiClp) was given. if test "${with_osiclp+set}" = set; then withval="$with_osiclp" if test "$withval" = no ; then coin_has_osiclp=skipping fi fi; fi OSICLP_LIBS= OSICLP_CFLAGS= OSICLP_DATA= OSICLP_DEPENDENCIES= OSICLP_PCLIBS= OSICLP_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osiclp != skipping; then # Check whether --with-m4_tolower(OsiClp)-lib or --without-m4_tolower(OsiClp)-lib was given. if test "${with_osiclp_lib+set}" = set; then withval="$with_osiclp_lib" if test "$withval" = no ; then coin_has_osiclp=skipping else coin_has_osiclp=yes OSICLP_LIBS="$withval" OSICLP_PCLIBS="$withval" CGLLIB_PCLIBS="$withval $CGLLIB_PCLIBS" CGLLIB_LIBS="$withval $CGLLIB_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 OSICLP_LIBS_INSTALLED="$withval" CGLLIB_LIBS_INSTALLED="$withval $CGLLIB_LIBS_INSTALLED" fi fi fi; fi if test $coin_has_osiclp != skipping; then # Check whether --with-m4_tolower(OsiClp)-incdir or --without-m4_tolower(OsiClp)-incdir was given. if test "${with_osiclp_incdir+set}" = set; then withval="$with_osiclp_incdir" if test "$withval" = no ; then coin_has_osiclp=skipping else coin_has_osiclp=yes OSICLP_CFLAGS="-I`${CYGPATH_W} $withval`" CGLLIB_CFLAGS="-I`${CYGPATH_W} $withval` $CGLLIB_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 OSICLP_CFLAGS_INSTALLED="$OSICLP_CFLAGS" CGLLIB_CFLAGS_INSTALLED="$OSICLP_CFLAGS $CGLLIB_CFLAGS_INSTALLED" fi fi fi; fi if test $coin_has_osiclp != skipping; then # Check whether --with-m4_tolower(OsiClp)-datadir or --without-m4_tolower(OsiClp)-datadir was given. if test "${with_osiclp_datadir+set}" = set; then withval="$with_osiclp_datadir" if test "$withval" = no ; then coin_has_osiclp=skipping else coin_has_osiclp=yes OSICLP_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 OSICLP_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osiclp = 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 "osi-clp"; then OSICLP_VERSIONS=`$PKG_CONFIG --modversion "osi-clp" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi-clp" 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 OSICLP_CFLAGS="$cflags" OSICLP_LIBS=`$PKG_CONFIG --libs "osi-clp" 2>/dev/null` OSICLP_DATA=`$PKG_CONFIG --variable=datadir "osi-clp" 2>/dev/null` coin_has_osiclp=yes echo "$as_me:$LINENO: result: yes: $OSICLP_VERSIONS" >&5 echo "${ECHO_T}yes: $OSICLP_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 OSICLP_LIBS=`echo " $OSICLP_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSICLP_PCREQUIRES="osi-clp" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in CglLib CGLLIB_PCREQUIRES="osi-clp $CGLLIB_PCREQUIRES" CGLLIB_CFLAGS="$OSICLP_CFLAGS $CGLLIB_CFLAGS" CGLLIB_LIBS="$OSICLP_LIBS $CGLLIB_LIBS" else OSICLP_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi-clp"` coin_has_osiclp=notGiven echo "$as_me:$LINENO: result: not given: $OSICLP_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSICLP_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module OsiClp without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module OsiClp 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 OsiClp (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package OsiClp (fallback)... $ECHO_C" >&6 coin_has_osiclp=notGiven OSICLP_LIBS= OSICLP_LIBS_INSTALLED= OSICLP_CFLAGS= OSICLP_CFLAGS_INSTALLED= OSICLP_DATA= OSICLP_DATA_INSTALLED= OSICLP_PCLIBS= OSICLP_PCREQUIRES= # initial list of dependencies is "osi-clp", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi-clp" # 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$OSICLP_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSICLP_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$OSICLP_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 OSICLP_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 OSICLP_CFLAGS="$projcflags $OSICLP_CFLAGS" # set LIBS variable OSICLP_LIBS="$projlibs $OSICLP_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 OSICLP_CFLAGS_INSTALLED="$projcflags $OSICLP_CFLAGS_INSTALLED" # set LIBS variable OSICLP_LIBS_INSTALLED="$projlibs $OSICLP_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osiclp=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSICLP 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 OSICLP_LIBS=`echo " $OSICLP_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSICLP_LIBS_INSTALLED=`echo " $OSICLP_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 OSICLP_PCREQUIRES="osi-clp" CGLLIB_PCREQUIRES="osi-clp $CGLLIB_PCREQUIRES" CGLLIB_CFLAGS="$OSICLP_CFLAGS $CGLLIB_CFLAGS" CGLLIB_LIBS="$OSICLP_LIBS $CGLLIB_LIBS" CGLLIB_CFLAGS_INSTALLED="$OSICLP_CFLAGS_INSTALLED $CGLLIB_CFLAGS_INSTALLED" CGLLIB_LIBS_INSTALLED="$OSICLP_LIBS_INSTALLED $CGLLIB_LIBS_INSTALLED" fi if test $coin_has_osiclp != notGiven && test $coin_has_osiclp != skipping; then COIN_HAS_OSICLP_TRUE= COIN_HAS_OSICLP_FALSE='#' else COIN_HAS_OSICLP_TRUE='#' COIN_HAS_OSICLP_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osiclp" >&5 echo "${ECHO_T}$coin_has_osiclp" >&6 fi if test $coin_has_osiclp != skipping && test $coin_has_osiclp != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSICLP 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) OSICLP_DEPENDENCIES=`echo " $OSICLP_LIBS" | sed -e 's/ mkl[^ ]*//g' -e 's/ libiomp5[^ ]*//g' -e 's/ wsock32[^ ]*//g' -e 's/ -framework *[^ ]*//g' -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g'` CGLLIB_DEPENDENCIES=`echo " $CGLLIB_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 "$OSICLP_CFLAGS" ; then { echo "$as_me:$LINENO: OsiClp CFLAGS are $OSICLP_CFLAGS" >&5 echo "$as_me: OsiClp CFLAGS are $OSICLP_CFLAGS" >&6;} fi if test -n "$OSICLP_LIBS" ; then { echo "$as_me:$LINENO: OsiClp LIBS are $OSICLP_LIBS" >&5 echo "$as_me: OsiClp LIBS are $OSICLP_LIBS" >&6;} fi if test -n "$OSICLP_DEPENDENCIES" ; then { echo "$as_me:$LINENO: OsiClp DEPENDENCIES are $OSICLP_DEPENDENCIES" >&5 echo "$as_me: OsiClp DEPENDENCIES are $OSICLP_DEPENDENCIES" >&6;} fi if test -n "$OSICLP_DATA" ; then { echo "$as_me:$LINENO: OsiClp DATA is $OSICLP_DATA" >&5 echo "$as_me: OsiClp DATA is $OSICLP_DATA" >&6;} fi if test -n "$OSICLP_PCLIBS" ; then { echo "$as_me:$LINENO: OsiClp PCLIBS are $OSICLP_PCLIBS" >&5 echo "$as_me: OsiClp PCLIBS are $OSICLP_PCLIBS" >&6;} fi if test -n "$OSICLP_PCREQUIRES" ; then { echo "$as_me:$LINENO: OsiClp PCREQUIRES are $OSICLP_PCREQUIRES" >&5 echo "$as_me: OsiClp PCREQUIRES are $OSICLP_PCREQUIRES" >&6;} fi { echo "$as_me:$LINENO: CglLib CFLAGS are $CGLLIB_CFLAGS" >&5 echo "$as_me: CglLib CFLAGS are $CGLLIB_CFLAGS" >&6;} { echo "$as_me:$LINENO: CglLib LIBS are $CGLLIB_LIBS" >&5 echo "$as_me: CglLib LIBS are $CGLLIB_LIBS" >&6;} { echo "$as_me:$LINENO: CglLib DEPENDENCIES are $CGLLIB_DEPENDENCIES" >&5 echo "$as_me: CglLib DEPENDENCIES are $CGLLIB_DEPENDENCIES" >&6;} fi fi # Define the Makefile conditional if test $coin_has_osiclp != notGiven && test $coin_has_osiclp != skipping; then COIN_HAS_OSICLP_TRUE= COIN_HAS_OSICLP_FALSE='#' else COIN_HAS_OSICLP_TRUE='#' COIN_HAS_OSICLP_FALSE= fi ############################################################################# # Solvers for unittesting # ############################################################################# # These are not really required for the compilation of Cgl, but we # need to know which are available in order to compile the unitTest # correctly. echo "$as_me:$LINENO: checking for COIN-OR package OsiCpx" >&5 echo $ECHO_N "checking for COIN-OR package OsiCpx... $ECHO_C" >&6 coin_has_osicpx=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 = "OsiCpx"; then coin_has_osicpx=skipping fi done fi if test "$coin_has_osicpx" != skipping; then # Check whether --with-m4_tolower(OsiCpx) or --without-m4_tolower(OsiCpx) was given. if test "${with_osicpx+set}" = set; then withval="$with_osicpx" if test "$withval" = no ; then coin_has_osicpx=skipping fi fi; fi OSICPX_LIBS= OSICPX_CFLAGS= OSICPX_DATA= OSICPX_DEPENDENCIES= OSICPX_PCLIBS= OSICPX_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osicpx != skipping; then # Check whether --with-m4_tolower(OsiCpx)-lib or --without-m4_tolower(OsiCpx)-lib was given. if test "${with_osicpx_lib+set}" = set; then withval="$with_osicpx_lib" if test "$withval" = no ; then coin_has_osicpx=skipping else coin_has_osicpx=yes OSICPX_LIBS="$withval" OSICPX_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 OSICPX_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osicpx != skipping; then # Check whether --with-m4_tolower(OsiCpx)-incdir or --without-m4_tolower(OsiCpx)-incdir was given. if test "${with_osicpx_incdir+set}" = set; then withval="$with_osicpx_incdir" if test "$withval" = no ; then coin_has_osicpx=skipping else coin_has_osicpx=yes OSICPX_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 OSICPX_CFLAGS_INSTALLED="$OSICPX_CFLAGS" fi fi fi; fi if test $coin_has_osicpx != skipping; then # Check whether --with-m4_tolower(OsiCpx)-datadir or --without-m4_tolower(OsiCpx)-datadir was given. if test "${with_osicpx_datadir+set}" = set; then withval="$with_osicpx_datadir" if test "$withval" = no ; then coin_has_osicpx=skipping else coin_has_osicpx=yes OSICPX_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 OSICPX_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osicpx = 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 "osi-cplex"; then OSICPX_VERSIONS=`$PKG_CONFIG --modversion "osi-cplex" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi-cplex" 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 OSICPX_CFLAGS="$cflags" OSICPX_LIBS=`$PKG_CONFIG --libs "osi-cplex" 2>/dev/null` OSICPX_DATA=`$PKG_CONFIG --variable=datadir "osi-cplex" 2>/dev/null` coin_has_osicpx=yes echo "$as_me:$LINENO: result: yes: $OSICPX_VERSIONS" >&5 echo "${ECHO_T}yes: $OSICPX_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 OSICPX_LIBS=`echo " $OSICPX_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSICPX_PCREQUIRES="osi-cplex" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else OSICPX_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi-cplex"` coin_has_osicpx=notGiven echo "$as_me:$LINENO: result: not given: $OSICPX_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSICPX_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module OsiCpx without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module OsiCpx 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 OsiCpx (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package OsiCpx (fallback)... $ECHO_C" >&6 coin_has_osicpx=notGiven OSICPX_LIBS= OSICPX_LIBS_INSTALLED= OSICPX_CFLAGS= OSICPX_CFLAGS_INSTALLED= OSICPX_DATA= OSICPX_DATA_INSTALLED= OSICPX_PCLIBS= OSICPX_PCREQUIRES= # initial list of dependencies is "osi-cplex", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi-cplex" # 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$OSICPX_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSICPX_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$OSICPX_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 OSICPX_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 OSICPX_CFLAGS="$projcflags $OSICPX_CFLAGS" # set LIBS variable OSICPX_LIBS="$projlibs $OSICPX_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 OSICPX_CFLAGS_INSTALLED="$projcflags $OSICPX_CFLAGS_INSTALLED" # set LIBS variable OSICPX_LIBS_INSTALLED="$projlibs $OSICPX_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osicpx=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSICPX 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 OSICPX_LIBS=`echo " $OSICPX_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSICPX_LIBS_INSTALLED=`echo " $OSICPX_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 OSICPX_PCREQUIRES="osi-cplex" fi if test $coin_has_osicpx != notGiven && test $coin_has_osicpx != skipping; then COIN_HAS_OSICPX_TRUE= COIN_HAS_OSICPX_FALSE='#' else COIN_HAS_OSICPX_TRUE='#' COIN_HAS_OSICPX_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osicpx" >&5 echo "${ECHO_T}$coin_has_osicpx" >&6 fi if test $coin_has_osicpx != skipping && test $coin_has_osicpx != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSICPX 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) OSICPX_DEPENDENCIES=`echo " $OSICPX_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 "$OSICPX_CFLAGS" ; then { echo "$as_me:$LINENO: OsiCpx CFLAGS are $OSICPX_CFLAGS" >&5 echo "$as_me: OsiCpx CFLAGS are $OSICPX_CFLAGS" >&6;} fi if test -n "$OSICPX_LIBS" ; then { echo "$as_me:$LINENO: OsiCpx LIBS are $OSICPX_LIBS" >&5 echo "$as_me: OsiCpx LIBS are $OSICPX_LIBS" >&6;} fi if test -n "$OSICPX_DEPENDENCIES" ; then { echo "$as_me:$LINENO: OsiCpx DEPENDENCIES are $OSICPX_DEPENDENCIES" >&5 echo "$as_me: OsiCpx DEPENDENCIES are $OSICPX_DEPENDENCIES" >&6;} fi if test -n "$OSICPX_DATA" ; then { echo "$as_me:$LINENO: OsiCpx DATA is $OSICPX_DATA" >&5 echo "$as_me: OsiCpx DATA is $OSICPX_DATA" >&6;} fi if test -n "$OSICPX_PCLIBS" ; then { echo "$as_me:$LINENO: OsiCpx PCLIBS are $OSICPX_PCLIBS" >&5 echo "$as_me: OsiCpx PCLIBS are $OSICPX_PCLIBS" >&6;} fi if test -n "$OSICPX_PCREQUIRES" ; then { echo "$as_me:$LINENO: OsiCpx PCREQUIRES are $OSICPX_PCREQUIRES" >&5 echo "$as_me: OsiCpx PCREQUIRES are $OSICPX_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_osicpx != notGiven && test $coin_has_osicpx != skipping; then COIN_HAS_OSICPX_TRUE= COIN_HAS_OSICPX_FALSE='#' else COIN_HAS_OSICPX_TRUE='#' COIN_HAS_OSICPX_FALSE= fi echo "$as_me:$LINENO: checking for COIN-OR package OsiGlpk" >&5 echo $ECHO_N "checking for COIN-OR package OsiGlpk... $ECHO_C" >&6 coin_has_osiglpk=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 = "OsiGlpk"; then coin_has_osiglpk=skipping fi done fi if test "$coin_has_osiglpk" != skipping; then # Check whether --with-m4_tolower(OsiGlpk) or --without-m4_tolower(OsiGlpk) was given. if test "${with_osiglpk+set}" = set; then withval="$with_osiglpk" if test "$withval" = no ; then coin_has_osiglpk=skipping fi fi; fi OSIGLPK_LIBS= OSIGLPK_CFLAGS= OSIGLPK_DATA= OSIGLPK_DEPENDENCIES= OSIGLPK_PCLIBS= OSIGLPK_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osiglpk != skipping; then # Check whether --with-m4_tolower(OsiGlpk)-lib or --without-m4_tolower(OsiGlpk)-lib was given. if test "${with_osiglpk_lib+set}" = set; then withval="$with_osiglpk_lib" if test "$withval" = no ; then coin_has_osiglpk=skipping else coin_has_osiglpk=yes OSIGLPK_LIBS="$withval" OSIGLPK_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 OSIGLPK_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osiglpk != skipping; then # Check whether --with-m4_tolower(OsiGlpk)-incdir or --without-m4_tolower(OsiGlpk)-incdir was given. if test "${with_osiglpk_incdir+set}" = set; then withval="$with_osiglpk_incdir" if test "$withval" = no ; then coin_has_osiglpk=skipping else coin_has_osiglpk=yes OSIGLPK_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 OSIGLPK_CFLAGS_INSTALLED="$OSIGLPK_CFLAGS" fi fi fi; fi if test $coin_has_osiglpk != skipping; then # Check whether --with-m4_tolower(OsiGlpk)-datadir or --without-m4_tolower(OsiGlpk)-datadir was given. if test "${with_osiglpk_datadir+set}" = set; then withval="$with_osiglpk_datadir" if test "$withval" = no ; then coin_has_osiglpk=skipping else coin_has_osiglpk=yes OSIGLPK_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 OSIGLPK_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osiglpk = 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 "osi-glpk"; then OSIGLPK_VERSIONS=`$PKG_CONFIG --modversion "osi-glpk" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi-glpk" 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 OSIGLPK_CFLAGS="$cflags" OSIGLPK_LIBS=`$PKG_CONFIG --libs "osi-glpk" 2>/dev/null` OSIGLPK_DATA=`$PKG_CONFIG --variable=datadir "osi-glpk" 2>/dev/null` coin_has_osiglpk=yes echo "$as_me:$LINENO: result: yes: $OSIGLPK_VERSIONS" >&5 echo "${ECHO_T}yes: $OSIGLPK_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 OSIGLPK_LIBS=`echo " $OSIGLPK_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSIGLPK_PCREQUIRES="osi-glpk" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else OSIGLPK_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi-glpk"` coin_has_osiglpk=notGiven echo "$as_me:$LINENO: result: not given: $OSIGLPK_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSIGLPK_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module OsiGlpk without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module OsiGlpk 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 OsiGlpk (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package OsiGlpk (fallback)... $ECHO_C" >&6 coin_has_osiglpk=notGiven OSIGLPK_LIBS= OSIGLPK_LIBS_INSTALLED= OSIGLPK_CFLAGS= OSIGLPK_CFLAGS_INSTALLED= OSIGLPK_DATA= OSIGLPK_DATA_INSTALLED= OSIGLPK_PCLIBS= OSIGLPK_PCREQUIRES= # initial list of dependencies is "osi-glpk", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi-glpk" # 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$OSIGLPK_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSIGLPK_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$OSIGLPK_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 OSIGLPK_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 OSIGLPK_CFLAGS="$projcflags $OSIGLPK_CFLAGS" # set LIBS variable OSIGLPK_LIBS="$projlibs $OSIGLPK_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 OSIGLPK_CFLAGS_INSTALLED="$projcflags $OSIGLPK_CFLAGS_INSTALLED" # set LIBS variable OSIGLPK_LIBS_INSTALLED="$projlibs $OSIGLPK_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osiglpk=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIGLPK 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 OSIGLPK_LIBS=`echo " $OSIGLPK_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSIGLPK_LIBS_INSTALLED=`echo " $OSIGLPK_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 OSIGLPK_PCREQUIRES="osi-glpk" fi if test $coin_has_osiglpk != notGiven && test $coin_has_osiglpk != skipping; then COIN_HAS_OSIGLPK_TRUE= COIN_HAS_OSIGLPK_FALSE='#' else COIN_HAS_OSIGLPK_TRUE='#' COIN_HAS_OSIGLPK_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osiglpk" >&5 echo "${ECHO_T}$coin_has_osiglpk" >&6 fi if test $coin_has_osiglpk != skipping && test $coin_has_osiglpk != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIGLPK 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) OSIGLPK_DEPENDENCIES=`echo " $OSIGLPK_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 "$OSIGLPK_CFLAGS" ; then { echo "$as_me:$LINENO: OsiGlpk CFLAGS are $OSIGLPK_CFLAGS" >&5 echo "$as_me: OsiGlpk CFLAGS are $OSIGLPK_CFLAGS" >&6;} fi if test -n "$OSIGLPK_LIBS" ; then { echo "$as_me:$LINENO: OsiGlpk LIBS are $OSIGLPK_LIBS" >&5 echo "$as_me: OsiGlpk LIBS are $OSIGLPK_LIBS" >&6;} fi if test -n "$OSIGLPK_DEPENDENCIES" ; then { echo "$as_me:$LINENO: OsiGlpk DEPENDENCIES are $OSIGLPK_DEPENDENCIES" >&5 echo "$as_me: OsiGlpk DEPENDENCIES are $OSIGLPK_DEPENDENCIES" >&6;} fi if test -n "$OSIGLPK_DATA" ; then { echo "$as_me:$LINENO: OsiGlpk DATA is $OSIGLPK_DATA" >&5 echo "$as_me: OsiGlpk DATA is $OSIGLPK_DATA" >&6;} fi if test -n "$OSIGLPK_PCLIBS" ; then { echo "$as_me:$LINENO: OsiGlpk PCLIBS are $OSIGLPK_PCLIBS" >&5 echo "$as_me: OsiGlpk PCLIBS are $OSIGLPK_PCLIBS" >&6;} fi if test -n "$OSIGLPK_PCREQUIRES" ; then { echo "$as_me:$LINENO: OsiGlpk PCREQUIRES are $OSIGLPK_PCREQUIRES" >&5 echo "$as_me: OsiGlpk PCREQUIRES are $OSIGLPK_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_osiglpk != notGiven && test $coin_has_osiglpk != skipping; then COIN_HAS_OSIGLPK_TRUE= COIN_HAS_OSIGLPK_FALSE='#' else COIN_HAS_OSIGLPK_TRUE='#' COIN_HAS_OSIGLPK_FALSE= fi #AC_COIN_CHECK_PACKAGE(OsiGrb, [osi-gurobi]) echo "$as_me:$LINENO: checking for COIN-OR package OsiMsk" >&5 echo $ECHO_N "checking for COIN-OR package OsiMsk... $ECHO_C" >&6 coin_has_osimsk=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 = "OsiMsk"; then coin_has_osimsk=skipping fi done fi if test "$coin_has_osimsk" != skipping; then # Check whether --with-m4_tolower(OsiMsk) or --without-m4_tolower(OsiMsk) was given. if test "${with_osimsk+set}" = set; then withval="$with_osimsk" if test "$withval" = no ; then coin_has_osimsk=skipping fi fi; fi OSIMSK_LIBS= OSIMSK_CFLAGS= OSIMSK_DATA= OSIMSK_DEPENDENCIES= OSIMSK_PCLIBS= OSIMSK_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osimsk != skipping; then # Check whether --with-m4_tolower(OsiMsk)-lib or --without-m4_tolower(OsiMsk)-lib was given. if test "${with_osimsk_lib+set}" = set; then withval="$with_osimsk_lib" if test "$withval" = no ; then coin_has_osimsk=skipping else coin_has_osimsk=yes OSIMSK_LIBS="$withval" OSIMSK_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 OSIMSK_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osimsk != skipping; then # Check whether --with-m4_tolower(OsiMsk)-incdir or --without-m4_tolower(OsiMsk)-incdir was given. if test "${with_osimsk_incdir+set}" = set; then withval="$with_osimsk_incdir" if test "$withval" = no ; then coin_has_osimsk=skipping else coin_has_osimsk=yes OSIMSK_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 OSIMSK_CFLAGS_INSTALLED="$OSIMSK_CFLAGS" fi fi fi; fi if test $coin_has_osimsk != skipping; then # Check whether --with-m4_tolower(OsiMsk)-datadir or --without-m4_tolower(OsiMsk)-datadir was given. if test "${with_osimsk_datadir+set}" = set; then withval="$with_osimsk_datadir" if test "$withval" = no ; then coin_has_osimsk=skipping else coin_has_osimsk=yes OSIMSK_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 OSIMSK_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osimsk = 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 "osi-mosek"; then OSIMSK_VERSIONS=`$PKG_CONFIG --modversion "osi-mosek" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi-mosek" 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 OSIMSK_CFLAGS="$cflags" OSIMSK_LIBS=`$PKG_CONFIG --libs "osi-mosek" 2>/dev/null` OSIMSK_DATA=`$PKG_CONFIG --variable=datadir "osi-mosek" 2>/dev/null` coin_has_osimsk=yes echo "$as_me:$LINENO: result: yes: $OSIMSK_VERSIONS" >&5 echo "${ECHO_T}yes: $OSIMSK_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 OSIMSK_LIBS=`echo " $OSIMSK_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSIMSK_PCREQUIRES="osi-mosek" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else OSIMSK_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi-mosek"` coin_has_osimsk=notGiven echo "$as_me:$LINENO: result: not given: $OSIMSK_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSIMSK_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module OsiMsk without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module OsiMsk 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 OsiMsk (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package OsiMsk (fallback)... $ECHO_C" >&6 coin_has_osimsk=notGiven OSIMSK_LIBS= OSIMSK_LIBS_INSTALLED= OSIMSK_CFLAGS= OSIMSK_CFLAGS_INSTALLED= OSIMSK_DATA= OSIMSK_DATA_INSTALLED= OSIMSK_PCLIBS= OSIMSK_PCREQUIRES= # initial list of dependencies is "osi-mosek", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi-mosek" # 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$OSIMSK_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSIMSK_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$OSIMSK_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 OSIMSK_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 OSIMSK_CFLAGS="$projcflags $OSIMSK_CFLAGS" # set LIBS variable OSIMSK_LIBS="$projlibs $OSIMSK_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 OSIMSK_CFLAGS_INSTALLED="$projcflags $OSIMSK_CFLAGS_INSTALLED" # set LIBS variable OSIMSK_LIBS_INSTALLED="$projlibs $OSIMSK_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osimsk=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIMSK 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 OSIMSK_LIBS=`echo " $OSIMSK_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSIMSK_LIBS_INSTALLED=`echo " $OSIMSK_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 OSIMSK_PCREQUIRES="osi-mosek" fi if test $coin_has_osimsk != notGiven && test $coin_has_osimsk != skipping; then COIN_HAS_OSIMSK_TRUE= COIN_HAS_OSIMSK_FALSE='#' else COIN_HAS_OSIMSK_TRUE='#' COIN_HAS_OSIMSK_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osimsk" >&5 echo "${ECHO_T}$coin_has_osimsk" >&6 fi if test $coin_has_osimsk != skipping && test $coin_has_osimsk != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIMSK 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) OSIMSK_DEPENDENCIES=`echo " $OSIMSK_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 "$OSIMSK_CFLAGS" ; then { echo "$as_me:$LINENO: OsiMsk CFLAGS are $OSIMSK_CFLAGS" >&5 echo "$as_me: OsiMsk CFLAGS are $OSIMSK_CFLAGS" >&6;} fi if test -n "$OSIMSK_LIBS" ; then { echo "$as_me:$LINENO: OsiMsk LIBS are $OSIMSK_LIBS" >&5 echo "$as_me: OsiMsk LIBS are $OSIMSK_LIBS" >&6;} fi if test -n "$OSIMSK_DEPENDENCIES" ; then { echo "$as_me:$LINENO: OsiMsk DEPENDENCIES are $OSIMSK_DEPENDENCIES" >&5 echo "$as_me: OsiMsk DEPENDENCIES are $OSIMSK_DEPENDENCIES" >&6;} fi if test -n "$OSIMSK_DATA" ; then { echo "$as_me:$LINENO: OsiMsk DATA is $OSIMSK_DATA" >&5 echo "$as_me: OsiMsk DATA is $OSIMSK_DATA" >&6;} fi if test -n "$OSIMSK_PCLIBS" ; then { echo "$as_me:$LINENO: OsiMsk PCLIBS are $OSIMSK_PCLIBS" >&5 echo "$as_me: OsiMsk PCLIBS are $OSIMSK_PCLIBS" >&6;} fi if test -n "$OSIMSK_PCREQUIRES" ; then { echo "$as_me:$LINENO: OsiMsk PCREQUIRES are $OSIMSK_PCREQUIRES" >&5 echo "$as_me: OsiMsk PCREQUIRES are $OSIMSK_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_osimsk != notGiven && test $coin_has_osimsk != skipping; then COIN_HAS_OSIMSK_TRUE= COIN_HAS_OSIMSK_FALSE='#' else COIN_HAS_OSIMSK_TRUE='#' COIN_HAS_OSIMSK_FALSE= fi echo "$as_me:$LINENO: checking for COIN-OR package OsiXpr" >&5 echo $ECHO_N "checking for COIN-OR package OsiXpr... $ECHO_C" >&6 coin_has_osixpr=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 = "OsiXpr"; then coin_has_osixpr=skipping fi done fi if test "$coin_has_osixpr" != skipping; then # Check whether --with-m4_tolower(OsiXpr) or --without-m4_tolower(OsiXpr) was given. if test "${with_osixpr+set}" = set; then withval="$with_osixpr" if test "$withval" = no ; then coin_has_osixpr=skipping fi fi; fi OSIXPR_LIBS= OSIXPR_CFLAGS= OSIXPR_DATA= OSIXPR_DEPENDENCIES= OSIXPR_PCLIBS= OSIXPR_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osixpr != skipping; then # Check whether --with-m4_tolower(OsiXpr)-lib or --without-m4_tolower(OsiXpr)-lib was given. if test "${with_osixpr_lib+set}" = set; then withval="$with_osixpr_lib" if test "$withval" = no ; then coin_has_osixpr=skipping else coin_has_osixpr=yes OSIXPR_LIBS="$withval" OSIXPR_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 OSIXPR_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osixpr != skipping; then # Check whether --with-m4_tolower(OsiXpr)-incdir or --without-m4_tolower(OsiXpr)-incdir was given. if test "${with_osixpr_incdir+set}" = set; then withval="$with_osixpr_incdir" if test "$withval" = no ; then coin_has_osixpr=skipping else coin_has_osixpr=yes OSIXPR_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 OSIXPR_CFLAGS_INSTALLED="$OSIXPR_CFLAGS" fi fi fi; fi if test $coin_has_osixpr != skipping; then # Check whether --with-m4_tolower(OsiXpr)-datadir or --without-m4_tolower(OsiXpr)-datadir was given. if test "${with_osixpr_datadir+set}" = set; then withval="$with_osixpr_datadir" if test "$withval" = no ; then coin_has_osixpr=skipping else coin_has_osixpr=yes OSIXPR_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 OSIXPR_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osixpr = 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 "osi-xpress"; then OSIXPR_VERSIONS=`$PKG_CONFIG --modversion "osi-xpress" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi-xpress" 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 OSIXPR_CFLAGS="$cflags" OSIXPR_LIBS=`$PKG_CONFIG --libs "osi-xpress" 2>/dev/null` OSIXPR_DATA=`$PKG_CONFIG --variable=datadir "osi-xpress" 2>/dev/null` coin_has_osixpr=yes echo "$as_me:$LINENO: result: yes: $OSIXPR_VERSIONS" >&5 echo "${ECHO_T}yes: $OSIXPR_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 OSIXPR_LIBS=`echo " $OSIXPR_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSIXPR_PCREQUIRES="osi-xpress" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else OSIXPR_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi-xpress"` coin_has_osixpr=notGiven echo "$as_me:$LINENO: result: not given: $OSIXPR_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSIXPR_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module OsiXpr without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module OsiXpr 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 OsiXpr (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package OsiXpr (fallback)... $ECHO_C" >&6 coin_has_osixpr=notGiven OSIXPR_LIBS= OSIXPR_LIBS_INSTALLED= OSIXPR_CFLAGS= OSIXPR_CFLAGS_INSTALLED= OSIXPR_DATA= OSIXPR_DATA_INSTALLED= OSIXPR_PCLIBS= OSIXPR_PCREQUIRES= # initial list of dependencies is "osi-xpress", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi-xpress" # 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$OSIXPR_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSIXPR_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$OSIXPR_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 OSIXPR_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 OSIXPR_CFLAGS="$projcflags $OSIXPR_CFLAGS" # set LIBS variable OSIXPR_LIBS="$projlibs $OSIXPR_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 OSIXPR_CFLAGS_INSTALLED="$projcflags $OSIXPR_CFLAGS_INSTALLED" # set LIBS variable OSIXPR_LIBS_INSTALLED="$projlibs $OSIXPR_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osixpr=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIXPR 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 OSIXPR_LIBS=`echo " $OSIXPR_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSIXPR_LIBS_INSTALLED=`echo " $OSIXPR_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 OSIXPR_PCREQUIRES="osi-xpress" fi if test $coin_has_osixpr != notGiven && test $coin_has_osixpr != skipping; then COIN_HAS_OSIXPR_TRUE= COIN_HAS_OSIXPR_FALSE='#' else COIN_HAS_OSIXPR_TRUE='#' COIN_HAS_OSIXPR_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osixpr" >&5 echo "${ECHO_T}$coin_has_osixpr" >&6 fi if test $coin_has_osixpr != skipping && test $coin_has_osixpr != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIXPR 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) OSIXPR_DEPENDENCIES=`echo " $OSIXPR_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 "$OSIXPR_CFLAGS" ; then { echo "$as_me:$LINENO: OsiXpr CFLAGS are $OSIXPR_CFLAGS" >&5 echo "$as_me: OsiXpr CFLAGS are $OSIXPR_CFLAGS" >&6;} fi if test -n "$OSIXPR_LIBS" ; then { echo "$as_me:$LINENO: OsiXpr LIBS are $OSIXPR_LIBS" >&5 echo "$as_me: OsiXpr LIBS are $OSIXPR_LIBS" >&6;} fi if test -n "$OSIXPR_DEPENDENCIES" ; then { echo "$as_me:$LINENO: OsiXpr DEPENDENCIES are $OSIXPR_DEPENDENCIES" >&5 echo "$as_me: OsiXpr DEPENDENCIES are $OSIXPR_DEPENDENCIES" >&6;} fi if test -n "$OSIXPR_DATA" ; then { echo "$as_me:$LINENO: OsiXpr DATA is $OSIXPR_DATA" >&5 echo "$as_me: OsiXpr DATA is $OSIXPR_DATA" >&6;} fi if test -n "$OSIXPR_PCLIBS" ; then { echo "$as_me:$LINENO: OsiXpr PCLIBS are $OSIXPR_PCLIBS" >&5 echo "$as_me: OsiXpr PCLIBS are $OSIXPR_PCLIBS" >&6;} fi if test -n "$OSIXPR_PCREQUIRES" ; then { echo "$as_me:$LINENO: OsiXpr PCREQUIRES are $OSIXPR_PCREQUIRES" >&5 echo "$as_me: OsiXpr PCREQUIRES are $OSIXPR_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_osixpr != notGiven && test $coin_has_osixpr != skipping; then COIN_HAS_OSIXPR_TRUE= COIN_HAS_OSIXPR_FALSE='#' else COIN_HAS_OSIXPR_TRUE='#' COIN_HAS_OSIXPR_FALSE= fi echo "$as_me:$LINENO: checking for COIN-OR package OsiVol" >&5 echo $ECHO_N "checking for COIN-OR package OsiVol... $ECHO_C" >&6 coin_has_osivol=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 = "OsiVol"; then coin_has_osivol=skipping fi done fi if test "$coin_has_osivol" != skipping; then # Check whether --with-m4_tolower(OsiVol) or --without-m4_tolower(OsiVol) was given. if test "${with_osivol+set}" = set; then withval="$with_osivol" if test "$withval" = no ; then coin_has_osivol=skipping fi fi; fi OSIVOL_LIBS= OSIVOL_CFLAGS= OSIVOL_DATA= OSIVOL_DEPENDENCIES= OSIVOL_PCLIBS= OSIVOL_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osivol != skipping; then # Check whether --with-m4_tolower(OsiVol)-lib or --without-m4_tolower(OsiVol)-lib was given. if test "${with_osivol_lib+set}" = set; then withval="$with_osivol_lib" if test "$withval" = no ; then coin_has_osivol=skipping else coin_has_osivol=yes OSIVOL_LIBS="$withval" OSIVOL_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 OSIVOL_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osivol != skipping; then # Check whether --with-m4_tolower(OsiVol)-incdir or --without-m4_tolower(OsiVol)-incdir was given. if test "${with_osivol_incdir+set}" = set; then withval="$with_osivol_incdir" if test "$withval" = no ; then coin_has_osivol=skipping else coin_has_osivol=yes OSIVOL_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 OSIVOL_CFLAGS_INSTALLED="$OSIVOL_CFLAGS" fi fi fi; fi if test $coin_has_osivol != skipping; then # Check whether --with-m4_tolower(OsiVol)-datadir or --without-m4_tolower(OsiVol)-datadir was given. if test "${with_osivol_datadir+set}" = set; then withval="$with_osivol_datadir" if test "$withval" = no ; then coin_has_osivol=skipping else coin_has_osivol=yes OSIVOL_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 OSIVOL_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osivol = 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 "osi-vol"; then OSIVOL_VERSIONS=`$PKG_CONFIG --modversion "osi-vol" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi-vol" 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 OSIVOL_CFLAGS="$cflags" OSIVOL_LIBS=`$PKG_CONFIG --libs "osi-vol" 2>/dev/null` OSIVOL_DATA=`$PKG_CONFIG --variable=datadir "osi-vol" 2>/dev/null` coin_has_osivol=yes echo "$as_me:$LINENO: result: yes: $OSIVOL_VERSIONS" >&5 echo "${ECHO_T}yes: $OSIVOL_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 OSIVOL_LIBS=`echo " $OSIVOL_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSIVOL_PCREQUIRES="osi-vol" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else OSIVOL_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi-vol"` coin_has_osivol=notGiven echo "$as_me:$LINENO: result: not given: $OSIVOL_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSIVOL_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module OsiVol without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module OsiVol 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 OsiVol (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package OsiVol (fallback)... $ECHO_C" >&6 coin_has_osivol=notGiven OSIVOL_LIBS= OSIVOL_LIBS_INSTALLED= OSIVOL_CFLAGS= OSIVOL_CFLAGS_INSTALLED= OSIVOL_DATA= OSIVOL_DATA_INSTALLED= OSIVOL_PCLIBS= OSIVOL_PCREQUIRES= # initial list of dependencies is "osi-vol", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi-vol" # 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$OSIVOL_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSIVOL_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$OSIVOL_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 OSIVOL_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 OSIVOL_CFLAGS="$projcflags $OSIVOL_CFLAGS" # set LIBS variable OSIVOL_LIBS="$projlibs $OSIVOL_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 OSIVOL_CFLAGS_INSTALLED="$projcflags $OSIVOL_CFLAGS_INSTALLED" # set LIBS variable OSIVOL_LIBS_INSTALLED="$projlibs $OSIVOL_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osivol=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIVOL 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 OSIVOL_LIBS=`echo " $OSIVOL_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSIVOL_LIBS_INSTALLED=`echo " $OSIVOL_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 OSIVOL_PCREQUIRES="osi-vol" fi if test $coin_has_osivol != notGiven && test $coin_has_osivol != skipping; then COIN_HAS_OSIVOL_TRUE= COIN_HAS_OSIVOL_FALSE='#' else COIN_HAS_OSIVOL_TRUE='#' COIN_HAS_OSIVOL_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osivol" >&5 echo "${ECHO_T}$coin_has_osivol" >&6 fi if test $coin_has_osivol != skipping && test $coin_has_osivol != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIVOL 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) OSIVOL_DEPENDENCIES=`echo " $OSIVOL_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 "$OSIVOL_CFLAGS" ; then { echo "$as_me:$LINENO: OsiVol CFLAGS are $OSIVOL_CFLAGS" >&5 echo "$as_me: OsiVol CFLAGS are $OSIVOL_CFLAGS" >&6;} fi if test -n "$OSIVOL_LIBS" ; then { echo "$as_me:$LINENO: OsiVol LIBS are $OSIVOL_LIBS" >&5 echo "$as_me: OsiVol LIBS are $OSIVOL_LIBS" >&6;} fi if test -n "$OSIVOL_DEPENDENCIES" ; then { echo "$as_me:$LINENO: OsiVol DEPENDENCIES are $OSIVOL_DEPENDENCIES" >&5 echo "$as_me: OsiVol DEPENDENCIES are $OSIVOL_DEPENDENCIES" >&6;} fi if test -n "$OSIVOL_DATA" ; then { echo "$as_me:$LINENO: OsiVol DATA is $OSIVOL_DATA" >&5 echo "$as_me: OsiVol DATA is $OSIVOL_DATA" >&6;} fi if test -n "$OSIVOL_PCLIBS" ; then { echo "$as_me:$LINENO: OsiVol PCLIBS are $OSIVOL_PCLIBS" >&5 echo "$as_me: OsiVol PCLIBS are $OSIVOL_PCLIBS" >&6;} fi if test -n "$OSIVOL_PCREQUIRES" ; then { echo "$as_me:$LINENO: OsiVol PCREQUIRES are $OSIVOL_PCREQUIRES" >&5 echo "$as_me: OsiVol PCREQUIRES are $OSIVOL_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_osivol != notGiven && test $coin_has_osivol != skipping; then COIN_HAS_OSIVOL_TRUE= COIN_HAS_OSIVOL_FALSE='#' else COIN_HAS_OSIVOL_TRUE='#' COIN_HAS_OSIVOL_FALSE= fi echo "$as_me:$LINENO: checking for COIN-OR package OsiDyLP" >&5 echo $ECHO_N "checking for COIN-OR package OsiDyLP... $ECHO_C" >&6 coin_has_osidylp=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 = "OsiDyLP"; then coin_has_osidylp=skipping fi done fi if test "$coin_has_osidylp" != skipping; then # Check whether --with-m4_tolower(OsiDyLP) or --without-m4_tolower(OsiDyLP) was given. if test "${with_osidylp+set}" = set; then withval="$with_osidylp" if test "$withval" = no ; then coin_has_osidylp=skipping fi fi; fi OSIDYLP_LIBS= OSIDYLP_CFLAGS= OSIDYLP_DATA= OSIDYLP_DEPENDENCIES= OSIDYLP_PCLIBS= OSIDYLP_PCREQUIRES= #check if user provided LIBS, CFLAGS, or DATA for package or disables use of package if test $coin_has_osidylp != skipping; then # Check whether --with-m4_tolower(OsiDyLP)-lib or --without-m4_tolower(OsiDyLP)-lib was given. if test "${with_osidylp_lib+set}" = set; then withval="$with_osidylp_lib" if test "$withval" = no ; then coin_has_osidylp=skipping else coin_has_osidylp=yes OSIDYLP_LIBS="$withval" OSIDYLP_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 OSIDYLP_LIBS_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osidylp != skipping; then # Check whether --with-m4_tolower(OsiDyLP)-incdir or --without-m4_tolower(OsiDyLP)-incdir was given. if test "${with_osidylp_incdir+set}" = set; then withval="$with_osidylp_incdir" if test "$withval" = no ; then coin_has_osidylp=skipping else coin_has_osidylp=yes OSIDYLP_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 OSIDYLP_CFLAGS_INSTALLED="$OSIDYLP_CFLAGS" fi fi fi; fi if test $coin_has_osidylp != skipping; then # Check whether --with-m4_tolower(OsiDyLP)-datadir or --without-m4_tolower(OsiDyLP)-datadir was given. if test "${with_osidylp_datadir+set}" = set; then withval="$with_osidylp_datadir" if test "$withval" = no ; then coin_has_osidylp=skipping else coin_has_osidylp=yes OSIDYLP_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 OSIDYLP_DATA_INSTALLED="$withval" fi fi fi; fi if test $coin_has_osidylp = 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 "osi-dylp"; then OSIDYLP_VERSIONS=`$PKG_CONFIG --modversion "osi-dylp" 2>/dev/null | tr '\n' ' '` cflags=`$PKG_CONFIG --cflags "osi-dylp" 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 OSIDYLP_CFLAGS="$cflags" OSIDYLP_LIBS=`$PKG_CONFIG --libs "osi-dylp" 2>/dev/null` OSIDYLP_DATA=`$PKG_CONFIG --variable=datadir "osi-dylp" 2>/dev/null` coin_has_osidylp=yes echo "$as_me:$LINENO: result: yes: $OSIDYLP_VERSIONS" >&5 echo "${ECHO_T}yes: $OSIDYLP_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 OSIDYLP_LIBS=`echo " $OSIDYLP_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` fi OSIDYLP_PCREQUIRES="osi-dylp" # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in else OSIDYLP_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "osi-dylp"` coin_has_osidylp=notGiven echo "$as_me:$LINENO: result: not given: $OSIDYLP_PKG_ERRORS" >&5 echo "${ECHO_T}not given: $OSIDYLP_PKG_ERRORS" >&6 fi else { { echo "$as_me:$LINENO: error: \"Cannot check for existance of module OsiDyLP without pkg-config\"" >&5 echo "$as_me: error: \"Cannot check for existance of module OsiDyLP 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 OsiDyLP (fallback)" >&5 echo $ECHO_N "checking for COIN-OR package OsiDyLP (fallback)... $ECHO_C" >&6 coin_has_osidylp=notGiven OSIDYLP_LIBS= OSIDYLP_LIBS_INSTALLED= OSIDYLP_CFLAGS= OSIDYLP_CFLAGS_INSTALLED= OSIDYLP_DATA= OSIDYLP_DATA_INSTALLED= OSIDYLP_PCLIBS= OSIDYLP_PCREQUIRES= # initial list of dependencies is "osi-dylp", but we need to filter out version number specifications (= x, <= x, >= x, != x) projtoprocess="osi-dylp" # 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$OSIDYLP_DATA" = x ; then projdatadir= pcfilemod=`sed -e '/[a-zA-Z]:/d' -e 's/datadir=\(.*\)/echo projdatadir=\\\\"\1\\\\"/g' $pcfile` eval `sh -c "$pcfilemod"` OSIDYLP_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$OSIDYLP_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 OSIDYLP_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 OSIDYLP_CFLAGS="$projcflags $OSIDYLP_CFLAGS" # set LIBS variable OSIDYLP_LIBS="$projlibs $OSIDYLP_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 OSIDYLP_CFLAGS_INSTALLED="$projcflags $OSIDYLP_CFLAGS_INSTALLED" # set LIBS variable OSIDYLP_LIBS_INSTALLED="$projlibs $OSIDYLP_LIBS_INSTALLED" # remember that we have processed $pcfile pcfilesprocessed="$pcfilesprocessed:$pcfile" done IFS="$save_IFS" # finish up coin_has_osidylp=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIDYLP 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 OSIDYLP_LIBS=`echo " $OSIDYLP_LIBS " | sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g'` OSIDYLP_LIBS_INSTALLED=`echo " $OSIDYLP_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 OSIDYLP_PCREQUIRES="osi-dylp" fi if test $coin_has_osidylp != notGiven && test $coin_has_osidylp != skipping; then COIN_HAS_OSIDYLP_TRUE= COIN_HAS_OSIDYLP_FALSE='#' else COIN_HAS_OSIDYLP_TRUE='#' COIN_HAS_OSIDYLP_FALSE= fi fi else echo "$as_me:$LINENO: result: $coin_has_osidylp" >&5 echo "${ECHO_T}$coin_has_osidylp" >&6 fi if test $coin_has_osidylp != skipping && test $coin_has_osidylp != notGiven ; then cat >>confdefs.h <<\_ACEOF #define COIN_HAS_OSIDYLP 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) OSIDYLP_DEPENDENCIES=`echo " $OSIDYLP_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 "$OSIDYLP_CFLAGS" ; then { echo "$as_me:$LINENO: OsiDyLP CFLAGS are $OSIDYLP_CFLAGS" >&5 echo "$as_me: OsiDyLP CFLAGS are $OSIDYLP_CFLAGS" >&6;} fi if test -n "$OSIDYLP_LIBS" ; then { echo "$as_me:$LINENO: OsiDyLP LIBS are $OSIDYLP_LIBS" >&5 echo "$as_me: OsiDyLP LIBS are $OSIDYLP_LIBS" >&6;} fi if test -n "$OSIDYLP_DEPENDENCIES" ; then { echo "$as_me:$LINENO: OsiDyLP DEPENDENCIES are $OSIDYLP_DEPENDENCIES" >&5 echo "$as_me: OsiDyLP DEPENDENCIES are $OSIDYLP_DEPENDENCIES" >&6;} fi if test -n "$OSIDYLP_DATA" ; then { echo "$as_me:$LINENO: OsiDyLP DATA is $OSIDYLP_DATA" >&5 echo "$as_me: OsiDyLP DATA is $OSIDYLP_DATA" >&6;} fi if test -n "$OSIDYLP_PCLIBS" ; then { echo "$as_me:$LINENO: OsiDyLP PCLIBS are $OSIDYLP_PCLIBS" >&5 echo "$as_me: OsiDyLP PCLIBS are $OSIDYLP_PCLIBS" >&6;} fi if test -n "$OSIDYLP_PCREQUIRES" ; then { echo "$as_me:$LINENO: OsiDyLP PCREQUIRES are $OSIDYLP_PCREQUIRES" >&5 echo "$as_me: OsiDyLP PCREQUIRES are $OSIDYLP_PCREQUIRES" >&6;} fi fi fi # Define the Makefile conditional if test $coin_has_osidylp != notGiven && test $coin_has_osidylp != skipping; then COIN_HAS_OSIDYLP_TRUE= COIN_HAS_OSIDYLP_FALSE='#' else COIN_HAS_OSIDYLP_TRUE='#' COIN_HAS_OSIDYLP_FALSE= fi #AC_COIN_CHECK_PACKAGE(OsiSpx, [osi-soplex]) ############################################################################# # 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 cgl@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 cgl@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 cgl@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 cgl@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 cgl@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 cgl@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 ############################################################################# # Determine list of all Cgl subprojects # ############################################################################# # In order to avoid that one has to update this configure.ac and the # Makefile.am whenever a new cut generator is added, we automatically determine # the list of all subdirectories of src with a Makefile.in (CGL_SUBDIRS), # and also a list of all sublibraries relative to src (CGL_SUBLIBS) that # can be used in the src/Makefile.am. (It is still necessary to manually # add an entry to write the Makefile in the AC_CONFIG_FILES list below.) curr_dir=`pwd` cd $srcdir/src for file in `ls */Makefile.in`; do newdir=`echo $file | sed -e s%/Makefile.in%% | sed -e s%^./%% ` CGL_SUBDIRS="$CGL_SUBDIRS $newdir" CGL_SUBLIBS="$CGL_SUBLIBS $newdir/lib${newdir}.la" done cd $curr_dir ############################################################################# # 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 ############################################################################## # Finishing up by writing all the output # ############################################################################## # Install files for unitTest echo "$as_me:$LINENO: checking whether this is a VPATH configuration" >&5 echo $ECHO_N "checking whether this is a VPATH configuration... $ECHO_C" >&6 if test `cd $srcdir; pwd` != `pwd`; then coin_vpath_config=yes; else coin_vpath_config=no; fi echo "$as_me:$LINENO: result: $coin_vpath_config" >&5 echo "${ECHO_T}$coin_vpath_config" >&6 # Allow for newlines in the parameter if test $coin_vpath_config = yes; then cvl_tmp="test/CglTestData/capPlan1.mps test/CglTestData/l152lav.mps test/CglTestData/egout.mps test/CglTestData/lseu.mps" for file in $cvl_tmp ; do coin_vpath_link_files="$coin_vpath_link_files $file" done fi # 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/Makefile src/CglAllDifferent/Makefile src/CglClique/Makefile src/CglDuplicateRow/Makefile src/CglFlowCover/Makefile src/CglGMI/Makefile src/CglGomory/Makefile src/CglKnapsackCover/Makefile src/CglLandP/Makefile src/CglLiftAndProject/Makefile src/CglMixedIntegerRounding/Makefile src/CglMixedIntegerRounding2/Makefile src/CglOddHole/Makefile src/CglPreProcess/Makefile src/CglProbing/Makefile src/CglRedSplit/Makefile src/CglRedSplit2/Makefile src/CglResidualCapacity/Makefile src/CglSimpleRounding/Makefile src/CglTwomir/Makefile src/CglZeroHalf/Makefile test/Makefile cgl.pc cgl-uninstalled.pc" 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/config.h src/config_cgl.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_OSI_TRUE}" && test -z "${COIN_HAS_OSI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSI_TRUE}" && test -z "${COIN_HAS_OSI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSI\" 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_OSICLP_TRUE}" && test -z "${COIN_HAS_OSICLP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSICLP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSICLP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSICLP_TRUE}" && test -z "${COIN_HAS_OSICLP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSICLP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSICLP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSICPX_TRUE}" && test -z "${COIN_HAS_OSICPX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSICPX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSICPX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSICPX_TRUE}" && test -z "${COIN_HAS_OSICPX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSICPX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSICPX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIGLPK_TRUE}" && test -z "${COIN_HAS_OSIGLPK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIGLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIGLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIGLPK_TRUE}" && test -z "${COIN_HAS_OSIGLPK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIGLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIGLPK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIMSK_TRUE}" && test -z "${COIN_HAS_OSIMSK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIMSK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIMSK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIMSK_TRUE}" && test -z "${COIN_HAS_OSIMSK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIMSK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIMSK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIXPR_TRUE}" && test -z "${COIN_HAS_OSIXPR_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIXPR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIXPR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIXPR_TRUE}" && test -z "${COIN_HAS_OSIXPR_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIXPR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIXPR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIVOL_TRUE}" && test -z "${COIN_HAS_OSIVOL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIVOL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIVOL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIVOL_TRUE}" && test -z "${COIN_HAS_OSIVOL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIVOL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIVOL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIDYLP_TRUE}" && test -z "${COIN_HAS_OSIDYLP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIDYLP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIDYLP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COIN_HAS_OSIDYLP_TRUE}" && test -z "${COIN_HAS_OSIDYLP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COIN_HAS_OSIDYLP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COIN_HAS_OSIDYLP\" 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 Cgl $as_me 0.58.9, 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="\\ Cgl config.status 0.58.9 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/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/CglAllDifferent/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglAllDifferent/Makefile" ;; "src/CglClique/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglClique/Makefile" ;; "src/CglDuplicateRow/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglDuplicateRow/Makefile" ;; "src/CglFlowCover/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglFlowCover/Makefile" ;; "src/CglGMI/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglGMI/Makefile" ;; "src/CglGomory/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglGomory/Makefile" ;; "src/CglKnapsackCover/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglKnapsackCover/Makefile" ;; "src/CglLandP/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglLandP/Makefile" ;; "src/CglLiftAndProject/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglLiftAndProject/Makefile" ;; "src/CglMixedIntegerRounding/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglMixedIntegerRounding/Makefile" ;; "src/CglMixedIntegerRounding2/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglMixedIntegerRounding2/Makefile" ;; "src/CglOddHole/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglOddHole/Makefile" ;; "src/CglPreProcess/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglPreProcess/Makefile" ;; "src/CglProbing/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglProbing/Makefile" ;; "src/CglRedSplit/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglRedSplit/Makefile" ;; "src/CglRedSplit2/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglRedSplit2/Makefile" ;; "src/CglResidualCapacity/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglResidualCapacity/Makefile" ;; "src/CglSimpleRounding/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglSimpleRounding/Makefile" ;; "src/CglTwomir/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglTwomir/Makefile" ;; "src/CglZeroHalf/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/CglZeroHalf/Makefile" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "cgl.pc" ) CONFIG_FILES="$CONFIG_FILES cgl.pc" ;; "cgl-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES cgl-uninstalled.pc" ;; "doxydoc/doxygen.conf" ) CONFIG_FILES="$CONFIG_FILES doxydoc/doxygen.conf" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "src/config_cgl.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config_cgl.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,@CGL_SVN_REV@,$CGL_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,@CGLLIB_CFLAGS@,$CGLLIB_CFLAGS,;t t s,@CGLLIB_LIBS@,$CGLLIB_LIBS,;t t s,@CGLLIB_PCLIBS@,$CGLLIB_PCLIBS,;t t s,@CGLLIB_PCREQUIRES@,$CGLLIB_PCREQUIRES,;t t s,@CGLLIB_DEPENDENCIES@,$CGLLIB_DEPENDENCIES,;t t s,@CGLLIB_CFLAGS_INSTALLED@,$CGLLIB_CFLAGS_INSTALLED,;t t s,@CGLLIB_LIBS_INSTALLED@,$CGLLIB_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,@OSI_LIBS@,$OSI_LIBS,;t t s,@OSI_CFLAGS@,$OSI_CFLAGS,;t t s,@OSI_DATA@,$OSI_DATA,;t t s,@OSI_DEPENDENCIES@,$OSI_DEPENDENCIES,;t t s,@OSI_LIBS_INSTALLED@,$OSI_LIBS_INSTALLED,;t t s,@OSI_CFLAGS_INSTALLED@,$OSI_CFLAGS_INSTALLED,;t t s,@OSI_DATA_INSTALLED@,$OSI_DATA_INSTALLED,;t t s,@COIN_HAS_OSI_TRUE@,$COIN_HAS_OSI_TRUE,;t t s,@COIN_HAS_OSI_FALSE@,$COIN_HAS_OSI_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,@OSICLP_LIBS@,$OSICLP_LIBS,;t t s,@OSICLP_CFLAGS@,$OSICLP_CFLAGS,;t t s,@OSICLP_DATA@,$OSICLP_DATA,;t t s,@OSICLP_DEPENDENCIES@,$OSICLP_DEPENDENCIES,;t t s,@OSICLP_LIBS_INSTALLED@,$OSICLP_LIBS_INSTALLED,;t t s,@OSICLP_CFLAGS_INSTALLED@,$OSICLP_CFLAGS_INSTALLED,;t t s,@OSICLP_DATA_INSTALLED@,$OSICLP_DATA_INSTALLED,;t t s,@COIN_HAS_OSICLP_TRUE@,$COIN_HAS_OSICLP_TRUE,;t t s,@COIN_HAS_OSICLP_FALSE@,$COIN_HAS_OSICLP_FALSE,;t t s,@OSICPX_LIBS@,$OSICPX_LIBS,;t t s,@OSICPX_CFLAGS@,$OSICPX_CFLAGS,;t t s,@OSICPX_DATA@,$OSICPX_DATA,;t t s,@OSICPX_DEPENDENCIES@,$OSICPX_DEPENDENCIES,;t t s,@OSICPX_LIBS_INSTALLED@,$OSICPX_LIBS_INSTALLED,;t t s,@OSICPX_CFLAGS_INSTALLED@,$OSICPX_CFLAGS_INSTALLED,;t t s,@OSICPX_DATA_INSTALLED@,$OSICPX_DATA_INSTALLED,;t t s,@COIN_HAS_OSICPX_TRUE@,$COIN_HAS_OSICPX_TRUE,;t t s,@COIN_HAS_OSICPX_FALSE@,$COIN_HAS_OSICPX_FALSE,;t t s,@OSIGLPK_LIBS@,$OSIGLPK_LIBS,;t t s,@OSIGLPK_CFLAGS@,$OSIGLPK_CFLAGS,;t t s,@OSIGLPK_DATA@,$OSIGLPK_DATA,;t t s,@OSIGLPK_DEPENDENCIES@,$OSIGLPK_DEPENDENCIES,;t t s,@OSIGLPK_LIBS_INSTALLED@,$OSIGLPK_LIBS_INSTALLED,;t t s,@OSIGLPK_CFLAGS_INSTALLED@,$OSIGLPK_CFLAGS_INSTALLED,;t t s,@OSIGLPK_DATA_INSTALLED@,$OSIGLPK_DATA_INSTALLED,;t t s,@COIN_HAS_OSIGLPK_TRUE@,$COIN_HAS_OSIGLPK_TRUE,;t t s,@COIN_HAS_OSIGLPK_FALSE@,$COIN_HAS_OSIGLPK_FALSE,;t t s,@OSIMSK_LIBS@,$OSIMSK_LIBS,;t t s,@OSIMSK_CFLAGS@,$OSIMSK_CFLAGS,;t t s,@OSIMSK_DATA@,$OSIMSK_DATA,;t t s,@OSIMSK_DEPENDENCIES@,$OSIMSK_DEPENDENCIES,;t t s,@OSIMSK_LIBS_INSTALLED@,$OSIMSK_LIBS_INSTALLED,;t t s,@OSIMSK_CFLAGS_INSTALLED@,$OSIMSK_CFLAGS_INSTALLED,;t t s,@OSIMSK_DATA_INSTALLED@,$OSIMSK_DATA_INSTALLED,;t t s,@COIN_HAS_OSIMSK_TRUE@,$COIN_HAS_OSIMSK_TRUE,;t t s,@COIN_HAS_OSIMSK_FALSE@,$COIN_HAS_OSIMSK_FALSE,;t t s,@OSIXPR_LIBS@,$OSIXPR_LIBS,;t t s,@OSIXPR_CFLAGS@,$OSIXPR_CFLAGS,;t t s,@OSIXPR_DATA@,$OSIXPR_DATA,;t t s,@OSIXPR_DEPENDENCIES@,$OSIXPR_DEPENDENCIES,;t t s,@OSIXPR_LIBS_INSTALLED@,$OSIXPR_LIBS_INSTALLED,;t t s,@OSIXPR_CFLAGS_INSTALLED@,$OSIXPR_CFLAGS_INSTALLED,;t t s,@OSIXPR_DATA_INSTALLED@,$OSIXPR_DATA_INSTALLED,;t t s,@COIN_HAS_OSIXPR_TRUE@,$COIN_HAS_OSIXPR_TRUE,;t t s,@COIN_HAS_OSIXPR_FALSE@,$COIN_HAS_OSIXPR_FALSE,;t t s,@OSIVOL_LIBS@,$OSIVOL_LIBS,;t t s,@OSIVOL_CFLAGS@,$OSIVOL_CFLAGS,;t t s,@OSIVOL_DATA@,$OSIVOL_DATA,;t t s,@OSIVOL_DEPENDENCIES@,$OSIVOL_DEPENDENCIES,;t t s,@OSIVOL_LIBS_INSTALLED@,$OSIVOL_LIBS_INSTALLED,;t t s,@OSIVOL_CFLAGS_INSTALLED@,$OSIVOL_CFLAGS_INSTALLED,;t t s,@OSIVOL_DATA_INSTALLED@,$OSIVOL_DATA_INSTALLED,;t t s,@COIN_HAS_OSIVOL_TRUE@,$COIN_HAS_OSIVOL_TRUE,;t t s,@COIN_HAS_OSIVOL_FALSE@,$COIN_HAS_OSIVOL_FALSE,;t t s,@OSIDYLP_LIBS@,$OSIDYLP_LIBS,;t t s,@OSIDYLP_CFLAGS@,$OSIDYLP_CFLAGS,;t t s,@OSIDYLP_DATA@,$OSIDYLP_DATA,;t t s,@OSIDYLP_DEPENDENCIES@,$OSIDYLP_DEPENDENCIES,;t t s,@OSIDYLP_LIBS_INSTALLED@,$OSIDYLP_LIBS_INSTALLED,;t t s,@OSIDYLP_CFLAGS_INSTALLED@,$OSIDYLP_CFLAGS_INSTALLED,;t t s,@OSIDYLP_DATA_INSTALLED@,$OSIDYLP_DATA_INSTALLED,;t t s,@COIN_HAS_OSIDYLP_TRUE@,$COIN_HAS_OSIDYLP_TRUE,;t t s,@COIN_HAS_OSIDYLP_FALSE@,$COIN_HAS_OSIDYLP_FALSE,;t t s,@CGL_SUBDIRS@,$CGL_SUBDIRS,;t t s,@CGL_SUBLIBS@,$CGL_SUBLIBS,;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 Cgl-0.58.9/config.guess0000755000076600007660000012706311405215371013330 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: