Esempio n. 1
0
        public static IEnumerable <T> Sequence <T>(
            this IExpressionEvaluator <T> evaluator,
            T seed,
            EvaluationFunction <T> function,
            EvaluationPredicate <T>?predicate = null
            ) where T : struct, IComparable <T>, IEquatable <T>
        {
            var index   = 0;
            var current = seed;

            while (predicate?.Invoke(evaluator, current, index) ?? true)
            {
                yield return(current);

                current = function(evaluator, current, index);
                index++;
            }
        }
Esempio n. 2
0
 internal bool Evaluate(RandomForestInstance instance)
 {
     return(EvaluationPredicate.Invoke(instance));
 }