All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.maizegenetics.taxa.distance.DistanceMatrixWithCounts Maven / Gradle / Ivy

Go to download

TASSEL 6 is a software package to evaluate traits association. Feature Tables are at the heart of the package where, a feature is a range of positions or a single position. Row in the that table are taxon.

There is a newer version: 6.0.1
Show newest version
/*
 *  DistanceMatrixWithCounts
 * 
 *  Created on Jan 14, 2016
 */
package net.maizegenetics.taxa.distance;

import net.maizegenetics.taxa.TaxaList;
import net.maizegenetics.util.GeneralAnnotation;

/**
 *
 * @author Terry Casstevens
 */
public class DistanceMatrixWithCounts extends DistanceMatrix {

    private final int[][] myCounts;

    DistanceMatrixWithCounts(float[][] distances, TaxaList taxa, GeneralAnnotation annotations, int[][] counts) {
        super(distances, taxa, annotations);
        myCounts = counts;
    }

    DistanceMatrixWithCounts(double[][] distance, TaxaList taxaList, GeneralAnnotation annotations, int[][] counts) {
        super(distance, taxaList, annotations);
        myCounts = counts;
    }

    public int getCount(int x, int y) {
        if (x > y) {
            return myCounts[x][y];
        } else {
            return myCounts[y][x];
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy