本文整理汇总了C++中ArrayInfo::isLinear方法的典型用法代码示例。如果您正苦于以下问题:C++ ArrayInfo::isLinear方法的具体用法?C++ ArrayInfo::isLinear怎么用?C++ ArrayInfo::isLinear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayInfo
的用法示例。
在下文中一共展示了ArrayInfo::isLinear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: af_histogram
af_err af_histogram(af_array *out, const af_array in,
const unsigned nbins, const double minval, const double maxval)
{
try {
ArrayInfo info = getInfo(in);
af_dtype type = info.getType();
af_array output;
switch(type) {
case f32: output = histogram<float , uint>(in, nbins, minval, maxval, info.isLinear()); break;
case f64: output = histogram<double, uint>(in, nbins, minval, maxval, info.isLinear()); break;
case b8 : output = histogram<char , uint>(in, nbins, minval, maxval, info.isLinear()); break;
case s32: output = histogram<int , uint>(in, nbins, minval, maxval, info.isLinear()); break;
case u32: output = histogram<uint , uint>(in, nbins, minval, maxval, info.isLinear()); break;
case s16: output = histogram<short , uint>(in, nbins, minval, maxval, info.isLinear()); break;
case u16: output = histogram<ushort, uint>(in, nbins, minval, maxval, info.isLinear()); break;
case s64: output = histogram<intl , uint>(in, nbins, minval, maxval, info.isLinear()); break;
case u64: output = histogram<uintl , uint>(in, nbins, minval, maxval, info.isLinear()); break;
case u8 : output = histogram<uchar , uint>(in, nbins, minval, maxval, info.isLinear()); break;
default : TYPE_ERROR(1, type);
}
std::swap(*out,output);
}
CATCHALL;
return AF_SUCCESS;
}