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

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

Some refactoring for storing the initial alignments so we don't need to do them again.

File size: 980 bytes
Line 
1package de.ugoe.cs.autoquest.tasktrees.alignment.matrix;
2
3
4import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWatermanRepeated;
5
6public class BinaryAlignmentStorage {
7
8    private SmithWatermanRepeated[][] alignments;
9    UPGMAMatrix sequenceDistances;
10   
11    public BinaryAlignmentStorage(int size) {
12        alignments = new SmithWatermanRepeated[size][size];
13        sequenceDistances = new UPGMAMatrix(size);
14        sequenceDistances.initialize(Double.POSITIVE_INFINITY);
15    }
16   
17    public void set(int i,int j,SmithWatermanRepeated sw) {
18        alignments[i][j] = sw;
19    }
20   
21    public SmithWatermanRepeated 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.