Paramotopy
parallel parameter homotopy through bertini
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
para_aux_funcs.cpp File Reference
#include "para_aux_funcs.hpp"

Go to the source code of this file.

Functions

void ParamotopySplashScreen ()
 
void BertiniSplashScreen (std::string bertinilocation)
 
int GetFileParserIndex (std::string filename)
 
void GetFilesToParse (boost::filesystem::path run_to_analyze, std::vector< std::string > &gather_savefiles, std::vector< int > &gather_parser_indices)
 
bool TestIfFinished (boost::filesystem::path &path_to_check)
 
int ParseFailedPaths (std::ifstream &fin, int numvariables)
 the parser for the failed_paths file type, which is output from bertini. More...
 
std::string replace_tilde_with_home (std::string workwithme)
 
std::vector
< boost::filesystem::path > 
FindDirectories (boost::filesystem::path dir, std::string expression)
 
std::vector
< boost::filesystem::path > 
FindFiles (boost::filesystem::path dir, std::string expression)
 
boost::filesystem::path make_base_dir_name (boost::filesystem::path filename)
 
bool parseDouble (std::string const &text, double &results)
 
double getDouble ()
 
std::string getAlphaNumeric_WithSpaces ()
 
std::string getAlphaNumeric ()
 
bool parseInteger (std::string const &text, int &results)
 
int getInteger ()
 
int get_int_choice (std::string display_string, int min_value, int max_value)
 
int ParamotopyMainMenu ()
 
std::string stackoverflow_getcwd ()
 
void safe_chdir (std::string desired_directory)
 
std::string convert_spaces_to_escaped (std::string workwithme)
 

Function Documentation

void BertiniSplashScreen ( std::string  bertinilocation)

Display the bertini version information.

Definition at line 21 of file para_aux_funcs.cpp.

References bertini_main().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string convert_spaces_to_escaped ( std::string  workwithme)

Definition at line 484 of file para_aux_funcs.cpp.

Referenced by parallel_case().

Here is the caller graph for this function:

std::vector<boost::filesystem::path> FindDirectories ( boost::filesystem::path  ,
std::string  expression 
)

Searches a directory for all files fitting a regular expression.

Parameters
dir- The directory to search.
expression- The expression for which to search.
Returns
vector<path> - A vector of boost style paths that stores the files found.

Definition at line 167 of file para_aux_funcs.cpp.

Referenced by runinfo::AutoScanData(), datagatherer::GetAvailableRuns(), failinfo::RecoverProgress(), runinfo::ScanData(), and failinfo::StartOver().

Here is the caller graph for this function:

std::vector< boost::filesystem::path > FindFiles ( boost::filesystem::path  dir,
std::string  expression 
)

Searches a directory for all directories fitting a regular expression.

Parameters
dir- The directory to search.
expression- The expression for which to search.
Returns
vector<string> - A vector of strings that stores the found directories.

Definition at line 194 of file para_aux_funcs.cpp.

Referenced by datagatherer::finalize_run_to_file(), GetFilesToParse(), ProgSettings::load_interactive(), and datagatherer::MergeFolders().

Here is the caller graph for this function:

int get_int_choice ( std::string  display_string,
int  min_value,
int  max_value 
)

Display a menu option to the user and ask for an integer input within the specified range.

Parameters
display_string- The menu as a string.
min_value- The minimum value allowed.
max_value- The maximum value allowed.
Returns
int - The integer the user specified.

Definition at line 347 of file para_aux_funcs.cpp.

References getInteger().

Referenced by ProgSettings::AddSetting(), ProgSettings::BertiniMenu(), runinfo::CheckRunStepOne(), DataManagementMainMenu(), ProgSettings::FileMenu(), ProgSettings::GetArchitecture(), datagatherer::GetAvailableRuns(), ProgSettings::GetBufferSize(), ProgSettings::GetDataFolderMethod(), ProgSettings::GetDeleteTmpFiles(), ProgSettings::GetMachineFile(), ProgSettings::GetNewFileThresh(), ProgSettings::GetNewRandomAtNewFolder(), ProgSettings::GetNumFilesTime(), ProgSettings::GetNumIterations(), ProgSettings::GetNumProcs(), ProgSettings::GetParallel(), ProgSettings::GetRandomMethod(), ProgSettings::GetStartFileName(), ProgSettings::GetStifle(), ProgSettings::GetTemporaryFileLocation(), ProgSettings::GetTightenTolerancesPathFailure(), ProgSettings::GetWriteMCFileUserDef(), ProgSettings::load_interactive(), failinfo::MainMenu(), ProgSettings::MainMenu(), ProgSettings::ManagePathFailureBertini(), ProgSettings::MetaSettingsMenu(), ProgSettings::ParallelismMenu(), ParamotopyMainMenu(), ProgSettings::PathFailureMenu(), runinfo::RandomMenu(), ProgSettings::SaveFilesMenu(), ProgSettings::SearchMenu(), runinfo::SetBaseDirManual(), runinfo::SetRandom(), ProgSettings::SetSaveFiles(), ProgSettings::SetSearchDesiredNumber(), ProgSettings::SetSearchIterations(), ProgSettings::SetSearchMode(), ProgSettings::SetSearchPosRealThresh(), ProgSettings::SetSearchSubmode(), ProgSettings::SetStandardStep2(), ProgSettings::SolverModeMenu(), ProgSettings::StepOneMenu(), steptwo_case(), ProgSettings::StepTwoMenu(), and ProgSettings::SystemMenu().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string getAlphaNumeric ( )

Get alphanumeric input from the user without spaces.

Returns
string - The string inputted by the user.

Definition at line 292 of file para_aux_funcs.cpp.

Referenced by ProgSettings::AddSetting(), ProgSettings::ChangeSetting(), ProgSettings::FindProgram(), ProgSettings::GetMachineFile(), ProgSettings::GetProgramLocationManual(), ProgSettings::GetTemporaryFileLocation(), and ProgSettings::RemoveSetting().

Here is the caller graph for this function:

std::string getAlphaNumeric_WithSpaces ( )

Get alphnumeric input from the user with spaces.

Returns
string - The string inputted by the user.

Definition at line 278 of file para_aux_funcs.cpp.

Referenced by ProgSettings::GetArchitecture(), runinfo::GetInputFileName(), runinfo::LoadRandom(), and runinfo::SaveRandom().

Here is the caller graph for this function:

double getDouble ( )

Have the user input a value until it's a double, return that value.

Returns
double - The double the user inputted.

Definition at line 247 of file para_aux_funcs.cpp.

References parseDouble().

Referenced by runinfo::SetRandom().

Here is the call graph for this function:

Here is the caller graph for this function:

int GetFileParserIndex ( std::string  filename)

get the index for the particular filename. not the fastest lookup, should only perform seldomly.

Parameters
filenamethe string name of the file.
Returns
parser index of the filename

Definition at line 44 of file para_aux_funcs.cpp.

Referenced by datagatherer::add_file_to_save().

Here is the caller graph for this function:

void GetFilesToParse ( boost::filesystem::path  run_to_analyze,
std::vector< std::string > &  gather_savefiles,
std::vector< int > &  gather_parser_indices 
)

Get the files to parse.

Parameters
run_to_analyze- The path of the folder to analyze.
gather_savefiles- Gather all the files to be saved
gather_parser_indices- A vector that that stores info as to whether or not to gather a particular file.

Definition at line 66 of file para_aux_funcs.cpp.

References FindFiles().

Referenced by datagatherer::GatherDataForFails(), and datagatherer::GatherDataFromMenu().

Here is the call graph for this function:

Here is the caller graph for this function:

int getInteger ( )

Have the user input a value untl it's an integer, return that value.

Returns
int - The integer the user inputted.

Definition at line 317 of file para_aux_funcs.cpp.

References parseInteger().

Referenced by get_int_choice().

Here is the call graph for this function:

Here is the caller graph for this function:

boost::filesystem::path make_base_dir_name ( boost::filesystem::path  filename)

Make the base directory given the associated paramotopy input filename.

Parameters
filename- The paramotopy input filename.
Returns
string - A string of the format "bfiles_filename", where filename is the string value of filename.

Definition at line 226 of file para_aux_funcs.cpp.

Referenced by main().

Here is the caller graph for this function:

int ParamotopyMainMenu ( )

Display the main paramotopy choice menu.

Returns
int - The integer choice of the user for the main menu.

Definition at line 387 of file para_aux_funcs.cpp.

References get_int_choice().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void ParamotopySplashScreen ( )

Display the Paramotopy splash screen.

Definition at line 5 of file para_aux_funcs.cpp.

Referenced by main().

Here is the caller graph for this function:

bool parseDouble ( std::string const &  text,
double &  results 
)

Set results to the value in the string.

Parameters
text- The double as a string value.
results- The double to store the string value as a double.
Returns
bool - A boolean to indicate whether the parsing was successful or not.

Definition at line 241 of file para_aux_funcs.cpp.

Referenced by getDouble().

Here is the caller graph for this function:

int ParseFailedPaths ( std::ifstream &  fin,
int  numvariables 
)

the parser for the failed_paths file type, which is output from bertini.

The parser for the failed_paths file type which is output from bertini.

Parameters
fin- The input file stream of the failed_paths file to parse
numvariables- The number of variables.
Returns
int - The number of failed_paths for a particular parameter point.

Definition at line 125 of file para_aux_funcs.cpp.

Referenced by failinfo::find_failed_paths().

Here is the caller graph for this function:

bool parseInteger ( std::string const &  text,
int &  results 
)

Parse a string that has an integer value in string form.

Parameters
text- The integer value as a string.
results- The value to set as a string.
Returns
bool - A boolean to indicate whether the parsing was successful or not.

Definition at line 310 of file para_aux_funcs.cpp.

Referenced by getInteger().

Here is the caller graph for this function:

std::string replace_tilde_with_home ( std::string  workwithme)

Finds a user-entered tilde, and replaces it with the $HOME variable.

Parameters
workwithme- The string to test if a ~ exists to replace with the $HOME variable.
Returns
string - The replacement string.

Definition at line 151 of file para_aux_funcs.cpp.

Referenced by ProgSettings::GetProgramLocationManual().

Here is the caller graph for this function:

void safe_chdir ( std::string  desired_directory)

Definition at line 463 of file para_aux_funcs.cpp.

Referenced by slave_process::GoCalledDir(), and slave_process::MoveToWorkingFolder().

Here is the caller graph for this function:

std::string stackoverflow_getcwd ( )

Get the current working directory directly from stackoverflow

Returns
string - The current working directory as a string..

Definition at line 428 of file para_aux_funcs.cpp.

Referenced by master_process::master_process(), and slave_process::slave_process().

Here is the caller graph for this function:

bool TestIfFinished ( boost::filesystem::path &  path_to_check)

Test if a step2 run is finished.

Parameters
paths_to_check
Returns
bool - A boolean to indicate whether or not the step 2 run is finished.

Definition at line 109 of file para_aux_funcs.cpp.

Referenced by datagatherer::GetAvailableRuns(), failinfo::PerformAnalysis(), and failinfo::RecoverProgress().

Here is the caller graph for this function: