com.google.common.collect.ArrayTable#get ( )源码实例Demo

下面列出了com.google.common.collect.ArrayTable#get ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ipst   文件: FEAMatFileWriter.java
private MLDouble histoDataAsMLDouble(String name, ArrayTable<Integer, String, Float> histoData) {
    int rowsSize = histoData.rowKeySet().size();
    int colsSize = histoData.columnKeySet().size();
    MLDouble mlDouble = new MLDouble(name, new int[] {rowsSize, colsSize});
    int i = 0;
    for (Integer rowKey : histoData.rowKeyList()) {
        int j = 0;
        for (String colkey : histoData.columnKeyList()) {
            Float v = histoData.get(rowKey, colkey);
            mlDouble.set(new Double(v), i, j);
            j++;
        }
        i++;
    }
    return mlDouble;
}
 
源代码2 项目: ipst   文件: Utils.java
public static double[][] histoDataAsDoubleMatrixNew(ArrayTable<Integer, String, Float> hdTable) {
    int rowsSize = hdTable.rowKeySet().size();
    int colsSize = hdTable.columnKeySet().size();
    double[][] matFinal = new double[rowsSize][colsSize];
    int i = 0;
    for (Integer rowKey : hdTable.rowKeyList()) {
        int j = 0;
        for (String colkey : hdTable.columnKeyList()) {
            Float v = hdTable.get(rowKey, colkey);
            matFinal[i][j] = getCleanFloat(v);
            j = j + 1;
        }
        i = i + 1;
    }
    return matFinal;
}
 
源代码3 项目: ipst   文件: Utils.java
public static double[][] histoDataAsDoubleMatrix(ArrayTable<Integer, String, Float> hdTable) {

        int rowsSize = hdTable.rowKeySet().size();
        int colsSize = hdTable.columnKeySet().size();
        double[][] matFinal = new double[rowsSize][colsSize];
        for (int i = 0; i < rowsSize; i++) {
            for (int j = 0; j < colsSize; j++) {
                Float v = hdTable.get(i, j);
                matFinal[i][j] = getCleanFloat(v);
            }
        }
        return matFinal;
    }