Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static final int[][] input = new int[][]
- {{5, 5, 5, 5, 5, 5, 5, 5, 5, 5},
- {4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
- {0, 5, 5, 5, 5, 5, 0, 0, 5, 5},
- {0, 5, 5, 5, 5, 5, 0, 0, 5, 5},
- {0, 5, 5, 5, 5, 5, 0, 0, 5, 5},
- {5, 4, 4, 4, 4, 4, 5, 5, 4, 4},
- {5, 5, 5, 5, 4, 5, 5, 5, 5, 5},
- {0, 5, 5, 5, 5, 5, 0, 0, 5, 5},
- {0, 4, 4, 4, 5, 4, 0, 0, 4, 4},
- {4, 5, 5, 5, 5, 5, 4, 4, 5, 5}};
- private static int[][] train = input;
- private static final int[] indexes = new int[] {2, 3, 2, 4, 4, 9, 8, 5, 2, 1};
- private static int[][] test = new int[input.length][input[0].length];
- public static int[][] checkImplementation(){
- int[][] input = ArrayHelper.input;
- for(int i = 0; i < input.length; i++){
- test[i][indexes[i]] = train[i][indexes[i]];
- train[i][indexes[i]] = 0;
- }
- return train;
- }
- public static String[][] checkImplementationResult(double[][] result){
- DecimalFormat dec = new DecimalFormat("#0.00");
- String[][] resultString = new String[input.length][input[0].length];
- for(int i = 0; i < input.length; i++){
- for(int j = 0; j < input[0].length; j++) {
- if(j != indexes[i]) {
- resultString[i][j] = ArrayHelper.input[i][j] + "=>" + dec.format(result[i][j]) + " |";
- } else {
- resultString[i][j] = ArrayHelper.test[i][j] + "=>" + dec.format(result[i][j]) + " |";
- }
- }
- }
- return resultString;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement