| 150 | } |
| 151 | |
| 152 | af_err af_conjg(af_array *out, const af_array in) { |
| 153 | try { |
| 154 | const ArrayInfo &info = getInfo(in); |
| 155 | af_dtype type = info.getType(); |
| 156 | |
| 157 | if (type != c32 && type != c64) { return af_retain_array(out, in); } |
| 158 | if (info.ndims() == 0) { return af_retain_array(out, in); } |
| 159 | |
| 160 | af_array res; |
| 161 | switch (type) { |
| 162 | case c32: |
| 163 | res = getHandle(conj<cfloat>(getArray<cfloat>(in))); |
| 164 | break; |
| 165 | case c64: |
| 166 | res = getHandle(conj<cdouble>(getArray<cdouble>(in))); |
| 167 | break; |
| 168 | |
| 169 | default: TYPE_ERROR(0, type); |
| 170 | } |
| 171 | |
| 172 | std::swap(*out, res); |
| 173 | } |
| 174 | CATCHALL; |
| 175 | return AF_SUCCESS; |
| 176 | } |
| 177 | |
| 178 | af_err af_abs(af_array *out, const af_array in) { |
| 179 | try { |
no test coverage detected