@@ -156,6 +156,28 @@ namespace af
156156 */
157157 AFAPI array abs (const array &in);
158158
159+ /* *
160+ C++ Interface for arg
161+
162+ \param[in] in is input array
163+ \return phase of \p in
164+
165+ \ingroup arith_func_arg
166+ */
167+ AFAPI array arg (const array &in);
168+
169+ /* *
170+ C++ Interface for getting the sign of input
171+
172+ \param[in] in is input array
173+ \return the sign of each element of input
174+
175+ \note output is 1 for negative numbers and 0 for positive numbers
176+
177+ \ingroup arith_func_sign
178+ */
179+ AFAPI array sign (const array &in);
180+
159181 /* *
160182 C++ Interface for rounding an array of numbers
161183
@@ -168,6 +190,17 @@ namespace af
168190 */
169191 AFAPI array round (const array &in);
170192
193+ /* *
194+ C++ Interface for truncating an array of numbers
195+
196+ \param[in] in is input array
197+ \return values truncated to nearest integer not greater than input values
198+
199+ \ingroup arith_func_trunc
200+ */
201+ AFAPI array trunc (const array &in);
202+
203+
171204 /* *
172205 C++ Interface for flooring an array of numbers
173206
@@ -447,6 +480,39 @@ namespace af
447480 */
448481 AFAPI array atanh (const array &in);
449482
483+ /* *
484+ C++ Interface for nth root
485+
486+ \param[in] lhs is nth root
487+ \param[in] rhs is value
488+ \return \p lhs th root of \p rhs
489+
490+ \ingroup arith_func_root
491+ */
492+ AFAPI array root (const array &lhs, const array &rhs);
493+
494+ /* *
495+ C++ Interface for nth root
496+
497+ \param[in] lhs is nth root
498+ \param[in] rhs is value
499+ \return \p lhs th root of \p rhs
500+
501+ \ingroup arith_func_root
502+ */
503+ AFAPI array root (const array &lhs, const double rhs);
504+
505+ /* *
506+ C++ Interface for nth root
507+
508+ \param[in] lhs is nth root
509+ \param[in] rhs is value
510+ \return \p lhs th root of \p rhs
511+
512+ \ingroup arith_func_root
513+ */
514+ AFAPI array root (const double lhs, const array &rhs);
515+
450516
451517 /* *
452518 C++ Interface for power when base and exponent are arrays
@@ -481,6 +547,16 @@ namespace af
481547 */
482548 AFAPI array pow (const double lhs, const array &rhs);
483549
550+ /* *
551+ C++ Interface for power of 2
552+
553+ \param[in] in is exponent
554+ \return 2 raised to power of \p in
555+
556+ \ingroup arith_func_pow2
557+ */
558+ AFAPI array pow2 (const array &in);
559+
484560 /* *
485561 C++ Interface for exponential of an array
486562
@@ -585,6 +661,16 @@ namespace af
585661 */
586662 AFAPI array cbrt (const array &in);
587663
664+ /* *
665+ C++ Interface for factorial of input
666+
667+ \param[in] in is input
668+ \return the factorial function of input
669+
670+ \ingroup arith_func_factorial
671+ */
672+ AFAPI array factorial (const array &in);
673+
588674 /* *
589675 C++ Interface for gamma function of input
590676
@@ -948,6 +1034,30 @@ extern "C" {
9481034 */
9491035 AFAPI af_err af_abs (af_array *out, const af_array in);
9501036
1037+ /* *
1038+ C Interface for finding the phase
1039+
1040+ \param[out] out will the phase of \p in
1041+ \param[in] in is input array
1042+ \return \ref AF_SUCCESS if the execution completes properly
1043+
1044+ \ingroup arith_func_arg
1045+ */
1046+ AFAPI af_err af_arg (af_array *out, const af_array in);
1047+
1048+ /* *
1049+ C Interface for finding the sign of the input
1050+
1051+ \param[out] out will contain the sign of each element of the input arrays
1052+ \param[in] in is input array
1053+ \return \ref AF_SUCCESS if the execution completes properly
1054+
1055+ \note output is 1 for negative numbers and 0 for positive numbers
1056+
1057+ \ingroup arith_func_round
1058+ */
1059+ AFAPI af_err af_sign (af_array *out, const af_array in);
1060+
9511061 /* *
9521062 C Interface for rounding an array of numbers
9531063
@@ -961,6 +1071,17 @@ extern "C" {
9611071 */
9621072 AFAPI af_err af_round (af_array *out, const af_array in);
9631073
1074+ /* *
1075+ C Interface for truncing an array of numbers
1076+
1077+ \param[out] out will contain values truncated to nearest integer not greater than input
1078+ \param[in] in is input array
1079+ \return \ref AF_SUCCESS if the execution completes properly
1080+
1081+ \ingroup arith_func_trunc
1082+ */
1083+ AFAPI af_err af_trunc (af_array *out, const af_array in);
1084+
9641085 /* *
9651086 C Interface for flooring an array of numbers
9661087
@@ -1198,6 +1319,20 @@ extern "C" {
11981319 */
11991320 AFAPI af_err af_atanh (af_array *out, const af_array in);
12001321
1322+ /* *
1323+ C Interface for root
1324+
1325+ \param[out] out will contain \p lhs th root of \p rhs
1326+ \param[in] lhs is nth root
1327+ \param[in] rhs is value
1328+ \param[in] batch specifies if operations need to be performed in batch mode
1329+ \return \ref AF_SUCCESS if the execution completes properly
1330+
1331+ \ingroup arith_func_root
1332+ */
1333+ AFAPI af_err af_root (af_array *out, const af_array lhs, const af_array rhs, const bool batch);
1334+
1335+
12011336 /* *
12021337 C Interface for power
12031338
@@ -1211,6 +1346,17 @@ extern "C" {
12111346 */
12121347 AFAPI af_err af_pow (af_array *out, const af_array lhs, const af_array rhs, const bool batch);
12131348
1349+ /* *
1350+ C Interface for power of two
1351+
1352+ \param[out] out will contain the values of 2 to the power \p in
1353+ \param[in] in is exponent
1354+ \return \ref AF_SUCCESS if the execution completes properly
1355+
1356+ \ingroup arith_func_pow2
1357+ */
1358+ AFAPI af_err af_pow2 (af_array *out, const af_array in);
1359+
12141360 /* *
12151361 C Interface for exponential of an array
12161362
@@ -1321,6 +1467,17 @@ extern "C" {
13211467 */
13221468 AFAPI af_err af_cbrt (af_array *out, const af_array in);
13231469
1470+ /* *
1471+ C Interface for the factorial
1472+
1473+ \param[out] out will contain the result of factorial of \p in
1474+ \param[in] in is input
1475+ \return \ref AF_SUCCESS if the execution completes properly
1476+
1477+ \ingroup arith_func_factorial
1478+ */
1479+ AFAPI af_err af_factorial (af_array *out, const af_array in);
1480+
13241481 /* *
13251482 C Interface for the gamma function
13261483
0 commit comments