本文整理汇总了C++中TupleList::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ TupleList::begin方法的具体用法?C++ TupleList::begin怎么用?C++ TupleList::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TupleList
的用法示例。
在下文中一共展示了TupleList::begin方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_tuples
TupleList SimpleQueryLinker::make_tuples(
const std::vector<std::string>& variables)
{
TupleList result;
std::string first_qvar = *variables.begin();
if(!is_initialized(first_qvar)) {
throw QueryLinkerError();
}
for(ConditionSet::iterator cit = _qvar_table[first_qvar].begin();
cit != _qvar_table[first_qvar].end(); ++cit)
{
TupleList tuples = make_tuples(first_qvar, *cit,
++variables.begin(), variables.end());
for(TupleList::iterator tit = tuples.begin();
tit != tuples.end(); ++tit)
{
result.insert(*tit);
}
}
return result;
}
示例2: merge_tuples
void SimpleQueryLinker::merge_tuples(const ConditionPtr& target_condition,
const TupleList& tuples, TupleList& result)
{
for(TupleList::const_iterator tit = tuples.begin();
tit != tuples.end(); ++tit)
{
result.insert(ConditionTuplePtr(
new SimpleConditionTuple(target_condition, *tit)));
}
}
示例3: sequentialMerge
/** Merge two DiscreteDBFs as if there we executed sequentially
* @remarks This can also be achived on-the-fly using SequentialDBF
*/
DiscreteDBF DiscreteDBF::sequentialMerge(const DiscreteDBF& dbf1,
const DiscreteDBF& dbf2){
DiscreteDBF retval;
const TupleList& t1 = dbf1._tuples,
t2 = dbf2._tuples;
TupleList& tr = retval._tuples;
ConstTupleIterator i1 = t1.begin(),
i2 = t2.begin();
int max = 0;
// While we have stuff to merge from both t1 and t2
while(i1 != t1.end() && i2 != t2.end()){
int time = -1;
if(i1->time() <= i2->time()){
if(max < i1->wcet()){
max = i1->wcet();
time = i1->time();
assert(time != -1);
}
i1++;
}else if(i1->time() >= i2->time()){
if(max < i2->wcet()){
max = i2->wcet();
time = i2->time();
assert(time != -1);
}
i2++;
}
if(time != -1)
tr.push_back(DemandTuple(max, time));
}
// Now one of them might contains something...
while(i1 != t1.end()){
if(max < i1->wcet()){
max = i1->wcet();
tr.push_back(DemandTuple(max, i1->time()));
}
i1++;
}
while(i2 != t2.end()){
if(max < i2->wcet()){
max = i2->wcet();
tr.push_back(DemandTuple(max, i2->time()));
}
i2++;
}
return retval;
}
示例4: writeTupleListEntry
void DomUtil::writeTupleListEntry(QDomDocument &doc, const QString &path, const QString &tag,
const QStringList &attrList, const TupleList &value)
{
QDomElement el = createElementByPath(doc, path);
TupleList::ConstIterator it;
for (it = value.begin(); it != value.end(); ++it) {
QDomElement subEl = doc.createElement(tag);
int i=0;
for(QValueListConstIterator<QString> iter = attrList.begin(); iter != attrList.end(); ++iter) {
subEl.setAttribute(*iter,(*it)[i++]);
}
el.appendChild(subEl);
}
}
示例5:
/** Create DiscreteStepIterator */
DiscreteDBF::DiscreteStepIterator::DiscreteStepIterator(const TupleList& tuples){
_next = tuples.begin();
_end = tuples.end();
}
示例6: construct_cells
ErrorCode ReadCCMIO::construct_cells(TupleList &face_map,
#ifndef TUPLE_LIST
SenseList &sense_map,
#endif
TupleList & /* vert_map */,
std::map<int,int> &cell_topo_types,
std::vector<EntityHandle> &new_cells)
{
std::vector<EntityHandle> facehs;
std::vector<int> senses;
EntityHandle cell;
ErrorCode tmp_rval, rval = MB_SUCCESS;
EntityType this_type = MBMAXTYPE;
bool has_mid_nodes = false;
#ifdef TUPLE_LIST
unsigned int i = 0;
while (i < face_map.n) {
// pull out face handles bounding the same cell
facehs.clear();
int this_id = face_map.get_int(i);
unsigned int inext = i;
while (face_map.get_int(inext) == this_id && inext <= face_map.n) {
inext++;
EntityHandle face = face_map.get_ulong(inext);
facehs.push_back(face);
senses.push_back(face_map.get_short(inext));
}
this_type = MBMAXTYPE;
has_mid_nodes = false;
#else
std::map<int,std::vector<EntityHandle> >::iterator fmit;
std::map<int,std::vector<int> >::iterator smit;
std::map<int,int>::iterator typeit;
for (fmit = face_map.begin(), smit = sense_map.begin();
fmit != face_map.end(); fmit++, smit++) {
// pull out face handles bounding the same cell
facehs.clear();
int this_id = (*fmit).first;
facehs = (*fmit).second;
senses.clear();
senses = (*smit).second;
typeit = cell_topo_types.find(this_id);
if (typeit != cell_topo_types.end()) {
rval = ccmio_to_moab_type(typeit->second, this_type, has_mid_nodes);
}
else {
this_type = MBMAXTYPE;
has_mid_nodes = false;
}
#endif
tmp_rval = create_cell_from_faces(facehs, senses, this_type, has_mid_nodes, cell);
if (MB_SUCCESS != tmp_rval) rval = tmp_rval;
else {
new_cells.push_back(cell);
// tag cell with global id
tmp_rval = mbImpl->tag_set_data(mGlobalIdTag, &cell, 1, &this_id);
if (MB_SUCCESS != tmp_rval) rval = tmp_rval;
}
}
return rval;
}
ErrorCode ReadCCMIO::ccmio_to_moab_type(int ccm_type, EntityType &moab_type, bool &has_mid_nodes)
{
switch (ccm_type) {
case 1:
moab_type = MBVERTEX;
break;
case 2:
case 28:
moab_type = MBEDGE;
break;
case 29:
moab_type = MBMAXTYPE;
break;
case 3:
case 4:
moab_type = MBQUAD;
break;
case 11:
case 21:
moab_type = MBHEX;
break;
case 12:
case 22:
moab_type = MBPRISM;
break;
case 13:
case 23:
moab_type = MBTET;
break;
case 14:
case 24:
moab_type = MBPYRAMID;
break;
case 255:
moab_type = MBPOLYHEDRON;
break;
//.........这里部分代码省略.........