source: branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/BinaryAlignmentStorage.java @ 1586

Last change on this file since 1586 was 1586, checked in by rkrimmel, 10 years ago

Adding simple smith waterman and changing alignment algorithm creation to factory pattern

File size: 1000 bytes
Line 
1package de.ugoe.cs.autoquest.tasktrees.alignment.matrix;
2
3
4import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithm;
5
6public class BinaryAlignmentStorage {
7
8    private AlignmentAlgorithm[][] alignments;
9    UPGMAMatrix sequenceDistances;
10   
11    public BinaryAlignmentStorage(int sizex, int sizey) {
12        alignments = new AlignmentAlgorithm[sizex+1][sizey+1];
13        sequenceDistances = new UPGMAMatrix(Math.max(sizex,sizey));
14        sequenceDistances.initialize(Double.POSITIVE_INFINITY);
15    }
16   
17    public void set(int i,int j,AlignmentAlgorithm sw) {
18        alignments[i][j] = sw;
19    }
20   
21    public AlignmentAlgorithm get(int i,int j) {
22        return alignments[i][j];
23    }
24   
25    public void setDistance(int i,int j,double distance) {
26        sequenceDistances.set(i, j, distance);
27    }
28   
29    public double getDistance(int i,int j) {
30        return sequenceDistances.get(i,j);
31    }
32   
33    public UPGMAMatrix getDistanceMatrix() {
34        return sequenceDistances;
35    }
36}
37
Note: See TracBrowser for help on using the repository browser.