本文整理汇总了C++中Pattern::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Pattern::end方法的具体用法?C++ Pattern::end怎么用?C++ Pattern::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pattern
的用法示例。
在下文中一共展示了Pattern::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convert
bool Analyzer::convert(Pattern& pattern, vector<string>& items, RowData& row_data){
// pattern and item size must match
if (pattern.size() != items.size()) {
return false;
}
Pattern::iterator itr_pattern = pattern.begin();
vector<string>::iterator itr_items = items.begin();
// process every element using proper element parser
// return true only if all items are proper handled
while (itr_pattern != pattern.end()) {
Element* ele = *(*itr_pattern);
string str = *itr_items;
// increase pattern itr and corresponding item itr
itr_pattern++;
itr_items++;
Data data;
if (ele->convert(str, data)) {
row_data.push_back(data);
} else {
row_data.clear();
return false;
}
}
return true;
}
示例2: clipped_Hebbian
Matrix clipped_Hebbian(const Pattern& Z, const Topology& W)
{
Matrix J(W.n, W.n, 0); // Create a nxn Matrix filled with 0
// clipped Hebbian Definition: Jij=Wij * Zp(i) * Zp(j)
// Redefinition:
// If there is a connection between neuron i and neuron j,
// check if neuron i and neuron j are both in pattern p
// ----------------------------
// 1. Go through all the patterns
for (Pattern::const_iterator p=Z.begin(); p!=Z.end(); ++p)
// 2. Go through all connections of the topology
for (Topology::const_iterator i=W.begin(); i!=W.end(); ++i)
{
// 3. Check if neuron 'i' is in pattern
if (find(p->begin(), p->end(), i->first)!=p->end())
// 4. If so, then check if any of the neurons connected to 'i' is in the pattern 'p' as well
for (NeuronList::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
if (find(p->begin(), p->end(), *j)!=p->end())
// If so, Jij is equal to 1
J(i->first,*j)=1;
}
return J;
}
示例3: get_kmer_from_read
Pattern gram::get_kmer_from_read(const uint32_t &kmer_size, const Pattern &read) {
Pattern kmer;
auto kmer_start_it = read.begin() + read.size() - kmer_size;
kmer.assign(kmer_start_it, read.end());
return kmer;
}