/* Created on: 16 feb. 2019 Author: Daniel Mårtensson Do repeate matrix. If you have a matrix A with size row x column and you want to repeat matrix A horz=3 times to left and vert=2 times down, Then you need a matrix B with size row*2 x column*3  */
void repmat(double *A, int row, int column, int horz, int vert, double *B)
/* Created on: 16 feb. 2019 Author: Daniel Mårtensson Do repeate matrix. If you have a matrix A with size row x column and you want to repeat matrix A horz=3 times to left and vert=2 times down, Then you need a matrix B with size row*2 x column*3  */
void repmat(double *A, int row, int column, int horz, int vert, double *B)
{
		for (int j = 0; j < horz; j++) {
			memcpy(B, A + jump, sizeof(double) * column);
			B += column;
		}
		jump += column;
		if(jump >= column*row)
			jump = 0;
	}
}