當前位置: 首頁>>代碼示例>>C++>>正文


C++ BOOST_AUTO_TPL函數代碼示例

本文整理匯總了C++中BOOST_AUTO_TPL函數的典型用法代碼示例。如果您正苦於以下問題:C++ BOOST_AUTO_TPL函數的具體用法?C++ BOOST_AUTO_TPL怎麽用?C++ BOOST_AUTO_TPL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BOOST_AUTO_TPL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: del

 BOOST_FORCEINLINE
 void del(A0& a0, A1 & a1, const char& orient, boost::mpl::long_<2> const&) const
 {
   BOOST_AUTO_TPL(r1, boost::proto::child_c<1>(a1));
   BOOST_AUTO_TPL(q1, boost::proto::child_c<0>(a1));
   do_it(a0,orient,q1,r1);
 }
開發者ID:atyuwen,項目名稱:nt2,代碼行數:7,代碼來源:qrdelete.hpp

示例2: apply

    static inline void apply(Polygon const& polygon_in, ring_identifier id,
                Polygon& polygon_out, MarkMap const& mark_map)
    {
        typedef typename geometry::ring_type<Polygon>::type ring_type;

        typedef range_remove_marked<ring_type, MarkMap> per_range;
        id.ring_index = -1;
        per_range::apply(exterior_ring(polygon_in), id, exterior_ring(polygon_out), mark_map);


        typename interior_return_type<Polygon const>::type rings_in
                    = interior_rings(polygon_in);
        typename interior_return_type<Polygon>::type rings_out
                    = interior_rings(polygon_out);

        rings_out.resize(boost::size(interior_rings(polygon_in)));
        BOOST_AUTO_TPL(out, boost::begin(rings_out));

        for (BOOST_AUTO_TPL(it, boost::begin(rings_in));
            it != boost::end(rings_in);
            ++it, ++out)
        {
            id.ring_index++;
            per_range::apply(*it, id, *out, mark_map);
        }
    }
開發者ID:Belial2010,項目名稱:Pedestrian-Detection-Project,代碼行數:26,代碼來源:remove_marked.hpp

示例3: apply

    static inline void apply(Polygon1 const& source, Polygon2& destination)
    {
        // Clearing managed per ring, and in the resizing of interior rings

        per_ring::apply(geometry::exterior_ring(source),
                        geometry::exterior_ring(destination));

        // Container should be resizeable
        traits::resize
        <
        typename pdalboost::remove_reference
        <
        typename traits::interior_mutable_type<Polygon2>::type
        >::type
        >::apply(interior_rings(destination), num_interior_rings(source));

        typename interior_return_type<Polygon1 const>::type rings_source
            = interior_rings(source);
        typename interior_return_type<Polygon2>::type rings_dest
            = interior_rings(destination);

        BOOST_AUTO_TPL(it_source, pdalboost::begin(rings_source));
        BOOST_AUTO_TPL(it_dest, pdalboost::begin(rings_dest));

        for ( ; it_source != pdalboost::end(rings_source); ++it_source, ++it_dest)
        {
            per_ring::apply(*it_source, *it_dest);
        }
    }
開發者ID:mweisman,項目名稱:PDAL,代碼行數:29,代碼來源:convert.hpp

示例4: evenx2

 static void evenx2(A0& out, std::size_t n)
 {
   value_type nn = n;
   BOOST_AUTO_TPL(p, nt2::_(value_type(1), nn));
   BOOST_AUTO_TPL(j, nt2::trunc(nt2::mod(p,nt2::Four<value_type>())*nt2::Half<value_type>()));
   BOOST_AUTO_TPL(k, nt2::sx(nt2::tag::is_equal_(), j, nt2::colvect(j)));
   BOOST_AUTO_TPL(p1, colvect(nt2::_(value_type(1), nn, nt2::sqr(nn))));
   out =  nt2::sx(nt2::tag::plus_(),p1,nt2::minusone(p));
   out(k) = nt2::oneplus(sqr(nn)) - out(k);
 }
開發者ID:JanVogelgesang,項目名稱:nt2,代碼行數:10,代碼來源:magic.hpp

示例5: compute

 static void compute(A0& out,const C& c, const R& r)
 {
   size_t p = numel(r);
   size_t m = numel(c);
   BOOST_AUTO_TPL(idx, nt2::_(ptrdiff_t(p), ptrdiff_t(-1), ptrdiff_t(2)));
   BOOST_AUTO_TPL(ridx, nt2::colvect(r(idx)));
   BOOST_AUTO_TPL(x, catv(ridx, c)); //build vector of user data
   BOOST_AUTO_TPL(v1, nt2::fliplr(nt2::cif(m, p, meta::as_<ptrdiff_t>())));
   BOOST_AUTO_TPL(v2, nt2::ric(m, p, meta::as_<ptrdiff_t>()));
   out(nt2::_) = x(v1+v2);
 }
開發者ID:LuisBL,項目名稱:pythran,代碼行數:11,代碼來源:toeplitz.hpp

示例6: matrix_compute

    BOOST_FORCEINLINE
      static void matrix_compute(const size_t & n, const size_t & k, A1 & a1)
    {
      typedef typename boost::proto::result_of::child_c<A1&,0>::type       a_t;
      a_t & a = boost::proto::child_c<0>(a1);
      BOOST_AUTO_TPL(c, nt2::cumprod(nt2::_(value_t(2), value_t(n+1))));
      BOOST_AUTO_TPL(d, nt2::cumprod(nt2::_(value_t(n+1), value_t(2*n)))*c(n-1));

      a = nt2::hankel(c, d);
      if (k) a = nt2::rec(a);
    }
開發者ID:fpelliccioni,項目名稱:nt2,代碼行數:11,代碼來源:ipjfact.hpp

示例7: finalize

 static inline A0 finalize(const A0& a0, const A0& y)
 {
 #ifdef BOOST_SIMD_NO_NANS
   BOOST_AUTO_TPL(test, nt2::is_ltz(a0));
 #else
   BOOST_AUTO_TPL(test, nt2::logical_or(nt2::is_ltz(a0), nt2::is_nan(a0)));
 #endif
   A0 y1 = nt2::if_nan_else(test, y);
 #ifndef BOOST_SIMD_NO_INFINITIES
   y1 = if_else(nt2::is_equal(a0, nt2::Inf<A0>()), a0, y1);
 #endif
   return if_else(is_eqz(a0), nt2::Minf<A0>(), y1);
 }
開發者ID:caocuongngo,項目名稱:nt2,代碼行數:13,代碼來源:f_log.hpp

示例8: compute

 value_t compute(const  FUNC &f, const X&ranges, const input_t & vol,  input_t fact)
 {
     size_t n = size(ranges, 1);
     BOOST_AUTO_TPL(r1, ranges(nt2::_, begin_));
     BOOST_AUTO_TPL(r1ex, nt2::expand_to(r1,   nt2::of_size(n, nbpts_)));
     BOOST_AUTO_TPL(r2ex, nt2::expand_to(fact, nt2::of_size(n, nbpts_)));
     rtab_t rnd = nt2::quasi(n, nbpts_, nt2::meta::as_<real_t>());
     BOOST_AUTO_TPL(x, nt2::fma(rnd, r2ex, r1ex));
     BOOST_AUTO_TPL(z, f(x));
     if (compute_err_)
     {
         real_t fnbpt = real_t(nbpts_);
         err_ += nt2::pow(nt2::log(fnbpt), real_t(n))*nt2::Three<real_t>()*vol*nt2::real(nt2::globalstdev(z))/fnbpt;
     }
     return vol*nt2::globalmean(z);
 }
開發者ID:kevinushey,項目名稱:nt2,代碼行數:16,代碼來源:qmtc.hpp

示例9: apply

 static inline void apply(MultiGeometry& multi, Functor& f)
 {
     for(BOOST_AUTO_TPL(it, boost::begin(multi)); it != boost::end(multi); ++it)
     {
         Policy::apply(*it, f);
     }
 }
開發者ID:1050676515,項目名稱:ZeusMud,代碼行數:7,代碼來源:for_each.hpp

示例10: conf_bounds

 BOOST_FORCEINLINE static void conf_bounds(const A0& a0, A1& a1,
                                           const value_type& alpha )
 {
   nt2::container::table<value_type> pcov =  boost::proto::child_c<3>(a0);
   const In0& x  = boost::proto::child_c<0>(a0);
   const In1& mu = boost::proto::child_c<1>(a0);
   const In2& sigma = boost::proto::child_c<2>(a0);
   BOOST_AUTO_TPL(z, (x-mu)/sigma);
   BOOST_AUTO_TPL(zvar, pcov(1,1) + (Two<value_type>()*pcov(1,2) + pcov(2,2)*z)*z);
   BOOST_ASSERT_MSG(nt2::globalall(nt2::is_gez(zvar)), "Covariance matrix must be positive");
   value_type normz = -nt2::norminv(alpha*nt2::Half<value_type>());
   BOOST_AUTO_TPL(halfwidth, normz*nt2::sqrt(zvar)/sigma);
   boost::proto::child_c<0>(a1) = Half<value_type>()*nt2::erfc(-Sqrt_2o_2<value_type>()*z);
   boost::proto::child_c<1>(a1) = Half<value_type>()*nt2::erfc(-Sqrt_2o_2<value_type>()*(z-halfwidth));
   boost::proto::child_c<2>(a1) = Half<value_type>()*nt2::erfc(-Sqrt_2o_2<value_type>()*(z+halfwidth));
 }
開發者ID:atyuwen,項目名稱:nt2,代碼行數:16,代碼來源:normcdf.hpp

示例11: compute

 void compute( const FUNC& f, const X & x, const o_t & o)
 {
   real_t tmptol = tol_;
   init(o, x);
   BOOST_AUTO_TPL(dif, nt2::abs(nt2::diff(nt2::rowvect(wpts_))));
   real_t tol1= tol_/nt2::globalasum1(dif);
   size_t l = numel(dif);
   res_.resize(extent(wpts_));
   res_(1) = nt2::Zero<value_t>();
   tol_ = tol1*dif(1);
   res_(2) = compute<true>(f, wpts_(1), wpts_(2));
   for(size_t i=2; i < l; ++i)
   {
     tol_ = tol1*dif(i);
     res_(i+1) = res_(i)+compute<false>(f, wpts_(i), wpts_(i+1));
   }
   if (l >= 2)
   {
     tol_ = tol1*dif(l);
     res_(l+1) = res_(l)+compute<true>(f, wpts_(l), wpts_(l+1));
   }
   tol_ = tmptol;
   if (!o.return_waypoints)
   {
     res_(begin_) = res_(end_);
     res_.resize(nt2::of_size(1, 1));
   }
 }
開發者ID:fpelliccioni,項目名稱:nt2,代碼行數:28,代碼來源:quadl.hpp

示例12: apply

    static inline void apply(Range& range, Functor& f)
    {
        typedef typename add_const_if_c
            <
                is_const<Range>::value,
                typename point_type<Range>::type
            >::type point_type;

        BOOST_AUTO_TPL(it, boost::begin(range));
        BOOST_AUTO_TPL(previous, it++);
        while(it != boost::end(range))
        {
            model::referring_segment<point_type> s(*previous, *it);
            f(s);
            previous = it++;
        }
    }
開發者ID:8573,項目名稱:anura,代碼行數:17,代碼來源:for_each.hpp

示例13: operator

    BOOST_FORCEINLINE typename Target::type
    operator()(Pos const& p, Size const& sz, Target const&) const
    {
      typedef typename Target::type                                         type;
      typedef typename meta::as_index<type>::type                            i_t;
      typedef typename meta::call<tag::enumerate_(Pos,meta::as_<i_t>)>::type p_t;
      typedef typename nt2::result_of::as_subscript<Size,p_t>::type          s_t;
      typedef typename s_t::value_type                                       v_t;

      // Retrieve 2D position from the linear index
      s_t const pos = as_subscript(sz,nt2::enumerate<i_t>(p));
      // Return a 1 where it belongs
      BOOST_AUTO_TPL(ii, nt2::splat<v_t>(i_));
      BOOST_AUTO_TPL(jj, nt2::splat<v_t>(j_));
      return nt2::if_else(nt2::logical_and(nt2::eq(pos[0],ii),
                                           nt2::eq(pos[1],jj)),
                          nt2::One<type>(), nt2::Zero<type>());
    }
開發者ID:fpelliccioni,項目名稱:nt2,代碼行數:18,代碼來源:deltaf.hpp

示例14: conf_bounds

 BOOST_FORCEINLINE static void conf_bounds(const A0& a0, A1& a1,
                                           const value_type& alpha )
 {
   typedef typename boost::proto::result_of::child_c<A0&,1>::type          In1;
   value_type pcov =  boost::proto::child_c<2>(a0);
   BOOST_ASSERT_MSG(pcov >= Zero<value_type>(), "Variance pcov must be non-negative");
   const In0& q  = boost::proto::child_c<0>(a0);
   const In1& mu = boost::proto::child_c<1>(a0);
   BOOST_ASSERT_MSG(nt2::globalall(nt2::is_gtz(mu)), "mu parameter must be positive");
   BOOST_AUTO_TPL(x, (-nt2::log1p(-q)*mu));
   //      nt2::container::table<value_type> logx = nt2::log(q*mu);
   value_type normz = -nt2::norminv(alpha*nt2::Half<value_type>());
   BOOST_AUTO_TPL(halfwidth, normz * nt2::sqrt(pcov/nt2::sqr(mu)));
   BOOST_AUTO_TPL(exp_halfwidth, exp(halfwidth));
   boost::proto::child_c<0>(a1) = x;
   boost::proto::child_c<2>(a1) = x*exp_halfwidth;
   boost::proto::child_c<1>(a1) = x/exp_halfwidth;
 }
開發者ID:atyuwen,項目名稱:nt2,代碼行數:18,代碼來源:expinv.hpp

示例15: sum_interior_rings

 static inline ReturnType sum_interior_rings(Rings const& rings, Strategy const& strategy)
 {
     ReturnType sum = ReturnType();
     for (BOOST_AUTO_TPL(it, boost::begin(rings)); it != boost::end(rings); ++it)
     {
         sum += Policy::apply(*it, strategy);
     }
     return sum;
 }
開發者ID:13609594236,項目名稱:ph-open,代碼行數:9,代碼來源:calculate_sum.hpp


注:本文中的BOOST_AUTO_TPL函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。