本文整理匯總了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;
}