MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / af_factorial

Function af_factorial

src/api/c/unary.cpp:662–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

660}
661
662af_err af_factorial(af_array *out, const af_array in) {
663 try {
664 af_array one;
665 const ArrayInfo &in_info = getInfo(in);
666 if (in_info.ndims() == 0) { return af_retain_array(out, in); }
667
668 AF_CHECK(af_constant(&one, 1, in_info.ndims(), in_info.dims().get(),
669 in_info.getType()));
670
671 af_array inp1;
672 AF_CHECK(af_add(&inp1, one, in, false));
673
674 AF_CHECK(af_tgamma(out, inp1));
675
676 AF_CHECK(af_release_array(one));
677 AF_CHECK(af_release_array(inp1));
678 }
679 CATCHALL;
680
681 return AF_SUCCESS;
682}
683
684template<typename T, af_op_t op>
685static inline af_array checkOp(const af_array in) {

Callers

nothing calls this directly

Calls 8

af_addFunction · 0.85
af_retain_arrayFunction · 0.70
af_constantFunction · 0.70
af_release_arrayFunction · 0.70
ndimsMethod · 0.45
getMethod · 0.45
dimsMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected