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 addFactor(Real *x, long nrx, long ncx, Real *c, long nrc, long ncc, unsigned *v)
        {
            Real *xj, *yj, *ck;
            for (long k = ncc - 1; k >= 0; k--)
            {
                for (int j = 0; j < ncx; j++)
                {
                    xj = &x[j * nrx];
                    yj = &x[(k * ncx + j)*nrx];
                    ck = &c[k * nrc];
                    for (int i = 0; i < nrx; i++)
                    {
                        yj[i] = ck[v[i]-1] * xj[i];
                    }
                }
            }
        }
inline void addFactor ( Real * x , long nrx , long ncx , Real * c , long nrc , long ncc , unsigned * v ) { Real * xj , * yj , * ck ; for ( long k = ncc - 1 ; k >= 0 ; k -- ) { for ( int j = 0 ; j < ncx ; j ++ ) { xj = & x [ j * nrx ] ; yj = & x [ ( k * ncx + j ) * nrx ] ; ck = & c [ k * nrc ] ; for ( int i = 0 ; i < nrx ; i ++ ) { yj [ i ] = ck [ v [ i ] - 1 ] * xj [ i ] ; } } } }
Adopted from modelMatrix.cpp in R
Adopted from modelMatrix . cpp in R