Line | |
---|
1 | package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | public class UPGMAMatrix extends TriangleMatrix { |
---|
6 | |
---|
7 | public UPGMAMatrix(int size) { |
---|
8 | super(size); |
---|
9 | } |
---|
10 | |
---|
11 | public int size() { |
---|
12 | return size; |
---|
13 | } |
---|
14 | |
---|
15 | public String toString() { |
---|
16 | String result = ""; |
---|
17 | for (int i = 0; i < size; i++) { |
---|
18 | result = result + String.format("%8d", i); |
---|
19 | } |
---|
20 | result += "\n"; |
---|
21 | |
---|
22 | for (int i = 0; i < size; i++) { |
---|
23 | for(int j = 0; j< size; j++) { |
---|
24 | if(i<j) { |
---|
25 | if(Double.isInfinite(this.get(i,j))) { |
---|
26 | result = result + " -------"; |
---|
27 | } |
---|
28 | else { |
---|
29 | result = result + String.format("%+8.2f",this.get(i,j)); |
---|
30 | } |
---|
31 | } |
---|
32 | else { |
---|
33 | result = result + (" "); |
---|
34 | } |
---|
35 | } |
---|
36 | result = result + " " + i + "\n"; |
---|
37 | } |
---|
38 | return result; |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.