Skip to content

Commit

Permalink
Remove redundant variable Initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
arturobernalg committed Apr 12, 2021
1 parent 0300f97 commit 8a9b896
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 38 deletions.
Expand Up @@ -117,7 +117,7 @@ public class EmpiricalDistribution extends AbstractRealDistribution
private final List<SummaryStatistics> binStats;

/** Sample statistics */
private SummaryStatistics sampleStats = null;
private SummaryStatistics sampleStats;

/** Max loaded value */
private double max = Double.NEGATIVE_INFINITY;
Expand All @@ -126,16 +126,16 @@ public class EmpiricalDistribution extends AbstractRealDistribution
private double min = Double.POSITIVE_INFINITY;

/** Grid size */
private double delta = 0d;
private double delta;

/** number of bins */
private final int binCount;

/** is the distribution loaded? */
private boolean loaded = false;
private boolean loaded;

/** upper bounds of subintervals in (0,1) "belonging" to the bins */
private double[] upperBounds = null;
private double[] upperBounds;

/**
* Creates a new EmpiricalDistribution with the default bin count.
Expand Down
Expand Up @@ -71,7 +71,7 @@ public class MultivariateNormalMixtureExpectationMaximization {
/**
* The log likelihood of the data given the fitted model.
*/
private double logLikelihood = 0d;
private double logLikelihood;

/**
* Creates an object to fit a multivariate normal mixture model to data.
Expand Down
Expand Up @@ -29,7 +29,7 @@
*/
public class FixedGenerationCount implements StoppingCondition {
/** Number of generations that have passed */
private int numGenerations = 0;
private int numGenerations;

/** Maximum number of generations (stopping criteria) */
private final int maxGenerations;
Expand Down
Expand Up @@ -53,7 +53,7 @@ public class GeneticAlgorithm {
private final SelectionPolicy selectionPolicy;

/** the number of generations evolved to reach {@link StoppingCondition} in the last run. */
private int generationsEvolved = 0;
private int generationsEvolved;

/**
* Create a new genetic algorithm.
Expand Down
Expand Up @@ -753,7 +753,7 @@ public Iterator<Entry> iterator() {
return new Iterator<Entry>() {

/** Current index. */
private int i = 0;
private int i;

/** Current entry. */
private Entry e = new Entry();
Expand Down
Expand Up @@ -254,7 +254,7 @@ private static class ImprovementEvaluator {
/** Minimum value of {@link #ewaInertia} during iteration. */
private double ewaInertiaMin = Double.POSITIVE_INFINITY;
/** Number of iteration during which {@link #ewaInertia} did not improve. */
private int noImprovementTimes = 0;
private int noImprovementTimes;

/**
* @param batchSize Number of elements for each batch iteration.
Expand Down
Expand Up @@ -71,7 +71,7 @@ public class HaltonSequenceGenerator implements RandomVectorGenerator {
private final int dimension;

/** The current index in the sequence. */
private int count = 0;
private int count;

/** The base numbers for each component. */
private final int[] base;
Expand Down
Expand Up @@ -74,7 +74,7 @@ public class SobolSequenceGenerator implements RandomVectorGenerator {
private final int dimension;

/** The current index in the sequence. */
private int count = 0;
private int count;

/** The direction vector for each component. */
private final long[][] direction;
Expand Down
Expand Up @@ -78,7 +78,7 @@ public class MultivariateSummaryStatistics
private final int k;

/** Count of values that have been added */
private long n = 0;
private long n;

/** Sum statistic implementation - can be reset by setter. */
private final StorelessUnivariateStatistic[] sumImpl;
Expand Down
Expand Up @@ -63,7 +63,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
private static final long serialVersionUID = -2021321786743555871L;

/** count of values that have been added */
private long n = 0;
private long n;

/** SecondMoment is used to compute the mean and variance */
private SecondMoment secondMoment = new SecondMoment();
Expand Down
Expand Up @@ -51,7 +51,7 @@ public class Skewness extends AbstractStorelessUnivariateStatistic implements Se
private static final long serialVersionUID = 20150412L;

/** Third moment on which this statistic is based */
protected ThirdMoment moment = null;
protected ThirdMoment moment;

/**
* Determines whether or not this statistic can be incremented or cleared.
Expand Down
Expand Up @@ -46,7 +46,7 @@ public class StandardDeviation extends AbstractStorelessUnivariateStatistic
private static final long serialVersionUID = 20150412L;

/** Wrapped Variance instance */
private Variance variance = null;
private Variance variance;

/**
* Constructs a StandardDeviation. Sets the underlying {@link Variance}
Expand Down
Expand Up @@ -72,7 +72,7 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
private static final long serialVersionUID = 20150412L;

/** SecondMoment is used in incremental calculation of Variance*/
protected SecondMoment moment = null;
protected SecondMoment moment;

/**
* Whether or not {@link #increment(double)} should increment
Expand Down
Expand Up @@ -99,7 +99,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
* Markers is the marker collection object which comes to effect
* only after 5 values are inserted
*/
private PSquareMarkers markers = null;
private PSquareMarkers markers;

/**
* Computed p value (i,e percentile value of data set hither to received)
Expand Down
Expand Up @@ -44,7 +44,7 @@ public abstract class AbstractMultipleLinearRegression implements
private RealVector yVector;

/** Whether or not the regression model includes an intercept. True means no intercept. */
private boolean noIntercept = false;
private boolean noIntercept;

/**
* @return the X sample data.
Expand Down
Expand Up @@ -58,23 +58,23 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
/** scratch space for tolerance calc */
private final double[] work_tolset;
/** number of observations entered */
private long nobs = 0;
private long nobs;
/** sum of squared errors of largest regression */
private double sserr = 0.0;
private double sserr;
/** has rss been called? */
private boolean rss_set = false;
private boolean rss_set;
/** has the tolerance setting method been called */
private boolean tol_set = false;
private boolean tol_set;
/** flags for variables with linear dependency problems */
private final boolean[] lindep;
/** singular x values */
private final double[] x_sing;
/** workspace for singularity method */
private final double[] work_sing;
/** summation of Y variable */
private double sumy = 0.0;
private double sumy;
/** summation of squared Y values */
private double sumsqy = 0.0;
private double sumsqy;
/** boolean flag whether a regression constant is added */
private final boolean hasIntercept;
/** zero tolerance */
Expand Down
Expand Up @@ -54,7 +54,7 @@
public class OLSMultipleLinearRegression extends AbstractMultipleLinearRegression {

/** Cached QR decomposition of X matrix */
private QRDecomposition qr = null;
private QRDecomposition qr;

/** Singularity threshold for QR decomposition */
private final double threshold;
Expand Down
Expand Up @@ -66,28 +66,28 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
private static final long serialVersionUID = -3004689053607543335L;

/** sum of x values */
private double sumX = 0d;
private double sumX;

/** total variation in x (sum of squared deviations from xbar) */
private double sumXX = 0d;
private double sumXX;

/** sum of y values */
private double sumY = 0d;
private double sumY;

/** total variation in y (sum of squared deviations from ybar) */
private double sumYY = 0d;
private double sumYY;

/** sum of products */
private double sumXY = 0d;
private double sumXY;

/** number of observations */
private long n = 0;
private long n;

/** mean of accumulated x values, used in updating formulas */
private double xbar = 0;
private double xbar;

/** mean of accumulated y values, used in updating formulas */
private double ybar = 0;
private double ybar;

/** include an intercept or not */
private final boolean hasIntercept;
Expand Down
Expand Up @@ -148,7 +148,7 @@ public void trigger(int max) throws MaxCountExceededException {
/** Function called at counter exhaustion. */
private final MaxCountExceededCallback maxCountCallback;
/** Current count. */
private int count = 0;
private int count;

/**
* Defines a method to be called at counter exhaustion.
Expand Down
Expand Up @@ -120,14 +120,14 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* The number of addressable elements in the array. Note that this
* has nothing to do with the length of the internal storage array.
*/
private int numElements = 0;
private int numElements;

/**
* The position of the first addressable element in the internal storage
* array. The addressable elements in the array are
* {@code internalArray[startIndex],...,internalArray[startIndex + numElements - 1]}.
*/
private int startIndex = 0;
private int startIndex;

/**
* Specification of expansion algorithm.
Expand Down
Expand Up @@ -38,12 +38,12 @@ public class TransformerMap implements NumberTransformer, Serializable {
/**
* A default Number Transformer for Numbers and numeric Strings.
*/
private NumberTransformer defaultTransformer = null;
private NumberTransformer defaultTransformer;

/**
* The internal Map.
*/
private Map<Class<?>, NumberTransformer> map = null;
private Map<Class<?>, NumberTransformer> map;

/**
* Build a map containing only the default transformer.
Expand Down

0 comments on commit 8a9b896

Please sign in to comment.