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


C++ LocationVector::end方法代码示例

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


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

示例1: runtime_error

   bool PSU1Rules::Verify()
   {
      //store all locations and compare to 
      //ensure unique assignments
      LocationVector globalLocations;

      //contains tuple<LocationVector, Pattern, double>
      //single entry
      const CodeTupleVector& codeTupleVec = codeKey.GetTupleRef();

      //contains tuple<LocationVector, double, double>
      //single entry
      const TrTupleVector& trTupleVec = trKey.GetTupleRef();

      //contains tuple<LocationVector, double>
      //single entry
      const TxaTupleVector& txaTupleVec = txaKey.GetTupleRef();

      //contains tuple<LocationVector, bool, double, double>
      //multiple entries
      const SaTupleVector& saTupleVec = saKey.GetTupleRef();

      //contains simple Parameter
      //multiple entries
      const ParameterVector& t1Tuple = t1Key.GetTupleRef();

      //contains tuple<LocationVector, dynamic_bitset<> >
      //optional with multiple entries
      GenericTupleVector genericTupleVec; 

      if(gKey.Set())
      {
         genericTupleVec = gKey.GetTupleRef();
      }

      //contains simple Parameter
      //single entry
      //const ParameterVector& t2Tuple   = t2Key.GetTupleRef();

      const double txa = txaTupleVec[0].get<1>();
      const double rfclk    = any_cast<double>(param::FindParameter(t1Tuple, "refclock").value);
      const double baudb    = any_cast<double>(param::FindParameter(t1Tuple, "baudb").value);
      const double ippa     = any_cast<double>(param::FindParameter(t1Tuple, "ippa").value);
      const double bauda    = any_cast<double>(param::FindParameter(t1Tuple, "bauda").value);
      const uint32_t txa_baud = round(txa/bauda);

      iif_.clkDivA = round(rfclk*bauda/2.0);
      iif_.clkDivB = round(rfclk*baudb/2.0);

      std::cout << "txa      = " << txa << std::endl;
      std::cout << "txa_baud = " << txa_baud << std::endl;
      std::cout << "rfclk    = " << rfclk << std::endl;
      std::cout << "baudb    = " << baudb << std::endl;
      std::cout << "bauda    = " << bauda << std::endl;
      std::cout << "ippa     = " << ippa << std::endl;
      std::cout << "diva     = " << iif_.clkDivA << std::endl;
      std::cout << "divb     = " << iif_.clkDivB << std::endl;

      //const double ipp_b   = rfclk/ipp;
      const double duty_cycle = txa/ippa;
      const uint32_t code_l  = codeTupleVec[0].get<2>();

      std::cout << "code length = " << code_l << std::endl;
      std::cout << "txa  length = " << txa_baud << std::endl;

      //verify that code width matches the transmitted pulse width
      if(txa_baud != code_l)
      {
         cerr << "TXA Pulse Width != CODE Pulse Width => " << txa_baud << " != " << code_l << endl;
         throw std::runtime_error("PSU1Rules: TXA length != CODE length");
      }

      //verify that code width matches the transmitted pulse width
      if( duty_cycle > MAX_DUTY_CYCLE ) 
      {
         throw std::runtime_error("PSU1Rules - DUTY CYCLE " + 
               lexical_cast<string>(duty_cycle) + " > " + 
               lexical_cast<string>(MAX_DUTY_CYCLE));
      }

      //push sa locations 
      for(uint16_t idx=0; idx<saTupleVec.size(); ++idx)
      {
         LocationVector lv = saTupleVec[idx].get<0>();
         globalLocations.insert(globalLocations.end(), lv.begin(), lv.end());
      }

      //push generic location
      for(uint16_t idx=0; idx<genericTupleVec.size(); ++idx)
      {
         LocationVector lv = genericTupleVec[idx].get<0>();
         globalLocations.insert(globalLocations.end(), lv.begin(), lv.end());
      }

      //push all other locations
      LocationVector t = txaTupleVec[0].get<0>();
      globalLocations.insert(globalLocations.end(), t.begin(), t.end() );
      t = trTupleVec[0].get<0>();
      globalLocations.insert(globalLocations.end(), t.begin(), t.end() );
      t = codeTupleVec[0].get<0>();
//.........这里部分代码省略.........
开发者ID:rseal,项目名称:BitPatternGenerator,代码行数:101,代码来源:PSU1Rules.cpp


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