Changeset 89 in tspsg-svn for trunk/src/tspsolver.cpp


Ignore:
Timestamp:
Jan 12, 2010, 4:27:52 PM (15 years ago)
Author:
laleppa
Message:

Back to double to maintain compatibility between platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tspsolver.cpp

    r87 r89  
    106106int nRow, nCol;
    107107bool firstStep = true;
    108 qreal check;
     108double check;
    109109        while (this->route.size() < nCities) {
    110110//              forbidden.clear();
     
    188188/* Privates **********************************************************/
    189189
    190 qreal CTSPSolver::align(TMatrix &matrix)
    191 {
    192 qreal r = 0;
    193 qreal min;
     190double CTSPSolver::align(TMatrix &matrix)
     191{
     192double r = 0;
     193double min;
    194194        for (int k = 0; k < nCities; k++) {
    195195                min = findMinInRow(k,matrix);
     
    240240QList<SCandidate> alts;
    241241SCandidate cand;
    242 qreal h = -1;
    243 qreal sum;
     242double h = -1;
     243double sum;
    244244        for (int r = 0; r < nCities; r++)
    245245                for (int c = 0; c < nCities; c++)
     
    261261}
    262262
    263 qreal CTSPSolver::findMinInCol(int nCol, const TMatrix &matrix, int exr) const
    264 {
    265 qreal min = INFINITY;
     263double CTSPSolver::findMinInCol(int nCol, const TMatrix &matrix, int exr) const
     264{
     265double min = INFINITY;
    266266        for (int k = 0; k < nCities; k++)
    267267                if ((k != exr) && (min > matrix.at(k).at(nCol)))
     
    270270}
    271271
    272 qreal CTSPSolver::findMinInRow(int nRow, const TMatrix &matrix, int exc) const
    273 {
    274 qreal min = INFINITY;
     272double CTSPSolver::findMinInRow(int nRow, const TMatrix &matrix, int exc) const
     273{
     274double min = INFINITY;
    275275        for (int k = 0; k < nCities; k++)
    276276                if (((k != exc)) && (min > matrix.at(nRow).at(k)))
     
    293293}
    294294
    295 void CTSPSolver::subCol(TMatrix &matrix, int nCol, qreal val)
     295void CTSPSolver::subCol(TMatrix &matrix, int nCol, double val)
    296296{
    297297        for (int k = 0; k < nCities; k++)
     
    300300}
    301301
    302 void CTSPSolver::subRow(TMatrix &matrix, int nRow, qreal val)
     302void CTSPSolver::subRow(TMatrix &matrix, int nRow, double val)
    303303{
    304304        for (int k = 0; k < nCities; k++)
Note: See TracChangeset for help on using the changeset viewer.