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


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

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


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

示例1: operator

 bool operator()(const Tuple &t1, const Tuple &t2) const {
   vector<size_t>::const_iterator it = this->order.begin();
   for (; it != this->order.end(); ++it) {
     if (*it >= t1.size()) {
       if (*it < t2.size()) {
         return false;
       }
     } else if (*it >= t2.size()) {
       return true;
     } else if (t1[*it] != t2[*it]) {
       return t1[*it] < t2[*it];
     }
   }
   if (this->total_ordering) {
     Tuple::const_iterator cit1 = t1.begin();
     Tuple::const_iterator cit2 = t2.begin();
     while (cit1 != t1.end() && cit2 != t2.end()) {
       if (*cit1 != *cit2) {
         return *cit1 < *cit2;
       }
       ++cit1;
       ++cit2;
     }
     if (cit1 == t1.end()) {
       return cit2 != t2.end();
     }
   }
   return false;
 }
开发者ID:jrweave,项目名称:phd,代码行数:29,代码来源:infer-rules.cpp

示例2: error_total

double error_total(double (*efn)(MeshFunction*, MeshFunction*, RefMap*, RefMap*),
		   double (*nfn)(MeshFunction*, RefMap*), Tuple<Solution*>& slns1, Tuple<Solution*>& slns2	)
{
  Tuple<Solution*>::iterator it1, it2;
  double error = 0.0, norm = 0.0;

  for (it1=slns1.begin(), it2=slns2.begin(); it1 < slns1.end(); it1++, it2++) {
    assert(it2 < slns2.end());
    error += sqr(calc_abs_error(efn, *it1, *it2));
    if (nfn) norm += sqr(calc_norm(nfn, *it2));
  }

  return (nfn ? sqrt(error/norm) : sqrt(error));
}
开发者ID:dugankevin,项目名称:hermes,代码行数:14,代码来源:main.cpp

示例3: paranoidInsertTypeCheck

void TupleStorageSubBlock::paranoidInsertTypeCheck(const Tuple &tuple, const AllowedTypeConversion atc) {
#ifdef QUICKSTEP_DEBUG
  assert(relation_.size() == tuple.size());

  Tuple::const_iterator value_it = tuple.begin();
  CatalogRelation::const_iterator attr_it = relation_.begin();

  while (value_it != tuple.end()) {
    switch (atc) {
      case kNone:
        assert(value_it->getType().equals(attr_it->getType()));
        break;
      case kSafe:
        assert(value_it->getType().isSafelyCoercibleTo(attr_it->getType()));
        break;
      case kUnsafe:
        assert(value_it->getType().isCoercibleTo(attr_it->getType()));
        break;
    }

    ++value_it;
    ++attr_it;
  }
#endif
}
开发者ID:saketj,项目名称:quickstep-storage-explorer,代码行数:25,代码来源:TupleStorageSubBlock.cpp

示例4:

	inline Tuple *replace_tuple(const Tuple *t, size_t pos, const Value &val)
	{
		Tuple *ret = new_tuple(std::max(t->m_count, pos+1));
		std::copy(t->begin(), t->begin() + std::min(pos, t->m_count), ret->m_data);
		if (pos < t->m_count)
			std::copy(t->begin() + pos + 1, t->end(), ret->m_data + pos + 1);
		std::fill(ret->begin() + t->m_count, ret->end(), Nil);
		ret->m_data[pos] = val;
		return ret;
	}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例5: if

bool
Tuple::operator<(const Tuple& rhs) const
{
  auto iterl = begin();
  auto iterr = rhs.begin();

  while (iterl != end() && iterr != rhs.end())
  {
    if (iterl->first < iterr->first)
    {
      return true;
    }
    else if (iterr->first < iterl->first)
    {
      return false;
    }
    else if (iterl->second < iterr->second)
    {
      return true;
    }
    else if (iterr->second < iterl->second)
    {
      return false;
    }
    //this pair is equal, go to the next one
    ++iterl;
    ++iterr;
  }

  if (iterl == end() && iterr == rhs.end())
  {
    //they must be equal, so return false
    return false;
  }
  else if (iterl == end())
  {
    return true;
  }
  else
  {
    return false;
  }
}
开发者ID:jarro2783,项目名称:TransLucid,代码行数:43,代码来源:types.cpp

示例6: DimensionNotFound

 inline Constant
 get_dimension(const Tuple& k, size_t index)
 {
   Tuple::const_iterator i = k.find(index);
   if (i == k.end())
   {
     throw DimensionNotFound();
   }
   return i->second;
 }
开发者ID:jarro2783,项目名称:TransLucid,代码行数:10,代码来源:utility.hpp

示例7: operator

 bool operator()(const Tuple& tup) const {
   auto& tarr = static_types_array<T...>::arr;
   if (tup.size() >= (sizeof...(T) - wc_count)) {
     auto fpush = [](const typename Tuple::const_iterator&) {};
     auto fcommit = [] {};
     auto frollback = [] {};
     return match(tup.begin(), tup.end(), tarr.begin(), tarr.end(),
            fpush, fcommit, frollback);
   }
   return false;
 }
开发者ID:asmodehn,项目名称:actor-framework,代码行数:11,代码来源:matches.hpp

示例8: TaggedConstant

 TaggedConstant
 operator()(const Tuple& k)
 {
   Tuple::const_iterator iter = k.find(m_index);
   if (iter != k.end())
   {
     return TaggedConstant(iter->second, k);
   }
   else
   {
     return TaggedConstant(Types::Special::create(SP_DIMENSION), k);
   }
 }
开发者ID:jarro2783,项目名称:TransLucid,代码行数:13,代码来源:utility.hpp

示例9: addEntry

  bool addEntry(const Tuple &tuple) {
	  Tuple::const_iterator attr_it;
	  int bloom_filter_id = 0;
	  for (attr_it = tuple.begin(); attr_it != tuple.end(); ++attr_it, ++bloom_filter_id) {
		  if (!attr_it->isNull()) {
			  ScopedPtr<char> attr_data_ptr(new char[attr_it->getInstanceByteLength()]);
			  attr_it->copyInto(static_cast<void*>(attr_data_ptr.get()));
			  bloom_filters_.get()[bloom_filter_id].insert(attr_data_ptr.get(),
					  	  	  	  	  	  	  	  	 attr_it->getInstanceByteLength());
		  }
	  }
	  return true;
  }
开发者ID:saketj,项目名称:quickstep-storage-explorer,代码行数:13,代码来源:BloomFilterSubBlock.hpp

示例10: printTuple

/**
 * @brief utility function that prints a Tuple on the specified ostream
 */
void ActionPluginFinalCallback::printTuple(std::ostream& output,
		const Tuple& tuple, const RegistryPtr registryPtr) {
	bool first = true;
	for (Tuple::const_iterator it = tuple.begin(); it != tuple.end(); it++) {
		if (first)
			first = !first;
		else
			output << ", ";
		if (it->isConstantTerm() || it->isVariableTerm())
			output << registryPtr->getTermStringByID(*it);
		else
			output << it->address;
	}
}
开发者ID:hexhex,项目名称:actionplugin,代码行数:17,代码来源:ActionPluginFinalCallback.cpp

示例11: paranoidInsertTypeCheck

void TupleStorageSubBlock::paranoidInsertTypeCheck(const Tuple &tuple) {
#ifdef QUICKSTEP_DEBUG
  assert(relation_.size() == tuple.size());

  Tuple::const_iterator value_it = tuple.begin();
  CatalogRelationSchema::const_iterator attr_it = relation_.begin();

  while (value_it != tuple.end()) {
    assert(value_it->isPlausibleInstanceOf(attr_it->getType().getSignature()));

    ++value_it;
    ++attr_it;
  }
#endif
}
开发者ID:HanumathRao,项目名称:incubator-quickstep,代码行数:15,代码来源:TupleStorageSubBlock.cpp

示例12:

TTailHairpin::TTailHairpin(const Tuple &tuple, const Tuple &size) {
    int len = size[1];
    Tuple t = tuple;
    std::sort(t.begin(), t.end(), std::less<int>{});
    Frag frag;
        for (int i = t[0]; i <= t[1]; i++) {
            frag.push_back(i);
        }
        d_frags.push_back(std::move(frag));
        for (int i = t[2]; i < len; i++) {
            frag.push_back(i);
        }
        d_frags.push_back(std::move(frag));
        d_max_len = std::max(t[1] - t[0] - 1, len - t[2] - 1);
    d_indices = std::make_unique<Mati>(d_max_len, 3);
    for (int i = 0; i < d_max_len; i++) for (int j = 0; j < 3; j++) (*d_indices)(i, j) = -1;
    set_indices(0, d_frags[0].front() + 1, d_frags[0].back() - 1);
    set_indices(1, d_frags[1].front() + 1, len - 1);
}
开发者ID:hust220,项目名称:nsp,代码行数:19,代码来源:TTailHairpin.cpp


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