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


Java TLongDoubleHashMap类代码示例

本文整理汇总了Java中gnu.trove.map.hash.TLongDoubleHashMap的典型用法代码示例。如果您正苦于以下问题:Java TLongDoubleHashMap类的具体用法?Java TLongDoubleHashMap怎么用?Java TLongDoubleHashMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TLongDoubleHashMap类属于gnu.trove.map.hash包,在下文中一共展示了TLongDoubleHashMap类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: queryId

import gnu.trove.map.hash.TLongDoubleHashMap; //导入依赖的package包/类
long queryId(String sql) throws SQLException {
	TLongDoubleHashMap vals = new TLongDoubleHashMap();
	NativeSql.on(destDb).query(sql, r -> {
		vals.put(r.getLong(1), r.getDouble(2));
		return true;
	});
	long exchangeId = -1;
	double delta = 0;
	for (long id : vals.keys()) {
		double dist = Math.abs(amount - vals.get(id));
		if (exchangeId == -1 || dist < delta) {
			exchangeId = id;
			delta = dist;
		}
	}
	return exchangeId;
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:18,代码来源:ProductSystemLinks.java

示例2: causal

import gnu.trove.map.hash.TLongDoubleHashMap; //导入依赖的package包/类
private double causal(LongPair provider, CalcExchange e) {
	if (exchangeFactors == null)
		return 1d;
	TLongDoubleHashMap map = exchangeFactors.get(provider);
	if (map == null)
		return 1d;
	return map.get(e.exchangeId); // default is 1.0
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:9,代码来源:AllocationIndex.java

示例3: loadFactors

import gnu.trove.map.hash.TLongDoubleHashMap; //导入依赖的package包/类
private void loadFactors(Connection con, String table,
		TLongDoubleHashMap map) throws Exception {
	Statement statement = con.createStatement();
	String query = "select id, conversion_factor from " + table;
	ResultSet set = statement.executeQuery(query);
	while (set.next()) {
		long id = set.getLong("id");
		double factor = set.getDouble("conversion_factor");
		map.put(id, factor);
	}
	statement.close();
	set.close();
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:14,代码来源:ConversionTable.java

示例4: ConceptVector

import gnu.trove.map.hash.TLongDoubleHashMap; //导入依赖的package包/类
/**
 * Constructs an empty ConceptVector.
 */
public ConceptVector() {
    vector = new TLongDoubleHashMap();
}
 
开发者ID:shilad,项目名称:sem-tag,代码行数:7,代码来源:ConceptVector.java


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