当前位置: 首页>>代码示例>>Java>>正文


Java DoubleAdder类代码示例

本文整理汇总了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();
    }

}
 
开发者ID:maxdemarzi,项目名称:graph_processing,代码行数:28,代码来源:Closeness.java

示例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);
}
 
开发者ID:gsummer,项目名称:neoNetworkAnalyzer,代码行数:6,代码来源:AverageShortestPathMulti.java

示例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 );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:15,代码来源:BetweennessCentrality.java

示例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 );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:15,代码来源:StressCentrality.java


注:本文中的org.neo4j.graphalgo.impl.util.DoubleAdder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。