/// <summary> /// Adds seletion /// </summary> /// <param name="sel">Selection to add</param> public void AddSelection(IArgumentSelection sel) { if (selections.Count == 0) { selections.Add(sel); etalons.Add(sel); dim += sel.VectorDimension; return; } string[] variables = first.Variables; string[] var = sel.Variables; if (var.Length != variables.Length) { throw new Exception("Illegal number of variables"); } foreach (string s in var) { foreach (string s1 in variables) { if (s.Equals(s1)) { goto m1; } } throw new Exception("Illegal variables"); m1 : continue; } dim += sel.VectorDimension; etalons.Add(sel); selections.Add(sel.SynchronizedSelection(selections[0] as IArgumentSelection)); }
/// <summary> /// Calculates synchronized selection /// </summary> /// <param name="selection">The etalon selection</param> /// <returns>Synchronized selection</returns> public IArgumentSelection SynchronizedSelection(IArgumentSelection selection) { ArgumentMultiSelection sel = new ArgumentMultiSelection(); for (int i = 0; i < selections.Count; i++) { IArgumentSelection s = selections[i] as IArgumentSelection; sel.AddSelection(s.SynchronizedSelection(selection)); } return(sel); }