Exemplo n.º 1
0
  public void run() {
    final EdgeData data = source.getValue();
    final int nodes = data.getSize();

    eigenMetric.eigensolve("V", nodes, data);

    VertexData result = new VertexData(nodes);

    for (int i = 0; i < nodes; i++) {
      result.set(i, eigenMetric.evResult[nodes + i]);
    }

    target.setValue(result);
  }
Exemplo n.º 2
0
    public void visit(int from, int into, double e) {
      if (e < minAbsValue) {
        return;
      }

      final double toMaxRatio = e / max;
      if (toMaxRatio < minToMaxRatio) {
        return;
      }

      result.set(from, into, e);
    }
Exemplo n.º 3
0
  public void run() {
    final EdgeData data = Metric.fetch(metric);

    final EdgeMaxVisitor max = new EdgeMaxVisitor();
    data.visitNonDef(max);

    if (!max.isMaxSet() || max.getMax() == 0) {
      target.setValue(data);
      return;
    }

    final EdgeData result =
        EdgeDataFactory.sparse(data.isSymmetric(), data.getDefElem(), data.getSize());

    data.visitNonDef(new ThresholdVisitor(minToMaxRatio, minAbsValue, max.getMax(), result));

    target.setValue(result);
  }