Ignore:
Timestamp:
08/03/14 22:53:27 (10 years ago)
Author:
rkrimmel
Message:

Adding tests to some classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java

    r1620 r1649  
    102102                                //position of the maximal score of the previous row 
    103103                                 
    104                                 for(int j = 2; j < length2;j++) { 
     104                                for(int j = 2; j <= length2;j++) { 
    105105                                        if(matrix[i-1][j].getScore() > tempMax) { 
    106106                                                tempMax = matrix[i-1][j].getScore(); 
     
    122122                         
    123123                        //The last additional score is not related to a character in the input sequence, it's the total score. Therefore we don't need to save something for it 
    124                         if(i<length1+1)  
    125                         { 
     124                        //and can end here 
     125                        if(i<length1+1) { 
    126126                                matrix[i][0].setXvalue(input1[i-1]); 
    127127                                matrix[i][0].setYvalue(Constants.UNMATCHED_SYMBOL); 
    128128                        } 
    129                         else {  
    130                         //End after we calculated final score 
     129                        else { 
    131130                                return; 
    132131                        } 
    133                          
    134                          
    135                         for (int j = 1; j < length2; j++) { 
     132                  
     133                         
     134                         
     135                        for (int j = 1; j <= length2; j++) { 
    136136                                double diagScore = matrix[i - 1][j - 1].getScore() + similarity(i, j); 
    137137                                double upScore = matrix[i][j - 1].getScore() + submat.getGapPenalty(); 
     
    181181                // skip the first row and column 
    182182                for (int i = 1; i <= length1; i++) { 
    183                         for (int j = 1; j < length2; j++) { 
     183                        for (int j = 1; j <= length2; j++) { 
    184184                                if (matrix[i][j].getScore() > maxScore) { 
    185185                                        maxScore = matrix[i][j].getScore(); 
     
    373373                 
    374374                for (int i = 0; i <= length1+1; i++) { 
    375                         for(int j = 0; j< length2; j++) { 
     375                        for(int j = 0; j<= length2; j++) { 
    376376                                matrix[i][j] = new MatrixEntry(); 
    377377                        } 
Note: See TracChangeset for help on using the changeset viewer.