/// <summary> /// Takes metric function to compute distances between two <see cref="TF"/> /// </summary> /// <param name="metricFunc"></param> public DbscanAlgorithm(Func <TF, TF, double> metricFunc) { MetricFunction = metricFunc ?? throw new ArgumentNullException(nameof(metricFunc)); RegionQueryPredicate = (mainFeature, epsilon) => relatedPoint => MetricFunction(mainFeature, relatedPoint.Feature) <= epsilon; publisher = new EmptyDbscanEventPublisher(); }
public DbscanAlgorithm(Func <TF, TF, double> metricFunc, IDbscanEventPublisher publisher) : this(metricFunc) { this.publisher = publisher ?? throw new ArgumentNullException(nameof(publisher)); }