Changeset 79


Ignore:
Timestamp:
Mar 24, 2009 2:49:44 PM (11 years ago)
Author:
pbelotti
Message:

name fixing. Trying to fix a crippling cast conversion for function pointer comparison (dangerous...)

Location:
trunk/Couenne/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/bound_tightening/operators/impliedBounds-exprMul.cpp

    r1 r79  
    6868    // these bounds would be implied by McCormick's convexification,
    6969    // however we write them explicitly for internal use within bound
    70     // tightening, as otherwise they would only be known by Clp only.
     70    // tightening, as otherwise they would be known to Clp only.
    7171
    7272    int xi = arglist_ [0] -> Index (),
  • trunk/Couenne/src/expression/operators/exprOpp.cpp

    r75 r79  
    44 * Purpose: definition of the opposite -f(x) of a function
    55 *
    6  * (C) Carnegie-Mellon University, 2006.
     6 * (C) Carnegie-Mellon University, 2006-09.
    77 * This file is licensed under the Common Public License (CPL)
    88 */
  • trunk/Couenne/src/main/BonCouenne.cpp

    r55 r79  
    2121#include "CoinTime.hpp"
    2222#include "CoinError.hpp"
    23 #include "BonminConfig.h"
    2423#include "BonCouenneInterface.hpp"
    25 #include "BonIpoptSolver.hpp"
    2624
    2725#include "BonCouenneSetup.hpp"
     
    8684#endif
    8785
    88     CouenneSetup bonmin;
    89     if (!bonmin.InitializeCouenne (argv, p, ci))
     86    CouenneSetup couenne;
     87    if (!couenne.InitializeCouenne (argv, p, ci))
    9088      throw infeasible;
    9189
     
    9795    /// update time limit (read/preprocessing might have taken some)
    9896    double timeLimit = 0;
    99     bonmin.options () -> GetNumericValue ("time_limit", timeLimit, "bonmin.");
    100     bonmin.setDoubleParameter (BabSetupBase::MaxTime,
     97    couenne.options () -> GetNumericValue ("time_limit", timeLimit, "couenne.");
     98    couenne.setDoubleParameter (BabSetupBase::MaxTime,
    10199                               timeLimit - (time_start = (CoinCpuTime () - time_start)));
    102100
    103101    //////////////////////////////////
    104102
    105     bb (bonmin); // do branch and bound
     103    bb (couenne); // do branch and bound
    106104
    107105    //////////////////////////////////
     
    127125    // retrieve test value to check
    128126    double global_opt;
    129     bonmin.options () -> GetNumericValue ("couenne_check", global_opt, "couenne.");
     127    couenne.options () -> GetNumericValue ("couenne_check", global_opt, "couenne.");
    130128
    131129    if (global_opt < COUENNE_INFINITY) { // some value found in couenne.opt
     
    137135              (fabs (opt - global_opt) /
    138136               (1. + CoinMax (fabs (opt), fabs (global_opt))) < PRINTED_PRECISION) ?
    139               (char *) "OK" : (char *) "FAILED");
     137              (const char *) "OK" : (const char *) "FAILED");
    140138              //opt, global_opt,
    141139              //fabs (opt - global_opt));
     
    143141    } else // good old statistics
    144142
    145     if (bonmin.displayStats ()) { // print statistics
     143    if (couenne.displayStats ()) { // print statistics
    146144
    147145      // CAUTION: assuming first cut generator is our CouenneCutGenerator
  • trunk/Couenne/src/problem/problem.cpp

    r78 r79  
    151151      }
    152152
    153       if (var -> Type () == AUX)
     153      if (var -> Type () == AUX) {
    154154        X (index) =  // addresses of x[] and X() are equal
    155155          CoinMax (l, CoinMin (u, (*(var -> Image ())) ()));
    156156
     157      }
    157158    } else X (index) = 0.;
    158159  }
  • trunk/Couenne/src/readnl/invmap.cpp

    r1 r79  
    1515#include "nlp.h"
    1616#include "r_opn.hd"
     17
     18#if defined(_MSC_VER)
     19typedef void * fcn_ptr;
     20#else
     21typedef long int fcn_ptr;
     22#endif
    1723
    1824
     
    3339  /* FIX! weak cast for 64 bit machines */
    3440
    35   register long int f1 = (long int) (((AslCouPair *) p1) -> fp);
    36   register long int f2 = (long int) (((AslCouPair *) p2) -> fp);
     41  register fcn_ptr f1 = (fcn_ptr) (((AslCouPair *) p1) -> fp);
     42  register fcn_ptr f2 = (fcn_ptr) (((AslCouPair *) p2) -> fp);
    3743
    3844  if      (f1 < f2) return -1;
     
    5662  /* FIX cast fo 64 bit machines */
    5763
    58   if (((long int) f <  N_OPS) &&
    59       ((long int) f > -N_OPS))
    60     return (long int) f;
     64  if (((fcn_ptr) f <  N_OPS) &&
     65      ((fcn_ptr) f > -N_OPS))
     66    return (fcn_ptr) f;
    6167
    6268  key.fp = f;
  • trunk/Couenne/src/readnl/nl2e.cpp

    r64 r79  
    44 * Purpose: converts a nl expression into a Couenne expression
    55 *
    6  * (C) Carnegie-Mellon University, 2006.
     6 * (C) Carnegie-Mellon University, 2006-09.
    77 * This file is licensed under the Common Public License (CPL)
    88 */
     
    138138
    139139  default:
    140     printf ("ERROR: unknown operator (address %x), aborting.\n", (long int) e -> op);
     140    printf ("ERROR: unknown operator (address %p), aborting.\n", e -> op);
    141141    exit (-1);
    142142    //return new exprConst (0);
  • trunk/Couenne/src/readnl/readnl.cpp

    r78 r79  
    2222#include "opcode.hd"
    2323
     24#if defined(_MSC_VER)
     25typedef void * fcn_ptr;
     26#else
     27typedef long int fcn_ptr;
     28#endif
     29
    2430#define OBJ_DE    ((const ASL_fg *) asl) -> I.obj_de_
    2531#define VAR_E     ((const ASL_fg *) asl) -> I.var_e_
     
    3137// check if an expression is a null pointer or equals zero
    3238inline bool is_expr_zero (expr* e)
    33   {return ((e==NULL) || (((((long int) e->op) == OPNUM) &&
     39  {return ((e==NULL) || (((((fcn_ptr) e->op) == OPNUM) &&
    3440                          (fabs (((expr_n *)e) -> v)  < COUENNE_EPS)
    3541                          //  && (fabs (e -> dL) < COUENNE_EPS)
Note: See TracChangeset for help on using the changeset viewer.