src/stats/ss/internal/model.hpp
/*
         * Adopted from modelMatrix.cpp in R
         */
Adopted from modelMatrix.cpp in R
Adopted from modelMatrix . cpp in R
inline void firstFactor(Real *x, long nrx, long ncx, Real *c, long nrc, long ncc, unsigned *v)
        {
            Real *cj, *xj;
            for (int j = 0; j < ncc; j++)
            {
                xj = &x[j * nrx];
                cj = &c[j * nrc];
                for (int i = 0; i < nrx; i++)
                {
                    xj[i] = cj[v[i]-1];
                }
            }
        }
inline void firstFactor ( Real * x , long nrx , long ncx , Real * c , long nrc , long ncc , unsigned * v ) { Real * cj , * xj ; for ( int j = 0 ; j < ncc ; j ++ ) { xj = & x [ j * nrx ] ; cj = & c [ j * nrc ] ; for ( int i = 0 ; i < nrx ; i ++ ) { xj [ i ] = cj [ v [ i ] - 1 ] ; } } }
Adopted from modelMatrix.cpp in R
Adopted from modelMatrix . cpp in R