|
Camargue
|
Storing TSP instance data. More...
#include <datagroups.hpp>

Public Member Functions | |
| Instance () noexcept | |
| Default construct an empty instance. | |
| Instance (const std::string &fname, int seed) | |
| Construct an Instance from a TSPLIB file with a random seed. | |
| Instance (int seed, int ncount, int gridsize) | |
| Construct a geometric random Instance. More... | |
| Instance (const std::string &probname, int seed, int ncount, std::vector< int > &elist, std::vector< int > &elen, int default_len) | |
| Construct a sparse Instance with fixed edge set. | |
| Instance (const std::string &probname, int seed, int ncount, std::vector< int > &elist, std::vector< int > &elen) | |
| Instance (Instance &&I) noexcept | |
| Instance & | operator= (Instance &&I) noexcept |
| CCdatagroup * | ptr () const |
| Access the raw pointer to the data, for use by Concorde routines. | |
| double | edgelen (int end0, int end1) const |
| Edge length between two nodes in an Instance. | |
| const std::function< double(int, int)> | edgelen_func () const |
| A function object for the edge length. | |
| int | node_count () const |
| Number of nodes. | |
| int | seed () const |
| Random seed used. | |
| double | tour_length (const std::vector< int > &tour_nodes) const |
Get the length of the tour in tour_nodes. | |
| const std::string & | problem_name () const |
| The TSPLIB instance name or the random problem dimensions. | |
Private Attributes | |
| CCdatagroup | dat |
| The Concorde data structure being managed. | |
| int | nodecount |
| int | random_seed |
| std::string | pname |
Storing TSP instance data.
This is a handle to CCdatagroup, providing unique ownership.
| CMR::Data::Instance::Instance | ( | int | seed, |
| int | ncount, | ||
| int | gridsize | ||
| ) |
Construct a geometric random Instance.
| [in] | seed | the random seed used to generate the problem, and for all other later random computations. |
| [in] | ncount | the number of nodes in the problem |
| [in] | gridsize | the nodes will be generated from a square grid with this side length. |
1.8.11