cern.colt.matrix.linalg.Algebra.permute()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中cern.colt.matrix.linalg.Algebra.permute()方法的一些代码示例,展示了Algebra.permute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Algebra.permute()方法的具体详情如下:
包路径:cern.colt.matrix.linalg.Algebra
类名称:Algebra
方法名:permute

Algebra.permute介绍

[英]Modifies the given vector A such that it is permuted as specified; Useful for pivoting. Cell A[i] will go into cell A[indexes[i]].

Example:

Reordering 
[A,B,C,D,E] with indexes [0,4,2,3,1] yields  
[A,E,C,D,B] 
In other words A[0]

[中]修改给定向量A,使其按指定方式排列;用于旋转。单元格A[i]将进入单元格A[index[i]]。
例子:

Reordering 
[A,B,C,D,E] with indexes [0,4,2,3,1] yields  
[A,E,C,D,B] 
In other words A[0]

代码示例

代码示例来源:origin: com.github.vincentk/joptimizer

public static final DoubleMatrix2D symmPermutation(DoubleMatrix2D A, int from, int to){
  int n = A.rows();
  int[] rowIndexes = new int[n];
  int[] columnIndexes = new int[n];
  for(int i=0; i<n; i++){
    rowIndexes[i] = i;
    columnIndexes[i] = i;
  }
  rowIndexes[from] = to;
  rowIndexes[to] = from;
  columnIndexes[from] = to;
  columnIndexes[to] = from;
  return Algebra.DEFAULT.permute(A, rowIndexes, columnIndexes);
}

代码示例来源:origin: blazegraph/database

if (columns < size/10) { // quicker
  double[] doubleWork = new double[size];
  for (int j=A.columns(); --j >= 0; ) permute(A.viewColumn(j), indexes, doubleWork);
  return A;

代码示例来源:origin: com.blazegraph/colt

if (columns < size/10) { // quicker
  double[] doubleWork = new double[size];
  for (int j=A.columns(); --j >= 0; ) permute(A.viewColumn(j), indexes, doubleWork);
  return A;

代码示例来源:origin: blazegraph/database

algebra.permute(B, this.piv, this.workDouble);

代码示例来源:origin: com.blazegraph/colt

algebra.permute(B, this.piv, this.workDouble);

相关文章