Permalink
Browse files

StyleCop updated to 4.3, various StyleCop fixes.

  • Loading branch information...
1 parent 59e7834 commit d9d1edab165ae83eb35aeb4b53adbc888560d848 @cdrnet cdrnet committed Dec 22, 2008
Showing with 524 additions and 512 deletions.
  1. +1 −1 src/app/MathNet.Iridium/Library/Collection.cs
  2. +42 −35 src/app/MathNet.Iridium/Library/Complex.cs
  3. +17 −13 src/app/MathNet.Iridium/Library/ComplexPolynomial.cs
  4. +8 −4 src/app/MathNet.Iridium/Library/ComplexRational.cs
  5. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/BetaDistribution.cs
  6. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/CauchyLorentzDistribution.cs
  7. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/ChiDistribution.cs
  8. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/ChiSquareDistribution.cs
  9. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/ContinuousUniformDistribution.cs
  10. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/ErlangDistribution.cs
  11. +17 −14 src/app/MathNet.Iridium/Library/Distributions/Continuous/ExponentialDistribution.cs
  12. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/FisherSnedecorDistribution.cs
  13. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/GammaDistribution.cs
  14. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/LaplaceDistribution.cs
  15. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/LognormalDistribution.cs
  16. +21 −17 src/app/MathNet.Iridium/Library/Distributions/Continuous/NormalDistribution.cs
  17. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/ParetoDistribution.cs
  18. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/StableDistribution.cs
  19. +20 −16 src/app/MathNet.Iridium/Library/Distributions/Continuous/StandardDistribution.cs
  20. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/StudentsTDistribution.cs
  21. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Continuous/TriangularDistribution.cs
  22. +18 −16 src/app/MathNet.Iridium/Library/Distributions/Discrete/ArbitraryDistribution.cs
  23. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Discrete/BernoulliDistribution.cs
  24. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Discrete/BinomialDistribution.cs
  25. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Discrete/DiscreteUniformDistribution.cs
  26. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Discrete/GeometricDistribution.cs
  27. +6 −6 src/app/MathNet.Iridium/Library/Distributions/Discrete/HypergeometricDistribution.cs
  28. +17 −14 src/app/MathNet.Iridium/Library/Distributions/Discrete/PoissonDistribution.cs
  29. +16 −9 src/app/MathNet.Iridium/Library/Distributions/Discrete/ZipfDistribution.cs
  30. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/AkimaSplineInterpolation.cs
  31. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/BarycentricInterpolation.cs
  32. +1 −1 ...app/MathNet.Iridium/Library/Interpolation/Algorithms/ChebyshevFirstKindPolynomialInterpolation.cs
  33. +1 −1 ...pp/MathNet.Iridium/Library/Interpolation/Algorithms/ChebyshevSecondKindPolynomialInterpolation.cs
  34. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/CubicHermiteSplineInterpolation.cs
  35. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/CubicSplineInterpolation.cs
  36. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/EquidistantPolynomialInterpolation.cs
  37. +4 −2 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/LimitedOrderPolynomialInterpolation.cs
  38. +4 −2 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/LimitedOrderRationalInterpolation.cs
  39. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/LinearSplineInterpolation.cs
  40. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/PolynomialInterpolation.cs
  41. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/RationalInterpolation.cs
  42. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/RationalPoleFreeInterpolation.cs
  43. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/SplineInterpolation.cs
  44. +5 −5 src/app/MathNet.Iridium/Library/Interpolation/Interpolation1D.cs
  45. +7 −4 src/app/MathNet.Iridium/Library/LinearAlgebra/CholeskyDecomposition.cs
  46. +10 −6 src/app/MathNet.Iridium/Library/LinearAlgebra/ComplexMatrix.cs
  47. +11 −8 src/app/MathNet.Iridium/Library/LinearAlgebra/ComplexVector.cs
  48. +9 −8 src/app/MathNet.Iridium/Library/LinearAlgebra/EigenvalueDecomposition.cs
  49. +4 −4 src/app/MathNet.Iridium/Library/LinearAlgebra/LUDecomposition.cs
  50. +12 −8 src/app/MathNet.Iridium/Library/LinearAlgebra/Matrix.cs
  51. +34 −30 src/app/MathNet.Iridium/Library/LinearAlgebra/QRDecomposition.cs
  52. +15 −9 src/app/MathNet.Iridium/Library/LinearAlgebra/SingularValueDecomposition.cs
  53. +11 −8 src/app/MathNet.Iridium/Library/LinearAlgebra/Vector.cs
  54. +7 −4 src/app/MathNet.Iridium/Library/Polynomial.cs
  55. +2 −2 src/app/MathNet.Iridium/Library/Quaternion.cs
  56. +1 −1 src/app/MathNet.Iridium/Library/RandomSources/MersenneTwisterRandomSource.cs
  57. +1 −1 src/app/MathNet.Iridium/Library/RandomSources/XorShiftRandomSource.cs
  58. +8 −4 src/app/MathNet.Iridium/Library/Rational.cs
  59. +7 −6 src/app/MathNet.Iridium/Library/SampleList.cs
  60. +8 −9 src/app/MathNet.Iridium/Library/Set.cs
  61. +23 −98 src/app/MathNet.Iridium/Library/{Settings.SourceAnalysis → Settings.StyleCop}
  62. +1 −0 src/app/MathNet.Iridium/Library/SiConstants.cs
  63. +9 −6 src/app/MathNet.Iridium/Library/SpecialFunctions.cs
  64. +7 −7 src/app/MathNet.Iridium/Library/Statistics/Accumulator.cs
  65. +14 −10 src/app/MathNet.Iridium/Library/Statistics/Histogram.cs
  66. +3 −2 src/app/MathNet.Iridium/Library/Transformations/ComplexFourierTransformation.cs
  67. +3 −2 src/app/MathNet.Iridium/Library/Transformations/RealFourierTransformation.cs
  68. +1 −1 src/app/MathNet.Iridium/Library/Tuple.cs
@@ -31,7 +31,7 @@ namespace MathNet.Numerics
public sealed class Collection
{
/// <summary>
- /// Preventing the instantiation of the <see cref="Collection"/> class.
+ /// Prevents a default instance of the Collection class from being created.
/// </summary>
private Collection()
{
@@ -33,36 +33,40 @@ namespace MathNet.Numerics
/// Complex numbers class.
/// </summary>
/// <remarks>
- /// <p>The class <c>Complex</c> provides all elementary operations
+ /// <p>
+ /// The class <c>Complex</c> provides all elementary operations
/// on complex numbers. All the operators <c>+</c>, <c>-</c>,
/// <c>*</c>, <c>/</c>, <c>==</c>, <c>!=</c> are defined in the
/// canonical way. Additional complex trigonometric functions such
/// as <see cref="Complex.Cosine"/>, ...
/// are also provided. Note that the <c>Complex</c> structures
/// has two special constant values <see cref="Complex.NaN"/> and
- /// <see cref="Complex.Infinity"/>.</p>
- ///
- /// <p>In order to avoid possible ambiguities resulting from a
+ /// <see cref="Complex.Infinity"/>.
+ /// </p>
+ /// <p>
+ /// In order to avoid possible ambiguities resulting from a
/// <c>Complex(double, double)</c> constructor, the static methods
/// <see cref="Complex.FromRealImaginary"/> and <see cref="Complex.FromModulusArgument"/>
- /// are provided instead.</p>
- ///
+ /// are provided instead.
+ /// </p>
/// <code>
/// Complex x = Complex.FromRealImaginary(1d, 2d);
/// Complex y = Complex.FromModulusArgument(1d, Math.Pi);
/// Complex z = (x + y) / (x - y);
/// </code>
- ///
- /// <p>Since there is no canonical order among the complex numbers,
+ /// <p>
+ /// Since there is no canonical order among the complex numbers,
/// <c>Complex</c> does not implement <c>IComparable</c> but several
/// lexicographic <c>IComparer</c> implementations are provided, see
/// <see cref="Complex.RealImaginaryComparer"/>,
/// <see cref="Complex.ModulusArgumentComparer"/> and
- /// <see cref="Complex.ArgumentModulusComparer"/>.</p>
- ///
- /// <p>For mathematical details about complex numbers, please
+ /// <see cref="Complex.ArgumentModulusComparer"/>.
+ /// </p>
+ /// <p>
+ /// For mathematical details about complex numbers, please
/// have a look at the <a href="http://en.wikipedia.org/wiki/Complex_number">
- /// Wikipedia</a></p>
+ /// Wikipedia</a>
+ /// </p>
/// </remarks>
public struct Complex : IEquatable<Complex>, IComparable<Complex>
{
@@ -152,8 +156,8 @@ public static IComparer ArgumentModulusComparer
#region Constructors and Constants
/// <summary>
- /// Constructs a <c>Complex</c> from its real
- /// and imaginary parts.
+ /// Initializes a new instance of the Complex struct
+ /// from its real and imaginary parts.
/// </summary>
public
Complex(
@@ -433,7 +437,7 @@ public double Modulus
{
get
{
- return Math.Sqrt(real * real + imag * imag);
+ return Math.Sqrt((real * real) + (imag * imag));
}
set
@@ -461,7 +465,7 @@ public double Modulus
}
else
{
- double factor = value / Math.Sqrt(real * real + imag * imag);
+ double factor = value / Math.Sqrt((real * real) + (imag * imag));
real *= factor;
imag *= factor;
}
@@ -484,7 +488,7 @@ public double ModulusSquared
{
get
{
- return real * real + imag * imag;
+ return (real * real) + (imag * imag);
}
set
@@ -512,7 +516,7 @@ public double ModulusSquared
}
else
{
- double factor = value / (real * real + imag * imag);
+ double factor = value / ((real * real) + (imag * imag));
real *= factor;
imag *= factor;
}
@@ -827,7 +831,7 @@ Complex other
/// </summary>
public static Complex operator *(Complex multiplicand, Complex multiplier)
{
- return new Complex(multiplicand.real * multiplier.real - multiplicand.imag * multiplier.imag, multiplicand.real * multiplier.imag + multiplicand.imag * multiplier.real);
+ return new Complex((multiplicand.real * multiplier.real) - (multiplicand.imag * multiplier.imag), (multiplicand.real * multiplier.imag) + (multiplicand.imag * multiplier.real));
}
/// <summary>
@@ -857,7 +861,10 @@ Complex other
}
double z2mod = divisor.ModulusSquared;
- return new Complex((dividend.real * divisor.real + dividend.imag * divisor.imag) / z2mod, (dividend.imag * divisor.real - dividend.real * divisor.imag) / z2mod);
+ return new Complex(
+ ((dividend.real * divisor.real) + (dividend.imag * divisor.imag)) / z2mod,
+ ((dividend.imag * divisor.real) - (dividend.real * divisor.imag)) / z2mod
+ );
}
/// <summary>
@@ -950,7 +957,7 @@ Complex other
double cosr = Trig.Cosine(real);
double sinhi = Trig.HyperbolicSine(imag);
- double denom = cosr * cosr + sinhi * sinhi;
+ double denom = (cosr * cosr) + (sinhi * sinhi);
return new Complex(
Trig.Sine(real) * cosr / denom,
@@ -972,7 +979,7 @@ Complex other
double sinr = Trig.Sine(real);
double sinhi = Trig.HyperbolicSine(imag);
- double denom = sinr * sinr + sinhi * sinhi;
+ double denom = (sinr * sinr) + (sinhi * sinhi);
return new Complex(
sinr * Trig.Cosine(real) / denom,
@@ -994,7 +1001,7 @@ Complex other
double cosr = Trig.Cosine(real);
double sinhi = Trig.HyperbolicSine(imag);
- double denom = cosr * cosr + sinhi * sinhi;
+ double denom = (cosr * cosr) + (sinhi * sinhi);
return new Complex(
cosr * Trig.HyperbolicCosine(imag) / denom,
@@ -1016,7 +1023,7 @@ Complex other
double sinr = Trig.Sine(real);
double sinhi = Trig.HyperbolicSine(imag);
- double denom = sinr * sinr + sinhi * sinhi;
+ double denom = (sinr * sinr) + (sinhi * sinhi);
return new Complex(
sinr * Trig.HyperbolicCosine(imag) / denom,
@@ -1035,7 +1042,7 @@ Complex other
Complex
InverseSine()
{
- return -Complex.I * ((1 - this.Square()).SquareRoot() + Complex.I * this).NaturalLogarithm();
+ return -Complex.I * ((1 - this.Square()).SquareRoot() + (Complex.I * this)).NaturalLogarithm();
}
/// <summary>
@@ -1045,7 +1052,7 @@ Complex other
Complex
InverseCosine()
{
- return -Complex.I * (this + Complex.I * (1 - this.Square()).SquareRoot()).NaturalLogarithm();
+ return -Complex.I * (this + (Complex.I * (1 - this.Square()).SquareRoot())).NaturalLogarithm();
}
/// <summary>
@@ -1067,7 +1074,7 @@ Complex other
InverseCotangent()
{
Complex iz = new Complex(-imag, real); // I*this
- return new Complex(0, 0.5) * ((1 + iz).NaturalLogarithm() - (1 - iz).NaturalLogarithm()) + Math.PI / 2;
+ return (new Complex(0, 0.5) * ((1 + iz).NaturalLogarithm() - (1 - iz).NaturalLogarithm())) + (Math.PI / 2);
}
/// <summary>
@@ -1078,7 +1085,7 @@ Complex other
InverseSecant()
{
Complex inv = 1 / this;
- return -Complex.I * (inv + Complex.I * (1 - inv.Square()).SquareRoot()).NaturalLogarithm();
+ return -Complex.I * (inv + (Complex.I * (1 - inv.Square()).SquareRoot())).NaturalLogarithm();
}
/// <summary>
@@ -1089,7 +1096,7 @@ Complex other
InverseCosecant()
{
Complex inv = 1 / this;
- return -Complex.I * (Complex.I * inv + (1 - inv.Square()).SquareRoot()).NaturalLogarithm();
+ return -Complex.I * ((Complex.I * inv) + (1 - inv.Square()).SquareRoot()).NaturalLogarithm();
}
#endregion
@@ -1146,7 +1153,7 @@ Complex other
double cosi = Trig.Cosine(imag);
double sinhr = Trig.HyperbolicSine(real);
- double denom = cosi * cosi + sinhr * sinhr;
+ double denom = (cosi * cosi) + (sinhr * sinhr);
return new Complex(
Trig.HyperbolicCosine(real) * sinhr / denom,
@@ -1168,7 +1175,7 @@ Complex other
double sini = Trig.Sine(imag);
double sinhr = Trig.HyperbolicSine(real);
- double denom = sini * sini + sinhr * sinhr;
+ double denom = (sini * sini) + (sinhr * sinhr);
return new Complex(
sinhr * Trig.HyperbolicCosine(real) / denom,
@@ -1229,7 +1236,7 @@ Complex other
Complex
InverseHyperbolicCosine()
{
- return (this + (this - 1).SquareRoot() * (this + 1).SquareRoot()).NaturalLogarithm();
+ return (this + ((this - 1).SquareRoot() * (this + 1).SquareRoot())).NaturalLogarithm();
}
/// <summary>
@@ -1260,7 +1267,7 @@ Complex other
InverseHyperbolicSecant()
{
Complex inv = 1 / this;
- return (inv + (inv - 1).SquareRoot() * (inv + 1).SquareRoot()).NaturalLogarithm();
+ return (inv + ((inv - 1).SquareRoot() * (inv + 1).SquareRoot())).NaturalLogarithm();
}
/// <summary>
@@ -1378,7 +1385,7 @@ Complex rootexponent
}
return new Complex(
- real * real - imag * imag,
+ (real * real) - (imag * imag),
2 * real * imag
);
}
@@ -1397,7 +1404,7 @@ Complex rootexponent
double mod = Modulus;
- if(imag > 0 || imag == 0 && real < 0)
+ if(imag > 0 || (imag == 0 && real < 0))
{
return new Complex(
Constants.Sqrt1_2 * Math.Sqrt(mod + real),
@@ -39,7 +39,8 @@ public class ComplexPolynomial :
int order;
/// <summary>
- /// Create a new polynomial by order
+ /// Initializes a new instance of the ComplexPolynomial class
+ /// of the provided order.
/// </summary>
/// <param name="order">The highest power. Example: 2*x^3+x-3 has order 3.</param>
public
@@ -52,7 +53,8 @@ int order
}
/// <summary>
- /// Create a new polynomial by coefficients
+ /// Initializes a new instance of the ComplexPolynomial class
+ /// with the provided coefficients.
/// </summary>
/// <param name="coefficients">The complex coefficients vector. The coefficient index denotes the related power (c[0]*x^0+c[1]*x^1+..)</param>
public
@@ -70,7 +72,8 @@ Complex[] coefficients
}
/// <summary>
- /// Create a new complex polynomial by copy from a complex polynomial
+ /// Initializes a new instance of the ComplexPolynomial class
+ /// by deep copy from an existing polynomial.
/// </summary>
/// <param name="copy">A complex polynomial to copy from.</param>
public
@@ -88,7 +91,8 @@ ComplexPolynomial copy
}
/// <summary>
- /// Create a new complex polynomial by copy from a real polynomial
+ /// Initializes a new instance of the ComplexPolynomial class
+ /// by deep copy from an existing real polynomial.
/// </summary>
/// <param name="copy">A real polynomial to copy from.</param>
public
@@ -1060,7 +1064,7 @@ Complex c0
for(int j = order - 1; j >= 1; j--)
{
- coefficients[j] = coefficients[j - 1] - c0 * coefficients[j];
+ coefficients[j] = coefficients[j - 1] - (c0 * coefficients[j]);
}
coefficients[0] *= -c0;
@@ -1084,7 +1088,7 @@ Complex c0
for(int j = order - 1; j >= 1; j--)
{
- coefficients[j] = coefficients[j - 1] - c0 * coefficients[j];
+ coefficients[j] = coefficients[j - 1] - (c0 * coefficients[j]);
}
coefficients[0] *= -c0;
@@ -1351,7 +1355,7 @@ int offset
return new ComplexPolynomial(
new Complex[] {
leftCoefficients[offset] * rightCoefficients[offset],
- leftCoefficients[offset] * rightCoefficients[offset + 1] + leftCoefficients[offset + 1] * rightCoefficients[offset],
+ (leftCoefficients[offset] * rightCoefficients[offset + 1]) + (leftCoefficients[offset + 1] * rightCoefficients[offset]),
leftCoefficients[offset + 1] * rightCoefficients[offset + 1]
});
}
@@ -1444,7 +1448,7 @@ Complex value
Complex ret = coefficients[order];
for(int j = order - 1; j >= 0; j--)
{
- ret = ret * value + coefficients[j];
+ ret = (ret * value) + coefficients[j];
}
return ret;
@@ -1468,8 +1472,8 @@ Complex value
derivative = 0d;
for(int j = order - 1; j >= 0; j--)
{
- derivative = derivative * value + ret;
- ret = ret * value + coefficients[j];
+ derivative = (derivative * value) + ret;
+ ret = (ret * value) + coefficients[j];
}
return ret;
@@ -1498,10 +1502,10 @@ int derivativeOrderMax
len = Math.Min(derivativeOrderMax, coefficients.Length - 1 - i);
for(int j = len; j >= 1; j--)
{
- ret[j] = ret[j] * value + ret[j - 1];
+ ret[j] = (ret[j] * value) + ret[j - 1];
}
- ret[0] = ret[0] * value + coefficients[i];
+ ret[0] = (ret[0] * value) + coefficients[i];
}
double factorial = 1.0;
@@ -1558,7 +1562,7 @@ string baseVariable
}
}
- if(!Number.AlmostEqual(realCoeff, 1) && !Number.AlmostEqual(realCoeff, -1) || i == 0)
+ if(i == 0 || (!Number.AlmostEqual(realCoeff, 1) && !Number.AlmostEqual(realCoeff, -1)))
{
builder.Append(Math.Abs(realCoeff));
}
Oops, something went wrong.

0 comments on commit d9d1eda

Please sign in to comment.