<commit_before>#ifndef ASTI_POLYLINE
#define ASTI_POLYLINE
#include "bspline.hpp"
#include <vector>
namespace geom
{

template <class Point>
class polyline : public bspline<Point>
{

    typedef typename bspline<Point>::cpts_t cpts_t;

    static
    std::vector<double> compute_knots(const cpts_t &pts)
    {
        size_t num_pts = pts.size();
        std::vector<double> ks(num_pts+2);
        ks[0] = 0;
        ks[num_pts + 1] = 1.0;
        int prev  = 0;
        for(int i = 0; i < num_pts; ++i)
        {
            ks[i+1] = len(pts[i]-pts[prev]);
            prev = i;
        }
        return ks;
    }

    static
    std::vector<double> compute_knots(size_t num_pts, double start, double end)
    {
        assert(num_pts > 0);
        std::vector<double> ks(num_pts+2);
        ks[0] = start;
        ks[num_pts + 1] = end;

        for(size_t i = 0; i < num_pts; ++i)
        {
            ks[i+1] = start + i*(end - start)/(num_pts-1);
        }
        return ks;
    }
public:
    polyline(cpts_t pts):
        bspline<Point>(std::move(pts),compute_knots(pts),1)
    {
    }

    polyline(cpts_t pts, double start, double end):
        bspline<Point>(std::move(pts),compute_knots(pts.size(),start,end),1)
    {
    }
};

}
#endif // ASTI_POLYLINE
<commit_msg>more osx failure due to argument eval order and move semantics<commit_after>#ifndef ASTI_POLYLINE
#define ASTI_POLYLINE
#include "bspline.hpp"
#include <vector>
namespace geom
{

template <class Point>
class polyline : public bspline<Point>
{

    typedef typename bspline<Point>::cpts_t cpts_t;

    static
    std::vector<double> compute_knots(const cpts_t &pts)
    {
        size_t num_pts = pts.size();
        std::vector<double> ks(num_pts+2);
        ks[0] = 0;
        ks[num_pts + 1] = 1.0;
        int prev  = 0;
        for(int i = 0; i < num_pts; ++i)
        {
            ks[i+1] = len(pts[i]-pts[prev]);
            prev = i;
        }
        return ks;
    }

    static
    std::vector<double> compute_knots(size_t num_pts, double start, double end)
    {
        assert(num_pts > 0);
        std::vector<double> ks(num_pts+2);
        ks[0] = start;
        ks[num_pts + 1] = end;

        for(size_t i = 0; i < num_pts; ++i)
        {
            ks[i+1] = start + i*(end - start)/(num_pts-1);
        }
        return ks;
    }
public:
    polyline(cpts_t pts):
        bspline<Point>(pts,compute_knots(pts),1)
    {
    }

    polyline(cpts_t pts, double start, double end):
        bspline<Point>(pts,compute_knots(pts.size(),start,end),1)
    {
    }
};

}
#endif // ASTI_POLYLINE

{'fraction_non_alphanumeric': 0.1415860735009671, 'fraction_numerical': 0.013926499032882012, 'mean_word_length': 2.2284644194756553, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5731935', 'n_tokens_mistral': 1038, 'n_tokens_neox': 983, 'n_words': 196}