Beispiel #1
0
void number_of_paths(const graph & graph, config::selectivity::type type, size_t n, matrix_of_paths & matrix) {
    size_t m = graph.neighbors.size();
    matrix.data.resize(n+1);
    for (size_t i = 0; i <= n; i++) {
        matrix.data[i].resize(m);
    }
    
    for (size_t j = 0; j < m; j++) {
        for (auto sel : SELECTIVITY::types) {
            if (is_subclass_of(sel, type)) {
                matrix.data[0][j][sel] = 1;
            }
        }
    }
    
    for (size_t i = 1; i <= n; i++) {
        for (size_t j = 0; j < m; j++) {
            for (auto sel : SELECTIVITY::types) {
                if (graph.neighbors[j].count(sel) > 0) {
                    for (auto pair : graph.neighbors[j].at(sel)) {
                        matrix.data[i][j][sel] += matrix.data[i-1][pair.second.first][pair.second.second];
                    }
                }
            }
        }
    }
}
Beispiel #2
0
bool Klass::compute_is_subtype_of(klassOop k) {
  assert(k->is_klass(), "argument must be a class");
  return is_subclass_of(k);
}