--- trunk/src/math/CubicSpline.cpp 2015/03/03 15:22:26 2057 +++ trunk/src/math/CubicSpline.cpp 2015/03/05 16:30:23 2069 @@ -50,7 +50,7 @@ using namespace std; using namespace OpenMD; using namespace std; -CubicSpline::CubicSpline() : generated(false), isUniform(true) { +CubicSpline::CubicSpline() : isUniform(true), generated(false) { x_.clear(); y_.clear(); } @@ -319,7 +319,15 @@ std::vector CubicSpline::sort_permutation(std::ve std::vector CubicSpline::sort_permutation(std::vector& v) { std::vector p(v.size()); - std::iota(p.begin(), p.end(), 0); + + // 6 lines to replace std::iota(p.begin(), p.end(), 0); + int value = 0; + std::vector::iterator i; + for (i = p.begin(); i != p.end(); ++i) { + (*i) = value; + ++value; + } + std::sort(p.begin(), p.end(), OpenMD::Comparator(v) ); return p; }