Skip to content

Commit 2bf2580

Browse files
authored
Update ChebyshevIteration.java
1 parent 4874dc3 commit 2bf2580

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

src/main/java/com/thealgorithms/maths/ChebyshevIteration.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,7 @@ private ChebyshevIteration() {
4343
* if maxIterations <= 0, or if eigenvalues are invalid (e.g., minEigenvalue
4444
* <= 0, maxEigenvalue <= minEigenvalue).
4545
*/
46-
public static double[] solve(
47-
double[][] a,
48-
double[] b,
49-
double[] x0,
50-
double minEigenvalue,
51-
double maxEigenvalue,
52-
int maxIterations,
53-
double tolerance
54-
) {
46+
public static double[] solve(double[][] a, double[] b, double[] x0, double minEigenvalue, double maxEigenvalue, int maxIterations, double tolerance) {
5547
validateInputs(a, b, x0, minEigenvalue, maxEigenvalue, maxIterations, tolerance);
5648

5749
int n = b.length;
@@ -95,15 +87,7 @@ public static double[] solve(
9587
/**
9688
* Validates the inputs for the Chebyshev solver.
9789
*/
98-
private static void validateInputs(
99-
double[][] a,
100-
double[] b,
101-
double[] x0,
102-
double minEigenvalue,
103-
double maxEigenvalue,
104-
int maxIterations,
105-
double tolerance
106-
) {
90+
private static void validateInputs(double[][] a, double[] b, double[] x0, double minEigenvalue, double maxEigenvalue, int maxIterations, double tolerance) {
10791
int n = a.length;
10892
if (n == 0) {
10993
throw new IllegalArgumentException("Matrix A cannot be empty.");
@@ -194,4 +178,4 @@ private static double vectorNorm(double[] v) {
194178
}
195179
return Math.sqrt(sumOfSquares);
196180
}
197-
}
181+
}

0 commit comments

Comments
 (0)