Logo ROOT   6.08/07
Reference Guide
Macros | Typedefs | Functions | Variables
simanTSP.cxx File Reference
#include <cmath>
#include <vector>
#include <algorithm>
#include "Math/GSLSimAnnealing.h"
#include "Math/GSLRndmEngines.h"
#include "Math/SMatrix.h"
#include "Math/Math.h"
#include "TH1.h"
#include "TGraph.h"
#include "TCanvas.h"
#include "TApplication.h"
Include dependency graph for simanTSP.cxx:

Macros

#define N_CITIES   (sizeof(cities)/sizeof(Stsp_city))
 

Typedefs

typedef struct s_tsp_city Stsp_city
 

Functions

double city_distance (Stsp_city c1, Stsp_city c2)
 
void do_all_perms (MySimAnFunc &f, int offset)
 
void FullSearch ()
 
int main (int argc, char **argv)
 
void print_distance_matrix ()
 
void simanTSP (bool debug=true)
 

Variables

double best_E
 
Stsp_city cities []
 
double distance_matrix [N_CITIES][N_CITIES]
 
unsigned int nfiter = 0
 
unsigned int r1 [N_CITIES]
 
unsigned int r2 [N_CITIES]
 
unsigned int r3 [N_CITIES]
 
double second_E
 
bool showGraphics = false
 
double third_E
 

Macro Definition Documentation

◆ N_CITIES

#define N_CITIES   (sizeof(cities)/sizeof(Stsp_city))

Definition at line 53 of file simanTSP.cxx.

Typedef Documentation

◆ Stsp_city

typedef struct s_tsp_city Stsp_city

Definition at line 38 of file simanTSP.cxx.

Function Documentation

◆ city_distance()

double city_distance ( Stsp_city  c1,
Stsp_city  c2 
)

Definition at line 58 of file simanTSP.cxx.

◆ do_all_perms()

void do_all_perms ( MySimAnFunc &  f,
int  offset 
)

Definition at line 329 of file simanTSP.cxx.

◆ FullSearch()

void FullSearch ( )

Definition at line 406 of file simanTSP.cxx.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 448 of file simanTSP.cxx.

◆ print_distance_matrix()

void print_distance_matrix ( )

Definition at line 85 of file simanTSP.cxx.

◆ simanTSP()

void simanTSP ( bool  debug = true)

Definition at line 244 of file simanTSP.cxx.

Variable Documentation

◆ best_E

double best_E

Definition at line 325 of file simanTSP.cxx.

◆ cities

Stsp_city cities[]
Initial value:
= {{"Santa Fe", 35.68, 105.95},
{"Phoenix", 33.54, 112.07},
{"Albuquerque", 35.12, 106.62},
{"Clovis", 34.41, 103.20},
{"Durango", 37.29, 107.87},
{"Dallas", 32.79, 96.77},
{"Tesuque", 35.77, 105.92},
{"Grants", 35.15, 107.84},
{"Los Alamos", 35.89, 106.28},
{"Las Cruces", 32.34, 106.76},
{"Cortez", 37.35, 108.58},
{"Gallup", 35.52, 108.74}}

Definition at line 40 of file simanTSP.cxx.

◆ distance_matrix

double distance_matrix[N_CITIES][N_CITIES]

Definition at line 55 of file simanTSP.cxx.

◆ nfiter

unsigned int nfiter = 0

Definition at line 324 of file simanTSP.cxx.

◆ r1

unsigned int r1[N_CITIES]

Definition at line 321 of file simanTSP.cxx.

◆ r2

unsigned int r2[N_CITIES]

Definition at line 322 of file simanTSP.cxx.

◆ r3

unsigned int r3[N_CITIES]

Definition at line 323 of file simanTSP.cxx.

◆ second_E

double second_E

Definition at line 325 of file simanTSP.cxx.

◆ showGraphics

bool showGraphics = false

Definition at line 27 of file simanTSP.cxx.

◆ third_E

double third_E

Definition at line 325 of file simanTSP.cxx.