Ignore:
Timestamp:
Apr 28, 2007 2:10:25 AM (13 years ago)
Author:
pbelotti
Message:

introducing better bounds for sin/cos. Tool for drawing cuts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Couenne/Couenne/src/util/drawCuts.cpp

    r515 r521  
    2222                   minY =  COUENNE_INFINITY;
    2323
    24   if (1 || (img -> code () == COU_EXPRSIN) ||
     24  if ((img -> code () == COU_EXPRSIN) ||
    2525      (img -> code () == COU_EXPRPOW) ||
    2626      (img -> code () == COU_EXPREXP) ||
     
    2828      (img -> code () == COU_EXPRCOS)) {
    2929
    30     printf (" ==> "); w -> print (std::cout); printf ("\n");
     30    //    fprintf (stderr, " ==> "); w -> print (std::cerr); fprintf (stderr, "\n");
    3131
    3232    expression *lbe, *ube;
     
    3838
    3939    int xi = indep -> Index ();
    40     printf ("looking into w_%d = f (x_%d)\n", w -> Index (), xi);
     40
     41    //    fprintf (stderr, "looking into w_%d = f (x_%d)\n",
     42    //       w -> Index (), xi);
    4143
    4244    indep -> getBounds (lbe, ube);
     
    7173          if (y < minY) minY = y;
    7274
    73           printf ("#=# %.12e %.12e\n", x, y);
     75          fprintf (stderr, "%.12e %.12e\n", x, y);
    7476        }
     77
     78        maxY += (maxY-minY) / 20;
     79        minY -= (maxY-minY) / 20;
    7580      }
    7681       
    77       //lb -= 1;
    78       //ub += 1;
     82      lb -= (ub-lb) / 20;
     83      ub += (ub-lb) / 20;
    7984
    8085      // plot lines defining constraint (only for cuts involving at
     
    9398        }
    9499
    95         printf ("#=# #m=2,S=%d\n", (cs.rowCutPtr (jj) -> sense () == 'L') ? 10:11);
     100        fprintf (stderr, "#m=2,S=%d\n", (cs.rowCutPtr (jj) -> sense () == 'L') ? 10:11);
    96101
    97         printf ("#=# %.12e %.12e\n", lb0, (rhs - el [1] * lb0) / el [0]);
    98         printf ("#=# %.12e %.12e\n", ub0, (rhs - el [1] * ub0) / el [0]);
     102        fprintf (stderr, "%.12e %.12e\n", lb0, (rhs - el [1] * lb0) / el [0]);
     103        fprintf (stderr, "%.12e %.12e\n", ub0, (rhs - el [1] * ub0) / el [0]);
    99104      }
    100105
    101106      cg -> Problem () -> X () [xi] = curx;
     107      exit(0);
    102108    }
    103109  }
Note: See TracChangeset for help on using the changeset viewer.