/** * Swaps indexes i and j. This does both row and column permutation. * * @param i First index to swap. * @param j Second index to swap. */ public void swap(int i, int j) { swapRows(i, j); swapColumns(i, j); }
@Override public Matrix matrixFactory(double[][] values) { Matrix base = new DenseMatrix(values); // for general tests, we just make a scrambled matrix and fill it // with the standard data. Then we can test the details of the // row and/or column swapping separately. PivotedMatrix pm = new PivotedMatrix(base.like()); pm.swap(0, 1); pm.swapRows(1, 2); pm.assign(base); return pm; }
/** * Swaps indexes i and j. This does both row and column permutation. * * @param i First index to swap. * @param j Second index to swap. */ public void swap(int i, int j) { swapRows(i, j); swapColumns(i, j); }
/** * Swaps indexes i and j. This does both row and column permutation. * * @param i First index to swap. * @param j Second index to swap. */ public void swap(int i, int j) { swapRows(i, j); swapColumns(i, j); }
@Override public Matrix matrixFactory(double[][] values) { Matrix base = new DenseMatrix(values); // for general tests, we just make a scrambled matrix and fill it // with the standard data. Then we can test the details of the // row and/or column swapping separately. PivotedMatrix pm = new PivotedMatrix(base.like()); pm.swap(0, 1); pm.swapRows(1, 2); pm.assign(base); return pm; }