本文整理汇总了Java中org.ejml.data.DenseMatrix64F.unsafe_set方法的典型用法代码示例。如果您正苦于以下问题:Java DenseMatrix64F.unsafe_set方法的具体用法?Java DenseMatrix64F.unsafe_set怎么用?Java DenseMatrix64F.unsafe_set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ejml.data.DenseMatrix64F
的用法示例。
在下文中一共展示了DenseMatrix64F.unsafe_set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scatterRowsAndColumns
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static void scatterRowsAndColumns(final DenseMatrix64F source, final DenseMatrix64F destination,
final int[] rowIdices, final int[] colIndices, final boolean clear) {
if (clear) {
Arrays.fill(destination.getData(), 0.0);
}
final int rowLength = rowIdices.length;
final int colLength = colIndices.length;
final double[] in = source.getData();
int index = 0;
for (int i = 0; i < rowLength; ++i) {
final int rowIndex = rowIdices[i];
for (int j = 0; j < colLength; ++j) {
destination.unsafe_set(rowIndex, colIndices[j], in[index]);
++index;
}
}
}
示例2: computePrecisionForTaxon
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
private void computePrecisionForTaxon(final DenseMatrix64F precision, final int taxon,
final int numFactors) {
final double[] observed = observedIndicators[taxon];
// Compute L D_i \Gamma D_i^t L^t // TODO Generalize for non-diagonal \Gamma
for (int row = 0; row < numFactors; ++row) {
for (int col = 0; col < numFactors; ++col) {
double sum = 0;
for (int k = 0; k < dimTrait; ++k) {
double thisPrecision = (observed[k] == 1.0) ? traitPrecision.getParameterValue(k) : nuggetPrecision;
sum += loadings.getParameterValue(k, row) *
thisPrecision *
loadings.getParameterValue(k, col);
}
precision.unsafe_set(row, col, sum);
}
}
}
示例3: makeCompletedUnobserved
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
private void makeCompletedUnobserved(final DenseMatrix64F matrix, double diagonal) {
for (int row = 0; row < numFactors; ++row) {
for (int col = 0; col < numFactors; ++col) {
double x = (row == col) ? diagonal : 0.0;
matrix.unsafe_set(row, col, x);
}
}
}
示例4: addToDiagonal
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static void addToDiagonal(DenseMatrix64F source, double increment) {
final int width = source.getNumRows();
for (int i = 0; i < width; ++i) {
source.unsafe_set(i,i, source.unsafe_get(i, i) + increment);
}
}