From 69138ab18de0b84e0a8ec4a194cd116b7cc4e1ad Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Sun, 21 Aug 2011 21:18:34 +0000 Subject: [PATCH] Replaced deprecated exception; fixed javadoc typo. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1160068 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/math/stat/correlation/Covariance.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/math/stat/correlation/Covariance.java b/src/main/java/org/apache/commons/math/stat/correlation/Covariance.java index 6bea1ad1d..5a616e1c2 100644 --- a/src/main/java/org/apache/commons/math/stat/correlation/Covariance.java +++ b/src/main/java/org/apache/commons/math/stat/correlation/Covariance.java @@ -16,7 +16,7 @@ */ package org.apache.commons.math.stat.correlation; -import org.apache.commons.math.MathRuntimeException; +import org.apache.commons.math.exception.MathIllegalArgumentException; import org.apache.commons.math.exception.util.LocalizedFormats; import org.apache.commons.math.linear.RealMatrix; import org.apache.commons.math.linear.BlockRealMatrix; @@ -195,7 +195,7 @@ public class Covariance { } /** - * Create a covariance matrix from a rectangual array whose columns represent + * Create a covariance matrix from a rectangular array whose columns represent * covariates. Covariances are computed using the bias-corrected formula. * @param data input array (must have at least two columns and two rows) * @return covariance matrix @@ -223,11 +223,11 @@ public class Covariance { double result = 0d; int length = xArray.length; if (length != yArray.length) { - throw MathRuntimeException.createIllegalArgumentException( + throw new MathIllegalArgumentException( LocalizedFormats.DIMENSIONS_MISMATCH_SIMPLE, length, yArray.length); } else if (length < 2) { - throw MathRuntimeException.createIllegalArgumentException( - LocalizedFormats.INSUFFICIENT_DIMENSION, length, 2); + throw new MathIllegalArgumentException( + LocalizedFormats.INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE, length, 2); } else { double xMean = mean.evaluate(xArray); double yMean = mean.evaluate(yArray); @@ -266,7 +266,7 @@ public class Covariance { int nRows = matrix.getRowDimension(); int nCols = matrix.getColumnDimension(); if (nRows < 2 || nCols < 2) { - throw MathRuntimeException.createIllegalArgumentException( + throw new MathIllegalArgumentException( LocalizedFormats.INSUFFICIENT_ROWS_AND_COLUMNS, nRows, nCols); }