Working Version with Population update and T+ interactions.
This commit is contained in:
@@ -10,17 +10,18 @@
|
||||
#define find_species_h
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "particle.hpp"
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline typename std::vector<T*>::iterator find_SpeciesItr(std::vector<T*> Vec, species Species) {
|
||||
inline typename std::vector<T*>::iterator find_SpeciesItr(std::vector<T*> *Vec, species Species) {
|
||||
typename std::vector<T*>::iterator Itr;
|
||||
if (Vec.size() == 0) {
|
||||
Itr = Vec.end();
|
||||
if (Vec->size() == 0) {
|
||||
Itr = Vec->end();
|
||||
} else {
|
||||
Itr = Vec.begin();
|
||||
while (Itr != Vec.end() ) {
|
||||
Itr = Vec->begin();
|
||||
while (Itr != Vec->end() ) {
|
||||
if ((*Itr)->get_Species() == Species) {
|
||||
break;
|
||||
}
|
||||
@@ -31,13 +32,13 @@ inline typename std::vector<T*>::iterator find_SpeciesItr(std::vector<T*> Vec, s
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename std::vector<T*>::const_iterator find_SpeciesConstItr(const std::vector<T*> Vec, species Species) {
|
||||
inline typename std::vector<T*>::const_iterator find_SpeciesConstItr(const std::vector<T*> *Vec, species Species) {
|
||||
typename std::vector<T*>::const_iterator Itr;
|
||||
if (Vec.size() == 0) {
|
||||
Itr = Vec.end();
|
||||
if (Vec->size() == 0) {
|
||||
Itr = Vec->cend();
|
||||
} else {
|
||||
Itr = Vec.cbegin();
|
||||
while (Itr != Vec.cend() ) {
|
||||
Itr = Vec->cbegin();
|
||||
while (Itr != Vec->cend() ) {
|
||||
if ( (*Itr)->get_Species() == Species) {
|
||||
break;
|
||||
}
|
||||
@@ -47,4 +48,5 @@ inline typename std::vector<T*>::const_iterator find_SpeciesConstItr(const std::
|
||||
return (Itr);
|
||||
}
|
||||
|
||||
|
||||
#endif /* find_species_h */
|
||||
|
||||
Reference in New Issue
Block a user