Changeset fcaa74f7d7 in tspsg for src
- Timestamp:
- Dec 16, 2009, 11:49:51 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 140109febb
- Parents:
- 0bd0e1aca7
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mainwindow.cpp
r0bd0e1aca7 rfcaa74f7d7 414 414 output.append("<p>" + trUtf8("Selected candidate for branching: %1.").arg(trUtf8("(%1;%2)").arg(step->candidate.nRow + 1).arg(step->candidate.nCol + 1)) + "</p>"); 415 415 if (!step->alts.empty()) { 416 TCandidate cand;416 SCandidate cand; 417 417 QString alts; 418 418 foreach(cand, step->alts) { … … 672 672 line += "<td align=\"center\" class=\"selected\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>"; 673 673 else { 674 TCandidate cand;674 SCandidate cand; 675 675 cand.nRow = r; 676 676 cand.nCol = c; -
src/tspsolver.cpp
r0bd0e1aca7 rfcaa74f7d7 227 227 } 228 228 229 QList< TCandidate> CTSPSolver::findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const229 QList<SCandidate> CTSPSolver::findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const 230 230 { 231 231 nRow = -1; 232 232 nCol = -1; 233 QList< TCandidate> alts;234 TCandidate cand;233 QList<SCandidate> alts; 234 SCandidate cand; 235 235 double h = -1; 236 236 double sum; -
src/tspsolver.h
r0bd0e1aca7 rfcaa74f7d7 6 6 * $URL$ 7 7 * 8 * \brief Defines # tMatrix typedef, sStep structand CTSPSolver class.8 * \brief Defines #TMatrix typedef, SCandidate and SStep structs and CTSPSolver class. 9 9 * 10 10 * <b>TSPSG: TSP Solver and Generator</b> … … 39 39 * \brief A structure that represents a candidate for branching. 40 40 */ 41 struct TCandidate {41 struct SCandidate { 42 42 int nRow; //!< A zero-based row number of the candidate 43 43 int nCol; //!< A zero-based column number of the candidate 44 44 45 45 //! Assigns default values 46 TCandidate() {46 SCandidate() { 47 47 nCol = nRow = -1; 48 48 } 49 49 //! An operator == implementation 50 bool operator ==(const TCandidate &cand) const {50 bool operator ==(const SCandidate &cand) const { 51 51 return ((cand.nRow == nRow) && (cand.nCol == nCol)); 52 52 } … … 61 61 TMatrix matrix; //!< This step's matrix 62 62 double price; //!< The price of travel to this step 63 TCandidate candidate; //!< A candiadate for branching in the current matrix64 QList< TCandidate> alts; //!< A list of alternative branching candidates63 SCandidate candidate; //!< A candiadate for branching in the current matrix 64 QList<SCandidate> alts; //!< A list of alternative branching candidates 65 65 SStep *plNode; //!< Pointer to the left branch step 66 66 SStep *prNode; //!< Pointer to the right branch step … … 101 101 void cleanup(); 102 102 void deleteNode(SStep *node); 103 QList< TCandidate> findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const;103 QList<SCandidate> findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const; 104 104 double findMinInCol(int nCol, const TMatrix &matrix, int exr = -1) const; 105 105 double findMinInRow(int nRow, const TMatrix &matrix, int exc = -1) const;
Note: See TracChangeset
for help on using the changeset viewer.