src
tsp
MyThread.cpp
Go to the documentation of this file.
1
//==================================================================
2
// File : mythread.h
3
// Author : rsagalyn
4
// Date : Aug 25, 2013
5
// Description : Subclass of threads.h, implements run()
6
//==================================================================
7
8
#include "
MyThread.h
"
9
10
void
MyThread::run
()
11
{
12
int
result =
mytsp
->
find_best_path
(
start_node
);
13
14
mytsp
->
path_vals
[
my_id
][0] =
start_node
;
15
mytsp
->
path_vals
[
my_id
][1] = result;
16
17
if
(
DEBUG
) cout <<
"thread "
<< setw(4) << left <<
my_id
<< setw(8) << left
18
<<
" result: "
<< setw(5) << left << result << endl;
19
20
pthread_exit(NULL);
21
}
TSP::find_best_path
int find_best_path(int)
Definition:
tsp.cpp:630
DEBUG
#define DEBUG
Definition:
tsp.h:41
Thread::my_id
int my_id
Definition:
threads.h:67
MyThread.h
Thread::mytsp
TSP * mytsp
Definition:
threads.h:64
Thread::start_node
int start_node
Definition:
threads.h:61
MyThread::run
virtual void run()
Definition:
MyThread.cpp:10
TSP::path_vals
double ** path_vals
Definition:
tsp.h:119
co_scan
Author(s):
autogenerated on Mon Feb 28 2022 23:00:45