dReal4
Box Class Reference

Represents a n-dimensional interval vector. More...

#include </home/soonhokong/work/dreal4/dreal/util/box.h>

Public Types

using Interval = ibex::Interval
 
using IntervalVector = ibex::IntervalVector
 

Public Member Functions

 Box ()
 Constructs a zero-dimensional box.
 
 Box (const std::vector< Variable > &variables)
 Constructs a box from variables.
 
 Box (const Box &)=default
 Default copy constructor.
 
 Box (Box &&)=default
 Default move constructor.
 
Boxoperator= (const Box &)=default
 Default copy assign operator.
 
Boxoperator= (Box &&)=default
 Default move assign operator.
 
 ~Box ()=default
 Default destructor.
 
void Add (const Variable &v)
 Adds v to the box.
 
void Add (const Variable &v, double lb, double ub)
 Adds v to the box and sets its domain using lb and ub.
 
bool empty () const
 Checks if this box is empty.
 
void set_empty ()
 Make this box empty.
 
int size () const
 Returns the size of the box.
 
Interval & operator[] (int i)
 Returns i -th interval in the box.
 
Interval & operator[] (const Variable &var)
 Returns an interval associated with var.
 
const Interval & operator[] (int i) const
 Returns i -th interval in the box.
 
const Interval & operator[] (const Variable &var) const
 Returns an interval associated with var.
 
const std::vector< Variable > & variables () const
 Returns the variables in the box.
 
const Variablevariable (int i) const
 Returns i-th variable in the box.
 
bool has_variable (const Variable &var) const
 Checks if this box has var.
 
const IntervalVector & interval_vector () const
 Returns the interval vector of the box.
 
IntervalVector & mutable_interval_vector ()
 Returns the interval vector of the box.
 
int index (const Variable &var) const
 Returns the index associated with var.
 
std::pair< double, int > MaxDiam () const
 Returns the max diameter of the box and the associated index .
 
std::pair< Box, Boxbisect (int i) const
 Bisects the box at i -th dimension. More...
 
std::pair< Box, Boxbisect (const Variable &var) const
 Bisects the box at the dimension represented by var. More...
 
BoxInplaceUnion (const Box &b)
 Updates the current box by taking union with b. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Box &box)
 

Detailed Description

Represents a n-dimensional interval vector.

This is a wrapper of ibex::IntervalVector.

Member Function Documentation

◆ bisect() [1/2]

pair< Box, Box > bisect ( int  i) const

Bisects the box at i -th dimension.

Exceptions
std::runtimeif i -th dimension is not bisectable.

◆ bisect() [2/2]

pair< Box, Box > bisect ( const Variable var) const

Bisects the box at the dimension represented by var.

Exceptions
std::runtimeif i -th dimension is not bisectable.

◆ InplaceUnion()

Box & InplaceUnion ( const Box b)

Updates the current box by taking union with b.

Precondition
variables() == b.variables().

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