32 #include "pteros/core/typedefs.h"
33 #include "pteros/core/selection.h"
37 #define M_PI 3.14159265358979323846
41 #define M_PI_2 9.86960440108935712052951
46 float angle_between_vectors(Vector3f_const_ref vec1, Vector3f_const_ref vec2);
48 Eigen::Vector3f project_vector(Vector3f_const_ref vec1, Vector3f_const_ref vec2);
50 float rad_to_deg(
float ang);
51 float deg_to_rad(
float ang);
53 constexpr
long double operator"" _deg (
long double ang) {
54 return ang*3.141592/180.0;
57 constexpr
long double operator"" _rad (
long double ang) {
58 return ang*180.0/3.141592;
61 std::string get_element_name(
int elnum);
63 int get_element_number(
const std::string& name);
65 float get_vdw_radius(
int elnum,
const std::string& name);
68 void guess_element(
const std::string& name,
int& anum,
float& mass);
71 void get_element_from_atom_name(
const std::string& name,
int& anum,
float& mass);
74 Eigen::Affine3f rotation_transform(Vector3f_const_ref pivot, Vector3f_const_ref axis,
float angle);
77 char resname_1char(
const std::string& code);
79 std::string resname_3char(
char code);
82 int str_to_int(
const std::string& str);
83 float str_to_float(
const std::string& str);
84 void str_to_lower_in_place(std::string& str);
85 void str_to_upper_in_place(std::string& str);
86 std::string str_to_lower_copy(
const std::string& str);
87 void str_trim_in_place(std::string &s);
89 std::string time_pretty_print(
float t);
95 Histogram(
float minval,
float maxval,
int n);
96 void create(
float minval,
float maxval,
int n);
98 void add(
float v,
float weight=1.0);
99 void add(
const std::vector<float> &v);
100 void add(
const std::vector<float> &v,
const std::vector<float> &w);
101 void add_cylindrical(
float r,
float w,
float sector,
float cyl_h);
104 void normalize(
float norm=0);
105 float value(
int i)
const;
106 float position(
int i)
const;
107 float delta()
const {
return d;}
108 Eigen::VectorXd &values();
109 Eigen::VectorXd& positions();
110 int num_bins()
const;
111 void save_to_file(
const std::string& fname,
float x_shift=0);
124 Histogram2D(
float minval1,
float maxval1,
int n1,
float minval2,
float maxval2,
int n2);
125 void create(
float minval1,
float maxval1,
int n1,
float minval2,
float maxval2,
int n2);
126 void add(
float v1,
float v2,
float weight=1.0);
127 void normalize(
float norm=0);
128 Eigen::Vector2f delta()
const {
return d;}
129 float value(
int i,
int j)
const;
131 void save_to_file(
const std::string& fname);
133 Eigen::Vector2i nbins;
134 Eigen::Vector2f minv,maxv,d;
140 void greeting(std::string tool_name=
"");