| 58 | } |
| 59 | |
| 60 | static MATRIX ones(int n) { |
| 61 | const bool enabled = |
| 62 | traits::is_arithmetic<stored_type>::value || |
| 63 | traits::same_type<stored_type, Rcomplex>::value; |
| 64 | (void)sizeof(traits::allowed_matrix_type<enabled>); |
| 65 | |
| 66 | MATRIX res(n, n); |
| 67 | std::fill( |
| 68 | res.begin(), res.end(), |
| 69 | traits::one_type<stored_type>() |
| 70 | ); |
| 71 | return res; |
| 72 | } |
| 73 | |
| 74 | static MATRIX zeros(int n) { |
| 75 | const bool enabled = |