97 size_t len,
const double* weight) {
98 double G1 = 0.0,
G2 = 0.0;
99 for (
size_t i = 0;
i < len; ++
i) {
102 double w = (weight !=
nullptr ? weight[
i] : 1.);
105 G2 += w *
f2.length_sq();
106 mat[0][0] +=
v1.x *
f2.x;
107 mat[0][1] +=
v1.x *
f2.y;
108 mat[0][2] +=
v1.x *
f2.z;
109 mat[1][0] +=
v1.y *
f2.x;
110 mat[1][1] +=
v1.y *
f2.y;
111 mat[1][2] +=
v1.y *
f2.z;
112 mat[2][0] +=
v1.z *
f2.x;
113 mat[2][1] +=
v1.z *
f2.y;
114 mat[2][2] +=
v1.z *
f2.z;
116 return (
G1 +
G2) * 0.5;
121 double E0,
double len,
double min_score) {
126 Sxx = A[0][0];
Sxy = A[0][1];
Sxz = A[0][2];
127 Syx = A[1][0];
Syy = A[1][1];
Syz = A[1][2];
128 Szx = A[2][0];
Szy = A[2][1];
Szz = A[2][2];
170 for (
i = 0;
i < 50; ++
i) {
182 std::fprintf(
stderr,
"\nMore than %d iterations needed!\n",
i);
186 double rms = std::sqrt(std::fabs(2.0 * (
E0 -
mxEigenV) / len));
196 double a11, a12, a13,
a14,
a21, a22, a23,
a24;
271 rot->
a[0][1] = 2 * (
xy +
az);
272 rot->
a[0][2] = 2 * (
zx -
ay);
273 rot->
a[1][0] = 2 * (
xy -
az);
275 rot->
a[1][2] = 2 * (
yz +
ax);
276 rot->
a[2][0] = 2 * (
zx +
ay);
277 rot->
a[2][1] = 2 * (
yz -
ax);
287 for (
size_t i = 0;
i < len; ++
i) {
288 double w = (weight !=
nullptr ? weight[
i] : 1.);
298 size_t len,
const double* weight) {
307 if (weight ==
nullptr)
310 for (
size_t i = 0;
i < len; ++
i)
327 size_t len,
const double* weight) {
335 if (weight ==
nullptr)
338 for (
size_t i = 0;
i < len; ++
i)
Position qcp_calculate_center(const Position *pos, size_t len, const double *weight)
SupResult superpose_positions(const Position *pos1, const Position *pos2, size_t len, const double *weight)
int fast_calc_rmsd_and_rotation(Mat33 *rot, const Mat33 &A, double *rmsd, double E0, double len, double min_score)
double calculate_rmsd_of_superposed_positions(const Position *pos1, const Position *pos2, size_t len, const double *weight)
double qcp_inner_product(Mat33 &mat, const Position *pos1, const Position &ctr1, const Position *pos2, const Position &ctr2, size_t len, const double *weight)
Coordinates in Angstroms - orthogonal (Cartesian) coordinates.