Go to the source code of this file.
Compounds | |
| struct | msgtimer |
Defines | |
| #define | FALSE 0 |
| #define | TRUE 1 |
| #define | NULL 0 |
| #define | ABS(A) ((A)>0?(A):-(A)) |
| #define | VMD_PI 3.14159265358979323846 |
| #define | VMD_TWOPI (2.0 * VMD_PI) |
| #define | VMD_1_PI 0.31830988618379067154 |
| #define | DEGTORAD(a) (a*VMD_PI/180.0) |
| #define | RADTODEG(a) (a*180.0/VMD_PI) |
| #define | VMD_RAND_MAX 2147483647L |
Typedefs | |
| typedef void * | vmd_timerhandle |
| a timer handle. More... | |
Functions | |
| char * | combine_arguments (int, const char **, int) |
| given an argc, argv pair, take all the arguments from the Nth one on and combine them into a single string with spaces separating words. This allocates space for the string, which must be freed by the user. More... | |
| char * | stringdup (const char *) |
| make a copy of a string using c++ new routine for memory alloc. More... | |
| char * | stringtoupper (char *) |
| convert the given string to upper case. More... | |
| void | stripslashes (char *str) |
| strip trailing '/' characters from a string. More... | |
| int | strupcmp (const char *, const char *) |
| do case-insensitive string comparisons. More... | |
| int | strupncmp (const char *, const char *, int) |
| do case-insensitive string comparisons. More... | |
| void | breakup_filename (const char *, char **, char **) |
| break a file name up into path + name, returning both in the specified character pointers. This creates storage for the new strings by allocating space for them. More... | |
| char * | str_tokenize (const char *, int *, char **) |
| tokenize a given string; return char ptr if ok, NULL if error. More... | |
| double | time_of_day (void) |
| get the time of day from the system clock, and return it (in seconds) (This is supposedly accurate to within about 1 millisecond. More... | |
| vmd_timerhandle | vmd_timer_create (void) |
| create a timer (clears timer). More... | |
| void | vmd_timer_destroy (vmd_timerhandle) |
| create a timer (clears timer). More... | |
| void | vmd_timer_start (vmd_timerhandle) |
| start a timer (clears timer). More... | |
| void | vmd_timer_stop (vmd_timerhandle) |
| stop a timer. More... | |
| double | vmd_timer_time (vmd_timerhandle) |
| report elapsed time in seconds. More... | |
| double | vmd_timer_timenow (vmd_timerhandle) |
| report elapsed time in seconds. More... | |
| msgtimer * | msg_timer_create (double updatetime) |
| initialize periodic status message timer. More... | |
| int | msg_timer_timeout (msgtimer *time) |
| return true if it's time to print a status update message. More... | |
| void | msg_timer_destroy (msgtimer *mt) |
| destroy message timer. More... | |
| int | vmd_check_stdin (void) |
| check for input on stdin. More... | |
| char * | vmd_username (void) |
| return the username of the currently logged-on user. More... | |
| int | vmd_getuid (void) |
| return the uid of the currently logged-on user. More... | |
| int | clamp_int (int val, int min, int max) |
| clamp an integer value to the range min->max. More... | |
| float * | cross_prod (float *x1, const float *x2, const float *x3) |
| compute the cross product, assumes that x1 memory is _different_ than both x2 and x3, and returns the pointer to x1. More... | |
| float | dot_prod (const float *v1, const float *v2) |
| compute the inner dot product. More... | |
| double | dot_prod (const double *v1, const double *v2) |
| void | vec_copy (float *v1, const float *v2) |
| copy the first 3 elements from v2 to v1. More... | |
| float * | vec_normalize (float *) |
| normalizes the 3-vector to length one and returns the pointer note that this changes the vector. More... | |
| void | vec_sub (float *a, const float *b, const float *c) |
| subtract 3rd vector from 2nd and put into 1st in other words, a = b - c. More... | |
| void | vec_add (float *a, const float *b, const float *c) |
| add 2nd and 3rd elements, put into 1st. More... | |
| void | vec_incr (float *a, const float *b) |
| increment 1st vector by 2nd vector. More... | |
| void | vec_scale (float *a, float b, const float *c) |
| a = b*c. More... | |
| void | vec_scale (float *a, float b, const double *c) |
| a = b*c. More... | |
| void | vec_negate (float *a, const float *b) |
| a = -b. More... | |
| void | vec_scaled_add (float *a, float b, const float *c) |
| a += c*d. More... | |
| void | vec_triad (float *a, const float *b, float c, const float *d) |
| a = b + c*d (name taken from STREAM benchmark routine). More... | |
| void | vec_lerp (float *a, const float *b, const float *c, float frac) |
| perform linear interpolation between two vectors a = b + frac*(c-b). More... | |
| void | vec_zero (float *a) |
| void | clamp_color (float *rgb) |
| void | midpoint (float *a, const float *b, const float *c) |
| compute the midpoint a between two vectors b & c (a = (b + c)/2). More... | |
| void | create_Bspline_basis (float array[4][4]) |
| define a cubic spline with a B-Spline basis. More... | |
| void | create_modified_CR_spline_basis (float array[4][4], float slope) |
| define a cubic spline with a Catmull-Rom basis. More... | |
| void | make_spline_Q_matrix (float q[4][3], float basis[4][4], const float *pts) |
| Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point. More... | |
| void | make_spline_Q_matrix_noncontig (float q[4][3], float basis[4][4], const float *pts1, const float *pts2, const float *pts3, const float *pts4) |
| Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point. This one works with non-contiguous memory layouts. More... | |
| void | make_spline_interpolation (float out[3], float w, float q[4][3]) |
| Evaluate the spline to return a point on the curve specified by the w parameter, in the range 0 to 1. XXX an improved implementation might use forward differences to find the points on the curve rather than explicitly evaluating points one at a time. Forward differences should be much faster, since it can be done with 9 additions and no multiplies, whereas this code has to do 9 multiplies as well as 9 additions for each point. The forward difference method requires setup, and some extra storage for it's position/velocity/acceleration accumulators however, so it may be an even trade-off. More... | |
| int | tri_degenerate (const float *, const float *, const float *) |
| determine if a triangle is degenerate or not. More... | |
| float | angle (const float *, const float *) |
| compute the angle between two vectors a & b (0 to 180 deg). More... | |
| float | dihedral (const float *, const float *, const float *, const float *) |
| Compute the dihedral angle for the given atoms, returning a value between -180 and 180. More... | |
| float | distance (const float *, const float *) |
| compute the distance between two points a & b. More... | |
| float | distance2 (const float *a, const float *b) |
| compute the squared distance between two points a & b. More... | |
| float | norm (const float *) |
| find and return the norm of a 3-vector. More... | |
| char * | vmd_tempfile (const char *) |
| VMD temp file (portable) given a string, return a new one with the temp dir name prepended. The returned string must be deleted. More... | |
| int | vmd_delete_file (const char *) |
| VMD file deletion function (portable). More... | |
| void | vmd_sleep (int) |
| VMD process sleep functions (portable). More... | |
| void | vmd_msleep (int) |
| int | vmd_system (const char *cmd) |
| a buffer function to system() call to be replaced by a different implementation in console-free Win32 applications. More... | |
| void | vmd_srandom (unsigned int) |
| portable random number generation, NOT thread-safe however. More... | |
| long | vmd_random () |
| portable random number generation, NOT thread-safe however XXX we should replace these with our own thread-safe random number generator implementation at some point. More... | |
| float | vmd_random_gaussian () |
| Slow but accurate standard distribution random number generator (variance = 1). More... | |
| long | vmd_get_total_physmem_mb (void) |
| return the number of MB of physical memory installed in the system. More... | |
| long | vmd_get_avail_physmem_mb (void) |
| return the number of MB of physical memory "free" (no VM/swap counted...). More... | |
| long | vmd_get_avail_physmem_percent (void) |
| return the percentage of physical memory available. More... | |
|
|
Definition at line 35 of file utilities.h. |
|
|
Definition at line 44 of file utilities.h. Referenced by compute_angle_energy, compute_dihed_energy, compute_imprp_energy, Timestep::get_transform_vectors, measure_surface_int, obj_transabout, Matrix4::rot, Quat::rotate, and Symmetry::Symmetry. |
|
|
Definition at line 26 of file utilities.h. |
|
|
|
Definition at line 45 of file utilities.h. Referenced by myfit3, Matrix4::rotate_axis, transvec, Matrix4::transvec, transvecinv, and Matrix4::transvecinv. |
|
|
Definition at line 27 of file utilities.h. |
|
|
Definition at line 41 of file utilities.h. Referenced by RenderManDisplayDevice::write_header, LibGelatoDisplayDevice::write_header, and GelatoDisplayDevice::write_header. |
|
|
|
Definition at line 448 of file utilities.h. Referenced by VolMapCreateFastEnergy::compute_init, VolMapCreateSlowEnergy::compute_init, measure_sasa, and vmd_random_gaussian. |
|
|
Definition at line 40 of file utilities.h. Referenced by FileRenderer::cone, FileRenderer::cylinder, fullcirclearc, HSItoRGB, and DispCmdCylinder::putdata. |
|
|
a timer handle.
Definition at line 81 of file utilities.h. Referenced by VolMapCreate::compute_all, cudabusbw, cudaenergythread, cudamaddgflops, energythread, Symmetry::guess, stream_bench, stringdup, vmd_cuda_vol_cpotential, vmd_timer_create, vmd_timer_destroy, vmd_timer_start, vmd_timer_stop, vmd_timer_time, vmd_timer_timenow, vol_cpotential, and vol_cpotential_cpu. |
|
||||||||||||
|
compute the angle between two vectors a & b (0 to 180 deg).
Definition at line 493 of file utilities.C. Referenced by GeometryAngle::calculate, calculate_angle, and vmd_measure_hbonds. |
|
||||||||||||||||
|
break a file name up into path + name, returning both in the specified character pointers. This creates storage for the new strings by allocating space for them.
Definition at line 156 of file utilities.C. Referenced by Molecule::Molecule. |
|
|
Definition at line 211 of file utilities.h. Referenced by cremer_pople_ring_color, and hill_reilly_ring_color. |
|
||||||||||||||||
|
clamp an integer value to the range min->max.
Definition at line 112 of file utilities.h. Referenced by VolumetricData::compute_volume_gradient. |
|
||||||||||||||||
|
given an argc, argv pair, take all the arguments from the Nth one on and combine them into a single string with spaces separating words. This allocates space for the string, which must be freed by the user.
Definition at line 60 of file utilities.C. Referenced by text_cmd_mol, and text_cmd_render. |
|
|
define a cubic spline with a B-Spline basis.
Definition at line 269 of file utilities.h. |
|
||||||||||||
|
define a cubic spline with a Catmull-Rom basis.
Definition at line 289 of file utilities.h. Referenced by DrawMolItem::DrawMolItem. |
|
||||||||||||||||
|
compute the cross product, assumes that x1 memory is _different_ than both x2 and x3, and returns the pointer to x1.
Definition at line 415 of file utilities.C. Referenced by align_plane_with_axis, angle, IsoSurface::compute, Vrml2DisplayDevice::cone, FileRenderer::cone, Vrml2DisplayDevice::cylinder, FileRenderer::cylinder, dihedral, hill_reilly_ring_color, DispCmdCylinder::putdata, DispCmdSquare::putdata, DispCmdTriangle::putdata, ring_axes, and POV3DisplayDevice::tricolor. |
|
||||||||||||||||||||
|
Compute the dihedral angle for the given atoms, returning a value between -180 and 180.
Definition at line 505 of file utilities.C. Referenced by GeometryDihedral::calculate, and calculate_dihed. |
|
||||||||||||
|
compute the distance between two points a & b.
Definition at line 524 of file utilities.C. Referenced by VrmlDisplayDevice::cone, Vrml2DisplayDevice::cone, convert_endpoints_to_matrix, VrmlDisplayDevice::cylinder, Vrml2DisplayDevice::cylinder, RotateTool::do_event, and trans_overlap. |
|
||||||||||||
|
compute the squared distance between two points a & b.
Definition at line 402 of file utilities.h. Referenced by distance, measure_rgyr, measure_rmsd, measure_rmsf, trans_overlap, vmd_gridsearch1, vmd_gridsearch2, and vmd_gridsearch3. |
|
||||||||||||
|
||||||||||||
|
compute the inner dot product.
Definition at line 121 of file utilities.h. |
|
||||||||||||||||
|
Evaluate the spline to return a point on the curve specified by the w parameter, in the range 0 to 1. XXX an improved implementation might use forward differences to find the points on the curve rather than explicitly evaluating points one at a time. Forward differences should be much faster, since it can be done with 9 additions and no multiplies, whereas this code has to do 9 multiplies as well as 9 additions for each point. The forward difference method requires setup, and some extra storage for it's position/velocity/acceleration accumulators however, so it may be an even trade-off.
Definition at line 381 of file utilities.h. |
|
||||||||||||||||
|
Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point.
Definition at line 314 of file utilities.h. |
|
||||||||||||||||||||||||||||
|
Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point. This one works with non-contiguous memory layouts.
Definition at line 338 of file utilities.h. |
|
||||||||||||||||
|
compute the midpoint a between two vectors b & c (a = (b + c)/2).
Definition at line 231 of file utilities.h. Referenced by GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAngle::create_cmd_list, and set_scale. |
|
|
initialize periodic status message timer.
Definition at line 317 of file utilities.C. Referenced by bondsearchthread, cudaenergythread, energythread, measure_gofr, and vmd_gridsearch1. |
|
|
destroy message timer.
Definition at line 343 of file utilities.C. Referenced by bondsearchthread, cudaenergythread, energythread, measure_gofr, and vmd_gridsearch1. |
|
|
return true if it's time to print a status update message.
Definition at line 329 of file utilities.C. Referenced by bondsearchthread, cudaenergythread, energythread, measure_gofr_orth, and vmd_gridsearch1. |
|
|