| 175 | |
| 176 | template <typename U> |
| 177 | void fill_diag__dispatch( traits::false_type, const U& u) { |
| 178 | Shield<SEXP> elem( converter_type::get( u ) ); |
| 179 | |
| 180 | R_xlen_t bounds = std::min(Matrix::nrow(), Matrix::ncol()); |
| 181 | for (R_xlen_t i = 0; i < bounds; ++i) { |
| 182 | (*this)(i, i) = elem; |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | template <typename U> |
| 187 | void fill_diag__dispatch( traits::true_type, const U& u) { |