Repeat elements <code>rowRepeats</code> times in row direction and <code>colRepeats</code> times in column direction.

@param rowRepeats
@param colRepeats
@return a new matrix
@see IntMatrix#repelem(int, int)
508465
@Override
    public FloatMatrix repelem(final int rowRepeats, final int colRepeats) {
        N.checkArgument(rowRepeats > 0 && colRepeats > 0, "rowRepeats=%s and colRepeats=%s must be bigger than 0", rowRepeats, colRepeats);

        final float[][] c = new float[rows * rowRepeats][cols * colRepeats];

        for (int i = 0; i < rows; i++) {
            final float[] fr = c[i * rowRepeats];

            for (int j = 0; j < cols; j++) {
                N.copy(Array.repeat(a[i][j], colRepeats), 0, fr, j * colRepeats, colRepeats);
            }

            for (int k = 1; k < rowRepeats; k++) {
                N.copy(fr, 0, c[i * rowRepeats + k], 0, fr.length);
            }
        }

        return new FloatMatrix(c);
    }
1200683
public void reshape(int newrows, int newcolumns) {
        if (((newrows == rows) && (newcolumns == columns)) || (newrows <= 0) || (newcolumns <= 0)) return;

        double[][] newrealmatrix = new double[newrows][newcolumns];
        double[][] newimagmatrix = new double[newrows][newcolumns];
        int minrows = Math.min(rows, newrows);
        int mincolumns = Math.min(columns, newcolumns);
        int i, j;
        for (i = 0; i < minrows; i++)
            for (j = 0; j < mincolumns; j++) {
                newrealmatrix[i][j] = realmatrix[i][j];
                newimagmatrix[i][j] = imagmatrix[i][j];
            }

        for (i = minrows; i < newrows; i++)
            for (j = 0; j < mincolumns; j++) {
                newrealmatrix[i][j] = 0d;
                newimagmatrix[i][j] = 0d;
            }

        for (i = 0; i < minrows; i++)
            for (j = mincolumns; j < newcolumns; j++) {
                newrealmatrix[i][j] = 0d;
                newimagmatrix[i][j] = 0d;
            }

        for (i = minrows; i < newrows; i++)
            for (j = mincolumns; j < newcolumns; j++) {
                newrealmatrix[i][j] = 0d;
                newimagmatrix[i][j] = 0d;
            }

        realmatrix = newrealmatrix;
        imagmatrix = newimagmatrix;
        rows = newrows;
        columns = newcolumns;
    }
496746
private Matrix<Double> generateRandomMatrix(final int nRows, final int nColumns) {
    final List<List<Double>> rows = new ArrayList<>(nRows);
    final Random random = new Random();
    for (int i = 0; i < nRows; i++) {
      final List<Double> row = new ArrayList<>(nColumns);
      for (int j = 0; j < nColumns; j++) {
        row.add(random.nextDouble());
      }
      rows.add(row);
    }
    return new RowMatrix(rows);
  }
926088
public static String repeatString( String pattern, int repeats )
    {
        StringBuilder buffer = new StringBuilder( pattern.length() * repeats );
        for( int i = 0; i < repeats; i++ )
        {
            buffer.append( pattern );
        }

        return new String( buffer );
    }
445042
public static DoubleMatrix getInstance(int rows, int cols, ItemSupplier s)
    {
        DoubleMatrix m = new DoubleMatrix(rows, cols);
        ItemConsumer c = m.consumer;
        for (int i = 0; i < rows; i++)
        {
            for (int j = 0; j < cols; j++)
            {
                c.set(i, j, s.get(i, j));
            }
        }
        return m;
    }
825419
def repeat(obj, times=None):
    """"""
    if times is None:

        return AsyncIterWrapper(sync_itertools.repeat(obj))

    return AsyncIterWrapper(sync_itertools.repeat(obj, times))
74443
public static Matrix createMatrix(int rowCount, int colCount) {
		if (rowCount<=0 || colCount<=0) throw new IllegalArgumentException();
		if (colCount==1)
			return createVector(rowCount);
		else if (rowCount==2 && colCount==2)
			return createMatrix2();
		else if (rowCount==3 && colCount==3)
			return createMatrix3();
		else
			return new MatrixImpl(rowCount, colCount);
	}
396278
public static <T> ImmutableList<T> asUniquedList(Iterable<T> items) {
    return ImmutableSet.copyOf(items).asList();
  }
311030
public static <T extends SparseDoubleVector> SparseMatrix asSparseMatrix(
            List<T> vectors, int columns) {
        return new SparseListMatrix<T>(vectors, columns);
    }
1202890
public static List<String> getRepeat(List<String> list) {
        List<String> rtn = new ArrayList<>();
        Set<String> idSet = new HashSet<>();

        for (String id : list) {
            if (idSet.contains(id)) {
                rtn.add(id);
            } else {
                idSet.add(id);
            }
        }

        return rtn;
    }
18573
public Matrix4d getRepeatTransform(int repeat){

		Matrix4d transform = new Matrix4d();
		transform.setIdentity();

		int[] counts = getAxisCounts(repeat);

		for(int t = counts.length-1; t>=0; t--) {
			if( counts[t] == 0 )
				continue;
			Matrix4d axis = new Matrix4d(axes.get(t).getOperator());
			for(int i=0;i<counts[t];i++) {
				transform.mul(axis);
			}
		}
		return transform;
	}
229448
public static Object[][] matrixTransform(Object[][] datas) {
        if (datas.length == 0 || datas[0].length == 0) {
            return datas;
        }
        int column = datas.length;
        int row = datas[0].length;

        Object[][] newData = new Object[row][column];

        for (int i = 0; i < row; i++) {
            Object[] list = new Object[column];
            for (int j = 0; j < column; j++) {
                list[j] = datas[j][i];
            }
            newData[i] = list;
        }
        return newData;
    }
680417
public void setRow(RowVector rv, int r) throws MatrixException
    {
        if ((r < 0) || (r >= nRows)) {
            throw new MatrixException(MatrixException.INVALID_INDEX);
        }
        if (nCols != rv.nCols) {
            throw new MatrixException(
                                MatrixException.INVALID_DIMENSIONS);
        }

        for (int c = 0; c < nCols; ++c) {
            this.values[r][c] = rv.values[0][c];
        }
    }
460829
def rotateCoords(coords, R):
    
    newlist = list()
    for pp in coords:
        rpp = matrixTimesVector(R, pp)
        newlist.append(rpp)
    return newlist
1234461
@Override
    public Matrix<T> repmat(final int rowRepeats, final int colRepeats) {
        N.checkArgument(rowRepeats > 0 && colRepeats > 0, "rowRepeats=%s and colRepeats=%s must be bigger than 0", rowRepeats, colRepeats);

        final T[][] c = N.newArray(arrayType, rows * rowRepeats);

        for (int i = 0, len = c.length; i < len; i++) {
            c[i] = N.newArray(componentType, cols * colRepeats);
        }

        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < colRepeats; j++) {
                N.copy(a[i], 0, c[i], j * cols, cols);
            }
        }

        for (int i = 1; i < rowRepeats; i++) {
            for (int j = 0; j < rows; j++) {
                N.copy(c[j], 0, c[i * rows + j], 0, c[j].length);
            }
        }

        return new Matrix<T>(c);
    }
139809
public static double dotInnerColumns( DMatrixSparseCSC A , int colA , DMatrixSparseCSC B , int colB ,
                                          IGrowArray gw , DGrowArray gx)
    {
        if( A.numRows != B.numRows )
            throw new IllegalArgumentException("Number of rows must match.");

        int w[] = adjust(gw,A.numRows);
        Arrays.fill(w,0,A.numRows,-1);
        double x[] = adjust(gx,A.numRows);

        int length = 0;

        int idx0 = A.col_idx[colA];
        int idx1 = A.col_idx[colA+1];
        for (int i = idx0; i < idx1; i++) {
            int row = A.nz_rows[i];
            x[length] = A.nz_values[i];
            w[row] = length++;
        }

        double dot = 0;

        idx0 = B.col_idx[colB];
        idx1 = B.col_idx[colB+1];
        for (int i = idx0; i < idx1; i++) {
            int row = B.nz_rows[i];
            if( w[row] != -1 ) {
                dot += x[w[row]]*B.nz_values[i];
            }
        }

        return dot;
    }
808761
public Plan repeatEvery(final Integer repeatEvery, final PlanRepeatUnit unit) {
        this.repeatEvery = repeatEvery;
        this.repeatUnit = unit == null ? null : unit.name().toLowerCase();
        return this;
    }