Changeset 100 in tspsg-svn for trunk/docs/html/tspsolver_8h_source.html
- Timestamp:
- Apr 8, 2010, 11:02:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/html/tspsolver_8h_source.html
r97 r100 121 121 <a name="l00074"></a>00074 }; 122 122 <a name="l00075"></a>00075 123 <a name="l00080"></a><a class="code" href="class_c_t_s_p_solver.html">00080</a> <span class="keyword">class </span><a class="code" href="class_c_t_s_p_solver.html" title="This class solves Travelling Salesman Problem task.">CTSPSolver</a> 123 <a name="l00080"></a><a class="code" href="class_c_t_s_p_solver.html">00080</a> <span class="keyword">class </span><a class="code" href="class_c_t_s_p_solver.html" title="This class solves Travelling Salesman Problem task.">CTSPSolver</a>: <span class="keyword">public</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html">QObject</a> 124 124 <a name="l00081"></a>00081 { 125 <a name="l00082"></a>00082 Q_ DECLARE_TR_FUNCTIONS(<a class="code" href="class_c_t_s_p_solver.html" title="This class solves Travelling Salesman Problem task.">CTSPSolver</a>)125 <a name="l00082"></a>00082 Q_OBJECT 126 126 <a name="l00083"></a>00083 127 127 <a name="l00084"></a>00084 <span class="keyword">public</span>: 128 <a name="l00085"></a>00085 <a class="code" href="class_c_t_s_p_solver.html#aa5e45813d8f5e1c039b1bb9746d367bd" title="Class constructor.">CTSPSolver</a>(); 129 <a name="l00086"></a>00086 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> <a class="code" href="class_c_t_s_p_solver.html#a57556c971a25e3556c4aa3cc1fd2d3d0" title="Returns the sorted optimal path, starting from City 1.">getSortedPath</a>() <span class="keyword">const</span>; 130 <a name="l00087"></a>00087 <span class="keyword">static</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> <a class="code" href="class_c_t_s_p_solver.html#a677a878c4c8a06316a5d8d5a4fc8ab65" title="Returns CTSPSolver&#39;s version ID.">getVersionId</a>(); 131 <a name="l00088"></a>00088 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_solver.html#a28d546e840cf53c639b45c0f26419f7a" title="Returns whether or not the solution is definitely optimal.">isOptimal</a>() <span class="keyword">const</span>; 132 <a name="l00089"></a>00089 <a class="code" href="struct_s_step.html" title="This structure represents one step of solving.">SStep</a> *<a class="code" href="class_c_t_s_p_solver.html#a9a6545dd05e449151aabe325f4058edd" title="Solves the given task.">solve</a>(<span class="keywordtype">int</span> numCities, <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> task, <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qwidget.html">QWidget</a> *parent = 0); 133 <a name="l00090"></a>00090 ~<a class="code" href="class_c_t_s_p_solver.html" title="This class solves Travelling Salesman Problem task.">CTSPSolver</a>(); 134 <a name="l00091"></a>00091 135 <a name="l00092"></a>00092 <span class="keyword">private</span>: 136 <a name="l00093"></a>00093 <span class="keywordtype">bool</span> mayNotBeOptimal; 137 <a name="l00094"></a>00094 <span class="keywordtype">int</span> nCities; 138 <a name="l00095"></a>00095 <a class="code" href="struct_s_step.html" title="This structure represents one step of solving.">SStep</a> *root; 139 <a name="l00096"></a>00096 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html">QHash<int,int></a> route; 140 <a name="l00097"></a>00097 <span class="comment">// QHash<int,int> forbidden;</span> 141 <a name="l00098"></a>00098 142 <a name="l00099"></a>00099 <span class="keywordtype">double</span> align(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix); 143 <a name="l00100"></a>00100 <span class="keywordtype">void</span> cleanup(); 144 <a name="l00101"></a>00101 <span class="keywordtype">void</span> deleteTree(<a class="code" href="struct_s_step.html" title="This structure represents one step of solving.">SStep</a> *&root); 145 <a name="l00102"></a>00102 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">QList<SCandidate></a> findCandidate(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> &nRow, <span class="keywordtype">int</span> &nCol) <span class="keyword">const</span>; 146 <a name="l00103"></a>00103 <span class="keywordtype">double</span> findMinInCol(<span class="keywordtype">int</span> nCol, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> exr = -1) <span class="keyword">const</span>; 147 <a name="l00104"></a>00104 <span class="keywordtype">double</span> findMinInRow(<span class="keywordtype">int</span> nRow, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> exc = -1) <span class="keyword">const</span>; 148 <a name="l00105"></a>00105 <span class="keywordtype">bool</span> hasSubCycles(<span class="keywordtype">int</span> nRow, <span class="keywordtype">int</span> nCol) <span class="keyword">const</span>; 149 <a name="l00106"></a>00106 <span class="keywordtype">void</span> subCol(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> nCol, <span class="keywordtype">double</span> val); 150 <a name="l00107"></a>00107 <span class="keywordtype">void</span> subRow(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> nRow, <span class="keywordtype">double</span> val); 151 <a name="l00108"></a>00108 }; 152 <a name="l00109"></a>00109 153 <a name="l00110"></a>00110 <span class="preprocessor">#endif // TSPSOLVER_H</span> 128 <a name="l00085"></a>00085 <span class="keyword">static</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> <a class="code" href="class_c_t_s_p_solver.html#a677a878c4c8a06316a5d8d5a4fc8ab65" title="Returns CTSPSolver&#39;s version ID.">getVersionId</a>(); 129 <a name="l00086"></a>00086 130 <a name="l00087"></a>00087 <a class="code" href="class_c_t_s_p_solver.html#a4a519caa89db1683693759a92a65319c" title="Constructs CTSPSolver object.">CTSPSolver</a>(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html">QObject</a> *<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html#parent">parent</a> = NULL); 131 <a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_solver.html#acf86422c1b8ff8e5b9bc88e09c57c48b" title="Cleans up the object and frees up memory used by the solution tree.">cleanup</a>(<span class="keywordtype">bool</span> processEvents = <span class="keyword">false</span>); 132 <a name="l00089"></a>00089 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> <a class="code" href="class_c_t_s_p_solver.html#a57556c971a25e3556c4aa3cc1fd2d3d0" title="Returns the sorted optimal path, starting from City 1.">getSortedPath</a>() <span class="keyword">const</span>; 133 <a name="l00090"></a>00090 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_solver.html#a28d546e840cf53c639b45c0f26419f7a" title="Indicates whether or not the solution is definitely optimal.">isOptimal</a>() <span class="keyword">const</span>; 134 <a name="l00091"></a>00091 <a class="code" href="struct_s_step.html" title="This structure represents one step of solving.">SStep</a> *<a class="code" href="class_c_t_s_p_solver.html#a0f0f0aa60d05c97f3b0e867a381de558" title="Solves the given task.">solve</a>(<span class="keywordtype">int</span> numCities, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &task); 135 <a name="l00092"></a>00092 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_solver.html#a80cff5d533711ab1929de1fdf09495b7" title="Indicates whether or not the solution process was canceled.">wasCanceled</a>() <span class="keyword">const</span>; 136 <a name="l00093"></a>00093 ~<a class="code" href="class_c_t_s_p_solver.html" title="This class solves Travelling Salesman Problem task.">CTSPSolver</a>(); 137 <a name="l00094"></a>00094 138 <a name="l00095"></a>00095 <span class="keyword">public</span> slots: 139 <a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_solver.html#a996ac169e8ed087170bd8610fa4aa715" title="Cancels the solution process.">cancel</a>(); 140 <a name="l00097"></a>00097 141 <a name="l00098"></a>00098 signals: 142 <a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_solver.html#ae12895fa529a965b57204e355b9012d7" title="This signal is emitted once every time a part of the route is found.">routePartFound</a>(<span class="keywordtype">int</span> n); 143 <a name="l00104"></a>00104 144 <a name="l00105"></a>00105 <span class="keyword">private</span>: 145 <a name="l00106"></a>00106 <span class="keywordtype">bool</span> mayNotBeOptimal, canceled; 146 <a name="l00107"></a>00107 <span class="keywordtype">int</span> nCities; 147 <a name="l00108"></a>00108 <a class="code" href="struct_s_step.html" title="This structure represents one step of solving.">SStep</a> *root; 148 <a name="l00109"></a>00109 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html">QHash<int,int></a> route; 149 <a name="l00110"></a>00110 <span class="keyword">mutable</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmutex.html">QMutex</a> mutex; 150 <a name="l00111"></a>00111 151 <a name="l00112"></a>00112 <span class="keywordtype">double</span> align(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix); 152 <a name="l00113"></a>00113 <span class="keywordtype">void</span> deleteTree(<a class="code" href="struct_s_step.html" title="This structure represents one step of solving.">SStep</a> *&root, <span class="keywordtype">bool</span> processEvents = <span class="keyword">false</span>); 153 <a name="l00114"></a>00114 <span class="keywordtype">void</span> denormalize(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix) <span class="keyword">const</span>; 154 <a name="l00115"></a>00115 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">QList<SCandidate></a> findCandidate(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> &nRow, <span class="keywordtype">int</span> &nCol) <span class="keyword">const</span>; 155 <a name="l00116"></a>00116 <span class="keywordtype">double</span> findMinInCol(<span class="keywordtype">int</span> nCol, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> exr = -1) <span class="keyword">const</span>; 156 <a name="l00117"></a>00117 <span class="keywordtype">double</span> findMinInRow(<span class="keywordtype">int</span> nRow, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> exc = -1) <span class="keyword">const</span>; 157 <a name="l00118"></a>00118 <span class="keywordtype">bool</span> hasSubCycles(<span class="keywordtype">int</span> nRow, <span class="keywordtype">int</span> nCol) <span class="keyword">const</span>; 158 <a name="l00119"></a>00119 <span class="keywordtype">void</span> normalize(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix) <span class="keyword">const</span>; 159 <a name="l00120"></a>00120 <span class="keywordtype">void</span> subCol(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> nCol, <span class="keywordtype">double</span> val); 160 <a name="l00121"></a>00121 <span class="keywordtype">void</span> subRow(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <span class="keywordtype">int</span> nRow, <span class="keywordtype">double</span> val); 161 <a name="l00122"></a>00122 }; 162 <a name="l00123"></a>00123 163 <a name="l00124"></a>00124 <span class="preprocessor">#ifdef DEBUG</span> 164 <a name="l00125"></a>00125 <span class="preprocessor"></span><a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdebug.html">QDebug</a> operator<<(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdebug.html">QDebug</a> dbg, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix); 165 <a name="l00126"></a>00126 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdebug.html">QDebug</a> operator<<(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdebug.html">QDebug</a> dbg, <span class="keyword">const</span> <a class="code" href="struct_s_candidate.html" title="A structure that represents a candidate for branching.">SCandidate</a> &candidate); 166 <a name="l00127"></a>00127 <span class="preprocessor">#endif // DEBUG</span> 167 <a name="l00128"></a>00128 <span class="preprocessor"></span> 168 <a name="l00129"></a>00129 <span class="preprocessor">#endif // TSPSOLVER_H</span> 154 169 </pre></div></div> 155 170 <!--- window showing the filter options --> … … 167 182 </div> 168 183 169 <hr size="1"/><address style="text-align: right;"><small>Generated on Wed Mar 3 01:46:352010 for TSPSG: TSP Solver and Generator by 184 <hr size="1"/><address style="text-align: right;"><small>Generated on Thu Apr 8 23:15:53 2010 for TSPSG: TSP Solver and Generator by 170 185 <a href="http://www.doxygen.org/index.html"> 171 186 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
Note: See TracChangeset
for help on using the changeset viewer.