本文整理汇总了Java中org.ejml.data.DenseMatrix64F.unsafe_get方法的典型用法代码示例。如果您正苦于以下问题:Java DenseMatrix64F.unsafe_get方法的具体用法?Java DenseMatrix64F.unsafe_get怎么用?Java DenseMatrix64F.unsafe_get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ejml.data.DenseMatrix64F
的用法示例。
在下文中一共展示了DenseMatrix64F.unsafe_get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: gatherRowsAndColumns
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static void gatherRowsAndColumns(final DenseMatrix64F source, final DenseMatrix64F destination,
final int[] rowIndices, final int[] colIndices) {
final int rowLength = rowIndices.length;
final int colLength = colIndices.length;
final double[] out = destination.getData();
int index = 0;
for (int i = 0; i < rowLength; ++i) {
final int rowIndex = rowIndices[i];
for (int j = 0; j < colLength; ++j) {
out[index] = source.unsafe_get(rowIndex, colIndices[j]);
++index;
}
}
}
示例2: countFiniteDiagonals
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static int countFiniteDiagonals(DenseMatrix64F source) {
final int length = source.getNumCols();
int count = 0;
for (int i = 0; i < length; ++i) {
final double d = source.unsafe_get(i, i);
if (!Double.isInfinite(d)) {
++count;
}
}
return count;
}
示例3: countZeroDiagonals
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static int countZeroDiagonals(DenseMatrix64F source) {
final int length = source.getNumCols();
int count = 0;
for (int i = 0; i < length; ++i) {
final double d = source.unsafe_get(i, i);
if (d == 0.0) {
++count;
}
}
return count;
}
示例4: getFiniteDiagonalIndices
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static void getFiniteDiagonalIndices(final DenseMatrix64F source, final int[] indices) {
final int length = source.getNumCols();
int index = 0;
for (int i = 0; i < length; ++i) {
final double d = source.unsafe_get(i, i);
if (!Double.isInfinite(d)) {
indices[index] = i;
++index;
}
}
}
示例5: countFiniteNonZeroDiagonals
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static int countFiniteNonZeroDiagonals(DenseMatrix64F source) {
final int length = source.getNumCols();
int count = 0;
for (int i = 0; i < length; ++i) {
final double d = source.unsafe_get(i, i);
if (!Double.isInfinite(d) && d != 0.0) {
++count;
}
}
return count;
}
示例6: getFiniteNonZeroDiagonalIndices
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
public static void getFiniteNonZeroDiagonalIndices(final DenseMatrix64F source, final int[] indices) {
final int length = source.getNumCols();
int index = 0;
for (int i = 0; i < length; ++i) {
final double d = source.unsafe_get(i, i);
if (!Double.isInfinite(d) && d != 0.0) {
indices[index] = i;
++index;
}
}
}
示例7: computeFactorInnerProduct
import org.ejml.data.DenseMatrix64F; //导入方法依赖的package包/类
private double computeFactorInnerProduct(final WrappedVector mean, final DenseMatrix64F precision) {
// Compute \mu_i^t P_i \mu^t
double sum = 0;
for (int row = 0; row < numFactors; ++row) {
for (int col = 0; col < numFactors; ++col) {
sum += mean.get(row) * precision.unsafe_get(row, col) * mean.get(col);
}
}
return sum;
}