Here you can find the source of shiftOnRow(double[][] d, int q)
public static double[][] shiftOnRow(double[][] d, int q)
//package com.java2s; //License from project: Open Source License public class Main { public static double[][] shiftOnRow(double[][] d, int q) { double[][] ret = new double[d.length][d[0].length]; if (q >= 0) { for (int i = 0; i < d.length; i++) { for (int j = q; j < d[0].length; j++) { ret[i][j] = d[i][j - q]; }/*from w w w . j a va 2 s . c om*/ } } else { for (int i = 0; i < d.length; i++) { for (int j = 0; j < d[0].length + q; j++) { ret[i][j] = d[i][j - q]; } } } return ret; } }