Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 17454)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 17455)
@@ -42,6 +42,4 @@
     private const string SpecialFunctionsName = "Special Functions";
     private const string TimeSeriesSymbolsName = "Time Series Symbols";
-    private const string BasicVectorOperationSymbolsName = "Basic Vector Operations";
-    private const string VectorAggregationSymbolsName = "Vector Aggregation";
     private const string VectorSymbolsName = "Vector Symbols";
 
@@ -116,12 +114,4 @@
       var laggedVariable = new LaggedVariable();
       var autoregressiveVariable = new AutoregressiveTargetVariable();
-
-      var vectorVariable = new VectorVariable();
-      var vectorAdd = new VectorAddition();
-      var vectorSub = new VectorSubtraction();
-      var vectorMul = new VectorMultiplication();
-      var vectorDiv = new VectorDivision();
-      var vectorSum = new VectorSum();
-      var vectorAvg = new VectorMean();
       #endregion
 
@@ -143,8 +133,4 @@
 
       var timeSeriesSymbols = new GroupSymbol(TimeSeriesSymbolsName, new List<ISymbol> { timeLag, integral, derivative, laggedVariable, autoregressiveVariable });
-
-      var basicVectorOperationSymbols = new GroupSymbol(BasicVectorOperationSymbolsName, new List<ISymbol>() { vectorAdd, vectorSub, vectorMul, vectorDiv });
-      var vectorAggregationSymbols = new GroupSymbol(VectorAggregationSymbolsName, new List<ISymbol>() { vectorSum, vectorAvg });
-      var vectorSymbols = new GroupSymbol(VectorSymbolsName, new List<ISymbol>() { vectorVariable, basicVectorOperationSymbols, vectorAggregationSymbols });
       #endregion
 
@@ -153,5 +139,4 @@
       AddSymbol(conditionalSymbols);
       AddSymbol(timeSeriesSymbols);
-      AddSymbol(vectorSymbols);
 
       #region subtree count configuration
@@ -185,9 +170,4 @@
       SetSubtreeCount(laggedVariable, 0, 0);
       SetSubtreeCount(autoregressiveVariable, 0, 0);
-
-
-      SetSubtreeCount(vectorVariable, 0, 0);
-      SetSubtreeCount(basicVectorOperationSymbols, 2, 2);
-      SetSubtreeCount(vectorAggregationSymbols, 1, 1);
       #endregion
 
@@ -258,10 +238,4 @@
       AddAllowedChildSymbol(derivative, powerSymbols);
       AddAllowedChildSymbol(derivative, conditionSymbols);
-
-      AddAllowedChildSymbol(realValuedSymbols, vectorAggregationSymbols);
-      AddAllowedChildSymbol(vectorAggregationSymbols, basicVectorOperationSymbols);
-      AddAllowedChildSymbol(vectorAggregationSymbols, vectorVariable);
-      AddAllowedChildSymbol(basicVectorOperationSymbols, basicVectorOperationSymbols);
-      AddAllowedChildSymbol(basicVectorOperationSymbols, vectorVariable);
       #endregion
     }
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 17454)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 17455)
@@ -174,4 +174,5 @@
     <Compile Include="Interpreter\SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs" />
     <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs" />
+    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs" />
     <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs" />
     <Compile Include="Selectors\DiversitySelector.cs" />
@@ -223,10 +224,4 @@
     <Compile Include="SymbolicDataAnalysisProblem.cs" />
     <Compile Include="SymbolicDataAnalysisSolutionImpactValuesCalculator.cs" />
-    <Compile Include="Symbols\VectorMean.cs" />
-    <Compile Include="Symbols\VectorSum.cs" />
-    <Compile Include="Symbols\VectorSubtraction.cs" />
-    <Compile Include="Symbols\VectorMultiplication.cs" />
-    <Compile Include="Symbols\VectorDivision.cs" />
-    <Compile Include="Symbols\VectorAddition.cs" />
     <Compile Include="Symbols\Addition.cs" />
     <Compile Include="Symbols\AnalyticQuotient.cs" />
@@ -247,6 +242,4 @@
     <Compile Include="Symbols\CubeRoot.cs" />
     <Compile Include="Symbols\HyperbolicTangent.cs" />
-    <Compile Include="Symbols\VectorVariableTreeNode.cs" />
-    <Compile Include="Symbols\VectorVariable.cs" />
     <Compile Include="Symbols\VariableBase.cs" />
     <Compile Include="Symbols\VariableTreeNodeBase.cs" />
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 17454)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 17455)
@@ -22,5 +22,4 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 
@@ -78,12 +77,5 @@
     Cube = 50,
     CubeRoot = 51,
-    Tanh = 52,
-    VectorVariable = 53,
-    VectorAdd = 54,
-    VectorSub = 55,
-    VectorMul = 56,
-    VectorDiv = 57,
-    VectorSum = 58,
-    VectorAvg = 59
+    Tanh = 52
   };
   public static class OpCodes {
@@ -141,12 +133,4 @@
     public const byte CubeRoot = (byte)OpCode.CubeRoot;
     public const byte Tanh = (byte)OpCode.Tanh;
-    public const byte VectorVariable = (byte)OpCode.VectorVariable;
-    public const byte VectorAdd = (byte)OpCode.VectorAdd;
-    public const byte VectorSub = (byte)OpCode.VectorSub;
-    public const byte VectorMul = (byte)OpCode.VectorMul;
-    public const byte VectorDiv = (byte)OpCode.VectorDiv;
-    public const byte VectorSum = (byte)OpCode.VectorSum;
-    public const byte VectorMean = (byte)OpCode.VectorAvg;
-
 
     private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
@@ -203,12 +187,5 @@
       { typeof(AnalyticQuotient), OpCodes.AnalyticQuotient },
       { typeof(Cube), OpCodes.Cube },
-      { typeof(CubeRoot), OpCodes.CubeRoot },
-      { typeof(VectorVariable), OpCodes.VectorVariable },
-      { typeof(VectorAddition), OpCodes.VectorAdd },
-      { typeof(VectorSubtraction), OpCodes.VectorSub },
-      { typeof(VectorMultiplication), OpCodes.VectorMul },
-      { typeof(VectorDivision), OpCodes.VectorDiv },
-      { typeof(VectorSum), OpCodes.VectorSum },
-      { typeof(VectorMean), OpCodes.VectorMean }
+      { typeof(CubeRoot), OpCodes.CubeRoot }
     };
 
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 17454)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 17455)
@@ -20,6 +20,4 @@
 #endregion
 
-using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>;
-
 using System;
 using System.Collections.Generic;
@@ -30,5 +28,4 @@
 using HeuristicLab.Parameters;
 using HEAL.Attic;
-using MathNet.Numerics.Statistics;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
@@ -152,7 +149,4 @@
           var factorTreeNode = instr.dynamicNode as BinaryFactorVariableTreeNode;
           instr.data = dataset.GetReadOnlyStringValues(factorTreeNode.VariableName);
-        } else if (instr.opCode == OpCodes.VectorVariable) {
-          var vectorVariableTreeNode = (VectorVariableTreeNode)instr.dynamicNode;
-          instr.data = dataset.GetReadOnlyDoubleVectorValues(vectorVariableTreeNode.VariableName);
         } else if (instr.opCode == OpCodes.LagVariable) {
           var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
@@ -535,59 +529,8 @@
           }
 
-        case OpCodes.VectorSum: {
-            DoubleVector v = VectorEvaluate(dataset, ref row, state);
-            return v.Sum();
-          }
-        case OpCodes.VectorMean: {
-            DoubleVector v = VectorEvaluate(dataset, ref row, state);
-            return v.Mean();
-          }
-
         default:
           throw new NotSupportedException();
       }
     }
-
-    public virtual DoubleVector VectorEvaluate(IDataset dataset, ref int row, InterpreterState state) {
-      Instruction currentInstr = state.NextInstruction();
-      switch (currentInstr.opCode) {
-        case OpCodes.VectorAdd: {
-            DoubleVector s = VectorEvaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s += VectorEvaluate(dataset, ref row, state);
-            }
-            return s;
-          }
-        case OpCodes.VectorSub: {
-            DoubleVector s = VectorEvaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s -= VectorEvaluate(dataset, ref row, state);
-            }
-            return s;
-          }
-        case OpCodes.VectorMul: {
-            DoubleVector s = VectorEvaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s = s.PointwiseMultiply(VectorEvaluate(dataset, ref row, state));
-            }
-            return s;
-          }
-        case OpCodes.VectorDiv: {
-            DoubleVector s = VectorEvaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s /= VectorEvaluate(dataset, ref row, state);
-            }
-            return s;
-          }
-
-        case OpCodes.VectorVariable: {
-            if (row < 0 || row >= dataset.Rows) return DoubleVector.Build.Dense(new[] { double.NaN });
-            var vectorVarTreeNode = currentInstr.dynamicNode as VectorVariableTreeNode;
-            return ((IList<DoubleVector>)currentInstr.data)[row] * vectorVarTreeNode.Weight;
-          }
-        default:
-          throw new NotSupportedException();
-      }
-    }
   }
 }
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs	(revision 17455)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs	(revision 17455)
@@ -0,0 +1,343 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+using MathNet.Numerics.LinearAlgebra;
+using MathNet.Numerics.Statistics;
+
+using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableType("DE68A1D9-5AFC-4DDD-AB62-29F3B8FC28E0")]
+  [Item("SymbolicDataAnalysisExpressionTreeVectorInterpreter", "Interpreter for symbolic expression trees including vector arithmetic.")]
+  public class SymbolicDataAnalysisExpressionTreeVectorInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
+
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    #region parameter properties
+    public IFixedValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public int EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value.Value; }
+      set { EvaluatedSolutionsParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionTreeVectorInterpreter(StorableConstructorFlag _) : base(_) { }
+
+    protected SymbolicDataAnalysisExpressionTreeVectorInterpreter(SymbolicDataAnalysisExpressionTreeVectorInterpreter original, Cloner cloner)
+      : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionTreeVectorInterpreter(this, cloner);
+    }
+
+    public SymbolicDataAnalysisExpressionTreeVectorInterpreter()
+      : base("SymbolicDataAnalysisExpressionTreeVectorInterpreter", "Interpreter for symbolic expression trees including vector arithmetic.") {
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    protected SymbolicDataAnalysisExpressionTreeVectorInterpreter(string name, string description)
+      : base(name, description) {
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+
+    }
+
+    #region IStatefulItem
+    public void InitializeState() {
+      EvaluatedSolutions = 0;
+    }
+
+    public void ClearState() { }
+    #endregion
+
+    private readonly object syncRoot = new object();
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
+      lock (syncRoot) {
+        EvaluatedSolutions++; // increment the evaluated solutions counter
+      }
+      var state = PrepareInterpreterState(tree, dataset);
+
+      foreach (var rowEnum in rows) {
+        int row = rowEnum;
+        var result = Evaluate(dataset, ref row, state);
+        if (!result.IsScalar)
+          throw new InvalidOperationException("Result of the tree is not a scalar.");
+        yield return result.Scalar;
+        state.Reset();
+      }
+    }
+
+    private static InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, IDataset dataset) {
+      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
+      int necessaryArgStackSize = 0;
+      foreach (Instruction instr in code) {
+        if (instr.opCode == OpCodes.Variable) {
+          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+          instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.FactorVariable) {
+          var factorTreeNode = instr.dynamicNode as FactorVariableTreeNode;
+          instr.data = dataset.GetReadOnlyStringValues(factorTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.BinaryFactorVariable) {
+          var factorTreeNode = instr.dynamicNode as BinaryFactorVariableTreeNode;
+          instr.data = dataset.GetReadOnlyStringValues(factorTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.LagVariable) {
+          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
+          instr.data = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.VariableCondition) {
+          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
+          instr.data = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.Call) {
+          necessaryArgStackSize += instr.nArguments + 1;
+        }
+      }
+      return new InterpreterState(code, necessaryArgStackSize);
+    }
+
+
+    public struct EvaluationResult {
+      public double Scalar { get; }
+      public bool IsScalar => !double.IsNaN(Scalar);
+
+      public DoubleVector Vector { get; }
+      public bool IsVector => !(Vector.Count == 1 && double.IsNaN(Vector[0]));
+
+      public bool IsNaN => !IsScalar && !IsVector;
+
+      public EvaluationResult(double scalar) {
+        Scalar = scalar;
+        Vector = NaNVector;
+      }
+      public EvaluationResult(DoubleVector vector) {
+        Vector = vector;
+        Scalar = double.NaN;
+      }
+
+      public override string ToString() {
+        if (IsScalar) return Scalar.ToString();
+        if (IsVector) return Vector.ToVectorString();
+        return "NaN";
+      }
+
+      public static readonly EvaluationResult NaN = new EvaluationResult(double.NaN);
+      private static readonly DoubleVector NaNVector = DoubleVector.Build.Dense(1, double.NaN);
+    }
+
+    private static EvaluationResult ArithmeticApply(EvaluationResult lhs, EvaluationResult rhs,
+      Func<double, double, double> ssFunc = null,
+      Func<double, DoubleVector, DoubleVector> svFunc = null,
+      Func<DoubleVector, double, DoubleVector> vsFunc = null,
+      Func<DoubleVector, DoubleVector, DoubleVector> vvFunc = null) {
+      if (lhs.IsScalar && rhs.IsScalar && ssFunc != null) return new EvaluationResult(ssFunc(lhs.Scalar, rhs.Scalar));
+      if (lhs.IsScalar && rhs.IsVector && svFunc != null) return new EvaluationResult(svFunc(lhs.Scalar, rhs.Vector));
+      if (lhs.IsVector && rhs.IsScalar && vsFunc != null) return new EvaluationResult(vsFunc(lhs.Vector, rhs.Scalar));
+      if (lhs.IsVector && rhs.IsVector && vvFunc != null) return new EvaluationResult(vvFunc(lhs.Vector, rhs.Vector));
+      throw new NotSupportedException($"Unsupported combination of argument types: ({lhs}) / ({rhs})");
+    }
+
+    private static EvaluationResult FunctionApply(EvaluationResult val,
+      Func<double, double> sFunc = null,
+      Func<DoubleVector, DoubleVector> vFunc = null) {
+      if (val.IsScalar && sFunc != null) return new EvaluationResult(sFunc(val.Scalar));
+      if (val.IsVector && vFunc != null) return new EvaluationResult(vFunc(val.Vector));
+      throw new NotSupportedException($"Unsupported argument type ({val})");
+    }
+
+    public virtual EvaluationResult Evaluate(IDataset dataset, ref int row, InterpreterState state) {
+      Instruction currentInstr = state.NextInstruction();
+      switch (currentInstr.opCode) {
+        case OpCodes.Add: {
+            var cur = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var op = Evaluate(dataset, ref row, state);
+              cur = ArithmeticApply(cur, op,
+                (s1, s2) => s1 + s2,
+                (s1, v2) => s1 + v2,
+                (v1, s2) => v1 + s2,
+                (v1, v2) => v1 + v2);
+            }
+            return cur;
+          }
+        case OpCodes.Sub: {
+            var cur = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var op = Evaluate(dataset, ref row, state);
+              cur = ArithmeticApply(cur, op,
+                (s1, s2) => s1 - s2,
+                (s1, v2) => s1 - v2,
+                (v1, s2) => v1 - s2,
+                (v1, v2) => v1 - v2);
+            }
+            return cur;
+          }
+        case OpCodes.Mul: {
+            var cur = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var op = Evaluate(dataset, ref row, state);
+              cur = ArithmeticApply(cur, op,
+                (s1, s2) => s1 * s2,
+                (s1, v2) => s1 * v2,
+                (v1, s2) => v1 * s2,
+                (v1, v2) => v1.PointwiseMultiply(v2));
+            }
+            return cur;
+          }
+        case OpCodes.Div: {
+            var cur = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var op = Evaluate(dataset, ref row, state);
+              cur = ArithmeticApply(cur, op,
+                (s1, s2) => s1 / s2,
+                (s1, v2) => s1 / v2,
+                (v1, s2) => v1 / s2,
+                (v1, v2) => v1 / v2);
+            }
+            return cur;
+          }
+        case OpCodes.Absolute: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur, Math.Abs, DoubleVector.Abs);
+          }
+        case OpCodes.Tanh: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur, Math.Tanh, DoubleVector.Tanh);
+          }
+        case OpCodes.Cos: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur, Math.Cos, DoubleVector.Cos);
+          }
+        case OpCodes.Sin: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur, Math.Sin, DoubleVector.Sin);
+          }
+        case OpCodes.Tan: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur, Math.Tan, DoubleVector.Tan);
+          }
+        case OpCodes.Square: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur,
+              s => Math.Pow(s, 2),
+              v => v.PointwisePower(2));
+          }
+        case OpCodes.Cube: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur,
+              s => Math.Pow(s, 3),
+              v => v.PointwisePower(3));
+          }
+        case OpCodes.Power: {
+            var x = Evaluate(dataset, ref row, state);
+            var y = Evaluate(dataset, ref row, state);
+            return ArithmeticApply(x, y,
+              (s1, s2) => Math.Pow(s1, Math.Round(s2)),
+              (s1, v2) => DoubleVector.Build.Dense(v2.Count, s1).PointwisePower(DoubleVector.Round(v2)),
+              (v1, s2) => v1.PointwisePower(Math.Round(s2)),
+              (v1, v2) => v1.PointwisePower(DoubleVector.Round(v2)));
+          }
+        case OpCodes.SquareRoot: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur,
+              s => Math.Sqrt(s),
+              v => DoubleVector.Sqrt(v));
+          }
+        case OpCodes.CubeRoot: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur,
+              s => s < 0 ? -Math.Pow(-s, 1.0 / 3.0) : Math.Pow(s, 1.0 / 3.0),
+              v => v.Map(s => s < 0 ? -Math.Pow(-s, 1.0 / 3.0) : Math.Pow(s, 1.0 / 3.0)));
+          }
+        case OpCodes.Root: {
+            var x = Evaluate(dataset, ref row, state);
+            var y = Evaluate(dataset, ref row, state);
+            return ArithmeticApply(x, y,
+              (s1, s2) => Math.Pow(s1, 1.0 / Math.Round(s2)),
+              (s1, v2) => DoubleVector.Build.Dense(v2.Count, s1).PointwisePower(1.0 / DoubleVector.Round(v2)),
+              (v1, s2) => v1.PointwisePower(1.0 / Math.Round(s2)),
+              (v1, v2) => v1.PointwisePower(1.0 / DoubleVector.Round(v2)));
+          }
+        case OpCodes.Exp: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur,
+              s => Math.Exp(s),
+              v => DoubleVector.Exp(v));
+          }
+        case OpCodes.Log: {
+            var cur = Evaluate(dataset, ref row, state);
+            return FunctionApply(cur,
+              s => Math.Log(s),
+              v => DoubleVector.Log(v));
+          }
+        case OpCodes.Variable: {
+            if (row < 0 || row >= dataset.Rows) return EvaluationResult.NaN;
+            var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode;
+            if (currentInstr.data is IList<double> doubleList)
+              return new EvaluationResult(doubleList[row] * variableTreeNode.Weight);
+            if (currentInstr.data is IList<DoubleVector> doubleVectorList)
+              return new EvaluationResult(doubleVectorList[row] * variableTreeNode.Weight);
+            throw new NotSupportedException($"Unsupported type of variable: {currentInstr.data.GetType().GetPrettyName()}");
+          }
+        case OpCodes.BinaryFactorVariable: {
+            if (row < 0 || row >= dataset.Rows) return EvaluationResult.NaN;
+            var factorVarTreeNode = currentInstr.dynamicNode as BinaryFactorVariableTreeNode;
+            return new EvaluationResult(((IList<string>)currentInstr.data)[row] == factorVarTreeNode.VariableValue ? factorVarTreeNode.Weight : 0);
+          }
+        case OpCodes.FactorVariable: {
+            if (row < 0 || row >= dataset.Rows) return EvaluationResult.NaN;
+            var factorVarTreeNode = currentInstr.dynamicNode as FactorVariableTreeNode;
+            return new EvaluationResult(factorVarTreeNode.GetValue(((IList<string>)currentInstr.data)[row]));
+          }
+        case OpCodes.Constant: {
+            var constTreeNode = (ConstantTreeNode)currentInstr.dynamicNode;
+            return new EvaluationResult(constTreeNode.Value);
+          }
+
+        default:
+          throw new NotSupportedException($"Unsupported OpCode: {currentInstr.opCode}");
+      }
+    }
+  }
+}
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 17454)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 17455)
@@ -241,10 +241,4 @@
         }
       }
-      foreach (var vectorVariableSymbol in grammar.Symbols.OfType<VectorVariable>()) {
-        if (!vectorVariableSymbol.Fixed) {
-          vectorVariableSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<DoubleVector>(x));
-          vectorVariableSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => ds.VariableHasType<DoubleVector>(x));
-        }
-      }
     }
 
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorAddition.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorAddition.cs	(revision 17454)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("FD0FD140-7AED-483F-ACFC-A65FFCD4216A")]
-  [Item("VectorAddition", "Symbol that represents the + operator.")]
-  public sealed class VectorAddition : Symbol {
-    private const int minimumArity = 1;
-    private const int maximumArity = byte.MaxValue;
-
-    public override int MinimumArity {
-      get { return minimumArity; }
-    }
-    public override int MaximumArity {
-      get { return maximumArity; }
-    }
-
-    [StorableConstructor]
-    private VectorAddition(StorableConstructorFlag _) : base(_) { }
-    private VectorAddition(VectorAddition original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorAddition(this, cloner);
-    }
-    public VectorAddition() : base("VectorAddition", "Symbol that represents the + operator.") { }
-  }
-}
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorDivision.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorDivision.cs	(revision 17454)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("AC2706D7-40FF-4BB2-A7C9-1EE83EFF2D83")]
-  [Item("VectorDivision", "Symbol that represents the / operator.")]
-  public sealed class VectorDivision : Symbol {
-    private const int minimumArity = 1;
-    private const int maximumArity = byte.MaxValue;
-
-    public override int MinimumArity {
-      get { return minimumArity; }
-    }
-    public override int MaximumArity {
-      get { return maximumArity; }
-    }
-
-    [StorableConstructor]
-    private VectorDivision(StorableConstructorFlag _) : base(_) { }
-    private VectorDivision(VectorDivision original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorDivision(this, cloner);
-    }
-    public VectorDivision() : base("VectorDivision", "Symbol that represents the / operator.") { }
-  }
-}
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorMean.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorMean.cs	(revision 17454)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("85FF9A2E-207C-4008-BB8B-0C0363885443")]
-  [Item("VectorMean", "Symbol that represents the mean function.")]
-  public sealed class VectorMean : Symbol {
-    private const int minimumArity = 1;
-    private const int maximumArity = 1;
-
-    public override int MinimumArity {
-      get { return minimumArity; }
-    }
-    public override int MaximumArity {
-      get { return maximumArity; }
-    }
-
-    [StorableConstructor]
-    private VectorMean(StorableConstructorFlag _) : base(_) { }
-    private VectorMean(VectorMean original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorMean(this, cloner);
-    }
-    public VectorMean() : base("VectorMean", "Symbol that represents the mean function.") { }
-  }
-}
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorMultiplication.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorMultiplication.cs	(revision 17454)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("B3CD0680-162D-49F6-9D23-0F8730704050")]
-  [Item("VectorMultiplication", "Symbol that represents the * operator.")]
-  public sealed class VectorMultiplication : Symbol {
-    private const int minimumArity = 1;
-    private const int maximumArity = byte.MaxValue;
-
-    public override int MinimumArity {
-      get { return minimumArity; }
-    }
-    public override int MaximumArity {
-      get { return maximumArity; }
-    }
-
-    [StorableConstructor]
-    private VectorMultiplication(StorableConstructorFlag _) : base(_) { }
-    private VectorMultiplication(VectorMultiplication original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorMultiplication(this, cloner);
-    }
-    public VectorMultiplication() : base("VectorMultiplication", "Symbol that represents the * operator.") { }
-  }
-}
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorSubtraction.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorSubtraction.cs	(revision 17454)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("8700841D-3303-42E5-A71A-A941B4CF707E")]
-  [Item("VectorSubtraction", "Symbol that represents the - operator.")]
-  public sealed class VectorSubtraction : Symbol {
-    private const int minimumArity = 1;
-    private const int maximumArity = byte.MaxValue;
-
-    public override int MinimumArity {
-      get { return minimumArity; }
-    }
-    public override int MaximumArity {
-      get { return maximumArity; }
-    }
-
-    [StorableConstructor]
-    private VectorSubtraction(StorableConstructorFlag _) : base(_) { }
-    private VectorSubtraction(VectorSubtraction original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorSubtraction(this, cloner);
-    }
-    public VectorSubtraction() : base("VectorSubtraction", "Symbol that represents the - operator.") { }
-  }
-}
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorSum.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorSum.cs	(revision 17454)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("FD700096-C848-4841-BAF3-B89C4200EE5C")]
-  [Item("VectorSum", "Symbol that represents the sum function.")]
-  public sealed class VectorSum : Symbol {
-    private const int minimumArity = 1;
-    private const int maximumArity = 1;
-
-    public override int MinimumArity {
-      get { return minimumArity; }
-    }
-    public override int MaximumArity {
-      get { return maximumArity; }
-    }
-
-    [StorableConstructor]
-    private VectorSum(StorableConstructorFlag _) : base(_) { }
-    private VectorSum(VectorSum original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorSum(this, cloner);
-    }
-    public VectorSum() : base("VectorSum", "Symbol that represents the sum function.") { }
-  }
-}
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorVariable.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorVariable.cs	(revision 17454)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("B7E7393D-95BC-434D-862C-670C9FCF8328")]
-  [Item("Variable", "Represents a variable value.")]
-  public sealed class VectorVariable : VariableBase {
-
-    [StorableConstructor]
-    private VectorVariable(StorableConstructorFlag _) : base(_) {
-    }
-    private VectorVariable(VectorVariable original, Cloner cloner)
-      : base(original, cloner) {
-    }
-    public VectorVariable() : base("VectorVariable", "Represents a variable value.") { }
-    public VectorVariable(string name, string description) : base(name, description) { }
-
-    public override ISymbolicExpressionTreeNode CreateTreeNode() {
-      return new VectorVariableTreeNode(this);
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorVariable(this, cloner);
-    }
-  }
-}
Index: anches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorVariableTreeNode.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VectorVariableTreeNode.cs	(revision 17454)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HEAL.Attic;
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableType("C0C60572-E014-43D5-B06C-53F3DE6FD54A")]
-  public sealed class VectorVariableTreeNode : VariableTreeNodeBase {
-    public new VectorVariable Symbol {
-      get { return (VectorVariable)base.Symbol; }
-    }
-    [StorableConstructor]
-    private VectorVariableTreeNode(StorableConstructorFlag _) : base(_) { }
-    private VectorVariableTreeNode(VectorVariableTreeNode original, Cloner cloner)
-      : base(original, cloner) {
-    }
-    private VectorVariableTreeNode() { }
-    public VectorVariableTreeNode(VectorVariable variableSymbol) : base(variableSymbol) { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new VectorVariableTreeNode(this, cloner);
-    }
-  }
-}
