Ignore:
Timestamp:
07/14/14 23:27:01 (10 years ago)
Author:
rkrimmel
Message:

Removed parameters from alignmentalgorihm factory constructor and changed interface by adding a new align() method, which now gets all the data via parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWaterman.java

    r1592 r1612  
    3838        private SubstitutionMatrix submat; 
    3939 
    40         public SmithWaterman(int[] input1, int[] input2, SubstitutionMatrix submat, 
    41                         float threshold) { 
    42                 this.input1 = input1; 
    43                 this.input2 = input2; 
    44                 length1 = input1.length; 
    45                 length2 = input2.length; 
    46                 this.submat = submat; 
    47  
    48                 // System.out.println("Starting SmithWaterman algorithm with a " 
    49                 // + submat.getClass() + " Substitution Matrix: " + 
    50                 // submat.getClass().getCanonicalName()); 
    51  
    52                 matrix = new MatrixEntry[length1 + 1][length2 + 1]; 
    53                 alignment = new ArrayList<NumberSequence>(); 
    54  
    55                 for (int i = 0; i < length1+1; i++) { 
    56                         for (int j = 0; j < length2+1; j++) { 
    57                                 matrix[i][j] = new MatrixEntry(); 
    58                         } 
    59                 } 
    60  
    61                 buildMatrix(); 
    62                 traceback(); 
    63         } 
    6440 
    6541        /** 
     
    294270        } 
    295271 
     272        @Override 
     273        public void align(int[] input1, int[] input2, SubstitutionMatrix submat, 
     274                        float threshold) { 
     275                this.input1 = input1; 
     276                this.input2 = input2; 
     277                length1 = input1.length; 
     278                length2 = input2.length; 
     279                this.submat = submat; 
     280 
     281                // System.out.println("Starting SmithWaterman algorithm with a " 
     282                // + submat.getClass() + " Substitution Matrix: " + 
     283                // submat.getClass().getCanonicalName()); 
     284 
     285                matrix = new MatrixEntry[length1 + 1][length2 + 1]; 
     286                alignment = new ArrayList<NumberSequence>(); 
     287 
     288                for (int i = 0; i < length1+1; i++) { 
     289                        for (int j = 0; j < length2+1; j++) { 
     290                                matrix[i][j] = new MatrixEntry(); 
     291                        } 
     292                } 
     293 
     294                buildMatrix(); 
     295                traceback(); 
     296                 
     297        } 
     298 
    296299} 
Note: See TracChangeset for help on using the changeset viewer.