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

Function af_hist_equal

src/api/c/histeq.cpp:79–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79af_err af_hist_equal(af_array* out, const af_array in, const af_array hist) {
80 try {
81 const ArrayInfo& dataInfo = getInfo(in);
82 const ArrayInfo& histInfo = getInfo(hist);
83
84 af_dtype dataType = dataInfo.getType();
85 af::dim4 histDims = histInfo.dims();
86
87 ARG_ASSERT(2, (histDims.ndims() == 1));
88
89 af_array output = 0;
90 switch (dataType) {
91 case f64: output = hist_equal<double, uint>(in, hist); break;
92 case f32: output = hist_equal<float, uint>(in, hist); break;
93 case s32: output = hist_equal<int, uint>(in, hist); break;
94 case u32: output = hist_equal<uint, uint>(in, hist); break;
95 case s16: output = hist_equal<short, uint>(in, hist); break;
96 case u16: output = hist_equal<ushort, uint>(in, hist); break;
97 case s64: output = hist_equal<intl, uint>(in, hist); break;
98 case u64: output = hist_equal<uintl, uint>(in, hist); break;
99 case s8: output = hist_equal<schar, uint>(in, hist); break;
100 case u8: output = hist_equal<uchar, uint>(in, hist); break;
101 default: TYPE_ERROR(1, dataType);
102 }
103 std::swap(*out, output);
104 }
105 CATCHALL;
106
107 return AF_SUCCESS;
108}

Callers 1

histEqualFunction · 0.50

Calls 4

swapFunction · 0.85
getTypeMethod · 0.45
dimsMethod · 0.45
ndimsMethod · 0.45

Tested by

no test coverage detected