MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / eye

Method eye

inst/include/Rcpp/vector/MatrixBase.h:51–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 inline R_xlen_t ncol() const { return static_cast<const MATRIX&>(*this).ncol() ; }
50
51 static MATRIX eye(int n) {
52 const bool enabled =
53 traits::is_arithmetic<stored_type>::value ||
54 traits::same_type<stored_type, Rcomplex>::value;
55 (void)sizeof(traits::allowed_matrix_type<enabled>);
56
57 return MATRIX::diag(n, traits::one_type<stored_type>());
58 }
59
60 static MATRIX ones(int n) {
61 const bool enabled =

Callers

nothing calls this directly

Calls 1

diagFunction · 0.85

Tested by

no test coverage detected