当前位置: 首页>>代码示例>>Java>>正文


Java DenseMatrix64F.unsafe_set方法代码示例

本文整理汇总了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;
        }
    }
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:20,代码来源:MissingOps.java

示例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);
        }
    }
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:20,代码来源:IntegratedFactorAnalysisLikelihood.java

示例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);
        }
    }
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:9,代码来源:IntegratedFactorAnalysisLikelihood.java

示例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);
    }
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:7,代码来源:MissingOps.java


注:本文中的org.ejml.data.DenseMatrix64F.unsafe_set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。