Changeset 582


Ignore:
Timestamp:
Jun 11, 2007 12:52:40 PM (12 years ago)
Author:
andreasw
Message:

minor changes to make code compile with MSVC++; reran autotools

Location:
branches/Couenne/Couenne
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/Couenne/Couenne/configure

    r549 r582  
    2099820998  { echo "$as_me:$LINENO: Build is \"$build\"." >&5
    2099920999echo "$as_me: Build is \"$build\"." >&6;}
     21000  mydos2unix='| dos2unix'
    2100021001  case $build in
    2100121002    *-mingw*)
    2100221003      CYGPATH_W=echo
     21004      mydos2unix=
    2100321005      ;;
    2100421006  esac
     
    2102621028            -e 's%lib /OUT:%lib -OUT:%' \
    2102721029            -e "s%cygpath -w%$CYGPATH_W%" \
    21028             -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
     21030            -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo '"$mydos2unix"'\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
    2102921031            -e 's/$AR t/lib -nologo -list/' \
    2103021032            -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
  • branches/Couenne/Couenne/src/convex/operators/conv-exprPow.cpp

    r562 r582  
    88
    99#include <math.h>
     10#ifndef M_E
     11# define M_E             2.7182818284590452354
     12#endif
    1013
    1114#include <CouenneTypes.h>
  • branches/Couenne/Couenne/src/convex/operators/conv-exprSinCos.cpp

    r559 r582  
    88
    99#include <math.h>
     10#ifndef M_PI
     11# define M_PI 3.14159265358979323846
     12#endif
     13#ifndef M_PI_2
     14# define M_PI_2 1.57079632679489661923
     15#endif
    1016
    1117#include <OsiSolverInterface.hpp>
     
    8793                 expression *arg) { // argument of cos/sin (should be a variable)
    8894
    89   unary_function fn = (tt == COU_SINE) ? sin : cos;
     95  // AW 2007-06-11: The following doesn't compile with MSVC++ because
     96  // sin and cos are ambiguous
     97  //unary_function fn = (tt == COU_SINE) ? sin : cos;
    9098
    9199  // retrieve argument bounds
     
    118126  // left
    119127  if (lb > -COUENNE_INFINITY) { // if not unbounded
    120     ncuts += cg -> createCut (cs, fn (lb) - lb, -1, w_ind, 1., x_ind, -1.); // up:  w-x <= f lb - lb
    121     ncuts += cg -> createCut (cs, fn (lb) + lb, +1, w_ind, 1., x_ind,  1.); // dn:  w+x >= f lb + lb
     128    if (tt == COU_SINE) {
     129      ncuts += cg -> createCut (cs, sin (lb) - lb, -1, w_ind, 1., x_ind, -1.); // up:  w-x <= f lb - lb
     130      ncuts += cg -> createCut (cs, sin (lb) + lb, +1, w_ind, 1., x_ind,  1.); // dn:  w+x >= f lb + lb
     131    }
     132    else {
     133      ncuts += cg -> createCut (cs, cos (lb) - lb, -1, w_ind, 1., x_ind, -1.); // up:  w-x <= f lb - lb
     134      ncuts += cg -> createCut (cs, cos (lb) + lb, +1, w_ind, 1., x_ind,  1.); // dn:  w+x >= f lb + lb
     135    }
    122136  }
    123137
    124138  // right
    125139  if (ub <  COUENNE_INFINITY) { // if not unbounded
    126     ncuts += cg -> createCut (cs, fn (ub) - ub, +1, w_ind, 1., x_ind, -1.); // dn: w - x >= f ub - ub
    127     ncuts += cg -> createCut (cs, fn (ub) + ub, -1, w_ind, 1., x_ind,  1.); // up: w + x <= f ub + ub
     140    if (tt == COU_SINE) {
     141      ncuts += cg -> createCut (cs, sin (ub) - ub, +1, w_ind, 1., x_ind, -1.); // dn: w - x >= f ub - ub
     142      ncuts += cg -> createCut (cs, sin (ub) + ub, -1, w_ind, 1., x_ind,  1.); // up: w + x <= f ub + ub
     143    }
     144    else {
     145      ncuts += cg -> createCut (cs, cos (ub) - ub, +1, w_ind, 1., x_ind, -1.); // dn: w - x >= f ub - ub
     146      ncuts += cg -> createCut (cs, cos (ub) + ub, -1, w_ind, 1., x_ind,  1.); // up: w + x <= f ub + ub
     147    }
    128148  }
    129149
  • branches/Couenne/Couenne/src/expression/operators/exprBCos.h

    r548 r582  
    1212#include <exprOp.h>
    1313#include <math.h>
     14#ifndef M_PI
     15# define M_PI 3.14159265358979323846
     16#endif
    1417
    1518
  • branches/Couenne/Couenne/src/expression/operators/exprBSin.h

    r548 r582  
    1212#include <exprOp.h>
    1313#include <math.h>
    14 
     14#ifndef M_PI
     15# define M_PI 3.14159265358979323846
     16#endif
    1517
    1618//  class to compute lower bound of a sine based on the bounds on its
  • branches/Couenne/Couenne/src/expression/operators/exprQuad.cpp

    r545 r582  
    152152    else                            return nllin;
    153153  */
     154return 0;
    154155}
    155156
  • branches/Couenne/Couenne/src/readnl/invmap.c

    r389 r582  
    2727/* compare two AslCoupair's, used in qsort and bsearch below */
    2828
    29 inline int pair_compare (const void *p1, const void *p2) {
     29/* AW: 2007-06-11: changed b/c of problems with MSVC++ */
     30/* inline int pair_compare (const void *p1, const void *p2) { */
     31static int pair_compare (const void *p1, const void *p2) {
    3032
    3133  /* FIX THIS! weak cast for 64 bit machines */
Note: See TracChangeset for help on using the changeset viewer.