Changeset 498


Ignore:
Timestamp:
Apr 25, 2007 12:58:42 AM (13 years ago)
Author:
pbelotti
Message:

fixed serious bug with x(2k+1)

Location:
branches/Couenne/Couenne/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/Couenne/Couenne/src/branch/CouenneObject.cpp

    r497 r498  
    7878
    7979  /// avoid branching on (relatively) small deltas
    80   if ((delta < COUENNE_EPS)
    81     ||
     80  if (delta < COUENNE_EPS)
     81    /*||
    8282      (fabs (u-l) < COUENNE_EPS) ||
    8383      ((mymin (fabs (l), fabs (u)) > COUENNE_EPS) &&
    84       (fabs (u-l) / mymax (fabs (l), fabs (u)) < COUENNE_EPS)))
     84      (fabs (u-l) / mymax (fabs (l), fabs (u)) < COUENNE_EPS)))*/
    8585    //      ((mymin (fabs (lr), fabs (ur)) > COUENNE_EPS) &&
    8686    //       (fabs (ur-lr) / mymax (fabs (lr), fabs (ur)) < COUENNE_EPS)))
  • branches/Couenne/Couenne/src/expression/exprAux.cpp

    r497 r498  
    9292                ub = (*ube) ();
    9393
    94       lb = 1e-10;
    95       ub = 7;
    96 
    9794      delete lbe;
    9895      delete ube;
  • branches/Couenne/Couenne/src/expression/operators/exprPow.cpp

    r480 r498  
    1818
    1919
    20 // simplify power f(x) ^ g(x)
     20/// simplify power f(x) ^ g(x)
    2121
    2222expression *exprPow::simplify () {
     
    5959
    6060
    61 // differentiate power of expressions
     61/// differentiate power of expressions
    6262
    6363expression *exprPow::differentiate (int index) {
     
    9898
    9999
    100 // output
     100/// output
    101101
    102102void exprPow::print (std::ostream& out) const
     
    104104
    105105
    106 // get a measure of "how linear" the expression is:
    107 //
    108 // ZERO      = 0: a zero
    109 // CONSTANT  = 1: a constant
    110 // LINEAR    = 2: linear
    111 // QUADRATIC = 3: quadratic
    112 // NONLINER  = 4: nonlinear non-quadratic
     106/// get a measure of "how linear" the expression is:
     107///
     108/// ZERO      = 0: a zero
     109/// CONSTANT  = 1: a constant
     110/// LINEAR    = 2: linear
     111/// QUADRATIC = 3: quadratic
     112/// NONLINER  = 4: nonlinear non-quadratic
    113113
    114114int exprPow::Linearity () {
  • branches/Couenne/Couenne/src/include/rootQ.h

    r193 r498  
    4444    CouNumber root;
    4545
     46    k /= 2; // becomes true index
     47
    4648    if ((pos = Qmap.find (k)) == Qmap.end()) {
    4749
  • branches/Couenne/Couenne/src/util/rootQ.c

    r292 r498  
    4646  else {
    4747
    48     register CouNumber l = - 1.0 + 0.5 / k,
    49                     u = - 0.5,
    50                     Ql = Q (k, l), Qu = Q (k, u), Qm,
    51                     midpoint;
     48    register CouNumber l  = - 1.0 + 0.5 / k,
     49                       u = - 0.5,
     50                       Ql = Q (k, l), Qu = Q (k, u), Qm,
     51                       midpoint;
    5252    do {
    5353
    54       midpoint = 0.5 * (l+u);/* (- Ql * u + Qu * l) / (Qu - Ql); */
     54      midpoint = 0.5 * (l+u); /* (- Ql * u + Qu * l) / (Qu - Ql); */
    5555      Qm = Q (k, midpoint);
    5656
     
    7272  CouNumber x, q;
    7373
    74   for (k=30; --k;) {
     74  for (k=6; --k;) {
    7575
    7676    printf ("root, %3d -> %.15f\n", 2*k+1, rootQ (k));
Note: See TracChangeset for help on using the changeset viewer.