fix name of filtered_bond

This commit is contained in:
Daniel Russel 2009-04-10 00:23:20 +00:00
parent 7a340e9d8d
commit 9c2037dde3
2 changed files with 9 additions and 9 deletions

View File

@ -178,10 +178,10 @@ make_ca_range(Range r){
} }
template <class OK_atom> template <class Atom_filter>
struct Is_ok_bond { struct Filtered_atom_bond_filter {
typedef bool result_type; typedef bool result_type;
Is_ok_bond(OK_atom ao): ao_(ao){} Filtered_atom_bond_filter(Atom_filter ao): ao_(ao){}
struct Atom_pair{ struct Atom_pair{
Monomer::Atom_key k_; Monomer::Atom_key k_;
@ -205,14 +205,14 @@ struct Is_ok_bond {
return false; return false;
} }
} }
OK_atom ao_; Atom_filter ao_;
}; };
//! Return an iterator range which returns skips non-backbone atoms //! Return an iterator range which returns skips non-backbone atoms
template <class Range, class OKA> template <class Range, class AtomFilter>
internal::rangelib::filtered_range<Range, Is_ok_bond<OKA> > internal::rangelib::filtered_range<Range, Filtered_atom_bond_filter<AtomFilter> >
make_backbone_range(OKA oka, Range r){ make_filtered_bond_range(AtomFilter oka, Range r){
return internal::rangelib::filtered(r, Is_ok_bond<OKA>(oka)); return internal::rangelib::filtered(r, Filtered_atom_bond_filter<AtomFilter>(oka));
} }

View File

@ -60,7 +60,7 @@ int main() {
assert(bbi.size() < atoms.size()); assert(bbi.size() < atoms.size());
std::cout << bbi.size() << std::endl; std::cout << bbi.size() << std::endl;
std::vector<Bond> bbs; std::vector<Bond> bbs;
fill(bbs, make_bond_indices_range(make_ok_bond_range(Is_backbone(), p.bonds()))); fill(bbs, make_bond_indices_range(make_filtered_bond_range(Is_backbone(), p.bonds())));
std::cout << bbs.size() << std::endl; std::cout << bbs.size() << std::endl;
for (unsigned int i=0; i< bbs.size(); ++i) { for (unsigned int i=0; i< bbs.size(); ++i) {
assert(bbs[i].first < Index(bbi.size())); assert(bbs[i].first < Index(bbi.size()));