當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。