Index: src/FunctionApproximation/Extractors.cpp
===================================================================
--- src/FunctionApproximation/Extractors.cpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/Extractors.cpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -532,10 +532,16 @@
 }
 
-FunctionModel::arguments_t Extractors::reorderArgumentsByIncreasingDistance(
-    const FunctionModel::arguments_t &args
-    )
-{
-  FunctionModel::arguments_t returnargs(args);
-  std::sort(returnargs.begin(), returnargs.end(), argument_t::DistanceComparator);
+FunctionModel::list_of_arguments_t Extractors::reorderArgumentsByIncreasingDistance(
+    const FunctionModel::list_of_arguments_t &listargs
+    )
+{
+  FunctionModel::list_of_arguments_t returnargs;
+  for (FunctionModel::list_of_arguments_t::const_iterator iter = listargs.begin();
+      iter != listargs.end(); ++iter) {
+    const FunctionModel::arguments_t &args = *iter;
+    FunctionModel::arguments_t sortedargs(args);
+    std::sort(sortedargs.begin(), sortedargs.end(), argument_t::DistanceComparator);
+    returnargs.push_back(sortedargs);
+  }
   return returnargs;
 }
@@ -587,26 +593,170 @@
 }
 
-FunctionModel::arguments_t Extractors::reorderArgumentsByParticleTypes(
+FunctionModel::list_of_arguments_t Extractors::reorderArgumentsByParticleTypes(
+    const FunctionModel::list_of_arguments_t &listargs,
+    const ParticleTypes_t &_types
+    )
+{
+  FunctionModel::list_of_arguments_t returnargs;
+  for (FunctionModel::list_of_arguments_t::const_iterator iter = listargs.begin();
+      iter != listargs.end(); ++iter) {
+    const FunctionModel::arguments_t &args = *iter;
+    /// We  place all arguments into multimap according to particle type pair.
+    // here, we need a special comparator such that types in key pair are always
+    // properly ordered.
+    typedef std::multimap<
+        argument_t::types_t,
+        argument_t,
+        ParticleTypesComparator> TypePair_Argument_Map_t;
+    TypePair_Argument_Map_t argument_map;
+    for(FunctionModel::arguments_t::const_iterator iter = args.begin();
+        iter != args.end(); ++iter) {
+      argument_map.insert( std::make_pair(iter->types, *iter) );
+    }
+    LOG(4, "DEBUG: particle_type map is " << argument_map << ".");
+
+    /// Then, we create the desired unique keys
+    typedef std::vector<argument_t::types_t> UniqueTypes_t;
+    UniqueTypes_t UniqueTypes;
+    for (ParticleTypes_t::const_iterator firstiter = _types.begin();
+        firstiter != _types.end();
+        ++firstiter) {
+      for (ParticleTypes_t::const_iterator seconditer = firstiter;
+          seconditer != _types.end();
+          ++seconditer) {
+        if (seconditer == firstiter)
+          continue;
+        UniqueTypes.push_back( std::make_pair(*firstiter, *seconditer) );
+      }
+    }
+    LOG(4, "DEBUG: Created unique types as keys " << UniqueTypes << ".");
+
+    /// Finally, we use the unique key list to pick corresponding arguments from the map
+    FunctionModel::arguments_t sortedargs;
+    sortedargs.reserve(args.size());
+    while (!argument_map.empty()) {
+      // note that particle_types_t may be flipped, i.e. 1,8 is equal to 8,1, but we
+      // must maintain the correct order in indices in accordance with the order
+      // in _types, i.e. 1,8,1 must match with e.g. ids 1,0,2 where 1 has type 1,
+      // 0 has type 8, and 2 has type 2.
+      // In other words: We do not want to flip/modify arguments such that they match
+      // with the specific type pair we seek but then this comes at the price that we
+      // have flip indices when the types in a pair are flipped.
+
+      typedef std::vector<size_t> indices_t;
+      //!> here, we gather the indices as we discover them
+      indices_t indices;
+      indices.resize(_types.size(), (size_t)-1);
+
+      // these are two iterators that create index pairs in the same way as we have
+      // created type pairs. If a -1 is still present in indices, then the index is
+      // still arbitrary but is then set by the next found index
+      indices_t::iterator firstindex = indices.begin();
+      indices_t::iterator secondindex = firstindex+1;
+
+      //!> here, we gather the current bunch of arguments as we find them
+      FunctionModel::arguments_t argumentbunch;
+      argumentbunch.reserve(UniqueTypes.size());
+
+      for (UniqueTypes_t::const_iterator typeiter = UniqueTypes.begin();
+          typeiter != UniqueTypes.end(); ++typeiter) {
+        // have all arguments to same type pair as list within the found range
+        std::pair<
+            TypePair_Argument_Map_t::iterator,
+            TypePair_Argument_Map_t::iterator> range_t =
+                argument_map.equal_range(*typeiter);
+        LOG(4, "DEBUG: Set of arguments to current key [" << typeiter->first << ","
+            << typeiter->second << "] is " << std::list<argument_t>(
+                MapValueIterator<TypePair_Argument_Map_t::iterator>(range_t.first),
+                MapValueIterator<TypePair_Argument_Map_t::iterator>(range_t.second)
+                ) << ".");
+        // the first key is always easy and is pivot which the rest has to be associated to
+        if (typeiter == UniqueTypes.begin()) {
+          const argument_t & arg = range_t.first->second;
+          if ((typeiter->first == arg.types.first) && (typeiter->second == arg.types.second)) {
+            // store in correct order
+            *firstindex = arg.indices.first;
+            *secondindex = arg.indices.second;
+          } else {
+            // store in flipped order
+            *firstindex = arg.indices.second;
+            *secondindex = arg.indices.first;
+          }
+          argumentbunch.push_back(arg);
+          argument_map.erase(range_t.first);
+          LOG(4, "DEBUG: Gathered first argument " << arg << ".");
+        } else {
+          // go through the range and pick the first argument matching the index constraints
+          for (TypePair_Argument_Map_t::iterator argiter = range_t.first;
+              argiter != range_t.second; ++argiter) {
+            // seconditer may be -1 still
+            const argument_t &arg = argiter->second;
+            if (arg.indices.first == *firstindex) {
+              if ((arg.indices.second == *secondindex) || (*secondindex == (size_t)-1)) {
+                if (*secondindex == (size_t)-1)
+                  *secondindex = arg.indices.second;
+                argumentbunch.push_back(arg);
+                argument_map.erase(argiter);
+                LOG(4, "DEBUG: Gathered another argument " << arg << ".");
+                break;
+              }
+            } else if ((arg.indices.first == *secondindex) || (*secondindex == (size_t)-1)) {
+              if (arg.indices.second == *firstindex) {
+                if (*secondindex == (size_t)-1)
+                  *secondindex = arg.indices.first;
+                argumentbunch.push_back(arg);
+                argument_map.erase(argiter);
+                LOG(4, "DEBUG: Gathered another (flipped) argument " << arg << ".");
+                break;
+              }
+            }
+          }
+        }
+        // move along in indices and check bounds
+        ++secondindex;
+        if (secondindex == indices.end()) {
+          ++firstindex;
+          if (firstindex != indices.end()-1)
+            secondindex = firstindex+1;
+        }
+      }
+      ASSERT( (firstindex == indices.end()-1) && (secondindex == indices.end()),
+          "Extractors::reorderArgumentsByParticleTypes() - we have not gathered enough arguments.");
+      ASSERT( argumentbunch.size() == UniqueTypes.size(),
+          "Extractors::reorderArgumentsByParticleTypes() - we have not gathered enough arguments.");
+      // place bunch of arguments in return args
+      LOG(3, "DEBUG: Given types " << _types << " and found indices " << indices << ".");
+      LOG(3, "DEBUG: Final bunch of arguments is " << argumentbunch << ".");
+      sortedargs.insert(sortedargs.end(), argumentbunch.begin(), argumentbunch.end());
+    }
+    returnargs.push_back(sortedargs);
+  }
+
+  return returnargs;
+}
+
+FunctionModel::list_of_arguments_t Extractors::filterArgumentsByParticleTypes(
     const FunctionModel::arguments_t &args,
     const ParticleTypes_t &_types
     )
 {
-  /// We  place all arguments into multimap according to particle type pair.
-  // here, we need a special comparator such that types in key pair are always
-  // properly ordered.
-  typedef std::multimap<
-      argument_t::types_t,
-      argument_t,
-      ParticleTypesComparator> TypePair_Argument_Map_t;
-  TypePair_Argument_Map_t argument_map;
-  for(FunctionModel::arguments_t::const_iterator iter = args.begin();
-      iter != args.end(); ++iter) {
-    argument_map.insert( std::make_pair(iter->types, *iter) );
-  }
-  LOG(4, "DEBUG: particle_type map is " << argument_map << ".");
-
-  /// Then, we create the desired unique keys
-  typedef std::vector<argument_t::types_t> UniqueTypes_t;
-  UniqueTypes_t UniqueTypes;
+  typedef std::list< argument_t > ListArguments_t;
+  ListArguments_t availableList(args.begin(), args.end());
+  LOG(2, "DEBUG: Initial list of args is " << args << ".");
+
+
+  // TODO: fill a lookup map such that we don't have O(M^3) scaling, if M is number
+  // of types (and we always must have M(M-1)/2 args) but O(M^2 log(M)). However, as
+  // M is very small (<=3), this is not necessary fruitful now.
+//  typedef ParticleTypes_t firsttype;
+//  typedef ParticleTypes_t secondtype;
+//  typedef std::map< firsttype, std::map< secondtype, boost::ref(args) > > ArgsLookup_t;
+//  ArgsLookup_t ArgsLookup;
+
+  // basically, we have two choose any two pairs out of types but only those
+  // where the first is less than the latter. Hence, we start the second
+  // iterator at the current position of the first one and skip the equal case.
+  FunctionModel::arguments_t allargs;
+  allargs.reserve(args.size());
   for (ParticleTypes_t::const_iterator firstiter = _types.begin();
       firstiter != _types.end();
@@ -617,142 +767,5 @@
       if (seconditer == firstiter)
         continue;
-      UniqueTypes.push_back( std::make_pair(*firstiter, *seconditer) );
-    }
-  }
-  LOG(4, "DEBUG: Created unique types as keys " << UniqueTypes << ".");
-
-  /// Finally, we use the unique key list to pick corresponding arguments from the map
-  FunctionModel::arguments_t returnargs;
-  returnargs.reserve(args.size());
-  while (!argument_map.empty()) {
-    // note that particle_types_t may be flipped, i.e. 1,8 is equal to 8,1, but we
-    // must maintain the correct order in indices in accordance with the order
-    // in _types, i.e. 1,8,1 must match with e.g. ids 1,0,2 where 1 has type 1,
-    // 0 has type 8, and 2 has type 2.
-    // In other words: We do not want to flip/modify arguments such that they match
-    // with the specific type pair we seek but then this comes at the price that we
-    // have flip indices when the types in a pair are flipped.
-
-    typedef std::vector<size_t> indices_t;
-    //!> here, we gather the indices as we discover them
-    indices_t indices;
-    indices.resize(_types.size(), (size_t)-1);
-
-    // these are two iterators that create index pairs in the same way as we have
-    // created type pairs. If a -1 is still present in indices, then the index is
-    // still arbitrary but is then set by the next found index
-    indices_t::iterator firstindex = indices.begin();
-    indices_t::iterator secondindex = firstindex+1;
-
-    //!> here, we gather the current bunch of arguments as we find them
-    FunctionModel::arguments_t argumentbunch;
-    argumentbunch.reserve(UniqueTypes.size());
-
-    for (UniqueTypes_t::const_iterator typeiter = UniqueTypes.begin();
-        typeiter != UniqueTypes.end(); ++typeiter) {
-      // have all arguments to same type pair as list within the found range
-      std::pair<
-          TypePair_Argument_Map_t::iterator,
-          TypePair_Argument_Map_t::iterator> range_t =
-              argument_map.equal_range(*typeiter);
-      LOG(4, "DEBUG: Set of arguments to current key [" << typeiter->first << ","
-          << typeiter->second << "] is " << std::list<argument_t>(
-              MapValueIterator<TypePair_Argument_Map_t::iterator>(range_t.first),
-              MapValueIterator<TypePair_Argument_Map_t::iterator>(range_t.second)
-              ) << ".");
-      // the first key is always easy and is pivot which the rest has to be associated to
-      if (typeiter == UniqueTypes.begin()) {
-        const argument_t & arg = range_t.first->second;
-        if ((typeiter->first == arg.types.first) && (typeiter->second == arg.types.second)) {
-          // store in correct order
-          *firstindex = arg.indices.first;
-          *secondindex = arg.indices.second;
-        } else {
-          // store in flipped order
-          *firstindex = arg.indices.second;
-          *secondindex = arg.indices.first;
-        }
-        argumentbunch.push_back(arg);
-        argument_map.erase(range_t.first);
-        LOG(4, "DEBUG: Gathered first argument " << arg << ".");
-      } else {
-        // go through the range and pick the first argument matching the index constraints
-        for (TypePair_Argument_Map_t::iterator argiter = range_t.first;
-            argiter != range_t.second; ++argiter) {
-          // seconditer may be -1 still
-          const argument_t &arg = argiter->second;
-          if (arg.indices.first == *firstindex) {
-            if ((arg.indices.second == *secondindex) || (*secondindex == (size_t)-1)) {
-              if (*secondindex == (size_t)-1)
-                *secondindex = arg.indices.second;
-              argumentbunch.push_back(arg);
-              argument_map.erase(argiter);
-              LOG(4, "DEBUG: Gathered another argument " << arg << ".");
-              break;
-            }
-          } else if ((arg.indices.first == *secondindex) || (*secondindex == (size_t)-1)) {
-            if (arg.indices.second == *firstindex) {
-              if (*secondindex == (size_t)-1)
-                *secondindex = arg.indices.first;
-              argumentbunch.push_back(arg);
-              argument_map.erase(argiter);
-              LOG(4, "DEBUG: Gathered another (flipped) argument " << arg << ".");
-              break;
-            }
-          }
-        }
-      }
-      // move along in indices and check bounds
-      ++secondindex;
-      if (secondindex == indices.end()) {
-        ++firstindex;
-        if (firstindex != indices.end()-1)
-          secondindex = firstindex+1;
-      }
-    }
-    ASSERT( (firstindex == indices.end()-1) && (secondindex == indices.end()),
-        "Extractors::reorderArgumentsByParticleTypes() - we have not gathered enough arguments.");
-    ASSERT( argumentbunch.size() == UniqueTypes.size(),
-        "Extractors::reorderArgumentsByParticleTypes() - we have not gathered enough arguments.");
-    // place bunch of arguments in return args
-    LOG(3, "DEBUG: Given types " << _types << " and found indices " << indices << ".");
-    LOG(3, "DEBUG: Final bunch of arguments is " << argumentbunch << ".");
-    returnargs.insert(returnargs.end(), argumentbunch.begin(), argumentbunch.end());
-  }
-
-  return returnargs;
-}
-
-FunctionModel::arguments_t Extractors::filterArgumentsByParticleTypes(
-    const FunctionModel::arguments_t &args,
-    const ParticleTypes_t &_types
-    )
-{
-  typedef std::list< argument_t > ListArguments_t;
-  ListArguments_t availableList(args.begin(), args.end());
-  LOG(2, "DEBUG: Initial list of args is " << args << ".");
-
-
-  // TODO: fill a lookup map such that we don't have O(M^3) scaling, if M is number
-  // of types (and we always must have M(M-1)/2 args) but O(M^2 log(M)). However, as
-  // M is very small (<=3), this is not necessary fruitful now.
-//  typedef ParticleTypes_t firsttype;
-//  typedef ParticleTypes_t secondtype;
-//  typedef std::map< firsttype, std::map< secondtype, boost::ref(args) > > ArgsLookup_t;
-//  ArgsLookup_t ArgsLookup;
-
-  // basically, we have two choose any two pairs out of types but only those
-  // where the first is less than the latter. Hence, we start the second
-  // iterator at the current position of the first one and skip the equal case.
-  FunctionModel::arguments_t returnargs;
-  returnargs.reserve(args.size());
-  for (ParticleTypes_t::const_iterator firstiter = _types.begin();
-      firstiter != _types.end();
-      ++firstiter) {
-    for (ParticleTypes_t::const_iterator seconditer = firstiter;
-        seconditer != _types.end();
-        ++seconditer) {
-      if (seconditer == firstiter)
-        continue;
+      LOG(3, "DEBUG: Looking for (" << *firstiter << "," << *seconditer << ") in all args.");
 
       // search the right one in _args (we might allow switching places of
@@ -760,13 +773,13 @@
       ListArguments_t::iterator iter = availableList.begin();
       while (iter != availableList.end()) {
-        LOG(3, "DEBUG: Current args is " << *iter << ".");
+        LOG(4, "DEBUG: Current args is " << *iter << ".");
         if ((iter->types.first == *firstiter)
               && (iter->types.second == *seconditer)) {
-          returnargs.push_back( *iter );
+          allargs.push_back( *iter );
           iter = availableList.erase(iter);
           LOG(4, "DEBUG: Accepted argument.");
         } else if ((iter->types.first == *seconditer)
               && (iter->types.second == *firstiter)) {
-          returnargs.push_back( *iter );
+          allargs.push_back( *iter );
           iter = availableList.erase(iter);
           LOG(4, "DEBUG: Accepted (flipped) argument.");
@@ -778,5 +791,32 @@
     }
   }
-  LOG(2, "DEBUG: Final list of args is " << returnargs << ".");
+  LOG(2, "DEBUG: Final list of args is " << allargs << ".");
+
+  // first, we bring together tuples of distances that belong together
+  FunctionModel::list_of_arguments_t singlelist_allargs;
+  singlelist_allargs.push_back(allargs);
+  FunctionModel::list_of_arguments_t sortedargs =
+      reorderArgumentsByParticleTypes(singlelist_allargs, _types);
+  ASSERT( sortedargs.size() == (size_t)1,
+      "Extractors::filterArgumentsByParticleTypes() - reordering did not generate a single list.");
+  // then we split up the tuples of arguments and place each into single list
+  FunctionModel::list_of_arguments_t returnargs;
+  FunctionModel::arguments_t::const_iterator argiter = sortedargs.begin()->begin();
+  const size_t num_types = _types.size();
+  const size_t args_per_tuple = num_types * (num_types-1) / 2;
+  while (argiter != sortedargs.begin()->end()) {
+    FunctionModel::arguments_t currenttuple(args_per_tuple);
+    const FunctionModel::arguments_t::const_iterator startiter = argiter;
+    std::advance(argiter, args_per_tuple);
+#ifndef NDEBUG
+    FunctionModel::arguments_t::const_iterator endoutiter =
+#endif
+        std::copy(startiter, argiter, currenttuple.begin());
+    ASSERT( endoutiter == currenttuple.end(),
+        "Extractors::filterArgumentsByParticleTypes() - currenttuple not initialized to right size.");
+    returnargs.push_back(currenttuple);
+  }
+
+  LOG(2, "DEBUG: We have generated " << returnargs.size() << " tuples of distances.");
 
   return returnargs;
@@ -807,2 +847,10 @@
 }
 
+FunctionModel::list_of_arguments_t Extractors::concatenateListOfArguments(
+    const FunctionModel::list_of_arguments_t &firstlistargs,
+    const FunctionModel::list_of_arguments_t &secondlistargs)
+{
+  FunctionModel::list_of_arguments_t listargs(firstlistargs);
+  listargs.insert(listargs.end(), secondlistargs.begin(), secondlistargs.end());
+  return listargs;
+}
Index: src/FunctionApproximation/Extractors.hpp
===================================================================
--- src/FunctionApproximation/Extractors.hpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/Extractors.hpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -304,9 +304,9 @@
   /** Reorder arguments by increasing distance.
    *
-   * \param args arguments to reorder
+   * \param listargs list of arguments to reorder each
    * \return reordered args
    */
-  FunctionModel::arguments_t reorderArgumentsByIncreasingDistance(
-      const FunctionModel::arguments_t &args
+  FunctionModel::list_of_arguments_t reorderArgumentsByIncreasingDistance(
+      const FunctionModel::list_of_arguments_t &listargs
       );
 
@@ -318,23 +318,23 @@
    * \sa filterArgumentsByParticleTypes()
    *
+   * \param listargs list of arguments to reorder each
+   * \param _types particle type vector
+   * \return reordered args
+   */
+  FunctionModel::list_of_arguments_t reorderArgumentsByParticleTypes(
+      const FunctionModel::list_of_arguments_t &eachargs,
+      const ParticleTypes_t &_types
+      );
+
+  /** Filter arguments according to types, allowing multiples.
+   *
+   * If particle types is (0,1,2) and three arguments, each with a pair of types,
+   * are given, then the alignment will be: (0,1), (0,2), and (1,2).
+   *
    * \param args arguments to reorder
    * \param _types particle type vector
-   * \return reordered args
-   */
-  FunctionModel::arguments_t reorderArgumentsByParticleTypes(
-      const FunctionModel::arguments_t &args,
-      const ParticleTypes_t &_types
-      );
-
-  /** Filter arguments according to types.
-   *
-   * If particle types is (0,1,2) and three arguments, each with a pair of types,
-   * are given, then the alignment will be: (0,1), (0,2), and (1,2).
-   *
-   * \param args arguments to reorder
-   * \param _types particle type vector
-   * \return filtered args
-   */
-  FunctionModel::arguments_t filterArgumentsByParticleTypes(
+   * \return filtered list of args
+   */
+  FunctionModel::list_of_arguments_t filterArgumentsByParticleTypes(
       const FunctionModel::arguments_t &args,
       const ParticleTypes_t &_types
@@ -361,4 +361,14 @@
       const FunctionModel::arguments_t &secondargs);
 
+  /** Combines two argument lists by concatenation.
+   *
+   * @param firstlistargs first list of argument tuples
+   * @param secondlistargs second list of argument tuples
+   * @return concatenated lists
+   */
+  FunctionModel::list_of_arguments_t concatenateListOfArguments(
+      const FunctionModel::list_of_arguments_t &firstlistargs,
+      const FunctionModel::list_of_arguments_t &secondlistargs);
+
 }; /* namespace Extractors */
 
Index: src/FunctionApproximation/FunctionApproximation.cpp
===================================================================
--- src/FunctionApproximation/FunctionApproximation.cpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/FunctionApproximation.cpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -64,5 +64,5 @@
 {}
 
-void FunctionApproximation::setTrainingData(const inputs_t &input, const outputs_t &output)
+void FunctionApproximation::setTrainingData(const filtered_inputs_t &input, const outputs_t &output)
 {
   ASSERT( input.size() == output.size(),
@@ -334,5 +334,5 @@
       +" outputs but we provide "+toString(output_data.size())+".");
   if (!output_data.empty()) {
-    inputs_t::const_iterator initer = input_data.begin();
+    filtered_inputs_t::const_iterator initer = input_data.begin();
     outputs_t::const_iterator outiter = output_data.begin();
     size_t index = 0;
@@ -362,5 +362,5 @@
       +" outputs but we provide "+toString(output_data.size())+".");
   if (!output_data.empty()) {
-    inputs_t::const_iterator initer = input_data.begin();
+    filtered_inputs_t::const_iterator initer = input_data.begin();
     outputs_t::const_iterator outiter = output_data.begin();
     size_t index = 0;
Index: src/FunctionApproximation/FunctionApproximation.hpp
===================================================================
--- src/FunctionApproximation/FunctionApproximation.hpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/FunctionApproximation.hpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -71,4 +71,6 @@
   //!> typedef for a vector of input arguments
   typedef std::vector<FunctionModel::arguments_t> inputs_t;
+  //!> typedef for a vector of input arguments
+  typedef std::vector<FunctionModel::list_of_arguments_t> filtered_inputs_t;
   //!> typedef for a vector of output values
   typedef std::vector<FunctionModel::results_t> outputs_t;
@@ -110,5 +112,5 @@
    *        FunctionApproximation::output_dimension size
    */
-  void setTrainingData(const inputs_t &input, const outputs_t &output);
+  void setTrainingData(const filtered_inputs_t &input, const outputs_t &output);
 
   /** Setter for the model function to be used in the approximation.
@@ -191,5 +193,5 @@
 
   //!> current input set of training data
-  inputs_t input_data;
+  filtered_inputs_t input_data;
   //!> current output set of training data
   outputs_t output_data;
Index: src/FunctionApproximation/FunctionModel.hpp
===================================================================
--- src/FunctionApproximation/FunctionModel.hpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/FunctionModel.hpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -15,4 +15,5 @@
 
 #include <boost/function.hpp>
+#include <list>
 #include <vector>
 
@@ -58,6 +59,8 @@
   //!> typedef for the whole set of parameters of the function
   typedef std::vector<parameter_t> parameters_t;
-  //!> typedef for the argument vector as input to the function
+  //!> typedef for the argument vector as input to the function (subset of distances)
   typedef std::vector<argument_t> arguments_t;
+  //!> typedef for a list of argument vectors as input to the function (list of subsets)
+  typedef std::list<arguments_t> list_of_arguments_t;
   //!> typedef for a single result degree of freedom
   typedef double result_t;
@@ -65,7 +68,7 @@
   typedef std::vector<result_t> results_t;
   //!> typedef for a function containing how to extract required information from a Fragment.
-  typedef boost::function< arguments_t (const Fragment &, const size_t)> extractor_t;
+  typedef boost::function< list_of_arguments_t (const Fragment &, const size_t)> extractor_t;
   //!> typedef for a function containing how to filter required distances from a full argument list.
-  typedef boost::function< arguments_t (const arguments_t &)> filter_t;
+  typedef boost::function< list_of_arguments_t (const arguments_t &)> filter_t;
   //!> typedef for the magic triple function that gets the other two distances for a given argument
   typedef boost::function< std::vector<arguments_t>(const argument_t &, const double)> triplefunction_t;
@@ -114,5 +117,5 @@
    * \return result of the function
    */
-  virtual results_t operator()(const arguments_t &arguments) const=0;
+  virtual results_t operator()(const list_of_arguments_t &arguments) const=0;
 
   /** Evaluates the derivative of the function with the given \a arguments
@@ -124,5 +127,5 @@
    *         input
    */
-  virtual results_t parameter_derivative(const arguments_t &arguments, const size_t index) const=0;
+  virtual results_t parameter_derivative(const list_of_arguments_t &arguments, const size_t index) const=0;
 
   /** States whether lower and upper boundaries should be used to constraint
Index: src/FunctionApproximation/TrainingData.cpp
===================================================================
--- src/FunctionApproximation/TrainingData.cpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/TrainingData.cpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -68,5 +68,5 @@
     EnergyVector.push_back( FunctionModel::results_t(1, energy) );
     // filter distances out of list of all arguments
-    FunctionModel::arguments_t args = filter(all_args);
+    FunctionModel::list_of_arguments_t args = filter(all_args);
     LOG(3, "DEBUG: Filtered arguments are " << args << ".");
     ArgumentVector.push_back( args );
@@ -78,6 +78,6 @@
   double L2sum = 0.;
 
-  FunctionApproximation::inputs_t::const_iterator initer = ArgumentVector.begin();
-  FunctionApproximation::outputs_t::const_iterator outiter = EnergyVector.begin();
+  FilteredInputVector_t::const_iterator initer = ArgumentVector.begin();
+  OutputVector_t::const_iterator outiter = EnergyVector.begin();
   for (; initer != ArgumentVector.end(); ++initer, ++outiter) {
     const FunctionModel::results_t result = model((*initer));
@@ -92,6 +92,6 @@
   double Lmax = 0.;
 //  size_t maxindex = -1;
-  FunctionApproximation::inputs_t::const_iterator initer = ArgumentVector.begin();
-  FunctionApproximation::outputs_t::const_iterator outiter = EnergyVector.begin();
+  FilteredInputVector_t::const_iterator initer = ArgumentVector.begin();
+  OutputVector_t::const_iterator outiter = EnergyVector.begin();
   for (; initer != ArgumentVector.end(); ++initer, ++outiter) {
     const FunctionModel::results_t result = model((*initer));
@@ -113,12 +113,13 @@
       const range_t &range) const
 {
-  TrainingData::L2ErrorConfigurationIndexMap_t WorseFragmentMap;
+  L2ErrorConfigurationIndexMap_t WorseFragmentMap;
   // fragments make it into the container in reversed order, hence count from top down
   size_t index= std::distance(range.first, range.second)-1;
-  InputVector_t::const_iterator initer = ArgumentVector.begin();
+  InputVector_t::const_iterator distanceiter = DistanceVector.begin();
+  FilteredInputVector_t::const_iterator initer = ArgumentVector.begin();
   OutputVector_t::const_iterator outiter = EnergyVector.begin();
-  for (; initer != ArgumentVector.end(); ++initer, ++outiter) {
+  for (; initer != ArgumentVector.end(); ++initer, ++outiter, ++distanceiter) {
     // calculate value from potential
-    const FunctionModel::arguments_t &args = *initer;
+    const FunctionModel::list_of_arguments_t &args = *initer;
     const FunctionModel::results_t result = model(args);
     const double energy = (*outiter)[0];
@@ -131,5 +132,5 @@
       // give only the distances in the debugging text
       std::stringstream streamargs;
-      BOOST_FOREACH (argument_t arg, args) {
+      BOOST_FOREACH (argument_t arg, *distanceiter) {
         streamargs << " " << arg.distance;
       }
@@ -148,6 +149,6 @@
   /// extract distance member variable from argument_t and first value from results_t
   OutputVector_t::const_iterator ergiter = EnergyVector.begin();
-  for (InputVector_t::const_iterator iter = ArgumentVector.begin();
-      iter != ArgumentVector.end(); ++iter, ++ergiter) {
+  for (InputVector_t::const_iterator iter = DistanceVector.begin();
+      iter != DistanceVector.end(); ++iter, ++ergiter) {
     ASSERT( ergiter != EnergyVector.end(),
         "TrainingData::getDistanceEnergyTable() - less output than input values.");
Index: src/FunctionApproximation/TrainingData.hpp
===================================================================
--- src/FunctionApproximation/TrainingData.hpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/TrainingData.hpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -27,7 +27,7 @@
  * Fragment.
  *
- * In TrainingData::operator() we construct first all pair-wise distances as
- * list of all arguments. Then, these are filtered depending on the specific
- * FunctionModel's Filter and only these are handed to down to evaluate it.
+ * TrainingData::operator() takes the set of all possible pair-wise  distances
+ * (InputVector_t) and transforms it via the given filter into a list of subsets
+ * of distances (FilteredInputVector_t) that is feedable to the model.
  *
  */
@@ -41,4 +41,6 @@
   //!> Training tuple input vector pair
   typedef FunctionApproximation::inputs_t InputVector_t;
+  //!> Training tuple modified input vector pair
+  typedef FunctionApproximation::filtered_inputs_t FilteredInputVector_t;
   //!> Training tuple output vector pair
   typedef FunctionApproximation::outputs_t OutputVector_t;
@@ -47,5 +49,4 @@
   //!> Typedef for a map of each fragment with error.
   typedef std::multimap< double, size_t > L2ErrorConfigurationIndexMap_t;
-
 
 public:
@@ -75,5 +76,5 @@
    * \return const ref to training tuple of input vector
    */
-  const InputVector_t& getTrainingInputs() const {
+  const FilteredInputVector_t& getTrainingInputs() const {
     return ArgumentVector;
   }
@@ -142,5 +143,5 @@
   OutputVector_t EnergyVector;
   //!> list of all filtered arguments over all tuples
-  InputVector_t ArgumentVector;
+  FilteredInputVector_t ArgumentVector;
   //!> function to be used for training input data extraction from a fragment
   const FunctionModel::filter_t filter;
Index: src/FunctionApproximation/unittests/ExtractorsUnitTest.cpp
===================================================================
--- src/FunctionApproximation/unittests/ExtractorsUnitTest.cpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/FunctionApproximation/unittests/ExtractorsUnitTest.cpp	(revision e1fe7e9e5ab6e5acab3403d31d4139a02a1c1754)
@@ -182,8 +182,11 @@
   args.push_back(arg);
   CPPUNIT_ASSERT_EQUAL( (size_t)3, args.size() );
+  FunctionModel::list_of_arguments_t listargs(1, args);
 
   // reorder
-  FunctionModel::arguments_t args_sorted =
-      Extractors::reorderArgumentsByIncreasingDistance(args);
+  FunctionModel::list_of_arguments_t listargs_sorted =
+      Extractors::reorderArgumentsByIncreasingDistance(listargs);
+  CPPUNIT_ASSERT_EQUAL( (size_t)1, listargs_sorted.size() );
+  FunctionModel::arguments_t args_sorted = *(listargs_sorted.begin());
   CPPUNIT_ASSERT_EQUAL( (size_t)3, args_sorted.size() );
   CPPUNIT_ASSERT_EQUAL( args[0].distance, args_sorted[0].distance );
