Ignore:
Timestamp:
Feb 5, 2007 1:33:17 PM (13 years ago)
Author:
pbelotti
Message:

no more duplicated auxiliary variables, for smaller and tighter convexification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Couenne/Couenne/src/util/rootQ.c

    r238 r292  
    1313#include <stdio.h>
    1414
    15 /*
    16 inline int round (double x) {
    17   return (int) (ceil (x - 0.5));
    18 }
    19 */
    2015
    2116/* compute Q(x)*/
    2217
    23 CouNumber Q (int k, CouNumber x) {
     18CouNumber Q (register int k, CouNumber x) {
    2419
    25   register CouNumber xp;
     20  register CouNumber xp, Q;
    2621  register int i;
    27   register CouNumber Q;
    2822
    2923  k *= 2;
     
    6357      /*      printf ("[%.4f, %.4f] --> %.4f: %.24f\n", l, u, midpoint, Qm); */
    6458
    65       if (Qm<0) {l = midpoint; Ql = Qm;}
     59      if (Qm<0) {l = midpoint; Ql = Qm; Qm = - Qm;}
    6660      else      {u = midpoint; Qu = Qm;}
    6761
    68     } while (fabs (Qm) > 1e-15);
     62    } while (Qm > 1e-15);
    6963
    7064    return midpoint;
Note: See TracChangeset for help on using the changeset viewer.