PROFASI  Version 1.5
Public Member Functions | List of all members
prf::FindCoord Class Reference

Simple but very useful class used widely in PROFASI to get coordinates. More...

#include <FindCoord.hh>

Public Member Functions

 FindCoord ()
 
 FindCoord (double gu, double gv, double gw, double gthuv, double gthvw)
 Lengths of u, v and w, u-v angle and v-w angle given.
 
 FindCoord (double gu, double gv, double gw, double gthuv, double gthvw, double gh)
 Lengths of u, v, w, u-v and v-w angle and u-v-w torsion angle given.
 
void Initialize (double gu, double gv, double gw, double gthuv, double gthvw)
 Assign properties later, if default constructor was used.
 
void Initialize (double gu, double gv, double gw, double gthuv, double gthvw, double gh)
 Assign properties later, if default constructor was used.
 
Vector3 operator() (const Vector3 &, const Vector3 &)
 Find a vector w, given vectors u and v.
 
Vector3 operator() (const Vector3 &, const Vector3 &, double)
 Find a vector w, given vectors u and v, and torsional angle phi.
 
Vector3 fresh_eval (Vector3, Vector3, double)
 Fresh evaluation of w, without using precalculated constants.
 
Vector3 operator() (const Vector3 &, const Vector3 &, const Vector3 &)
 Even lazier: Assume U, V and their cross product UV are given.
 
Vector3 operator() (const Vector3 &, const Vector3 &, const Vector3 &, double)
 U, V, U cross V and phi are given.
 
void FixPhi (double gph)
 Precalculate constants assuming that phi is fixed.
 

Detailed Description

The task performed by this class is well-defined. We have vectors u and v given. We want to find a vector w, which has a certain length, a certain angle with v, thvw, a certain torsional orientation about v with respect to a direction defined by u.

The vector w can be expressed as a linear combination of u, v and u*v where u*v is the cross product. Often in an application, u and v would have fixed lengths, angles, and even the length of w and the v-w angle would be known to be fixed. So, except for the torsional angle, most other constants in the linear combinations can be precalculated. This is what this class does. It precalculates those constants, and for a given phi angle, and vectors u, v, it quickly generates a vector w satisfying all conditions.

The phi angle here is defined with respect to the forward going direction of u, so that if w were parallel to u, it would have phi=0

Care has to be taken in using this class. The fast evaluation does not check if the passed u and v vectors have the correct lengths or angle between them. If they don't, the generated w would not have the right properties. This means repeated, cyclic applications will lead to divergence because numerical precision errors in the lengths of u and w will eventually get amplified to order 1. The slow fresh_eval() function will generate a vector w of required length and angles with respect to v and u, no matter if the previously known lengths of u and v don't match up. But it is much slower.

Constructor & Destructor Documentation

FindCoord::FindCoord ( )

default constructor


The documentation for this class was generated from the following files:

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2