Permalink
Browse files

StyleCop

  • Loading branch information...
1 parent 7da13c2 commit 9c0458a5c846c3a1ef6dc414f446e264ee2ccb14 @cdrnet cdrnet committed Dec 31, 2008
@@ -184,7 +184,7 @@ SampleList samples
throw new InvalidOperationException(Properties.LocalStrings.InvalidOperationNoSamplesProvided);
}
- const double tiny = 1.0e-15;
+ const double Tiny = 1.0e-15;
int closestIndex;
int offset = SuggestOffset(t, out closestIndex);
double[] c = new double[_effectiveOrder];
@@ -200,7 +200,7 @@ SampleList samples
for(int i = 0; i < _effectiveOrder; i++)
{
c[i] = _samples.GetX(offset + i);
- d[i] = c[i] + tiny; // prevent rare zero-over-zero condition
+ d[i] = c[i] + Tiny; // prevent rare zero-over-zero condition
}
double x = _samples.GetX(offset + ns--);
@@ -119,7 +119,7 @@ IList<double> x
double t
)
{
- const double tiny = 1.0e-25;
+ const double Tiny = 1.0e-25;
int n = _t.Count;
double[] c = new double[n];
@@ -143,7 +143,7 @@ IList<double> x
}
c[i] = _x[i];
- d[i] = _x[i] + tiny;
+ d[i] = _x[i] + Tiny;
}
double x = _x[nearestIndex];
@@ -162,7 +162,7 @@ public int EffectiveOrder
throw new InvalidOperationException(Properties.LocalStrings.InvalidOperationNoSamplesProvided);
}
- const double tiny = 1.0e-15;
+ const double Tiny = 1.0e-15;
int closestIndex;
int offset = SuggestOffset(t, out closestIndex);
double[] c = new double[_effectiveOrder];
@@ -180,7 +180,7 @@ public int EffectiveOrder
for(int i = 0; i < _effectiveOrder; i++)
{
c[i] = _samples.GetX(offset + i);
- d[i] = c[i] + tiny; // prevent rare zero-over-zero condition
+ d[i] = c[i] + Tiny; // prevent rare zero-over-zero condition
}
x = _samples.GetX(offset + ns--);
@@ -43,14 +43,14 @@ namespace MathNet.Numerics
{
/// <summary>
/// [STUB] The mathematical set of natural numbers (including zero), supporting an arbitrary number of digits.
+ /// Note, this class will be refactored to use .Net 4's BigInteger as soon as available.
/// </summary>
- [Obsolete("Please use the BigInteger class as provided by .Net 4 instead.")]
public class Natural : IEquatable<Natural>, IComparable<Natural>
{
- const byte _radixBits = 32;
- const ulong _radix = ((ulong)1) << _radixBits;
- const uint _bound32 = 1; // (uint)Math.Ceiling(32d / _radixBits);
- const uint _bound64 = 2; // (uint)Math.Ceiling(64d / _radixBits);
+ const byte FixedRadixBits = 32;
+ const ulong FixedRadix = ((ulong)1) << FixedRadixBits;
+ const uint Bound32 = 1; // (uint)Math.Ceiling(32d / _radixBits);
+ const uint Bound64 = 2; // (uint)Math.Ceiling(64d / _radixBits);
uint _bound;
uint[] _coeff;
@@ -121,7 +121,7 @@ public uint Degree
[CLSCompliant(false)]
public ulong Radix
{
- get { return _radix; }
+ get { return FixedRadix; }
}
/// <summary>
@@ -179,7 +179,7 @@ public static
ulong number
)
{
- Natural n = new Natural(_bound64);
+ Natural n = new Natural(Bound64);
n.AddCoefficientInplace(number, 0);
return n;
}
@@ -194,7 +194,7 @@ public static
uint number
)
{
- Natural n = new Natural(_bound32);
+ Natural n = new Natural(Bound32);
n.AddCoefficientInplace(number, 0);
return n;
}
@@ -285,9 +285,9 @@ uint carry
ulong sum = (ulong)this[i] + number[i] + carry;
carry = 0;
- while(sum >= _radix)
+ while(sum >= FixedRadix)
{
- sum -= _radix;
+ sum -= FixedRadix;
carry++;
}
@@ -306,10 +306,10 @@ uint exponent
{
long sum = (long)_coeff[exponent] + (long)coeff;
- while(sum >= (long)_radix)
+ while(sum >= (long)FixedRadix)
{
long r;
- sum = _coeff[exponent + 1] + Math.DivRem(sum, (long)_radix, out r);
+ sum = _coeff[exponent + 1] + Math.DivRem(sum, (long)FixedRadix, out r);
_coeff[exponent++] = (uint)r;
}
@@ -381,7 +381,7 @@ Natural number
while(sum < 0)
{
- sum += (long)_radix;
+ sum += (long)FixedRadix;
carry++;
}
@@ -430,8 +430,8 @@ uint exponent
}
long r;
- sum = _coeff[exponent + 1] - Math.DivRem(-sum, (long)_radix, out r);
- _coeff[exponent++] = (r == 0) ? 0 : (uint)(_radix - (ulong)r);
+ sum = _coeff[exponent + 1] - Math.DivRem(-sum, (long)FixedRadix, out r);
+ _coeff[exponent++] = (r == 0) ? 0 : (uint)(FixedRadix - (ulong)r);
}
_coeff[exponent] = (uint)sum;
@@ -525,7 +525,7 @@ Natural b
uint factor
)
{
- uint len = _bound + _bound32;
+ uint len = _bound + Bound32;
Natural ret = new Natural(len);
for(uint i = 0; i < _bound; i++)
@@ -27,11 +27,6 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="ConstFieldNamesMustBeginWithUpperCaseLetter">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -92,11 +87,6 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="DeclarationKeywordsMustFollowOrder">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
<Rule Name="UsingDirectivesMustBeOrderedAlphabeticallyByNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
@@ -42,14 +42,14 @@ namespace MathNet.Numerics.Transformations
/// </summary>
internal sealed class InternalFFT
{
- const int maxLength = 1048576;
- const int minLength = 1;
- const int maxBits = 20;
- const int minBits = 0;
-
- int[][] _reversedBitsLookup = new int[maxBits][];
- double[,][] _realCoefficients = new double[maxBits + 1, 2][];
- double[,][] _imagCoefficients = new double[maxBits + 1, 2][];
+ const int MaxLength = 1048576;
+ const int MinLength = 1;
+ const int MaxBits = 20;
+ const int MinBits = 0;
+
+ int[][] _reversedBitsLookup = new int[MaxBits][];
+ double[,][] _realCoefficients = new double[MaxBits + 1, 2][];
+ double[,][] _imagCoefficients = new double[MaxBits + 1, 2][];
public
void

0 comments on commit 9c0458a

Please sign in to comment.