Rosetta 3.3
Namespaces | Classes | Typedefs | 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 1. More...

Namespaces

namespace  excn
namespace  factory
 

A pluggable class factory system.


namespace  file
namespace  io
 

File stream I/O classes, primarily for compressed data.


namespace  keys
 

Keys and key-accessed containers for fast, safe object lookup.


namespace  options
 

Program options system.


namespace  pointer
namespace  query
namespace  signals
namespace  sql_database
namespace  tag
namespace  tools

Classes

class  BitSet
 Simple bit set. More...
class  BitVector
 Simple bit vector. More...
class  Bound
 Bound value class. 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 * >
class  EXCN_utility_exit
class  fixedsizearray1iterator
class  fixedsizearray1const_iterator
class  fixedsizearray1
class  FixedSizeLexicographicalIterator
class  heap
class  list_element
class  in_place_list
class  IndirectSorter
 Sorts a container of things indirectly. More...
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  LexicographicalIterator
class  OrderedTuple
 The ordered tuple takes a container class T and defines comparison operators so that the tuple may be sorted. More...
class  PeriodicSplineReader
 Class: PeriodicSplineReader. More...
class  Show
struct  SortFirst
struct  SortSecond
class  TopScoreSelector
 The TopScoreSelector keeps an in-place, sorted, singly-linked list of the N top-scoring objects and their scores that it encounters. In the case of ties, the first object(s) encountered are kept. Class T must have a default constructor, a copy constructor, and must be assignable. Class S must be assignable and comparable, both by a < operator and by a > operator. More...
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...

Typedefs

typedef
utility::pointer::owning_ptr
< heap
heapOP
typedef
utility::pointer::owning_ptr
< heap const > 
heapCOP
typedef pointer::owning_ptr
< subset_mapping
subset_mappingOP
typedef pointer::owning_ptr
< subset_mapping const > 
subset_mappingCOP
typedef vector0< boolvector0_bool
typedef vector0< short intvector0_short
typedef vector0< intvector0_int
typedef vector0< long intvector0_long
typedef vector0< unsigned
short int
vector0_ushort
typedef vector0< unsigned intvector0_uint
typedef vector0< unsigned long
int
vector0_ulong
typedef vector0< std::size_t > vector0_size_t
typedef vector0< std::size_t > vector0_size
typedef vector0< ssize_tvector0_ssize_t
typedef vector0< ssize_tvector0_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< boolvector1_bool
typedef vector1< short intvector1_short
typedef vector1< intvector1_int
typedef vector1< long intvector1_long
typedef vector1< unsigned
short int
vector1_ushort
typedef vector1< unsigned intvector1_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< ssize_tvector1_ssize_t
typedef vector1< ssize_tvector1_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

Functions

void sys_sleep (double const seconds)
 Sleep for a specified number of seconds.
std::string timestamp ()
 Generate timestamp string.
template<typename B >
BitSet< B > operator+ (BitSet< B > const &a, BitSet< B > const &b)
 BitSet + BitSet: Union.
template<typename B >
BitSet< B > operator| (BitSet< B > const &a, BitSet< B > const &b)
 BitSet | BitSet: Union.
template<typename B >
BitSet< B > operator- (BitSet< B > const &a, BitSet< B > const &b)
 BitSet - BitSet: Difference.
template<typename B >
void swap (BitSet< B > &a, BitSet< B > &b)
 swap( BitSet, BitSet )
template<typename B >
bool operator== (BitSet< B > const &a, BitSet< B > const &b)
 BitSet == BitSet.
template<typename B >
bool operator!= (BitSet< B > const &a, BitSet< B > const &b)
 BitSet != BitSet.
template<typename B >
BitVector< B > operator+ (BitVector< B > const &a, BitVector< B > const &b)
 BitVector + BitVector: Union.
template<typename B >
BitVector< B > operator| (BitVector< B > const &a, BitVector< B > const &b)
 BitVector | BitVector: Union.
template<typename B >
BitVector< B > operator- (BitVector< B > const &a, BitVector< B > const &b)
 BitVector - BitVector: Difference.
template<typename B >
void swap (BitVector< B > &a, BitVector< B > &b)
 swap( BitVector, BitVector )
template<typename B >
bool operator== (BitVector< B > const &a, BitVector< B > const &b)
 BitVector == BitVector.
template<typename B >
bool operator!= (BitVector< B > const &a, BitVector< B > const &b)
 BitVector != BitVector.
template<class Target , class Source >
Target down_cast (Source &s)
 Fast assert-checked polymorphic down-cast: reference argument.
template<class Target , class Source >
Target down_cast (Source *p)
 Fast assert-checked polymorphic down-cast: pointer argument.
void set_exit_callback (void(*my_callback)(void)=0)
 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 0, whicth mean no sys exit is called.
void exit (std::string const &file, int const line, std::string const &message, int const status)
 Exit with file + line + message + optional status.
int cond_exit (bool condition, std::string const &file, int const line, std::string const &message, int const status)
 Conditional Exit with file + line + message + optional status.
void exit (std::string const &file, int const line, int const status=1)
 Exit with file + line + optional status.
void exit (int const status, std::string const &file, int const line)
 Exit with file + line + status.
template<typename T >
int argmin (const std::vector< T > &iterable)
 Returns the argument whose value is minimal according to operator<. Adheres to STL numbering (0-indexed).
template<typename T >
int argmin (const utility::vector1< T > &iterable)
 Returns the argument whose value is minimal according to operator<. Adheres to Rosetta numbering (1-indexed).
template<typename T >
int argmax (const std::vector< T > &iterable)
 Returns the argument whose value is maximal according to operator>. Adheres to STL numbering (0-indexed).
template<typename T >
int argmax (const utility::vector1< T > &iterable)
 Returns the argument whose value is maximal according to operator>. Adheres to Rosetta numbering (1-indexed).
int mpi_rank ()
int mpi_nprocs ()
std::string receive_string_from_node (int MPI_ONLY(source))
void send_string_to_node (int MPI_ONLY(destination), std::string const &MPI_ONLY(message))
int receive_integer_from_node (int MPI_ONLY(source))
void send_integer_to_node (int MPI_ONLY(destination), int MPI_ONLY(message))
utility::vector1< intreceive_integers_from_node (int MPI_ONLY(source))
void send_integers_to_node (int MPI_ONLY(destination), utility::vector1< int > const &MPI_ONLY(message))
double receive_double_from_node (int MPI_ONLY(source))
void send_double_to_node (int MPI_ONLY(destination), double MPI_ONLY(message))
utility::vector1< doublereceive_doubles_from_node (int MPI_ONLY(source))
void send_doubles_to_node (int MPI_ONLY(destination), utility::vector1< double > const &MPI_ONLY(message))
std::string receive_string_from_node (int source)
 Use MPI to receive a string from a particular node.
void send_string_to_node (int source, std::string const &message)
int receive_integer_from_node (int source)
 Use MPI to receive a single integer from a particular node.
void send_integer_to_node (int destination, int message)
utility::vector1< intreceive_integers_from_node (int source)
 Use MPI to receive a vector of integers from a particular node.
void send_integers_to_node (int destination, utility::vector1< int > const &message)
double receive_double_from_node (int source)
 Use MPI to receive a single double from a particular node.
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.
void send_doubles_to_node (int destination, utility::vector1< double > const &message)
template<class T >
utility::pointer::access_ptr< T > PyAP (T &o)
 Function to create argument for Python subclassing.
template<class T >
T * wrap_access_pointer_get_function (pointer::access_ptr< T > rs)
template<class T >
void wrap_access_pointer (std::string class_name)
template<typename T >
random ()
 Generic random number generator.
double drand ()
 Generate random doubles.
void ReadFromFileOrDie (const std::string &filename, std::string *contents)
 Reads the contents of <filename> into <contents>, preserving newline characters. Aborts if an error is encoutered.
std::vector< std::string > split (const std::string &s)
 split given std::string using ' ' symbol.
std::string join (utility::vector1< std::string > const &s, std::string const &connector)
 combine strings with anything
std::string join (std::vector< std::string > const &s, std::string const &connector)
 combine strings with anything
std::string join (std::string const &string_w_spaces, std::string const &connector)
 join space separations in a string with a connector such as '_'
std::list< std::string > split_to_list (const std::string &s)
std::vector< std::string > string_split (std::string const &in, char splitchar)
float string2float (std::string st)
int string2int (std::string st)
void string2uint (const std::string &x, unsigned int *y)
bool trimmed_compare (std::string const &s1, std::string const &s2)
bool startswith (std::string const &haystack, std::string const &needle)
 True iff haystack starts with needle.
bool endswith (std::string const &haystack, std::string const &needle)
 True iff haystack ends with needle.
void slurp (std::istream &in, std::string &out)
void trim (std::string &s, const std::string &drop)
std::string trim (std::string const &s, std::string const &drop=" ")
 create a new string that drops all the unwanted substrings of the original string.
void add_spaces_left_align (std::string &st, std::size_t const newlen)
 adds spaces to a left aligned string until a given length is reached
void add_spaces_right_align (std::string &st, std::size_t const newlen)
 adds spaces to a right aligned string until a given length is reached
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.
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
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.
void replace_in (std::string &s, const char from, const char *to)
template<class T >
std::string to_string (const T &t)
template<class T >
T const from_string (std::string const &s, T)
short int min (short int const a, short int const b)
 min( short int, short int )
int min (int const a, int const b)
 min( int, int )
long int min (long int const a, long int const b)
 min( long int, long int )
unsigned short int min (unsigned short int const a, unsigned short int const b)
 min( unsigned short int, unsigned short int )
unsigned int min (unsigned int const a, unsigned int const b)
 min( unsigned int, unsigned int )
unsigned long int min (unsigned long int const a, unsigned long int const b)
 min( unsigned long int, unsigned long int )
float min (float const a, float const b)
 min( float, float )
double min (double const a, double const b)
 min( double, double )
long double min (long double const a, long double const b)
 min( long double, long double )
template<typename T >
T const & min (T const &a, T const &b, T const &c)
 min( a, b, c )
template<typename T >
T const & min (T const &a, T const &b, T const &c, T const &d)
 min( a, b, c, d )
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 )
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 )
short int max (short int const a, short int const b)
 max( short int, short int )
int max (int const a, int const b)
 max( int, int )
long int max (long int const a, long int const b)
 max( long int, long int )
unsigned short int max (unsigned short int const a, unsigned short int const b)
 max( unsigned short int, unsigned short int )
unsigned int max (unsigned int const a, unsigned int const b)
 max( unsigned int, unsigned int )
unsigned long int max (unsigned long int const a, unsigned long int const b)
 max( unsigned long int, unsigned long int )
float max (float const a, float const b)
 max( float, float )
double max (double const a, double const b)
 max( double, double )
long double max (long double const a, long double const b)
 max( long double, long double )
template<typename T >
T const & max (T const &a, T const &b, T const &c)
 max( a, b, c )
template<typename T >
T const & max (T const &a, T const &b, T const &c, T const &d)
 max( a, b, c, d )
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 )
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 )
template<class T >
max (vector1< T > const &input)
 Find the largest value in a vector.
template<class T >
min (vector1< T > const &input)
 Find the smallest value in a vector.
template<class T >
vector1< T >::Size arg_max (vector1< T > const &input)
 find the index of the largest value in a vector
template<class T >
vector1< T >::Size arg_min (vector1< T > const &input)
 find the index of the smallest value in a vector
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)
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)
template<ssize_t L, typename T , typename A >
bool operator== (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL == vectorL
template<ssize_t L, typename T , typename A >
bool operator!= (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL != vectorL
template<ssize_t L, typename T , typename A >
bool operator< (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL < vectorL
template<ssize_t L, typename T , typename A >
bool operator<= (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL <= vectorL
template<ssize_t L, typename T , typename A >
bool operator>= (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL >= vectorL
template<ssize_t L, typename T , typename A >
bool operator> (vectorL< L, T, A > const &a, vectorL< L, T, A > const &b)
 vectorL > vectorL
template<ssize_t L, typename T , typename A >
bool operator== (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL == std::vector
template<ssize_t L, typename T , typename A >
bool operator!= (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL != std::vector
template<ssize_t L, typename T , typename A >
bool operator< (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL < std::vector
template<ssize_t L, typename T , typename A >
bool operator<= (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL <= std::vector
template<ssize_t L, typename T , typename A >
bool operator>= (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL >= std::vector
template<ssize_t L, typename T , typename A >
bool operator> (vectorL< L, T, A > const &a, std::vector< T, A > const &b)
 vectorL > std::vector
template<ssize_t L, typename T , typename A >
bool operator== (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector == vectorL
template<ssize_t L, typename T , typename A >
bool operator!= (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector != vectorL
template<ssize_t L, typename T , typename A >
bool operator< (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector < vectorL
template<ssize_t L, typename T , typename A >
bool operator<= (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector <= vectorL
template<ssize_t L, typename T , typename A >
bool operator>= (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector >= vectorL
template<ssize_t L, typename T , typename A >
bool operator> (std::vector< T, A > const &a, vectorL< L, T, A > const &b)
 std::vector > vectorL
template<ssize_t L, typename T , typename A >
void swap (vectorL< L, T, A > &a, vectorL< L, T, A > &b)
 swap( vectorL, vectorL )
template<ssize_t L, typename T , typename A >
void swap (vectorL< L, T, A > &a, std::vector< T, A > &b)
 swap( vectorL, std::vector )
template<ssize_t L, typename T , typename A >
void swap (std::vector< T, A > &a, vectorL< L, T, A > &b)
 swap( std::vector, vectorL )
template<ssize_t L, typename A >
bool operator== (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL == vectorL
template<ssize_t L, typename A >
bool operator!= (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL != vectorL
template<ssize_t L, typename A >
bool operator< (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL < vectorL
template<ssize_t L, typename A >
bool operator<= (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL <= vectorL
template<ssize_t L, typename A >
bool operator>= (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL >= vectorL
template<ssize_t L, typename A >
bool operator> (vectorL< L, bool, A > const &a, vectorL< L, bool, A > const &b)
 vectorL > vectorL
template<ssize_t L, typename A >
bool operator== (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL == std::vector
template<ssize_t L, typename A >
bool operator!= (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL != std::vector
template<ssize_t L, typename A >
bool operator< (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL < std::vector
template<ssize_t L, typename A >
bool operator<= (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL <= std::vector
template<ssize_t L, typename A >
bool operator>= (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL >= std::vector
template<ssize_t L, typename A >
bool operator> (vectorL< L, bool, A > const &a, std::vector< bool, A > const &b)
 vectorL > std::vector
template<ssize_t L, typename A >
bool operator== (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector == vectorL
template<ssize_t L, typename A >
bool operator!= (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector != vectorL
template<ssize_t L, typename A >
bool operator< (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector < vectorL
template<ssize_t L, typename A >
bool operator<= (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector <= vectorL
template<ssize_t L, typename A >
bool operator>= (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector >= vectorL
template<ssize_t L, typename A >
bool operator> (std::vector< bool, A > const &a, vectorL< L, bool, A > const &b)
 std::vector > vectorL
template<ssize_t L, typename A >
void swap (vectorL< L, bool, A > &a, vectorL< L, bool, A > &b)
 swap( vectorL, vectorL )
template<ssize_t L, typename A >
void swap (vectorL< L, bool, A > &a, std::vector< bool, A > &b)
 swap( vectorL, std::vector )
template<ssize_t L, typename A >
void swap (std::vector< bool, A > &a, vectorL< L, bool, A > &b)
 swap( std::vector, vectorL )

Variables

static void(* exit_callback )(void)=0

Detailed Description

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

Miscellaneous I/O, portability, and algorithmic classes.

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

STL Headers.

#include <iostream> // debug only

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

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


Typedef Documentation


Function Documentation

void utility::add_spaces_left_align ( std::string &  st,
std::size_t const  newlen 
)

adds spaces to a left aligned string until a given length is reached

void utility::add_spaces_right_align ( std::string &  st,
std::size_t const  newlen 
)

adds spaces to a right aligned string until a given length is reached

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 test::T200_Scoring::ii, and insert_middle().

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 test::T200_Scoring::ii, and insert_middle().

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 test::T200_Scoring::ii, and basic::T().

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 test::T200_Scoring::ii, and basic::T().

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

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

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

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

int utility::cond_exit ( bool  condition,
std::string 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().

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 docking::p.

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 basic::options::OptionKeys::in::file::s.

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

double utility::drand ( ) [inline]

Generate random doubles.

Note:
This should probably use C stdlib.h's drand48 if available.
Deprecated:
Use random<double> instead.

Referenced by utility::file::file_delete(), utility::file::trytry_ifstream_open(), and utility::file::trytry_ofstream_open().

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

True iff haystack ends with needle.

void utility::exit ( std::string const &  file,
int const  line,
std::string const &  message,
int const  status 
)
void utility::exit ( int const  status,
std::string const &  file,
int const  line 
) [inline]

Exit with file + line + status.

Note:
Deprecated: For backwards compatibility with earlier version

References exit().

void utility::exit ( std::string const &  file,
int const  line,
int const  status = 1 
) [inline]

Exit with file + line + optional status.

References exit(), and basic::options::OptionKeys::run::status.

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

References filename().

std::string utility::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.

References utility::io::izstream::close(), ObjexxFCL::getline(), test::T200_Scoring::ii, get_pdb::line, and utility::options::OptionKeys::options::table::text.

std::string utility::filename ( const std::string &  path)
template<class T >
T const utility::from_string ( std::string const &  s,
 
) [inline]
template<class T >
void utility::insert_middle ( vector1< T > &  vect,
typename vector1< T >::Size const  position,
T const  new_value,
bool  expand 
)
bool utility::is_string_numeric ( std::string const &  input)

References color_pdb::i.

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

combine strings with anything

References begin.

Referenced by join().

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

combine strings with anything

References begin.

std::string utility::join ( std::string const &  string_w_spaces,
std::string const &  connector 
)

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

References join(), split(), trim(), and ObjexxFCL::trimmed().

short int utility::max ( short int const  a,
short int const  b 
) [inline]
int utility::max ( int const  a,
int const  b 
) [inline]
long int utility::max ( long int const  a,
long int const  b 
) [inline]
unsigned short int utility::max ( unsigned short int const  a,
unsigned short int const  b 
) [inline]
unsigned int utility::max ( unsigned int const  a,
unsigned int const  b 
) [inline]
unsigned long int utility::max ( unsigned long int const  a,
unsigned long int const  b 
) [inline]
float utility::max ( float const  a,
float const  b 
) [inline]
double utility::max ( double const  a,
double const  b 
) [inline]
long double utility::max ( long double const  a,
long double const  b 
) [inline]
template<typename T >
T const& utility::max ( T const &  a,
T const &  b,
T const &  c 
) [inline]

max( a, b, c )

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

max( a, b, c, d )

References numeric::max(), and max().

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

max( a, b, c, d, e )

References numeric::max(), and max().

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( a, b, c, d, e, f )

References numeric::max(), and max().

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 test::T200_Scoring::ii, and basic::T().

short int utility::min ( short int const  a,
short int const  b 
) [inline]
int utility::min ( int const  a,
int const  b 
) [inline]
long int utility::min ( long int const  a,
long int const  b 
) [inline]
unsigned short int utility::min ( unsigned short int const  a,
unsigned short int const  b 
) [inline]
unsigned int utility::min ( unsigned int const  a,
unsigned int const  b 
) [inline]
unsigned long int utility::min ( unsigned long int const  a,
unsigned long int const  b 
) [inline]
float utility::min ( float const  a,
float const  b 
) [inline]
double utility::min ( double const  a,
double const  b 
) [inline]
long double utility::min ( long double const  a,
long double const  b 
) [inline]
template<typename T >
T const& utility::min ( T const &  a,
T const &  b,
T const &  c 
) [inline]

min( a, b, c )

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

min( a, b, c, d )

References basic::options::OptionKeys::ddg::min, and min().

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

min( a, b, c, d, e )

References basic::options::OptionKeys::ddg::min, and min().

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( a, b, c, d, e, f )

References basic::options::OptionKeys::ddg::min, and min().

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 test::T200_Scoring::ii, and basic::T().

int utility::mpi_nprocs ( )
int utility::mpi_rank ( )
template<ssize_t L, typename A >
bool utility::operator!= ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)
template<ssize_t L, typename A >
bool utility::operator!= ( vectorL< L, bool, A > const &  a,
std::vector< bool, A > const &  b 
)

vectorL != std::vector

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

std::vector != vectorL

template<typename B >
bool utility::operator!= ( BitSet< B > const &  a,
BitSet< B > const &  b 
)
template<typename B >
bool utility::operator!= ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
template<ssize_t L, typename T , typename A >
bool utility::operator!= ( vectorL< L, T, A > const &  a,
vectorL< L, T, A > const &  b 
)
template<ssize_t L, typename T , typename A >
bool utility::operator!= ( vectorL< L, T, A > const &  a,
std::vector< T, A > const &  b 
)

vectorL != std::vector

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

std::vector != vectorL

template<typename B >
BitVector< B > utility::operator+ ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
template<typename B >
BitSet< B > utility::operator+ ( BitSet< B > const &  a,
BitSet< B > const &  b 
)
template<typename B >
BitSet< B > utility::operator- ( BitSet< B > const &  a,
BitSet< B > const &  b 
)
template<typename B >
BitVector< B > utility::operator- ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
template<ssize_t L, typename T , typename A >
bool utility::operator< ( std::vector< T, A > const &  a,
vectorL< L, T, A > const &  b 
)

std::vector < vectorL

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

vectorL < std::vector

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

std::vector < vectorL

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

vectorL < std::vector

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

std::vector <= vectorL

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

vectorL <= std::vector

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

std::vector <= vectorL

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

vectorL <= std::vector

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

vectorL == std::vector

template<typename B >
bool utility::operator== ( BitSet< B > const &  a,
BitSet< B > const &  b 
)
template<typename B >
bool utility::operator== ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
template<ssize_t L, typename A >
bool utility::operator== ( std::vector< bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)

std::vector == vectorL

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

vectorL == std::vector

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

std::vector == vectorL

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

std::vector > vectorL

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

vectorL > std::vector

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

std::vector > vectorL

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

vectorL > std::vector

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

vectorL >= std::vector

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

std::vector >= vectorL

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

std::vector >= vectorL

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

vectorL >= std::vector

template<typename B >
BitVector< B > utility::operator| ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
template<typename B >
BitSet< B > utility::operator| ( BitSet< B > const &  a,
BitSet< B > const &  b 
)
std::string utility::pathname ( const std::string &  path)
template<class T >
utility::pointer::access_ptr<T> utility::PyAP ( T &  o)

Function to create argument for Python subclassing.

References basic::options::OptionKeys::out::file::o.

template<typename T >
T utility::random ( ) [inline]

Generic random number generator.

Note:
Default to std::rand in the absence of a better alternative
On POSIX systems (e.g. Linux) use drand48 for doubles

References basic::T().

void utility::ReadFromFileOrDie ( const std::string &  filename,
std::string *  contents 
)

Reads the contents of <filename> into <contents>, preserving newline characters. Aborts if an error is encoutered.

References ObjexxFCL::getline(), basic::options::OptionKeys::in::in, get_pdb::line, basic::options::OptionKeys::smhybrid::ss, and utility_exit_with_message.

double utility::receive_double_from_node ( int   MPI_ONLYsource)

References tag.

double utility::receive_double_from_node ( int  source)

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

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

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

int utility::receive_integer_from_node ( int  source)

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

int utility::receive_integer_from_node ( int   MPI_ONLYsource)

References tag.

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

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

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

Use MPI to receive a string from a particular node.

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

References ObjexxFCL::len(), and tag.

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, and utility_exit_with_message.

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

void utility::replace_in ( std::string &  s,
const char  from,
const char *  to 
) [inline]
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.

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

References NetLink::message, and tag.

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

References NetLink::message, and tag.

void utility::send_integer_to_node ( int  destination,
int  message 
)
void utility::send_integers_to_node ( int   MPI_ONLYdestination,
utility::vector1< int > const &  MPI_ONLYmessage 
)
void utility::send_integers_to_node ( int  destination,
utility::vector1< int > const &  message 
)
void utility::send_string_to_node ( int  source,
std::string const &  message 
)
void utility::send_string_to_node ( int   MPI_ONLYdestination,
std::string const &  MPI_ONLYmessage 
)
void utility::set_exit_callback ( void(*)(void)  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 0, whicth mean no sys exit is called.

References exit_callback.

Referenced by set_pyexit_callback().

void utility::slurp ( std::istream &  in,
std::string &  out 
)
std::vector< std::string > utility::split ( const std::string &  s)

split given std::string using ' ' symbol.

TODO get rid of std::vector TODO implement this function in terms of string_split, found below

split given std::string using ' ' symbol.

References numeric::add(), color_pdb::i, and NetLink::r.

Referenced by join(), and basic::Tracer::set_ios_hook().

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

split given std::string using ' ' symbol.

References numeric::add(), color_pdb::i, and NetLink::r.

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

True iff haystack starts with needle.

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

convert a string to a float

References color_pdb::i, and basic::options::OptionKeys::smhybrid::ss.

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

convert a string to an int

References color_pdb::i, and basic::options::OptionKeys::smhybrid::ss.

void utility::string2uint ( const std::string &  x,
unsigned int y 
)
std::vector< std::string > utility::string_split ( std::string const &  in,
char  splitchar 
)

split to vector< std::string > using arbitrary split character

Author:
ashworth

split to vector< std::string > using arbitrary split character

References color_pdb::i.

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

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

swap( BitVector, BitVector )

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

swap( vectorL, std::vector )

References utility::vectorL< L, T, A >::swap().

template<ssize_t L, typename A >
void utility::swap ( std::vector< bool, A > &  a,
vectorL< L, bool, A > &  b 
) [inline]

swap( std::vector, vectorL )

References utility::vectorL< L, bool, A >::swap().

template<ssize_t L, typename A >
void utility::swap ( vectorL< L, bool, A > &  a,
vectorL< L, bool, A > &  b 
) [inline]

swap( vectorL, vectorL )

References utility::vectorL< L, bool, A >::swap().

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

swap( BitSet, BitSet )

Referenced by insert_middle().

template<ssize_t L, typename A >
void utility::swap ( vectorL< L, bool, A > &  a,
std::vector< bool, A > &  b 
) [inline]

swap( vectorL, std::vector )

References utility::vectorL< L, bool, A >::swap().

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

swap( std::vector, vectorL )

References utility::vectorL< L, T, A >::swap().

template<ssize_t L, typename T , typename A >
void utility::swap ( vectorL< L, T, A > &  a,
vectorL< L, T, A > &  b 
) [inline]

swap( vectorL, vectorL )

References utility::vectorL< L, T, A >::swap().

void utility::sys_sleep ( double const  seconds)
std::string utility::timestamp ( )

Generate timestamp string.

template<class T >
std::string utility::to_string ( const T &  t) [inline]
void utility::trim ( std::string &  s,
const std::string &  drop 
)

References NetLink::r.

Referenced by join(), and trim().

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

create a new string that drops all the unwanted substrings of the original string.

References trim().

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

compares two strings ignoring leading and trailing spaces

References ObjexxFCL::space().

template<class T >
void utility::wrap_access_pointer ( std::string  class_name)

References basic::T().

template<class T >
T* utility::wrap_access_pointer_get_function ( pointer::access_ptr< T >  rs)

Variable Documentation

void(* utility::exit_callback)(void)=0 [static]

Referenced by exit(), and set_exit_callback().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines