本文整理汇总了C++中PartVector::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ PartVector::resize方法的具体用法?C++ PartVector::resize怎么用?C++ PartVector::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartVector
的用法示例。
在下文中一共展示了PartVector::resize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: translate_partset_to_partvector
void Transaction::translate_partset_to_partvector ( const PartSet &in , PartVector &out ) const
{
out.resize ( in.size() );
unsigned i = 0;
for ( PartSet::const_iterator cur_in = in.begin() ; cur_in != in.end() ; cur_in++ )
{
out[i] = *cur_in;
++i;
}
}
示例2: supersets
void Bucket::supersets( PartVector & ps ) const
{
const MetaData & mesh_meta_data = mesh().mesh_meta_data();
std::pair<const unsigned *, const unsigned *>
part_ord = superset_part_ordinals();
ps.resize( part_ord.second - part_ord.first );
for ( unsigned i = 0 ;
part_ord.first < part_ord.second ; ++(part_ord.first) , ++i ) {
ps[i] = & mesh_meta_data.get_part( * part_ord.first );
}
}
示例3: unpack_entity_info
void unpack_entity_info(
CommBuffer & buf,
const BulkData & mesh ,
EntityKey & key ,
unsigned & owner ,
PartVector & parts ,
std::vector<Relation> & relations )
{
unsigned nparts = 0 ;
unsigned nrel = 0 ;
buf.unpack<EntityKey>( key );
buf.unpack<unsigned>( owner );
buf.unpack<unsigned>( nparts );
parts.resize( nparts );
for ( unsigned i = 0 ; i < nparts ; ++i ) {
unsigned part_ordinal = ~0u ;
buf.unpack<unsigned>( part_ordinal );
parts[i] = & MetaData::get(mesh).get_part( part_ordinal );
}
buf.unpack( nrel );
relations.clear();
relations.reserve( nrel );
for ( unsigned i = 0 ; i < nrel ; ++i ) {
EntityKey rel_key ;
unsigned rel_id = 0 ;
unsigned rel_attr = 0 ;
buf.unpack<EntityKey>( rel_key );
buf.unpack<unsigned>( rel_id );
buf.unpack<unsigned>( rel_attr );
Entity * const entity =
mesh.get_entity( entity_rank(rel_key), entity_id(rel_key) );
if ( entity && EntityLogDeleted != entity->log_query() ) {
Relation rel( * entity, rel_id );
rel.set_attribute(rel_attr);
relations.push_back( rel );
}
}
}