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

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

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

Algebra.transpose介绍

[英]Constructs and returns a new view which is the transposition of the given matrix A. Equivalent to DoubleMatrix2D#viewDice. This is a zero-copy transposition, taking O(1), i.e. constant time. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa. Use idioms like result = transpose(A).copy() to generate an independent matrix.

Example:

2 x 3 matrix:
1, 2, 3
4, 5, 6 transpose ==>3 x 2 matrix:
1, 4
2, 5
3, 6transpose ==>2 x 3 matrix:
1, 2, 3
4, 5, 6
[中]构造并返回一个新视图,该视图是给定矩阵a的换位。相当于DoubleMatrix2D#viewDice。这是一个零拷贝转置,取O(1),即恒定时间。此矩阵支持返回的视图,因此返回视图中的更改将反映在此矩阵中,反之亦然。使用习惯用法,如result=transpose(A)。copy()生成一个独立的矩阵。
例子:
2 x 3矩阵:
1, 2, 3
4,5,6转置==>3 x 2矩阵:
1, 4
2, 5
3,6传输==>2 x 3矩阵:
1, 2, 3
4, 5, 6

代码示例

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

public void setAMatrix(DoubleMatrix2D AMatrix) {
  this.A = AMatrix;
  this.AT = ALG.transpose(A);
}

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

public DoubleMatrix2D getLT() {
  if(this.rescaler==null){
    return ALG.transpose(this.L);
  }
  //@TODO: implement this
  throw new RuntimeException("not yet implemented");
}

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

/**
 * Solves X*A = B, which is also A'*X' = B'.
 * @return X; a new independent matrix; solution if A is square, least squares solution otherwise.
 */
public DoubleMatrix2D solveTranspose(DoubleMatrix2D A, DoubleMatrix2D B) {
  return solve(transpose(A), transpose(B));
}
/**

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

/**
 * Solves X*A = B, which is also A'*X' = B'.
 * @return X; a new independent matrix; solution if A is square, least squares solution otherwise.
 */
public DoubleMatrix2D solveTranspose(DoubleMatrix2D A, DoubleMatrix2D B) {
  return solve(transpose(A), transpose(B));
}
/**

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

public DoubleMatrix2D getLT() {
  if(this.LT == null){
    this.LT = ALG.transpose(getL());
  }
  return this.LT;
}

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

public DoubleMatrix2D getLT() {
  if(this.LT == null){
    this.LT = ALG.transpose(getL());
  }
  return this.LT;
}

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

public DoubleMatrix2D getLT() {
  if(this.LT == null){
    this.LT = ALG.transpose(getL());
  }
  return this.LT;
}

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

public DoubleMatrix2D getL() {
  if(this.L == null){
    this.L = ALG.transpose(getLT());
  }
  return this.L;
}

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

public DoubleMatrix2D getLT() {
  if(this.LT == null){
    this.LT = ALG.transpose(getL());
  }
  return this.LT;
}

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

public DoubleMatrix2D getLT() {
    if(this.LT == null){
      this.LT = ALG.transpose(getL());
    }
    return this.LT;
  }
}

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

protected final DoubleMatrix2D getAT() {
  if(AT==null && getA()!=null){
    AT = ALG.transpose(getA());
  }
  return AT;
}

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

/**
 * @TODO: check this!!!
 * @see "http://mathworld.wolfram.com/PositiveDefiniteMatrix.html"
 */
public static DoubleMatrix2D randomValuesPositiveMatrix(int rows, int cols, double min, double max, Long seed) {
  DoubleMatrix2D Q = Utils.randomValuesMatrix(rows, cols, min, max, seed);
  DoubleMatrix2D P = Algebra.DEFAULT.mult(Q, Algebra.DEFAULT.transpose(Q.copy()));
return Algebra.DEFAULT.mult(P, P);
}

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

/**
 * A representation of a posynomial (1) in the form (2).
 * @param akArray the matrix (a[1,k],..,a[n,k]) in expression (2)
 * @param bkArray the vector b[k] in expression (2)
 */
public LogTransformedPosynomial(double[][] akArray, double[] bkArray){
  this.A = DoubleFactory2D.dense.make(akArray);
  this.b = DoubleFactory1D.dense.make(bkArray);
  if(A.rows() != b.size()){
    throw new IllegalArgumentException("Impossible to create the function");
  }
  ALG.transpose(A);
  this.dim = A.columns();
}

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

transposeMatrix     = Algebra.DEFAULT.transpose (patternMatrix);
QMatrix             = Algebra.DEFAULT.mult (transposeMatrix,patternMatrix);
inverseQMatrix      = Algebra.DEFAULT.inverse (QMatrix);

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

transposeMatrix     = Algebra.DEFAULT.transpose (patternMatrix);
QMatrix             = Algebra.DEFAULT.mult (transposeMatrix,patternMatrix);
inverseQMatrix      = Algebra.DEFAULT.inverse (QMatrix);

代码示例来源:origin: cmu-phil/tetrad

private static double norm2(DoubleMatrix2D mat){
  //return Math.sqrt(mat.copy().assign(Functions.pow(2)).zSum());
  Algebra al = new Algebra();
  //norm found by svd so we need rows >= cols
  if(mat.rows() < mat.columns()){
    return al.norm2(al.transpose(mat));
  }
  return al.norm2(mat);
}

代码示例来源:origin: cmu-phil/tetrad

outMat.viewPart(0,0,p,p).assign(params.beta.copy().assign(alg.transpose(params.beta), Functions.plus));

代码示例来源:origin: cmu-phil/tetrad

DoubleMatrix2D Zt = new Algebra().transpose(Z);
DoubleMatrix2D ZtZ = new Algebra().mult(Zt, Z);
DoubleMatrix2D G = new DenseDoubleMatrix2D(new TetradMatrix(ZtZ.toArray()).inverse().toArray());

代码示例来源:origin: cmu-phil/tetrad

DoubleMatrix2D Zt = new Algebra().transpose(Z);
DoubleMatrix2D ZtZ = new Algebra().mult(Zt, Z);
DoubleMatrix2D G = new DenseDoubleMatrix2D(new TetradMatrix(ZtZ.toArray()).inverse().toArray());

代码示例来源:origin: TACIXAT/CFGScanDroid

signatureSelector.set(0, i, 1.0);
DoubleMatrix2D signatureNodeParentVector = Algebra.DEFAULT.mult(signatureSelector, Algebra.DEFAULT.transpose(signatureAdjacencyMatrix));
  functionSelector.set(0, j, 1.0);
  DoubleMatrix2D functionNodeParentVector = Algebra.DEFAULT.mult(functionSelector, Algebra.DEFAULT.transpose(functionAdjacencyMatrix));

相关文章