本文整理匯總了Java中org.apache.commons.math3.linear.RealMatrix.setColumnVector方法的典型用法代碼示例。如果您正苦於以下問題:Java RealMatrix.setColumnVector方法的具體用法?Java RealMatrix.setColumnVector怎麽用?Java RealMatrix.setColumnVector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.math3.linear.RealMatrix
的用法示例。
在下文中一共展示了RealMatrix.setColumnVector方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: centerKernelMatrix
import org.apache.commons.math3.linear.RealMatrix; //導入方法依賴的package包/類
private static RealMatrix
centerKernelMatrix(final RealMatrix kernelMatrix) {
// get size of kernelMatrix
final int n = kernelMatrix.getRowDimension();
// get mean values for each row/column
final RealVector columnMeans =
MatrixFunctions.columnMeans(kernelMatrix);
final double matrixMean = MatrixFunctions.mean(kernelMatrix);
RealMatrix centeredKernelMatrix = kernelMatrix.copy();
for (int k = 0; k < n; k++) {
centeredKernelMatrix.setRowVector(k,
centeredKernelMatrix.getRowVector(k).subtract(columnMeans));
centeredKernelMatrix.setColumnVector(k, centeredKernelMatrix
.getColumnVector(k).subtract(columnMeans));
}
centeredKernelMatrix = centeredKernelMatrix.scalarAdd(matrixMean);
return centeredKernelMatrix;
}
示例2: makeDataMatrix
import org.apache.commons.math3.linear.RealMatrix; //導入方法依賴的package包/類
private RealMatrix makeDataMatrix(List<double[]> X, double[] meanX) {
if (meanX == null) {
return makeDataMatrix(X);
}
final int m = X.size();
final int n = X.get(0).length;
RealMatrix M = MatrixUtils.createRealMatrix(n, m);
RealVector mean = MatrixUtils.createRealVector(meanX);
int i = 0;
for (double[] x : X) {
RealVector xi = MatrixUtils.createRealVector(x).subtract(mean);
M.setColumnVector(i, xi);
i++;
}
return M;
}
示例3: getTransformationMatrix
import org.apache.commons.math3.linear.RealMatrix; //導入方法依賴的package包/類
@Override
public RealMatrix getTransformationMatrix() {
RealMatrix cR = R.scalarMultiply(c);
RealMatrix M = MatrixUtils.createRealMatrix(n, n + 1);
M.setSubMatrix(cR.getData(), 0, 0);
M.setColumnVector(n, t);
return M;
}