/// <summary> /// Creates a new <see cref="NetworkParametersCollection{TMatrix}"/> from an existing <see cref="SCG.IList{T}"/> of /// <see cref="FrequencyParametersPair{TMatrix}"/> pairs. /// </summary> /// <param name="parameters">The list of parameters </param> /// <param name="sorted"></param> public NetworkParametersCollection(SCG.IList <FrequencyParametersPair <TMatrix> > parameters, bool sorted = false) { networkParameters = new Dictionary <double, TMatrix>(parameters.Count); frequencies = new SortedArray <double>(parameters.Count); foreach (var(frequency, data) in parameters) { networkParameters[frequency] = data; if (!sorted) { frequencies.Add(frequency); } } if (sorted) { frequencies.AddSorted(parameters.Select(p => p.Frequency_Hz)); } }