Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/17 01:15:25 (8 years ago)
Author:
pkimmesw
Message:

#2665 BenchmarkSuite, all examples, partially tested, VectorExpressions added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/ExampleArgumentConverter.cs

    r14834 r14875  
    77
    88  public static class ExampleArgumentConverter {
    9     private static readonly char[] ArrayValueSeparator = { ' ', ',', ';' };
     9    private static readonly char[] ArrayValueSeparator = { ' ', ';' };
    1010    private static readonly char[] ArraySymbolTrim = { '[', ']', '(', ')' };
     11
     12    public static double[] ConvertDoubles(string[] input) {
     13      return input.Select(ConvertDouble).ToArray();
     14    }
     15
    1116    public static double[] ConvertDoubles(string input) {
    1217      return ConvertMultiple(input, str => double.Parse(str, CultureInfo.InvariantCulture));
     
    1520    public static double ConvertDouble(string input) {
    1621      return double.Parse(input, CultureInfo.InvariantCulture);
     22    }
     23
     24    public static long[] ConvertIntegers(string[] input) {
     25      return input.Select(ConvertInteger).ToArray();
    1726    }
    1827
     
    2433
    2534      return string.IsNullOrEmpty(input) ? default(long) : long.Parse(input);
     35    }
     36
     37    public static string[] ConvertStringVector(string input) {
     38      return ConvertMultiple(input, s => s);
    2639    }
    2740
Note: See TracChangeset for help on using the changeset viewer.