code: public static double[] singularValues( DMatrixRMaj A ) {
          SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(A.numRows,A.numCols,false,true,true);
  
          if( svd.inputModified() ) {
              A = A.copy();
          }
          if( !svd.decompose(A)) {
              throw new RuntimeException("SVD Failed!");
          }
  
          double sv[] = svd.getSingularValues();
          Arrays.sort(sv,0,svd.numberOfSingularValues());
  
          // change the ordering to ascending
          for (int i = 0; i < sv.length/2; i++) {
              double tmp = sv[i];
              sv[i] = sv[sv.length-i-1];
              sv[sv.length-i-1] = tmp;
          }
  
          return sv;
      }
docs: Returns an array of all the singular values in A sorted in ascending order
  
  @param A Matrix. Not modified.
  @return singular values