Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature find missing parameter #123

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion modules/PhysiCell_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,16 @@ int Parameters<T>::find_index( std::string search_name )
{
return name_to_index_map[ search_name ];
}


template <class T>
int Parameters<T>::find_variable_index( std::string search_name )
{
// this should return -1 if not found, not zero
auto out = name_to_index_map.find( search_name );
if( out != name_to_index_map.end() )
{ return out->second; }
return -1;
}

template <class T>
std::ostream& operator<<( std::ostream& os , const Parameters<T>& params )
Expand Down
1 change: 1 addition & 0 deletions modules/PhysiCell_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class Parameters
void add_parameter( Parameter<T> param );

int find_index( std::string search_name );
int find_variable_index (std::string search_name); // same result above, but will return -1 if search_name is not a parameter

// these access the values
T& operator()( int i );
Expand Down