本文整理汇总了C++中array类的典型用法代码示例。如果您正苦于以下问题:C++ array类的具体用法?C++ array怎么用?C++ array使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了array类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:EmergentOrder,项目名称:arrayfire,代码行数:5,代码来源:knn.cpp
示例2: arr
array::array(const array& in) : arr(0), isRef(false)
{
AF_THROW(af_weak_copy(&arr, in.get()));
}
开发者ID:franklinzhang,项目名称:arrayfire,代码行数:4,代码来源:array.cpp
示例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());
}
开发者ID:Caraul,项目名称:airgit,代码行数:3,代码来源:array.hpp
示例4: swap
inline void swap (array<T,N>& x, array<T,N>& y) {
x.swap(y);
}
开发者ID:66eli77,项目名称:RadChip,代码行数:3,代码来源:array.hpp
示例5: stack_push_back_value
void stack_push_back_value( array<as_value> & stack, T value )
{
stack.push_back( value );
}
开发者ID:Cucurbitace,项目名称:attract,代码行数:4,代码来源:gameswf_avm2_jit.cpp
示例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);
}
开发者ID:9prady9,项目名称:arrayfire,代码行数:5,代码来源:ycbcr_rgb.cpp
示例7: equal
bool operator== (const array<T,N>& x, const array<T,N>& y) {
return std::equal(x.begin(), x.end(), y.begin());
}
开发者ID:66eli77,项目名称:RadChip,代码行数:3,代码来源:array.hpp
示例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);
}
开发者ID:EmergentOrder,项目名称:arrayfire,代码行数:6,代码来源:var.cpp
示例9: print
void print(const array<T,N>& a)
{
for (size_t i=0; i!=a.size(); ++i)
cout << a[i] << '\n';
}
开发者ID:sasaki-seiji,项目名称:ProgrammingLanguageCPP4th,代码行数:5,代码来源:struct_and_array.cpp
示例10: array
explicit array(const array<U, N>& that) {
std::uninitialized_copy(that.begin(), that.end(), begin());
}
开发者ID:acsearle,项目名称:backlight,代码行数:3,代码来源:array.hpp
示例11: swap
void swap(array<U, N>& that) {
swap_ranges(begin(), end(), that.begin());
}
开发者ID:acsearle,项目名称:backlight,代码行数:3,代码来源:array.hpp
示例12: abserr
float abserr(const array& predicted, const array& target)
{
return 100 * sum<float>(abs(predicted - target)) / predicted.elements();
}
开发者ID:rotorliu,项目名称:arrayfire,代码行数:4,代码来源:logistic_regression.cpp
示例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());
}
开发者ID:66eli77,项目名称:RadChip,代码行数:3,代码来源:array.hpp
示例14: hash_value
std::size_t hash_value(const array<T,N>& arr)
{
return boost::hash_range(arr.begin(), arr.end());
}
开发者ID:66eli77,项目名称:RadChip,代码行数:4,代码来源:array.hpp
示例15:
bool operator!=(const array<T, N>& left, const array<U, N>& right) {
return !equal(left.begin(), left.end(), right.begin());
}
开发者ID:acsearle,项目名称:backlight,代码行数:3,代码来源:array.hpp
示例16: stack_push_back_ref
void stack_push_back_ref( array<as_value> & stack, T & value )
{
stack.push_back( value );
}
开发者ID:Cucurbitace,项目名称:attract,代码行数:4,代码来源:gameswf_avm2_jit.cpp
示例17: lexicographical_compare
bool operator<(const array<T, M>& left, const array<U, N>& right) {
return lexicographical_compare(left.begin(), left.end(), right.begin(),
right.end());
}
开发者ID:acsearle,项目名称:backlight,代码行数:4,代码来源:array.hpp
示例18: add
void Pass::add(PassType type, array<Pass>& passes)
{
for(size_t i = 0; i < passes.size(); i++)
if(passes[i].type == type)
return;
Pass pass;
pass.type = type;
pass.filter = true;
pass.exposure = false;
pass.divide_type = PASS_NONE;
switch(type) {
case PASS_NONE:
pass.components = 0;
break;
case PASS_COMBINED:
pass.components = 4;
pass.exposure = true;
break;
case PASS_DEPTH:
pass.components = 1;
pass.filter = false;
break;
case PASS_MIST:
pass.components = 1;
break;
case PASS_NORMAL:
pass.components = 4;
break;
case PASS_UV:
pass.components = 4;
break;
case PASS_MOTION:
pass.components = 4;
pass.divide_type = PASS_MOTION_WEIGHT;
break;
case PASS_MOTION_WEIGHT:
pass.components = 1;
break;
case PASS_OBJECT_ID:
case PASS_MATERIAL_ID:
pass.components = 1;
pass.filter = false;
break;
case PASS_EMISSION:
case PASS_BACKGROUND:
pass.components = 4;
pass.exposure = true;
break;
case PASS_AO:
pass.components = 4;
break;
case PASS_SHADOW:
pass.components = 4;
pass.exposure = false;
break;
case PASS_LIGHT:
/* This isn't a real pass, used by baking to see whether
* light data is needed or not.
*
* Set components to 0 so pass sort below happens in a
* determined way.
*/
pass.components = 0;
break;
#ifdef WITH_CYCLES_DEBUG
case PASS_BVH_TRAVERSED_NODES:
case PASS_BVH_TRAVERSED_INSTANCES:
case PASS_BVH_INTERSECTIONS:
case PASS_RAY_BOUNCES:
pass.components = 1;
pass.exposure = false;
break;
#endif
case PASS_RENDER_TIME:
/* This pass is handled entirely on the host side. */
pass.components = 0;
break;
case PASS_DIFFUSE_COLOR:
case PASS_GLOSSY_COLOR:
case PASS_TRANSMISSION_COLOR:
case PASS_SUBSURFACE_COLOR:
pass.components = 4;
break;
case PASS_DIFFUSE_DIRECT:
case PASS_DIFFUSE_INDIRECT:
pass.components = 4;
pass.exposure = true;
pass.divide_type = PASS_DIFFUSE_COLOR;
break;
case PASS_GLOSSY_DIRECT:
case PASS_GLOSSY_INDIRECT:
pass.components = 4;
pass.exposure = true;
pass.divide_type = PASS_GLOSSY_COLOR;
break;
//.........这里部分代码省略.........
开发者ID:mdtrooper,项目名称:goxel,代码行数:101,代码来源:film.cpp
示例19: val
mapped_type val() const {
return ary_->get_val_at_id(id(), w_, o_, true, false);
}
开发者ID:AndyGreenwell,项目名称:Jellyfish,代码行数:3,代码来源:large_hash_iterator.hpp
示例20: pos
size_t pos() const { return key_.get_bits(0, ary_->lsize()); }
开发者ID:AndyGreenwell,项目名称:Jellyfish,代码行数:1,代码来源:large_hash_iterator.hpp
注:本文中的array类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论