MCPcopy Create free account
hub / github.com/numpy/numpy / identity_matrix

Function identity_matrix

numpy/linalg/umath_linalg.cpp:973–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

971 /* identity square matrix generation */
972template<typename typ>
973static inline void
974identity_matrix(typ *matrix, size_t n)
975{
976 size_t i;
977 /* in IEEE floating point, zeroes are represented as bitwise 0 */
978 memset(matrix, 0, n*n*sizeof(typ));
979
980 for (i = 0; i < n; ++i)
981 {
982 *matrix = numeric_limits<typ>::one;
983 matrix += n+1;
984 }
985}
986
987 /* lower/upper triangular matrix using blas (in place) */
988

Callers 2

invFunction · 0.85
svd_wrapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected