Swaps the a'th and b'th elements of the specified Row array.
334025
private static void swap(Object[] w, int a, int b) {

        Object t = w[a];

        w[a] = w[b];
        w[b] = t;
    }
1119913
private static void vecswap(Quicksortable q, int a, int b, int n) {
        for (int i = 0; i < n; i++, a++, b++)
            q.swap(a, b);
    }
695101
public void swapElements(int i, int j) {
        if (i != j) {
            double s = get(i);
            set(i, get(j));
            set(j, s);
        }
    }
136209
public static void swap(char[] charArray, int index1, int index2) {
        XORSwap.swap(charArray, index1, charArray, index2);
    }
856382
private static void swap(double[] keys, int[] vals, int j, int i) {
    double td = keys[j];
    keys[j] = keys[i];
    keys[i] = td;
    int ti = vals[j];
    vals[j] = vals[i];
    vals[i] = ti;
  }
1206522
public void swapRows(int r1, int r2)
    {
        int n = columns();
        ItemSupplier s = supplier;
        ItemConsumer c = consumer;
        for (int j = 0; j < n; j++)
        {
            double v = s.get(r1, j);
            c.set(r1, j, s.get(r2, j));
            c.set(r2, j, v);
        }
    }
318685
public static void swapPivot(double[][] source, int diag, double[][] s, double[][] t) {
		// get swap row and col
		int swapRow = diag;
		int swapCol = diag;
		double maxValue = Math.abs(source[diag][diag]);
		int rows = source.length;
		int cols = source[0].length;
		double abs = 0;
		double[] r = null;
		for (int row = diag; row < rows; row++) {
			r = source[row];
			for (int col = diag; col < cols; col++) {
				abs = Math.abs(r[col]);
				if (abs > maxValue) {
					maxValue = abs;
					swapRow = row;
					swapCol = col;
				}
			}
		}

		// swap rows and columns
		if (swapRow != diag) {
			swapRows(source, swapRow, diag);
			swapRows(t, swapRow, diag);
		}
		if (swapCol != diag) {
			swapCols(source, swapCol, diag);
			swapCols(s, swapCol, diag);
		}
	}
867042
private static void swap(Object[] arr, int i, int j) {
		Object tmp = arr[i];
		arr[i] = arr[j];
		arr[j] = tmp;
	}
632848
public static void swapRow(Matrix A, int j, int k)
    {
        swapCol(A, j, k, 0, A.cols());
    }
619565
public static void swapCol(Matrix A, int j, int k)
    {
        swapCol(A, j, k, 0, A.rows());
    }
262135
def swap_across(idx, idy, mat_a, mat_r, perm):
    """"""
    # Temporary permutation matrix for swaping 2 rows or columns.
    size = mat_a.shape[0]
    perm_new = numpy.eye(size, dtype=int)

    # Modify the permutation matrix perm by swaping columns.
    perm_row = 1.0*perm[:, idx]
    perm[:, idx] = perm[:, idy]
    perm[:, idy] = perm_row

    # Modify the permutation matrix p by swaping rows (same as
    # columns because p = pT).
    row_p = 1.0 * perm_new[idx]
    perm_new[idx] = perm_new[idy]
    perm_new[idy] = row_p

    # Permute mat_a and r (p = pT).
    mat_a = numpy.dot(perm_new, numpy.dot(mat_a, perm_new))
    mat_r = numpy.dot(mat_r, perm_new)
    return mat_a, mat_r, perm
726191
protected void swap(int i, int j) {
        byte[] ltemp = ranges[i];
        ranges[i] = ranges[j];
        ranges[j] = ltemp;

        String tempFilename = filenames[i];
        filenames[i] = filenames[j];
        filenames[j] = tempFilename;
    }
39477
function swap(arr, i1, i2) {
  const tmp = arr[i1];
  arr[i1] = arr[i2];
  arr[i2] = tmp;
}
1117301
public void swap(int i, int j) {
    checkBounds(i);
    checkBounds(j);

    if (i == j)
      return;

    copier.copy(tmp, offset(i));
    unsafe.copyMemory(null, offset(j), null, offset(i), elementSpacing);
    unsafe.copyMemory(tmp, firstFieldOffset, null, offset(j), elementSize);
  }
155271
private static final <T> void swap(List<T> data, int a, int b) {
    data.set(b, data.set(a, data.get(b)));
  }
813598
public static <T> void swap(T[] arr, int a, int b) {
		if (a < 0 || a > arr.length || b < 0 || b > arr.length)
			throw new IllegalArgumentException("swap position out of bounds.");
		if (a != b) {
			T t = arr[a];
			arr[a] = arr[b];
			arr[b] = t;
		}
	}
634154
public static <T> void shuffleArray(T[] arr) {
		for (int i = arr.length; i > 1; i--)
			swap(arr, i - 1, rand.nextInt(i));
	}