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

Function addUfuncs

numpy/linalg/umath_linalg.cpp:4513–4545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4511};
4512
4513static int
4514addUfuncs(PyObject *dictionary) {
4515 PyObject *f;
4516 int i;
4517 const int gufunc_count = sizeof(gufunc_descriptors)/
4518 sizeof(gufunc_descriptors[0]);
4519 for (i = 0; i < gufunc_count; i++) {
4520 GUFUNC_DESCRIPTOR_t* d = &gufunc_descriptors[i];
4521 f = PyUFunc_FromFuncAndDataAndSignature(d->funcs,
4522 array_of_nulls,
4523 d->types,
4524 d->ntypes,
4525 d->nin,
4526 d->nout,
4527 PyUFunc_None,
4528 d->name,
4529 d->doc,
4530 0,
4531 d->signature);
4532 if (f == NULL) {
4533 return -1;
4534 }
4535#if 0
4536 dump_ufunc_object((PyUFuncObject*) f);
4537#endif
4538 int ret = PyDict_SetItemString(dictionary, d->name, f);
4539 Py_DECREF(f);
4540 if (ret < 0) {
4541 return -1;
4542 }
4543 }
4544 return 0;
4545}
4546
4547
4548

Callers 1

PyInit__umath_linalgFunction · 0.85

Calls 2

dump_ufunc_objectFunction · 0.85

Tested by

no test coverage detected