Last change
on this file since 1572 was
1572,
checked in by rkrimmel, 10 years ago
|
Added parts of the PAL library, implemented UPGMA Algoritm for Feng Doolittle guide tree
|
File size:
813 bytes
|
Rev | Line | |
---|
[1572] | 1 | package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; |
---|
[1570] | 2 | |
---|
[1572] | 3 | import de.ugoe.cs.autoquest.tasktrees.alignment.pal.misc.Identifier; |
---|
[1570] | 4 | |
---|
[1572] | 5 | |
---|
| 6 | public class UPGMAMatrix extends TriangleMatrix { |
---|
| 7 | |
---|
| 8 | public UPGMAMatrix(int size) { |
---|
[1570] | 9 | super(size); |
---|
| 10 | } |
---|
[1572] | 11 | |
---|
| 12 | public int size() { |
---|
| 13 | return size; |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | public String toString() { |
---|
| 17 | String result = ""; |
---|
| 18 | for (int i = 0; i < size; i++) { |
---|
| 19 | result = result + String.format("%8d", i); |
---|
| 20 | } |
---|
| 21 | result += "\n"; |
---|
| 22 | |
---|
| 23 | for (int i = 0; i < size; i++) { |
---|
| 24 | for(int j = 0; j< size; j++) { |
---|
| 25 | if(i<j) { |
---|
| 26 | if(Double.isInfinite(this.get(i,j))) { |
---|
| 27 | result = result + " -------"; |
---|
| 28 | } |
---|
| 29 | else { |
---|
| 30 | result = result + String.format("%+8.2f",this.get(i,j)); |
---|
| 31 | } |
---|
| 32 | } |
---|
| 33 | else { |
---|
| 34 | result = result + (" "); |
---|
| 35 | } |
---|
| 36 | } |
---|
| 37 | result = result + " " + i + "\n"; |
---|
| 38 | } |
---|
| 39 | return result; |
---|
| 40 | } |
---|
| 41 | |
---|
[1571] | 42 | |
---|
[1570] | 43 | |
---|
| 44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.