// // find_species.h // mc_electron // // Created by Christian Reiling on 03.05.19. // Copyright © 2019 Christian Reiling. All rights reserved. // #ifndef find_species_h #define find_species_h #include #include "particle.hpp" template inline typename std::vector::iterator find_SpeciesItr(std::vector *Vec, species Species) { typename std::vector::iterator Itr; if (Vec->size() == 0) { Itr = Vec->end(); } else { Itr = Vec->begin(); while (Itr != Vec->end() ) { if ((*Itr)->get_Species() == Species) { break; } Itr++; } } return (Itr); } template inline typename std::vector::const_iterator find_SpeciesConstItr(const std::vector *Vec, species Species) { typename std::vector::const_iterator Itr; if (Vec->size() == 0) { Itr = Vec->cend(); } else { Itr = Vec->cbegin(); while (Itr != Vec->cend() ) { if ( (*Itr)->get_Species() == Species) { break; } Itr++; } } return (Itr); } #endif /* find_species_h */