Exemplo n.º 1
0
        public static InputOutput FromCsvRow(string[] csvCells)
        {
            var endInput = Array.IndexOf(csvCells, "");

            if (endInput == -1)
                throw new Exception("No end of input found.");

            var inputTarget = new InputOutput
            {
                Input = new double[endInput],
                Output = new double[csvCells.Length - endInput - 1]
            };

            for (var i = 0; i < csvCells.Length; i++)
            {
                if (i < endInput)
                    inputTarget.Input[i] = double.Parse(csvCells[i]);

                if (i > endInput)
                    inputTarget.Output[i - endInput - 1] = double.Parse(csvCells[i]);
            }

            return inputTarget;
        }
Exemplo n.º 2
0
 protected bool Equals(InputOutput other)
 {
     return(Input.ListEquals(other.Input) && Output.ListEquals(other.Output));
 }
Exemplo n.º 3
0
 protected bool Equals(InputOutput other)
 {
     return Input.ListEquals(other.Input) && Output.ListEquals(other.Output);
 }