Index: branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/HeuristicLab.MathNet.Numerics.csproj
===================================================================
--- branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/HeuristicLab.MathNet.Numerics.csproj	(revision 17448)
+++ branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/HeuristicLab.MathNet.Numerics.csproj	(revision 17449)
@@ -32,8 +32,15 @@
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604" />
+    <Reference Include="HEAL.Attic, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\bin\HEAL.Attic.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="VectorTransformer.cs" />
     <None Include="Plugin.cs.frame" />
     <Compile Include="Plugin.cs" />
Index: branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/Plugin.cs.frame
===================================================================
--- branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/Plugin.cs.frame	(revision 17448)
+++ branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/Plugin.cs.frame	(revision 17449)
@@ -20,5 +20,9 @@
 #endregion
 
+using System;
 using HeuristicLab.PluginInfrastructure;
+using HEAL.Attic;
+using MathNet.Numerics.LinearAlgebra;
+using MathNet.Numerics.LinearAlgebra.Storage;
 
 namespace HeuristicLab.MathNet.Numerics {
@@ -27,7 +31,64 @@
   [PluginFile("MathNet.Numerics.dll", PluginFileType.Assembly)]
   //[PluginFile("MathNet.Numerics.License.txt", PluginFileType.License)]
+  [PluginDependency("HeuristicLab.Attic", "1.0")]
   public class Plugin : PluginBase {
     public Plugin() {
     }
+
+    public override void OnLoad() {
+      base.OnLoad();
+      #region Register Vector Types in Attic
+      Mapper.StaticCache.RegisterType(new Guid("9BDA9658-EDBF-4BAD-B988-DCA08C500D7A"), typeof(Vector<>));
+
+      Mapper.StaticCache.RegisterType(new Guid("4921801B-5A2F-41E4-86AD-E6B548ED2CB7"), typeof(VectorStorage<>));
+      Mapper.StaticCache.RegisterType(new Guid("8E57A262-299C-46B6-BDA8-DCB726C83FC0"), typeof(DenseVectorStorage<>));
+      Mapper.StaticCache.RegisterType(new Guid("33724125-E6A4-4E08-9EE4-9508D696E2D9"), typeof(SparseVectorStorage<>));
+
+      Mapper.StaticCache.RegisterType(new Guid("0210EAC6-0261-4D83-A161-00A2B67CA0CC"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex.Vector));
+      Mapper.StaticCache.RegisterType(new Guid("87F48979-5F2A-42C9-9D84-916C37CE42C3"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex.DenseVector));
+      Mapper.StaticCache.RegisterType(new Guid("311C0244-103E-4E8B-A823-534158DE5257"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex.SparseVector));
+
+      Mapper.StaticCache.RegisterType(new Guid("06608505-BB8A-41C0-B5B9-C9A5605CB6E0"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex32.Vector));
+      Mapper.StaticCache.RegisterType(new Guid("37C6F78F-4ABE-41AE-AF68-573450AAB0AB"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex32.DenseVector));
+      Mapper.StaticCache.RegisterType(new Guid("D31F4B80-3EAE-4668-A6D4-817DA0DA7E28"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex32.SparseVector));
+
+      Mapper.StaticCache.RegisterType(new Guid("F20EE6AE-EAC6-4937-BBE7-92955D8C5936"), typeof(global::MathNet.Numerics.LinearAlgebra.Double.Vector));
+      Mapper.StaticCache.RegisterType(new Guid("8E63B5E1-8892-455F-97C2-31B367A21734"), typeof(global::MathNet.Numerics.LinearAlgebra.Double.DenseVector));
+      Mapper.StaticCache.RegisterType(new Guid("6BDA39FC-1334-4D86-9E88-277E4C33D7F1"), typeof(global::MathNet.Numerics.LinearAlgebra.Double.SparseVector));
+
+      Mapper.StaticCache.RegisterType(new Guid("99E450D1-7F02-4ED4-922E-8EB597214DFF"), typeof(global::MathNet.Numerics.LinearAlgebra.Single.Vector));
+      Mapper.StaticCache.RegisterType(new Guid("A1B29D78-603D-4AEE-8D5E-3E3B3D1FC1F8"), typeof(global::MathNet.Numerics.LinearAlgebra.Single.DenseVector));
+      Mapper.StaticCache.RegisterType(new Guid("7775580A-AB68-4311-A75E-C4075C9A2F18"), typeof(global::MathNet.Numerics.LinearAlgebra.Single.SparseVector));
+      #endregion
+
+      #region Register Matrix Types in Attic
+      Mapper.StaticCache.RegisterType(new Guid("360253A5-F021-4892-9AEA-A52FB6904844"), typeof(Matrix<>));
+
+      Mapper.StaticCache.RegisterType(new Guid("4BE8AF41-C052-4C7F-897C-24178AEEA3BC"), typeof(MatrixStorage<>));
+      Mapper.StaticCache.RegisterType(new Guid("1B426075-E412-4648-AB97-A6927D796008"), typeof(DenseColumnMajorMatrixStorage<>));
+      Mapper.StaticCache.RegisterType(new Guid("7E8270CB-B7B5-4198-889F-B7A0DC302AEB"), typeof(DiagonalMatrixStorage<>));
+      Mapper.StaticCache.RegisterType(new Guid("F332A995-4056-4C8D-B4A6-42771306D43E"), typeof(SparseCompressedRowMatrixStorage<>));
+
+      Mapper.StaticCache.RegisterType(new Guid("3928D44C-E393-421B-9BA6-1619F2EF77CA"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex.Matrix));
+      Mapper.StaticCache.RegisterType(new Guid("35A7ADF2-0F9A-4AA9-B5EC-A5F14A44ADCC"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex.DenseMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("D3376AC9-AFB0-47F7-A69C-807FB562E896"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex.DiagonalMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("5EBC44E4-D92F-4D0F-B740-10A5B32F5233"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex.SparseMatrix));
+
+      Mapper.StaticCache.RegisterType(new Guid("0740483C-A512-4414-9795-0575F681DD72"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex32.Matrix));
+      Mapper.StaticCache.RegisterType(new Guid("8E1191CC-3305-49AD-ADAA-7CCE73DE7EC5"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex32.DenseMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("1AB78582-551A-4368-A0A3-582D38B38A39"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex32.DiagonalMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("EC07CD9D-BC1B-4A60-9248-1F57D2161932"), typeof(global::MathNet.Numerics.LinearAlgebra.Complex32.SparseMatrix));
+
+      Mapper.StaticCache.RegisterType(new Guid("DDB7C3FC-3389-4E98-AEEF-6A1B08BB0319"), typeof(global::MathNet.Numerics.LinearAlgebra.Double.Matrix));
+      Mapper.StaticCache.RegisterType(new Guid("0F704924-2E50-476B-8C48-8F4F8C8F06F1"), typeof(global::MathNet.Numerics.LinearAlgebra.Double.DenseMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("636898E8-03B8-4841-BC12-62A845251533"), typeof(global::MathNet.Numerics.LinearAlgebra.Double.DiagonalMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("80129CDD-4853-4049-9A71-7939D312A134"), typeof(global::MathNet.Numerics.LinearAlgebra.Double.SparseMatrix));
+
+      Mapper.StaticCache.RegisterType(new Guid("FEF95D66-C01F-4C1C-B154-B86489E9092B"), typeof(global::MathNet.Numerics.LinearAlgebra.Single.Matrix));
+      Mapper.StaticCache.RegisterType(new Guid("CBBA6D18-1AE5-48C2-BEF0-71C4107454A7"), typeof(global::MathNet.Numerics.LinearAlgebra.Single.DenseMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("5DD5D87D-F64B-4D0F-86DE-966EA30A9F07"), typeof(global::MathNet.Numerics.LinearAlgebra.Single.DiagonalMatrix));
+      Mapper.StaticCache.RegisterType(new Guid("3C41DF38-CC7B-4D3C-AEB0-6106CDBFCDA1"), typeof(global::MathNet.Numerics.LinearAlgebra.Single.SparseMatrix));
+      #endregion
+    }
   }
 }
Index: branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/VectorTransformer.cs
===================================================================
--- branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/VectorTransformer.cs	(revision 17449)
+++ branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/VectorTransformer.cs	(revision 17449)
@@ -0,0 +1,146 @@
+﻿#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 System.IO;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.Serialization;
+using Google.Protobuf;
+using HEAL.Attic;
+using MathNet.Numerics;
+using MathNet.Numerics.LinearAlgebra;
+using MathNet.Numerics.LinearAlgebra.Storage;
+
+namespace HeuristicLab.MathNet.Numerics {
+  #region Vector Transformer
+  public abstract class VectorTransformer<T> : BoxTransformer<Vector<T>> where T : struct, IEquatable<T>, IFormattable {
+    public override bool CanTransformType(Type type) {
+      return typeof(Vector<T>).IsAssignableFrom(type);
+    }
+    public override Box CreateBox(object o, Mapper mapper) {
+      var box = base.CreateBox(o, mapper);
+      box.Value = new ScalarValueBox();
+      return box;
+    }
+    protected override void Populate(Box box, Vector<T> vector, Mapper mapper) {
+      var storageId = mapper.GetBoxId(vector.Storage);
+      box.Value.ULong = storageId;
+    }
+    protected override Vector<T> Extract(Box box, Type type, Mapper mapper) {
+      var storageId = (uint)box.Value.ULong;
+      var storage = (VectorStorage<T>)mapper.GetObject(storageId);
+      return Vector<T>.Build.OfStorage(storage);
+    }
+  }
+
+  [Transformer("78276F91-D075-4472-B81B-3A736184CC22", 400)]
+  public class SingleVectorTransformer : VectorTransformer<float> { }
+
+  [Transformer("9B131989-4528-4A59-B64D-0FE07693714F", 400)]
+  public class ComplexVectorTransformer : VectorTransformer<Complex> { }
+
+  [Transformer("2D978104-A174-4AE2-AEA1-20FD50CADF0D", 400)]
+  public class Complex32VectorTransformer : VectorTransformer<Complex32> { }
+
+  [Transformer("76A21F63-36B4-4073-ABBC-56623ECBF42E", 400)]
+  public class DoubleVectorTransformer : VectorTransformer<double> { }
+  #endregion
+
+  #region Dense Vector Storage Transformer
+  [Transformer("CA28BA16-2C95-4270-9A04-3502D492F070", 200)]
+  public class DenseDoubleVectorStorageTransformer : BoxTransformer<DenseVectorStorage<double>> {
+    public override Box CreateBox(object o, Mapper mapper) {
+      var box = base.CreateBox(o, mapper);
+      box.Values = new RepeatedValueBox() {
+        Doubles = new RepeatedDoubleBox()
+      };
+      return box;
+    }
+    protected override void Populate(Box box, DenseVectorStorage<double> storage, Mapper mapper) {
+      box.Values.Doubles.Values.AddRange(storage.Data);
+    }
+    protected override DenseVectorStorage<double> Extract(Box box, Type type, Mapper mapper) {
+      var data = box.Values.Doubles.Values;
+      return DenseVectorStorage<double>.OfEnumerable(data);
+    }
+  }
+  #endregion
+
+  #region Sparse Vector Storage Transformer
+  [Transformer("25FDFB3B-5849-44F6-81AC-3D16CB093ADE", 200)]
+  public class SparseDoubleVectorStorageTransformer : BoxTransformer<SparseVectorStorage<double>> {
+    public override Box CreateBox(object o, Mapper mapper) {
+      var box = base.CreateBox(o, mapper);
+      box.Value = new ScalarValueBox();
+      box.Values = new RepeatedValueBox() {
+        Doubles = new RepeatedDoubleBox(),
+        Ints = new RepeatedIntBox()
+      };
+      return box;
+    }
+    protected override void Populate(Box box, SparseVectorStorage<double> storage, Mapper mapper) {
+      box.Value.Long = storage.ValueCount;
+      box.Values.Doubles.Values.AddRange(storage.Values);
+      box.Values.Ints.Values.AddRange(storage.Indices);
+    }
+    protected override SparseVectorStorage<double> Extract(Box box, Type type, Mapper mapper) {
+      int valueCount = (int)box.Value.Long;
+      var values = box.Values.Doubles.Values;
+      var indices = box.Values.Ints.Values;
+      var data = indices.Zip(values, Tuple.Create);
+      return SparseVectorStorage<double>.OfIndexedEnumerable(valueCount, data);
+    }
+  }
+  #endregion
+
+
+
+  [Transformer("45EFC879-241D-404F-BCC1-341A41F6AB90", 1000)]
+  public class DataContractTransformer : BoxTransformer<object> {
+    private readonly DataContractSerializer serializer = new DataContractSerializer(typeof(DenseVectorStorage<>));
+    public override bool CanTransformType(Type type) {
+      return Attribute.GetCustomAttribute(type, typeof(SerializableAttribute)) != null &&
+             Attribute.GetCustomAttribute(type, typeof(DataContractAttribute)) != null;
+    }
+    public override Box CreateBox(object o, Mapper mapper) {
+      var box = base.CreateBox(o, mapper);
+      box.Value = new ScalarValueBox();
+      return box;
+    }
+    protected override void Populate(Box box, object o, Mapper mapper) {
+      using (var stream = new MemoryStream()) {
+        serializer.WriteObject(stream, o);
+        var data = stream.ToArray();
+        box.Value.Bytes = ByteString.CopyFrom(data);
+      }
+    }
+    protected override object Extract(Box box, Type type, Mapper mapper) {
+      var data = box.Value.Bytes.ToByteArray();
+      using (var stream = new MemoryStream()) {
+        stream.Write(data, 0, data.Length);
+        stream.Seek(0, SeekOrigin.Begin);
+        return serializer.ReadObject(stream);
+      }
+    }
+  }
+}
Index: branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
===================================================================
--- branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 17448)
+++ branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 17449)
@@ -364,5 +364,5 @@
 
       var doubleVectorValues = values as IList<DoubleVector>;
-      if (doubleVectorValues != null) return doubleVectorValues.Select(x => DoubleVector.Build.DenseOfVector(x)).ToList();
+      if (doubleVectorValues != null) return doubleVectorValues.Select(x => x.Clone()).ToList();
 
       throw new ArgumentException(string.Format("Unsupported variable type {0}.", GetElementType(values)));
