Changeset 14875 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/ExampleArgumentConverter.cs
- Timestamp:
- 04/18/17 01:15:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/ExampleArgumentConverter.cs
r14834 r14875 7 7 8 8 public static class ExampleArgumentConverter { 9 private static readonly char[] ArrayValueSeparator = { ' ', ' ,', ';' };9 private static readonly char[] ArrayValueSeparator = { ' ', ';' }; 10 10 private static readonly char[] ArraySymbolTrim = { '[', ']', '(', ')' }; 11 12 public static double[] ConvertDoubles(string[] input) { 13 return input.Select(ConvertDouble).ToArray(); 14 } 15 11 16 public static double[] ConvertDoubles(string input) { 12 17 return ConvertMultiple(input, str => double.Parse(str, CultureInfo.InvariantCulture)); … … 15 20 public static double ConvertDouble(string input) { 16 21 return double.Parse(input, CultureInfo.InvariantCulture); 22 } 23 24 public static long[] ConvertIntegers(string[] input) { 25 return input.Select(ConvertInteger).ToArray(); 17 26 } 18 27 … … 24 33 25 34 return string.IsNullOrEmpty(input) ? default(long) : long.Parse(input); 35 } 36 37 public static string[] ConvertStringVector(string input) { 38 return ConvertMultiple(input, s => s); 26 39 } 27 40
Note: See TracChangeset
for help on using the changeset viewer.