本文整理汇总了Java中org.jblas.DoubleMatrix.min方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleMatrix.min方法的具体用法?Java DoubleMatrix.min怎么用?Java DoubleMatrix.min使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jblas.DoubleMatrix
的用法示例。
在下文中一共展示了DoubleMatrix.min方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateLineProbs
import org.jblas.DoubleMatrix; //导入方法依赖的package包/类
protected boolean updateLineProbs(int tsPoint, double dt) {
DoubleMatrix A = stateProbabilities.getLineageStateSum();
DoubleMatrix Y = ts.getYs()[tsPoint];
DoubleMatrix F = ts.getFs()[tsPoint];
DoubleMatrix G = ts.getGs()[tsPoint];
DoubleMatrix mul = Y.sub(A).div(Y);
/*
* (before: If there is more state probability in a deme than individuals
* return the false flag indicating an error)
* Fix coefficient to [0,1] range
*/
if(mul.min()<0 || mul.max() > 1) {
//System.out.println("Y<A t: "+t+" Y "+Y+" A: "+A+" -- fixing --");
for(int i=0; i < mul.length; i++) {
final double v = mul.get(i);
if (v < 0.0) { mul.put(i, 0.0); }
if (v > 1.0) { mul.put(i, 1.0); }
}
}
if (Double.isNaN(mul.get(0)))
{ System.out.println("NaN"); return true; }
DoubleMatrix QT = computeQTrans(Y, F, G, mul);
// dP(i)/dt = Q*Pi , i lineage, Pi column vector
// dP(i)/dt = Pi*QT, QT=trans(Q); Pi,dPi row vectors
// transposed version more efficient due to jblas column-major layout
// We need the state probabilities as row vectors
/* Compute lineage probabilities */
DoubleMatrix newP = matrixExponential(QT, dt);
// Update extant probabilities: p*Q
stateProbabilities.mulExtantProbabilities(newP, true);
return false;
}