using System; using System.Collections; using System.IO; public class cogmod { public static void Main(string[] argv) { data_point[] training_data = read(argv[0]); data_point[] test_data = read(argv[1]); double[] weights = new double[3]; weights[0] = 0.3; weights[1] = 0.6; weights[2] = 0.5; double[,] res = calc(training_data, test_data, weights); for (int i=0; i 1) { Console.WriteLine("Found {0} when expected single character.", s); throw new Exception(); } return s[0]; } /** * category x * categories x and y */ int[] parse_category(string s) { int[] category; string[] t = s.Split(' '); if (t[0] == "category") { category = new int[1]; category[0] = c(t[1]) - 'A'; } else if (t[0] == "categories") { category = new int[2]; category[0] = c(t[1]) - 'A'; category[1] = c(t[3]) - 'A'; } else { throw new Exception(); } return category; } public bool is_in_category(int c) { for (int i=0; i