Paramotopy parallel parameter homotopy through bertini
para_aux_funcs.hpp File Reference
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sstream>
#include <fstream>
#include <string>
#include <stdexcept>
#include <vector>
#include <map>
#include <iostream>
#include <stdio.h>
#include <boost/filesystem.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/progress.hpp>
#include <boost/regex.hpp>
#include "paramotopy_enum.hpp"
#include "random.hpp"
#include "mtrand.hpp"

Go to the source code of this file.

## Macros

#define BOOST_FILESYSTEM_VERSION   3

#define BOOST_FILESYSTEM_NO_DEPRECATED

#define __PARA_AUX_H__

## Functions

int bertini_main (int argC, char *args[])

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 >
FindFiles (boost::filesystem::path dir, std::string expression)

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

std::string getAlphaNumeric_WithSpaces ()

std::string getAlphaNumeric ()

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

double getDouble ()

int getInteger ()

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

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

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

std::string stackoverflow_getcwd ()

void safe_chdir (std::string desired_directory)

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

## Macro Definition Documentation

 #define __PARA_AUX_H__

Definition at line 33 of file para_aux_funcs.hpp.

 #define BOOST_FILESYSTEM_NO_DEPRECATED

Definition at line 23 of file para_aux_funcs.hpp.

 #define BOOST_FILESYSTEM_VERSION   3

Definition at line 22 of file para_aux_funcs.hpp.

## Function Documentation

 int bertini_main ( int argC, char * args[] )

Function to call the bertini libraries.

 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 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.

Here is the caller graph for this function:

 std::vector 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.

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().

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.

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.

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
 filename the string name of the file.
Returns
parser index of the filename

Definition at line 44 of file para_aux_funcs.cpp.

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().

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:

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.

Here is the caller graph for this function: