evaluate method

  1. @override
dynamic evaluate(
  1. EvaluationType type,
  2. ContextModel context
)
override

Evaluates this expression according to given type and context.

Implementation

@override
dynamic evaluate(EvaluationType type, ContextModel context) {
  if (type == EvaluationType.REAL) {
    // Be lazy, convert to Ln.
    return asNaturalLogarithm().evaluate(type, context);
  }

  if (type == EvaluationType.INTERVAL) {
    // log_a([x, y]) = [log_a(x), log_a(y)] for [x, y] positive and a > 1
    return asNaturalLogarithm().evaluate(type, context);
  }

  throw UnimplementedError('Can not evaluate $name on $type yet.');
}