Skip to content

Commit c949c12

Browse files
committed
Fix stylecop issues
1 parent f39d7aa commit c949c12

File tree

12 files changed

+153
-152
lines changed

12 files changed

+153
-152
lines changed

Algorithms/DataCompression/BurrowsWheelerTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class BurrowsWheelerTransform
1616
/// rotation matrix.
1717
/// </summary>
1818
/// <param name="s">Input string.</param>
19-
public (string encoded, int index) Encode(string s)
19+
public (string Encoded, int Index) Encode(string s)
2020
{
2121
if (s.Length == 0)
2222
{

Algorithms/Graph/FloydWarshall.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class FloydWarshall<T>
4949
{
5050
for (var j = 0; j < distances.GetLength(0); j++)
5151
{
52-
var dist = graph.AdjacentDistance(graph.Vertices[i] !, graph.Vertices[j] !);
52+
var dist = graph.AdjacentDistance(graph.Vertices[i]!, graph.Vertices[j]!);
5353
distances[i, j] = dist != 0 ? dist : double.PositiveInfinity;
5454
}
5555
}

Algorithms/LinearAlgebra/Eigenvalue/PowerIteration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class PowerIteration
2727
/// <returns>Dominant eigenvalue and eigenvector pair.</returns>
2828
/// <exception cref="ArgumentException">The <paramref name="source" /> matrix is not square-shaped.</exception>
2929
/// <exception cref="ArgumentException">The length of the start vector doesn't equal the size of the source matrix.</exception>
30-
public static (double eigenvalue, double[] eigenvector) Dominant(
30+
public static (double Eigenvalue, double[] Eigenvector) Dominant(
3131
double[,] source,
3232
double[] startVector,
3333
double error = 0.00001)
@@ -61,7 +61,7 @@ public static (double eigenvalue, double[] eigenvector) Dominant(
6161

6262
var eigenvalue = source.Multiply(currentEigenVector.ToColumnVector()).ToRowVector().Magnitude();
6363

64-
return (eigenvalue, eigenvector: currentEigenVector);
64+
return (eigenvalue, Eigenvector: currentEigenVector);
6565
}
6666

6767
/// <summary>
@@ -81,6 +81,6 @@ public static (double eigenvalue, double[] eigenvector) Dominant(
8181
/// <returns>Dominant eigenvalue and eigenvector pair.</returns>
8282
/// <exception cref="ArgumentException">The <paramref name="source" /> matrix is not square-shaped.</exception>
8383
/// <exception cref="ArgumentException">The length of the start vector doesn't equal the size of the source matrix.</exception>
84-
public static (double eigenvalue, double[] eigenvector) Dominant(double[,] source, double error = 0.00001) =>
84+
public static (double Eigenvalue, double[] Eigenvector) Dominant(double[,] source, double error = 0.00001) =>
8585
Dominant(source, new Random().NextVector(source.GetLength(1)), error);
8686
}

Algorithms/ModularArithmetic/ChineseRemainderTheorem.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static long Compute(List<long> listOfAs, List<long> listOfNs)
4949
var n_i = listOfNs[i];
5050
var modulus_i = prodN / n_i;
5151

52-
var bezout_modulus_i = ExtendedEuclideanAlgorithm.Compute(n_i, modulus_i).bezoutB;
52+
var bezout_modulus_i = ExtendedEuclideanAlgorithm.Compute(n_i, modulus_i).BezoutB;
5353
result += a_i * bezout_modulus_i * modulus_i;
5454
}
5555

@@ -102,7 +102,7 @@ public static BigInteger Compute(List<BigInteger> listOfAs, List<BigInteger> lis
102102
var n_i = listOfNs[i];
103103
var modulus_i = prodN / n_i;
104104

105-
var bezout_modulus_i = ExtendedEuclideanAlgorithm.Compute(n_i, modulus_i).bezoutB;
105+
var bezout_modulus_i = ExtendedEuclideanAlgorithm.Compute(n_i, modulus_i).BezoutB;
106106
result += a_i * bezout_modulus_i * modulus_i;
107107
}
108108

@@ -145,7 +145,7 @@ private static void CheckRequirements(List<long> listOfAs, List<long> listOfNs)
145145
for (var j = i + 1; j < listOfNs.Count; j++)
146146
{
147147
long gcd;
148-
if ((gcd = ExtendedEuclideanAlgorithm.Compute(listOfNs[i], listOfNs[j]).gcd) != 1L)
148+
if ((gcd = ExtendedEuclideanAlgorithm.Compute(listOfNs[i], listOfNs[j]).Gcd) != 1L)
149149
{
150150
throw new ArgumentException($"The GCD of n_{i} = {listOfNs[i]} and n_{j} = {listOfNs[j]} equals {gcd} and thus these values aren't coprime.");
151151
}
@@ -182,7 +182,7 @@ private static void CheckRequirements(List<BigInteger> listOfAs, List<BigInteger
182182
for (var j = i + 1; j < listOfNs.Count; j++)
183183
{
184184
BigInteger gcd;
185-
if ((gcd = ExtendedEuclideanAlgorithm.Compute(listOfNs[i], listOfNs[j]).gcd) != BigInteger.One)
185+
if ((gcd = ExtendedEuclideanAlgorithm.Compute(listOfNs[i], listOfNs[j]).Gcd) != BigInteger.One)
186186
{
187187
throw new ArgumentException($"The GCD of n_{i} = {listOfNs[i]} and n_{j} = {listOfNs[j]} equals {gcd} and thus these values aren't coprime.");
188188
}

Algorithms/ModularArithmetic/ModularMultiplicativeInverse.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public static long Compute(long a, long n)
2020
var eeaResult = ExtendedEuclideanAlgorithm.Compute(a, n);
2121

2222
// Check if there is an inverse:
23-
if (eeaResult.gcd != 1)
23+
if (eeaResult.Gcd != 1)
2424
{
2525
throw new ArithmeticException($"{a} is not invertible in Z/{n}Z.");
2626
}
2727

2828
// Make sure, inverseOfA (i.e. the bezout coefficient of a) is in the interval [0, n).
29-
var inverseOfA = eeaResult.bezoutA;
29+
var inverseOfA = eeaResult.BezoutA;
3030
if (inverseOfA < 0)
3131
{
3232
inverseOfA += n;
@@ -47,13 +47,13 @@ public static BigInteger Compute(BigInteger a, BigInteger n)
4747
var eeaResult = ExtendedEuclideanAlgorithm.Compute(a, n);
4848

4949
// Check if there is an inverse:
50-
if (eeaResult.gcd != 1)
50+
if (eeaResult.Gcd != 1)
5151
{
5252
throw new ArithmeticException($"{a} is not invertible in Z/{n}Z.");
5353
}
5454

5555
// Make sure, inverseOfA (i.e. the bezout coefficient of a) is in the interval [0, n).
56-
var inverseOfA = eeaResult.bezoutA;
56+
var inverseOfA = eeaResult.BezoutA;
5757
if (inverseOfA < 0)
5858
{
5959
inverseOfA += n;

Algorithms/Search/FastSearcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public int FindIndex(Span<int> array, int item)
4444
return from + FindIndex(array.Slice(from, to - from + 1), item);
4545
}
4646

47-
private (int left, int right) ComputeIndices(Span<int> array, int item)
47+
private (int Left, int Right) ComputeIndices(Span<int> array, int item)
4848
{
4949
var indexBinary = array.Length / 2;
5050

@@ -62,7 +62,7 @@ public int FindIndex(Span<int> array, int item)
6262
: (indexInterpolation, indexBinary);
6363
}
6464

65-
private (int from, int to) SelectSegment(Span<int> array, int left, int right, int item)
65+
private (int From, int To) SelectSegment(Span<int> array, int left, int right, int item)
6666
{
6767
if (item < array[left])
6868
{

Algorithms/Sorters/Comparison/MergeSorter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private static void Merge(T[] array, T[] left, T[] right, IComparer<T> comparer)
5757
}
5858
}
5959

60-
private static (T[] left, T[] right) Split(T[] array)
60+
private static (T[] Left, T[] Right) Split(T[] array)
6161
{
6262
var mid = array.Length / 2;
6363
return (array.Take(mid).ToArray(), array.Skip(mid).ToArray());

0 commit comments

Comments
 (0)