|
| vector< string > | nnp::split (std::string const &input, char delimiter=' ') |
| | Split string at each delimiter.
|
| |
| string | nnp::trim (std::string const &line, std::string const &whitespace=" \t") |
| | Remove leading and trailing whitespaces from string.
|
| |
| string | nnp::reduce (std::string const &line, std::string const &whitespace=" \t", std::string const &fill=" ") |
| | Replace multiple whitespaces with fill.
|
| |
| std::string | nnp::pad (std::string const &input, std::size_t num, char fill=' ', bool right=true) |
| | Pad string to given length with fill character.
|
| |
| string | nnp::strpr (const char *format,...) |
| | String version of printf function.
|
| |
| string | nnp::cap (std::string word) |
| | Capitalize first letter of word.
|
| |
| std::vector< std::string > | nnp::createFileHeader (std::vector< std::string > const &title, std::vector< std::size_t > const &colLength, std::vector< std::string > const &colName, std::vector< std::string > const &colInfo, char const &commentChar='#') |
| | Generate output file header with info section and column labels.
|
| |
| void | nnp::appendLinesToFile (std::ofstream &file, std::vector< std::string > const lines) |
| | Append multiple lines of strings to open file stream.
|
| |
| void | nnp::appendLinesToFile (FILE *const &file, std::vector< std::string > const lines) |
| | Append multiple lines of strings to open file pointer.
|
| |
| std::map< std::size_t, std::vector< double > > | nnp::readColumnsFromFile (std::string fileName, std::vector< std::size_t > columns, char comment='#') |
| | Read multiple columns of data from file.
|
| |
| template<typename K, typename V> |
| V const & | nnp::safeFind (std::map< K, V > const &stdMap, typename std::map< K, V >::key_type const &key) |
| | Safely access map entry.
|
| |
| template<typename T> |
| bool | nnp::vectorContains (std::vector< T > const &stdVec, T value) |
| | Test if vector contains specified value.
|
| |
| template<typename T, typename U> |
| bool | nnp::unorderedMapContainsKey (std::unordered_map< T, U > const &stdMap, T key) |
| | Test if unordered map contains specified key.
|
| |
| template<typename T> |
| bool | nnp::comparePointerTargets (T *lhs, T *rhs) |
| | Compare pointer targets.
|
| |
| double | nnp::pow_int (double x, int n) |
| | Integer version of power function, "fast exponentiation algorithm".
|
| |