using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AutoDiff { /// /// A visitor for the terms that has a result from its computations /// /// The type of the computation results public interface ITermVisitor { /// /// Computes a value for a constant term. /// /// The input term. /// The result of the computation. TResult Visit(Constant constant); /// /// Computes a value for a zero term. /// /// The input term. /// The result of the computation. TResult Visit(Zero zero); /// /// Computes a value for a power term. /// /// The input term. /// The result of the computation. TResult Visit(ConstPower power); /// /// Computes a value for a power term. /// /// The input term. /// The result of the computation. TResult Visit(TermPower power); /// /// Computes a value for a product term. /// /// The input term. /// The result of the computation. TResult Visit(Product product); /// /// Computes a value for a sum term. /// /// The input term. /// The result of the computation. TResult Visit(Sum sum); /// /// Computes a value for a variable term. /// /// The input term. /// The result of the computation. TResult Visit(Variable variable); /// /// Computes a value for a logarithm term. /// /// The input term. /// The result of the computation. TResult Visit(Log log); /// /// Computes a value for an exponential function term. /// /// The input term. /// The result of the computation. TResult Visit(Exp exp); /// /// Computes a value for an unary function /// /// The unary function /// The result of the computation TResult Visit(UnaryFunc func); /// /// Computes a value for a binary function /// /// The binary function /// The result of the computation TResult Visit(BinaryFunc func); /// /// Computes a value for a n-ary function /// /// The n-ary function /// The result of the computation TResult Visit(NaryFunc func); } }