mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 05:59:22 +08:00
style: include OCP_OVERLY_CONCRETE_PARAMETER
(#5833)
This commit is contained in:
@ -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++) {
|
||||
|
@ -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++) {
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user