style: include OCP_OVERLY_CONCRETE_PARAMETER (#5833)

This commit is contained in:
Piotr Idzik
2024-10-14 22:46:28 +02:00
committed by GitHub
parent 3af4cfd7c8
commit 8886e0996a
28 changed files with 46 additions and 33 deletions

View File

@ -1,6 +1,7 @@
package com.thealgorithms.maths;
import java.util.ArrayList;
import java.util.Collection;
/**
* Class for circular convolution of two discrete signals using the convolution
@ -19,7 +20,7 @@ public final class CircularConvolutionFFT {
* @param x The signal to be padded.
* @param newSize The new size of the signal.
*/
private static void padding(ArrayList<FFT.Complex> x, int newSize) {
private static void padding(Collection<FFT.Complex> x, int newSize) {
if (x.size() < newSize) {
int diff = newSize - x.size();
for (int i = 0; i < diff; i++) {

View File

@ -1,6 +1,7 @@
package com.thealgorithms.maths;
import java.util.ArrayList;
import java.util.Collection;
/**
* Class for linear convolution of two discrete signals using the convolution
@ -19,7 +20,7 @@ public final class ConvolutionFFT {
* @param x The signal to be padded.
* @param newSize The new size of the signal.
*/
private static void padding(ArrayList<FFT.Complex> x, int newSize) {
private static void padding(Collection<FFT.Complex> x, int newSize) {
if (x.size() < newSize) {
int diff = newSize - x.size();
for (int i = 0; i < diff; i++) {

View File

@ -1,6 +1,7 @@
package com.thealgorithms.maths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
/**
@ -274,7 +275,7 @@ public final class FFT {
*
* @param x The ArrayList to be padded.
*/
private static void paddingPowerOfTwo(ArrayList<Complex> x) {
private static void paddingPowerOfTwo(Collection<Complex> x) {
int n = 1;
int oldSize = x.size();
while (n < oldSize) {

View File

@ -1,6 +1,7 @@
package com.thealgorithms.maths;
import java.util.ArrayList;
import java.util.List;
/**
* Class for calculating the Fast Fourier Transform (FFT) of a discrete signal
@ -25,7 +26,7 @@ public final class FFTBluestein {
* IFFT of signal x.
* @param inverse True if you want to find the inverse FFT.
*/
public static void fftBluestein(ArrayList<FFT.Complex> x, boolean inverse) {
public static void fftBluestein(List<FFT.Complex> x, boolean inverse) {
int n = x.size();
int bnSize = 2 * n - 1;
int direction = inverse ? -1 : 1;

View File

@ -1,12 +1,13 @@
package com.thealgorithms.maths;
import java.util.ArrayList;
import java.util.List;
public final class Gaussian {
private Gaussian() {
}
public static ArrayList<Double> gaussian(int matSize, ArrayList<Double> matrix) {
public static ArrayList<Double> gaussian(int matSize, List<Double> matrix) {
int i;
int j = 0;

View File

@ -2,6 +2,7 @@ package com.thealgorithms.maths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import org.apache.commons.lang3.tuple.MutablePair;
/**
@ -64,7 +65,7 @@ public class NthUglyNumber {
}
}
private long computeCandidate(final MutablePair<Integer, Integer> entry) {
private long computeCandidate(final Map.Entry<Integer, Integer> entry) {
return entry.getKey() * uglyNumbers.get(entry.getValue());
}