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


C++ A0类代码示例

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


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

示例1: call

    static type call(A0& a0, I const& indices)
    {
      Idx idx = nt2::function_index(indices, a0.extent(), meta::as_<typename A0::indexes_type>());
      std::size_t b = nt2::run(idx, 0u, meta::as_<std::size_t>());
      std::size_t e = nt2::run(idx, nt2::numel(idx.extent())-1u, meta::as_<std::size_t>())+1u;
      typename A0::value_type* p = const_cast<typename A0::value_type*>(a0.raw());

      return type(expr::make(container_ref(boost::make_shared<container>(idx.extent(), nt2::share(p+b, p+e)))));
    }
开发者ID:fpelliccioni,项目名称:nt2,代码行数:9,代码来源:function.hpp

示例2: combine_eigens

 BOOST_FORCEINLINE void
 combine_eigens(const T& wr,  const T& wi, A0& w)
 {
   typedef typename A0::value_type type_t;
   int n = numel(wr);
   w.resize(of_size(n, 1));
   nt2::container::table<type_t, nt2::shared_> sw(of_size(n, 1), share(w.data(), w.data()+n));
   sw = tocomplex(wr, wi);
 }
开发者ID:JanVogelgesang,项目名称:nt2,代码行数:9,代码来源:combine.hpp

示例3: operator

     BOOST_FORCEINLINE result_type operator()(A0& a0, A1 const& a1) const
     {
        result_type that;
        nt2_la_int n   = nt2::width(a0);
        nt2_la_int lda = a0.leading_size();

        NT2_F77NAME(zpotrf) (&a1,&n,a0.raw(),&lda,&that);

        return that;
     }
开发者ID:LuisBL,项目名称:pythran,代码行数:10,代码来源:potrf.hpp

示例4: operator

     BOOST_FORCEINLINE result_type operator()(A0& a0, A1 const a1) const
     {
        result_type that;
        nt2_la_int n   = nt2::width(a0);
        nt2_la_int lda = a0.leading_size();

        magma_zpotrf(a1,n,(cuDoubleComplex*)a0.raw(),lda,&that);

        return that;
     }
开发者ID:atyuwen,项目名称:nt2,代码行数:10,代码来源:potrf.hpp

示例5: operator

     BOOST_FORCEINLINE result_type operator()(A0& a0, A1& a1) const
     {
        result_type that;
        nt2_la_int  m  = nt2::height(a0);
        nt2_la_int  n  = nt2::width(a0);
        nt2_la_int  ld = a0.leading_size();

        a1.resize( nt2::of_size(std::min(n, m), 1) );

        magma_cgetrf(m, n, (cuFloatComplex*)a0.data(), ld, a1.data(), &that);
        return that;
     }
开发者ID:aminiussi,项目名称:nt2,代码行数:12,代码来源:getrf.hpp

示例6: operator

 BOOST_FORCEINLINE result_type operator()( A0& a, A1& scale
                                         , A2& ilo, A3& ihi, C0 job) const
 {
    result_type info;
    nt2_la_int  n   = nt2::width(a);
    BOOST_ASSERT_MSG(n == nt2_la_int(nt2::height(a)), "input must be square");
    nt2_la_int  lda = nt2::max(a.leading_size(), One<size_t>());
    NT2_F77NAME(cgebal) (&job, &n
                        , a.raw(), &lda
                        , &ilo, &ihi
                        , scale.raw(), &info);
    return info;
 }
开发者ID:gilbert0571,项目名称:nt2,代码行数:13,代码来源:gebal.hpp

示例7: conf_bounds

    BOOST_FORCEINLINE static void conf_bounds(const A0& a0, A1& a1,
                                              const M2x2 pcov,
                                              const value_type& normz,
                                              Out0 & p)
    {
      typedef typename boost::proto::result_of::child_c<A1&,1>::type         Out1;
      typedef typename boost::proto::result_of::child_c<A1&,2>::type         Out2;

      //      NT2_DISPLAY(a0.extent());   NT2_DISPLAY(a1.extent());
      p.resize(a0.extent());
      const In0& x  = boost::proto::child_c<0>(a0);
      //      NT2_DISPLAY(x);
      const In1& a = boost::proto::child_c<1>(a0);
      //      NT2_DISPLAY(a);
      const In2& b = boost::proto::child_c<2>(a0);
      //       NT2_DISPLAY(b);
      BOOST_AUTO_TPL(z, x/b);
      //       NT2_DISPLAY(z);
      //       NT2_DISPLAY(nt2::gammainc(z, a));
      //       NT2_DISPLAY(size(p));
      p =  nt2::exp(z); //nt2::gammainc(z, a);
      //       NT2_DISPLAY(p);
      //      Out0& p = boost::proto::child_c<0>(a1);
      //      NT2_DISPLAY(p);
      BOOST_AUTO_TPL(itp, (p/nt2::oneminus(p)));
      //       NT2_DISPLAY(itp);
      BOOST_AUTO_TPL(dp, nt2::rec(p*oneminus(p))); // derivative of logit(p) w.r.t. p
      //       NT2_DISPLAY(dp);
      BOOST_AUTO_TPL(da, dgammainc(z,a)*dp);       // dlogitp/da = dp/da * dlogitp/dp
      //       NT2_DISPLAY(da);
      BOOST_AUTO_TPL(db, -nt2::exp(a*nt2::log(z)-z-nt2::gammaln(a)-nt2::log(b))* dp); // dlogitp/db = dp/db * dlogitp/dp
      //      NT2_DISPLAY(db);
      BOOST_AUTO_TPL(varLogitp, pcov(1,1)*sqr(da) + (Two<value_type>()*pcov(1,2)*da + pcov(2,2)*db)*db);
      //       NT2_DISPLAY(varLogitp);
      //       NT2_DISPLAY(normz);
      BOOST_AUTO_TPL(exp_halfwidth, nt2::exp(normz*nt2::sqrt(varLogitp)));
      //       NT2_DISPLAY(exp_halfwidth);
      Out1 & plo = boost::proto::child_c<1>(a1);
      Out2 & pup = boost::proto::child_c<2>(a1);
      plo.resize(a0.extent());
      pup.resize(a0.extent());
      //      std::cout << "1" << std::endl;
      plo = itp*exp_halfwidth;
      //      std::cout << "2" << std::endl;
      pup = itp/exp_halfwidth;
      //      std::cout << "3" << std::endl;
      plo /= nt2::oneplus(plo);
      //      std::cout << "4" << std::endl;
      pup /= nt2::oneplus(pup);
      //      std::cout << "5" << std::endl;
    }
开发者ID:fpelliccioni,项目名称:nt2,代码行数:51,代码来源:gamcdf.hpp

示例8: operator

     BOOST_FORCEINLINE result_type operator()(A0& a0, A1& a1) const
     {
        result_type that;
        nt2_la_int  n  = nt2::width(a0);
        nt2_la_int  ld = a0.leading_size();
        nt2_la_int  ldb = a1.leading_size();
        nt2_la_int  nhrs = nt2::width(a1);
        char uplo = 'L';

        NT2_F77NAME(zposv) ( &uplo, &n, &nhrs, a0.data(), &ld, a1.data(), &ldb
                           , &that
                            );

        return that;
     }
开发者ID:JanVogelgesang,项目名称:nt2,代码行数:15,代码来源:posv.hpp

示例9: operator

    BOOST_FORCEINLINE result_type operator()( A0& a0, A1& s, A2& u,A3 &vt, A4 const jobu
            , A5 const jobvt) const
    {
        result_type that;
        details::workspace<typename A0::value_type> w;
        nt2_la_int  m  = nt2::height(a0);
        nt2_la_int  n  = nt2::width(a0);
        nt2_la_int  ld = a0.leading_size();
        nt2_la_int ldu = u.leading_size() > 1 ? u.leading_size() : 1 ;
        nt2_la_int ldvt= vt.leading_size() > 1 ? vt.leading_size() : 1 ;
        nt2_la_int lwork_query = -1;

        char c = std::toupper(jobu);
        magma_vec_t magma_jobu  = c == 'A' ? MagmaAllVec : c == 'S' ? MagmaSomeVec : c == 'O' ? MagmaOverwriteVec : c == 'N' ? MagmaNoVec : (magma_vec_t)0;
        c = std::toupper(jobvt);
        magma_vec_t magma_jobvt = c == 'A' ? MagmaAllVec : c == 'S' ? MagmaSomeVec : c == 'O' ? MagmaOverwriteVec : c == 'N' ? MagmaNoVec : (magma_vec_t)0;

        magma_sgesvd(magma_jobu,magma_jobvt,m, n, 0, ld, 0, 0, ldu
                     , 0, ldvt, w.main()
                     , lwork_query, &that
                    );

        w.prepare_main();
        nt2::gesvd(a0,s,u,vt,jobu,jobvt,w);

        return that;
    }
开发者ID:psiha,项目名称:nt2,代码行数:27,代码来源:gesvd.hpp

示例10: eval

 //==========================================================================
 /// INTERNAL ONLY - X = LINSOLVE(A,B) -- symmetric shape
 BOOST_FORCEINLINE
 void eval ( A0 const& a0, A1 const& a1 , A2 const& a2 ,boost::mpl::long_<1> const
           , nt2::symmetric_ const&) const
 {
   type_t rcond;
   nt2::container::table<nt2_la_int> piv = nt2::zeros(a0.leading_size(), 1
                                         , nt2::meta::as_<nt2_la_int>() );
   boost::proto::child_c<0>(a2).resize(nt2::of_size(a0.leading_size(),1));
   NT2_AS_TERMINAL_IN(desired_semantic1,a,a0);
   NT2_AS_TERMINAL_IN(desired_semantic,b,a1);
   nt2_la_int iter = nt2::sysvx( boost::proto::value(a),boost::proto::value(piv)
                              , boost::proto::value(b)
                              , boost::proto::value(boost::proto::child_c<0>(a2))
                              , rcond);
   boost::ignore_unused(iter);
 }
开发者ID:JanVogelgesang,项目名称:nt2,代码行数:18,代码来源:plinsolve.hpp

示例11: operator

    result_type operator()(A0& yi, A1& inputs) const
    {
        yi.resize(inputs.extent());
        const child0 & x   =  boost::proto::child_c<0>(inputs);
        if (numel(x) <=  1)
            BOOST_ASSERT_MSG(numel(x) >  1, "Interpolation requires at least two sample points in each dimension.");
        else
        {
            BOOST_ASSERT_MSG(issorted(x, 'a'), "for 'nearest' interpolation x values must be sorted in ascending order");
            const child1 & y   =  boost::proto::child_c<1>(inputs);
            BOOST_ASSERT_MSG(numel(x) == numel(y), "The grid vectors do not define a grid of points that match the given values.");
            const child2 & xi  =  boost::proto::child_c<2>(inputs);
            bool extrap = false;
            value_type extrapval = Nan<value_type>();
            choices(inputs, extrap, extrapval, N1());
            table<index_type>   index = bsearch (x, xi);
            table<value_type>  dx    =  xi-x(index);
            table<index_type> indexp1 =  oneplus(index);
            yi = y(nt2::if_else(lt(nt2::abs(xi-x(index)), nt2::abs(xi-x(indexp1))), index,  indexp1));
            value_type  b =  value_type(x(begin_));
            value_type  e =  value_type(x(end_));
            if (!extrap) yi = nt2::if_else(nt2::logical_or(boost::simd::is_nge(xi, b),
                                               boost::simd::is_nle(xi, e)), extrapval, yi);
        }

        return yi;
    }
开发者ID:kevinushey,项目名称:nt2,代码行数:27,代码来源:nearest.hpp

示例12: operator

 BOOST_FORCEINLINE result_type operator()( A0& a, A1& b, A2& alpha, A3& beta, A4& vr, A5& vl) const
 {
   result_type info = 0;
   char jobvr = 'V';
   char jobvl = 'V';
   details::workspace<typename A0::value_type> wk;
   nt2_la_int n = nt2::width(a);
   BOOST_ASSERT_MSG(  (n == nt2_la_int(nt2::height(a)))
                      &&(n == nt2_la_int(nt2::height(b))) , "inputs must be square");
   nt2_la_int lda  = nt2::max(a.leading_size(), One<size_t>());
   nt2_la_int ldb  = nt2::max(b.leading_size(), One<size_t>());
   nt2_la_int ldvl = n;
   nt2_la_int ldvr = n;
   NT2_F77NAME(zggev) ( &jobvl, &jobvr
                      , &n
                      , 0 /*a*/, &lda
                      , 0 /*b*/, &ldb
                      , 0/*alpha*/
                      , 0/*beta*/
                      , 0/*vl*/, &ldvl
                      , 0/*vr*/, &ldvr
                      , wk.main(), details::query()
                      , wk.reals()
                      , &info);
   info = nt2::ggev_wvrvl(a, b, alpha, beta, vr, vl, wk);
   return info;
 }
开发者ID:JanVogelgesang,项目名称:nt2,代码行数:27,代码来源:ggev_wvrvl.hpp

示例13: operator

    BOOST_FORCEINLINE
    result_type operator()(A0 const& a0, A1 ind, A2 dim) const
    {
      std::size_t along = dim-1;
      typename A0::extent_type ex1 = a0.extent();
      ex1[along] = 1;

      return boost::proto::make_expr< nt2::tag::line_
                                    , container::domain
                                    > ( boost::cref(a0)
                                      , along
                                      , as_index( a0.extent()
                                                , as_subscript(ex1, ind)
                                                )
                                      , nt2::linesstride(a0, dim)
                                      );
    }
开发者ID:JanVogelgesang,项目名称:nt2,代码行数:17,代码来源:line.hpp

示例14: operator

 result_type operator()(A0& out, const A1& in) const
 {
   size_t n =  boost::proto::child_c<0>(in);
   out.resize(nt2::of_size(n, n));
   nt2::table<value_type, _2D> l = nt2::abs(nt2::pascal(n, 1, nt2::meta::as_<value_type>()));
   nt2::table<value_type, _2D> u = nt2::fliplr(nt2::flipud(l));
   nt2::table<value_type, _2D> d = nt2::from_diag(nt2::pow(value_type(-2), nt2::_(value_type(0), value_type(n-1))));
   out =  nt2::round2even(nt2::mtimes(l, nt2::mtimes(d, u)));
   return out;
 }
开发者ID:sschaetz,项目名称:nt2,代码行数:10,代码来源:binomial.hpp

示例15: operator

    BOOST_FORCEINLINE result_type operator()(A0& a0, A1 a1, nt2::symmetric_ const&) const
    {
      result_type norm;
      char uplo = 'L';
      nt2_la_int n = nt2::width(a0);
      nt2_la_int ld = n;

     if(a1 =='I'|| a1 =='1'|| a1 =='O')
     {
        nt2::memory::container<tag::table_, result_type, nt2::_2D> work(nt2::of_size(n,1));
        norm = NT2_F77NAME(zlansy)( &a1, &uplo, &n, a0.raw(), &ld, work.raw());
      }
      else
      {
        norm = NT2_F77NAME(zlansy)( &a1, &uplo, &n, a0.raw(), &ld, 0);
      }

      return norm;
    }
开发者ID:atyuwen,项目名称:nt2,代码行数:19,代码来源:lansy.hpp


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