Exemplo 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++;
            }
        }
Exemplo n.º 2
0
 internal bool Evaluate(RandomForestInstance instance)
 {
     return(EvaluationPredicate.Invoke(instance));
 }