MC++
mc::McCormick< T > Class Template Reference

C++ class for McCormick relaxation arithmetic for factorable function. More...

#include <mccormick.hpp>

Collaboration diagram for mc::McCormick< T >:

Classes

class  Exceptions
 Exceptions of mc::McCormick. More...
 
struct  Options
 Options of mc::McCormick. More...
 

Public Member Functions

 McCormick ()
 Default constructor (needed to declare arrays of McCormick class)
 
 McCormick (const double c)
 Constructor for a constant value c
 
 McCormick (const T &I)
 Constructor for an interval I.
 
 McCormick (const T &I, const double c)
 Constructor for a variable, whose range is I and value is c
 
 McCormick (const T &I, const double cv, const double cc)
 Constructor for a variable, whose range is I and convex and concave bounds are cv and cc
 
 McCormick (const McCormick< T > &MC)
 Copy constructor.
 
template<typename U >
 McCormick (const McCormick< U > &MC)
 Copy constructor doing type conversion for underlying interval.
 
 ~McCormick ()
 Destructor.
 
unsigned int & nsub ()
 Number of subgradient components/directions.
 
T & I ()
 Interval bounds.
 
double l () const
 Lower bound.
 
double u () const
 Upper bound.
 
double & cv ()
 Convex bound.
 
double & cc ()
 Concave bound.
 
double *& cvsub ()
 Pointer to a subgradient of convex underestimator.
 
double *& ccsub ()
 Pointer to a subgradient of concave overestimator.
 
double & cvsub (const unsigned int i)
 ith component of a subgradient of convex underestimator
 
double & ccsub (const unsigned int i)
 ith component of a subgradient of concave overestimator
 
void I (const T &I)
 Set interval bounds.
 
void cv (const double &cv)
 Set convex bound to cv
 
void cc (const double &cc)
 Set concave bound to cc
 
void c (const double &c)
 Set both convex and concave bounds to c
 
McCormick< T > & sub (const unsigned int nsub)
 Set dimension of subgradient to nsub
 
McCormick< T > & sub (const unsigned int nsub, const unsigned int isub)
 Set dimension of subgradient to nsub and variable index isub (starts at 0)
 
McCormick< T > & sub (const unsigned int nsub, const double *cvsub, const double *ccsub)
 Set dimension of subgradient to nsub and subgradient values for the convex and concave relaxations to cvsub and ccsub
 
McCormick< T > & cut ()
 Cut convex/concave relaxations at interval bound.
 
double laff (const double *p, const double *pref) const
 Compute affine underestimator at p based on a subgradient value of the convex underestimator at pref
 
double laff (const T *Ip, const double *pref) const
 Compute lower bound on range Ip based on an affine underestimator of the convex underestimator at pref
 
double uaff (const double *p, const double *pref) const
 Compute affine overestimator at p based on a subgradient value of the concave overestimator at pref
 
double uaff (const T *Ip, const double *pref) const
 Compute upper bound on range Ip based on an affine overestimator of the concave overestimator at pref
 

Detailed Description

template<typename T>
class mc::McCormick< T >

mc::McCormick is a C++ class computing the McCormick convex/concave relaxations of factorable functions on a box, as well as doing subgradient propagation. The template parameter corresponds to the type used in the underlying interval arithmetic computations.


The documentation for this class was generated from the following file: