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


Java MathUtils.round方法代码示例

本文整理汇总了Java中org.apache.commons.math.util.MathUtils.round方法的典型用法代码示例。如果您正苦于以下问题:Java MathUtils.round方法的具体用法?Java MathUtils.round怎么用?Java MathUtils.round使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math.util.MathUtils的用法示例。


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

示例1: getFeatureQ3

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Get the 3rd quartile of the given Feature of the whole graph.
 * @param feature
 * @return 
 */
public double getFeatureQ3(Feature feature) {
    List<Node> nodes = getFeatureSortedNodes(feature, true);
    int size = nodes.size();
    int q3Position = (int) MathUtils.round((size / 4.0), 0) * 3;

    return nodes.get(q3Position).getFeatureValue(feature);
}
 
开发者ID:gfigueroa,项目名称:clusterrank-graph-clustering,代码行数:13,代码来源:ClusterRankGraph.java

示例2: getFeatureQ1

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Get the 1st quartile of the given Feature of the whole graph.
 * @param feature
 * @return 
 */
public double getFeatureQ1(Feature feature) {
    List<Node> nodes = getFeatureSortedNodes(feature, true);
    int size = nodes.size();
    int q1Position = (int) MathUtils.round((size / 4.0), 0);

    return nodes.get(q1Position).getFeatureValue(feature);
}
 
开发者ID:gfigueroa,项目名称:clusterrank-graph-clustering,代码行数:13,代码来源:ClusterRankGraph.java

示例3: toStringSeparator

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
public String toStringSeparator(String separator) {
    String string = "";
    string += "Key: " + this.key;
    string += separator + "Label: " + this.label;
    string += separator + "Rank: " + MathUtils.round(this.rank, 2);
    string += separator + "Outgoing Edges: " + this.outgoingEdges.size();
    string += separator + "Incoming Edges: " + this.incomingEdges.size();
    string += separator + "Cooccurrence: " + MathUtils.round(this.cooccurrence, 2);
    
    return string;
}
 
开发者ID:gfigueroa,项目名称:clusterrank-graph-clustering,代码行数:12,代码来源:Node.java

示例4: toString

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
@Override
public String toString() {
            String string = "";
    string += "Key: " + this.key;
    string += " | Label: " + this.label;
    string += " | Rank: " + MathUtils.round(this.rank, 2);
    string += " | Outgoing Edges: " + this.outgoingEdges.size();
    string += " | Incoming Edges: " + this.incomingEdges.size();
    string += " | Cooccurrence: " + MathUtils.round(this.cooccurrence, 2);

    return string;
}
 
开发者ID:gfigueroa,项目名称:clusterrank-graph-clustering,代码行数:13,代码来源:Node.java

示例5: ROUNDDOWN

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
public double ROUNDDOWN(double number, int count) {
	return MathUtils.round(number, count, BigDecimal.ROUND_DOWN);
}
 
开发者ID:netxilia,项目名称:netxilia,代码行数:4,代码来源:MathFunctions.java

示例6: ROUNDUP

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
public double ROUNDUP(double number, int count) {
	return MathUtils.round(number, count, BigDecimal.ROUND_UP);
}
 
开发者ID:netxilia,项目名称:netxilia,代码行数:4,代码来源:MathFunctions.java

示例7: TRUNC

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
public double TRUNC(double number, int count) {
	return MathUtils.round(number, count, BigDecimal.ROUND_DOWN);
}
 
开发者ID:netxilia,项目名称:netxilia,代码行数:4,代码来源:MathFunctions.java

示例8: roundToNextN

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
public static double roundToNextN(double value, double n) {

		return MathUtils.round(value / n, 0) * n;
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:5,代码来源:RoundUtil.java

示例9: ROUND

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Rounds the given number to a certain number of decimal places according to valid mathematical criteria. Count
 * (optional) is the number of the places to which the value is to be rounded. If the count parameter is negative,
 * only the whole number portion is rounded. It is rounded to the place indicated by the count.
 * 
 * @param number
 * @return
 */
public double ROUND(double number, int count) {
	return MathUtils.round(number, count, BigDecimal.ROUND_FLOOR);
}
 
开发者ID:netxilia,项目名称:netxilia,代码行数:12,代码来源:MathFunctions.java


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