Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/21 15:24:58 (3 years ago)
Author:
gkronber
Message:

#3073 code improvements after reintegration of branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstraintsParser.cs

    r17906 r17911  
    7676    private const string weightRegex = @"\s*(weight:\s*(?<weight>\S*))?";
    7777    public static ShapeConstraint ParseFunctionRangeConstraint(string expr) {
    78       if (!expr.StartsWith("f")) throw new ArgumentException($"Invalid function range constraint {expr} (e.g. f in [1..2])", nameof(expr));
     78      if (!expr.StartsWith("f")) throw new ArgumentException($"Invalid function range constraint {expr} (e.g. f in [1..2])");
    7979      var start = "f".Length;
    8080      var end = expr.Length;
     
    131131          return new ShapeConstraint(interval, weight);
    132132      } else
    133         throw new ArgumentException($"The inserted target constraint {expr} is not valid.", nameof(expr));
     133        throw new ArgumentException($"The target constraint {expr} is not valid.");
    134134    }
    135135    public static ShapeConstraint ParseDerivationConstraint(string expr) {
     
    161161        if (enumeratorNumDeriv != "" || denominatorNumDeriv != "") {
    162162          if (enumeratorNumDeriv == "" || denominatorNumDeriv == "")
    163             throw new ArgumentException($"Number of derivation has to be written on both sides in {expr}.", nameof(expr));
     163            throw new ArgumentException($"Number of derivation has to be written on both sides in {expr}.");
    164164          if (enumeratorNumDeriv != denominatorNumDeriv)
    165             throw new ArgumentException($"Derivation number is not equal on both sides in {expr}.", nameof(expr));
     165            throw new ArgumentException($"Derivation number is not equal on both sides in {expr}.");
    166166        }
    167167
     
    193193          return new ShapeConstraint(variable, numberOfDerivation, interval, weight);
    194194      } else
    195         throw new ArgumentException($"The inserted derivation constraint {expr} is not valid.", nameof(expr));
     195        throw new ArgumentException($"The derivation constraint {expr} is not valid.");
    196196    }
    197197
Note: See TracChangeset for help on using the changeset viewer.