Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Fixing some code analysis warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsouza committed Jul 1, 2016
1 parent d01e2ad commit 933838e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
19 changes: 0 additions & 19 deletions Sources/Accord.IO/ExcelReader.cs
Expand Up @@ -357,28 +357,9 @@ public DataSet GetWorksheet()
return dataset;
}


private bool unquote(string str, char quote, out string unquoted)
{
unquoted = str;

if (String.IsNullOrEmpty(str))
return false;

int length = str.Length;
if (length > 1 && str[0] == quote && str[length - 1] == quote)
{
unquoted = str.Substring(1, length - 2);
return true;
}

return false;
}

}



#if NET35
internal static class Extensions
{
Expand Down
4 changes: 2 additions & 2 deletions Sources/Accord.Math/Distances/Mahalanobis.cs
Expand Up @@ -126,7 +126,7 @@ public double Distance(double[] x, double[] y)
/// of the given covariance matrix.
/// </returns>
///
public SquareMahalanobis FromCovarianceMatrix(double[,] covariance)
public static SquareMahalanobis FromCovarianceMatrix(double[,] covariance)
{
return new SquareMahalanobis(new CholeskyDecomposition(covariance));
}
Expand All @@ -141,7 +141,7 @@ public SquareMahalanobis FromCovarianceMatrix(double[,] covariance)
/// A Mahalanobis distance using the given precision matrix.
/// </returns>
///
public SquareMahalanobis FromPrecisionMatrix(double[,] precision)
public static SquareMahalanobis FromPrecisionMatrix(double[,] precision)
{
return new SquareMahalanobis(precision);
}
Expand Down
Expand Up @@ -58,7 +58,7 @@ public override CancellationToken Token
/// <summary>
/// Initializes a new instance of the <see cref="ParallelMulticlassLearningBase{TModel, TInput}"/> class.
/// </summary>
public ParallelMulticlassLearningBase()
protected ParallelMulticlassLearningBase()
{
ParallelOptions = new ParallelOptions();
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/Accord.Statistics/Distances/Bhattacharyya.cs
Expand Up @@ -247,14 +247,14 @@ public double Distance(double[] meanX, double[,] covX, double[] meanY, double[,]
/// Bhattacharyya distance between two Gaussian distributions.
/// </summary>
///
/// <param name="a">The first Normal distribution.</param>
/// <param name="b">The second Normal distribution.</param>
/// <param name="x">The first Normal distribution.</param>
/// <param name="y">The second Normal distribution.</param>
///
/// <returns>The Bhattacharyya distance between the two distributions.</returns>
///
public double Distance(MultivariateNormalDistribution a, MultivariateNormalDistribution b)
public double Distance(MultivariateNormalDistribution x, MultivariateNormalDistribution y)
{
return Distance(a.Mean, a.Covariance, b.Mean, b.Covariance);
return Distance(x.Mean, x.Covariance, y.Mean, y.Covariance);
}
}
}

0 comments on commit 933838e

Please sign in to comment.