void vectorial()

in include/BinAlgo.h [30:69]


    void vectorial(uint32 *pr, const T *pz, uint32 n) const
    {
        if (!L && !R) {
            Details::Loop<T,base_t>::loop(*this, pr, pz, n);
        }
        else {
            const uint32 nElem = base_t::nElem;
            const uint32 idealbufsize = 256;
            const uint32 bufsize = nElem * (idealbufsize / nElem + ((idealbufsize % nElem) ? 1 : 0));
            T databuf[bufsize];
            uint32 resbuf[bufsize];
            uint32 indexbuf[bufsize];

            uint32 *prend = pr + n;
            while(pr != prend) {
                uint32 cnt = 0;
                uint32 niter = std::min(bufsize, (uint32)std::distance(pr,prend));
                for (uint32 j = 0; j < niter; ++j) {
                    T z = pz[j];
                    // FIXME: use SSE2?
                    if (!L || z >= x0)
                        if (!R || z < xN) {
                            databuf[cnt] = z;
                            indexbuf[cnt] = j;
                            ++cnt;
                        }
                        else
                            pr[j] = N;
                    else
                        pr[j] = std::numeric_limits<uint32>::max();
                }
                // FIXME: merge these two loops
                Details::Loop<T,base_t>::loop(*this, resbuf, databuf, cnt);
                for (uint32 j = 0; j < cnt; ++j)
                    pr[indexbuf[j]] = resbuf[j];
                pr += niter;
                pz += niter;
            }
        }
    }