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