style: enable LocalVariableName in CheckStyle (#5191)

* style: enable LocalVariableName in checkstyle

* Removed minor bug

* Resolved Method Name Bug

* Changed names according to suggestions
This commit is contained in:
S. Utkarsh
2024-05-28 23:59:28 +05:30
committed by GitHub
parent 81cb09b1f8
commit 25d711c5d8
45 changed files with 418 additions and 417 deletions

View File

@ -13,28 +13,29 @@ class StrassenMatrixMultiplicationTest {
@Test
public void strassenMatrixMultiplicationTest2x2() {
int[][] A = {{1, 2}, {3, 4}};
int[][] B = {{5, 6}, {7, 8}};
int[][] a = {{1, 2}, {3, 4}};
int[][] b = {{5, 6}, {7, 8}};
int[][] expResult = {{19, 22}, {43, 50}};
int[][] actResult = SMM.multiply(A, B);
int[][] actResult = SMM.multiply(a, b);
assertArrayEquals(expResult, actResult);
}
@Test
void strassenMatrixMultiplicationTest4x4() {
int[][] A = {{1, 2, 5, 4}, {9, 3, 0, 6}, {4, 6, 3, 1}, {0, 2, 0, 6}};
int[][] B = {{1, 0, 4, 1}, {1, 2, 0, 2}, {0, 3, 1, 3}, {1, 8, 1, 2}};
int[][] a = {{1, 2, 5, 4}, {9, 3, 0, 6}, {4, 6, 3, 1}, {0, 2, 0, 6}};
int[][] b = {{1, 0, 4, 1}, {1, 2, 0, 2}, {0, 3, 1, 3}, {1, 8, 1, 2}};
int[][] expResult = {{7, 51, 13, 28}, {18, 54, 42, 27}, {11, 29, 20, 27}, {8, 52, 6, 16}};
int[][] actResult = SMM.multiply(A, B);
int[][] actResult = SMM.multiply(a, b);
assertArrayEquals(expResult, actResult);
}
@Test
void strassenMatrixMultiplicationTestNegativeNumber4x4() {
int[][] A = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}};
int[][] B = {{1, -2, -3, 4}, {4, -3, -2, 1}, {5, -6, -7, 8}, {8, -7, -6, -5}};
void strassenMatrixMultiplicationTestNegetiveNumber4x4() {
int[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}};
int[][] b = {{1, -2, -3, 4}, {4, -3, -2, 1}, {5, -6, -7, 8}, {8, -7, -6, -5}};
int[][] expResult = {{56, -54, -52, 10}, {128, -126, -124, 42}, {200, -198, -196, 74}, {272, -270, -268, 106}};
int[][] actResult = SMM.multiply(A, B);
int[][] actResult = SMM.multiply(a, b);
assertArrayEquals(expResult, actResult);
}
}