本文整理汇总了Java中org.jblas.DoubleMatrix.transpose方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleMatrix.transpose方法的具体用法?Java DoubleMatrix.transpose怎么用?Java DoubleMatrix.transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jblas.DoubleMatrix
的用法示例。
在下文中一共展示了DoubleMatrix.transpose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: solve
import org.jblas.DoubleMatrix; //导入方法依赖的package包/类
public void solve(double h0, double h1, int lastPoint, STreeLikelihoodODE stlh) {
tsPointLast = lastPoint;
tsTimes0 = stlh.tsTimes0;
ts = stlh.ts;
StateProbabilities sp = stlh.stateProbabilities;
A0 = sp.getLineageStateSum(); // numStates column vector
sumA0 = A0.sum();
// prepare ql arrays
int k=0;
for(int i = 0; i < numStates; i++) {
for(int j=0; j < numStates; j++) {
if (i==j)
ql0[k] = 1.0;
else
ql0[k] = 0.0;
ql1[k] = 0.0;
k++;
}
}
ql0[k] = ql1[k] = 0.0;
foi.integrate(this, h0, ql0, h1, ql1);
DoubleMatrix Q = new DoubleMatrix(numStates,numStates);
double[] Qdata = Q.data;
for(k=0; k < numStatesSQ; k++) Qdata[k] = ql1[k];
Q.diviRowVector(Q.columnSums()); // normalise columns
logLh = -ql1[numStatesSQ]; // likelihood - negative because it needs to be subtracted
// TODO: check if sign has to be modified in main loop
if (Double.isNaN(logLh)) logLh = Double.NEGATIVE_INFINITY;
// Update state probabilities in Likelihood object
DoubleMatrix Qtrans = Q.transpose();
// Update lineage probabilities
int numExtant = sp.getNumExtant();
sp.mulExtantProbabilities(Qtrans, true);
if (stlh.setMinP) {
sp.setMinP(stlh.minP);
}
// replaces below
//for (int l = 0; l < numExtant; l++) {
// DoubleMatrix probs = (stlh.extantProbs[l]).mmul(Qtrans); // row-vector
// probs.divi(probs.sum()); /* normalise */
// probs.maxi(0.0); /* clamp(0,1) */
// probs.mini(1.0);
// stlh.extantProbs[l] = probs;
//}
ts = null;
return;
}