Changeset 1757eb594b in tspsg for src/tspsolver.h


Ignore:
Timestamp:
Jan 12, 2010, 3:11:24 PM (14 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
fcd8c1e4c1
Parents:
64f288c0f8
Message:

+ Added Fractional accuracy (in decimail places) to settings.
+ Created defaults.h file. Moved all default defines there.

  • Replaced all double types with qreal.
  • Replaced all calls to trUtf8() with tr() as we use setCodecForTr() to set UTF-8 encoding as default and tr() is enough.
  • Replaced all 2009 with 2010 in copyrights.
  • Fixed an error when loading .zkt file with less than 5 cities.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tspsolver.h

    r64f288c0f8 r1757eb594b  
    11/*!
    22 * \file tspsolver.h
    3  * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
     3 * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
    44 *
    55 *  $Id$
     
    3434
    3535//! A matrix of city-to-city travel costs.
    36 typedef QList<QList<double> > TMatrix;
     36typedef QList<QList<qreal> > TMatrix;
    3737
    3838/*!
     
    6060struct SStep {
    6161        TMatrix matrix; //!< This step's matrix
    62         double price; //!< The price of travel to this step
     62        qreal price; //!< The price of travel to this step
    6363        SCandidate candidate; //!< A candiadate for branching in the current matrix
    6464        QList<SCandidate> alts; //!< A list of alternative branching candidates
     
    7575/*!
    7676 * \brief This class solves Travelling Salesman Problem task.
    77  * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
     77 * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
    7878 *
    7979 * \todo TODO: Deletion of solution tree on destroy and cleanup.
     
    9898//      QHash<int,int> forbidden;
    9999
    100         double align(TMatrix &matrix);
     100        qreal align(TMatrix &matrix);
    101101        void cleanup();
    102102        void deleteNode(SStep *&node);
    103103        QList<SCandidate> findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const;
    104         double findMinInCol(int nCol, const TMatrix &matrix, int exr = -1) const;
    105         double findMinInRow(int nRow, const TMatrix &matrix, int exc = -1) const;
     104        qreal findMinInCol(int nCol, const TMatrix &matrix, int exr = -1) const;
     105        qreal findMinInRow(int nRow, const TMatrix &matrix, int exc = -1) const;
    106106        bool hasSubCycles(int nRow, int nCol) const;
    107         void subCol(TMatrix &matrix, int nCol, double val);
    108         void subRow(TMatrix &matrix, int nRow, double val);
     107        void subCol(TMatrix &matrix, int nCol, qreal val);
     108        void subRow(TMatrix &matrix, int nRow, qreal val);
    109109};
    110110
Note: See TracChangeset for help on using the changeset viewer.