Rosetta
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
utility Namespace Reference

unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 0. More...

Namespaces

 CSI
 
 excn
 
 factory
 
 file
 
 graph
 
 io
 
 json_spirit
 
 keys
 
 libsvm
 
 options
 
 pointer
 
 py
 
 serialization
 
 signals
 
 sql_database
 
 tag
 
 thread
 
 tools
 
 type_traits
 
 xsd_util
 

Classes

class  BitSet
 Simple bit set. More...
 
class  BitVector
 Simple bit vector. More...
 
class  Bound
 Bound value class. More...
 
class  CSI_Sequence
 Class to hold all Terminal ASCII codes as static data for CSI_Sequence. Note: that on non-tty terminals the codes will not print to avoid polution of Rosetta logs. More...
 
class  deep_copy_vector1
 
struct  DenseBoolMap
 This struct condenses N boolean values into roughly N bits, saving roughly 4x memory. NUM_ELEMS parameter takes in the number of boolean values. BASE_INDEX parameter takes in the index of the first value. The recommended way to use this struct is with an enum. See core::scoring::hbonds::graph::AtomInfo for an example. More...
 
class  DereferenceIterator
 const_iterator class for SilentFileData container. More...
 
struct  RawType
 Meta-programming classes to provide the pointer type for down_cast. More...
 
struct  RawType< T & >
 
struct  RawType< T * >
 
struct  UtilityExitException
 
class  fixedsizearray0
 
class  fixedsizearray1
 
class  FixedSizeLexicographicalIterator
 
class  heap
 
class  list_element
 
class  in_place_list
 
class  predicate_cmp_filename
 
class  Inline_File_Provider_Hook
 
class  Inline_File_Provider
 
class  subset_mapping
 This class handles the bookeeping to map between a set of integer ids in the "source" enumeration to a subset of those ids – the destination enumartion. Elements in the source enumeration that do not map to elements in the destination enumeration are represented by the value 0. Both enumerations should count from 1. Once the class has been initialized, this class offers O(1) mapping between elements in the enumerations. More...
 
class  Enumerate1
 
class  SimpleRange1
 
class  LexicographicalIterator
 
class  OrderedTuple
 The ordered tuple takes a container class T and defines comparison operators so that the tuple may be sorted. More...
 
struct  history_queue_struct
 
class  recent_history_queue
 A class for keeping track of a subset of elements in a set that are pushed into a queue in a certain order, and which fall off the end of the queue in ther order in which they arrive. Elements in the set can be bumped to the front of the queue. More...
 
class  Show
 
class  SimulateMPIMessage
 
class  SimulateMPIData
 
class  SimulateMPI
 singleton class storing simulated MPI state More...
 
class  SingletonBase
 SingletonBase is meant to serve as a base class for singleton classes in Rosetta handling the initialization of the singleton in a thread-safe way. More...
 
class  small_vectorL
 
struct  SortFirst
 
struct  SortSecond
 
struct  StrongT
 
class  VBWrapper
 
class  vector0
 std::vector with assert-checked bounds More...
 
class  vector0< bool, A >
 std::vector with assert-checked bounds: bool specialization More...
 
class  vector1
 std::vector with 1-based indexing More...
 
class  vector1< bool, A >
 std::vector with 1-based indexing: bool specialization More...
 
class  vectorL
 std::vector with L-based indexing More...
 
class  vectorL< L, bool, A >
 std::vector with L-based indexing: bool specialization More...
 
struct  vectorL_IndexSelector
 vectorL index type selector: Nonnegative lower index non-specialization More...
 
struct  vectorL_IndexSelector< false >
 vectorL index type selector: Negative lower index specialization More...
 
struct  vectorL_ZeroSelector
 vectorL lower index zero selector: Nonzero lower index non-specialization More...
 
struct  vectorL_ZeroSelector< false >
 vectorL lower index zero selector: Zero lower index specialization More...
 
struct  Version
 
class  VirtualBase
 Base class for Polymorphic classes All classes in Rosetta used polymorphically (that is, where a pointer/reference to a base type can point/reference a derived type) should inherit from this class. More...
 

Typedefs

typedef void(* UtilityExitCallBack) ()
 
typedef utility::pointer::shared_ptr< heapheapOP
 
typedef utility::pointer::shared_ptr< heap const > heapCOP
 
typedef utility::pointer::shared_ptr< Inline_File_Provider_HookInline_File_Provider_HookOP
 
typedef utility::pointer::shared_ptr< Inline_File_Provider_Hook const > Inline_File_Provider_HookCOP
 
typedef pointer::shared_ptr< subset_mappingsubset_mappingOP
 
typedef pointer::shared_ptr< subset_mapping const > subset_mappingCOP
 
typedef utility::pointer::shared_ptr< SimulateMPIMessageSimulateMPIMessageOP
 
typedef utility::pointer::shared_ptr< SimulateMPIMessage const > SimulateMPIMessageCOP
 
template<typename T , std::size_t BUFFER_SIZE>
using small_vector0 = small_vectorL< T, 0, BUFFER_SIZE >
 
template<typename T , std::size_t BUFFER_SIZE>
using small_vector1 = small_vectorL< T, 1, BUFFER_SIZE >
 
template<typename Key >
using StrongReal = StrongT< platform::Real, Key >
 
template<typename Key >
using StrongSize = StrongT< platform::Size, Key >
 
typedef utility::pointer::shared_ptr< VirtualBaseVirtualBaseOP
 
typedef utility::pointer::shared_ptr< VirtualBase const > VirtualBaseCOP
 
typedef vector0< bool > vector0_bool
 
typedef vector0< short int > vector0_short
 
typedef vector0< int > vector0_int
 
typedef vector0< long int > vector0_long
 
typedef vector0< unsigned short int > vector0_ushort
 
typedef vector0< unsigned int > vector0_uint
 
typedef vector0< unsigned long int > vector0_ulong
 
typedef vector0< platform::Sizevector0_size_t
 
typedef vector0< platform::Sizevector0_size
 
typedef vector0< platform::SSizevector0_ssize_t
 
typedef vector0< platform::SSizevector0_ssize
 
typedef vector0< float > vector0_float
 
typedef vector0< doublevector0_double
 
typedef vector0< long doublevector0_longdouble
 
typedef vector0< char > vector0_char
 
typedef vector0< unsigned char > vector0_uchar
 
typedef vector0< signed char > vector0_schar
 
typedef vector1< bool > vector1_bool
 
typedef vector1< short int > vector1_short
 
typedef vector1< int > vector1_int
 
typedef vector1< long int > vector1_long
 
typedef vector1< unsigned short int > vector1_ushort
 
typedef vector1< unsigned int > vector1_uint
 
typedef vector1< unsigned long int > vector1_ulong
 
typedef vector1< std::size_t > vector1_size_t
 
typedef vector1< std::size_t > vector1_size
 
typedef vector1< platform::SSizevector1_ssize_t
 
typedef vector1< platform::SSizevector1_ssize
 
typedef vector1< float > vector1_float
 
typedef vector1< doublevector1_double
 
typedef vector1< long doublevector1_longdouble
 
typedef vector1< char > vector1_char
 
typedef vector1< unsigned char > vector1_uchar
 
typedef vector1< signed char > vector1_schar
 

Enumerations

enum  DateFormat { PDB_FORMAT = 1 }
 Enumeration of acceptable date formats. More...
 
enum  simulate_mpi_message_type {
  smpi_char = 1 , smpi_integer , smpi_size , smpi_string ,
  smpi_double , smpi_integers , smpi_sizes , smpi_doubles
}
 

Functions

void swap4_aligned (void *v, long ndata)
 
void encode6bit (const unsigned char *memory, unsigned int length, std::string &jar)
 Given a block of memory (with memory pointing to the first byte) and a byte count (length), convert every three bytes of memory into four bytes of ASCII characters, and populate the string (jar) with those characters. More...
 
platform::Size decode6bit (unsigned char *memory, std::string const &jar, platform::Size const maxbytes)
 Given 3*N bytes of memory to fill, and a string containing 4*N characters, decode the characters (interpreting 4 bytes of ASCII text as 3 binary bytes) and populate the block of memory. More...
 
unsigned char code_to_6bit (unsigned char _6bit)
 
unsigned char code_from_6bit (unsigned char _8bit)
 
void encode_24_to_32 (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char &o0, unsigned char &o1, unsigned char &o2, unsigned char &o3)
 
void decode_32_to_24 (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3, unsigned char *o0, unsigned short goodbytes)
 
template<typename B >
BitSet< Boperator+ (BitSet< B > const &a, BitSet< B > const &b)
 BitSet + BitSet: Union. More...
 
template<typename B >
BitSet< Boperator| (BitSet< B > const &a, BitSet< B > const &b)
 BitSet | BitSet: Union. More...
 
template<typename B >
BitSet< Boperator- (BitSet< B > const &a, BitSet< B > const &b)
 BitSet - BitSet: Difference. More...
 
template<typename B >
void swap (BitSet< B > &a, BitSet< B > &b)
 swap( BitSet, BitSet ) More...
 
template<typename B >
bool operator== (BitSet< B > const &a, BitSet< B > const &b)
 BitSet == BitSet. More...
 
template<typename B >
bool operator!= (BitSet< B > const &a, BitSet< B > const &b)
 BitSet != BitSet. More...
 
template<typename B >
BitVector< Boperator+ (BitVector< B > const &a, BitVector< B > const &b)
 BitVector + BitVector: Union. More...
 
template<typename B >
BitVector< Boperator| (BitVector< B > const &a, BitVector< B > const &b)
 BitVector | BitVector: Union. More...
 
template<typename B >
BitVector< Boperator- (BitVector< B > const &a, BitVector< B > const &b)
 BitVector - BitVector: Difference. More...
 
template<typename B >
void swap (BitVector< B > &a, BitVector< B > &b)
 swap( BitVector, BitVector ) More...
 
template<typename B >
bool operator== (BitVector< B > const &a, BitVector< B > const &b)
 BitVector == BitVector. More...
 
template<typename B >
bool operator!= (BitVector< B > const &a, BitVector< B > const &b)
 BitVector != BitVector. More...
 
template<typename U >
void swap (BitVector< U > &a, BitVector< U > &b)
 swap( BitVector, BitVector ) More...
 
static std::string const CRASH_FILE ("ROSETTA_CRASH.log")
 
static std::string APPNAME ("UNKNOWN APPLICATION")
 
static std::string OPTIONS ("NO OPTIONS SPECIFIED")
 
static std::string const HEADER ("##############################################################################################################\n" "#\n" "# Rosetta crash log. Please submit the contents of this file to http://crash.rosettacommons.org/\n" "# or use the script Rosetta/main/source/scripts/python/public/report_crashes.py\n" "#\n\n")
 
void signal_handler (int signal)
 
void terminate_handler ()
 
void install_crash_handler ()
 Set the crash handler for non-standard crashes (e.g. segfaults) Should only be called once at startup. More...
 
void set_application_name (char const *appname)
 Set the application name that this was launched as. Should only be called once on startup. More...
 
void set_options_string (std::string const &options)
 Set the string representation of the options to be used in the crash report Should only be called once on startup. More...
 
void set_show_crash_report_on_console (bool setting)
 If passed true, any backtrace will show up on stderr in addition to the crash report file. More...
 
void save_crash_report (char const *message="(none)", std::string const &file="(none)", int const line=0)
 Save a crash report to the crash reporter file. More...
 
void save_crash_report (char const *message, std::string const &file, int line, std::string const &traceback)
 
void save_crash_report_to_file (char const *message, std::string const &file, int line, std::string const &traceback)
 
void save_crash_report_to_console (char const *, std::string const &, int, std::string const &traceback)
 
void save_crash_report (std::string const &message, std::string const &file="(none)", int const line=0)
 Save a crash report to the crash reporter file. More...
 
void save_crash_report (std::string const &message, std::string const &file, int const line, std::string const &traceback)
 
bool stdout_is_tty ()
 
CSI_Sequence CSI_Nothing ()
 
CSI_Sequence CSI_Reset ()
 
CSI_Sequence CSI_Bold ()
 
CSI_Sequence CSI_Underline ()
 
CSI_Sequence CSI_Black ()
 
CSI_Sequence CSI_Red ()
 
CSI_Sequence CSI_Green ()
 
CSI_Sequence CSI_Yellow ()
 
CSI_Sequence CSI_Blue ()
 
CSI_Sequence CSI_Magenta ()
 
CSI_Sequence CSI_Cyan ()
 
CSI_Sequence CSI_White ()
 
CSI_Sequence CSI_Default ()
 
CSI_Sequence CSI_bgBlack ()
 
CSI_Sequence CSI_bgRed ()
 
CSI_Sequence CSI_bgGreen ()
 
CSI_Sequence CSI_bgYellow ()
 
CSI_Sequence CSI_bgBlue ()
 
CSI_Sequence CSI_bgMagenta ()
 
CSI_Sequence CSI_bgCyan ()
 
CSI_Sequence CSI_bgWhite ()
 
CSI_Sequence CSI_bgDefault ()
 
std::string get_current_date (DateFormat const format)
 Return current date in the requested format. More...
 
template<class Target , class Source >
Target down_cast (Source &s)
 Fast assert-checked polymorphic down-cast: reference argument. More...
 
template<class Target , class Source >
Target down_cast (Source *p)
 Fast assert-checked polymorphic down-cast: pointer argument. More...
 
void set_main_exit_callback (UtilityExitCallBack=nullptr)
 Set call back funtion that will be called on utility::exit. Use this function to overload default behavior of sys.exit to more appropriate to your application Defaut value for callback function is nullptr, whicth mean no sys exit is called. More...
 
std::vector< UtilityExitCallBack > & get_all_exit_callbacks ()
 Array to hold all additional exit-callbacks. More...
 
void add_exit_callback (UtilityExitCallBack)
 Add additional callback function that will be called before standard exit(…) is executed. [Note: do not confuse this function with 'set_main_exit_callback' which is replacing the end behavior of exit(…)]. More...
 
void remove_exit_callback (UtilityExitCallBack)
 Remove additional callback function that was previously added by using add_exit_callback. More...
 
void exit_handler (char const *file, int const line, std::string const &message)
 
void exit_with_user_fixable_issue (char const *file, int line, std::string const &message)
 Exit in cases where there's a clear issue the user can fix. More...
 
void exit (char const *file, int const line, std::string const &message, int const)
 Exit with file + line + message + optional status. More...
 
int cond_exit (bool condition, char const *file, int const line, std::string const &message, int const status)
 Conditional Exit with file + line + message + optional status. More...
 
NORETURN_ATTR void exit (char const *file, int const line, int const status=1)
 Exit with file + line + optional status. More...
 
void exit (int const status, char const *file, int const line)
 Exit with file + line + status. More...
 
template<typename BidirectionalIterator , typename T >
BidirectionalIterator find_closest (BidirectionalIterator first, BidirectionalIterator last, const T &value)
 Returns an iterator on the sorted range [first, last) nearest to value. If value is equidistant between adjacent elements, the lesser is returned. More...
 
SimpleRange1 enumerate1 (platform::Size const max_inclusive)
 iterate from [1, max_inclusive] More...
 
template<typename T >
SimpleRange1 indices1 (utility::vector1< T > const &v)
 iterate from [1, c.size()] More...
 
template<class K , class V >
void map_merge (std::map< K, V > &destination_map, std::map< K, V > const &source_map)
 Append the second map to the first For one-liner convenience (esp. for map return values.) More...
 
template<typename T >
int argmin (const std::vector< T > &iterable)
 Returns the argument whose value is minimal according to operator<. More...
 
template<typename T >
int argmin (const utility::vector1< T > &iterable)
 Returns the argument whose value is minimal according to operator<. More...
 
template<typename T >
int argmax (const std::vector< T > &iterable)
 Returns the argument whose value is maximal according to operator>. More...
 
template<typename T >
int argmax (const utility::vector1< T > &iterable)
 Returns the argument whose value is maximal according to operator>. More...
 
platform::Size modulo (int const &a, int const &b)
 modulo of an input integer a (can be negative) with respect to unsigned integer b More...
 
int mpi_rank ()
 
int mpi_nprocs ()
 
int receive_integer_from_anyone ()
 Use MPI to wait until some node sends an integer – usually its own mpi_rank so that it can send further messages. More...
 
std::string receive_string_from_node (int source)
 Use MPI to receive a string from a particular node. More...
 
void send_string_to_node (int destination, std::string const &message)
 
char receive_char_from_node (int source)
 Use MPI to receive a single char from a particular node. More...
 
void send_char_to_node (int destination, char message)
 
int receive_integer_from_node (int source)
 Use MPI to receive a single integer from a particular node. More...
 
void send_integer_to_node (int destination, int message)
 
utility::vector1< int > receive_integers_from_node (int source)
 Use MPI to receive a vector of integers from a particular node. More...
 
void send_integers_to_node (int destination, utility::vector1< int > const &message)
 
platform::Size receive_size_from_node (int source)
 Use MPI to receive a single unsigned (usually 64-bit) integer from a particular node. More...
 
void send_size_to_node (int destination, platform::Size message)
 Use MPI to send a single unsigned (usually 64-bit) integer to a particular node. More...
 
utility::vector1< platform::Sizereceive_sizes_from_node (int source)
 Use MPI to receive a vector of integers from a particular node. More...
 
void send_sizes_to_node (int destination, utility::vector1< platform::Size > const &message)
 
double receive_double_from_node (int source)
 Use MPI to receive a single double from a particular node. More...
 
void send_double_to_node (int destination, double message)
 
utility::vector1< doublereceive_doubles_from_node (int source)
 Use MPI to receive a vector of doubles from a particular node. More...
 
void send_doubles_to_node (int destination, utility::vector1< double > const &message)
 
bool isnan (platform::Real const &val)
 
bool isinf (platform::Real const &val)
 
bool isfinite (platform::Real const &val)
 
platform::Real round (platform::Real const &val)
 
platform::Real copysign (platform::Real const &x, platform::Real const &y)
 
platform::Size get_undefined_size ()
 Get a numeric value for Size that represents an "undefined" value. More...
 
bool is_undefined (platform::Size const &val)
 Check if a Size is undefined (i.e has the same value as utility::get_undefined_size() ) More...
 
platform::Real get_undefined_real ()
 Get a numeric value for Real that represents an "undefined" value. More...
 
bool is_undefined (platform::Real const &val)
 Check if a Real is undefined (i.e has the same value as utility::get_undefined_real() ) More...
 
bool operator== (history_queue_struct const &a, history_queue_struct const &b)
 
std::string msg_name (simulate_mpi_message_type msg_type)
 
std::string payload (SimulateMPIMessageOP msg)
 
void print_message (SimulateMPIMessageCOP msg, std::ostream &os)
 
template<platform::SSize L, typename T >
utility::vector1< platform::Sizeargsort (utility::vectorL< L, T > const &v)
 
template<platform::SSize L, typename T >
utility::vector1< platform::Realfractional_rank (utility::vectorL< L, T > const &v)
 Return the fractional rank of a list of numbers. More...
 
template<platform::SSize L, class T , typename std::enable_if< utility::type_traits::has_insertion_operator_s< T >::value >::type * = nullptr>
std::ostream & operator<< (std::ostream &os, utility::vectorL< L, T > const &v)
 Output function for utility::vectorL object. More...
 
template<class T , platform::Size S>
std::ostream & operator<< (std::ostream &os, utility::fixedsizearray1< T, S > const &v)
 Output function for utility::fixedsizearray0 object. More...
 
static std::string const UPPERCASE_LETTERS ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
 
static std::string const LOWERCASE_LETTERS ("abcdefghijklmnopqrstuvwxyz")
 
static std::string const LETTERS (UPPERCASE_LETTERS+LOWERCASE_LETTERS)
 
static std::string const NUMERALS ("0123456789")
 
static std::string const UPPERCASE_ALPHANUMERICS (UPPERCASE_LETTERS+NUMERALS)
 
static std::string const LOWERCASE_ALPHANUMERICS (LOWERCASE_LETTERS+NUMERALS)
 
static std::string const ALPHANUMERICS (LETTERS+NUMERALS)
 
utility::vector1< std::string > string_vector_from_char_vector (utility::vector1< char > const &char_vect)
 
bool parse_boolean (std::stringstream &stream, std::string const &errmsg)
 Given a stringstream in which the next block of text is any string representing "true" or any string representing "false", parse this as a Boolean, and return an informative error message if we fail. More...
 
utility::vector1< std::string > split (std::string const &s)
 split given std::string using ' ' symbol. More...
 
utility::vector1< std::string > split_whitespace (std::string const &s)
 split given std::string using whitespace as a separator. Unlike string_split_multi_delim(), any group of mixed whitespace counts only as a single seperator. More...
 
std::vector< std::string > split_by_newlines (std::string const &s)
 
std::string upper (std::string const &s)
 Make a string Uppercase. More...
 
std::string lower (std::string const &s)
 @breif Make a string Lowercase More...
 
utility::vector1< std::string > quoted_split (std::string const &s)
 
std::string join (utility::vector1< std::string > const &s, std::string const &connector)
 combine strings with anything More...
 
std::string join (std::vector< std::string > const &s, std::string const &connector)
 combine strings with anything More...
 
std::string replace_spaces (std::string const &string_w_spaces, std::string const &replacement)
 replace space separations in a string with a connector such as '_' More...
 
std::list< std::string > split_to_list (const std::string &s)
 split given std::string using ' ' symbol. More...
 
std::set< std::string > split_to_set (std::string const &s)
 split given std::string to a set using ' ' symbol. More...
 
utility::vector1< std::string > string_split (std::string const &in, char splitchar)
 
utility::vector1< std::string > string_split_simple (std::string const &in, char splitchar=' ')
 split to vector1< std::string > using arbitrary split character, but no empty strings (closer to python string::split) More...
 
utility::vector1< std::string > string_split_multi_delim (std::string const &in, std::string splitchars)
 
float string2float (std::string const &st)
 convert a string to a float, returns -1 on failure More...
 
int string2int (std::string const &st)
 convert a string to an int, returns -1 on failure More...
 
platform::Size string2Size (std::string const &st)
 convert a string to a Size, returns numeric::get_undefined_size() on failure More...
 
platform::Real string2Real (std::string const &st)
 convert a string to a Real, returns numeric::get_undefined_real() on failure More...
 
std::string Real2string (platform::Real, std::size_t const decimal_places)
 convert a Real to string at a number of decimal places, optionally pad left. More...
 
std::string fmt_real (platform::Real, platform::Size const pad_left_newlen, std::size_t const decimal_places)
 @breif convert a Real to a string, padding left with spaces until total number of char on left is equal to pad_lef_n More...
 
void string2uint (const std::string &x, unsigned int *const y)
 
bool trimmed_compare (std::string const &s1, std::string const &s2)
 compares two strings ignoring leading and trailing spaces More...
 
bool startswith (std::string const &haystack, std::string const &needle)
 True iff haystack starts with needle. More...
 
bool endswith (std::string const &haystack, std::string const &needle)
 True iff haystack ends with needle. More...
 
bool contains (std::string const &haystack, std::string const &needle)
 Does the string contain the other string? This is purely convenience as I hate the C++ syntax to do this. More...
 
void slurp (std::istream &in, std::string &out)
 Take all of the contents from the std::istream "in" and put them in the std::string "out". More...
 
void ltrim (std::string &s, const std::string &drop)
 Remove any characters in "drop" from the front of the string. More...
 
void rtrim (std::string &s, const std::string &drop)
 Remove any characters in "drop" from the back of the string. More...
 
void trim (std::string &s, const std::string &drop=" ")
 Remove any charachters in "drop" from the front and back of the string. Use strip() for the value-return version. More...
 
std::string strip (std::string const &source, std::string const &drop)
 Return a copy of the string with leading and trailing characters removed Any charachters in drop will be removed For the in place version, see trim() More...
 
std::string pad_atom_name (std::string const &s)
 Pad an atom name to the pdb format. More...
 
std::string pad_left (std::string const &s, platform::Size const newlen, char pad_with=' ')
 Add char to the left of the string. More...
 
std::string pad_right (std::string const &s, platform::Size const newlen, char pad_with=' ')
 Add char to the right of a string. More...
 
std::string strip (std::string const &source, char c=' ')
 Return a copy of the string with leading and trailing characters removed. More...
 
bool is_string_numeric (std::string const &input)
 
std::string file_contents (std::string const &file_name)
 Read the entire contents of a file into a string. All end-of-line characters are replaced by "\n". Throws a utility::excn::EXCN_msg_exception if the file cannot be opened. More...
 
std::string file_basename (const std::string &full_path)
 
std::string filename (const std::string &path)
 
std::string pathname (const std::string &path)
 
std::string replace_environment_variables (std::string input)
 find all environment variables with the form ${VARIABLE} and replace with the contents of that environment variable. if the environment variable does not exist, return string::npos More...
 
std::string string_to_sha1 (std::string const &input_string)
 
bool is_true_string (std::string const &value_str)
 String accepted as a true value? More...
 
bool is_false_string (std::string const &value_str)
 String accepted as a false value? More...
 
std::string make_tag_with_dashes (utility::vector1< int > res_vector, char const delimiter=' ')
 Compactifies vectors of ints: 1 2 3 9 10 11 to "1-3 9-11". More...
 
std::string make_tag_with_dashes (utility::vector1< int > res_vector, utility::vector1< char > chain_vector, utility::vector1< std::string > segid_vector, char const delimiter)
 
std::string make_segtag_with_dashes (utility::vector1< int > res_vector, utility::vector1< std::string > segid_vector, char const delimiter)
 
std::string make_tag (utility::vector1< int > res_vector)
 
std::tuple< utility::vector1< int >, utility::vector1< char >, utility::vector1< std::string > > get_resnum_and_chain_and_segid (std::string const &s, bool &string_is_ok)
 converts string like "1-3 20-22" or "A:1-5 B:20-22" to vectors containing resnums and chains. More...
 
std::tuple< utility::vector1< int >, utility::vector1< char >, utility::vector1< std::string > > get_resnum_and_chain (std::string const &s)
 for those who have a legacy interface that can't touch segids. More...
 
std::pair< std::vector< int >, std::vector< std::string > > get_resnum_and_segid (std::string const &s, bool &string_is_ok)
 converts string like "1-3 20-22" or "A:1-5 B:20-22" to vectors containing resnums and chains. More...
 
bool get_resnum_and_chain_from_one_tag (std::string const &tag, utility::vector1< int > &resnum, utility::vector1< char > &chains, utility::vector1< std::string > &segids)
 helper function for get_resnum_and_chain More...
 
bool get_resnum_and_segid_from_one_tag (std::string const &tag, std::vector< int > &resnum, std::vector< std::string > &chains)
 helper function for get_resnum_and_chain More...
 
platform::Size get_num_digits (platform::Size value)
 
std::string replace_in (std::string const &source, std::string const &from, std::string const &to)
 Generate new string from 'source' by replacing all occurrences of 'from' to 'to' string. More...
 
std::string replace_first_in (std::string const &source, std::string const &from, std::string const &to)
 Generate new string from 'source' by replacing the first occurrence of 'from' to 'to' string. More...
 
std::string remove_from_string (std::string const &source, std::string const &erase_str)
 Call boost to erase all instances of erase_str from source. More...
 
void copy_to_cstr_buffer (std::string const &str, char *buffer, platform::Size buffer_length)
 Copy the contents of a string to a given C-style string buffer (with the given maximum length) The output will be truncated if greater than length, and null terminator will be added. More...
 
template<class T >
std::string to_string (const T &t)
 
template<>
std::string to_string< char > (const char &t)
 
template<class T >
T const from_string (std::string const &s, T)
 
template<class T >
utility::vector1< T > const string_split (std::string const &in, char splitchar, T)
 
template<class T >
void parse_out (std::stringstream &stream, T &recipient, std::string const &errmsg)
 Parse out some data of type T from a stringstream, and throw an error with a message if the operation fails. More...
 
template<class T >
void parse_out (std::stringstream &stream, T &recipient)
 Parse out some data of type T from a stringstream, and throw an error with a message if the operation fails. More...
 
template<class T >
std::string join (utility::vector1< T > const &vector, std::string const &connector)
 combine vector with anything More...
 
template<platform::SSize L>
std::string join (vectorL< L, std::string > const &s, std::string const &connector)
 Join vector of strings in to single string. More...
 
std::string trim (std::string const &s, std::string const &drop=" ")
 Ambiguious with the trim( std::string & s ) – Deprecated: use strip() instead for return-value trimming. More...
 
template<class T >
std::string pad_left (const T &t, platform::Size const newlen, char pad_width=' ')
 Add char to the left of the string. More...
 
template<class T >
std::string pad_right (const T &t, platform::Size const newlen, char pad_width=' ')
 Add char to the right of a string. More...
 
bool same_ignoring_spaces (std::string const &s1, std::string const &s2)
 Compares two strings, ignoring spaces. Useful for comparing atom name strings which have pdb-alignment built into them. Slightly dangerous if you consider the fact that atom names in the PDB are different for different indentation rules: ' CA ' is c-alpha. 'CA ' is calcium. More...
 
void replace_in (std::string &s, const char from, const char *to)
 
void sys_sleep (double const seconds)
 Sleep for a specified number of seconds. More...
 
void rand_sleep ()
 
std::string timestamp ()
 Generate timestamp string. More...
 
std::string timestamp_short ()
 Generate timestamp string, short format. More...
 
std::string timestamp_millis ()
 Generate timestamp string with millis. More...
 
std::string timestamp_millis_short ()
 Generate timestamp string with millis, short format. More...
 
short int min (short int const a, short int const b)
 min( short int, short int ) More...
 
int min (int const a, int const b)
 min( int, int ) More...
 
long int min (long int const a, long int const b)
 min( long int, long int ) More...
 
unsigned short int min (unsigned short int const a, unsigned short int const b)
 min( unsigned short int, unsigned short int ) More...
 
unsigned int min (unsigned int const a, unsigned int const b)
 min( unsigned int, unsigned int ) More...
 
unsigned long int min (unsigned long int const a, unsigned long int const b)
 min( unsigned long int, unsigned long int ) More...
 
float min (float const a, float const b)
 min( float, float ) More...
 
double min (double const a, double const b)
 min( double, double ) More...
 
long double min (long double const a, long double const b)
 min( long double, long double ) More...
 
template<typename T >
T const & min (T const &a, T const &b, T const &c)
 min( a, b, c ) More...
 
template<typename T >
T const & min (T const &a, T const &b, T const &c, T const &d)
 min( a, b, c, d ) More...
 
template<typename T >
T const & min (T const &a, T const &b, T const &c, T const &d, T const &e)
 min( a, b, c, d, e ) More...
 
template<typename T >
T const & min (T const &a, T const &b, T const &c, T const &d, T const &e, T const &f)
 min( a, b, c, d, e, f ) More...
 
short int max (short int const a, short int const b)
 max( short int, short int ) More...
 
int max (int const a, int const b)
 max( int, int ) More...
 
long int max (long int const a, long int const b)
 max( long int, long int ) More...
 
unsigned short int max (unsigned short int const a, unsigned short int const b)
 max( unsigned short int, unsigned short int ) More...
 
unsigned int max (unsigned int const a, unsigned int const b)
 max( unsigned int, unsigned int ) More...
 
unsigned long int max (unsigned long int const a, unsigned long int const b)
 max( unsigned long int, unsigned long int ) More...
 
float max (float const a, float const b)
 max( float, float ) More...
 
double max (double const a, double const b)
 max( double, double ) More...
 
long double max (long double const a, long double const b)
 max( long double, long double ) More...
 
template<typename T >
T const & max (T const &a, T const &b, T const &c)
 max( a, b, c ) More...
 
template<typename T >
T const & max (T const &a, T const &b, T const &c, T const &d)
 max( a, b, c, d ) More...
 
template<typename T >
T const & max (T const &a, T const &b, T const &c, T const &d, T const &e)
 max( a, b, c, d, e ) More...
 
template<typename T >
T const & max (T const &a, T const &b, T const &c, T const &d, T const &e, T const &f)
 max( a, b, c, d, e, f ) More...
 
template<class T >
utility::pointer::shared_ptr< VBWrapper< T > > make_shared_vb_wrapper (T val)
 
template<class T >
void nmers_worker (utility::vector1< T > const &vec, utility::vector1< T > &combination, utility::vector1< utility::vector1< T > > &power_sets, int const offset, int const kk, int const kk_orig)
 Function invoked by nmers_of (and itself) to generate the power sets of a vector of size kk_orig. More...
 
template<class T >
utility::vector1< utility::vector1< T > > nmers_of (utility::vector1< T > const &vec, int const kk)
 Returns all vector of kk-mer vectors made from combinations of the elements of vec. Returns a vector containing only the empty vector if 0-mers are requested (rather than a zero length vector). More...
 
template<class T >
T max (vector1< T > const &input)
 Find the largest value in a vector. More...
 
template<class T >
T max2 (vector1< T > const &input)
 Find the second largest value in a vector. More...
 
template<class T >
T min (vector1< T > const &input)
 Find the smallest value in a vector. More...
 
template<class T >
T min2 (vector1< T > const &input)
 Find the SECOND smallest value in a vector. More...
 
template<class T >
vector1< T >::Size arg_max (vector1< T > const &input)
 find the index of the largest value in a vector More...
 
template<class T >
vector1< T >::Size arg_min (vector1< T > const &input)
 find the index of the smallest value in a vector More...
 
template<class T >
void insert_middle (vector1< T > &vect, typename vector1< T >::Size const position, T const new_value, bool expand)
 
template<class T >
void arg_greatest_several (vector1< T > const &input, vector1< typename vector1< T >::Size > &arg_list)
 Finds indices of the n largest items in input vector, where n is size of the arg_list vector. The indices are reported in decreasing sorted order by the value of the corresponding position in the input vector. If m is the size of the input vector, then this function is O( m n**2) More...
 
template<class T >
void arg_least_several (vector1< T > const &input, vector1< typename vector1< T >::Size > &arg_list)
 Finds indices of the n smallest items in input vector, where n is size of the arg_list vector. The indices are reported in increasing sorted order by the value of the corresponding position in the input vector. If m is the size of the input vector, then this function is O( m n**2) More...
 
template<typename T >
platform::Size binary_search_ranges (utility::vector1< T > const &range_array, T query)
 Find the index into the input range array such that range_array[ index ] <= query < range_array[ index + 1 ] or if index+1 would be off the end of the array, then simply the last index in the array (for which range_array[ index ] <= query holds). Each entry in range_array represents the lower boundry (inclusive) for a range, so that range i is defined by ( range_array[ i ], range_array[i+1] - 1 ) except for the last range, which is from range_array[ range_array.size() ] to infinity. T must be a discrete type. range_array must be sorted. range_array[ 1 ] must be as small as the smallest possible query. More...
 
template<platform::SSize L, typename T >
bool is_finite (utility::vectorL< L, T > const &vect)
 Are any of the values contained in the vector non-finite (NaN, inf) More...
 
template<platform::SSize L, typename T , typename A >
bool operator== (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL == vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator!= (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL != vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator< (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL < vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator<= (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL <= vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator>= (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL >= vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator> (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL > vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator== (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL == std::vector More...
 
template<platform::SSize L, typename T , typename A >
bool operator!= (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL != std::vector More...
 
template<platform::SSize L, typename T , typename A >
bool operator< (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL < std::vector More...
 
template<platform::SSize L, typename T , typename A >
bool operator<= (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL <= std::vector More...
 
template<platform::SSize L, typename T , typename A >
bool operator>= (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL >= std::vector More...
 
template<platform::SSize L, typename T , typename A >
bool operator> (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL > std::vector More...
 
template<platform::SSize L, typename T , typename A >
bool operator== (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector == vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator!= (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector != vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator< (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector < vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator<= (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector <= vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator>= (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector >= vectorL More...
 
template<platform::SSize L, typename T , typename A >
bool operator> (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector > vectorL More...
 
template<platform::SSize L, typename T , typename A >
void swap (vectorL< L, T, A > &a, vectorL< L, T, A > &b)
 swap( vectorL, vectorL ) More...
 
template<platform::SSize L, typename T , typename A >
void swap (vectorL< L, T, A > &a, std::vector< T, A > &b)
 swap( vectorL, std::vector ) More...
 
template<platform::SSize L, typename T , typename A >
void swap (std::vector< T, A > &a, vectorL< L, T, A > &b)
 swap( std::vector, vectorL ) More...
 
template<platform::SSize L, typename A >
bool operator== (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL == vectorL More...
 
template<platform::SSize L, typename A >
bool operator!= (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL != vectorL More...
 
template<platform::SSize L, typename A >
bool operator< (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL < vectorL More...
 
template<platform::SSize L, typename A >
bool operator<= (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL <= vectorL More...
 
template<platform::SSize L, typename A >
bool operator>= (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL >= vectorL More...
 
template<platform::SSize L, typename A >
bool operator> (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL > vectorL More...
 
template<platform::SSize L, typename A >
bool operator== (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL == std::vector More...
 
template<platform::SSize L, typename A >
bool operator!= (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL != std::vector More...
 
template<platform::SSize L, typename A >
bool operator< (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL < std::vector More...
 
template<platform::SSize L, typename A >
bool operator<= (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL <= std::vector More...
 
template<platform::SSize L, typename A >
bool operator>= (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL >= std::vector More...
 
template<platform::SSize L, typename A >
bool operator> (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL > std::vector More...
 
template<platform::SSize L, typename A >
bool operator== (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector == vectorL More...
 
template<platform::SSize L, typename A >
bool operator!= (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector != vectorL More...
 
template<platform::SSize L, typename A >
bool operator< (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector < vectorL More...
 
template<platform::SSize L, typename A >
bool operator<= (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector <= vectorL More...
 
template<platform::SSize L, typename A >
bool operator>= (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector >= vectorL More...
 
template<platform::SSize L, typename A >
bool operator> (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector > vectorL More...
 
template<platform::SSize L, typename A >
void swap (vectorL< L, bool, A > &a, vectorL< L, bool, A > &b)
 swap( vectorL, vectorL ) More...
 
template<platform::SSize L, typename A >
void swap (vectorL< L, bool, A > &a, std::vector< bool, A > &b)
 swap( vectorL, std::vector ) More...
 
template<platform::SSize L, typename A >
void swap (std::vector< bool, A > &a, vectorL< L, bool, A > &b)
 swap( std::vector, vectorL ) More...
 

Variables

static bool show_crash_report_on_console_ = false
 
std::terminate_handler old_terminate_handler_ = nullptr
 
static void(* main_exit_callback )(void) = nullptr
 Place holder for 'end-action' of utility::exit(…) More...
 

Detailed Description

unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 0.

#include <core/conformation/signals/GeneralEvent.hh> – Illegal and unneccessary

STL Headers.

#include <iostream> // debug only

determines all possible rings in a graph.

Project headers.

#include <iosfwd> // debug only

unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 1.

if you have a container of OPs: i.e., typedef std::list< SilentStructOP > SilentStructs; you can now call this function with the SilentStructs container instead of the SilentFileData objects by my_func( DereferenceIterator< SilentStructs >( decoys().begin() ), DereferenceIterator< SilentStructs >( decoys().end() ) );

Author
Oliver Lange

Utility headers

Hanser, Th., Jauffret, Ph., Kaufmann, G., "A New Algorithm for Exhaustive Ring Perception in a Molecular Graph", Laboratoire de Modeles Informatiques Appliques a la Synthese, URA 405 du CNRS, Universite Louis Pasteur, 67000 Strasbourg, France, Received May 15, 1996

Date
02/13/2014

This detects rings in residues!

Author
Steven Combs (steve.nosp@m.n.co.nosp@m.mbs1@.nosp@m.gmai.nosp@m.l.com), Ralf Mueller, Jeff Menden

#include <core/pose/signals/DestructionEvent.hh> – Illegal and unneccessary


Predefined functions for Tracer IO We originally moved them out of name spaces so we can use them right away - without specifying it. Returned to utility namespace, as some compilers did not find the operator otherwise! – rhiju

Typedef Documentation

◆ heapCOP

typedef utility::pointer::shared_ptr< heap const > utility::heapCOP

◆ heapOP

typedef utility::pointer::shared_ptr< heap > utility::heapOP

◆ Inline_File_Provider_HookCOP

typedef utility::pointer::shared_ptr< Inline_File_Provider_Hook const > utility::Inline_File_Provider_HookCOP

◆ Inline_File_Provider_HookOP

typedef utility::pointer::shared_ptr< Inline_File_Provider_Hook > utility::Inline_File_Provider_HookOP

◆ SimulateMPIMessageCOP

typedef utility::pointer::shared_ptr< SimulateMPIMessage const > utility::SimulateMPIMessageCOP

◆ SimulateMPIMessageOP

typedef utility::pointer::shared_ptr< SimulateMPIMessage > utility::SimulateMPIMessageOP

◆ small_vector0

template<typename T , std::size_t BUFFER_SIZE>
using utility::small_vector0 = typedef small_vectorL< T, 0, BUFFER_SIZE >

◆ small_vector1

template<typename T , std::size_t BUFFER_SIZE>
using utility::small_vector1 = typedef small_vectorL< T, 1, BUFFER_SIZE >

◆ StrongReal

template<typename Key >
using utility::StrongReal = typedef StrongT< platform::Real, Key >

◆ StrongSize

template<typename Key >
using utility::StrongSize = typedef StrongT< platform::Size, Key >

◆ subset_mappingCOP

typedef pointer::shared_ptr< subset_mapping const> utility::subset_mappingCOP

◆ subset_mappingOP

typedef pointer::shared_ptr< subset_mapping > utility::subset_mappingOP

◆ UtilityExitCallBack

typedef void(* utility::UtilityExitCallBack) ()

◆ vector0_bool

typedef vector0< bool > utility::vector0_bool

◆ vector0_char

typedef vector0< char > utility::vector0_char

◆ vector0_double

◆ vector0_float

typedef vector0< float > utility::vector0_float

◆ vector0_int

typedef vector0< int > utility::vector0_int

◆ vector0_long

typedef vector0< long int > utility::vector0_long

◆ vector0_longdouble

◆ vector0_schar

typedef vector0< signed char > utility::vector0_schar

◆ vector0_short

typedef vector0< short int > utility::vector0_short

◆ vector0_size

◆ vector0_size_t

◆ vector0_ssize

◆ vector0_ssize_t

◆ vector0_uchar

◆ vector0_uint

◆ vector0_ulong

◆ vector0_ushort

◆ vector1_bool

typedef vector1< bool > utility::vector1_bool

◆ vector1_char

typedef vector1< char > utility::vector1_char

◆ vector1_double

◆ vector1_float

typedef vector1< float > utility::vector1_float

◆ vector1_int

typedef vector1< int > utility::vector1_int

◆ vector1_long

typedef vector1< long int > utility::vector1_long

◆ vector1_longdouble

◆ vector1_schar

typedef vector1< signed char > utility::vector1_schar

◆ vector1_short

typedef vector1< short int > utility::vector1_short

◆ vector1_size

typedef vector1< std::size_t > utility::vector1_size

◆ vector1_size_t

typedef vector1< std::size_t > utility::vector1_size_t

◆ vector1_ssize

◆ vector1_ssize_t

◆ vector1_uchar

◆ vector1_uint

◆ vector1_ulong

◆ vector1_ushort

◆ VirtualBaseCOP

typedef utility::pointer::shared_ptr< VirtualBase const > utility::VirtualBaseCOP

◆ VirtualBaseOP

typedef utility::pointer::shared_ptr< VirtualBase > utility::VirtualBaseOP

Enumeration Type Documentation

◆ DateFormat

Enumeration of acceptable date formats.

Enumerator
PDB_FORMAT 

◆ simulate_mpi_message_type

@detail This is for unit testing mpi code in a single processor. The idea is to buffer the messages in the SimulateMPIData stored in the SimulateMPI. To use this class, call initialize_simulation( nprocs ), then set the mpi rank can be set manually, and the functions in mpi_util are usable. By setting the mpi_rank to a different processor, other messages can be sent and received. See test/utility/simulate_mpi.cxxtest for examples.

Enumerator
smpi_char 
smpi_integer 
smpi_size 
smpi_string 
smpi_double 
smpi_integers 
smpi_sizes 
smpi_doubles 

Function Documentation

◆ add_exit_callback()

void utility::add_exit_callback ( UtilityExitCallBack  cb)

Add additional callback function that will be called before standard exit(…) is executed. [Note: do not confuse this function with 'set_main_exit_callback' which is replacing the end behavior of exit(…)].

References get_all_exit_callbacks().

◆ ALPHANUMERICS()

static std::string const utility::ALPHANUMERICS ( LETTERS NUMERALS)
static

◆ APPNAME()

static std::string utility::APPNAME ( "UNKNOWN APPLICATION"  )
static

◆ arg_greatest_several()

template<class T >
void utility::arg_greatest_several ( vector1< T > const &  input,
vector1< typename vector1< T >::Size > &  arg_list 
)

Finds indices of the n largest items in input vector, where n is size of the arg_list vector. The indices are reported in decreasing sorted order by the value of the corresponding position in the input vector. If m is the size of the input vector, then this function is O( m n**2)

If arg_list has more entries than input, then it is resized at the end of this function to have as many entries as the input.

References create_a3b_hbs::ii, gaussian-sampling::input, insert_middle(), beta_nonlocal::jj, and kmeans_adaptive_kernel_density_bb_dependent_rotlib::n.

Referenced by analyze_poses_for_convergence(), and main().

◆ arg_least_several()

template<class T >
void utility::arg_least_several ( vector1< T > const &  input,
vector1< typename vector1< T >::Size > &  arg_list 
)

Finds indices of the n smallest items in input vector, where n is size of the arg_list vector. The indices are reported in increasing sorted order by the value of the corresponding position in the input vector. If m is the size of the input vector, then this function is O( m n**2)

If arg_list has more entries than input, then it is resized at the end of this function to have as many entries as the input.

References create_a3b_hbs::ii, gaussian-sampling::input, insert_middle(), beta_nonlocal::jj, and kmeans_adaptive_kernel_density_bb_dependent_rotlib::n.

Referenced by main().

◆ arg_max()

template<class T >
vector1< T >::Size utility::arg_max ( vector1< T > const &  input)

find the index of the largest value in a vector

class T must provide an operator < () and operator = (). Error if input.size() == 0

References debug_assert, create_a3b_hbs::ii, and gaussian-sampling::input.

Referenced by MetalSiteFinderMover::apply(), main(), and numeric::linear_algebra::minimum_bounding_ellipse().

◆ arg_min()

template<class T >
vector1< T >::Size utility::arg_min ( vector1< T > const &  input)

find the index of the smallest value in a vector

class T must provide an operator < () and operator = (). Error if input.size() == 0

References debug_assert, create_a3b_hbs::ii, and gaussian-sampling::input.

Referenced by MetalSiteFinderMover::apply(), main(), and numeric::geometry::vector_normal_to_ring_plane_of_best_fit().

◆ argmax() [1/2]

template<typename T >
int utility::argmax ( const std::vector< T > &  iterable)

Returns the argument whose value is maximal according to operator>.

Adheres to STL numbering (0-indexed).

Referenced by MPDomainAssembly::apply().

◆ argmax() [2/2]

template<typename T >
int utility::argmax ( const utility::vector1< T > &  iterable)

Returns the argument whose value is maximal according to operator>.

Adheres to Rosetta numbering (1-indexed).

◆ argmin() [1/2]

template<typename T >
int utility::argmin ( const std::vector< T > &  iterable)

Returns the argument whose value is minimal according to operator<.

Adheres to STL numbering (0-indexed).

Referenced by main().

◆ argmin() [2/2]

template<typename T >
int utility::argmin ( const utility::vector1< T > &  iterable)

Returns the argument whose value is minimal according to operator<.

Adheres to Rosetta numbering (1-indexed).

◆ argsort()

template<platform::SSize L, typename T >
utility::vector1< platform::Size > utility::argsort ( utility::vectorL< L, T > const &  v)

◆ binary_search_ranges()

template<typename T >
platform::Size utility::binary_search_ranges ( utility::vector1< T > const &  range_array,
T  query 
)

Find the index into the input range array such that range_array[ index ] <= query < range_array[ index + 1 ] or if index+1 would be off the end of the array, then simply the last index in the array (for which range_array[ index ] <= query holds). Each entry in range_array represents the lower boundry (inclusive) for a range, so that range i is defined by ( range_array[ i ], range_array[i+1] - 1 ) except for the last range, which is from range_array[ range_array.size() ] to infinity. T must be a discrete type. range_array must be sorted. range_array[ 1 ] must be as small as the smallest possible query.

References lower(), cache_trajectory::query, and upper().

◆ code_from_6bit()

unsigned char utility::code_from_6bit ( unsigned char  _8bit)
inline

Referenced by decode_32_to_24().

◆ code_to_6bit()

unsigned char utility::code_to_6bit ( unsigned char  _6bit)
inline

uuencode

Referenced by encode_24_to_32().

◆ cond_exit()

int utility::cond_exit ( bool  condition,
char const *  file,
int const  line,
std::string const &  message,
int const  status 
)

Conditional Exit with file + line + message + optional status.

Conditional Exit with file + line + message + optional status. WIll exit if the condition is not met!

References exit(), evaluate_beta_mutants::file, line, and pyrosetta.utility.array::message.

◆ contains()

bool utility::contains ( std::string const &  haystack,
std::string const &  needle 
)

Does the string contain the other string? This is purely convenience as I hate the C++ syntax to do this.

References make_symmdef_file_denovo::pos.

Referenced by lactamize::find_lactams(), SphereGrinder(), and test_Vec().

◆ copy_to_cstr_buffer()

void utility::copy_to_cstr_buffer ( std::string const &  str,
char *  buffer,
platform::Size  buffer_length 
)

Copy the contents of a string to a given C-style string buffer (with the given maximum length) The output will be truncated if greater than length, and null terminator will be added.

To be clear, this is only to be used for limited situations. Avoiding c-style strings is preferred.

References str().

Referenced by interface_residue_ddg(), and is_interface_residue().

◆ copysign()

platform::Real utility::copysign ( platform::Real const &  x,
platform::Real const &  y 
)
inline

◆ CRASH_FILE()

static std::string const utility::CRASH_FILE ( "ROSETTA_CRASH.log"  )
static

◆ CSI_bgBlack()

CSI_Sequence utility::CSI_bgBlack ( )
inline

References utility::CSI::bgBlack.

◆ CSI_bgBlue()

CSI_Sequence utility::CSI_bgBlue ( )
inline

References utility::CSI::bgBlue.

Referenced by main(), and ui::network::B::run().

◆ CSI_bgCyan()

CSI_Sequence utility::CSI_bgCyan ( )
inline

References utility::CSI::bgCyan.

◆ CSI_bgDefault()

CSI_Sequence utility::CSI_bgDefault ( )
inline

◆ CSI_bgGreen()

CSI_Sequence utility::CSI_bgGreen ( )
inline

References utility::CSI::bgGreen.

Referenced by ui::network::B::run().

◆ CSI_bgMagenta()

CSI_Sequence utility::CSI_bgMagenta ( )
inline

◆ CSI_bgRed()

CSI_Sequence utility::CSI_bgRed ( )
inline

References utility::CSI::bgRed.

Referenced by ui::network::B::run().

◆ CSI_bgWhite()

CSI_Sequence utility::CSI_bgWhite ( )
inline

References utility::CSI::bgWhite.

◆ CSI_bgYellow()

CSI_Sequence utility::CSI_bgYellow ( )
inline

◆ CSI_Black()

CSI_Sequence utility::CSI_Black ( )
inline

References utility::CSI::Black.

Referenced by ui::network::B::run().

◆ CSI_Blue()

CSI_Sequence utility::CSI_Blue ( )
inline

References utility::CSI::Blue.

◆ CSI_Bold()

CSI_Sequence utility::CSI_Bold ( )
inline

◆ CSI_Cyan()

CSI_Sequence utility::CSI_Cyan ( )
inline

References utility::CSI::Cyan.

◆ CSI_Default()

CSI_Sequence utility::CSI_Default ( )
inline

References utility::CSI::Default.

◆ CSI_Green()

CSI_Sequence utility::CSI_Green ( )
inline

References utility::CSI::Green.

Referenced by main().

◆ CSI_Magenta()

CSI_Sequence utility::CSI_Magenta ( )
inline

◆ CSI_Nothing()

CSI_Sequence utility::CSI_Nothing ( )
inline

Functions to return CSI_Seqeunce objects. These are not static constants, due to the static initilization order fiasco.

References utility::CSI::Nothing.

Referenced by basic::TracerImpl::TracerImpl().

◆ CSI_Red()

CSI_Sequence utility::CSI_Red ( )
inline

◆ CSI_Reset()

CSI_Sequence utility::CSI_Reset ( )
inline

◆ CSI_Underline()

CSI_Sequence utility::CSI_Underline ( )
inline

◆ CSI_White()

CSI_Sequence utility::CSI_White ( )
inline

References utility::CSI::White.

◆ CSI_Yellow()

CSI_Sequence utility::CSI_Yellow ( )
inline

References utility::CSI::Yellow.

Referenced by main().

◆ decode6bit()

platform::Size utility::decode6bit ( unsigned char *  memory,
std::string const &  jar,
platform::Size const  maxbytes 
)

Given 3*N bytes of memory to fill, and a string containing 4*N characters, decode the characters (interpreting 4 bytes of ASCII text as 3 binary bytes) and populate the block of memory.

Parameters
[in]memoryA pointer to the first byte of memory to fill. It is assumed that we're filling a contiguous block of memory.
[in]jarThe string containing the characters that will be decoded and converted to bytes.
[in]maxbytesThe maximum number of bytes to put into the memory pointed to by the "memory" pointer. (i.e. The size of the array that we're filling).
Note
Assumes memory already allocated!!! There is no direct check for vector overflows, since this function has no knowlege of what it is that it's filling (or how big the object is). The function relies on maxbytes to prevent overflows.
Returns
The number of bytes filled.
Author
Originally author unknown. Revised in 2021 by Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.iron.nosp@m.insti.nosp@m.tute.nosp@m..org).

References decode_32_to_24(), create_a3b_hbs::i, and min().

◆ decode_32_to_24()

void utility::decode_32_to_24 ( unsigned char  i0,
unsigned char  i1,
unsigned char  i2,
unsigned char  i3,
unsigned char *  o0,
unsigned short  goodbytes 
)
inline

References code_from_6bit().

Referenced by decode6bit().

◆ down_cast() [1/2]

template<class Target , class Source >
Target utility::down_cast ( Source &  s)
inline

Fast assert-checked polymorphic down-cast: reference argument.

Note
Usage: down_cast< Type & > where Type can be const-qualified
For down-casting when you know the cast is valid
Can't use for hierarchies with virtual base classes
Assert intentionally won't compile if a virtual base class is present

References debug_assert, and docking::s.

Referenced by utility::options::OptionCollection::operator()(), and utility::options::OptionCollection::operator[]().

◆ down_cast() [2/2]

template<class Target , class Source >
Target utility::down_cast ( Source *  p)
inline

Fast assert-checked polymorphic down-cast: pointer argument.

Note
Usage: down_cast< Type * > where Type can be const-qualified
For down-casting when you know the cast is valid
Can't use for hierarchies with virtual base classes
Assert intentionally won't compile if a virtual base class is present

References debug_assert, and kmeans_adaptive_kernel_density_bb_dependent_rotlib::p.

◆ encode6bit()

void utility::encode6bit ( const unsigned char *  memory,
unsigned int  length,
std::string &  jar 
)

Given a block of memory (with memory pointing to the first byte) and a byte count (length), convert every three bytes of memory into four bytes of ASCII characters, and populate the string (jar) with those characters.

Note that decode6bit requires the length of the memory block into which the contents of jar will be extracted, so the length of the memory location here should be stored somehow if one hopes to accurately reproduce the bytes stored.

References encode_24_to_32(), create_a3b_hbs::i, oop_conformations::length, and PREcst::linewidth.

◆ encode_24_to_32()

void utility::encode_24_to_32 ( unsigned char  i0,
unsigned char  i1,
unsigned char  i2,
unsigned char &  o0,
unsigned char &  o1,
unsigned char &  o2,
unsigned char &  o3 
)
inline

References code_to_6bit().

Referenced by encode6bit().

◆ endswith()

bool utility::endswith ( std::string const &  haystack,
std::string const &  needle 
)

True iff haystack ends with needle.

◆ enumerate1()

SimpleRange1 utility::enumerate1 ( platform::Size const  max_inclusive)
inline

iterate from [1, max_inclusive]

USAGE: for( platform::Size const index : enumerate1( vec.size() ) )

Referenced by indices1().

◆ exit() [1/3]

void utility::exit ( char const *  file,
int const  line,
int const  status = 1 
)
inline

Exit with file + line + optional status.

References exit(), evaluate_beta_mutants::file, and line.

◆ exit() [2/3]

NORETURN_ATTR void utility::exit ( char const *  file,
int const  line,
std::string const &  message,
int const   
)

◆ exit() [3/3]

void utility::exit ( int const  status,
char const *  file,
int const  line 
)
inline

Exit with file + line + status.

Note
Deprecated: For backwards compatibility with earlier version

References exit(), evaluate_beta_mutants::file, and line.

◆ exit_handler()

void utility::exit_handler ( char const *  file,
int const  line,
std::string const &  message 
)

◆ exit_with_user_fixable_issue()

NORETURN_ATTR void utility::exit_with_user_fixable_issue ( char const *  file,
int  line,
std::string const &  message 
)

Exit in cases where there's a clear issue the user can fix.

References exit_handler(), evaluate_beta_mutants::file, line, and pyrosetta.utility.array::message.

◆ file_basename()

std::string utility::file_basename ( const std::string &  full_path)

◆ file_contents()

std::string utility::file_contents ( std::string const &  file_name)

◆ filename()

std::string utility::filename ( const std::string &  path)

◆ find_closest()

template<typename BidirectionalIterator , typename T >
BidirectionalIterator utility::find_closest ( BidirectionalIterator  first,
BidirectionalIterator  last,
const T value 
)

Returns an iterator on the sorted range [first, last) nearest to value. If value is equidistant between adjacent elements, the lesser is returned.

References create_a3b_hbs::first, and value.

◆ fmt_real()

std::string utility::fmt_real ( platform::Real  num,
platform::Size  pad_left_n,
std::size_t const  decimal_places 
)

@breif convert a Real to a string, padding left with spaces until total number of char on left is equal to pad_lef_n

References pad_left(), Real2string(), and docking::s.

◆ fractional_rank()

template<platform::SSize L, typename T >
utility::vector1< platform::Real > utility::fractional_rank ( utility::vectorL< L, T > const &  v)

◆ from_string()

template<class T >
T const utility::from_string ( std::string const &  s,
T   
)
inline

◆ get_all_exit_callbacks()

std::vector< UtilityExitCallBack >& utility::get_all_exit_callbacks ( )

Array to hold all additional exit-callbacks.

Referenced by add_exit_callback(), exit_handler(), and remove_exit_callback().

◆ get_current_date()

std::string utility::get_current_date ( DateFormat const  format)

◆ get_num_digits()

platform::Size utility::get_num_digits ( platform::Size  value)

References value.

◆ get_resnum_and_chain()

std::tuple< utility::vector1< int >, utility::vector1< char >, utility::vector1< std::string > > utility::get_resnum_and_chain ( std::string const &  s)

for those who have a legacy interface that can't touch segids.

converts string like "1-3 20-22" or "A:1-5 B:20-22" to vectors containing resnums and chains.

References get_resnum_and_chain_and_segid(), and docking::s.

Referenced by my_main().

◆ get_resnum_and_chain_and_segid()

std::tuple< utility::vector1< int >, utility::vector1< char >, utility::vector1< std::string > > utility::get_resnum_and_chain_and_segid ( std::string const &  s,
bool &  string_is_ok 
)

◆ get_resnum_and_chain_from_one_tag()

bool utility::get_resnum_and_chain_from_one_tag ( std::string const &  tag,
utility::vector1< int > &  resnum,
utility::vector1< char > &  chains,
utility::vector1< std::string > &  segids 
)

◆ get_resnum_and_segid()

std::pair< std::vector< int >, std::vector< std::string > > utility::get_resnum_and_segid ( std::string const &  s,
bool &  string_is_ok 
)

converts string like "1-3 20-22" or "A:1-5 B:20-22" to vectors containing resnums and chains.

References get_resnum_and_segid_from_one_tag(), kmeans_adaptive_kernel_density_bb_dependent_rotlib::n, replace_in(), predPRE::resnum, docking::s, tag, and extract_by_sidechain_sasa_score::tags.

◆ get_resnum_and_segid_from_one_tag()

bool utility::get_resnum_and_segid_from_one_tag ( std::string const &  tag,
std::vector< int > &  resnum,
std::vector< std::string > &  segids 
)

◆ get_undefined_real()

platform::Real utility::get_undefined_real ( )
inline

Get a numeric value for Real that represents an "undefined" value.

References max().

Referenced by initialize_atoms(), is_undefined(), and string2Real().

◆ get_undefined_size()

platform::Size utility::get_undefined_size ( )
inline

Get a numeric value for Size that represents an "undefined" value.

References max().

Referenced by initialize_elements(), is_undefined(), and string2Size().

◆ HEADER()

static std::string const utility::HEADER ( "##############################################################################################################\n" "#\n" "# Rosetta crash log. Please submit the contents of this file to http://crash.rosettacommons.org/\n" "# or use the script Rosetta/main/source/scripts/python/public/report_crashes.py\n" "#\n\n"  )
static

◆ indices1()

template<typename T >
SimpleRange1 utility::indices1 ( utility::vector1< T > const &  v)
inline

iterate from [1, c.size()]

USAGE: for( platform::Size const index : indices1( vec1 ) )

References enumerate1(), and kmeans_adaptive_kernel_density_bb_dependent_rotlib::v.

◆ insert_middle()

template<class T >
void utility::insert_middle ( vector1< T > &  vect,
typename vector1< T >::Size const  position,
T const  new_value,
bool  expand 
)

◆ install_crash_handler()

void utility::install_crash_handler ( )

Set the crash handler for non-standard crashes (e.g. segfaults) Should only be called once at startup.

References old_terminate_handler_, signal_handler(), and terminate_handler().

◆ is_false_string()

bool utility::is_false_string ( std::string const &  value_str)

◆ is_finite()

template<platform::SSize L, typename T >
bool utility::is_finite ( utility::vectorL< L, T > const &  vect)

Are any of the values contained in the vector non-finite (NaN, inf)

References isfinite(), and kmeans_adaptive_kernel_density_bb_dependent_rotlib::v.

◆ is_string_numeric()

bool utility::is_string_numeric ( std::string const &  input)

◆ is_true_string()

bool utility::is_true_string ( std::string const &  value_str)

◆ is_undefined() [1/2]

bool utility::is_undefined ( platform::Real const &  val)
inline

Check if a Real is undefined (i.e has the same value as utility::get_undefined_real() )

References get_undefined_real(), isinf(), and isnan().

◆ is_undefined() [2/2]

bool utility::is_undefined ( platform::Size const &  val)
inline

Check if a Size is undefined (i.e has the same value as utility::get_undefined_size() )

References get_undefined_size().

◆ isfinite()

bool utility::isfinite ( platform::Real const &  val)
inline

◆ isinf()

bool utility::isinf ( platform::Real const &  val)
inline

◆ isnan()

bool utility::isnan ( platform::Real const &  val)
inline

◆ join() [1/4]

std::string utility::join ( std::vector< std::string > const &  s,
std::string const &  connector 
)

combine strings with anything

References begin, and docking::s.

◆ join() [2/4]

std::string utility::join ( utility::vector1< std::string > const &  s,
std::string const &  connector 
)

◆ join() [3/4]

template<class T >
std::string utility::join ( utility::vector1< T > const &  vector,
std::string const &  connector 
)

combine vector with anything

References begin.

◆ join() [4/4]

template<platform::SSize L>
std::string utility::join ( vectorL< L, std::string > const &  s,
std::string const &  connector 
)

Join vector of strings in to single string.

References begin, and docking::s.

◆ LETTERS()

static std::string const utility::LETTERS ( UPPERCASE_LETTERS LOWERCASE_LETTERS)
static

Referenced by superimpose_A_to_all().

◆ lower()

std::string utility::lower ( std::string const &  s)

◆ LOWERCASE_ALPHANUMERICS()

static std::string const utility::LOWERCASE_ALPHANUMERICS ( LOWERCASE_LETTERS NUMERALS)
static

◆ LOWERCASE_LETTERS()

static std::string const utility::LOWERCASE_LETTERS ( "abcdefghijklmnopqrstuvwxyz"  )
static

◆ ltrim()

void utility::ltrim ( std::string &  s,
const std::string &  drop 
)

Remove any characters in "drop" from the front of the string.

References docking::s.

Referenced by trim().

◆ make_segtag_with_dashes()

std::string utility::make_segtag_with_dashes ( utility::vector1< int >  res_vector,
utility::vector1< std::string >  segid_vector,
char const  delimiter 
)

◆ make_shared_vb_wrapper()

template<class T >
utility::pointer::shared_ptr<VBWrapper<T> > utility::make_shared_vb_wrapper ( T  val)

◆ make_tag()

std::string utility::make_tag ( utility::vector1< int >  res_vector)

◆ make_tag_with_dashes() [1/2]

std::string utility::make_tag_with_dashes ( utility::vector1< int >  res_vector,
char const  delimiter 
)

Compactifies vectors of ints: 1 2 3 9 10 11 to "1-3 9-11".

References chains, and kmeans_adaptive_kernel_density_bb_dependent_rotlib::n.

◆ make_tag_with_dashes() [2/2]

std::string utility::make_tag_with_dashes ( utility::vector1< int >  res_vector,
utility::vector1< char >  chain_vector,
utility::vector1< std::string >  segid_vector,
char const  delimiter 
)

◆ map_merge()

template<class K , class V >
void utility::map_merge ( std::map< K, V > &  destination_map,
std::map< K, V > const &  source_map 
)

Append the second map to the first For one-liner convenience (esp. for map return values.)

In C++17 this is std::map::merge(), but until then ...

◆ max() [1/14]

double utility::max ( double const  a,
double const  b 
)
inline

◆ max() [2/14]

float utility::max ( float const  a,
float const  b 
)
inline

◆ max() [3/14]

int utility::max ( int const  a,
int const  b 
)
inline

◆ max() [4/14]

long double utility::max ( long double const  a,
long double const  b 
)
inline

◆ max() [5/14]

long int utility::max ( long int const  a,
long int const  b 
)
inline

◆ max() [6/14]

short int utility::max ( short int const  a,
short int const  b 
)
inline

◆ max() [7/14]

template<typename T >
T const& utility::max ( T const &  a,
T const &  b,
T const &  c 
)
inline

◆ max() [8/14]

template<typename T >
T const& utility::max ( T const &  a,
T const &  b,
T const &  c,
T const &  d 
)
inline

◆ max() [9/14]

template<typename T >
T const& utility::max ( T const &  a,
T const &  b,
T const &  c,
T const &  d,
T const &  e 
)
inline

◆ max() [10/14]

template<typename T >
T const& utility::max ( T const &  a,
T const &  b,
T const &  c,
T const &  d,
T const &  e,
T const &  f 
)
inline

◆ max() [11/14]

unsigned int utility::max ( unsigned int const  a,
unsigned int const  b 
)
inline

◆ max() [12/14]

unsigned long int utility::max ( unsigned long int const  a,
unsigned long int const  b 
)
inline

◆ max() [13/14]

unsigned short int utility::max ( unsigned short int const  a,
unsigned short int const  b 
)
inline

◆ max() [14/14]

template<class T >
T utility::max ( vector1< T > const &  input)

Find the largest value in a vector.

class T must provide an operator < () and operator = (). Error if input.size() == 0

References debug_assert, create_a3b_hbs::ii, and gaussian-sampling::input.

◆ max2()

template<class T >
T utility::max2 ( vector1< T > const &  input)

Find the second largest value in a vector.

class T must provide an operator < () and operator = (). Error if input.size() == 0

References debug_assert, create_a3b_hbs::ii, and gaussian-sampling::input.

◆ min() [1/14]

double utility::min ( double const  a,
double const  b 
)
inline

◆ min() [2/14]

float utility::min ( float const  a,
float const  b 
)
inline

◆ min() [3/14]

int utility::min ( int const  a,
int const  b 
)
inline

◆ min() [4/14]

long double utility::min ( long double const  a,
long double const  b 
)
inline

◆ min() [5/14]

long int utility::min ( long int const  a,
long int const  b 
)
inline

◆ min() [6/14]

short int utility::min ( short int const  a,
short int const  b 
)
inline

◆ min() [7/14]

template<typename T >
T const& utility::min ( T const &  a,
T const &  b,
T const &  c 
)
inline

◆ min() [8/14]

template<typename T >
T const& utility::min ( T const &  a,
T const &  b,
T const &  c,
T const &  d 
)
inline

◆ min() [9/14]

template<typename T >
T const& utility::min ( T const &  a,
T const &  b,
T const &  c,
T const &  d,
T const &  e 
)
inline

◆ min() [10/14]

template<typename T >
T const& utility::min ( T const &  a,
T const &  b,
T const &  c,
T const &  d,
T const &  e,
T const &  f 
)
inline

◆ min() [11/14]

unsigned int utility::min ( unsigned int const  a,
unsigned int const  b 
)
inline

◆ min() [12/14]

unsigned long int utility::min ( unsigned long int const  a,
unsigned long int const  b 
)
inline

◆ min() [13/14]

unsigned short int utility::min ( unsigned short int const  a,
unsigned short int const  b 
)
inline

◆ min() [14/14]

template<class T >
T utility::min ( vector1< T > const &  input)

Find the smallest value in a vector.

class T must provide an operator < () and operator = (). Error if input.size() == 0

References debug_assert, create_a3b_hbs::ii, and gaussian-sampling::input.

◆ min2()

template<class T >
T utility::min2 ( vector1< T > const &  input)

Find the SECOND smallest value in a vector.

class T must provide an operator < () and operator = (). Error if input.size() == 0

References debug_assert, create_a3b_hbs::ii, and gaussian-sampling::input.

◆ modulo()

platform::Size utility::modulo ( int const &  a,
int const &  b 
)
inline

modulo of an input integer a (can be negative) with respect to unsigned integer b

Most folks use C's "a % b" operator but it gives funny behavior for negative a. This version came out of stack overflow.

References a, ObjexxFCL::abs(), and compute_difference::b.

Referenced by numeric::interpolation::get_val().

◆ mpi_nprocs()

int utility::mpi_nprocs ( )

◆ mpi_rank()

int utility::mpi_rank ( )

◆ msg_name()

std::string utility::msg_name ( simulate_mpi_message_type  msg_type)

◆ nmers_of()

template<class T >
utility::vector1< utility::vector1< T > > utility::nmers_of ( utility::vector1< T > const &  vec,
int const  kk 
)

Returns all vector of kk-mer vectors made from combinations of the elements of vec. Returns a vector containing only the empty vector if 0-mers are requested (rather than a zero length vector).

References kk, nmers_worker(), and vec().

◆ nmers_worker()

template<class T >
void utility::nmers_worker ( utility::vector1< T > const &  vec,
utility::vector1< T > &  combination,
utility::vector1< utility::vector1< T > > &  power_sets,
int const  offset,
int const  kk,
int const  kk_orig 
)

Function invoked by nmers_of (and itself) to generate the power sets of a vector of size kk_orig.

References create_a3b_hbs::ii, enumerate_junctions::int, kk, offset, and vec().

Referenced by nmers_of().

◆ NUMERALS()

static std::string const utility::NUMERALS ( "0123456789"  )
static

◆ operator!=() [1/8]

template<typename B >
bool utility::operator!= ( BitSet< B > const &  a,
BitSet< B > const &  b 
)

◆ operator!=() [2/8]

template<typename B >
bool utility::operator!= ( BitVector< B > const &  a,
BitVector< B > const &  b 
)

◆ operator!=() [3/8]

template<platform::SSize L, typename A >
bool utility::operator!= ( std::vector< bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

std::vector != vectorL

◆ operator!=() [4/8]

template<platform::SSize L, typename T , typename A >
bool utility::operator!= ( std::vector< T, A > const &  a,
vectorL< L, T, A > const &  b 
)

std::vector != vectorL

◆ operator!=() [5/8]

template<platform::SSize L, typename A >
bool utility::operator!= ( vectorL< L, bool, A > const &  a,
std::vector< bool, A > const &  b 
)

vectorL != std::vector

◆ operator!=() [6/8]

template<platform::SSize L, typename A >
bool utility::operator!= ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

◆ operator!=() [7/8]

template<platform::SSize L, typename T , typename A >
bool utility::operator!= ( vectorL< L, T, A > const &  a,
std::vector< T, A > const &  b 
)

vectorL != std::vector

◆ operator!=() [8/8]

template<platform::SSize L, typename T , typename A >
bool utility::operator!= ( vectorL< L, T, A > const &  a,
vectorL< L, T, A > const &  b 
)

◆ operator+() [1/2]

template<typename B >
BitSet< B > utility::operator+ ( BitSet< B > const &  a,
BitSet< B > const &  b 
)

BitSet + BitSet: Union.

◆ operator+() [2/2]

template<typename B >
BitVector< B > utility::operator+ ( BitVector< B > const &  a,
BitVector< B > const &  b 
)

BitVector + BitVector: Union.

◆ operator-() [1/2]

template<typename B >
BitSet< B > utility::operator- ( BitSet< B > const &  a,
BitSet< B > const &  b 
)

BitSet - BitSet: Difference.

◆ operator-() [2/2]

template<typename B >
BitVector< B > utility::operator- ( BitVector< B > const &  a,
BitVector< B > const &  b 
)

BitVector - BitVector: Difference.

◆ operator<() [1/6]

template<platform::SSize L, typename A >
bool utility::operator< ( std::vector< bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

std::vector < vectorL

◆ operator<() [2/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator< ( std::vector< T, A > const &  a,
vectorL< L, T, A > const &  b 
)

std::vector < vectorL

◆ operator<() [3/6]

template<platform::SSize L, typename A >
bool utility::operator< ( vectorL< L, bool, A > const &  a,
std::vector< bool, A > const &  b 
)

vectorL < std::vector

◆ operator<() [4/6]

template<platform::SSize L, typename A >
bool utility::operator< ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

◆ operator<() [5/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator< ( vectorL< L, T, A > const &  a,
std::vector< T, A > const &  b 
)

vectorL < std::vector

◆ operator<() [6/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator< ( vectorL< L, T, A > const &  a,
vectorL< L, T, A > const &  b 
)

◆ operator<<() [1/2]

template<class T , platform::Size S>
std::ostream& utility::operator<< ( std::ostream &  os,
utility::fixedsizearray1< T, S > const &  v 
)

◆ operator<<() [2/2]

template<platform::SSize L, class T , typename std::enable_if< utility::type_traits::has_insertion_operator_s< T >::value >::type * = nullptr>
std::ostream & utility::operator<< ( std::ostream &  os,
utility::vectorL< L, T > const &  v 
)

◆ operator<=() [1/6]

template<platform::SSize L, typename A >
bool utility::operator<= ( std::vector< bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

std::vector <= vectorL

◆ operator<=() [2/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator<= ( std::vector< T, A > const &  a,
vectorL< L, T, A > const &  b 
)

std::vector <= vectorL

◆ operator<=() [3/6]

template<platform::SSize L, typename A >
bool utility::operator<= ( vectorL< L, bool, A > const &  a,
std::vector< bool, A > const &  b 
)

vectorL <= std::vector

◆ operator<=() [4/6]

template<platform::SSize L, typename A >
bool utility::operator<= ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

◆ operator<=() [5/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator<= ( vectorL< L, T, A > const &  a,
std::vector< T, A > const &  b 
)

vectorL <= std::vector

◆ operator<=() [6/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator<= ( vectorL< L, T, A > const &  a,
vectorL< L, T, A > const &  b 
)

◆ operator==() [1/9]

template<typename B >
bool utility::operator== ( BitSet< B > const &  a,
BitSet< B > const &  b 
)

◆ operator==() [2/9]

template<typename B >
bool utility::operator== ( BitVector< B > const &  a,
BitVector< B > const &  b 
)

◆ operator==() [3/9]

bool utility::operator== ( history_queue_struct const &  a,
history_queue_struct const &  b 
)
inline

References a, and compute_difference::b.

◆ operator==() [4/9]

template<platform::SSize L, typename A >
bool utility::operator== ( std::vector< bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

std::vector == vectorL

◆ operator==() [5/9]

template<platform::SSize L, typename T , typename A >
bool utility::operator== ( std::vector< T, A > const &  a,
vectorL< L, T, A > const &  b 
)

std::vector == vectorL

◆ operator==() [6/9]

template<platform::SSize L, typename A >
bool utility::operator== ( vectorL< L, bool, A > const &  a,
std::vector< bool, A > const &  b 
)

vectorL == std::vector

◆ operator==() [7/9]

template<platform::SSize L, typename A >
bool utility::operator== ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

◆ operator==() [8/9]

template<platform::SSize L, typename T , typename A >
bool utility::operator== ( vectorL< L, T, A > const &  a,
std::vector< T, A > const &  b 
)

vectorL == std::vector

◆ operator==() [9/9]

template<platform::SSize L, typename T , typename A >
bool utility::operator== ( vectorL< L, T, A > const &  a,
vectorL< L, T, A > const &  b 
)

◆ operator>() [1/6]

template<platform::SSize L, typename A >
bool utility::operator> ( std::vector< bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

std::vector > vectorL

◆ operator>() [2/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator> ( std::vector< T, A > const &  a,
vectorL< L, T, A > const &  b 
)

std::vector > vectorL

◆ operator>() [3/6]

template<platform::SSize L, typename A >
bool utility::operator> ( vectorL< L, bool, A > const &  a,
std::vector< bool, A > const &  b 
)

vectorL > std::vector

◆ operator>() [4/6]

template<platform::SSize L, typename A >
bool utility::operator> ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

◆ operator>() [5/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator> ( vectorL< L, T, A > const &  a,
std::vector< T, A > const &  b 
)

vectorL > std::vector

◆ operator>() [6/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator> ( vectorL< L, T, A > const &  a,
vectorL< L, T, A > const &  b 
)

◆ operator>=() [1/6]

template<platform::SSize L, typename A >
bool utility::operator>= ( std::vector< bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

std::vector >= vectorL

◆ operator>=() [2/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator>= ( std::vector< T, A > const &  a,
vectorL< L, T, A > const &  b 
)

std::vector >= vectorL

◆ operator>=() [3/6]

template<platform::SSize L, typename A >
bool utility::operator>= ( vectorL< L, bool, A > const &  a,
std::vector< bool, A > const &  b 
)

vectorL >= std::vector

◆ operator>=() [4/6]

template<platform::SSize L, typename A >
bool utility::operator>= ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

◆ operator>=() [5/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator>= ( vectorL< L, T, A > const &  a,
std::vector< T, A > const &  b 
)

vectorL >= std::vector

◆ operator>=() [6/6]

template<platform::SSize L, typename T , typename A >
bool utility::operator>= ( vectorL< L, T, A > const &  a,
vectorL< L, T, A > const &  b 
)

◆ operator|() [1/2]

template<typename B >
BitSet< B > utility::operator| ( BitSet< B > const &  a,
BitSet< B > const &  b 
)

BitSet | BitSet: Union.

◆ operator|() [2/2]

template<typename B >
BitVector< B > utility::operator| ( BitVector< B > const &  a,
BitVector< B > const &  b 
)

BitVector | BitVector: Union.

◆ OPTIONS()

static std::string utility::OPTIONS ( "NO OPTIONS SPECIFIED"  )
static

◆ pad_atom_name()

std::string utility::pad_atom_name ( std::string const &  s)

Pad an atom name to the pdb format.

References CREATE_EXCEPTION, and docking::s.

◆ pad_left() [1/2]

template<class T >
std::string utility::pad_left ( const T t,
platform::Size const  newlen,
char  pad_width = ' ' 
)

Add char to the left of the string.

References pad_left(), docking::s, predPRE::t, and to_string().

◆ pad_left() [2/2]

std::string utility::pad_left ( std::string const &  s,
platform::Size const  newlen,
char  pad_with 
)

Add char to the left of the string.

References basic::options::OptionKeys::ufv::right, and docking::s.

Referenced by fmt_real(), and pad_left().

◆ pad_right() [1/2]

template<class T >
std::string utility::pad_right ( const T t,
platform::Size const  newlen,
char  pad_width = ' ' 
)

Add char to the right of a string.

References pad_right(), docking::s, predPRE::t, and to_string().

◆ pad_right() [2/2]

std::string utility::pad_right ( std::string const &  s,
platform::Size const  newlen,
char  pad_with 
)

Add char to the right of a string.

References basic::options::OptionKeys::ufv::left, and docking::s.

Referenced by main(), and pad_right().

◆ parse_boolean()

bool utility::parse_boolean ( std::stringstream &  stream,
std::string const &  errmsg 
)

Given a stringstream in which the next block of text is any string representing "true" or any string representing "false", parse this as a Boolean, and return an informative error message if we fail.

Author
Vikram K. Mulligan

References errmsg(), is_false_string(), is_true_string(), and runtime_assert_string_msg.

◆ parse_out() [1/2]

template<class T >
void utility::parse_out ( std::stringstream &  stream,
T recipient 
)
inline

Parse out some data of type T from a stringstream, and throw an error with a message if the operation fails.

Version with a default error message.

Author
Vikram K. Mulligan.

References parse_out().

◆ parse_out() [2/2]

template<class T >
void utility::parse_out ( std::stringstream &  stream,
T recipient,
std::string const &  errmsg 
)
inline

Parse out some data of type T from a stringstream, and throw an error with a message if the operation fails.

Version with a custom error message.

Author
Vikram K. Mulligan.

References errmsg(), and runtime_assert_string_msg.

Referenced by parse_out().

◆ pathname()

std::string utility::pathname ( const std::string &  path)

◆ payload()

std::string utility::payload ( SimulateMPIMessageOP  msg)

◆ print_message()

void utility::print_message ( SimulateMPIMessageCOP  msg,
std::ostream &  os 
)

◆ quoted_split()

utility::vector1< std::string > utility::quoted_split ( std::string const &  s)

Split a string by whitespace, but obey single and double quote marks, like the bash commandline

References create_a3b_hbs::ii, create_a3b_hbs::r, docking::s, and basic::options::OptionKeys::cutoutdomain::start.

Referenced by basic::citation_manager::Citation::parse_authors(), and utility::options::VectorOption::set_value().

◆ rand_sleep()

void utility::rand_sleep ( )

◆ Real2string()

std::string utility::Real2string ( platform::Real  num,
std::size_t const  decimal_places 
)

convert a Real to string at a number of decimal places, optionally pad left.

References basic::options::OptionKeys::optE::fixed.

Referenced by fmt_real().

◆ receive_char_from_node()

char utility::receive_char_from_node ( int  source)

Use MPI to receive a single char from a particular node.

References utility::SimulateMPI::receive_char_from_node(), and utility::SimulateMPI::simulate_mpi().

◆ receive_double_from_node()

double utility::receive_double_from_node ( int  source)

◆ receive_doubles_from_node()

utility::vector1< double > utility::receive_doubles_from_node ( int  source)

Use MPI to receive a vector of doubles from a particular node.

References utility::SimulateMPI::receive_doubles_from_node(), and utility::SimulateMPI::simulate_mpi().

Referenced by main(), and run_parallel_docking().

◆ receive_integer_from_anyone()

int utility::receive_integer_from_anyone ( )

Use MPI to wait until some node sends an integer – usually its own mpi_rank so that it can send further messages.

References utility::SimulateMPI::receive_integer_from_anyone(), and utility::SimulateMPI::simulate_mpi().

Referenced by main().

◆ receive_integer_from_node()

int utility::receive_integer_from_node ( int  source)

◆ receive_integers_from_node()

utility::vector1< int > utility::receive_integers_from_node ( int  source)

Use MPI to receive a vector of integers from a particular node.

References utility::SimulateMPI::receive_integers_from_node(), and utility::SimulateMPI::simulate_mpi().

Referenced by main().

◆ receive_size_from_node()

platform::Size utility::receive_size_from_node ( int  source)

Use MPI to receive a single unsigned (usually 64-bit) integer from a particular node.

References utility::SimulateMPI::receive_size_from_node(), and utility::SimulateMPI::simulate_mpi().

◆ receive_sizes_from_node()

utility::vector1< platform::Size > utility::receive_sizes_from_node ( int  source)

Use MPI to receive a vector of integers from a particular node.

References utility::SimulateMPI::receive_sizes_from_node(), and utility::SimulateMPI::simulate_mpi().

◆ receive_string_from_node()

std::string utility::receive_string_from_node ( int  source)

◆ remove_exit_callback()

void utility::remove_exit_callback ( UtilityExitCallBack  cb)

Remove additional callback function that was previously added by using add_exit_callback.

References begin, and get_all_exit_callbacks().

◆ remove_from_string()

std::string utility::remove_from_string ( std::string const &  source,
std::string const &  remove 
)

Call boost to erase all instances of erase_str from source.

References erraser_util::remove().

◆ replace_environment_variables()

std::string utility::replace_environment_variables ( std::string  input)

find all environment variables with the form ${VARIABLE} and replace with the contents of that environment variable. if the environment variable does not exist, return string::npos

References end, gaussian-sampling::input, basic::options::OptionKeys::cutoutdomain::start, and utility_exit_with_message.

Referenced by utility::options::OptionCollection::load_options_from_stream().

◆ replace_first_in()

std::string utility::replace_first_in ( std::string const &  source,
std::string const &  from,
std::string const &  to 
)

Generate new string from 'source' by replacing the first occurrence of 'from' to 'to' string.

Author
Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.iron.nosp@m.insti.nosp@m.tute.nosp@m..org).

References make_symmdef_file_denovo::pos, and replace_string().

◆ replace_in() [1/2]

void utility::replace_in ( std::string &  s,
const char  from,
const char *  to 
)
inline

◆ replace_in() [2/2]

std::string utility::replace_in ( std::string const &  name_in,
std::string const &  find_string,
std::string const &  replace_string 
)

◆ replace_spaces()

std::string utility::replace_spaces ( std::string const &  string_w_spaces,
std::string const &  replacement 
)

replace space separations in a string with a connector such as '_'

References join(), and split().

◆ round()

platform::Real utility::round ( platform::Real const &  val)
inline

References round().

◆ rtrim()

void utility::rtrim ( std::string &  s,
const std::string &  drop 
)

Remove any characters in "drop" from the back of the string.

References docking::s.

Referenced by trim().

◆ same_ignoring_spaces()

bool utility::same_ignoring_spaces ( std::string const &  s1,
std::string const &  s2 
)
inline

Compares two strings, ignoring spaces. Useful for comparing atom name strings which have pdb-alignment built into them. Slightly dangerous if you consider the fact that atom names in the PDB are different for different indentation rules: ' CA ' is c-alpha. 'CA ' is calcium.

References basic::options::OptionKeys::stepwise::s1, and basic::options::OptionKeys::stepwise::s2.

◆ save_crash_report() [1/4]

void utility::save_crash_report ( char const *  message,
std::string const &  file,
int  line,
std::string const &  traceback 
)

◆ save_crash_report() [2/4]

void utility::save_crash_report ( char const *  message,
std::string const &  file,
int  line 
)

◆ save_crash_report() [3/4]

void utility::save_crash_report ( std::string const &  message,
std::string const &  file,
int const  line,
std::string const &  traceback 
)
inline

◆ save_crash_report() [4/4]

void utility::save_crash_report ( std::string const &  message,
std::string const &  file = "(none)",
int const  line = 0 
)
inline

Save a crash report to the crash reporter file.

References evaluate_beta_mutants::file, line, pyrosetta.utility.array::message, and save_crash_report().

◆ save_crash_report_to_console()

void utility::save_crash_report_to_console ( char const *  ,
std::string const &  ,
int  ,
std::string const &  traceback 
)

◆ save_crash_report_to_file()

void utility::save_crash_report_to_file ( char const *  message,
std::string const &  file,
int  line,
std::string const &  traceback 
)

◆ send_char_to_node()

void utility::send_char_to_node ( int  destination,
char  message 
)

◆ send_double_to_node()

void utility::send_double_to_node ( int  destination,
double  message 
)

◆ send_doubles_to_node()

void utility::send_doubles_to_node ( int  destination,
utility::vector1< double > const &  message 
)

◆ send_integer_to_node()

void utility::send_integer_to_node ( int  destination,
int  message 
)

◆ send_integers_to_node()

void utility::send_integers_to_node ( int  destination,
utility::vector1< int > const &  message 
)

◆ send_size_to_node()

void utility::send_size_to_node ( int  destination,
platform::Size  message 
)

Use MPI to send a single unsigned (usually 64-bit) integer to a particular node.

References pyrosetta.utility.array::message, utility::SimulateMPI::send_size_to_node(), and utility::SimulateMPI::simulate_mpi().

◆ send_sizes_to_node()

void utility::send_sizes_to_node ( int  destination,
utility::vector1< platform::Size > const &  message 
)

◆ send_string_to_node()

void utility::send_string_to_node ( int  destination,
std::string const &  message 
)

◆ set_application_name()

void utility::set_application_name ( char const *  appname)

Set the application name that this was launched as. Should only be called once on startup.

References APPNAME().

◆ set_main_exit_callback()

void utility::set_main_exit_callback ( UtilityExitCallBack  my_callback)

Set call back funtion that will be called on utility::exit. Use this function to overload default behavior of sys.exit to more appropriate to your application Defaut value for callback function is nullptr, whicth mean no sys exit is called.

References main_exit_callback.

Referenced by utility::py::PyExitCallback::set_PyExitCallBack().

◆ set_options_string()

void utility::set_options_string ( std::string const &  options)

Set the string representation of the options to be used in the crash report Should only be called once on startup.

References OPTIONS(), and options.

◆ set_show_crash_report_on_console()

void utility::set_show_crash_report_on_console ( bool  setting)

If passed true, any backtrace will show up on stderr in addition to the crash report file.

References show_crash_report_on_console_.

◆ signal_handler()

void utility::signal_handler ( int  signal)

◆ slurp()

void utility::slurp ( std::istream &  in,
std::string &  out 
)

Take all of the contents from the std::istream "in" and put them in the std::string "out".

Useful for reading the full contents of a file into a string.

References basic::options::OptionKeys::cloud::block.

Referenced by basic::resource_manager::ResourceManager::initialize_from_commandline(), main(), and sequence_tolerance_mf_main().

◆ split()

utility::vector1< std::string > utility::split ( const std::string &  s)

◆ split_by_newlines()

std::vector< std::string > utility::split_by_newlines ( std::string const &  s)

◆ split_to_list()

std::list< std::string > utility::split_to_list ( const std::string &  s)

split given std::string using ' ' symbol.

split given std::string using ' ' symbol.

References numeric::add(), create_a3b_hbs::i, create_a3b_hbs::r, docking::s, and basic::options::OptionKeys::cutoutdomain::start.

Referenced by utility::options::OptionCollection::load_option_from_file().

◆ split_to_set()

std::set< std::string > utility::split_to_set ( const std::string &  s)

split given std::string to a set using ' ' symbol.

split given std::string using ' ' symbol.

References numeric::add(), create_a3b_hbs::i, create_a3b_hbs::r, docking::s, and basic::options::OptionKeys::cutoutdomain::start.

◆ split_whitespace()

utility::vector1< std::string > utility::split_whitespace ( const std::string &  s)

split given std::string using whitespace as a separator. Unlike string_split_multi_delim(), any group of mixed whitespace counts only as a single seperator.

References test.T009_Exceptions::e, create_a3b_hbs::r, docking::s, and challenge::ss.

Referenced by read_complex_type().

◆ startswith()

bool utility::startswith ( std::string const &  haystack,
std::string const &  needle 
)

True iff haystack starts with needle.

Referenced by DRRAFTER_util::graph_from_ss().

◆ stdout_is_tty()

bool utility::stdout_is_tty ( )

◆ string2float()

float utility::string2float ( std::string const &  st)

convert a string to a float, returns -1 on failure

convert a string to a float

References create_a3b_hbs::i, and challenge::ss.

◆ string2int()

int utility::string2int ( std::string const &  st)

◆ string2Real()

platform::Real utility::string2Real ( std::string const &  st)

convert a string to a Real, returns numeric::get_undefined_real() on failure

References get_undefined_real(), create_a3b_hbs::i, and challenge::ss.

◆ string2Size()

platform::Size utility::string2Size ( std::string const &  st)

◆ string2uint()

void utility::string2uint ( const std::string &  x,
unsigned int *const  y 
)

References debug_assert, challenge::ss, x, and predPRE::y.

◆ string_split() [1/2]

utility::vector1< std::string > utility::string_split ( std::string const &  in,
char  splitchar = ' ' 
)

◆ string_split() [2/2]

template<class T >
utility::vector1<T> const utility::string_split ( std::string const &  in,
char  splitchar,
T   
)
inline

◆ string_split_multi_delim()

utility::vector1< std::string > utility::string_split_multi_delim ( std::string const &  in,
std::string  splitchars = " \t" 
)

split to vector< std::string > using any of arbitrary split characters

References create_a3b_hbs::i, and create_a3b_hbs::j.

Referenced by main().

◆ string_split_simple()

utility::vector1< std::string > utility::string_split_simple ( std::string const &  in,
char  splitchar 
)

split to vector1< std::string > using arbitrary split character, but no empty strings (closer to python string::split)

split to vector1< std::string > using arbitrary split character, but no empty strings (closer to python string::split)

References create_a3b_hbs::i, and create_a3b_hbs::j.

Referenced by utility::io::GeneralFileContentsVector::GeneralFileContentsVector(), MetalSiteFinderMover::initialize_from_options(), and main().

◆ string_to_sha1()

std::string utility::string_to_sha1 ( std::string const &  input_string)

References create_a3b_hbs::i.

◆ string_vector_from_char_vector()

utility::vector1< std::string > utility::string_vector_from_char_vector ( utility::vector1< char > const &  char_vect)

References to_string< char >().

◆ strip() [1/2]

std::string utility::strip ( std::string const &  source,
char  c 
)

Return a copy of the string with leading and trailing characters removed.

References begin, kmeans_adaptive_kernel_density_bb_dependent_rotlib::c, end, and kmeans_adaptive_kernel_density_bb_dependent_rotlib::p.

◆ strip() [2/2]

std::string utility::strip ( std::string const &  s,
std::string const &  drop 
)

◆ swap() [1/9]

template<typename B >
void utility::swap ( BitSet< B > &  a,
BitSet< B > &  b 
)

swap( BitSet, BitSet )

Referenced by swap().

◆ swap() [2/9]

template<typename B >
void utility::swap ( BitVector< B > &  a,
BitVector< B > &  b 
)

swap( BitVector, BitVector )

◆ swap() [3/9]

template<typename U >
void utility::swap ( BitVector< U > &  a,
BitVector< U > &  b 
)

swap( BitVector, BitVector )

◆ swap() [4/9]

template<platform::SSize L, typename A >
void utility::swap ( std::vector< bool, A > &  a,
vectorL< L, bool, A > &  b 
)

swap( std::vector, vectorL )

References a, and compute_difference::b.

◆ swap() [5/9]

template<platform::SSize L, typename T , typename A >
void utility::swap ( std::vector< T, A > &  a,
vectorL< L, T, A > &  b 
)
inline

swap( std::vector, vectorL )

References a, and compute_difference::b.

◆ swap() [6/9]

template<platform::SSize L, typename A >
void utility::swap ( vectorL< L, bool, A > &  a,
std::vector< bool, A > &  b 
)

swap( vectorL, std::vector )

References a, compute_difference::b, and swap().

◆ swap() [7/9]

template<platform::SSize L, typename A >
void utility::swap ( vectorL< L, bool, A > &  a,
vectorL< L, bool, A > &  b 
)

swap( vectorL, vectorL )

References a, compute_difference::b, and swap().

◆ swap() [8/9]

template<platform::SSize L, typename T , typename A >
void utility::swap ( vectorL< L, T, A > &  a,
std::vector< T, A > &  b 
)
inline

swap( vectorL, std::vector )

References a, compute_difference::b, and swap().

◆ swap() [9/9]

template<platform::SSize L, typename T , typename A >
void utility::swap ( vectorL< L, T, A > &  a,
vectorL< L, T, A > &  b 
)
inline

swap( vectorL, vectorL )

References a, compute_difference::b, and swap().

◆ swap4_aligned()

void utility::swap4_aligned ( void *  v,
long  ndata 
)

◆ sys_sleep()

void utility::sys_sleep ( double const  seconds)

Sleep for a specified number of seconds.

References utility::io::oc::cout, enumerate_junctions::int, and x.

Referenced by rand_sleep().

◆ terminate_handler()

void utility::terminate_handler ( )

◆ timestamp()

std::string utility::timestamp ( )

◆ timestamp_millis()

std::string utility::timestamp_millis ( )

Generate timestamp string with millis.

References localtime(), docking::s, predPRE::t, and timestamp().

◆ timestamp_millis_short()

std::string utility::timestamp_millis_short ( )

Generate timestamp string with millis, short format.

References localtime(), docking::s, predPRE::t, and timestamp().

◆ timestamp_short()

std::string utility::timestamp_short ( )

Generate timestamp string, short format.

References localtime(), and timestamp().

◆ to_string()

template<class T >
std::string utility::to_string ( const T t)
inline
Note
: If your type is int/Size/Real, you're probably better off with std::to_string()

References challenge::ss, and predPRE::t.

Referenced by protocols::abinitio::JumpSpecificAbrelax::add_constraints(), dsRNA_grow::apply(), GraftDesignCDRs::apply(), InverseRotlibDumpMover::apply(), LoopHash_Analyze::apply(), IdentifyCDRClusters::apply(), GlycanClashCheckMover::apply(), MPFindInterfaceTestMover::apply(), CrystRelax::apply(), ScoreFunctionFingerprintMover::apply(), utility::graph::block_allocation_error_message(), calc_rama_scores(), compare_chi1_2_angles(), compare_residues_and_chi1_2_angles(), apps::pilot::frankdt::compare_segment_to_motif(), design_cluster(), dump_insert_pdb_and_remodel_blueprint(), basic::execute(), InterfaceDDGBindJobInputter::fill_jobs(), CrystDesign::filter_and_report(), find_clusters(), get_attachment_point_string(), go(), numeric::expression_parser::ExpressionCreator::handle_function_expression(), numeric::expression_parser::SimpleExpressionCreator::handle_variable_expression(), InjectorMover::hash(), apps::pilot::frankdt::import_motifs(), TestQuickRelaxMover::init_from_cmd(), utility::tag::integer_range_restriction(), utility::tag::XMLErrorHandler::lines_near_error(), main(), make_fragments(), map_morph(), utility::graph::neg_space_element_allocation_error_message(), zinc_stats::ZincStatisticGenerator::output_file(), output_pdb(), pad_left(), pad_right(), payload(), utility::SimulateMPIData::pop_next_message_for_node_of_type(), utility::SimulateMPIData::pop_next_message_of_type(), Prepare(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_subelement_single_instance_optional(), basic::database::schema_generator::DbText::print(), read_native_sequence_for_entity_elements(), repack_cluster(), basic::mpi::DbMoverMessageListener::request(), utility::SimulateMPIData::retrieve_next_message(), apps::pilot::frankdt::reverse_motif(), DockFragmentsMover::run(), run_parallel_docking(), numeric::expression_parser::ArithmeticScanner::scan(), numeric::expression_parser::ArithmeticScanner::scan_identifier(), numeric::expression_parser::ArithmeticScanner::scan_literal(), utility::subset_mapping::set_next_correspondence(), ScoreFunctionFingerprintMover::sfxn(), ship_coordinates_to_gpu(), show(), apps::pilot::frankdt::store_segment_motif_match(), superimpose_smotifs(), sweep_params_from_match_constraint_file(), GlycanClashCheckMover::tabulate_individual_data(), myspace::GraftTester::test_cart_graft(), test_numerical_deriv(), numeric::expression_parser::LiteralToken::to_string(), numeric::expression_parser::FunctionToken::to_string(), traceCAs(), and numeric::expression_parser::ExpressionCreator::visit().

◆ to_string< char >()

template<>
std::string utility::to_string< char > ( const char &  t)
inline

References predPRE::t.

Referenced by main(), and string_vector_from_char_vector().

◆ trim() [1/2]

void utility::trim ( std::string &  s,
const std::string &  drop 
)

Remove any charachters in "drop" from the front and back of the string. Use strip() for the value-return version.

References ltrim(), rtrim(), and docking::s.

Referenced by utility::io::get_lines_from_file_data(), scan_hbond_jumps(), spanfile_for_each_chain(), spanfile_from_pdb(), strip(), and basic::database::write_schema_to_database().

◆ trim() [2/2]

std::string utility::trim ( std::string const &  s,
std::string const &  drop = " " 
)
inline

Ambiguious with the trim( std::string & s ) – Deprecated: use strip() instead for return-value trimming.

References docking::s, and strip().

◆ trimmed_compare()

bool utility::trimmed_compare ( std::string const &  s1,
std::string const &  s2 
)

compares two strings ignoring leading and trailing spaces

compares two strings ignoring leading and trailing spaces

References basic::options::OptionKeys::stepwise::s1, basic::options::OptionKeys::stepwise::s2, and sign::space.

◆ upper()

std::string utility::upper ( std::string const &  s)

◆ UPPERCASE_ALPHANUMERICS()

static std::string const utility::UPPERCASE_ALPHANUMERICS ( UPPERCASE_LETTERS NUMERALS)
static

◆ UPPERCASE_LETTERS()

static std::string const utility::UPPERCASE_LETTERS ( "ABCDEFGHIJKLMNOPQRSTUVWXYZ"  )
static

Referenced by PoseWrap::dump_pdb(), and dumpsym().

Variable Documentation

◆ main_exit_callback

void(* utility::main_exit_callback) (void) ( void  ) = nullptr
static

Place holder for 'end-action' of utility::exit(…)

Referenced by set_main_exit_callback().

◆ old_terminate_handler_

std::terminate_handler utility::old_terminate_handler_ = nullptr

◆ show_crash_report_on_console_

bool utility::show_crash_report_on_console_ = false
static