com.google.common.graph.Network.inDegree()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中com.google.common.graph.Network.inDegree()方法的一些代码示例,展示了Network.inDegree()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.inDegree()方法的具体详情如下:
包路径:com.google.common.graph.Network
类名称:Network
方法名:inDegree

Network.inDegree介绍

[英]Returns the count of node's #inEdges(Object) in a directed network. In an undirected network, returns the #degree(Object).

If the count is greater than Integer.MAX_VALUE, returns Integer.MAX_VALUE.
[中]返回定向网络中节点的#INEDGE(对象)计数。在无向网络中,返回#度(对象)。
如果计数大于整数。最大值,返回整数。最大值。

代码示例

代码示例来源:origin: google/guava

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}

代码示例来源:origin: google/guava

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}

代码示例来源:origin: google/j2objc

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}

代码示例来源:origin: google/j2objc

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}

代码示例来源:origin: wildfly/wildfly

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}

代码示例来源:origin: wildfly/wildfly

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}

代码示例来源:origin: google/guava

.isEqualTo(network.inDegree(node) + network.outDegree(node));
 assertThat(network.inEdges(node)).hasSize(network.inDegree(node));
 assertThat(network.outEdges(node)).hasSize(network.outDegree(node));
} else {
 assertThat(network.inEdges(node)).isEqualTo(network.incidentEdges(node));
 assertThat(network.outEdges(node)).isEqualTo(network.incidentEdges(node));
 assertThat(network.inDegree(node)).isEqualTo(network.degree(node));
 assertThat(network.outDegree(node)).isEqualTo(network.degree(node));

代码示例来源:origin: google/guava

assertThat(directedGraph.outDegree(node)).isSameAs(transpose.inDegree(node));

代码示例来源:origin: com.io7m.jgrapht/jgrapht-guava

@Override
public int inDegreeOf(V vertex)
{
  return network.inDegree(vertex);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}

代码示例来源:origin: jrtom/jung

public NodeShapeSizeAspect(Network<N, E> graphIn, Function<N, Double> voltagesIn) {
 this.graph = graphIn;
 this.voltages = voltagesIn;
 setSizeTransformer(n -> scale ? (int) (voltages.apply(n) * 15) + 10 : 10);
 setAspectRatioTransformer(
   n -> stretch ? (float) (graph.inDegree(n) + 1) / (graph.outDegree(n) + 1) : 1.0f);
}

代码示例来源:origin: jrtom/jung

/**
  * Collects the "disappearing potential" associated with nodes that have either no incoming edges,
  * no outgoing edges, or both. Nodes that have no incoming edges do not directly contribute to the
  * hub scores of other nodes; similarly, nodes that have no outgoing edges do not directly
  * contribute to the authority scores of other nodes. These values are collected at each step and
  * then distributed across all nodes as a part of the normalization process. (This process is not
  * required for, and does not affect, the 'sum-of-squares'-style normalization.)
  */
 @Override
 protected void collectDisappearingPotential(N v) {
  if (graph.outDegree(v) == 0) {
   Preconditions.checkArgument(isDisconnectedGraphOK(), "Outdegree of " + v + " must be > 0");
   disappearing_potential.hub += getCurrentValue(v).authority;
  }
  if (graph.inDegree(v) == 0) {
   Preconditions.checkArgument(isDisconnectedGraphOK(), "Indegree of " + v + " must be > 0");
   disappearing_potential.authority += getCurrentValue(v).hub;
  }
 }
}

代码示例来源:origin: com.google.guava/guava-tests

assertThat(directedGraph.outDegree(node)).isSameAs(transpose.inDegree(node));

代码示例来源:origin: com.google.guava/guava-tests

.isEqualTo(network.inDegree(node) + network.outDegree(node));
 assertThat(network.inEdges(node)).hasSize(network.inDegree(node));
 assertThat(network.outEdges(node)).hasSize(network.outDegree(node));
} else {
 assertThat(network.inEdges(node)).isEqualTo(network.incidentEdges(node));
 assertThat(network.outEdges(node)).isEqualTo(network.incidentEdges(node));
 assertThat(network.inDegree(node)).isEqualTo(network.degree(node));
 assertThat(network.outDegree(node)).isEqualTo(network.degree(node));

相关文章