public static Col Create(string colName) { Col output = null; colName = colName.Trim(); bool hasMin = Test(MINIMIZE_CHAR, colName); bool hasMax = Test(MAXIMIZE_CHAR, colName); bool hasNumeric = Test(NUMERIC_CHAR, colName); bool hasGoal = Test(GOAL_CHAR, colName); if (hasMin || hasMax || hasNumeric) { output = new Num(colName); } else { output = new Sym(colName); } output.Goal = hasGoal || hasMin || hasMax; output.Minimize = hasMin; output.Weight = hasMin ? -1 : 1; return(output); }
public override Col Clone() { Sym result = (Sym)this.MemberwiseClone(); result.N = 0; result.counts = new Dictionary <string, int>(); result.modeCount = 0; result.Mode = null; return(result); }
public override bool IsCentralTendencyDifferent(Col other, double epsilon) { Sym otherSym = other as Sym; if (otherSym == null) { return(true); } return(otherSym.Mode != this.Mode); }
public override Col Clone() { Sym result = (Sym)this.MemberwiseClone(); result.N = 0; result.counts = new Dictionary <string, int>(); result.modeCount = 0; result.Mode = null; result.cells = new List <Cell>(); foreach (var cell in cells) { result.AddCell(cell); } return(result); }