Permalink
Browse files

Various StyleCop fixes

  • Loading branch information...
1 parent 695f594 commit fdaa82e899977789b9f501765a330e2ed3673334 @cdrnet cdrnet committed Dec 22, 2008
Showing with 63 additions and 73 deletions.
  1. +5 −5 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/AkimaSplineInterpolation.cs
  2. +2 −2 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/BarycentricInterpolation.cs
  3. +6 −6 ...app/MathNet.Iridium/Library/Interpolation/Algorithms/ChebyshevFirstKindPolynomialInterpolation.cs
  4. +3 −3 ...pp/MathNet.Iridium/Library/Interpolation/Algorithms/ChebyshevSecondKindPolynomialInterpolation.cs
  5. +2 −2 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/CubicHermiteSplineInterpolation.cs
  6. +6 −6 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/CubicSplineInterpolation.cs
  7. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/LimitedOrderPolynomialInterpolation.cs
  8. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/LimitedOrderRationalInterpolation.cs
  9. +4 −4 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/PolynomialInterpolation.cs
  10. +6 −6 src/app/MathNet.Iridium/Library/Interpolation/Algorithms/SplineInterpolation.cs
  11. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/PolynomialInterpolationAlgorithm.cs
  12. +1 −1 src/app/MathNet.Iridium/Library/Interpolation/RationalInterpolationAlgorithm.cs
  13. +1 −1 src/app/MathNet.Iridium/Library/RandomSources/AdditiveLaggedFibonacciRandomSource.cs
  14. +2 −2 src/app/MathNet.Iridium/Library/RandomSources/MersenneTwisterRandomSource.cs
  15. +1 −1 src/app/MathNet.Iridium/Library/RandomSources/SystemRandomSource.cs
  16. +1 −1 src/app/MathNet.Iridium/Library/RandomSources/XorShiftRandomSource.cs
  17. +0 −10 src/app/MathNet.Iridium/Library/Settings.StyleCop
  18. +8 −8 src/app/MathNet.Iridium/Library/Transformations/InternalFFT.cs
  19. +12 −12 src/app/MathNet.Iridium/Library/Transformations/RealFourierTransformation.cs
@@ -158,11 +158,11 @@ IList<double> x
{
if(!Number.AlmostZero(w[i - 1]) || !Number.AlmostZero(w[i + 1]))
{
- d[i] = (w[i + 1] * diff[i - 1] + w[i - 1] * diff[i]) / (w[i + 1] + w[i - 1]);
+ d[i] = ((w[i + 1] * diff[i - 1]) + (w[i - 1] * diff[i])) / (w[i + 1] + w[i - 1]);
}
else
{
- d[i] = ((tt[i + 1] - tt[i]) * diff[i - 1] + (tt[i] - tt[i - 1]) * diff[i]) / (tt[i + 1] - tt[i - 1]);
+ d[i] = (((tt[i + 1] - tt[i]) * diff[i - 1]) + ((tt[i] - tt[i - 1]) * diff[i])) / (tt[i + 1] - tt[i - 1]);
}
}
@@ -249,9 +249,9 @@ IList<double> x
t = t - t0;
t1 = t1 - t0;
t2 = t2 - t0;
- double a = (x2 - x0 - t2 / t1 * (x1 - x0)) / (t2 * t2 - t1 * t2);
- double b = (x1 - x0 - a * t1 * t1) / t1;
- return 2 * a * t + b;
+ double a = (x2 - x0 - (t2 / t1 * (x1 - x0))) / ((t2 * t2) - (t1 * t2));
+ double b = (x1 - x0 - (a * t1 * t1)) / t1;
+ return (2 * a * t) + b;
}
}
}
@@ -197,13 +197,13 @@ IList<double> w
if(i != j)
{
double v = s * _w[i] / (t - _t[i]);
- s1 = s1 + v * _x[i];
+ s1 = s1 + (v * _x[i]);
s2 = s2 + v;
}
else
{
double v = _w[i];
- s1 = s1 + v * _x[i];
+ s1 = s1 + (v * _x[i]);
s2 = s2 + v;
}
}
@@ -133,8 +133,8 @@ IList<double> x
_transformFactor = 2.0 / (b - a);
// trigonometric recurrence
- double a0 = Math.PI / (2 * (x.Count - 1) + 2);
- double delta = 2 * Math.PI / (2 * (x.Count - 1) + 2);
+ double a0 = Math.PI / ((2 * (x.Count - 1)) + 2);
+ double delta = 2 * Math.PI / ((2 * (x.Count - 1)) + 2);
double alpha = Math.Sin(delta / 2);
alpha = 2 * alpha * alpha;
double beta = Math.Sin(delta);
@@ -150,8 +150,8 @@ IList<double> x
w[0] = sa;
for(int i = 1; i < t.Length; i++)
{
- double temps = sa - (alpha * sa - beta * ca);
- double tempc = ca - (alpha * ca + beta * sa);
+ double temps = sa - ((alpha * sa) - (beta * ca));
+ double tempc = ca - ((alpha * ca) + (beta * sa));
sa = temps;
ca = tempc;
sign = -sign;
@@ -237,12 +237,12 @@ int numberOfPoints
double transformSummand = 0.5 * (a + b);
double transformFactor = (b - a) / 2.0;
- double angleFactor = Math.PI / (2 * (numberOfPoints - 1) + 2);
+ double angleFactor = Math.PI / ((2 * (numberOfPoints - 1)) + 2);
double[] nodes = new double[numberOfPoints];
for(int i = 0; i < numberOfPoints; i++)
{
- nodes[i] = transformSummand + transformFactor * Math.Cos((2 * i + 1) * angleFactor);
+ nodes[i] = transformSummand + (transformFactor * Math.Cos(((2 * i) + 1) * angleFactor));
}
return nodes;
@@ -151,8 +151,8 @@ IList<double> x
for(int i = 1; i < t.Length; i++)
{
- double temps = sa - (alpha * sa - beta * ca);
- double tempc = ca - (alpha * ca + beta * sa);
+ double temps = sa - ((alpha * sa) - (beta * ca));
+ double tempc = ca - ((alpha * ca) + (beta * sa));
sa = temps;
ca = tempc;
sign = -sign;
@@ -245,7 +245,7 @@ int numberOfPoints
double[] nodes = new double[numberOfPoints];
for(int i = 0; i < numberOfPoints; i++)
{
- nodes[i] = transformSummand + transformFactor * Math.Cos(i * angleFactor);
+ nodes[i] = transformSummand + (transformFactor * Math.Cos(i * angleFactor));
}
return nodes;
@@ -173,8 +173,8 @@ IList<double> d
double delta3 = delta * delta2;
c[j] = x[i];
c[j + 1] = d[i];
- c[j + 2] = (3 * (x[i + 1] - x[i]) - 2 * d[i] * delta - d[i + 1] * delta) / delta2;
- c[j + 3] = (2 * (x[i] - x[i + 1]) + d[i] * delta + d[i + 1] * delta) / delta3;
+ c[j + 2] = (3 * (x[i + 1] - x[i]) - (2 * d[i] * delta) - (d[i + 1] * delta)) / delta2;
+ c[j + 3] = (2 * (x[i] - x[i + 1]) + (d[i] * delta) + (d[i + 1] * delta)) / delta3;
}
_spline.Init(t, c);
@@ -212,7 +212,7 @@ IList<double> x
a1[0] = 0;
a2[0] = 2;
a3[0] = 1;
- b[0] = 3 * (xx[1] - xx[0]) / (tt[1] - tt[0]) - 0.5 * leftBoundary * (tt[1] - tt[0]);
+ b[0] = 3 * ((xx[1] - xx[0]) / (tt[1] - tt[0])) - (0.5 * leftBoundary * (tt[1] - tt[0]));
break;
default:
throw new NotSupportedException(Properties.LocalStrings.InvalidLeftBoundaryCondition);
@@ -224,7 +224,7 @@ IList<double> x
a1[i] = tt[i + 1] - tt[i];
a2[i] = 2 * (tt[i + 1] - tt[i - 1]);
a3[i] = tt[i] - tt[i - 1];
- b[i] = 3 * (xx[i] - xx[i - 1]) / (tt[i] - tt[i - 1]) * (tt[i + 1] - tt[i]) + 3 * (xx[i + 1] - xx[i]) / (tt[i + 1] - tt[i]) * (tt[i] - tt[i - 1]);
+ b[i] = (3 * (xx[i] - xx[i - 1]) / (tt[i] - tt[i - 1]) * (tt[i + 1] - tt[i])) + (3 * (xx[i + 1] - xx[i]) / (tt[i + 1] - tt[i]) * (tt[i] - tt[i - 1]));
}
// Right Boundary
@@ -246,7 +246,7 @@ IList<double> x
a1[n - 1] = 1;
a2[n - 1] = 2;
a3[n - 1] = 0;
- b[n - 1] = 3 * (xx[n - 1] - xx[n - 2]) / (tt[n - 1] - tt[n - 2]) + 0.5 * rightBoundary * (tt[n - 1] - tt[n - 2]);
+ b[n - 1] = (3 * (xx[n - 1] - xx[n - 2]) / (tt[n - 1] - tt[n - 2])) + (0.5 * rightBoundary * (tt[n - 1] - tt[n - 2]));
break;
default:
throw new NotSupportedException(Properties.LocalStrings.InvalidRightBoundaryCondition);
@@ -326,14 +326,14 @@ IList<double> x
for(int k = 1; k < a.Length; k++)
{
double t = a[k] / b[k - 1];
- b[k] = b[k] - t * c[k - 1];
- d[k] = d[k] - t * d[k - 1];
+ b[k] = b[k] - (t * c[k - 1]);
+ d[k] = d[k] - (t * d[k - 1]);
}
x[x.Length - 1] = d[d.Length - 1] / b[b.Length - 1];
for(int k = x.Length - 2; k >= 0; k--)
{
- x[k] = (d[k] - c[k] * x[k + 1]) / b[k];
+ x[k] = (d[k] - (c[k] * x[k + 1])) / b[k];
}
return x;
@@ -221,7 +221,7 @@ SampleList samples
closestIndex = Math.Max(_samples.Locate(t), 0);
int ret = Math.Min(
Math.Max(
- closestIndex - (_effectiveOrder - 1) / 2,
+ closestIndex - ((_effectiveOrder - 1) / 2),
0
),
_samples.Count - _effectiveOrder
@@ -229,7 +229,7 @@ SampleList samples
closestIndex = Math.Max(_samples.Locate(t), 0);
int ret = Math.Min(
Math.Max(
- closestIndex - (_effectiveOrder - 1) / 2,
+ closestIndex - ((_effectiveOrder - 1) / 2),
0
),
_samples.Count - _effectiveOrder
@@ -158,7 +158,7 @@ IList<double> x
double hp = t - _t[i + level];
double ho = _t[i] - t;
double den = _t[i] - _t[i + level];
- x[i] = (hp * x[i] + ho * x[i + 1]) / den;
+ x[i] = ((hp * x[i]) + (ho * x[i + 1])) / den;
}
}
@@ -193,9 +193,9 @@ IList<double> x
double hp = t - _t[i + level];
double ho = _t[i] - t;
double den = _t[i] - _t[i + level];
- d2x[i] = (hp * d2x[i] + ho * d2x[i + 1] + 2 * dx[i] - 2 * dx[i + 1]) / den;
- dx[i] = (hp * dx[i] + x[i] + ho * dx[i + 1] - x[i + 1]) / den;
- x[i] = (hp * x[i] + ho * x[i + 1]) / den;
+ d2x[i] = ((hp * d2x[i]) + (ho * d2x[i + 1]) + (2 * dx[i]) - (2 * dx[i + 1])) / den;
+ dx[i] = ((hp * dx[i]) + x[i] + (ho * dx[i + 1]) - x[i + 1]) / den;
+ x[i] = ((hp * x[i]) + (ho * x[i + 1])) / den;
}
}
@@ -165,7 +165,7 @@ IList<double> c
// Interpolation
t = t - _t[low];
int k = low << 2;
- return _c[k] + t * (_c[k + 1] + t * (_c[k + 2] + t * _c[k + 3]));
+ return _c[k] + (t * (_c[k + 1] + (t * (_c[k + 2] + (t * _c[k + 3])))));
}
/// <summary>
@@ -202,9 +202,9 @@ IList<double> c
// Differentiation
t = t - _t[low];
int k = low << 2;
- first = _c[k + 1] + 2 * t * _c[k + 2] + 3 * t * t * _c[k + 3];
- second = 2 * _c[k + 2] + 6 * t * _c[k + 3];
- return _c[k] + t * (_c[k + 1] + t * (_c[k + 2] + t * _c[k + 3]));
+ first = _c[k + 1] + (2 * t * _c[k + 2]) + (3 * t * t * _c[k + 3]);
+ second = (2 * _c[k + 2]) + (6 * t * _c[k + 3]);
+ return _c[k] + (t * (_c[k + 1] + (t * (_c[k + 2] + (t * _c[k + 3])))));
}
/// <summary>
@@ -240,12 +240,12 @@ IList<double> c
for(int i = 0, j = 0; i < low; i++, j += 4)
{
double w = _t[i + 1] - _t[i];
- result += w * (_c[j] + w * (_c[j + 1] * 0.5 + w * (_c[j + 2] / 3 + w * _c[j + 3] * 0.25)));
+ result += w * (_c[j] + (w * (_c[j + 1] * 0.5) + (w * ((_c[j + 2] / 3) + (w * _c[j + 3] * 0.25)))));
}
t = t - _t[low];
int k = low << 2;
- return result + t * (_c[k] + t * (_c[k + 1] * 0.5 + t * (_c[k + 2] / 3 + t * _c[k + 3] * 0.25)));
+ return result + t * (_c[k] + (t * (_c[k + 1] * 0.5) + (t * ((_c[k + 2] / 3) + (t * _c[k + 3] * 0.25)))));
}
}
}
@@ -199,7 +199,7 @@ public int EffectiveOrder
closestIndex = Math.Max(_samples.Locate(t), 0);
int ret = Math.Min(
Math.Max(
- closestIndex - (_effectiveOrder - 1) / 2,
+ closestIndex - ((_effectiveOrder - 1) / 2),
0
),
_samples.Count - _effectiveOrder
@@ -208,7 +208,7 @@ public int EffectiveOrder
closestIndex = Math.Max(_samples.Locate(t), 0);
int ret = Math.Min(
Math.Max(
- closestIndex - (_effectiveOrder - 1) / 2,
+ closestIndex - ((_effectiveOrder - 1) / 2),
0
),
_samples.Count - _effectiveOrder
@@ -540,7 +540,7 @@ public override
// The shift operation and extra int cast before the first multiplication give better performance.
// See comment in NextDouble().
- return minValue + (double)(int)(x >> 1) * IntToDoubleMultiplier * range;
+ return minValue + ((double)(int)(x >> 1) * IntToDoubleMultiplier * range);
}
/// <summary>
@@ -274,7 +274,7 @@ uint[] seedArray
_mt[0] = _seed & 0xffffffffU;
for(_mti = 1; _mti < N; _mti++)
{
- _mt[_mti] = (1812433253U * (_mt[_mti - 1] ^ (_mt[_mti - 1] >> 30)) + _mti);
+ _mt[_mti] = (1812433253U * (_mt[_mti - 1] ^ (_mt[_mti - 1] >> 30))) + _mti;
// See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier.
// In the previous versions, MSBs of the seed affect only MSBs of the array mt[].
@@ -725,7 +725,7 @@ public override
// The shift operation and extra int cast before the first multiplication give better performance.
// See comment in NextDouble().
- return minValue + (double)(int)(y >> 1) * IntToDoubleMultiplier * range;
+ return minValue + ((double)(int)(y >> 1) * IntToDoubleMultiplier * range);
}
/// <summary>
@@ -272,7 +272,7 @@ public override
throw new ArgumentException(Properties.LocalStrings.ArgumentRangeLessEqual("minValue", "maxValue", "Double.MaxValue"));
}
- return minValue + _generator.NextDouble() * range;
+ return minValue + (_generator.NextDouble() * range);
}
/// <summary>
@@ -508,7 +508,7 @@ public override
// The shift operation and extra int cast before the first multiplication give better performance.
// See comment in NextDouble().
- return minValue + (double)(int)(w >> 1) * IntToDoubleMultiplier * range;
+ return minValue + ((double)(int)(w >> 1) * IntToDoubleMultiplier * range);
}
/// <summary>
@@ -117,21 +117,11 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="FieldsMustBePrivate">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
<Rule Name="FileMayOnlyContainASingleClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -197,8 +197,8 @@ TransformationConvention convention
double re = samples[odd];
double im = samples[odd + 1];
- double tmpr = re * uR - im * uI;
- double tmpi = re * uI + im * uR;
+ double tmpr = (re * uR) - (im * uI);
+ double tmpi = (re * uI) + (im * uR);
re = samples[even];
im = samples[even + 1];
@@ -252,8 +252,8 @@ TransformationConvention convention
double re = samples[odd];
double im = samples[odd + 1];
- double tmpr = re * uR - im * uI;
- double tmpi = re * uI + im * uR;
+ double tmpr = (re * uR) - (im * uI);
+ double tmpi = (re * uI) + (im * uR);
re = samples[even];
im = samples[even + 1];
@@ -421,12 +421,12 @@ int levels
realBackward[i] = uRealBw;
imagBackward[i] = uImagBw;
- uwI = uImagFw * wRreal - uRealFw * wImag;
- uRealFw = uRealFw * wRreal + uImagFw * wImag;
+ uwI = (uImagFw * wRreal) - (uRealFw * wImag);
+ uRealFw = (uRealFw * wRreal) + (uImagFw * wImag);
uImagFw = uwI;
- uwI = uImagBw * wRreal + uRealBw * wImag;
- uRealBw = uRealBw * wRreal - uImagBw * wImag;
+ uwI = (uImagBw * wRreal) + (uRealBw * wImag);
+ uRealBw = (uRealBw * wRreal) - (uImagBw * wImag);
uImagBw = uwI;
}
Oops, something went wrong.

0 comments on commit fdaa82e

Please sign in to comment.