using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AutoDiff
{
///
/// Represents a product between two terms.
///
[Serializable]
public class Product : Term
{
///
/// Constructs a new instance of the type.
///
/// The first product term
/// The second product term
public Product(Term left, Term right)
{
Left = left;
Right = right;
}
///
/// Gets the first product term.
///
public Term Left { get; private set; }
///
/// Gets the second product term.
///
public Term Right { get; private set; }
///
/// Accepts a term visitor
///
/// The term visitor to accept
public override void Accept(ITermVisitor visitor)
{
visitor.Visit(this);
}
///
/// Accepts a term visitor with a generic result
///
/// The type of the result from the visitor's function
/// The visitor to accept
///
/// The result from the visitor's visit function.
///
public override TResult Accept(ITermVisitor visitor)
{
return visitor.Visit(this);
}
}
}