Algorithm-Statistic

 view release on metacpan or  search on metacpan

Statistic.xs  view on Meta::CPAN

#define NDEBUG
#include <memory>

#include "kth_order_statistic.hpp"
#include "debug.hpp"

/**
 * Default comparator for numerics
 */
class PerlDefaultCompare {
public:
    virtual ~PerlDefaultCompare() {}

    virtual int operator()(SV* const x, SV* const y) const {
        dTHX; 
        SV *z = x;
        if (SvTYPE(x) < SvTYPE(y)) {
            // For comparison betwee flaot and int
            z = y;
        }

Statistic.xs  view on Meta::CPAN

            }
        }
    
        return res;
    }
};

/**
 * Extended comparator specified from perl
 */
class PerlCompare : public PerlDefaultCompare {
public:
    PerlCompare(SV* compare) : compare_(compare), PerlDefaultCompare() {}

    int operator()(SV* const x, SV* const y) const {
        dTHX;
        dSP;

        ENTER;
        SAVETMPS;

        PUSHMARK(SP);



( run in 0.303 second using v1.01-cache-2.11-cpan-64827b87656 )