Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
Loading...
Searching...
No Matches
torque.h
1#pragma once
2#include "ff/precision.h"
3#include "seq/seq.h"
4
5namespace tinker {
7inline real torqueDot(const real* restrict a, const real* restrict b)
8{
9 return (a[0] * b[0] + a[1] * b[1] + a[2] * b[2]);
10}
11
13inline void torqueCross(real* restrict ans, const real* restrict u,
14 const real* restrict v)
15{
16 ans[0] = u[1] * v[2] - u[2] * v[1];
17 ans[1] = u[2] * v[0] - u[0] * v[2];
18 ans[2] = u[0] * v[1] - u[1] * v[0];
19}
20
22inline void torqueNormal(real* restrict a, real _1_na)
23{
24 a[0] *= _1_na;
25 a[1] *= _1_na;
26 a[2] *= _1_na;
27}
28}
#define SEQ_ROUTINE
Definition: acc/seqdef.h:7
#define restrict
Definition: macro.h:51
float real
Definition: precision.h:80
Definition: testrt.h:9
__device__ void torqueNormal(real *__restrict__ a, real _1_na)
Definition: torque.h:22
__device__ void torqueCross(real *__restrict__ ans, const real *__restrict__ u, const real *__restrict__ v)
Definition: torque.h:13
__device__ real torqueDot(const real *__restrict__ a, const real *__restrict__ b)
Definition: torque.h:7