SingularValueDecomposition rrsvd = new SingularValueDecomposition(rrmul); // RS' = U \Sigma V' double[] sval = rrsvd.getSingularValues(); // get singular values as double array
/** Singular Value Decomposition @return SingularValueDecomposition @see SingularValueDecomposition */ public SingularValueDecomposition svd () { return new SingularValueDecomposition(this); }
/** Two norm @return maximum singular value. */ public double norm2 () { return (new SingularValueDecomposition(this).norm2()); }
/** Matrix condition (2 norm) @return ratio of largest to smallest singular value. */ public double cond () { return new SingularValueDecomposition(this).cond(); }
/** Matrix rank @return effective numerical rank, obtained from SVD. */ public int rank () { return new SingularValueDecomposition(this).rank(); }
public static SingularValueDecomposition singular(double[][] v) { return new SingularValueDecomposition(new Matrix(v)); }
private void setup(boolean brute) { if (brute) { this.mode = new ConvolveMode.BruteForce(this.kernel); return; } if (this.kernel.width == 1 || this.kernel.height == 1) { this.mode = new ConvolveMode.OneD(kernel); } else { final SingularValueDecomposition svd = new SingularValueDecomposition( MatrixUtils.matrixFromFloat(this.kernel.pixels)); if (svd.rank() == 1) this.mode = new ConvolveMode.Separable(svd); else this.mode = new ConvolveMode.BruteForce(this.kernel); } }
private void setup(boolean brute) { if (brute) { this.mode = new ConvolveMode.BruteForce(this.kernel); return; } if (this.kernel.width == 1 || this.kernel.height == 1) { this.mode = new ConvolveMode.OneD(kernel); } else { final SingularValueDecomposition svd = new SingularValueDecomposition( MatrixUtils.matrixFromFloat(this.kernel.pixels)); if (svd.rank() == 1) this.mode = new ConvolveMode.Separable(svd); else this.mode = new ConvolveMode.BruteForce(this.kernel); } }
public static void computePrincipalMomentsOfInertia(Matrix inertiaForSVD, Matrix3d principalAxesRotationToPack, Vector3d principalMomentsOfInertiaToPack) { // Decompose Inertia Matrix: I = U*sigma*V SingularValueDecomposition inertiaSVD = new SingularValueDecomposition(inertiaForSVD); Matrix sigma = inertiaSVD.getS(); // Matrix U = inertiaSVD.getU(); Matrix V = inertiaSVD.getV(); // If determinant is -1.0, then multiply V by -1. Since I = U*sigma*U_Transpose, then I = (-U) * sigma * (-U_Transpose) double determinant = V.det(); if (determinant < 0.0) { V = V.times(-1.0); determinant = -determinant; } if (Math.abs(determinant - 1.0) > 1e-5) { throw new RuntimeException("Problem in Link.addEllipsoidFromMassProperties(). Determinant should be 1.0"); } principalMomentsOfInertiaToPack.set(sigma.get(0, 0), sigma.get(1, 1), sigma.get(2, 2)); principalAxesRotationToPack.set(V.getRowPackedCopy()); }
public Matrix[] svd() { if (getColumnCount() > getRowCount()) { SingularValueDecomposition svd = new SingularValueDecomposition(matrix.transpose()); Matrix u = new JamaDenseDoubleMatrix2D(svd.getV()); Matrix s = new JamaDenseDoubleMatrix2D(svd.getS().transpose()); Matrix v = new JamaDenseDoubleMatrix2D(svd.getU()); return new Matrix[] { u, s, v }; } else { SingularValueDecomposition svd = new SingularValueDecomposition(matrix); Matrix u = new JamaDenseDoubleMatrix2D(svd.getU()); Matrix s = new JamaDenseDoubleMatrix2D(svd.getS()); Matrix v = new JamaDenseDoubleMatrix2D(svd.getV()); return new Matrix[] { u, s, v }; } }
public Matrix[] svd() { if (getColumnCount() > getRowCount()) { SingularValueDecomposition svd = new SingularValueDecomposition(matrix.transpose()); Matrix u = new JamaDenseDoubleMatrix2D(svd.getV()); Matrix s = new JamaDenseDoubleMatrix2D(svd.getS().transpose()); Matrix v = new JamaDenseDoubleMatrix2D(svd.getU()); return new Matrix[] { u, s, v }; } else { SingularValueDecomposition svd = new SingularValueDecomposition(matrix); Matrix u = new JamaDenseDoubleMatrix2D(svd.getU()); Matrix s = new JamaDenseDoubleMatrix2D(svd.getS()); Matrix v = new JamaDenseDoubleMatrix2D(svd.getV()); return new Matrix[] { u, s, v }; } }
this.cog = cog; Matrix covm = new Matrix(cov); svd = new SingularValueDecomposition(covm); s = svd.getSingularValues(); rang = svd.rank();
private SingularValueDecomposition svd() { // create the matrix Matrix matrix = new Matrix(3, 3); matrix.set(0, 0, this.Ixx); matrix.set(0, 1, this.Ixy); matrix.set(0, 2, this.Ixz); matrix.set(1, 0, this.Ixy); matrix.set(1, 1, this.Iyy); matrix.set(1, 2, this.Iyz); matrix.set(2, 0, this.Ixz); matrix.set(2, 1, this.Iyz); matrix.set(2, 2, this.Izz); // Extract singular values return new SingularValueDecomposition(matrix); } }
SingularValueDecomposition rrsvd = new SingularValueDecomposition(rrmul); // RS' = U \Sigma V' double[] sval = rrsvd.getSingularValues(); // get singular values as double array
final SingularValueDecomposition svd = new SingularValueDecomposition( mA ); final Matrix s = svd.getS(); final Matrix v = svd.getV();
final SingularValueDecomposition svd = new SingularValueDecomposition( mA ); final Matrix s = svd.getS(); final Matrix v = svd.getV();
final SingularValueDecomposition svd = new SingularValueDecomposition( M );