public void AddOutgoingEdge(HmmState <TValue, TObservation> to, double logProbability) { if (this.Model == null) { throw new InvalidOperationException(); } if (to == null) { throw new ArgumentNullException(nameof(to)); } if (to.Model != this.Model) { throw new ArgumentException(nameof(to)); } if (!(logProbability <= 0.0)) { throw new ArgumentOutOfRangeException(nameof(logProbability)); } if (double.IsNegativeInfinity(logProbability)) { this._outgoingEdges.Remove(to.Index); } else { this._outgoingEdges[to.Index] = logProbability; } }
public SingingPositionTracker(HmmState <PitchHmmState, PitchHmmEmission> startState) { this._model = startState.Model; // 初期状態はスタートが 1 this._stateLogProbabilities = new List <KeyValuePair <int, double> >(this._model.States.Count) { new KeyValuePair <int, double>(startState.Index, 0.0) }; }
public void AddState(HmmState <TStateValue, TObservation> state) { if (state == null) { throw new ArgumentNullException(nameof(state)); } state.SetModel(this, this._states.Count); this._states.Add(state); }