private static void hDot()

in flink-ml-servable-core/src/main/java/org/apache/flink/ml/linalg/BLAS.java [220:239]


    private static void hDot(SparseVector x, SparseVector y) {
        int idx = 0;
        int idy = 0;
        while (idx < x.indices.length && idy < y.indices.length) {
            int indexX = x.indices[idx];
            while (idy < y.indices.length && y.indices[idy] < indexX) {
                y.values[idy] = 0;
                idy++;
            }
            if (idy < y.indices.length && y.indices[idy] == indexX) {
                y.values[idy] *= x.values[idx];
                idy++;
            }
            idx++;
        }
        while (idy < y.indices.length) {
            y.values[idy] = 0;
            idy++;
        }
    }