/** * Returns a copy of the pivot permutation vector. * * @return piv */ public int[] getPivot() { return quick.getPivot().clone(); }
/** * Returns a copy of the pivot permutation vector. * * @return piv */ public int[] getPivot() { return quick.getPivot().clone(); }
buf.append(String.valueOf(new cern.colt.list.tint.IntArrayList(this.getPivot()))); } catch (IllegalArgumentException exc) { buf.append(unknown + exc.getMessage());
buf.append(String.valueOf(new cern.colt.list.tint.IntArrayList(this.getPivot()))); } catch (IllegalArgumentException exc) { buf.append(unknown + exc.getMessage());
@Override public long process(BenchmarkMatrix[] inputs, BenchmarkMatrix[] outputs, long numTrials) { DoubleMatrix2D matA = inputs[0].getOriginal(); // the recommended way I think would be using Algebra, but this might allow // reuse of data DenseDoubleLUDecompositionQuick decomp = new DenseDoubleLUDecompositionQuick(); DoubleMatrix2D tmp = createMatrix(matA.rows(),matA.columns()); DoubleMatrix2D L = null; DoubleMatrix2D U = null; int[] pivot = null; long prev = System.nanoTime(); for( long i = 0; i < numTrials; i++ ) { // input matrix is overwritten tmp.assign(matA); decomp.decompose(tmp); if( !decomp.isNonsingular() ) throw new DetectedException("LU decomposition failed"); L = decomp.getL(); U = decomp.getU(); pivot = decomp.getPivot(); } long elapsedTime = System.nanoTime()-prev; if( outputs != null ) { outputs[0] = new PColtBenchmarkMatrix(L); outputs[1] = new PColtBenchmarkMatrix(U); outputs[2] = new RowMajorBenchmarkMatrix(RowMajorOps.pivotMatrix(null, pivot, pivot.length, false)); } return elapsedTime; } }