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

Function af_var_all_v2

src/api/c/var.cpp:344–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344af_err af_var_all_v2(double* realVal, double* imagVal, const af_array in,
345 const af_var_bias bias) {
346 try {
347 const ArrayInfo& info = getInfo(in);
348 af_dtype type = info.getType();
349 switch (type) {
350 case f64: *realVal = varAll<double, double>(in, bias); break;
351 case f32: *realVal = varAll<float, float>(in, bias); break;
352 case s32: *realVal = varAll<int, float>(in, bias); break;
353 case u32: *realVal = varAll<uint, float>(in, bias); break;
354 case s16: *realVal = varAll<short, float>(in, bias); break;
355 case u16: *realVal = varAll<ushort, float>(in, bias); break;
356 case s64: *realVal = varAll<intl, double>(in, bias); break;
357 case u64: *realVal = varAll<uintl, double>(in, bias); break;
358 case s8: *realVal = varAll<schar, float>(in, bias); break;
359 case u8: *realVal = varAll<uchar, float>(in, bias); break;
360 case b8: *realVal = varAll<char, float>(in, bias); break;
361 case f16: *realVal = varAll<half, float>(in, bias); break;
362 case c32: {
363 cfloat tmp = varAll<cfloat, cfloat>(in, bias);
364 *realVal = real(tmp);
365 *imagVal = imag(tmp);
366 } break;
367 case c64: {
368 cdouble tmp = varAll<cdouble, cdouble>(in, bias);
369 *realVal = real(tmp);
370 *imagVal = imag(tmp);
371 } break;
372 default: TYPE_ERROR(1, type);
373 }
374 }
375 CATCHALL;
376 return AF_SUCCESS;
377}
378
379af_err af_var_all_weighted(double* realVal, double* imagVal, const af_array in,
380 const af_array weights) {

Callers 3

af_var_allFunction · 0.70
varFunction · 0.50
af_cdouble varFunction · 0.50

Calls 3

realFunction · 0.50
imagFunction · 0.50
getTypeMethod · 0.45

Tested by

no test coverage detected