Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
numeric::deriv Namespace Reference

Functions

template<class P >
void helper (xyzVector< P > const &M, xyzVector< P > const &w, xyzVector< P > &F1, xyzVector< P > &F2)
 
template<class P >
void p1_theta_deriv (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, xyzVector< P > &F1, xyzVector< P > &F2)
 
template<class P >
void x_and_dtheta_dx (xyzVector< P > const &v1, xyzVector< P > const &v2, P const n1, P const n2, P &x, P &dtheta_dx)
 
template<class P >
void p1_theta_deriv (xyzVector< P > const &p1, xyzVector< P > const &v1, xyzVector< P > const &v2, P const n1, P const n2, P const x, P const dtheta_dx, xyzVector< P > &F1, xyzVector< P > &F2)
 
template<class P >
void angle_p1_deriv (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, P &theta, xyzVector< P > &f1, xyzVector< P > &f2)
 compute f1/f2 atom derivative vectors for the first point defining an angle. Templated on the precision of the coordinates being represented. Returns the angle, theta, defined by p1->p2->p3, which should be used to evaluate dE_dtheta. dE_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians. More...
 
template<class P >
void angle_p2_deriv (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, P &theta, xyzVector< P > &f1, xyzVector< P > &f2)
 compute f1/f2 atom derivative vectors for the middle point defining an angle. Templated on the precision of the coordinates being represented. Returns the angle, theta, defined by p1->p2->p3, which should be used to evaluate the dfunc. dE_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians. More...
 
template<class P >
void angle_p1_p2_p3_deriv (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, P &theta, xyzVector< P > &f1_p1, xyzVector< P > &f2_p1, xyzVector< P > &f1_p2, xyzVector< P > &f2_p2, xyzVector< P > &f1_p3, xyzVector< P > &f2_p3)
 
template<class P >
void helper (xyzVector< P > const &M, xyzVector< P > const &v, xyzVector< P > const &w, xyzVector< P > &F1, xyzVector< P > &F2)
 
template<class P >
void dihedral_deriv_second (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, xyzVector< P > const &p4, P x, P &theta, xyzVector< P > &F1, xyzVector< P > &F2)
 Whether computing the f1/f2 derivatives for a function of a dihedral for the end points (p1 or p4) or the middle points (p2 or p3), the second half of the computation is the same. This "second" function expects the F1 and F2 arrays to have been partially computed, as well as the cosine of the angle theta. It scales the F1 and F2 vectors by dtheta_dthetaU * dthetaU_dx. More...
 
template<class P >
void dihedral_p1_cosine_deriv_first (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, xyzVector< P > const &p4, P &x, bool &colinearity_flag, xyzVector< P > &F1, xyzVector< P > &F2)
 The first half of the computation of the f1/f2 derivatives for an end point of a dihedral. The values in the output-parameter vectors F1 and F2 are overwritten. The cosine of the dihedral theta is returned in the output parameter x. More...
 
template<class P >
void dihedral_p1_cosine_deriv (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, xyzVector< P > const &p4, P &theta, xyzVector< P > &f1, xyzVector< P > &f2)
 compute f1/f2 atom derivative vectors for one of the two end points defining a dihedral angle for some function F. Templated on the precision of the coordinates being represented. Returns the dihedral angle, theta, defined by p1->p2->p3->p4, which should be used to evaluate the derivative of the function F. dF_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians. More...
 
template<class P >
void dihedral_p2_cosine_deriv_first (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, xyzVector< P > const &p4, P &x, bool &colinearity_flag, xyzVector< P > &F1, xyzVector< P > &F2)
 The first half of the computation of the f1/f2 derivatives for a central point of a dihedral. The values in the output-parameter vectors F1 and F2 are overwritten. The cosine of the dihedral theta is returned in the output parameter x. More...
 
template<class P >
void dihedral_p2_cosine_deriv (xyzVector< P > const &p1, xyzVector< P > const &p2, xyzVector< P > const &p3, xyzVector< P > const &p4, P &theta, xyzVector< P > &f1, xyzVector< P > &f2)
 compute f1/f2 atom derivative vectors for one of the two middle points defining a dihedral angle for some function F. Templated on the precision of the coordinates being represented. Returns the dihedral angle, theta, defined by p1->p2->p3->p4, which should be used to evaluate the derivative of the function F. dF_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians. More...
 
template<class P >
void distance_f1_f2_deriv (xyzVector< P > const &p1, xyzVector< P > const &p2, P &distance, xyzVector< P > &f1, xyzVector< P > &f2)
 Compute the f1/f2 derivative vectors for point p1 for a function F of the distance between p1 and p2. This function returns the distance which should be used to evaluate dF_ddist. dF_ddist should then be multiplied into both f1 and f2. The values of the output variables f1 and f2 are overwritten. More...
 

Function Documentation

template<class P >
void numeric::deriv::angle_p1_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
P &  theta,
xyzVector< P > &  f1,
xyzVector< P > &  f2 
)
inline

compute f1/f2 atom derivative vectors for the first point defining an angle. Templated on the precision of the coordinates being represented. Returns the angle, theta, defined by p1->p2->p3, which should be used to evaluate dE_dtheta. dE_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians.

References numeric::arccos(), utility::io::oc::cout, numeric::dot(), test.T009_Exceptions::e, numeric::xyzVector< typename >::length(), test.Workshop4test::P, p1_theta_deriv(), and loops_kic::tol.

template<class P >
void numeric::deriv::angle_p1_p2_p3_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
P &  theta,
xyzVector< P > &  f1_p1,
xyzVector< P > &  f2_p1,
xyzVector< P > &  f1_p2,
xyzVector< P > &  f2_p2,
xyzVector< P > &  f1_p3,
xyzVector< P > &  f2_p3 
)
inline

useful for computing all three f1/f2 derivative vectors simultaneously. Basically a small refactoring / copy and pasting of the above code.

References numeric::arccos(), numeric::dot(), test.T009_Exceptions::e, numeric::xyzVector< typename >::length(), test.Workshop4test::P, p1_theta_deriv(), loops_kic::tol, and x_and_dtheta_dx().

template<class P >
void numeric::deriv::angle_p2_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
P &  theta,
xyzVector< P > &  f1,
xyzVector< P > &  f2 
)
inline

compute f1/f2 atom derivative vectors for the middle point defining an angle. Templated on the precision of the coordinates being represented. Returns the angle, theta, defined by p1->p2->p3, which should be used to evaluate the dfunc. dE_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians.

References ObjexxFCL::abs(), numeric::arccos(), numeric::cross(), numeric::dot(), test.T009_Exceptions::e, numeric::xyzVector< typename >::length(), test.Workshop4test::P, p1_theta_deriv(), and loops_kic::tol.

template<class P >
void numeric::deriv::dihedral_deriv_second ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
xyzVector< P > const &  p4,
x,
P &  theta,
xyzVector< P > &  F1,
xyzVector< P > &  F2 
)
inline

Whether computing the f1/f2 derivatives for a function of a dihedral for the end points (p1 or p4) or the middle points (p2 or p3), the second half of the computation is the same. This "second" function expects the F1 and F2 arrays to have been partially computed, as well as the cosine of the angle theta. It scales the F1 and F2 vectors by dtheta_dthetaU * dthetaU_dx.

References ObjexxFCL::abs(), numeric::arccos(), ASSERT_ONLY, numeric::dihedral_radians(), test.T009_Exceptions::e, max(), min(), test.Workshop4test::P, and numeric::conversions::radians().

Referenced by dihedral_p1_cosine_deriv(), and dihedral_p2_cosine_deriv().

template<class P >
void numeric::deriv::dihedral_p1_cosine_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
xyzVector< P > const &  p4,
P &  theta,
xyzVector< P > &  f1,
xyzVector< P > &  f2 
)
inline

compute f1/f2 atom derivative vectors for one of the two end points defining a dihedral angle for some function F. Templated on the precision of the coordinates being represented. Returns the dihedral angle, theta, defined by p1->p2->p3->p4, which should be used to evaluate the derivative of the function F. dF_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians.

compute f1/f2 atom derivative vectors for one of the two middle points defining a dihedral angle for some function F. Templated on the precision of the coordinates being represented. Returns the dihedral angle, theta, defined by p1->p2->p3->p4, which should be used to evaluate the derivative of the function F. dF_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians.

References dihedral_deriv_second(), dihedral_p1_cosine_deriv_first(), test.Workshop4test::P, and numeric::crick_equations::x().

template<class P >
void numeric::deriv::dihedral_p1_cosine_deriv_first ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
xyzVector< P > const &  p4,
P &  x,
bool colinearity_flag,
xyzVector< P > &  F1,
xyzVector< P > &  F2 
)
inline

The first half of the computation of the f1/f2 derivatives for an end point of a dihedral. The values in the output-parameter vectors F1 and F2 are overwritten. The cosine of the dihedral theta is returned in the output parameter x.

References ObjexxFCL::abs(), numeric::cross(), numeric::dot(), test.T009_Exceptions::e, demo.D060_Folding::f, helper(), numeric::xyzVector< typename >::length(), and test.Workshop4test::P.

Referenced by dihedral_p1_cosine_deriv().

template<class P >
void numeric::deriv::dihedral_p2_cosine_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
xyzVector< P > const &  p4,
P &  theta,
xyzVector< P > &  f1,
xyzVector< P > &  f2 
)
inline

compute f1/f2 atom derivative vectors for one of the two middle points defining a dihedral angle for some function F. Templated on the precision of the coordinates being represented. Returns the dihedral angle, theta, defined by p1->p2->p3->p4, which should be used to evaluate the derivative of the function F. dF_dtheta should then be multiplied into both derivative vectors that are returned. The values of the output variables f1 and f2 are overwritten. Theta is computed in radians.

References dihedral_deriv_second(), dihedral_p2_cosine_deriv_first(), test.Workshop4test::P, and numeric::crick_equations::x().

template<class P >
void numeric::deriv::dihedral_p2_cosine_deriv_first ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
xyzVector< P > const &  p4,
P &  x,
bool colinearity_flag,
xyzVector< P > &  F1,
xyzVector< P > &  F2 
)
inline

The first half of the computation of the f1/f2 derivatives for a central point of a dihedral. The values in the output-parameter vectors F1 and F2 are overwritten. The cosine of the dihedral theta is returned in the output parameter x.

References ObjexxFCL::abs(), numeric::cross(), numeric::dot(), test.T009_Exceptions::e, demo.D060_Folding::f, helper(), numeric::xyzVector< typename >::length(), and test.Workshop4test::P.

Referenced by dihedral_p2_cosine_deriv().

template<class P >
void numeric::deriv::distance_f1_f2_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
P &  distance,
xyzVector< P > &  f1,
xyzVector< P > &  f2 
)
inline

Compute the f1/f2 derivative vectors for point p1 for a function F of the distance between p1 and p2. This function returns the distance which should be used to evaluate dF_ddist. dF_ddist should then be multiplied into both f1 and f2. The values of the output variables f1 and f2 are overwritten.

References numeric::xyzVector< typename >::cross(), numeric::distance(), numeric::xyzVector< typename >::length(), test.Workshop4test::P, and p2.

template<class P >
void numeric::deriv::helper ( xyzVector< P > const &  M,
xyzVector< P > const &  v,
xyzVector< P > const &  w,
xyzVector< P > &  F1,
xyzVector< P > &  F2 
)
inline

References numeric::cross().

template<class P >
void numeric::deriv::helper ( xyzVector< P > const &  M,
xyzVector< P > const &  w,
xyzVector< P > &  F1,
xyzVector< P > &  F2 
)
inline
template<class P >
void numeric::deriv::p1_theta_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  p2,
xyzVector< P > const &  p3,
xyzVector< P > &  F1,
xyzVector< P > &  F2 
)
inline
template<class P >
void numeric::deriv::p1_theta_deriv ( xyzVector< P > const &  p1,
xyzVector< P > const &  v1,
xyzVector< P > const &  v2,
P const  n1,
P const  n2,
P const  x,
P const  dtheta_dx,
xyzVector< P > &  F1,
xyzVector< P > &  F2 
)
inline
template<class P >
void numeric::deriv::x_and_dtheta_dx ( xyzVector< P > const &  v1,
xyzVector< P > const &  v2,
P const  n1,
P const  n2,
P &  x,
P &  dtheta_dx 
)
inline