Is it necessary to use all this STL stuff? It gives complications with SWIG. There are probably classes already implemented in Shogun that you could use.