protected internal MixtureComponent[] ToArray() { var allComponents = new PrunableMixtureComponent[0]; for (var i = 0; i < _numStreams; i++) { Concatenate(allComponents, _components[i]); } return(allComponents); }
public bool IsInTopComponents(PrunableMixtureComponent[] topComponents, PrunableMixtureComponent component) { foreach (var topComponent in topComponents) { if (topComponent.Id == component.Id) { return(true); } } return(false); }
public MixtureComponentSet(List <PrunableMixtureComponent[]> components, int topGauNum) { _components = components; _numStreams = components.Count; TopGauNum = topGauNum; GauNum = components[0].Length; _topComponents = new List <PrunableMixtureComponent[]>(); for (var i = 0; i < _numStreams; i++) { var featTopComponents = new PrunableMixtureComponent[topGauNum]; for (var j = 0; j < topGauNum; j++) { featTopComponents[j] = components[i][j]; } _topComponents.Add(featTopComponents); } _gauCalcSampleNumber = -1; _toStoreScore = false; _storedScores = new LinkedList <MixtureComponentSetScores>(); _curScores = null; }
private static void InsertTopComponent(PrunableMixtureComponent[] topComponents, PrunableMixtureComponent component) { int i; for (i = 0; i < topComponents.Length - 1; i++) { if (component.PartialScore < topComponents[i].PartialScore) { topComponents[i - 1] = component; return; } topComponents[i] = topComponents[i + 1]; } if (component.PartialScore < topComponents[topComponents.Length - 1].PartialScore) { topComponents[topComponents.Length - 2] = component; } else { topComponents[topComponents.Length - 1] = component; } }