/** * Gets the matrix V of the decomposition. * V is an orthogonal matrix, i.e. its transpose is also its inverse. * The columns of V are the eigenvectors of the original matrix. * No assumption is made about the orientation of the system axes formed * by the columns of V (e.g. in a 3-dimension space, V can form a left- * or right-handed system). * * @return the V matrix. */ public RealMatrix getV() { if (cachedV == null) { final int m = eigenvectors.length; cachedV = MatrixUtils.createRealMatrix(m, m); for (int k = 0; k < m; ++k) { cachedV.setColumnVector(k, eigenvectors[k]); } } // return the cached matrix return cachedV; }
userFeatures.setColumnVector(f, uvec); assert Math.abs(userFeatures.getColumnVector(f).getL1Norm() - uvec.getL1Norm()) < 1.0e-4 : "user column sum matches"; itemFeatures.setColumnVector(f, ivec); assert Math.abs(itemFeatures.getColumnVector(f).getL1Norm() - ivec.getL1Norm()) < 1.0e-4 : "item column sum matches";
/** * Gets the matrix V of the decomposition. * V is an orthogonal matrix, i.e. its transpose is also its inverse. * The columns of V are the eigenvectors of the original matrix. * No assumption is made about the orientation of the system axes formed * by the columns of V (e.g. in a 3-dimension space, V can form a left- * or right-handed system). * * @return the V matrix. */ public RealMatrix getV() { if (cachedV == null) { final int m = eigenvectors.length; cachedV = MatrixUtils.createRealMatrix(m, m); for (int k = 0; k < m; ++k) { cachedV.setColumnVector(k, eigenvectors[k]); } } // return the cached matrix return cachedV; }
/** * Gets the matrix V of the decomposition. * V is an orthogonal matrix, i.e. its transpose is also its inverse. * The columns of V are the eigenvectors of the original matrix. * No assumption is made about the orientation of the system axes formed * by the columns of V (e.g. in a 3-dimension space, V can form a left- * or right-handed system). * * @return the V matrix. */ public RealMatrix getV() { if (cachedV == null) { final int m = eigenvectors.length; cachedV = MatrixUtils.createRealMatrix(m, m); for (int k = 0; k < m; ++k) { cachedV.setColumnVector(k, eigenvectors[k]); } } // return the cached matrix return cachedV; }
/** * Gets the matrix V of the decomposition. * V is an orthogonal matrix, i.e. its transpose is also its inverse. * The columns of V are the eigenvectors of the original matrix. * No assumption is made about the orientation of the system axes formed * by the columns of V (e.g. in a 3-dimension space, V can form a left- * or right-handed system). * * @return the V matrix. */ public RealMatrix getV() { if (cachedV == null) { final int m = eigenvectors.length; cachedV = MatrixUtils.createRealMatrix(m, m); for (int k = 0; k < m; ++k) { cachedV.setColumnVector(k, eigenvectors[k]); } } // return the cached matrix return cachedV; }
userFeatures.setColumnVector(f, uvec); assert Math.abs(userFeatures.getColumnVector(f).getL1Norm() - uvec.getL1Norm()) < 1.0e-4 : "user column sum matches"; itemFeatures.setColumnVector(f, ivec); assert Math.abs(itemFeatures.getColumnVector(f).getL1Norm() - ivec.getL1Norm()) < 1.0e-4 : "item column sum matches";
private RealMatrix buildJ(SOCPConstraintParameters param, RealVector X){ RealMatrix J = new Array2DRowRealMatrix(dim, param.getA().getRowDimension()+1); J.setSubMatrix(param.getA().transpose().getData(), 0, 0); J.setColumnVector(param.getA().getRowDimension(), param.getC()); return J; }