Skip to content

Commit 6f5054e

Browse files
committed
fix
1 parent 2c153f6 commit 6f5054e

File tree

13 files changed

+22
-66
lines changed

13 files changed

+22
-66
lines changed

csharp/ToolGood.Algorithm.Fast/Internals/AntlrCharStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace ToolGood.Algorithm.Internals
1717
/// 'BEGIN' if constructor parameter upper=true but getText() would return
1818
/// 'BeGiN'.
1919
/// </summary>
20-
public sealed class AntlrCharStream : ICharStream
20+
sealed class AntlrCharStream : ICharStream
2121
{
2222
private ICharStream stream;
2323

csharp/ToolGood.Algorithm.Fast/Internals/AntlrErrorListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ToolGood.Algorithm.Internals
66
/// <summary>
77
/// 自定义ErrorListener
88
/// </summary>
9-
public sealed class AntlrErrorListener : IAntlrErrorListener<IToken>
9+
sealed class AntlrErrorListener : IAntlrErrorListener<IToken>
1010
{
1111
/// <summary>
1212
/// 是否出错

csharp/ToolGood.Algorithm.Fast/Internals/CharUtil.cs

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -83,60 +83,6 @@ public static bool Equals(string left, string arg1, string arg2, string arg3)
8383
if (Equals(left, arg3)) return true;
8484
return false;
8585
}
86-
87-
public static List<String> SplitFormula(String formula, List<char> splitChars)
88-
{
89-
List<String> result = new List<String>();
90-
bool inSquareBrackets = false;
91-
bool inBraceBrackets = false;
92-
int inBracketsCount = 0;
93-
bool inText = false;
94-
char textChar = (char)0;
95-
96-
StringBuilder str = new StringBuilder();
97-
int i = 0;
98-
while (i < formula.Length) {
99-
char c = formula[i];
100-
if (inSquareBrackets) {
101-
str.Append(c);
102-
if (c == ']') inSquareBrackets = false;
103-
} else if (inBraceBrackets) {
104-
str.Append(c);
105-
if (c == '}') inBraceBrackets = false;
106-
} else if (inText) {
107-
str.Append(c);
108-
if (c == '\\') {
109-
i++;
110-
if (i < formula.Length) {
111-
str.Append(formula[i]);
112-
}
113-
} else if (c == textChar) {
114-
inText = false;
115-
}
116-
} else if (splitChars.Contains(c) && inBracketsCount == 0) {
117-
result.Add(str.ToString());
118-
result.Add(c.ToString());
119-
str = new StringBuilder();
120-
} else {
121-
str.Append(c);
122-
if (c == '\'' || c == '"' || c == '`') {
123-
textChar = c;
124-
inText = true;
125-
} else if (c == '[') {
126-
inSquareBrackets = true;
127-
} else if (c == '{') {
128-
inBraceBrackets = true;
129-
} else if (c == '(') {
130-
inBracketsCount++;
131-
} else if (c == ')') {
132-
inBracketsCount--;
133-
}
134-
}
135-
i++;
136-
}
137-
if (str.Length > 0)
138-
result.Add(str.ToString());
139-
return result;
140-
}
86+
14187
}
14288
}

csharp/ToolGood.Algorithm.Fast/Internals/Functions/FunctionBase.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,22 @@ public abstract class FunctionBase
2121
/// <returns></returns>
2222
public abstract Operand Calculate(AlgorithmEngine work);
2323

24+
/// <summary>
25+
/// Returns a string that represents the current object.
26+
/// </summary>
27+
/// <returns>A string that represents the current object.</returns>
2428
public override string ToString()
2529
{
2630
StringBuilder stringBuilder = new StringBuilder();
2731
ToString(stringBuilder, false);
2832
return stringBuilder.ToString();
2933
}
34+
/// <summary>
35+
/// Appends a string representation of the current object to the specified StringBuilder, optionally including
36+
/// brackets.
37+
/// </summary>
38+
/// <param name="stringBuilder">The StringBuilder to which the string representation will be appended. Cannot be null.</param>
39+
/// <param name="addBrackets">true to enclose the string representation in brackets; otherwise, false.</param>
3040
public abstract void ToString(StringBuilder stringBuilder, bool addBrackets);
3141

3242

csharp/ToolGood.Algorithm.Fast/MathNet/Distributions/Binomial.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace ToolGood.Algorithm.MathNet.Numerics.Distributions
1010
/// <remarks>
1111
/// The distribution is parameterized by a probability (between 0.0 and 1.0).
1212
/// </remarks>
13-
public sealed class Binomial
13+
sealed class Binomial
1414
{
1515
/// <summary>
1616
/// Computes the probability mass (PMF) at k, i.e. P(X = k).

csharp/ToolGood.Algorithm.Fast/MathNet/Distributions/Exponential.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ToolGood.Algorithm.MathNet.Numerics.Distributions
77
/// The exponential distribution is a distribution over the real numbers parameterized by one non-negative parameter.
88
/// <a href="http://en.wikipedia.org/wiki/Exponential_distribution">Wikipedia - exponential distribution</a>.
99
/// </summary>
10-
public sealed class Exponential
10+
sealed class Exponential
1111
{
1212
/// <summary>
1313
/// Computes the probability density of the distribution (PDF) at x, i.e. ∂P(X ≤ x)/∂x.

csharp/ToolGood.Algorithm.Fast/MathNet/Distributions/Hypergeometric.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// describes the number of successes for draws with replacement
88
/// <a href="http://en.wikipedia.org/wiki/Hypergeometric_distribution">Wikipedia - Hypergeometric distribution</a>.
99
/// </summary>
10-
public sealed class Hypergeometric
10+
sealed class Hypergeometric
1111
{
1212
/// <summary>
1313
/// Computes the probability mass (PMF) at k, i.e. P(X = k).

csharp/ToolGood.Algorithm.Fast/MathNet/Distributions/NegativeBinomial.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace ToolGood.Algorithm.MathNet.Numerics.Distributions
99
/// when the probability of head is p.
1010
/// <a href="http://en.wikipedia.org/wiki/Negative_binomial_distribution">Wikipedia - NegativeBinomial distribution</a>.
1111
/// </summary>
12-
public sealed class NegativeBinomial
12+
sealed class NegativeBinomial
1313
{
1414
/// <summary>
1515
/// Computes the probability mass (PMF) at k, i.e. P(X = k).

csharp/ToolGood.Algorithm.Fast/MathNet/Distributions/Poisson.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace ToolGood.Algorithm.MathNet.Numerics.Distributions
1010
/// <para>Knuth's method is used to generate Poisson distributed random variables.</para>
1111
/// <para>f(x) = exp(-λ)*λ^x/x!;</para>
1212
/// </remarks>
13-
public sealed class Poisson
13+
sealed class Poisson
1414
{
1515
/// <summary>
1616
/// Computes the probability mass (PMF) at k, i.e. P(X = k).

csharp/ToolGood.Algorithm.Fast/MathNet/Distributions/Weibull.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace ToolGood.Algorithm.MathNet.Numerics.Distributions
1010
/// <remarks>
1111
/// The Weibull distribution is parametrized by a shape and scale parameter.
1212
/// </remarks>
13-
public sealed class Weibull
13+
sealed class Weibull
1414
{
1515
/// <summary>
1616
/// Computes the probability density of the distribution (PDF) at x, i.e. ∂P(X ≤ x)/∂x.

0 commit comments

Comments
 (0)