本文整理汇总了Java中org.neo4j.graphalgo.impl.util.DoubleAdder类的典型用法代码示例。如果您正苦于以下问题:Java DoubleAdder类的具体用法?Java DoubleAdder怎么用?Java DoubleAdder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DoubleAdder类属于org.neo4j.graphalgo.impl.util包,在下文中一共展示了DoubleAdder类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compute
import org.neo4j.graphalgo.impl.util.DoubleAdder; //导入依赖的package包/类
@Override
public void compute(String label, String type, int iterations) {
SingleSourceShortestPath<Double> singleSourceShortestPath = getSingleSourceShortestPath(DynamicRelationshipType.withName(type));
Set<Node> nodes = new HashSet<>();
try ( Transaction tx = db.beginTx()) {
ResourceIterator<Node> iterator = db.findNodes(Label.label(label));
while (iterator.hasNext()) {
nodes.add(iterator.next());
}
closenessCentrality = new ClosenessCentrality<>(
singleSourceShortestPath, new DoubleAdder(), 0.0, nodes, new CostDivider<Double>()
{
public Double divideByCost( Double d, Double c )
{
return d / c;
}
public Double divideCost( Double c, Double d )
{
return c / d;
}
});
closenessCentrality.calculate();
}
}
示例2: AverageShortestPathMulti
import org.neo4j.graphalgo.impl.util.DoubleAdder; //导入依赖的package包/类
public AverageShortestPathMulti(
SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath,
Set<Node> nodeSet) {
super(singleSourceShortestPath, new DoubleAdder(), 0.0, nodeSet);
}
示例3: BetweennessCentrality
import org.neo4j.graphalgo.impl.util.DoubleAdder; //导入依赖的package包/类
/**
* Default constructor.
* @param singleSourceShortestPath
* Underlying singleSourceShortestPath.
* @param nodeSet
* A set containing the nodes for which centrality values should
* be computed.
*/
public BetweennessCentrality(
SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath,
Set<Node> nodeSet )
{
super( singleSourceShortestPath, new DoubleAdder(), 0.0, nodeSet );
}
示例4: StressCentrality
import org.neo4j.graphalgo.impl.util.DoubleAdder; //导入依赖的package包/类
/**
* Default constructor.
* @param singleSourceShortestPath
* Underlying singleSourceShortestPath.
* @param nodeSet
* A set containing the nodes for which centrality values should
* be computed.
*/
public StressCentrality(
SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath,
Set<Node> nodeSet )
{
super( singleSourceShortestPath, new DoubleAdder(), 0.0, nodeSet );
}