inline void write_beta_matrix(SpMat &betas, int col, double beta0, SpVec &coef) { betas.insert(0, col) = beta0; for(SpVec::InnerIterator iter(coef); iter; ++iter) { betas.insert(iter.index() + 1, col) = iter.value(); } }
inline void write_beta_matrix(SpMat &betas, int col, double beta0, SpVec &coef, bool startatzero) { int add = 0; if (!startatzero) { add = 1; betas.insert(0, col) = beta0; } for(SpVec::InnerIterator iter(coef); iter; ++iter) { betas.insert(iter.index() + add, col) = iter.value(); } }