Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
ProMod3
Commits
c80ca8be
Commit
c80ca8be
authored
Apr 7, 2016
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
Fixed columnwise sums to remove compile-flag-dependent differences in results.
parent
d2f22bc7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/superpose.cc
+23
-24
23 additions, 24 deletions
core/src/superpose.cc
with
23 additions
and
24 deletions
core/src/superpose.cc
+
23
−
24
View file @
c80ca8be
...
...
@@ -48,6 +48,17 @@ inline Real GetRMSD(const promod3::core::EMatX& pos_one,
return
std
::
sqrt
(
rmsd
/
pos_one
.
rows
());
}
// calculate average row of the point set
inline
promod3
::
core
::
ERVec3
AverageRow
(
promod3
::
core
::
EMatX
&
pos
)
{
// return pos.colwise().sum()/pos.rows();
// NOTE: the colwise-operator is opt-flag-dependent and we hence do it manually
promod3
::
core
::
ERVec3
avg_row
=
promod3
::
core
::
ERVec3
::
Zero
();
for
(
uint
i
=
0
;
i
<
pos
.
rows
();
++
i
)
{
avg_row
+=
pos
.
row
(
i
);
}
return
avg_row
/
pos
.
rows
();
}
}
...
...
@@ -61,17 +72,13 @@ Real SuperposedRMSD(EMatX& pos_one, EMatX& pos_two){
throw
promod3
::
Error
(
ss
.
str
());
}
ERVec3
avg_one
=
pos_one
.
colwise
().
sum
()
/
pos_one
.
rows
(
);
ERVec3
avg_two
=
pos_two
.
colwise
().
sum
()
/
pos_two
.
rows
(
);
ERVec3
avg_one
=
AverageRow
(
pos_one
);
ERVec3
avg_two
=
AverageRow
(
pos_two
);
// SVD only determines the rotational component of the superposition
// we need to manually shift the centers of the two point sets on onto
// origin
// we need to shift the centers of the two point sets onto origin
for
(
uint
i
=
0
;
i
<
pos_one
.
rows
();
++
i
){
pos_one
.
row
(
i
)
-=
avg_one
;
}
for
(
uint
i
=
0
;
i
<
pos_two
.
rows
();
++
i
){
pos_two
.
row
(
i
)
-=
avg_two
;
}
...
...
@@ -88,17 +95,13 @@ geom::Mat4 MinRMSDSuperposition(EMatX& pos_one, EMatX& pos_two){
throw
promod3
::
Error
(
ss
.
str
());
}
ERVec3
avg_one
=
pos_one
.
colwise
().
sum
()
/
pos_one
.
rows
(
);
ERVec3
avg_two
=
pos_two
.
colwise
().
sum
()
/
pos_two
.
rows
(
);
ERVec3
avg_one
=
AverageRow
(
pos_one
);
ERVec3
avg_two
=
AverageRow
(
pos_two
);
// SVD only determines the rotational component of the superposition
// we need to manually shift the centers of the two point sets on onto
// origin
// we need to shift the centers of the two point sets onto origin
for
(
uint
i
=
0
;
i
<
pos_one
.
rows
();
++
i
){
pos_one
.
row
(
i
)
-=
avg_one
;
}
for
(
uint
i
=
0
;
i
<
pos_two
.
rows
();
++
i
){
pos_two
.
row
(
i
)
-=
avg_two
;
}
...
...
@@ -127,17 +130,13 @@ std::pair<geom::Mat4,Real> Superposition(EMatX& pos_one, EMatX& pos_two){
throw
promod3
::
Error
(
ss
.
str
());
}
ERVec3
avg_one
=
pos_one
.
colwise
().
sum
()
/
pos_one
.
rows
(
);
ERVec3
avg_two
=
pos_two
.
colwise
().
sum
()
/
pos_two
.
rows
(
);
ERVec3
avg_one
=
AverageRow
(
pos_one
);
ERVec3
avg_two
=
AverageRow
(
pos_two
);
// SVD only determines the rotational component of the superposition
// we need to manually shift the centers of the two point sets on onto
// origin
// we need to shift the centers of the two point sets onto origin
for
(
uint
i
=
0
;
i
<
pos_one
.
rows
();
++
i
){
pos_one
.
row
(
i
)
-=
avg_one
;
}
for
(
uint
i
=
0
;
i
<
pos_two
.
rows
();
++
i
){
pos_two
.
row
(
i
)
-=
avg_two
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment