PGROUTING  2.6
pgr_tsp.hpp File Reference
#include <time.h>
#include <sstream>
#include <vector>
#include <set>
#include <string>
#include <utility>
#include <limits>
#include <cmath>
#include "cpp_common/pgr_assert.h"
#include "cpp_common/Dmatrix.h"
#include "tsp/eucledianDmatrix.h"
#include "tsp/tour.h"
Include dependency graph for pgr_tsp.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pgrouting::tsp::TSP< MATRIX >
 

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

Definition at line 68 of file pgr_tsp.hpp.

68  {
69  return i == 0? n - 1: i -1;
70 }
static size_t rand ( size_t  n)
static

Definition at line 53 of file pgr_tsp.hpp.

References pgassert.

53  {
54  pgassert(n > 0);
55  return static_cast< size_t >(std::rand() % n);
56 }
static size_t rand(size_t n)
Definition: pgr_tsp.hpp:53
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81
static size_t succ ( size_t  i,
size_t  n 
)
static

Definition at line 61 of file pgr_tsp.hpp.

References pgassert.

61  {
62  pgassert(n > 0);
63  return static_cast<size_t>((i + 1) % n);
64 }
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81