Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Annotation of /branches/MS-Windows/src/results.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1281 - (hide annotations) (download) (as text)
Sat Apr 27 07:37:29 2013 UTC (11 years, 10 months ago) by amb
Original Path: trunk/src/results.h
File MIME type: text/x-chdr
File size: 3959 byte(s)
Remove the FindResult1 function which allows hashing to be performed on a
combination of node and segment rather than just node.

1 amb 29 /***************************************
2     A header file for the results.
3 amb 151
4     Part of the Routino routing software.
5 amb 29 ******************/ /******************
6 amb 1280 This file Copyright 2008-2013 Andrew M. Bishop
7 amb 29
8 amb 151 This program is free software: you can redistribute it and/or modify
9     it under the terms of the GNU Affero General Public License as published by
10     the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12    
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     GNU Affero General Public License for more details.
17    
18     You should have received a copy of the GNU Affero General Public License
19     along with this program. If not, see <http://www.gnu.org/licenses/>.
20 amb 29 ***************************************/
21    
22    
23     #ifndef RESULTS_H
24     #define RESULTS_H /*+ To stop multiple inclusions. +*/
25    
26     #include <stdint.h>
27    
28 amb 116 #include "types.h"
29 amb 29
30    
31 amb 302 /* Constants */
32    
33     /*+ A result is not currently queued. +*/
34 amb 874 #define NOT_QUEUED (uint32_t)(0)
35 amb 302
36    
37 amb 29 /* Data structures */
38    
39 amb 605 typedef struct _Result Result;
40    
41 amb 113 /*+ The result for a node. +*/
42 amb 605 struct _Result
43 amb 29 {
44 amb 170 index_t node; /*+ The node for which this result applies. +*/
45 amb 605 index_t segment; /*+ The segmemt used to get to the node for which this result applies. +*/
46 amb 113
47 amb 605 Result *prev; /*+ The previous result following the best path to get to this node via the segment. +*/
48     Result *next; /*+ The next result following the best path from this node that was reached via the segment. +*/
49 amb 116
50 amb 236 score_t score; /*+ The best actual weighted distance or duration score from the start to the node. +*/
51 amb 605 score_t sortby; /*+ The best possible weighted distance or duration score from the start to the finish. +*/
52 amb 116
53 amb 236 uint32_t queued; /*+ The position of this result in the queue. +*/
54 amb 605 };
55 amb 29
56     /*+ A list of results. +*/
57     typedef struct _Results
58     {
59 amb 165 uint32_t nbins; /*+ The number of bins. +*/
60     uint32_t mask; /*+ A bit mask to select the bottom 'nbins' bits. +*/
61 amb 71
62 amb 165 uint32_t number; /*+ The total number of occupied results. +*/
63 amb 71
64 amb 863 uint8_t *count; /*+ An array of nbins counters of results in each array. +*/
65 amb 79 Result ***point; /*+ An array of nbins arrays of pointers to actual results. +*/
66 amb 71
67 amb 854 uint32_t ndata1; /*+ The size of the first dimension of the 'data' array. +*/
68     uint32_t ndata2; /*+ The size of the second dimension of the 'data' array. +*/
69    
70     Result **data; /*+ An array of arrays containing the actual results, the first
71     dimension is reallocated but the second dimension is not.
72 amb 79 Most importantly pointers into the real data don't change
73 amb 113 as more space is allocated (since realloc is not being used). +*/
74 amb 165
75 amb 605 index_t start_node; /*+ The start node. +*/
76     index_t prev_segment; /*+ The previous segment to get to the start node (if any). +*/
77    
78     index_t finish_node; /*+ The finish node. +*/
79     index_t last_segment; /*+ The last segment (to arrive at the finish node). +*/
80 amb 29 }
81     Results;
82    
83    
84 amb 680 /* Forward definition for opaque type */
85 amb 236
86     typedef struct _Queue Queue;
87    
88    
89 amb 680 /* Results functions in results.c */
90 amb 29
91 amb 71 Results *NewResultsList(int nbins);
92 amb 29 void FreeResultsList(Results *results);
93    
94 amb 605 Result *InsertResult(Results *results,index_t node,index_t segment);
95 amb 29
96 amb 605 Result *FindResult(Results *results,index_t node,index_t segment);
97 amb 29
98 amb 79 Result *FirstResult(Results *results);
99     Result *NextResult(Results *results,Result *result);
100 amb 29
101 amb 234
102 amb 680 /* Queue functions in queue.c */
103 amb 67
104 amb 236 Queue *NewQueueList(void);
105     void FreeQueueList(Queue *queue);
106 amb 67
107 amb 236 void InsertInQueue(Queue *queue,Result *result);
108     Result *PopFromQueue(Queue *queue);
109 amb 67
110 amb 236
111 amb 29 #endif /* RESULTS_H */

Properties

Name Value
cvs:description Results data type.