tools.hpp
Go to the documentation of this file.
void write_pops(std::string filename, std::vector< std::size_t > pops, std::string header_comment, std::map< std::string, float > stringMap)
write populations as column into given file
Definition: tools.cpp:50
std::vector< std::size_t > read_concat_limits(std::string filename)
Definition: tools.cpp:133
std::tuple< NUM *, std::size_t, std::size_t > read_coords(std::string filename, std::vector< std::size_t > usecols=std::vector< std::size_t >())
Definition: tools.hxx:41
std::map< std::size_t, std::size_t > microstate_populations(std::vector< std::size_t > traj)
compute microstate populations from clustered trajectory
Definition: tools.cpp:176
std::vector< NUM > dim1_sorted_coords(const NUM *coords, std::size_t n_rows, std::size_t n_cols)
Definition: tools.hxx:122
std::vector< float > read_free_energies(std::string filename)
read free energies from plain text file
Definition: tools.cpp:96
void check_concat_limits(std::vector< std::size_t > concat_limits, std::size_t n_frames)
check if concat limits were passed correctly
Definition: tools.cpp:189
NUM string_to_num(const std::string &s)
convert std::string to number of given template format
Definition: tools.hxx:276
unsigned int min_multiplicator(unsigned int orig, unsigned int mult)
return minimum multiplicator to fulfill result * mult >= orig
Definition: tools.cpp:36
void write_map(std::string filename, std::map< KEY, VAL > mapping, std::string header_comment, bool val_then_key=false)
write key-value map to plain text file with key as first and value as second column ...
Definition: tools.hxx:209
std::pair< std::size_t, float > Neighbor
matches neighbor's frame id to distance
Definition: tools.hpp:64
void write_neighborhood(const std::string filename, const Neighborhood &nh, const Neighborhood &nh_high_dens, std::string header_comment, std::map< std::string, float > stringMap)
Definition: tools.cpp:144
std::map< std::size_t, Clustering::Tools::Neighbor > Neighborhood
map frame id to neighbors
Definition: tools.hpp:66
void read_comments(std::string filename, std::map< std::string, float > &stringMap)
read comments of stringMap from file. Comments should start with #@
Definition: tools.cpp:229
std::pair< Neighborhood, Neighborhood > read_neighborhood(const std::string filename)
Definition: tools.cpp:101
void append_commentsMap(std::string &header_comment, std::map< std::string, float > &stringMap)
append commentsMap to header comment
Definition: tools.cpp:267
std::vector< T > unique_elements(std::vector< T > xs)
return distinct elements of vector
Definition: tools.hxx:285
void write_single_column(std::string filename, std::vector< NUM > dat, std::string header_comment, bool with_scientific_format=false)
write single column of numbers to given file. number type (int, float, ...) given as template paramet...
Definition: tools.hxx:258
void write_fes(std::string filename, std::vector< float > fes, std::string header_comment, std::map< std::string, float > stringMap)
write free energies as column into given file
Definition: tools.cpp:42
void write_clustered_trajectory(std::string filename, std::vector< std::size_t > traj, std::string header_comment, std::map< std::string, float > stringMap)
write state trajectory into plain text file
Definition: tools.cpp:63
std::vector< NUM > boxlimits(const std::vector< NUM > &xs, std::size_t boxsize, std::size_t n_rows, std::size_t n_cols)
Definition: tools.hxx:159
std::vector< NUM > read_single_column(std::string filename)
read single column of numbers from given file. number type (int, float, ...) given as template parame...
Definition: tools.hxx:230
std::vector< std::size_t > read_clustered_trajectory(std::string filename)
read states from trajectory (given as plain text file)
Definition: tools.cpp:58
std::string stringprintf(const std::string &str,...)
printf-version for std::string
Definition: tools.cpp:80
std::pair< std::size_t, std::size_t > min_max_box(const std::vector< NUM > &limits, NUM val, NUM radius)
return indices of min and max boxes around value for given radius.
Definition: tools.hxx:179