Index: /trunk/sources/HeuristicLab.ExtLibs.sln
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs.sln	(revision 8702)
+++ /trunk/sources/HeuristicLab.ExtLibs.sln	(revision 8703)
@@ -39,9 +39,9 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.WinFormsUI-2.7.0", "HeuristicLab.ExtLibs\HeuristicLab.WinFormsUI\2.7.0\HeuristicLab.WinFormsUI-2.7.0\HeuristicLab.WinFormsUI-2.7.0.csproj", "{3A32A015-9BF9-4EEB-AE80-C5E2B654B860}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.AutoDiff-1.0", "HeuristicLab.ExtLibs\HeuristicLab.AutoDiff\1.0\HeuristicLab.AutoDiff-1.0\HeuristicLab.AutoDiff-1.0.csproj", "{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoDiff-1.0", "HeuristicLab.ExtLibs\HeuristicLab.AutoDiff\1.0\AutoDiff-1.0\AutoDiff-1.0.csproj", "{62551FD3-C21F-4E16-A7FC-6A017508809C}"
+EndProject
 Global
-	GlobalSection(SubversionScc) = preSolution
-		Svn-Managed = True
-		Manager = AnkhSVN - Subversion Support for Visual Studio
-	EndGlobalSection
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -245,7 +245,31 @@
 		{3A32A015-9BF9-4EEB-AE80-C5E2B654B860}.Release|x86.ActiveCfg = Release|x86
 		{3A32A015-9BF9-4EEB-AE80-C5E2B654B860}.Release|x86.Build.0 = Release|x86
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Debug|x64.ActiveCfg = Debug|x64
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Debug|x64.Build.0 = Debug|x64
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Debug|x86.ActiveCfg = Debug|x86
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Debug|x86.Build.0 = Debug|x86
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Release|x64.ActiveCfg = Release|x64
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Release|x64.Build.0 = Release|x64
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Release|x86.ActiveCfg = Release|x86
+		{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}.Release|x86.Build.0 = Release|x86
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Release|x64.ActiveCfg = Release|Any CPU
+		{62551FD3-C21F-4E16-A7FC-6A017508809C}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(SubversionScc) = preSolution
+		Svn-Managed = True
+		Manager = AnkhSVN - Subversion Support for Visual Studio
+	EndGlobalSection
 EndGlobal
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/AutoDiff-1.0.csproj
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/AutoDiff-1.0.csproj	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/AutoDiff-1.0.csproj	(revision 8703)
@@ -0,0 +1,157 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{62551FD3-C21F-4E16-A7FC-6A017508809C}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>AutoDiff</RootNamespace>
+    <AssemblyName>AutoDiff-1.0</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <CodeContractsAssemblyMode>0</CodeContractsAssemblyMode>
+    <SccProjectName>
+    </SccProjectName>
+    <SccLocalPath>
+    </SccLocalPath>
+    <SccAuxPath>
+    </SccAuxPath>
+    <SccProvider>
+    </SccProvider>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
+    <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
+    <CodeContractsRuntimeThrowOnFailure>False</CodeContractsRuntimeThrowOnFailure>
+    <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
+    <CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
+    <CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
+    <CodeContractsBoundsObligations>False</CodeContractsBoundsObligations>
+    <CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
+    <CodeContractsContainerAnalysis>False</CodeContractsContainerAnalysis>
+    <CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
+    <CodeContractsRunInBackground>True</CodeContractsRunInBackground>
+    <CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
+    <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
+    <CodeContractsEmitXMLDocs>True</CodeContractsEmitXMLDocs>
+    <CodeContractsCustomRewriterAssembly />
+    <CodeContractsCustomRewriterClass />
+    <CodeContractsLibPaths />
+    <CodeContractsExtraRewriteOptions />
+    <CodeContractsExtraAnalysisOptions />
+    <CodeContractsBaseLineFile />
+    <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
+    <CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking>
+    <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
+    <CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
+    <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
+    <CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
+    <CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
+    <CodeContractsBoundsObligations>False</CodeContractsBoundsObligations>
+    <CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
+    <CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
+    <CodeContractsRunInBackground>True</CodeContractsRunInBackground>
+    <CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
+    <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
+    <CodeContractsEmitXMLDocs>True</CodeContractsEmitXMLDocs>
+    <CodeContractsCustomRewriterAssembly />
+    <CodeContractsCustomRewriterClass />
+    <CodeContractsLibPaths />
+    <CodeContractsExtraRewriteOptions />
+    <CodeContractsExtraAnalysisOptions />
+    <CodeContractsBaseLineFile />
+    <CodeContractsCacheAnalysisResults>False</CodeContractsCacheAnalysisResults>
+    <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
+    <CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BinaryFunc.cs" />
+    <Compile Include="CompiledDifferentiator.Compiler.cs" />
+    <Compile Include="CompiledDifferentiator.cs" />
+    <Compile Include="CompiledDifferentiator.Eval.cs" />
+    <Compile Include="CompiledDifferentiator.ForwardSweepVisitor.cs" />
+    <Compile Include="Compiled\BinaryFunc.cs" />
+    <Compile Include="Compiled\Constant.cs" />
+    <Compile Include="Compiled\Exp.cs" />
+    <Compile Include="Compiled\InputConnection.cs" />
+    <Compile Include="Compiled\ITapeVisitor.cs" />
+    <Compile Include="Compiled\Log.cs" />
+    <Compile Include="Compiled\NaryFunc.cs" />
+    <Compile Include="Compiled\ConstPower.cs" />
+    <Compile Include="Compiled\Product.cs" />
+    <Compile Include="Compiled\Sum.cs" />
+    <Compile Include="Compiled\TapeElement.cs" />
+    <Compile Include="Compiled\TermPower.cs" />
+    <Compile Include="Compiled\UnaryFunc.cs" />
+    <Compile Include="Compiled\Variable.cs" />
+    <Compile Include="Constant.cs" />
+    <Compile Include="Exp.cs" />
+    <Compile Include="ICompiledTerm.cs" />
+    <Compile Include="ConstPower.cs" />
+    <Compile Include="IParametricCompiledTerm.cs" />
+    <Compile Include="ITermVisitor.cs" />
+    <Compile Include="ITermVisitor.generic.cs" />
+    <Compile Include="Log.cs" />
+    <Compile Include="NaryFunc.cs" />
+    <Compile Include="ParametricCompiledTerm.cs" />
+    <Compile Include="Product.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TermPower.cs" />
+    <Compile Include="UnaryFunc.cs" />
+    <Compile Include="Sum.cs" />
+    <Compile Include="Term.cs" />
+    <Compile Include="TermBuilder.cs" />
+    <Compile Include="TermUtils.cs" />
+    <Compile Include="TVec.cs" />
+    <Compile Include="Variable.cs" />
+    <Compile Include="Zero.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/BinaryFunc.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/BinaryFunc.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/BinaryFunc.cs	(revision 8703)
@@ -0,0 +1,104 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a custom binary function term. The user provides custom delegates
+    /// to evaluate and compute the gradient of the function.
+    /// </summary>
+    public class BinaryFunc : Term
+    {
+        private readonly Func<double, double, double> eval;
+        private readonly Func<double, double, Tuple<double, double>> diff;
+        private readonly Term left;
+        private readonly Term right;
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="BinaryFunc"/> class.
+        /// </summary>
+        /// <param name="eval">The evaluation method for the custom function.</param>
+        /// <param name="diff">The differentiation method for the custom function.</param>
+        /// <param name="left">The left argument term for the binary function.</param>
+        /// <param name="right">The right argument term for the binary function.</param>
+        public BinaryFunc(
+            Func<double, double, double> eval, 
+            Func<double, double, Tuple<double, double>> diff,
+            Term left, Term right)
+        {
+            Contract.Requires(eval != null);
+            Contract.Requires(diff != null);
+            Contract.Requires(left != null);
+            Contract.Requires(right != null);
+
+            Contract.Ensures(Eval == eval);
+            Contract.Ensures(Diff == diff);
+            Contract.Ensures(Left == left);
+            Contract.Ensures(Right == right);
+
+            this.eval = eval;
+            this.diff = diff;
+            this.left = left;
+            this.right = right;
+        }
+
+        /// <summary>
+        /// Constructs a factory delegate that creates similary binary functions for different terms.
+        /// </summary>
+        /// <param name="eval">The evaluation method for the custom function.</param>
+        /// <param name="diff">The differentiation method for the custom function.</param>
+        /// <returns>The described factory delegate</returns>
+        public static Func<Term, Term, BinaryFunc> Factory(Func<double, double, double> eval, Func<double, double, Tuple<double, double>> diff)
+        {
+            Contract.Requires(eval != null);
+            Contract.Requires(diff != null);
+            Contract.Ensures(Contract.Result < Func<Term, Term, BinaryFunc>>() != null);
+
+            Func<Term, Term, BinaryFunc> result = (left, right) => new BinaryFunc(eval, diff, left, right);
+            return result;
+        }
+
+        /// <summary>
+        /// Gets the evaluation delegate
+        /// </summary>
+        public Func<double, double, double> Eval { get { return eval; } }
+
+        /// <summary>
+        /// Gets the differentiation delegate
+        /// </summary>
+        public Func<double, double, Tuple<double, double>> Diff { get { return diff; } }
+
+        /// <summary>
+        /// Gets the function's left argument term
+        /// </summary>
+        public Term Left { get { return left; } }
+
+        /// <summary>
+        /// Gets the function's right argument term
+        /// </summary>
+        public Term Right { get { return right; } }
+
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>The result from the visitor's visit function.</returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/BinaryFunc.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/BinaryFunc.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/BinaryFunc.cs	(revision 8703)
@@ -0,0 +1,20 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    class BinaryFunc : TapeElement
+    {
+        public int Left;
+        public int Right;
+        public Func<double, double, double> Eval;
+        public Func<double, double, Tuple<double, double>> Diff;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/ConstPower.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/ConstPower.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/ConstPower.cs	(revision 8703)
@@ -0,0 +1,18 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    class ConstPower : TapeElement
+    {
+        public int Base;
+        public double Exponent;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Constant.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Constant.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Constant.cs	(revision 8703)
@@ -0,0 +1,21 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+	class Constant : TapeElement
+	{
+        public Constant(double value)
+        {
+            Value = value;
+            Adjoint = 0;
+        }
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Exp.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Exp.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Exp.cs	(revision 8703)
@@ -0,0 +1,17 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+	class Exp : TapeElement
+    {
+        public int Arg;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+	}
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/ITapeVisitor.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/ITapeVisitor.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/ITapeVisitor.cs	(revision 8703)
@@ -0,0 +1,22 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    interface ITapeVisitor
+    {
+        void Visit(Constant elem);
+        void Visit(Exp elem);
+        void Visit(Log elem);
+        void Visit(ConstPower elem);
+        void Visit(TermPower elem);
+        void Visit(Product elem);
+        void Visit(Sum elem);
+        void Visit(Variable var);
+        void Visit(UnaryFunc elem);
+        void Visit(BinaryFunc elem);
+        void Visit(NaryFunc elem);
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/InputConnection.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/InputConnection.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/InputConnection.cs	(revision 8703)
@@ -0,0 +1,13 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    class InputEdge
+    {
+        public int Index;
+        public double Weight;
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Log.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Log.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Log.cs	(revision 8703)
@@ -0,0 +1,17 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+	class Log : TapeElement
+    {
+        public int Arg;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/NaryFunc.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/NaryFunc.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/NaryFunc.cs	(revision 8703)
@@ -0,0 +1,19 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    class NaryFunc : TapeElement
+    {
+        public int[] Terms;
+        public Func<double[], double> Eval;
+        public Func<double[], double[]> Diff;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Product.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Product.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Product.cs	(revision 8703)
@@ -0,0 +1,18 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+	class Product : TapeElement
+    {
+        public int Left;
+        public int Right;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+	}
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Sum.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Sum.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Sum.cs	(revision 8703)
@@ -0,0 +1,17 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+	class Sum : TapeElement
+    {
+        public int[] Terms;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+	}
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/TapeElement.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/TapeElement.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/TapeElement.cs	(revision 8703)
@@ -0,0 +1,16 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    abstract class TapeElement
+    {
+        public double Value;
+        public double Adjoint;
+        public InputEdge[] Inputs;
+
+        public abstract void Accept(ITapeVisitor visitor);
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/TermPower.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/TermPower.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/TermPower.cs	(revision 8703)
@@ -0,0 +1,18 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    class TermPower : TapeElement
+    {
+        public int Base;
+        public int Exponent;
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/UnaryFunc.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/UnaryFunc.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/UnaryFunc.cs	(revision 8703)
@@ -0,0 +1,25 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+    class UnaryFunc : TapeElement
+    {
+        public int Arg;
+        public readonly Func<double, double> Eval;
+        public readonly Func<double, double> Diff;
+
+        public UnaryFunc(Func<double, double> eval, Func<double, double> diff)
+        {
+            this.Eval = eval;
+            this.Diff = diff;
+        }
+
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Variable.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Variable.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Compiled/Variable.cs	(revision 8703)
@@ -0,0 +1,15 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff.Compiled
+{
+	class Variable : TapeElement
+	{
+        public override void Accept(ITapeVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+	}
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.Compiler.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.Compiler.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.Compiler.cs	(revision 8703)
@@ -0,0 +1,241 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using CompileResult = AutoDiff.Compiled.TapeElement;
+
+namespace AutoDiff
+{
+    partial class CompiledDifferentiator<T>
+    {
+        private class Compiler : ITermVisitor<int> // int --> the index of the compiled element in the tape
+        {
+            private readonly List<Compiled.TapeElement> tape;
+            private readonly Dictionary<Term, int> indexOf;
+
+            public Compiler(T variables, List<Compiled.TapeElement> tape)
+            {
+                this.tape = tape;
+                indexOf = new Dictionary<Term, int>();
+                foreach (var i in Enumerable.Range(0, variables.Count))
+                {
+                    indexOf[variables[i]] = i;
+                    tape.Add(new Compiled.Variable());
+                }
+            }
+
+            public void Compile(Term term)
+            {
+                term.Accept(this);
+            }
+
+            public int Visit(Constant constant)
+            {
+                return Compile(constant, () => new Compiled.Constant(constant.Value) { Inputs = new Compiled.InputEdge[0] });
+            }
+
+            public int Visit(Zero zero)
+            {
+                return Compile(zero, () => new Compiled.Constant(0) { Inputs = new Compiled.InputEdge[0] });
+            }
+
+            public int Visit(ConstPower intPower)
+            {
+                return Compile(intPower, () =>
+                    {
+                        var baseIndex = intPower.Base.Accept(this);
+                        var element = new Compiled.ConstPower
+                        {
+                            Base = baseIndex,
+                            Exponent = intPower.Exponent,
+                            Inputs = new Compiled.InputEdge[] 
+                            {
+                                new Compiled.InputEdge { Index = baseIndex },
+                            },
+                        };
+
+                        return element;
+                    });
+            }
+
+            public int Visit(TermPower power)
+            {
+                return Compile(power, () =>
+                {
+                    var baseIndex = power.Base.Accept(this);
+                    var expIndex = power.Exponent.Accept(this);
+                    var element = new Compiled.TermPower
+                    {
+                        Base = baseIndex,
+                        Exponent = expIndex,
+                        Inputs = new Compiled.InputEdge[]
+                        {
+                            new Compiled.InputEdge { Index = baseIndex },
+                            new Compiled.InputEdge { Index = expIndex },
+                        },
+                    };
+
+                    return element;
+                });
+            }
+
+            public int Visit(Product product)
+            {
+                return Compile(product, () =>
+                    {
+                        var leftIndex = product.Left.Accept(this);
+                        var rightIndex = product.Right.Accept(this);
+                        var element = new Compiled.Product
+                        {
+                            Left = leftIndex,
+                            Right = rightIndex,
+                            Inputs = new Compiled.InputEdge[]
+                            {
+                                new Compiled.InputEdge { Index = leftIndex },
+                                new Compiled.InputEdge { Index = rightIndex },
+                            }
+                        };
+
+                        return element;
+                    });
+            }
+
+            public int Visit(Sum sum)
+            {
+                return Compile(sum, () =>
+                    {
+                        var indicesQuery = from term in sum.Terms
+                                           select term.Accept(this);
+                        var indices = indicesQuery.ToArray();
+                        var element = new Compiled.Sum 
+                        { 
+                            Terms = indices,
+                            Inputs = indices.Select(x => new Compiled.InputEdge { Index = x }).ToArray(),
+                        };
+
+                        return element;
+                    });
+            }
+
+            public int Visit(Variable variable)
+            {
+                return indexOf[variable];
+            }
+
+            public int Visit(Log log)
+            {
+                return Compile(log, () =>
+                    {
+                        var argIndex = log.Arg.Accept(this);
+                        var element = new Compiled.Log 
+                        { 
+                            Arg = argIndex,
+                            Inputs = new Compiled.InputEdge[]
+                            {
+                                new Compiled.InputEdge { Index = argIndex },
+                            },
+                        };
+
+                        return element;
+                    });
+            }
+
+            public int Visit(Exp exp)
+            {
+                return Compile(exp, () =>
+                    {
+                        var argIndex = exp.Arg.Accept(this);
+                        var element = new Compiled.Exp
+                        {
+                            Arg = argIndex,
+                            Inputs = new Compiled.InputEdge[]
+                            {
+                                new Compiled.InputEdge { Index = argIndex },
+                            },
+                        };
+
+                        return element;
+                    });
+            }
+
+            public int Visit(UnaryFunc func)
+            {
+                return Compile(func, () =>
+                    {
+                        var argIndex = func.Argument.Accept(this);
+                        var element = new Compiled.UnaryFunc(func.Eval, func.Diff)
+                        {
+                            Arg = argIndex,
+                            Inputs = new Compiled.InputEdge[]
+                            {
+                                new Compiled.InputEdge { Index = argIndex },
+                            },
+                        };
+
+                        return element;
+                    });
+            }
+
+            public int Visit(BinaryFunc func)
+            {
+                return Compile(func, () =>
+                    {
+                        var leftIndex = func.Left.Accept(this);
+                        var rightIndex = func.Right.Accept(this);
+
+                        var element = new Compiled.BinaryFunc
+                        {
+                            Eval = func.Eval,
+                            Diff = func.Diff,
+                            Left = leftIndex,
+                            Right = rightIndex,
+                            Inputs = new Compiled.InputEdge[]
+                            {
+                                new Compiled.InputEdge { Index = leftIndex },
+                                new Compiled.InputEdge { Index = rightIndex },
+                            }
+                        };
+
+                        return element;
+                    });
+            }
+
+            public int Visit(NaryFunc func)
+            {
+                return Compile(func, () =>
+                {
+                    var indicesQuery = from term in func.Terms
+                                       select term.Accept(this);
+                    var indices = indicesQuery.ToArray();
+
+                    var element = new Compiled.NaryFunc
+                    {
+                        Eval = func.Eval,
+                        Diff = func.Diff,
+                        Terms = indices,
+                        Inputs = indices.Select(x => new Compiled.InputEdge { Index = x }).ToArray(),
+                    };
+
+                    return element;
+                });
+            }
+
+
+            private int Compile(Term term, Func<CompileResult> compiler)
+            {
+                int index;
+                if (!indexOf.TryGetValue(term, out index))
+                {
+                    var compileResult = compiler();
+                    tape.Add(compileResult);
+
+                    index = tape.Count - 1;
+                    indexOf.Add(term, index);
+                }
+
+                return index;
+            }
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.Eval.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.Eval.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.Eval.cs	(revision 8703)
@@ -0,0 +1,85 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    partial class CompiledDifferentiator<T>
+    {
+        private class EvalVisitor : Compiled.ITapeVisitor
+        {
+            private readonly Compiled.TapeElement[] tape;
+
+            public EvalVisitor(Compiled.TapeElement[] tape)
+            {
+                this.tape = tape;
+            }
+
+            public void Visit(Compiled.Constant elem)
+            {
+            }
+
+            public void Visit(Compiled.Exp elem)
+            {
+                elem.Value = Math.Exp(ValueOf(elem.Arg));
+            }
+
+            public void Visit(Compiled.Log elem)
+            {
+                elem.Value = Math.Log(ValueOf(elem.Arg));
+            }
+
+            public void Visit(Compiled.ConstPower elem)
+            {
+                elem.Value = Math.Pow(ValueOf(elem.Base), elem.Exponent);
+            }
+
+            public void Visit(Compiled.TermPower elem)
+            {
+                elem.Value = Math.Pow(ValueOf(elem.Base), ValueOf(elem.Exponent));
+            }
+
+            public void Visit(Compiled.Product elem)
+            {
+                elem.Value = ValueOf(elem.Left) * ValueOf(elem.Right);
+            }
+
+            public void Visit(Compiled.Sum elem)
+            {
+                elem.Value = 0;
+                for (int i = 0; i < elem.Terms.Length; ++i)
+                    elem.Value += ValueOf(elem.Terms[i]);
+            }
+
+            public void Visit(Compiled.Variable var)
+            {
+            }
+
+            public void Visit(Compiled.UnaryFunc elem)
+            {
+                elem.Value = elem.Eval(ValueOf(elem.Arg));
+            }
+
+            public void Visit(Compiled.BinaryFunc elem)
+            {
+                elem.Value = elem.Eval(ValueOf(elem.Left), ValueOf(elem.Right));
+            }
+
+            public void Visit(Compiled.NaryFunc elem)
+            {
+                double[] args = new double[elem.Terms.Length];
+                for(int i=0;i<args.Length;i++)
+                    args[i] = ValueOf(elem.Terms[i]);
+                elem.Value = elem.Eval(args);
+            }
+
+            private double ValueOf(int index)
+            {
+                return tape[index].Value;
+            }
+
+
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.ForwardSweepVisitor.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.ForwardSweepVisitor.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.ForwardSweepVisitor.cs	(revision 8703)
@@ -0,0 +1,114 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+
+namespace AutoDiff
+{
+    partial class CompiledDifferentiator<T>
+    {
+        private class ForwardSweepVisitor : Compiled.ITapeVisitor
+        {
+            private Compiled.TapeElement[] tape;
+
+            public ForwardSweepVisitor(Compiled.TapeElement[] tape)
+            {
+                this.tape = tape;
+            }
+
+            public void Visit(Compiled.Constant elem)
+            {
+            }
+
+            public void Visit(Compiled.Exp elem)
+            {
+                elem.Value = Math.Exp(ValueOf(elem.Arg));
+                elem.Inputs[0].Weight = elem.Value;
+            }
+
+            public void Visit(Compiled.Log elem)
+            {
+                double arg = ValueOf(elem.Arg);
+                elem.Value = Math.Log(arg);
+                elem.Inputs[0].Weight = 1 / arg;
+            }
+
+            public void Visit(Compiled.ConstPower elem)
+            {
+                double baseVal = ValueOf(elem.Base);
+                elem.Value = Math.Pow(baseVal, elem.Exponent);
+                elem.Inputs[0].Weight = elem.Exponent * Math.Pow(baseVal, elem.Exponent - 1);
+            }
+
+            public void Visit(Compiled.TermPower elem)
+            {
+                double baseVal = ValueOf(elem.Base);
+                double exponent = ValueOf(elem.Exponent);
+
+                elem.Value = Math.Pow(baseVal, exponent);
+                elem.Inputs[0].Weight = exponent * Math.Pow(baseVal, exponent - 1);
+                elem.Inputs[1].Weight = elem.Value * Math.Log(baseVal);
+            }
+
+            public void Visit(Compiled.Product elem)
+            {
+                double left = ValueOf(elem.Left);
+                double right = ValueOf(elem.Right);
+
+                elem.Value = left * right;
+                elem.Inputs[0].Weight = right;
+                elem.Inputs[1].Weight = left;
+            }
+
+            public void Visit(Compiled.Sum elem)
+            {
+                elem.Value = 0;
+                for (int i = 0; i < elem.Terms.Length; ++i)
+                    elem.Value += ValueOf(elem.Terms[i]);
+
+                for (int i = 0; i < elem.Inputs.Length; ++i)
+                    elem.Inputs[i].Weight = 1;
+            }
+
+            public void Visit(Compiled.Variable var)
+            {
+            }
+
+            public void Visit(Compiled.UnaryFunc elem)
+            {
+                double arg = ValueOf(elem.Arg);
+                elem.Value = elem.Eval(arg);
+                elem.Inputs[0].Weight = elem.Diff(arg);
+            }
+
+            public void Visit(Compiled.BinaryFunc elem)
+            {
+                double left = ValueOf(elem.Left);
+                double right = ValueOf(elem.Right);
+
+                elem.Value = elem.Eval(left, right);
+                var grad = elem.Diff(left, right);
+                elem.Inputs[0].Weight = grad.Item1;
+                elem.Inputs[1].Weight = grad.Item2;
+            }
+
+            public void Visit(Compiled.NaryFunc elem)
+            {
+                double[] args = new double[elem.Terms.Length];
+                for (int i = 0; i < args.Length; i++)
+                    args[i] = ValueOf(elem.Terms[i]);
+
+                elem.Value = elem.Eval(args);
+                var grad = elem.Diff(args);
+                for (int i = 0; i < grad.Length; ++i)
+                    elem.Inputs[i].Weight = grad[i];
+            }
+
+            private double ValueOf(int index)
+            {
+                return tape[index].Value;
+            }
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/CompiledDifferentiator.cs	(revision 8703)
@@ -0,0 +1,115 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics.Contracts;
+using System.Diagnostics;
+using System.Collections.ObjectModel;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Compiles the terms tree to a more efficient form for differentiation.
+    /// </summary>
+    internal partial class CompiledDifferentiator<T> : ICompiledTerm
+        where T : IList<Variable>
+    {
+        private readonly Compiled.TapeElement[] tape;
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="CompiledDifferentiator"/> class.
+        /// </summary>
+        /// <param name="function">The function.</param>
+        /// <param name="variables">The variables.</param>
+        public CompiledDifferentiator(Term function, T variables)
+        {
+            Contract.Requires(function != null);
+            Contract.Requires(variables != null);
+            Contract.Requires(Contract.ForAll(variables, variable => variable != null));
+            Contract.Ensures(Dimension == variables.Count);
+
+            if (function is Variable)
+                function = new ConstPower(function, 1);
+
+            var tapeList = new List<Compiled.TapeElement>();
+            new Compiler(variables, tapeList).Compile(function);
+            tape = tapeList.ToArray();
+
+            Dimension = variables.Count;
+            Variables = new ReadOnlyCollection<Variable>(variables);
+        }
+
+        public int Dimension { get; private set; }
+
+        public double Evaluate(double[] arg)
+        {
+            EvaluateTape(arg);
+            return tape.Last().Value;
+        }
+
+        public Tuple<double[], double> Differentiate<S>(S arg)
+            where S : IList<double>
+        {
+            ForwardSweep(arg);
+            ReverseSweep();
+
+            var gradient = tape.Take(Dimension).Select(elem => elem.Adjoint).ToArray();
+            var value = tape.Last().Value;
+
+            return Tuple.Create(gradient, value);
+        }
+
+        public Tuple<double[], double> Differentiate(params double[] arg)
+        {
+            return Differentiate<double[]>(arg);
+        }
+
+        private void ReverseSweep()
+        {
+            tape.Last().Adjoint = 1;
+            
+            // initialize adjoints
+            for (int i = 0; i < tape.Length - 1; ++i)
+                tape[i].Adjoint = 0;
+
+            // accumulate adjoints
+            for (int i = tape.Length - 1; i >= Dimension; --i)
+            {
+                var inputs = tape[i].Inputs;
+                var adjoint = tape[i].Adjoint;
+                
+                for(int j = 0; j < inputs.Length; ++j)
+                    tape[inputs[j].Index].Adjoint += adjoint * inputs[j].Weight;
+            }
+        }
+
+        private void ForwardSweep<S>(S arg)
+            where S : IList<double>
+        {
+            for (int i = 0; i < Dimension; ++i)
+                tape[i].Value = arg[i];
+
+            var forwardDiffVisitor = new ForwardSweepVisitor(tape);
+            for (int i = Dimension; i < tape.Length; ++i)
+                tape[i].Accept(forwardDiffVisitor);
+        }
+
+        private void EvaluateTape(double[] arg)
+        {
+            for(int i = 0; i < Dimension; ++i)
+                tape[i].Value = arg[i];
+            var evalVisitor = new EvalVisitor(tape);
+            for (int i = Dimension; i < tape.Length; ++i )
+                tape[i].Accept(evalVisitor);
+        }
+
+        private double ValueOf(int index)
+        {
+            return tape[index].Value;
+        }
+
+        public ReadOnlyCollection<Variable> Variables { get; private set; }
+
+
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ConstPower.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ConstPower.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ConstPower.cs	(revision 8703)
@@ -0,0 +1,57 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a constant-power function x^n, where n is constant.
+    /// </summary>
+    [Serializable]
+    public class ConstPower : Term
+    {
+        /// <summary>
+        /// Constructs a new instance of the <see cref="ConstPower"/> class.
+        /// </summary>
+        /// <param name="baseTerm">The base of the power function</param>
+        /// <param name="exponent">The exponent of the power function</param>
+        public ConstPower(Term baseTerm, double exponent)
+        {
+            Base = baseTerm;
+            Exponent = exponent;
+        }
+
+        /// <summary>
+        /// Gets the base term of the power function
+        /// </summary>
+        public Term Base { get; private set; }
+
+        /// <summary>
+        /// Gets the exponent term of the power function.
+        /// </summary>
+        public double Exponent { get; private set; }
+
+        /// <summary>
+        /// Accepts a term visitor.
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept.</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Constant.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Constant.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Constant.cs	(revision 8703)
@@ -0,0 +1,52 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// A constant value term
+    /// </summary>
+    [Serializable]
+    [DebuggerDisplay("Constant = {Value}")]
+    public class Constant : Term
+    {
+        /// <summary>
+        /// Constructs a new instance of the <see cref="Constant"/> class
+        /// </summary>
+        /// <param name="value">The value of the constant</param>
+        public Constant(double value)
+        {
+            Value = value;
+        }
+
+        /// <summary>
+        /// Gets the value of this constant
+        /// </summary>
+        public double Value { get; private set; }
+
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Exp.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Exp.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Exp.cs	(revision 8703)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents the exponential function <c>e^x</c>
+    /// </summary>
+    [Serializable]
+    public class Exp : Term
+    {
+        /// <summary>
+        /// Constructs a new instance of the <see cref="Exp"/> type.
+        /// </summary>
+        /// <param name="arg">The exponent of the function.</param>
+        public Exp(Term arg)
+        {
+            Arg = arg;
+        }
+
+        /// <summary>
+        /// Gets the exponent term.
+        /// </summary>
+        public Term Arg { get; private set; }
+
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ICompiledTerm.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ICompiledTerm.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ICompiledTerm.cs	(revision 8703)
@@ -0,0 +1,94 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections.ObjectModel;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a term after it has been compiled for efficient evaluation/differentiation.
+    /// </summary>
+    [ContractClass(typeof(CompiledTermContract))]
+    public interface ICompiledTerm
+    {
+        /// <summary>
+        /// Evaluates the compiled term at the given point.
+        /// </summary>
+        /// <param name="arg">The point at which to evaluate.</param>
+        /// <returns>The value of the function represented by the term at the given point.</returns>
+        /// <remarks>The number at <c>arg[i]</c> is the value assigned to the variable <c>Variables[i]</c>.</remarks>
+        double Evaluate(params double[] arg);
+
+        /// <summary>
+        /// Computes the gradient of the compiled term at the given point.
+        /// </summary>
+        /// <param name="arg">The point at which to differentiate.</param>
+        /// <returns>A tuple, where the first item is the gradient at <paramref name="arg"/> and the second item is 
+        /// the value at <paramref name="arg"/>. That is, the second value is the same as running <see cref="Evaluate"/> on 
+        /// <paramref name="arg"/>.</returns>
+        /// <remarks>The number at <c>arg[i]</c> is the value assigned to the variable <c>Variables[i]</c>.</remarks>
+        Tuple<double[], double> Differentiate<T>(T arg) where T : IList<double>;
+
+        /// <summary>
+        /// Computes the gradient of the compiled term at the given point.
+        /// </summary>
+        /// <param name="arg">The point at which to differentiate.</param>
+        /// <returns>A tuple, where the first item is the gradient at <paramref name="arg"/> and the second item is 
+        /// the value at <paramref name="arg"/>. That is, the second value is the same as running <see cref="Evaluate"/> on 
+        /// <paramref name="arg"/>.</returns>
+        /// <remarks>The number at <c>arg[i]</c> is the value assigned to the variable <c>Variables[i]</c>.</remarks>
+        Tuple<double[], double> Differentiate(params double[] arg);
+
+        /// <summary>
+        /// The collection of variables contained in this compiled term.
+        /// </summary>
+        /// <remarks>
+        /// The order of variables in this collection specifies the meaning of each argument in <see cref="Differentiate"/> or
+        /// <see cref="Evaluate"/>. That is, the variable at <c>Variables[i]</c> corresponds to the i-th parameter of <see cref="Differentiate"/>
+        /// and <see cref="Evaluate"/>.
+        /// </remarks>
+        ReadOnlyCollection<Variable> Variables { get; }
+    }
+
+    [ContractClassFor(typeof(ICompiledTerm))]
+    abstract class CompiledTermContract : ICompiledTerm
+    {
+        public double Evaluate(params double[] arg)
+        {
+            Contract.Requires(arg != null);
+            Contract.Requires(arg.Length == Variables.Count);
+            return default(double);
+        }
+
+        public Tuple<double[], double> Differentiate<T>(T arg)
+            where T : IList<double>
+        {
+            Contract.Requires(arg != null);
+            Contract.Requires(arg.Count == Variables.Count);
+            Contract.Ensures(Contract.Result<Tuple<double[], double>>() != null);
+            Contract.Ensures(Contract.Result<Tuple<double[], double>>().Item1.Length == arg.Count);
+            return null;
+        }
+
+        public Tuple<double[], double> Differentiate(params double[] arg)
+        {
+            Contract.Requires(arg != null);
+            Contract.Requires(arg.Length == Variables.Count);
+            Contract.Ensures(Contract.Result<Tuple<double[], double>>() != null);
+            Contract.Ensures(Contract.Result<Tuple<double[], double>>().Item1.Length == arg.Length);
+            return null;
+        }
+
+        public ReadOnlyCollection<Variable> Variables
+        {
+            get 
+            { 
+                Contract.Ensures(Contract.Result<ReadOnlyCollection<Variable>>() != null);
+                return null;
+            }
+        }
+    }
+
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/IParametricCompiledTerm.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/IParametricCompiledTerm.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/IParametricCompiledTerm.cs	(revision 8703)
@@ -0,0 +1,103 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections.ObjectModel;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a parametric term after it has been compiled for efficient evaluation/differentiation. A parametric
+    /// term has some variables that function as "constant parameters" and others that function as actual variables.
+    /// </summary>
+    [ContractClass(typeof(ParametricCompiledTermContract))]
+    public interface IParametricCompiledTerm
+    {
+        /// <summary>
+        /// Evaluates the compiled term at the given point.
+        /// </summary>
+        /// <param name="arg">The point at which to evaluate..</param>
+        /// <param name="parameters">The parameter values</param>
+        /// <returns>The value of the function represented by the term at the given point.</returns>
+        /// <remarks>The number at <c>arg[i]</c> is the value assigned to the variable <c>Variables[i]</c>.</remarks>
+        double Evaluate(double[] arg, double[] parameters);
+
+        /// <summary>
+        /// Computes the gradient of the compiled term at the given point.
+        /// </summary>
+        /// <param name="arg">The point at which to differentiate.</param>
+        /// <param name="parameters">The parameter values</param>
+        /// <returns>A tuple, where the first item is the gradient at <paramref name="arg"/> and the second item is 
+        /// the value at <paramref name="arg"/>. That is, the second value is the same as running <see cref="Evaluate"/> on 
+        /// <paramref name="arg"/> and <paramref name="parameters"/>.</returns>
+        /// <remarks>The number at <c>arg[i]</c> is the value assigned to the variable <c>Variables[i]</c>.</remarks>
+        Tuple<double[], double> Differentiate(double[] arg, double[] parameters);
+
+        /// <summary>
+        /// The collection of variables contained in this compiled term.
+        /// </summary>
+        /// <remarks>
+        /// The order of variables in this collection specifies the meaning of each argument in <see cref="Differentiate"/> or
+        /// <see cref="Evaluate"/>. That is, the variable at <c>Variables[i]</c> corresponds to the i-th element in the <c>arg</c> parameter of <see cref="Differentiate"/>
+        /// and <see cref="Evaluate"/>.
+        /// </remarks>
+        ReadOnlyCollection<Variable> Variables { get; }
+
+        /// <summary>
+        /// The collection of parameter variables contained in this compiled term.
+        /// </summary>
+        /// <remarks>
+        /// The order of variables in this collection specifies the meaning of each argument in <see cref="Differentiate"/> or
+        /// <see cref="Evaluate"/>. That is, the variable at <c>Variables[i]</c> corresponds to the i-th element in the <c>parameters</c> parameter of <see cref="Differentiate"/>
+        /// and <see cref="Evaluate"/>.
+        /// </remarks>
+        ReadOnlyCollection<Variable> Parameters { get; }
+    }
+
+    [ContractClassFor(typeof(IParametricCompiledTerm))]
+    abstract class ParametricCompiledTermContract : IParametricCompiledTerm
+    {
+
+        public double Evaluate(double[] arg, double[] parameters)
+        {
+            Contract.Requires(arg != null);
+            Contract.Requires(arg.Length == Variables.Count);
+            Contract.Requires(parameters != null);
+            Contract.Requires(parameters.Length == Parameters.Count);
+
+            return default(double);
+        }
+
+        public Tuple<double[], double> Differentiate(double[] arg, double[] parameters)
+        {
+            Contract.Requires(arg != null);
+            Contract.Requires(arg.Length == Variables.Count);
+            Contract.Requires(parameters != null);
+            Contract.Requires(parameters.Length == Parameters.Count);
+
+            Contract.Ensures(Contract.Result<Tuple<double[], double>>() != null);
+            Contract.Ensures(Contract.Result<Tuple<double[], double>>().Item1.Length == arg.Length);
+
+            return null;
+        }
+
+        public ReadOnlyCollection<Variable> Variables
+        {
+            get
+            {
+                Contract.Ensures(Contract.Result<ReadOnlyCollection<Variable>>() != null);
+                return null;
+            }
+        }
+
+        public ReadOnlyCollection<Variable> Parameters
+        {
+            get
+            {
+                Contract.Ensures(Contract.Result<ReadOnlyCollection<Variable>>() != null);
+                return null;
+            }
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ITermVisitor.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ITermVisitor.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ITermVisitor.cs	(revision 8703)
@@ -0,0 +1,85 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Visitor for terms that has no result from its computations.
+    /// </summary>
+    public interface ITermVisitor
+    {
+        /// <summary>
+        /// Performs an action for a constant term.
+        /// </summary>
+        /// <param name="constant">The input term.</param>
+        void Visit(Constant constant);
+
+        /// <summary>
+        /// Performs an action for a zero term.
+        /// </summary>
+        /// <param name="zero">The input term.</param>
+        void Visit(Zero zero);
+
+        /// <summary>
+        /// Performs an action for a constant power term.
+        /// </summary>
+        /// <param name="power">The input term.</param>
+        void Visit(ConstPower power);
+
+        /// <summary>
+        /// Performs an action for a power term.
+        /// </summary>
+        /// <param name="power">The input term.</param>
+        void Visit(TermPower power);
+
+        /// <summary>
+        /// Performs an action for a product term.
+        /// </summary>
+        /// <param name="product">The input term.</param>
+        void Visit(Product product);
+
+        /// <summary>
+        /// Performs an action for a sum term.
+        /// </summary>
+        /// <param name="sum">The input term.</param>
+        void Visit(Sum sum);
+
+        /// <summary>
+        /// Performs an action for a variable term.
+        /// </summary>
+        /// <param name="variable">The input term.</param>
+        void Visit(Variable variable);
+
+        /// <summary>
+        /// Performs an action for a logarithm term.
+        /// </summary>
+        /// <param name="log">The input term.</param>
+        void Visit(Log log);
+
+        /// <summary>
+        /// Performs an action for an exponential function term.
+        /// </summary>
+        /// <param name="exp">The input term.</param>
+        void Visit(Exp exp);
+
+        /// <summary>
+        /// Performs an action for an unary function.
+        /// </summary>
+        /// <param name="func">The unary function</param>
+        void Visit(UnaryFunc func);
+
+        /// <summary>
+        /// Performs an action for a binary function.
+        /// </summary>
+        /// <param name="func">The binary function</param>
+        void Visit(BinaryFunc func);
+
+        /// <summary>
+        /// Performs an action for a n-ary function.
+        /// </summary>
+        /// <param name="func">The n-ary function</param>
+        void Visit(NaryFunc func);
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ITermVisitor.generic.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ITermVisitor.generic.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ITermVisitor.generic.cs	(revision 8703)
@@ -0,0 +1,98 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// A visitor for the terms that has a result from its computations
+    /// </summary>
+    /// <typeparam name="TResult">The type of the computation results</typeparam>
+    public interface ITermVisitor<TResult>
+    {
+        /// <summary>
+        /// Computes a value for a constant term.
+        /// </summary>
+        /// <param name="constant">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(Constant constant);
+
+        /// <summary>
+        /// Computes a value for a zero term.
+        /// </summary>
+        /// <param name="zero">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(Zero zero);
+
+        /// <summary>
+        /// Computes a value for a power term.
+        /// </summary>
+        /// <param name="power">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(ConstPower power);
+
+        /// <summary>
+        /// Computes a value for a power term.
+        /// </summary>
+        /// <param name="power">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(TermPower power);
+
+        /// <summary>
+        /// Computes a value for a product term.
+        /// </summary>
+        /// <param name="product">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(Product product);
+
+        /// <summary>
+        /// Computes a value for a sum term.
+        /// </summary>
+        /// <param name="sum">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(Sum sum);
+
+        /// <summary>
+        /// Computes a value for a variable term.
+        /// </summary>
+        /// <param name="variable">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(Variable variable);
+
+        /// <summary>
+        /// Computes a value for a logarithm term.
+        /// </summary>
+        /// <param name="log">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(Log log);
+
+        /// <summary>
+        /// Computes a value for an exponential function term.
+        /// </summary>
+        /// <param name="exp">The input term.</param>
+        /// <returns>The result of the computation.</returns>
+        TResult Visit(Exp exp);
+
+        /// <summary>
+        /// Computes a value for an unary function
+        /// </summary>
+        /// <param name="func">The unary function</param>
+        /// <returns>The result of the computation</returns>
+        TResult Visit(UnaryFunc func);
+
+        /// <summary>
+        /// Computes a value for a binary function
+        /// </summary>
+        /// <param name="func">The binary function</param>
+        /// <returns>The result of the computation</returns>
+        TResult Visit(BinaryFunc func);
+
+        /// <summary>
+        /// Computes a value for a n-ary function
+        /// </summary>
+        /// <param name="func">The n-ary function</param>
+        /// <returns>The result of the computation</returns>
+        TResult Visit(NaryFunc func);
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Log.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Log.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Log.cs	(revision 8703)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a natural logarithm function
+    /// </summary>
+    [Serializable]
+    public class Log : Term
+    {
+        /// <summary>
+        /// Constructs a new instance of the <see cref="Log"/> class.
+        /// </summary>
+        /// <param name="arg">The argument of the natural logarithm</param>
+        public Log(Term arg)
+        {
+            Arg = arg;
+        }
+
+        /// <summary>
+        /// Accepts a terms visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Gets the natural logarithm argument.
+        /// </summary>
+        public Term Arg { get; private set; }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/NaryFunc.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/NaryFunc.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/NaryFunc.cs	(revision 8703)
@@ -0,0 +1,86 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics.Contracts;
+using System.Collections.ObjectModel;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a custom n-ary function term. The user provides custom delegates
+    /// to evaluate and compute the gradient of the function.
+    /// </summary>
+    public class NaryFunc : Term
+    {
+        private readonly Func<double[], double> eval;
+        private readonly Func<double[], double[]> diff;
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="NaryFunc"/> class.
+        /// </summary>
+        /// <param name="eval">The evaluation method for the custom function.</param>
+        /// <param name="diff">The differentiation method for the custom function.</param>
+        /// <param name="terms">The argument terms for the n-ary function.</param>
+        public NaryFunc(
+            Func<double[], double> eval,
+            Func<double[], double[]> diff,
+            IEnumerable<Term> terms)
+        {
+            this.eval = eval;
+            this.diff = diff;
+            this.Terms = Array.AsReadOnly(terms.ToArray());
+        }
+
+        /// <summary>
+        /// Constructs a factory delegate that creates similary n-ary functions for different terms.
+        /// </summary>
+        /// <param name="eval">The evaluation method for the custom function.</param>
+        /// <param name="diff">The differentiation method for the custom function.</param>
+        /// <returns>The described factory delegate</returns>
+        public static Func<IEnumerable<Term>, NaryFunc> Factory(Func<double[], double> eval, Func<double[], double[]> diff)
+        {
+            Contract.Requires(eval != null);
+            Contract.Requires(diff != null);
+            Contract.Ensures(Contract.Result<Func<IEnumerable<Term>, NaryFunc>>() != null);
+
+            Func<IEnumerable<Term>, NaryFunc> result = (terms) => new NaryFunc(eval, diff, terms);
+            return result;
+        }
+
+        /// <summary>
+        /// Gets the evaluation delegate
+        /// </summary>
+        public Func<double[], double> Eval { get { return eval; } }
+
+        /// <summary>
+        /// Gets the differentiation delegate
+        /// </summary>
+        public Func<double[], double[]> Diff { get { return diff; } }
+
+        /// <summary>
+        /// Gets the arguments of this function
+        /// </summary>
+        public ReadOnlyCollection<Term> Terms { get; private set; }
+
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>The result from the visitor's visit function.</returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ParametricCompiledTerm.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ParametricCompiledTerm.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/ParametricCompiledTerm.cs	(revision 8703)
@@ -0,0 +1,41 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections.ObjectModel;
+
+namespace AutoDiff
+{
+    class ParametricCompiledTerm : IParametricCompiledTerm
+    {
+        private readonly ICompiledTerm compiledTerm;
+
+        public ParametricCompiledTerm(Term term, Variable[] variables, Variable[] parameters)
+        {
+            compiledTerm = term.Compile(variables.Concat(parameters).ToArray());
+            Variables = Array.AsReadOnly(variables.ToArray());
+            Parameters = Array.AsReadOnly(parameters.ToArray());
+        }
+
+        public double Evaluate(double[] arg, double[] parameters)
+        {
+            var combinedArg = arg.Concat(parameters).ToArray();
+            return compiledTerm.Evaluate(combinedArg);
+        }
+
+        public Tuple<double[], double> Differentiate(double[] arg, double[] parameters)
+        {
+            var combinedArg = arg.Concat(parameters).ToArray();
+            var diffResult = compiledTerm.Differentiate(combinedArg);
+
+            var partialGradient = new double[arg.Length];
+            Array.Copy(diffResult.Item1, partialGradient, partialGradient.Length);
+
+            return Tuple.Create(partialGradient, diffResult.Item2);
+        }
+
+        public ReadOnlyCollection<Variable> Variables { get; private set;}
+
+        public ReadOnlyCollection<Variable> Parameters { get; private set;} 
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Product.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Product.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Product.cs	(revision 8703)
@@ -0,0 +1,57 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a product between two terms.
+    /// </summary>
+    [Serializable]
+    public class Product : Term
+    {
+        /// <summary>
+        /// Constructs a new instance of the <see cref="Product"/> type.
+        /// </summary>
+        /// <param name="left">The first product term</param>
+        /// <param name="right">The second product term</param>
+        public Product(Term left, Term right)
+        {
+            Left = left;
+            Right = right;
+        }
+
+        /// <summary>
+        /// Gets the first product term.
+        /// </summary>
+        public Term Left { get; private set; }
+
+        /// <summary>
+        /// Gets the second product term.
+        /// </summary>
+        public Term Right { get; private set; }
+
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Properties/AssemblyInfo.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Properties/AssemblyInfo.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Properties/AssemblyInfo.cs	(revision 8703)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("AutoDiff")]
+[assembly: AssemblyDescription("High-performance and high-accuracy automatic function-differentiation library suitable for optimization and numeric computing.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Alex Shtof")]
+[assembly: AssemblyProduct("AutoDiff")]
+[assembly: AssemblyCopyright("Copyright © NA 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e294e492-271d-48ae-a047-c03bc13b9f6f")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Sum.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Sum.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Sum.cs	(revision 8703)
@@ -0,0 +1,63 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a sum of at least two terms.
+    /// </summary>
+    [Serializable]
+    [DebuggerDisplay("Sum: {Terms.Count}")]
+    public class Sum : Term
+    {
+        /// <summary>
+        /// Constructs an instance of the <see cref="Sum"/> class.
+        /// </summary>
+        /// <param name="first">The first term in the sum</param>
+        /// <param name="second">The second term in the sum</param>
+        /// <param name="rest">The rest of the terms in the sum.</param>
+        public Sum(Term first, Term second, params Term[] rest)
+        {
+            var allTerms = 
+                (new Term[] { first, second}).Concat(rest);
+
+            Terms = allTerms.ToList().AsReadOnly();
+        }
+
+        internal Sum(IEnumerable<Term> terms)
+        {
+            Terms = Array.AsReadOnly(terms.ToArray());
+        }
+
+        /// <summary>
+        /// Gets the terms of this sum.
+        /// </summary>
+        public ReadOnlyCollection<Term> Terms { get; private set; }
+        
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept.</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TVec.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TVec.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TVec.cs	(revision 8703)
@@ -0,0 +1,299 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AutoDiff;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// A column vector made of terms.
+    /// </summary>
+    [Serializable]
+    public class TVec
+    {
+        private readonly Term[] terms;
+
+        /// <summary>
+        /// Constructs a new instance of the <see cref="TVec"/> class given vector components.
+        /// </summary>
+        /// <param name="terms">The vector component terms</param>
+        public TVec(IEnumerable<Term> terms)
+        {
+            Contract.Requires(terms != null);
+            Contract.Requires(Contract.ForAll(terms, term => term != null));
+            Contract.Requires(terms.Any());
+
+            this.terms = terms.ToArray();
+        }
+
+        /// <summary>
+        /// Constructs a new instance of the <see cref="TVec"/> class given vector components.
+        /// </summary>
+        /// <param name="terms">The vector component terms</param>
+        public TVec(params Term[] terms)
+            : this(terms as IEnumerable<Term>)
+        {
+            Contract.Requires(terms != null);
+            Contract.Requires(Contract.ForAll(terms, term => term != null));
+            Contract.Requires(terms.Length > 0);
+        }
+
+        /// <summary>
+        /// Constructs a new instance of the <see cref="TVec"/> class using another vector's components.
+        /// </summary>
+        /// <param name="first">A vector containing the first vector components to use.</param>
+        /// <param name="rest">More vector components to add in addition to the components in <paramref name="first"/></param>
+        public TVec(TVec first, params Term[] rest)
+            : this(first.terms.Concat(rest ?? System.Linq.Enumerable.Empty<Term>()))
+        {
+            Contract.Requires(first != null);
+            Contract.Requires(Contract.ForAll(rest, term => term != null));
+        }
+
+        private TVec(Term[] left, Term[] right, Func<Term, Term, Term> elemOp)
+        {
+            Contract.Assume(left.Length == right.Length);
+            terms = new Term[left.Length];
+            for (int i = 0; i < terms.Length; ++i)
+                terms[i] = elemOp(left[i], right[i]);
+        }
+
+        private TVec(Term[] input, Func<Term, Term> elemOp)
+        {
+            terms = new Term[input.Length];
+            for (int i = 0; i < input.Length; ++i)
+                terms[i] = elemOp(input[i]);
+        }
+
+        /// <summary>
+        /// Gets a vector component given its zero-based index.
+        /// </summary>
+        /// <param name="index">The vector's component index.</param>
+        /// <returns>The vector component.</returns>
+        public Term this[int index]
+        {
+            get 
+            {
+                Contract.Requires(index >= 0 && index < Dimension);
+                Contract.Ensures(Contract.Result<Term>() != null);
+
+                return terms[index]; 
+            }
+        }
+
+        /// <summary>
+        /// Gets a term representing the squared norm of this vector.
+        /// </summary>
+        public Term NormSquared
+        {
+            get 
+            {
+                Contract.Ensures(Contract.Result<Term>() != null);
+
+                var powers = terms.Select(x => TermBuilder.Power(x, 2));
+                return TermBuilder.Sum(powers);
+            }
+        }
+
+        /// <summary>
+        /// Gets the dimensions of this vector
+        /// </summary>
+        public int Dimension
+        {
+            get 
+            {
+                Contract.Ensures(Contract.Result<int>() > 0);
+
+                return terms.Length; 
+            }
+        }
+
+        /// <summary>
+        /// Gets the first vector component
+        /// </summary>
+        public Term X
+        {
+            get 
+            {
+                Contract.Ensures(Contract.Result<Term>() != null);
+
+                return this[0]; 
+            }
+        }
+
+        /// <summary>
+        /// Gets the second vector component.
+        /// </summary>
+        public Term Y
+        {
+            get 
+            { 
+                Contract.Requires(Dimension >= 2);
+                Contract.Ensures(Contract.Result<Term>() != null);
+
+                return this[1];
+            }
+        }
+
+        /// <summary>
+        /// Gets the third vector component
+        /// </summary>
+        public Term Z
+        {
+            get
+            {
+                Contract.Requires(Dimension >= 3);
+                Contract.Ensures(Contract.Result<Term>() != null);
+
+                return this[2];
+            }
+        }
+
+        /// <summary>
+        /// Gets an array of all vector components.
+        /// </summary>
+        /// <returns>An array of all vector components. Users are free to modify this array. It doesn't point to any
+        /// internal structures.</returns>
+        public Term[] GetTerms()
+        {
+            Contract.Ensures(Contract.Result<Term[]>() != null);
+            Contract.Ensures(Contract.Result<Term[]>().Length > 0);
+            Contract.Ensures(Contract.ForAll(Contract.Result<Term[]>(), term => term != null));
+
+            return (Term[])terms.Clone();
+        }
+
+        /// <summary>
+        /// Constructs a sum of two term vectors.
+        /// </summary>
+        /// <param name="left">The first vector in the sum</param>
+        /// <param name="right">The second vector in the sum</param>
+        /// <returns>A vector representing the sum of <paramref name="left"/> and <paramref name="right"/></returns>
+        public static TVec operator+(TVec left, TVec right)
+        {
+            Contract.Requires(left != null);
+            Contract.Requires(right != null);
+            Contract.Requires(left.Dimension == right.Dimension);
+            Contract.Ensures(Contract.Result<TVec>().Dimension == left.Dimension);
+
+            return new TVec(left.terms, right.terms, (x, y) => x + y);
+        }
+
+        /// <summary>
+        /// Constructs a difference of two term vectors,
+        /// </summary>
+        /// <param name="left">The first vector in the difference</param>
+        /// <param name="right">The second vector in the difference.</param>
+        /// <returns>A vector representing the difference of <paramref name="left"/> and <paramref name="right"/></returns>
+        public static TVec operator-(TVec left, TVec right)
+        {
+            Contract.Requires(left != null);
+            Contract.Requires(right != null);
+            Contract.Requires(left.Dimension == right.Dimension);
+            Contract.Ensures(Contract.Result<TVec>().Dimension == left.Dimension);
+
+            return new TVec(left.terms, right.terms, (x, y) => x - y);
+        }
+
+        /// <summary>
+        /// Inverts a vector
+        /// </summary>
+        /// <param name="vector">The vector to invert</param>
+        /// <returns>A vector repsesenting the inverse of <paramref name="vector"/></returns>
+        public static TVec operator-(TVec vector)
+        {
+            Contract.Requires(vector != null);
+            Contract.Ensures(Contract.Result<TVec>().Dimension == vector.Dimension);
+
+            return vector * -1;
+        }
+
+        /// <summary>
+        /// Multiplies a vector by a scalar
+        /// </summary>
+        /// <param name="vector">The vector</param>
+        /// <param name="scalar">The scalar</param>
+        /// <returns>A product of the vector <paramref name="vector"/> and the scalar <paramref name="scalar"/>.</returns>
+        public static TVec operator*(TVec vector, Term scalar)
+        {
+            Contract.Requires(vector != null);
+            Contract.Requires(scalar != null);
+            Contract.Ensures(Contract.Result<TVec>().Dimension == vector.Dimension);
+
+            return new TVec(vector.terms, x => scalar * x);
+        }
+
+        /// <summary>
+        /// Multiplies a vector by a scalar
+        /// </summary>
+        /// <param name="vector">The vector</param>
+        /// <param name="scalar">The scalar</param>
+        /// <returns>A product of the vector <paramref name="vector"/> and the scalar <paramref name="scalar"/>.</returns>
+        public static TVec operator *(Term scalar, TVec vector)
+        {
+            Contract.Requires(vector != null);
+            Contract.Requires(scalar != null);
+            Contract.Ensures(Contract.Result<TVec>().Dimension == vector.Dimension);
+
+            return vector * scalar;
+        }
+
+        /// <summary>
+        /// Constructs a term representing the inner product of two vectors.
+        /// </summary>
+        /// <param name="left">The first vector of the inner product</param>
+        /// <param name="right">The second vector of the inner product</param>
+        /// <returns>A term representing the inner product of <paramref name="left"/> and <paramref name="right"/>.</returns>
+        public static Term operator*(TVec left, TVec right)
+        {
+            Contract.Requires(left != null);
+            Contract.Requires(right != null);
+            Contract.Requires(left.Dimension == right.Dimension);
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            return InnerProduct(left, right);
+        }
+
+        /// <summary>
+        /// Constructs a term representing the inner product of two vectors.
+        /// </summary>
+        /// <param name="left">The first vector of the inner product</param>
+        /// <param name="right">The second vector of the inner product</param>
+        /// <returns>A term representing the inner product of <paramref name="left"/> and <paramref name="right"/>.</returns>
+        public static Term InnerProduct(TVec left, TVec right)
+        {
+            Contract.Requires(left != null);
+            Contract.Requires(right != null);
+            Contract.Requires(left.Dimension == right.Dimension);
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            var products = from i in System.Linq.Enumerable.Range(0, left.Dimension)
+                           select left.terms[i] * right.terms[i];
+
+            return TermBuilder.Sum(products);
+        }
+
+        /// <summary>
+        /// Constructs a 3D cross-product vector given two 3D vectors.
+        /// </summary>
+        /// <param name="left">The left cross-product term</param>
+        /// <param name="right">The right cross product term</param>
+        /// <returns>A vector representing the cross product of <paramref name="left"/> and <paramref name="right"/></returns>
+        public static TVec CrossProduct(TVec left, TVec right)
+        {
+            Contract.Requires(left != null);
+            Contract.Requires(right != null);
+            Contract.Requires(left.Dimension == 3);
+            Contract.Requires(right.Dimension == 3);
+            Contract.Ensures(Contract.Result<TVec>().Dimension == 3);
+
+            return new TVec(
+                left.Y * right.Z - left.Z * right.Y,
+                left.Z * right.X - left.X * right.Z,
+                left.X * right.Y - left.Y * right.X
+                );
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Term.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Term.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Term.cs	(revision 8703)
@@ -0,0 +1,117 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Base class for all automatically-differentiable terms.
+    /// </summary>
+    [Serializable]
+    [ContractClass(typeof(TermContacts))]
+    public abstract class Term
+    {
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public abstract void Accept(ITermVisitor visitor);
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>The result from the visitor's visit function.</returns>
+        public abstract TResult Accept<TResult>(ITermVisitor<TResult> visitor);
+
+        /// <summary>
+        /// Converts a floating point constant to a constant term.
+        /// </summary>
+        /// <param name="value">The floating point constnat</param>
+        /// <returns>The resulting term.</returns>
+        public static implicit operator Term(double value)
+        {
+            return TermBuilder.Constant(value);
+        }
+
+        /// <summary>
+        /// Constructs a sum of the two given terms.
+        /// </summary>
+        /// <param name="left">First term in the sum</param>
+        /// <param name="right">Second term in the sum</param>
+        /// <returns>A term representing the sum of <paramref name="left"/> and <paramref name="right"/>.</returns>
+        public static Term operator+(Term left, Term right)
+        {
+            if (left is Zero && right is Zero)
+                return new Zero();
+            else if (left is Zero)
+                return right;
+            else if (right is Zero)
+                return left;
+            else
+                return TermBuilder.Sum(left, right);
+        }
+
+        /// <summary>
+        /// Constructs a product term of the two given terms.
+        /// </summary>
+        /// <param name="left">The first term in the product</param>
+        /// <param name="right">The second term in the product</param>
+        /// <returns>A term representing the product of <paramref name="left"/> and <paramref name="right"/>.</returns>
+        public static Term operator*(Term left, Term right)
+        {
+            return TermBuilder.Product(left, right);
+        }
+
+        /// <summary>
+        /// Constructs a fraction term of the two given terms.
+        /// </summary>
+        /// <param name="numerator">The numerator of the fraction. That is, the "top" part.</param>
+        /// <param name="denominator">The denominator of the fraction. That is, the "bottom" part.</param>
+        /// <returns>A term representing the fraction <paramref name="numerator"/> over <paramref name="denominator"/>.</returns>
+        public static Term operator/(Term numerator, Term denominator)
+        {
+            return TermBuilder.Product(numerator, TermBuilder.Power(denominator, -1));
+        }
+
+        /// <summary>
+        /// Constructs a difference of the two given terms.
+        /// </summary>
+        /// <param name="left">The first term in the difference</param>
+        /// <param name="right">The second term in the difference.</param>
+        /// <returns>A term representing <paramref name="left"/> - <paramref name="right"/>.</returns>
+        public static Term operator-(Term left, Term right)
+        {
+            return left + (-1) * right;
+        }
+
+        /// <summary>
+        /// Constructs a negated term
+        /// </summary>
+        /// <param name="term">The term to negate</param>
+        /// <returns>A term representing <c>-term</c>.</returns>
+        public static Term operator-(Term term)
+        {
+            return (-1) * term;
+        }
+    }
+
+    [ContractClassFor(typeof(Term))]
+    abstract class TermContacts : Term
+    {
+        public override void Accept(ITermVisitor visitor)
+        {
+            Contract.Requires(visitor != null);
+        }
+
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            Contract.Requires(visitor != null);
+            return default(TResult);
+        }
+    }
+
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermBuilder.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermBuilder.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermBuilder.cs	(revision 8703)
@@ -0,0 +1,161 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// A collection of static methods to build new terms
+    /// </summary>
+    public static class TermBuilder
+    {
+        /// <summary>
+        /// Builds a new constant term.
+        /// </summary>
+        /// <param name="value">The constant value</param>
+        /// <returns>The constant term.</returns>
+        public static Term Constant(double value)
+        {
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            if (value == 0)
+                return new Zero();
+            else
+                return new Constant(value);
+        }
+
+        /// <summary>
+        /// Builds a sum of given terms.
+        /// </summary>
+        /// <param name="terms">The collection of terms in the sum.</param>
+        /// <returns>A term representing the sum of the terms in <paramref name="terms"/>.</returns>
+        public static Sum Sum(IEnumerable<Term> terms)
+        {
+            Contract.Requires(terms.Where(term => !(term is Zero)).Count() >= 2); // require at-least two non-zero terms.
+            Contract.Requires(Contract.ForAll(terms, term => term != null));
+            Contract.Ensures(Contract.Result<Sum>() != null);
+
+            terms = terms.Where(term => !(term is Zero));
+            return new Sum(terms);
+        }
+
+        /// <summary>
+        /// Builds a sum of given terms.
+        /// </summary>
+        /// <param name="v1">The first term in the sum</param>
+        /// <param name="v2">The second term in the sum</param>
+        /// <param name="rest">The rest of the terms in the sum.</param>
+        /// <returns>A term representing the sum of <paramref name="v1"/>, <paramref name="v2"/> and the terms in <paramref name="rest"/>.</returns>
+        public static Sum Sum(Term v1, Term v2, params Term[] rest)
+        {
+            Contract.Requires(v1 != null);
+            Contract.Requires(v2 != null);
+            Contract.Requires(Contract.ForAll(rest, term => term != null));
+            Contract.Ensures(Contract.Result<Sum>() != null);
+
+            var allTerms = new Term[] { v1, v2 }.Concat(rest);
+            return Sum(allTerms);
+        }
+
+        /// <summary>
+        /// Builds a product of given terms.
+        /// </summary>
+        /// <param name="v1">The first term in the product</param>
+        /// <param name="v2">The second term in the product</param>
+        /// <param name="rest">The rest of the terms in the product</param>
+        /// <returns>A term representing the product of <paramref name="v1"/>, <paramref name="v2"/> and the terms in <paramref name="rest"/>.</returns>
+        public static Term Product(Term v1, Term v2, params Term[] rest)
+        {
+            Contract.Requires(v1 != null);
+            Contract.Requires(v2 != null);
+            Contract.Requires(Contract.ForAll(rest, term => term != null));
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            var result = new Product(v1, v2);
+            foreach (var item in rest)
+                result = new Product(result, item);
+
+            return result;
+        }
+
+        /// <summary>
+        /// Builds a power terms given a base and a constant exponent
+        /// </summary>
+        /// <param name="t">The power base term</param>
+        /// <param name="power">The exponent</param>
+        /// <returns>A term representing <c>t^power</c>.</returns>
+        public static Term Power(Term t, double power)
+        {
+            Contract.Requires(t != null);
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            return new ConstPower(t, power);
+        }
+
+        /// <summary>
+        /// Builds a power term given a base term and an exponent term.
+        /// </summary>
+        /// <param name="baseTerm">The base term</param>
+        /// <param name="exponent">The exponent term</param>
+        /// <returns></returns>
+        public static Term Power(Term baseTerm, Term exponent)
+        {
+            Contract.Requires(baseTerm != null);
+            Contract.Requires(exponent != null);
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            return new TermPower(baseTerm, exponent);
+        }
+
+        /// <summary>
+        /// Builds a term representing the exponential function e^x.
+        /// </summary>
+        /// <param name="arg">The function's exponent</param>
+        /// <returns>A term representing e^arg.</returns>
+        public static Term Exp(Term arg)
+        {
+            Contract.Requires(arg != null);
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            return new Exp(arg);
+        }
+
+        /// <summary>
+        /// Builds a term representing the natural logarithm.
+        /// </summary>
+        /// <param name="arg">The natural logarithm's argument.</param>
+        /// <returns>A term representing the natural logarithm of <paramref name="arg"/></returns>
+        public static Term Log(Term arg)
+        {
+            Contract.Requires(arg != null);
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            return new Log(arg);
+        }
+
+        /// <summary>
+        /// Constructs a 2D quadratic form given the vector components x1, x2 and the matrix coefficients a11, a12, a21, a22.
+        /// </summary>
+        /// <param name="x1">First vector component</param>
+        /// <param name="x2">Second vector component</param>
+        /// <param name="a11">First row, first column matrix component</param>
+        /// <param name="a12">First row, second column matrix component</param>
+        /// <param name="a21">Second row, first column matrix component</param>
+        /// <param name="a22">Second row, second column matrix component</param>
+        /// <returns>A term describing the quadratic form</returns>
+        public static Term QuadForm(Term x1, Term x2, Term a11, Term a12, Term a21, Term a22)
+        {
+            Contract.Requires(x1 != null);
+            Contract.Requires(x2 != null);
+            Contract.Requires(a11 != null);
+            Contract.Requires(a12 != null);
+            Contract.Requires(a21 != null);
+            Contract.Requires(a22 != null);
+            Contract.Ensures(Contract.Result<Term>() != null);
+
+            return Sum(a11 * Power(x1, 2), (a12 + a21) * x1 * x2, a22 * Power(x2, 2));
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermPower.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermPower.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermPower.cs	(revision 8703)
@@ -0,0 +1,48 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    public class TermPower : Term
+    {
+        public TermPower(Term baseTerm, Term exponent)
+        {
+            Base = baseTerm;
+            Exponent = exponent;
+        }
+
+        /// <summary>
+        /// Gets the base term of the power function
+        /// </summary>
+        public Term Base { get; private set; }
+
+        /// <summary>
+        /// Gets the exponent term of the power function.
+        /// </summary>
+        public Term Exponent { get; private set; }
+
+        /// <summary>
+        /// Accepts a term visitor.
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept.</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermUtils.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermUtils.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/TermUtils.cs	(revision 8703)
@@ -0,0 +1,125 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Static methods that operate on terms.
+    /// </summary>
+    public static class TermUtils
+    {
+        /// <summary>
+        /// Creates a compiled representation of a given term that allows efficient evaluation of the value/gradient.
+        /// </summary>
+        /// <param name="term">The term to compile.</param>
+        /// <param name="variables">The variables contained in the term.</param>
+        /// <returns>A compiled representation of <paramref name="term"/> that assigns values to variables in the same order
+        /// as in <paramref name="variables"/></returns>
+        /// <remarks>
+        /// The order of the variables in <paramref name="variables"/> is important. Each call to <c>ICompiledTerm.Evaluate</c> or 
+        /// <c>ICompiledTerm.Differentiate</c> receives an array of numbers representing the point of evaluation. The i'th number in this array corresponds
+        /// to the i'th variable in <c>variables</c>.
+        /// </remarks>
+        public static ICompiledTerm Compile(this Term term, params Variable[] variables)
+        {
+            return Compile<Variable[]>(term, variables);
+        }
+
+        /// <summary>
+        /// Creates a compiled representation of a given term that allows efficient evaluation of the value/gradient.
+        /// </summary>
+        /// <param name="term">The term to compile.</param>
+        /// <param name="variables">The variables contained in the term.</param>
+        /// <returns>A compiled representation of <paramref name="term"/> that assigns values to variables in the same order
+        /// as in <paramref name="variables"/></returns>
+        /// <remarks>
+        /// The order of the variables in <paramref name="variables"/> is important. Each call to <c>ICompiledTerm.Evaluate</c> or 
+        /// <c>ICompiledTerm.Differentiate</c> receives an array of numbers representing the point of evaluation. The i'th number in this array corresponds
+        /// to the i'th variable in <c>variables</c>.
+        /// </remarks>
+        public static ICompiledTerm Compile<T>(this Term term, T variables)
+            where T : IList<Variable>
+        {
+            Contract.Requires(variables != null);
+            Contract.Requires(term != null);
+            Contract.Ensures(Contract.Result<ICompiledTerm>() != null);
+            Contract.Ensures(Contract.Result<ICompiledTerm>().Variables.Count == variables.Count);
+            Contract.Ensures(Contract.ForAll(0, variables.Count, i => variables[i] == Contract.Result<ICompiledTerm>().Variables[i]));
+
+            return new CompiledDifferentiator<T>(term, variables);
+        }
+
+        /// <summary>
+        /// Creates a compiled representation of a given term that allows efficient evaluation of the value/gradient where part of the variables serve as function
+        /// inputs and other variables serve as constant parameters.
+        /// </summary>
+        /// <param name="term">The term to compile.</param>
+        /// <param name="variables">The variables contained in the term.</param>
+        /// <param name="parameters">The constant parameters in the term.</param>
+        /// <returns>A compiled representation of <paramref name="term"/> that assigns values to variables in the same order
+        /// as in <paramref name="variables"/> and <paramref name="parameters"/></returns>
+        /// <remarks>
+        /// The order of the variables in <paramref name="variables"/> is important. Each call to <c>ICompiledTerm.Evaluate</c> or 
+        /// <c>ICompiledTerm.Differentiate</c> receives an array of numbers representing the point of evaluation. The i'th number in this array corresponds
+        /// to the i'th variable in <c>variables</c>.
+        /// </remarks>
+        public static IParametricCompiledTerm Compile(this Term term, Variable[] variables, Variable[] parameters)
+        {
+            Contract.Requires(variables != null);
+            Contract.Requires(parameters != null);
+            Contract.Requires(term != null);
+            Contract.Ensures(Contract.Result<IParametricCompiledTerm>() != null);
+            Contract.Ensures(Contract.Result<IParametricCompiledTerm>().Variables.Count == variables.Length);
+            Contract.Ensures(Contract.ForAll(0, variables.Length, i => variables[i] == Contract.Result<IParametricCompiledTerm>().Variables[i]));
+            Contract.Ensures(Contract.Result<IParametricCompiledTerm>().Parameters.Count == parameters.Length);
+            Contract.Ensures(Contract.ForAll(0, parameters.Length, i => parameters[i] == Contract.Result<IParametricCompiledTerm>().Parameters[i]));
+
+            return new ParametricCompiledTerm(term, variables, parameters);
+        }
+
+        /// <summary>
+        /// Evaluates the function represented by a given term at a given point.
+        /// </summary>
+        /// <param name="term">The term representing the function to evaluate.</param>
+        /// <param name="variables">The variables used in <paramref name="term"/>.</param>
+        /// <param name="point">The values assigned to the variables in <paramref name="variables"/></param>
+        /// <returns>The value of the function represented by <paramref name="term"/> at the point represented by <paramref name="variables"/>
+        /// and <paramref name="point"/>.</returns>
+        /// <remarks>The i'th value in <c>point</c> corresponds to the i'th variable in <c>variables</c>.</remarks>
+        public static double Evaluate(this Term term, Variable[] variables, double[] point)
+        {
+            Contract.Requires(term != null);
+            Contract.Requires(variables != null);
+            Contract.Requires(point != null);
+            Contract.Requires(variables.Length == point.Length);
+
+            return term.Compile(variables).Evaluate(point);
+        }
+
+        /// <summary>
+        /// Computes the gradient of the function represented by a given term at a given point.
+        /// </summary>
+        /// <param name="term">The term representing the function to differentiate.</param>
+        /// <param name="variables">The variables used in <paramref name="term"/>.</param>
+        /// <param name="point">The values assigned to the variables in <paramref name="variables"/></param>
+        /// <returns>The gradient of the function represented by <paramref name="term"/> at the point represented by <paramref name="variables"/>
+        /// and <paramref name="point"/>.</returns>
+        /// <remarks>The i'th value in <c>point</c> corresponds to the i'th variable in <c>variables</c>. In addition, the i'th value
+        /// in the resulting array is the partial derivative with respect to the i'th variable in <c>variables</c>.</remarks>
+        public static double[] Differentiate(this Term term, Variable[] variables, double[] point)
+        {
+            Contract.Requires(term != null);
+            Contract.Requires(variables != null);
+            Contract.Requires(point != null);
+            Contract.Requires(variables.Length == point.Length);
+            Contract.Ensures(Contract.Result<double[]>() != null);
+            Contract.Ensures(Contract.Result<double[]>().Length == variables.Length);
+
+            var result =  term.Compile(variables).Differentiate(point).Item1;
+            return result;
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/UnaryFunc.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/UnaryFunc.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/UnaryFunc.cs	(revision 8703)
@@ -0,0 +1,94 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics.Contracts;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a custom unary function term. The user provides custom delegates
+    /// to evaluate and compute the derivative (differentiate) the function.
+    /// </summary>
+    public class UnaryFunc : Term
+    {
+        private readonly Func<double, double> eval;
+        private readonly Func<double, double> diff;
+        private readonly Term argument;
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="UnaryFunc"/> class.
+        /// </summary>
+        /// <param name="eval">The evaluation method for the custom function.</param>
+        /// <param name="diff">The differentiation method for the custom function.</param>
+        /// <param name="argument">The argument term for the unary function</param>
+        public UnaryFunc(Func<double, double> eval, Func<double, double> diff, Term argument)
+        {
+            Contract.Requires(eval != null);
+            Contract.Requires(diff != null);
+            Contract.Requires(argument != null);
+
+            Contract.Ensures(Eval == eval);
+            Contract.Ensures(Diff == diff);
+            Contract.Ensures(Argument == argument);
+
+            this.eval = eval;
+            this.diff = diff;
+            this.argument = argument;
+        }
+
+        /// <summary>
+        /// Constructs a factory delegate that creates similar unary functions for different terms.
+        /// </summary>
+        /// <param name="eval">The evaluation method for the custom function.</param>
+        /// <param name="diff">The differentiation method for the custom function.</param>
+        /// <returns>The described factory delegate</returns>
+        public static Func<Term, UnaryFunc> Factory(Func<double, double> eval, Func<double, double> diff)
+        {
+            Contract.Requires(eval != null);
+            Contract.Requires(diff != null);
+            Contract.Ensures(Contract.Result<Func<Term, UnaryFunc>>() != null);
+
+            Func<Term, UnaryFunc> result = term => new UnaryFunc(eval, diff, term);
+            return result;
+        }
+
+        /// <summary>
+        /// Gets the evaluation delegate.
+        /// </summary>
+        public Func<double, double> Eval { get { return eval; } }
+
+
+        /// <summary>
+        /// Gets the differentiation delegate.
+        /// </summary>
+        public Func<double, double> Diff { get { return diff; } }
+
+        /// <summary>
+        /// Gets the function's argument term
+        /// </summary>
+        public Term Argument { get { return argument; } }
+
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Variable.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Variable.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Variable.cs	(revision 8703)
@@ -0,0 +1,37 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// Represents a variable term. Variable terms are substituted for real values during evaluation and
+    /// differentiation. 
+    /// </summary>
+    [Serializable]
+    public class Variable : Term
+    {
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept.</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Zero.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Zero.cs	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/AutoDiff-1.0/Zero.cs	(revision 8703)
@@ -0,0 +1,36 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AutoDiff
+{
+    /// <summary>
+    /// A constant zero term. Similar to <see cref="Constant"/> but represents only the value 0.
+    /// </summary>
+    [Serializable]
+    public class Zero : Term
+    {
+        /// <summary>
+        /// Accepts a term visitor
+        /// </summary>
+        /// <param name="visitor">The term visitor to accept.</param>
+        public override void Accept(ITermVisitor visitor)
+        {
+            visitor.Visit(this);
+        }
+
+        /// <summary>
+        /// Accepts a term visitor with a generic result
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
+        /// <param name="visitor">The visitor to accept</param>
+        /// <returns>
+        /// The result from the visitor's visit function.
+        /// </returns>
+        public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
+        {
+            return visitor.Visit(this);
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/AutoDiff License-1.0.txt
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/AutoDiff License-1.0.txt	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/AutoDiff License-1.0.txt	(revision 8703)
@@ -0,0 +1,144 @@
+﻿GNU Library General Public License (LGPL)
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) The modified work must itself be a software library.
+
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+
+b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+
+c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+
+d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+
+e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/HeuristicLab.AutoDiff-1.0.csproj
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/HeuristicLab.AutoDiff-1.0.csproj	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/HeuristicLab.AutoDiff-1.0.csproj	(revision 8703)
@@ -0,0 +1,150 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{C8BB29AC-C64A-4EF4-9773-9208F9AE0B49}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.AutoDiff</RootNamespace>
+    <AssemblyName>HeuristicLab.AutoDiff-1.0</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\AutoDiff-1.0\AutoDiff-1.0.csproj">
+      <Project>{62551FD3-C21F-4E16-A7FC-6A017508809C}</Project>
+      <Name>AutoDiff-1.0</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="AutoDiff License-1.0.txt">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/Plugin.cs.frame
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/Plugin.cs.frame	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/Plugin.cs.frame	(revision 8703)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.AutoDiff {
+  [Plugin("HeuristicLab.AutoDiff","HeuristicLab wrapper for AutoDiff library that provides fast, accurate and automatic differentiation (derivative) of mathematical functions.","1.0.0.$WCREV$")]  
+  [PluginFile("HeuristicLab.AutoDiff-1.0.dll", PluginFileType.Assembly)]
+  [PluginFile("AutoDiff-1.0.dll", PluginFileType.Assembly)]
+  [PluginFile("AutoDiff License-1.0.txt", PluginFileType.License)]
+  public class HeuristicLabAutoDiffPlugin : PluginBase {
+  }
+}
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/Properties/AssemblyInfo.cs.frame
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/Properties/AssemblyInfo.cs.frame	(revision 8703)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AutoDiff/1.0/HeuristicLab.AutoDiff-1.0/Properties/AssemblyInfo.cs.frame	(revision 8703)
@@ -0,0 +1,37 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using HeuristicLab.PluginInfrastructure;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.AutoDiff")]
+[assembly: AssemblyDescription("Provides an interface to AutoDiff")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+// [assembly: Guid("XXX")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0")]
+[assembly: AssemblyFileVersion("1.0.0.$WCREV$")]
