private static IEnumerable <StrokeFit> GetFunctions(TransformedStrokes strokes) { if (strokes == null) { return(Enumerable.Empty <StrokeFit>()); } StrokeData strokeData = strokes.GetStrokeData(); if (strokeData.Points.Length <= 3) { return(Enumerable.Empty <StrokeFit>()); } return(FitFunctions.Select(f => f(strokeData)).Where(f => f.IsValid).AsParallel().OrderBy(f => f)); }
public static Task <IEnumerable <StrokeFit> > GetFunctionAsync(TransformedStrokes strokes) { return(Task.Run(() => GetFunctions(strokes))); }