当前位置: 首页>>代码示例>>C++>>正文


C++ nt2::definitely_not_equal方法代码示例

本文整理汇总了C++中nt2::definitely_not_equal方法的典型用法代码示例。如果您正苦于以下问题:C++ nt2::definitely_not_equal方法的具体用法?C++ nt2::definitely_not_equal怎么用?C++ nt2::definitely_not_equal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nt2的用法示例。


在下文中一共展示了nt2::definitely_not_equal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NT2_TEST_CASE_TPL

NT2_TEST_CASE_TPL ( definitely_not_equal_unsigned_int,  NT2_UNSIGNED_TYPES)
{
  using nt2::definitely_not_equal;
  using nt2::tag::definitely_not_equal_;
  typedef typename nt2::meta::as_integer<T>::type          iT;
  typedef typename nt2::meta::call<definitely_not_equal_(T,T,iT)>::type r_t;
  typedef typename nt2::meta::as_logical<T>::type wished_r_t;

  // return type conformity test
  NT2_TEST_TYPE_IS(r_t, wished_r_t);

  // specific values tests
  NT2_TEST_EQUAL(definitely_not_equal(T(0),T(0),iT(1)), nt2::False< nt2::logical<T> >());
  NT2_TEST_EQUAL(definitely_not_equal(T(0),T(1),iT(1)), nt2::False< nt2::logical<T> >());
}
开发者ID:JanVogelgesang,项目名称:nt2,代码行数:15,代码来源:definitely_not_equal.cpp

示例2: NT2_TEST_CASE_TPL

NT2_TEST_CASE_TPL ( definitely_not_equal_unsigned_int__3_0,  NT2_UNSIGNED_TYPES)
{
  
  using nt2::definitely_not_equal;
  using nt2::tag::definitely_not_equal_;
  typedef typename nt2::meta::as_integer<T>::type iT;
  typedef typename nt2::meta::call<definitely_not_equal_(T,T,iT)>::type r_t;
  typedef typename nt2::meta::scalar_of<r_t>::type ssr_t;
  typedef typename nt2::meta::upgrade<T>::type u_t;
  typedef typename nt2::meta::as_logical<T>::type wished_r_t;


  // return type conformity test 
  NT2_TEST( (boost::is_same < r_t, wished_r_t >::value) );
  std::cout << std::endl; 
  double ulpd;
  ulpd=0.0;


  // specific values tests
  NT2_TEST_EQUAL(definitely_not_equal(T(0),T(0),iT(1)), nt2::False<T>());
  NT2_TEST_EQUAL(definitely_not_equal(T(0),T(1),iT(1)), nt2::False<T>());
} // end of test for unsigned_int_
开发者ID:KWMalik,项目名称:nt2,代码行数:23,代码来源:definitely_not_equal.cpp

示例3: NT2_TEST_CASE_TPL

NT2_TEST_CASE_TPL ( definitely_not_equal_unsigned_int__3_0,  NT2_SIMD_UNSIGNED_TYPES)
{
  using nt2::definitely_not_equal;
  using nt2::tag::definitely_not_equal_;
  using nt2::load;
  using boost::simd::native;
  using nt2::meta::cardinal_of;
  typedef NT2_SIMD_DEFAULT_EXTENSION  ext_t;
  typedef typename nt2::meta::upgrade<T>::type   u_t;
  typedef native<T,ext_t>                        n_t;
  typedef n_t                                     vT;
  typedef typename nt2::meta::as_integer<T>::type iT;
  typedef native<iT,ext_t>                       ivT;
  typedef typename nt2::meta::call<definitely_not_equal_(vT,vT,ivT)>::type r_t;
  typedef typename nt2::meta::call<definitely_not_equal_(T,T,iT)>::type sr_t;
  typedef typename nt2::meta::scalar_of<r_t>::type ssr_t;
  double ulpd;
  ulpd=0.0;


  // specific values tests
  NT2_TEST_EQUAL(definitely_not_equal(nt2::splat<vT>(0),nt2::splat<vT>(0),nt2::splat<ivT>(1))[0], nt2::False<sr_t>());
  NT2_TEST_EQUAL(definitely_not_equal(nt2::splat<vT>(0),nt2::splat<vT>(1),nt2::splat<ivT>(1))[0], nt2::False<sr_t>());
} // end of test for unsigned_int_
开发者ID:joker-eph,项目名称:nt2,代码行数:24,代码来源:definitely_not_equal.cpp

示例4: NT2_TEST_CASE_TPL

NT2_TEST_CASE_TPL ( definitely_not_equal_signed_int__3_0,  NT2_INTEGRAL_SIGNED_TYPES)
{
  using nt2::definitely_not_equal;
  using nt2::tag::definitely_not_equal_;
  using nt2::load; 
  using nt2::simd::native;
  using nt2::meta::cardinal_of;
  typedef NT2_SIMD_DEFAULT_EXTENSION  ext_t;
  typedef typename nt2::meta::upgrade<T>::type   u_t;
  typedef native<T,ext_t>                        n_t;
  typedef n_t                                     vT;
  typedef typename nt2::meta::as_integer<T>::type iT;
  typedef native<iT,ext_t>                       ivT;
  typedef typename nt2::meta::call<definitely_not_equal_(vT,vT,ivT)>::type r_t;
  typedef typename nt2::meta::call<definitely_not_equal_(T,T,iT)>::type sr_t;
  typedef typename nt2::meta::scalar_of<r_t>::type ssr_t;
  double ulpd;
  ulpd=0.0;

  // random verifications
  static const nt2::uint32_t NR = NT2_NB_RANDOM_TEST;
  {
    NT2_CREATE_BUF(tab_a0,T, NR, T(-10), T(10));
    NT2_CREATE_BUF(tab_a1,T, NR, T(-10), T(10));
    NT2_CREATE_BUF(tab_a2,iT, NR, iT(0), iT(10));
    double ulp0, ulpd ; ulpd=ulp0=0.0;
    for(uint32_t j = 0; j < NR/cardinal_of<n_t>::value; j++)
      {
        vT a0 = load<vT>(&tab_a0[0],j);
        vT a1 = load<vT>(&tab_a1[0],j);
        ivT a2 = load<ivT>(&tab_a2[0],j);
        r_t v = definitely_not_equal(a0,a1,a2);
        for(int i = 0; i< cardinal_of<n_t>::value; i++)
        {
          int k = i+j*cardinal_of<n_t>::value;
          NT2_TEST_EQUAL( v[i]!=0,ssr_t(nt2::definitely_not_equal (tab_a0[k],tab_a1[k],tab_a2[k])));
        }
      }
    
  }
} // end of test for signed_int_
开发者ID:francescog,项目名称:nt2,代码行数:41,代码来源:definitely_not_equal.cpp


注:本文中的nt2::definitely_not_equal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。