source: tspsg/docs/html/globals_8h_source.html @ e2abfd326f

0.1.3.145-beta1-symbian0.1.4.170-beta2-bb10appveyorimgbotreadme
Last change on this file since e2abfd326f was f19df0a3e5, checked in by Oleksii Serdiuk, 15 years ago

+ Added precompiled header (PCH) file: should decrease project build time.

  • Improved installation and deployment rules in .pro file.
  • Improved translucency effect under Windows Vista/7.
  • Slightly modified qtwin.h to be included into the source documentation.
  • Regenerated source documentation.
  • Property mode set to 100644
File size: 12.7 KB
Line 
1<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4<head>
5<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6<title>TSPSG: TSP Solver and Generator: src/globals.h Source File</title>
7<link href="tabs.css" rel="stylesheet" type="text/css"/>
8<link href="search/search.css" rel="stylesheet" type="text/css"/>
9<script type="text/javaScript" src="search/search.js"></script>
10<link href="doxygen.css" rel="stylesheet" type="text/css"/>
11</head>
12<body onload='searchBox.OnSelectItem(0);'>
13<!-- Generated by Doxygen 1.6.1 -->
14<script type="text/javascript"><!--
15var searchBox = new SearchBox("searchBox", "search",false,'Search');
16--></script>
17<script type="text/javascript">
18<!--
19function changeDisplayState (e){
20  var num=this.id.replace(/[^[0-9]/g,'');
21  var button=this.firstChild;
22  var sectionDiv=document.getElementById('dynsection'+num);
23  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
24    sectionDiv.style.display='block';
25    button.src='open.gif';
26  }else{
27    sectionDiv.style.display='none';
28    button.src='closed.gif';
29  }
30}
31function initDynSections(){
32  var divs=document.getElementsByTagName('div');
33  var sectionCounter=1;
34  for(var i=0;i<divs.length-1;i++){
35    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
36      var header=divs[i];
37      var section=divs[i+1];
38      var button=header.firstChild;
39      if (button!='IMG'){
40        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
41        button=document.createElement('img');
42        divs[i].insertBefore(button,divs[i].firstChild);
43      }
44      header.style.cursor='pointer';
45      header.onclick=changeDisplayState;
46      header.id='dynheader'+sectionCounter;
47      button.src='closed.gif';
48      section.id='dynsection'+sectionCounter;
49      section.style.display='none';
50      section.style.marginLeft='14px';
51      sectionCounter++;
52    }
53  }
54}
55window.onload = initDynSections;
56-->
57</script>
58<div class="navigation" id="top">
59  <div class="tabs">
60    <ul>
61      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
62      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
63      <li><a href="annotated.html"><span>Classes</span></a></li>
64      <li class="current"><a href="files.html"><span>Files</span></a></li>
65      <li>
66        <div id="MSearchBox" class="MSearchBoxInactive">
67        <img id="MSearchSelect" src="search/search.png"
68             onmouseover="return searchBox.OnSearchSelectShow()"
69             onmouseout="return searchBox.OnSearchSelectHide()"
70             alt=""/>
71        <input type="text" id="MSearchField" value="Search" accesskey="S"
72             onfocus="searchBox.OnSearchFieldFocus(true)" 
73             onblur="searchBox.OnSearchFieldFocus(false)" 
74             onkeyup="searchBox.OnSearchFieldChange(event)"/>
75        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
76        </div>
77      </li>
78    </ul>
79  </div>
80  <div class="tabs">
81    <ul>
82      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
83      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
84    </ul>
85  </div>
86<h1>src/globals.h</h1><a href="globals_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
87<a name="l00028"></a>00028 <span class="preprocessor">#ifndef GLOBALS_H</span>
88<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define GLOBALS_H</span>
89<a name="l00030"></a>00030 <span class="preprocessor"></span>
90<a name="l00031"></a>00031 <span class="comment">// INCLUDES</span>
91<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;QtCore&gt;</span>
92<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;QtGui&gt;</span>
93<a name="l00034"></a>00034
94<a name="l00035"></a>00035 <span class="comment">// Version info</span>
95<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="version_8h.html" title="Contains TSPSG version information defines.">version.h</a>&quot;</span>
96<a name="l00037"></a>00037 <span class="comment">// OS and ARCH detection</span>
97<a name="l00038"></a>00038 <span class="preprocessor">#include &quot;<a class="code" href="os_8h.html" title="Contains TSPSG target CPU architecture and OS detection.">os.h</a>&quot;</span>
98<a name="l00039"></a>00039 <span class="comment">// TSPSG Defaults</span>
99<a name="l00040"></a>00040 <span class="preprocessor">#include &quot;<a class="code" href="defaults_8h.html" title="Contains TSPSG defaults.">defaults.h</a>&quot;</span>
100<a name="l00041"></a>00041 <span class="preprocessor">#ifdef Q_OS_WIN32</span>
101<a name="l00042"></a>00042 <span class="preprocessor"></span>    <span class="comment">// Vista/7 Eyecandy</span>
102<a name="l00043"></a>00043 <span class="preprocessor">    #include &quot;<a class="code" href="qtwin_8h.html">qtwin.h</a>&quot;</span>
103<a name="l00044"></a>00044 <span class="preprocessor">#endif // Q_OS_WIN32</span>
104<a name="l00045"></a>00045 <span class="preprocessor"></span>
105<a name="l00046"></a>00046 <span class="comment">// DEFINES</span>
106<a name="l00048"></a><a class="code" href="globals_8h.html#a70edda218af688662bb006cf0552544e">00048</a> <span class="comment"></span><span class="preprocessor">#define MAX_NUM_CITIES 50</span>
107<a name="l00050"></a><a class="code" href="globals_8h.html#a1703614f274735e91c1539048ef1093f">00050</a> <span class="preprocessor">#define MAX_RAND_VALUE 1000</span>
108<a name="l00051"></a>00051 <span class="preprocessor"></span>
109<a name="l00052"></a>00052 <span class="comment">// Paths</span>
110<a name="l00057"></a>00057 <span class="comment"></span><span class="preprocessor">#ifndef PATH_L10N</span>
111<a name="l00058"></a><a class="code" href="globals_8h.html#a27fa861afe50713394493c32c26741b9">00058</a> <span class="preprocessor"></span><span class="preprocessor">    #define PATH_L10N &quot;l10n&quot;</span>
112<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#endif // PATH_L10N</span>
113<a name="l00060"></a>00060 <span class="preprocessor"></span>
114<a name="l00064"></a>00064 <span class="preprocessor">#ifndef PATH_DOCS</span>
115<a name="l00065"></a><a class="code" href="globals_8h.html#a93de9563d724c12880c908961ca78dae">00065</a> <span class="preprocessor"></span><span class="preprocessor">    #define PATH_DOCS &quot;help&quot;</span>
116<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#endif // PATH_DOCS</span>
117<a name="l00067"></a>00067 <span class="preprocessor"></span>
118<a name="l00069"></a><a class="code" href="globals_8h.html#abd9c3c65456a20b4b281165a29583e78">00069</a> <span class="preprocessor">#define TSPT quint32(0x54535054)</span>
119<a name="l00071"></a><a class="code" href="globals_8h.html#afc611d658b90f441ae837a2478b5bdb1">00071</a> <span class="preprocessor">#define TSPT_VERSION quint8(1)</span>
120<a name="l00073"></a><a class="code" href="globals_8h.html#a4c516e985c6e8edf1b54bcd7c15ad89c">00073</a> <span class="preprocessor">#define TSPT_META_VERSION quint8(1)</span>
121<a name="l00075"></a><a class="code" href="globals_8h.html#a98ea46119cfda59f7b9c6f50ef72636e">00075</a> <span class="preprocessor">#define TSPT_META_SIZE 2</span>
122<a name="l00077"></a><a class="code" href="globals_8h.html#a437bcbf6414d33f7a885a4507c1b9940">00077</a> <span class="preprocessor">#define ZKT quint16(0x5A4B)</span>
123<a name="l00079"></a><a class="code" href="globals_8h.html#ab6d630d0a03e4e53fceb0567653ca629">00079</a> <span class="preprocessor">#define ZKT_VERSION quint8(1)</span>
124<a name="l00080"></a>00080 <span class="preprocessor"></span>
125<a name="l00088"></a>00088 <span class="preprocessor">#ifdef INFINITY</span>
126<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">    #undef INFINITY</span>
127<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
128<a name="l00091"></a><a class="code" href="globals_8h.html#a956e2723d559858d08644ac99146e910">00091</a> <span class="preprocessor"></span><span class="preprocessor">#define INFINITY 1.7E+308</span>
129<a name="l00093"></a><a class="code" href="globals_8h.html#a1ae8033146e07fa0bae37f148b90cd6b">00093</a> <span class="preprocessor">#define INFSTR &quot;---&quot;</span>
130<a name="l00094"></a>00094 <span class="preprocessor"></span>
131<a name="l00095"></a>00095 <span class="comment">// FUNCTIONS</span>
132<a name="l00101"></a><a class="code" href="globals_8h.html#a594842d2fcaf774c3c42b944f3f031d2">00101</a> <span class="comment"></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="globals_8h.html#a594842d2fcaf774c3c42b944f3f031d2" title="Checks whether x contains an integer value.">isInteger</a>(<span class="keywordtype">double</span> x)
133<a name="l00102"></a>00102 {
134<a name="l00103"></a>00103 <span class="keywordtype">double</span> i;
135<a name="l00104"></a>00104     <span class="keywordflow">return</span> (modf(x, &amp;i) == 0.0);
136<a name="l00105"></a>00105 }
137<a name="l00106"></a>00106
138<a name="l00107"></a>00107 <span class="comment">// Sanity checks</span>
139<a name="l00108"></a>00108 <span class="comment">// Check that default number of cities is sane (&lt;= MAX_NUM_CITIES)</span>
140<a name="l00109"></a>00109 <span class="preprocessor">#if DEF_NUM_CITIES &gt; MAX_NUM_CITIES</span>
141<a name="l00110"></a>00110 <span class="preprocessor"></span><span class="preprocessor">    #undef DEF_NUM_CITIES</span>
142<a name="l00111"></a>00111 <span class="preprocessor"></span><span class="preprocessor">    #define DEF_NUM_CITIES MAX_NUM_CITIES</span>
143<a name="l00112"></a>00112 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
144<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="comment">// Check that maximum for random generation is sane (&lt;= MAX_RAND_VALUE)</span>
145<a name="l00114"></a>00114 <span class="preprocessor">#if DEF_RAND_MAX &gt; MAX_RAND_VALUE</span>
146<a name="l00115"></a>00115 <span class="preprocessor"></span><span class="preprocessor">    #undef DEF_RAND_MAX</span>
147<a name="l00116"></a>00116 <span class="preprocessor"></span><span class="preprocessor">    #define DEF_RAND_MAX MAX_RAND_VALUE</span>
148<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
149<a name="l00118"></a>00118 <span class="preprocessor"></span><span class="comment">// Check that DEF_RAND_MIN &lt;= DEF_RAND_MAX</span>
150<a name="l00119"></a>00119 <span class="preprocessor">#if DEF_RAND_MIN &gt; DEF_RAND_MAX</span>
151<a name="l00120"></a>00120 <span class="preprocessor"></span><span class="preprocessor">    #undef DEF_RAND_MIN</span>
152<a name="l00121"></a>00121 <span class="preprocessor"></span><span class="preprocessor">    #define DEF_RAND_MIN DEF_RAND_MAX</span>
153<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
154<a name="l00123"></a>00123 <span class="preprocessor"></span>
155<a name="l00124"></a>00124 <span class="preprocessor">#endif // GLOBALS_H</span>
156</pre></div></div>
157<!--- window showing the filter options -->
158<div id="MSearchSelectWindow"
159     onmouseover="return searchBox.OnSearchSelectShow()"
160     onmouseout="return searchBox.OnSearchSelectHide()"
161     onkeydown="return searchBox.OnSearchSelectKey(event)">
162<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>
163
164<!-- iframe showing the search results (closed by default) -->
165<div id="MSearchResultsWindow">
166<iframe src="" frameborder="0" 
167        name="MSearchResults" id="MSearchResults">
168</iframe>
169</div>
170
171<hr size="1"/><address style="text-align: right;"><small>Generated on Wed Mar 3 01:46:34 2010 for TSPSG: TSP Solver and Generator by&nbsp;
172<a href="http://www.doxygen.org/index.html">
173<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
174</body>
175</html>
Note: See TracBrowser for help on using the repository browser.