Fixed CheckStyle warnings.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1372208 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2012-08-12 22:55:34 +00:00
parent 0f9adb1875
commit 1ec0b8d527
3 changed files with 64 additions and 31 deletions

View File

@ -21,17 +21,17 @@ import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.random.RandomGenerator;
/**
* Base class for probability distributions on the multivariate reals.
* Default implementations are provided for some of the methods that do
* not vary from distribution to distribution.
* Base class for multivariate probability distributions.
*
* @version $Id$
* @since 3.1
*/
public abstract class AbstractMultivariateRealDistribution
implements MultivariateRealDistribution {
/** The number of dimensions or columns in the multivariate distribution. */
private final int numDimensions;
/** RNG instance used to generate samples from the distribution. */
protected final RandomGenerator random;
/** The number of dimensions or columns in the multivariate distribution. */
private final int numDimensions;
/**
* @param rng Random number generator.
@ -49,8 +49,10 @@ public abstract class AbstractMultivariateRealDistribution
}
/**
* Gets the number of dimensions (i.e. the number of random variables) of
* the distribution.
*
* @return the number of dimensions in the multivariate distribution .
* @return the number of dimensions.
*/
public int getDimensions() {
return numDimensions;

View File

@ -1,3 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.distribution;
import org.apache.commons.math3.exception.DimensionMismatchException;
@ -18,6 +34,9 @@ import org.apache.commons.math3.util.MathArrays;
* Multivariate normal distribution (Wikipedia)</a>
* @see <a href="http://mathworld.wolfram.com/MultivariateNormalDistribution.html">
* Multivariate normal distribution (MathWorld)</a>
*
* @version $Id$
* @since 3.1
*/
public class MultivariateNormalDistribution
extends AbstractMultivariateRealDistribution {
@ -42,6 +61,12 @@ public class MultivariateNormalDistribution
*
* @param means Vector of means.
* @param covariances Covariance matrix.
* @throws DimensionMismatchException if the arrays length are
* inconsistent.
* @throws SingularMatrixException if the eigenvalue decomposition cannot
* be performed on the provided covariance matrix.
* @throws NonPositiveDefiniteMatrixException if any of the eigenvalues is
* negative.
*/
public MultivariateNormalDistribution(final double[] means,
final double[][] covariances)
@ -62,6 +87,12 @@ public class MultivariateNormalDistribution
* @param rng Random Number Generator.
* @param means Vector of means.
* @param covariances Covariance matrix.
* @throws DimensionMismatchException if the arrays length are
* inconsistent.
* @throws SingularMatrixException if the eigenvalue decomposition cannot
* be performed on the provided covariance matrix.
* @throws NonPositiveDefiniteMatrixException if any of the eigenvalues is
* negative.
*/
public MultivariateNormalDistribution(RandomGenerator rng,
final double[] means,

View File

@ -16,10 +16,7 @@
*/
package org.apache.commons.math3.distribution;
import org.apache.commons.math3.exception.DimensionMismatchException;
import org.apache.commons.math3.exception.NotStrictlyPositiveException;
import org.apache.commons.math3.exception.NumberIsTooLargeException;
import org.apache.commons.math3.exception.OutOfRangeException;
/**
* Base interface for multivariate distributions on the reals.
@ -27,6 +24,9 @@ import org.apache.commons.math3.exception.OutOfRangeException;
* This is based largely on the RealDistribution interface, but cumulative
* distribution functions are not required because they are often quite
* difficult to compute for multivariate distributions.
*
* @version $Id$
* @since 3.1
*/
public interface MultivariateRealDistribution {
/**
@ -51,7 +51,7 @@ public interface MultivariateRealDistribution {
* @param x Point at which the PDF is evaluated.
* @return the value of the probability density function at point {@code x}.
*/
double density(double[] x) throws DimensionMismatchException;
double density(double[] x);
/**
* Access the lower bound of the support.