5 #ifndef __RD_CHIRALVIOLATIONCONTRIB_H__
6 #define __RD_CHIRALVIOLATIONCONTRIB_H__
41 double getEnergy(
double *pos)
const;
45 void getGrad(
double *pos,
double *grad)
const;
51 unsigned int idx3,
unsigned int idx4,
52 const double *pos,
unsigned int dim) {
56 pos[idx1 * dim + 1] - pos[idx4 * dim + 1],
57 pos[idx1 * dim + 2] - pos[idx4 * dim + 2]);
60 pos[idx2 * dim + 1] - pos[idx4 * dim + 1],
61 pos[idx2 * dim + 2] - pos[idx4 * dim + 2]);
64 pos[idx3 * dim + 1] - pos[idx4 * dim + 1],
65 pos[idx3 * dim + 2] - pos[idx4 * dim + 2]);
73 unsigned int idx3,
unsigned int idx4,
78 (*pts[idx1])[1] - (*pts[idx4])[1],
79 (*pts[idx1])[2] - (*pts[idx4])[2]);
82 (*pts[idx2])[1] - (*pts[idx4])[1],
83 (*pts[idx2])[2] - (*pts[idx4])[2]);
86 (*pts[idx3])[1] - (*pts[idx4])[1],
87 (*pts[idx3])[2] - (*pts[idx4])[2]);
96 unsigned int d_idx1, d_idx2, d_idx3, d_idx4;