Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void fillHadamard(int[][] mat)
- {
- fillHadamard(mat, 0, 0, mat.length, 1);
- int d = 0;
- }
- private static void fillHadamard(int[][] mat, int i, int j, int size, int value)
- {
- if(size == 1)
- mat[i][j] = value;
- else{
- fillHadamard(mat, i, j, size / 2, value);
- fillHadamard(mat, i + size / 2, j, size / 2, value);
- fillHadamard(mat, i, j + size / 2, size / 2, value);
- fillHadamard(mat, i + size / 2, j + size / 2, size / 2, value * -1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement