Changeset 183 for stable/0.2/Couenne


Ignore:
Timestamp:
Jul 1, 2009 9:41:30 AM (12 years ago)
Author:
pbelotti
Message:

merged trunk changeset 182

Location:
stable/0.2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable/0.2

    • Property svn:mergeinfo changed
      /trunk (added)merged: 182
  • stable/0.2/Couenne/src/expression/operators/exprCos.cpp

    r159 r183  
    1 /* $Id: exprCos.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    2 /*
     1/* $Id$
     2 *
    33 * Name:    exprCos.cpp
    44 * Author:  Pietro Belotti
    55 * Purpose: methods for cosines
    66 *
    7  * (C) Carnegie-Mellon University, 2006-08.
     7 * (C) Carnegie-Mellon University, 2006-09.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
     
    4343}
    4444
    45 
    4645// compute value of bounds of cos x given bounds of x
    4746void exprCos::getBounds (CouNumber &lb, CouNumber &ub) {
    4847
    49   CouNumber l, u,  pi2 = 2 * M_PI;
     48  CouNumber l, u;
    5049  argument_ -> getBounds (l, u);
    5150
  • stable/0.2/Couenne/src/expression/operators/exprSin.cpp

    r159 r183  
    1 /* $Id: exprSin.cpp 154 2009-06-16 18:52:53Z pbelotti $ */
    2 /*
     1/* $Id$
     2 *
    33 * Name:    exprSin.cpp
    44 * Author:  Pietro Belotti
    55 * Purpose: definition of the sine of a function
    66 *
    7  * (C) Carnegie-Mellon University, 2006-08.
     7 * (C) Carnegie-Mellon University, 2006-09.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
     
    4242}
    4343
    44 
    4544// compute value of bounds of cos x given bounds of x
    4645void exprSin::getBounds (CouNumber &lb, CouNumber &ub) {
    4746
    4847  CouNumber l, u;
    49 
    5048  argument_ -> getBounds (l, u);
    51 
    52   CouNumber pi2 = 2 * M_PI;
    5349
    5450  if ((u - l > pi2) ||        // 1) interval spans whole cycle
     
    5652       floor (u/pi2 - 0.75)))
    5753    lb = -1.;
    58   else lb = CoinMin (cos (l), cos (u));
     54  else lb = CoinMin (sin (l), sin (u));
    5955
    6056  if ((u - l > pi2) ||        // 1) interval spans whole cycle
     
    6258       floor (u/pi2 - 0.25)))
    6359    ub = 1.;
    64   else ub = CoinMax (cos (l), cos (u));
     60  else ub = CoinMax (sin (l), sin (u));
    6561}
    6662
Note: See TracChangeset for help on using the changeset viewer.