VinaLC: Parallel Molecular Docking Program

Biochemical and Biophysical Systems Group
VinaLC version: 1.1.2

common.h File Reference
#include <cassert>
#include <string>
#include <limits>
#include <utility>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/filesystem/path.hpp>
#include "macros.h"
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  vec
 
struct  mat
 
struct  internal_error
 

Macros

#define VINA_CHECK(P)   assert(P)
 

Typedefs

typedef double fl
 
typedef std::size_t sz
 
typedef std::pair< fl, flpr
 
typedef std::vector< vecvecv
 
typedef std::pair< vec, vecvecp
 
typedef std::vector< flflv
 
typedef std::vector< prprv
 
typedef std::vector< szszv
 
typedef boost::filesystem::path path
 

Functions

template<typename T >
sqr (T x)
 
vec operator* (fl s, const vec &v)
 
vec cross_product (const vec &a, const vec &b)
 
vec elementwise_product (const vec &a, const vec &b)
 
sz fl_to_sz (fl x, sz max_sz)
 
bool eq (fl a, fl b)
 
bool eq_r2 (fl a, fl b)
 
bool eq (const vec &a, const vec &b)
 
template<typename T >
bool eq (const std::vector< T > &a, const std::vector< T > &b)
 
const vec zero_vec (0, 0, 0)
 
const vec max_vec (max_fl, max_fl, max_fl)
 
bool not_max (fl x)
 
fl vec_distance_sqr (const vec &a, const vec &b)
 
fl sqr (const vec &v)
 
template<typename T >
sz vector_append (std::vector< T > &x, const std::vector< T > &y)
 
template<typename T >
sz find_min (const std::vector< T > &v)
 
void normalize_angle (fl &x)
 
fl normalized_angle (fl x)
 
template<typename T >
std::string to_string (const T &x, std::streamsize width=0, char fill= ' ')
 
template<typename T >
sum (const std::vector< T > &v)
 
fl pK_to_energy (fl pK)
 
void print (fl x, std::ostream &out=std::cout)
 
void print (sz x, std::ostream &out=std::cout)
 
void print (const vec &v, std::ostream &out=std::cout)
 
template<typename T >
void print (const std::vector< T > &v, std::ostream &out=std::cout)
 
template<typename T >
void printnl (const T &x, std::ostream &out=std::cout)
 
bool starts_with (const std::string &str, const std::string &start)
 
template<typename T >
bool has (const std::vector< T > &v, const T &element)
 

Variables

const fl not_a_num = std::sqrt(fl(-1))
 
const fl pi = fl(3.1415926535897931)
 
const fl fl_tolerance = fl(0.001)
 
const fl fl_tolerance_r2 = fl(0.000001)
 
const fl max_fl = (std::numeric_limits<fl>::max)()
 
const sz max_sz = (std::numeric_limits<sz>::max)()
 
const unsigned max_unsigned = (std::numeric_limits<unsigned>::max)()
 
const fl epsilon_fl = std::numeric_limits<fl>::epsilon()
 
const fl pK_to_energy_factor = -8.31 * 0.001 * 300 / 4.184 * std::log(10.0)
 

Macro Definition Documentation

#define VINA_CHECK (   P)    assert(P)

Referenced by ad_type_to_el_type(), parsing_struct::add(), model::append(), strictly_triangular_matrix< distance_type >::append(), model::assign_types(), average_difference(), axis_frame::axis_frame(), model::check_internal_pairs(), checked_convert_substring(), atom_type::covalent_radius(), current_weights(), do_search(), ad4_solvation::eval(), terms::eval_additive_aux(), naive_non_cache::eval_deriv(), terms::evale(), terms::evale_robust(), terms::evali(), term_set< additive >::filter(), terms::filter_external(), terms::filter_internal(), generate_external(), model::get_ligand_coords(), model::get_ligand_internal_coords(), conf_independent_inputs::get_names(), term_set< additive >::get_names(), get_type_pair_index(), model::gyration_radius(), parsing_struct::immobile_atom_coords(), precalculate_element::init_from_smooth_fst(), pdbqt_initializer::initialize_from_nrp(), pdbqt_initializer::initialize_from_rigid(), parsing_struct::insert_immobile(), parsing_struct::insert_immobile_inflex(), main_procedure(), manifold_phase(), monte_carlo::many_runs(), mutate_conf(), omit_whitespace(), monte_carlo::operator()(), manifold::operator()(), parallel_iter< F, Container, Input, Sync >::aux::operator()(), change::operator()(), parse_bundle(), parse_pdbqt_flex(), parse_pdbqt_ligand(), pearson(), postprocess_branch(), postprocess_ligand(), postprocess_residue(), precalculate::precalculate(), matrix< distance_type >::resize(), strictly_triangular_matrix< distance_type >::resize(), rmsd(), model::rmsd_ligands_upper_bound(), model::rmsd_lower_bound_asymmetric(), rmsd_upper_bound(), model::rmsd_upper_bound(), segment::segment(), set_rotor(), solvation_parameter(), string_write_coord(), model::verify_bond_lengths(), volume(), weighted_terms::weighted_terms(), precalculate_element::widen_smooth_fst(), write_all_output(), and model::write_ligand().

Typedef Documentation

typedef double fl
typedef std::size_t sz
typedef std::pair<fl, fl> pr
typedef std::vector<vec> vecv
typedef std::pair<vec, vec> vecp
typedef std::vector<fl> flv
typedef std::vector<pr> prv
typedef std::vector<sz> szv
typedef boost::filesystem::path path

Function Documentation

vec operator* ( fl  s,
const vec v 
)
inline
vec cross_product ( const vec a,
const vec b 
)
inline

Referenced by branches_derivative(), and atom_frame::sum_force_and_torque().

Here is the caller graph for this function:

vec elementwise_product ( const vec a,
const vec b 
)
inline

Referenced by grid::evaluate_aux().

Here is the caller graph for this function:

sz fl_to_sz ( fl  x,
sz  max_sz 
)
inline

References max_sz.

Referenced by manifold_phase(), and szv_grid::possibilities().

Here is the caller graph for this function:

bool eq ( fl  a,
fl  b 
)
inline
bool eq_r2 ( fl  a,
fl  b 
)
inline

References fl_tolerance_r2.

Referenced by model::verify_bond_lengths().

Here is the caller graph for this function:

bool eq ( const vec a,
const vec b 
)
inline

References eq().

Here is the call graph for this function:

template<typename T >
bool eq ( const std::vector< T > &  a,
const std::vector< T > &  b 
)

References eq(), and VINA_FOR_IN.

Here is the call graph for this function:

const vec zero_vec ( ,
,
 
)

Referenced by pdbqt_initializer::initialize_from_nrp(), quaternion_to_angle(), and rigid_conf::set_to_null().

Here is the caller graph for this function:

const vec max_vec ( max_fl  ,
max_fl  ,
max_fl   
)
bool not_max ( fl  x)
inline

Referenced by curl(), do_search(), ad4_solvation::eval(), and model::rmsd_lower_bound_asymmetric().

Here is the caller graph for this function:

fl sqr ( const vec v)
inline

References sqr().

Here is the call graph for this function:

template<typename T >
sz vector_append ( std::vector< T > &  x,
const std::vector< T > &  y 
)

Referenced by appender::append().

Here is the caller graph for this function:

template<typename T >
sz find_min ( const std::vector< T > &  v)

References VINA_FOR_IN.

void normalize_angle ( fl x)
inline

References pi.

Referenced by angle_to_quaternion(), normalized_angle(), and torsions_increment().

Here is the caller graph for this function:

fl normalized_angle ( fl  x)
inline

References normalize_angle().

Referenced by torsions_increment(), and torsions_too_close().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
std::string to_string ( const T &  x,
std::streamsize  width = 0,
char  fill = ' ' 
)
template<typename T >
T sum ( const std::vector< T > &  v)
fl pK_to_energy ( fl  pK)
inline
void print ( fl  x,
std::ostream &  out = std::cout 
)
inline

Referenced by print(), and printnl().

Here is the caller graph for this function:

void print ( sz  x,
std::ostream &  out = std::cout 
)
inline
void print ( const vec v,
std::ostream &  out = std::cout 
)
inline

References print(), and VINA_FOR_IN.

Here is the call graph for this function:

template<typename T >
void print ( const std::vector< T > &  v,
std::ostream &  out = std::cout 
)

References print(), and VINA_FOR_IN.

Here is the call graph for this function:

template<typename T >
void printnl ( const T &  x,
std::ostream &  out = std::cout 
)

References print().

Referenced by ligand_change::print(), ligand_conf::print(), residue_change::print(), residue_conf::print(), and model::print_stuff().

Here is the call graph for this function:

Here is the caller graph for this function:

bool starts_with ( const std::string &  str,
const std::string &  start 
)
inline
template<typename T >
bool has ( const std::vector< T > &  v,
const T &  element 
)

Referenced by model::bonded_to(), model::get_movable_atom_types(), and model::initialize_pairs().

Here is the caller graph for this function:

Variable Documentation

const fl not_a_num = std::sqrt(fl(-1))

Referenced by mat::mat(), and vec::vec().

const fl fl_tolerance = fl(0.001)

Referenced by eq().

const fl fl_tolerance_r2 = fl(0.000001)

Referenced by eq_r2().

const sz max_sz = (std::numeric_limits<sz>::max)()
const unsigned max_unsigned = (std::numeric_limits<unsigned>::max)()
const fl pK_to_energy_factor = -8.31 * 0.001 * 300 / 4.184 * std::log(10.0)