"vscode:/vscode.git/clone" did not exist on "43926c46ddf720468bf60a4f10dce60c36f1ad53"
Commit 172d41e5 authored by Mike Houston's avatar Mike Houston
Browse files

Can't use 'cross' as a variable name since that is a builtin function name

parent 211042a9
...@@ -28,9 +28,9 @@ __kernel void calcPeriodicTorsionForce(int numAtoms, int numTorsions, __global f ...@@ -28,9 +28,9 @@ __kernel void calcPeriodicTorsionForce(int numAtoms, int numTorsions, __global f
if (cosangle > 0.99f || cosangle < -0.99f) { if (cosangle > 0.99f || cosangle < -0.99f) {
// We're close to the singularity in acos(), so take the cross product and use asin() instead. // We're close to the singularity in acos(), so take the cross product and use asin() instead.
float4 cross = cross(cp0, cp1); float4 cross_prod = cross(cp0, cp1);
float scale = dot(cp0, cp0)*dot(cp1, cp1); float scale = dot(cp0, cp0)*dot(cp1, cp1);
dihedralAngle = asin(sqrt(dot(cross, cross)/scale)); dihedralAngle = asin(sqrt(dot(cross_prod, cross_prod)/scale));
if (cosangle < 0.0f) if (cosangle < 0.0f)
dihedralAngle = PI-dihedralAngle; dihedralAngle = PI-dihedralAngle;
} }
......
...@@ -28,9 +28,9 @@ __kernel void calcRBTorsionForce(int numAtoms, int numTorsions, __global float4* ...@@ -28,9 +28,9 @@ __kernel void calcRBTorsionForce(int numAtoms, int numTorsions, __global float4*
if (cosangle > 0.99f || cosangle < -0.99f) { if (cosangle > 0.99f || cosangle < -0.99f) {
// We're close to the singularity in acos(), so take the cross product and use asin() instead. // We're close to the singularity in acos(), so take the cross product and use asin() instead.
float4 cross = cross(cp0, cp1); float4 cross_prod = cross(cp0, cp1);
float scale = dot(cp0, cp0)*dot(cp1, cp1); float scale = dot(cp0, cp0)*dot(cp1, cp1);
dihedralAngle = asin(sqrt(dot(cross, cross)/scale)); dihedralAngle = asin(sqrt(dot(cross_prod, cross_prod)/scale));
if (cosangle < 0.0f) if (cosangle < 0.0f)
dihedralAngle = PI-dihedralAngle; dihedralAngle = PI-dihedralAngle;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment