Changeset 76 in tspsg-svn for trunk/src


Ignore:
Timestamp:
Dec 16, 2009, 11:49:51 PM (15 years ago)
Author:
laleppa
Message:
  • TCandidate should, actually, be SCandidate (struct, not typedef). Renamed it.
  • Documentation update.
Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mainwindow.cpp

    r74 r76  
    414414                                output.append("<p>" + trUtf8("Selected candidate for branching: %1.").arg(trUtf8("(%1;%2)").arg(step->candidate.nRow + 1).arg(step->candidate.nCol + 1)) + "</p>");
    415415                                if (!step->alts.empty()) {
    416 TCandidate cand;
     416SCandidate cand;
    417417QString alts;
    418418                                        foreach(cand, step->alts) {
     
    672672                                line += "<td align=\"center\" class=\"selected\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>";
    673673                        else {
    674 TCandidate cand;
     674SCandidate cand;
    675675                                cand.nRow = r;
    676676                                cand.nCol = c;
  • trunk/src/tspsolver.cpp

    r74 r76  
    227227}
    228228
    229 QList<TCandidate> CTSPSolver::findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const
     229QList<SCandidate> CTSPSolver::findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const
    230230{
    231231        nRow = -1;
    232232        nCol = -1;
    233 QList<TCandidate> alts;
    234 TCandidate cand;
     233QList<SCandidate> alts;
     234SCandidate cand;
    235235double h = -1;
    236236double sum;
  • trunk/src/tspsolver.h

    r74 r76  
    66 *  $URL$
    77 *
    8  * \brief Defines #tMatrix typedef, sStep struct and CTSPSolver class.
     8 * \brief Defines #TMatrix typedef, SCandidate and SStep structs and CTSPSolver class.
    99 *
    1010 *  <b>TSPSG: TSP Solver and Generator</b>
     
    3939 * \brief A structure that represents a candidate for branching.
    4040 */
    41 struct TCandidate {
     41struct SCandidate {
    4242        int nRow; //!< A zero-based row number of the candidate
    4343        int nCol; //!< A zero-based column number of the candidate
    4444
    4545        //! Assigns default values
    46         TCandidate() {
     46        SCandidate() {
    4747                nCol = nRow = -1;
    4848        }
    4949        //! An operator == implementation
    50         bool operator ==(const TCandidate &cand) const {
     50        bool operator ==(const SCandidate &cand) const {
    5151                return ((cand.nRow == nRow) && (cand.nCol == nCol));
    5252        }
     
    6161        TMatrix matrix; //!< This step's matrix
    6262        double price; //!< The price of travel to this step
    63         TCandidate candidate; //!< A candiadate for branching in the current matrix
    64         QList<TCandidate> alts; //!< A list of alternative branching candidates
     63        SCandidate candidate; //!< A candiadate for branching in the current matrix
     64        QList<SCandidate> alts; //!< A list of alternative branching candidates
    6565        SStep *plNode; //!< Pointer to the left branch step
    6666        SStep *prNode; //!< Pointer to the right branch step
     
    101101        void cleanup();
    102102        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;
    104104        double findMinInCol(int nCol, const TMatrix &matrix, int exr = -1) const;
    105105        double findMinInRow(int nRow, const TMatrix &matrix, int exc = -1) const;
Note: See TracChangeset for help on using the changeset viewer.