本文整理汇总了C++中array类的典型用法代码示例。如果您正苦于以下问题:C++ array类的具体用法?C++ array怎么用?C++ array使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了array类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accuracy
// Get accuracy of the predicted results
float accuracy(const array& predicted, const array& target)
{
return 100 * count<float>(predicted == target) / target.elements();
}
示例2: arr
array::array(const array& in) : arr(0), isRef(false)
{
AF_THROW(af_weak_copy(&arr, in.get()));
}
示例3:
constexpr bool operator<(array<T, M> a, array<U, N> b) {
return M < N || detail::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end());
}
示例4: swap
inline void swap (array<T,N>& x, array<T,N>& y) {
x.swap(y);
}
示例5: stack_push_back_value
void stack_push_back_value( array<as_value> & stack, T value )
{
stack.push_back( value );
}
示例6: rgb2ycbcr
array rgb2ycbcr(const array& in, const YCCStd standard) {
af_array temp = 0;
AF_THROW(af_rgb2ycbcr(&temp, in.get(), standard));
return array(temp);
}
示例7: equal
bool operator== (const array<T,N>& x, const array<T,N>& y) {
return std::equal(x.begin(), x.end(), y.begin());
}
示例8: var
template<> AFAPI af_cdouble var(const array& in, const array weights)
{
double real, imag;
AF_THROW(af_var_all_weighted(&real, &imag, in.get(), weights.get()));
return std::complex<double>(real, imag);
}
示例9: print
void print(const array<T,N>& a)
{
for (size_t i=0; i!=a.size(); ++i)
cout << a[i] << '\n';
}
示例10: array
explicit array(const array<U, N>& that) {
std::uninitialized_copy(that.begin(), that.end(), begin());
}
示例11: swap
void swap(array<U, N>& that) {
swap_ranges(begin(), end(), that.begin());
}
示例12: abserr
float abserr(const array& predicted, const array& target)
{
return 100 * sum<float>(abs(predicted - target)) / predicted.elements();
}
示例13: lexicographical_compare
bool operator< (const array<T,N>& x, const array<T,N>& y) {
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
}
示例14: hash_value
std::size_t hash_value(const array<T,N>& arr)
{
return boost::hash_range(arr.begin(), arr.end());
}
示例15:
bool operator!=(const array<T, N>& left, const array<U, N>& right) {
return !equal(left.begin(), left.end(), right.begin());
}