本文整理汇总了C++中vec_t::size方法的典型用法代码示例。如果您正苦于以下问题:C++ vec_t::size方法的具体用法?C++ vec_t::size怎么用?C++ vec_t::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec_t
的用法示例。
在下文中一共展示了vec_t::size方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: curr_pid
rc_t
lg_tag_chunks_h::update(uint4_t start_byte, const vec_t& data) const
{
FUNC(lg_tag_chunks_h::update);
uint4_t amount; // amount to update on page
uint4_t pid_count = start_byte/lgdata_p::data_sz; // first page
uint4_t data_size = data.size();
lpid_t curr_pid(_page.pid().vol(), _cref.store, 0);
uint4_t offset = start_byte%lgdata_p::data_sz;
uint4_t num_bytes = 0;
while (num_bytes < data_size) {
amount = MIN(lgdata_p::data_sz-offset, data_size-num_bytes);
curr_pid.page = _pid(pid_count);
lgdata_p lgdata;
W_DO( lgdata.fix(curr_pid, LATCH_EX) );
W_DO(lgdata.update(offset, data, num_bytes, amount));
offset = 0;
num_bytes += amount;
pid_count++;
}
// verify last page touched is same as calculated last page
w_assert9(pid_count-1 == (start_byte+data.size()-1)/lgdata_p::data_sz);
return RCOK;
}
示例2: feat_trade_region
feature feat_trade_region(vec_t trade_list)
{
feature feat;
if (trade_list.size() > 0)
feat.push_back(trade_list[trade_list.size() - 1].timeStamp - trade_list[0].timeStamp);
else
feat.push_back(0);
return feat;
}
示例3: V
void V(const vec_t &a, int b, int c, vec_t &d)
{
int i;
DBG(<<"*******BEGIN TEST(" << b << "," << c << ")");
for(i=0; i<a.count(); i++) {
DBG(<<"vec["<<i<<"]=("
<<::dec((unsigned int)a.ptr(i)) <<"," <<a.len(i) <<")");
}
for(int l = 0; l<100; l++) {
if(c > (int) a.size()) break;
a.mkchunk(b, c, d);
#ifdef DEBUG
cout <<"returning :";
for(i=0; i<d.count(); i++) {
cout <<"result["<<i<<"]=("
<<::dec((unsigned int)d.ptr(i)) <<"," <<d.len(i) <<")" << endl;
}
for(i=0; i<d.count(); i++) {
for(int j=0; j< (int)d.len(i); j++) {
cout << *(char *)(d.ptr(i)+j);
}
} cout << endl;
#endif
c+=b;
}
DBG(<<"*******END TEST");
}
示例4: get_Gap_statistics
feature get_Gap_statistics(vec_t trade_list)
{
vec_d Gap;
size_t len = trade_list.size();
for (size_t i = 0; i + 1 < len; ++i)
Gap.push_back(trade_list[i + 1].timeStamp.get_time() - trade_list[i].timeStamp.get_time());
return get_statistics_feature(Gap);
}
示例5: get_track_distglobal_statistics
feature get_track_distglobal_statistics(vec_t trade_list)
{
vec_d Dist;
size_t len = trade_list.size();
for (size_t i = 0; i + 1< len; ++i )
Dist.push_back(dist_global(trade_list[i].addr, trade_list[i + 1].addr));
return get_statistics_feature(Dist);
}
示例6: get_dist2_statistics
feature get_dist2_statistics(vec_t trade_list)
{
vec_d Dist;
size_t len = trade_list.size();
for (size_t i = 0; i + 1 < len; ++i)
for (size_t j = i + 1; j < len; ++j)
Dist.push_back(dist2(trade_list[i].addr, trade_list[j].addr));
return get_statistics_feature(Dist);
}
示例7: feat_trade_distglobal_total
feature feat_trade_distglobal_total(vec_t trade_list)
{
feature feat;
size_t len = trade_list.size();
double sum = 0;
for (size_t i = 0; i + 1 < len; ++i)
sum += dist_global(trade_list[i].addr, trade_list[i + 1].addr);
feat.push_back(sum);
return feat;
}
示例8: feat_trade_location_avg
feature feat_trade_location_avg(vec_t trade_list)
{
feature feat;
size_t len = trade_list.size();
feature distVec;
for (size_t i = 0; i + 1 < len; ++i)
for (size_t j = i + 1; j < len; ++j)
distVec.push_back(dist2(trade_list[i].addr, trade_list[j].addr));
return feat;
}
示例9:
large::large( bool neg, const vec_t& val )
{
if( val.size() > 0 )
{
_neg = neg;
_val = val;
}
else
{
_neg = false;
}
}
示例10: feat_trade_distglobal_max
feature feat_trade_distglobal_max(vec_t trade_list)
{
feature feat;
size_t len = trade_list.size();
double maxDist = 0;
for (size_t i = 0; i + 1 < len; ++i)
for (size_t j = i + 1; j < len; ++j)
if (dist_global(trade_list[i].addr, trade_list[j].addr) > maxDist)
maxDist = dist_global(trade_list[i].addr, trade_list[j].addr);
feat.push_back(maxDist);
return feat;
}
示例11: loadIndexBufferObject
unsigned int loadIndexBufferObject( const vec_t& vertices )
{
return loadIndexBufferObject( vertices.data(),
vertices.size() * sizeof( vertices.front() ));
}
示例12: feat_trade_amount
feature feat_trade_amount(vec_t trade_list)
{
feature feat;
feat.push_back(trade_list.size());
return feat;
}