Skip to content

Commit

Permalink
StyleCop
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrnet committed Dec 31, 2008
1 parent 7da13c2 commit 9c0458a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ double t
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];
Expand All @@ -200,7 +200,7 @@ double t
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--);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -143,7 +143,7 @@ double t
}

c[i] = _x[i];
d[i] = _x[i] + tiny;
d[i] = _x[i] + Tiny;
}

double x = _x[nearestIndex];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ out double error
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];
Expand All @@ -180,7 +180,7 @@ out double error
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--);
Expand Down
32 changes: 16 additions & 16 deletions src/app/MathNet.Iridium/Library/Natural.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -121,7 +121,7 @@ public uint Degree
[CLSCompliant(false)]
public ulong Radix
{
get { return _radix; }
get { return FixedRadix; }
}

/// <summary>
Expand Down Expand Up @@ -179,7 +179,7 @@ public static
ulong number
)
{
Natural n = new Natural(_bound64);
Natural n = new Natural(Bound64);
n.AddCoefficientInplace(number, 0);
return n;
}
Expand All @@ -194,7 +194,7 @@ public static
uint number
)
{
Natural n = new Natural(_bound32);
Natural n = new Natural(Bound32);
n.AddCoefficientInplace(number, 0);
return n;
}
Expand Down Expand Up @@ -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++;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -381,7 +381,7 @@ out bool underflow

while(sum < 0)
{
sum += (long)_radix;
sum += (long)FixedRadix;
carry++;
}

Expand Down Expand Up @@ -430,8 +430,8 @@ out bool underflow
}

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;
Expand Down Expand Up @@ -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++)
Expand Down
10 changes: 0 additions & 10 deletions src/app/MathNet.Iridium/Library/Settings.StyleCop
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
16 changes: 8 additions & 8 deletions src/app/MathNet.Iridium/Library/Transformations/InternalFFT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c0458a

Please sign in to comment.