public bool Includes(int x, int y) { lock (this) { Coloumn cc = GetColoumn(x); if (cc == null) { return(false); } return(cc.Includes(y)); } }
public T Get(int x, int y) { lock (this) { Coloumn cc = GetColoumn(x); if (cc == null) { return(default(T)); } return(cc.Get(y)); } }
public bool Add(int x, int y, T item) { lock (this) { if (Includes(x, y)) { return(false); } Coloumn cc = GetColoumn(x); if (cc == null) { cc = new Coloumn(x); Coloumns.Add(cc); } if (cc.Add(y, item)) { length++; return(true); } return(false); } }
private static List <Coloumn> FixNominals(List <Coloumn> tabletoProcess) { for (int i = 0; i < tabletoProcess.Count; i++) { if (tabletoProcess[i].type == "nominal") { //figure out majority number// already done with nominal automitically //process Coloumn coloumn = tabletoProcess[i]; /* * Console.WriteLine(coloumn.title+": "+ coloumn.MissingValueIndexes.Count); * * foreach (var item in coloumn.ValueEntries) * { * Console.WriteLine(tabletoProcess[i].type); * Console.WriteLine(item); * * }*/ // Console.WriteLine("BEFORE"); //Console.WriteLine(coloumn.MissingValueIndexes.Count + ":" + coloumn.majorityValue.value); coloumn.UpdateMajorityValue(); //Console.WriteLine("AFTER"); //Console.WriteLine(coloumn.MissingValueIndexes.Count + ":" + coloumn.majorityValue.value); for (int j = 0; j < coloumn.MissingValueIndexes.Count; j++) { coloumn.instances[coloumn.MissingValueIndexes[j]] = coloumn.majorityValue.value; } tabletoProcess[i] = coloumn; } } return(tabletoProcess); }