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


Java MathException.printStackTrace方法代码示例

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


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

示例1: getElement

import org.apache.commons.math.MathException; //导入方法依赖的package包/类
/**
 * @see org.apache.commons.math.stat.descriptive.DescriptiveStatistics#getElement(int)
 */
public double getElement(int index) {

    double value = Double.NaN;

    int calcIndex = index;

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW &&
        windowSize < list.size())
    {
        calcIndex = (list.size() - windowSize) + index;
    }

    
    try {
        value = transformer.transform(list.get(calcIndex));
    } catch (MathException e) {
        e.printStackTrace();
    }
    
    return value;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:25,代码来源:ListUnivariateImpl.java

示例2: testQuantileCM

import org.apache.commons.math.MathException; //导入方法依赖的package包/类
private static void testQuantileCM(double y, double shape, double scale) {

        long time = System.currentTimeMillis();

        double value = 0;
        try {
            for (int i = 0; i < 1000; i++) {
                value = (new org.apache.commons.math.distribution.GammaDistributionImpl(shape, scale)).inverseCumulativeProbability(y);
            }
            value = (new org.apache.commons.math.distribution.GammaDistributionImpl(shape, scale)).inverseCumulativeProbability(y);
        } catch (MathException e) {
            e.printStackTrace();
        }
        long elapsed = System.currentTimeMillis() - time;


        System.out.println("commons.maths inverseCDF, "+ y +", for shape=" + shape + ", scale=" + scale
                + " : " + value + ", time=" + elapsed + "ms");

    }
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:21,代码来源:GammaDistribution.java

示例3: nextPathParameter

import org.apache.commons.math.MathException; //导入方法依赖的package包/类
double nextPathParameter() {
    if (step > pathSteps)
        return -1;
    if (step == 0) {
        step += 1;
        return 1.0;
    } else if (step + 1 < pathSteps) {
        double ratio = (double) step / (double) (pathSteps - 1);
        try {
            step += 1;
            return 1.0 - betaDistribution.inverseCumulativeProbability(ratio);
        } catch (MathException e) {
            e.printStackTrace();
        }
    }
    step += 1;
    return 0.0;
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:19,代码来源:MarginalLikelihoodEstimator.java

示例4: nextBeta

import org.apache.commons.math.MathException; //导入方法依赖的package包/类
static public double nextBeta(double alpha, double beta) {
	BetaDistribution distr = new BetaDistributionImpl(alpha, beta);
	double v = 0;
	try {
		v = distr.inverseCumulativeProbability(Randomizer.nextDouble());
	} catch (MathException e) {
		e.printStackTrace();
	}
	return v;		
}
 
开发者ID:BEAST2-Dev,项目名称:nested-sampling,代码行数:11,代码来源:NSLogAnalyser.java

示例5: drawSample

import org.apache.commons.math.MathException; //导入方法依赖的package包/类
double drawSample()
{
    try {
        return sampler.sample();
    } 
    catch (MathException e) 
    {
        System.err.println("ProbabilityDistribution(" + toString() + ") - drawSample():" + toString() + " Caught MathException:\n");
        e.printStackTrace(System.err);
        throw new Error("ProbabilityDistribution(" + toString() + ") - drawSample(): Caught MathException: " + e.toString());
    }
}
 
开发者ID:LARG,项目名称:TacTex,代码行数:13,代码来源:ProbabilityDistribution.java

示例6: doOperation

import org.apache.commons.math.MathException; //导入方法依赖的package包/类
@Override
	public double doOperation() {

		try {

//			doOperate();
			doOp();

		} catch (MathException e) {
			e.printStackTrace();
		}// END: try-catch block

		return 0.0;
	}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:15,代码来源:DirichletProcessOperator.java

示例7: computePval

import org.apache.commons.math.MathException; //导入方法依赖的package包/类
private double computePval(Strand strand, Context context,
						   ContigBisulfiteError error, int mCCount, int depth) {
	BinomialDistribution binomial = new BinomialDistributionImpl(depth, error.getError(strand, context).getError
			());

	double pval = 1.0;

	try {
		pval = (mCCount == 0) ? 1.0d : (1.0d - binomial.cumulativeProbability(mCCount - 1));
	} catch (MathException e) {
		e.printStackTrace();
		throw new RuntimeException(e);
	}
	return pval;
}
 
开发者ID:sing-group,项目名称:bicycle,代码行数:16,代码来源:ListerMethylationWalker.java


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