Camargue
Classes | Namespaces | Typedefs | Functions | Variables
util.hpp File Reference

Utility functions, macros, and structures. More...

#include <algorithm>
#include <array>
#include <iostream>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <cmath>
Include dependency graph for util.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CMR::OutPrefs
 Preferences related to tour file output and verbosity. More...
 
struct  CMR::util::C_resource_deleter< T >
 Class template for deleting resources allocated by C functions. More...
 
class  CMR::util::SquareUT< T >
 Class template for a square upper triangular matrix. More...
 
struct  CMR::Segment
 Simple utility struct for storing an interval of nodes. More...
 
struct  CMR::EndPts
 Simple base class for storing edge of a graph as a sorted pair of nodes. More...
 

Namespaces

 CMR
 The namespace for this project.
 
 CMR::Epsilon
 Numerical tolerances.
 
 CMR::util
 Utility functions/structures used miscellaneous places in the project.
 

Typedefs

template<typename numtype >
using CMR::util::c_array_ptr = std::unique_ptr< numtype, C_resource_deleter< numtype >>
 Alias declaration for unique_ptr to C array. More...
 

Functions

bool CMR::util::var_integral (double d)
 Is a zero-one variable considered integral.
 
double CMR::util::zeit (void)
 CPU time function.
 
double CMR::util::real_zeit (void)
 Wall clock time function.
 
template<typename T , typename... Args>
std::unique_ptr< T > CMR::util::make_unique (Args &&...args)
 As per Herb Sutter, port of C++14's make_unique faculty.
 
template<typename T , typename... Args>
void CMR::util::ptr_reset (std::unique_ptr< T > &target, Args &&...args)
 Adaptation of make_unique to reset a unique_ptr to an object. More...
 
template<typename ElemType , typename PredType >
void CMR::util::erase_remove (std::vector< ElemType > &vec, PredType pred)
 Standardization of erase-remove idiom. More...
 
bool CMR::operator== (EndPts e1, EndPts e2)
 
std::ostream & CMR::operator<< (std::ostream &os, const EndPts &e)
 

Variables

constexpr double CMR::Epsilon::Zero = 0.000001
 Numbers less than this treated as zero.
 
constexpr double CMR::Epsilon::MinCut = 0.0001
 Tolerance for min cut computations.
 
constexpr double CMR::Epsilon::CutViol = 0.001
 Cuts are not considered violated unless by at least this much.
 
constexpr double CMR::Epsilon::DualDust = 0.001
 Small dual values.
 
constexpr double CMR::Epsilon::TotalDelta = 0.01
 A round of cuts is a failure if the pivot deltas sum to less than this.
 
constexpr double CMR::Epsilon::PHratio = 0.1
 A small value of the Padberg-Hong metric.
 

Detailed Description

Utility functions, macros, and structures.