PGROUTING  2.6
pgr_tsp.cpp File Reference
#include "tsp/pgr_tsp.hpp"
#include <time.h>
#include <utility>
#include <iomanip>
#include <limits>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include "cpp_common/pgr_assert.h"
Include dependency graph for pgr_tsp.cpp:

Go to the source code of this file.

Namespaces

 pgrouting
 Book keeping class for swapping orders between vehicles.
 
 pgrouting::tsp
 

Functions

static size_t pred (size_t i, size_t n)
 
static size_t rand (size_t n)
 
static size_t succ (size_t i, size_t n)
 

Function Documentation

static size_t pred ( size_t  i,
size_t  n 
)
static
static size_t rand ( size_t  n)
static

Definition at line 49 of file pgr_tsp.cpp.

References pgassert.

Referenced by pgrouting::tsp::TSP< MATRIX >::annealing().

49  {
50  pgassert(n > 0);
51  return static_cast< size_t >(std::rand() % n);
52 }
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81
static size_t rand(size_t n)
Definition: pgr_tsp.cpp:49

Here is the caller graph for this function:

static size_t succ ( size_t  i,
size_t  n 
)
static

Definition at line 57 of file pgr_tsp.cpp.

References pgassert.

Referenced by pgrouting::tsp::TSP< MATRIX >::annealing(), pgrouting::tsp::TSP< MATRIX >::getDeltaReverse(), pgrouting::tsp::TSP< MATRIX >::getDeltaSlide(), and pgrouting::tsp::TSP< MATRIX >::getDeltaSwap().

57  {
58  pgassert(n > 0);
59  return static_cast<size_t>((i + 1) % n);
60 }
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81

Here is the caller graph for this function: