Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
446fa417
Commit
446fa417
authored
12 years ago
by
Gabriel Studer
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug, that resulted in a crash, if number of iterations is set
to 1. Exit condition of for loop is now properly set.
parent
882b681e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/mol/alg/src/svd_superpose.cc
+10
-4
10 additions, 4 deletions
modules/mol/alg/src/svd_superpose.cc
with
10 additions
and
4 deletions
modules/mol/alg/src/svd_superpose.cc
+
10
−
4
View file @
446fa417
...
...
@@ -266,19 +266,20 @@ SuperpositionResult MeanSquareMinimizerImpl::MinimizeOnce() const{
SuperpositionResult
MeanSquareMinimizerImpl
::
IterativeMinimize
(
int
max_cycles
,
Real
distance_threshold
)
const
{
EMat4
transformation_matrix_old
;
EMat4
transformation_matrix
;
EMatX
transformed_atoms
;
EMatX
subset1
;
EMatX
subset2
;
EMatX
subset1
=
atoms1_
;
EMatX
subset2
=
atoms2_
;
SuperpositionResult
res
;
EMat4
diff
;
std
::
vector
<
int
>
matching_indices
;
EMat4
identity_matrix
=
EMat4
::
Identity
();
//do initial superposition
res
=
this
->
Minimize
(
atoms1_
,
atoms2_
);
transformation_matrix
=
Mat4ToEigenMat4
(
res
.
transformation
);
transformation_matrix_old
=
transformation_matrix
;
//note, that the initial superposition is the first cycle...
int
cycles
=
1
;
...
...
@@ -302,12 +303,15 @@ SuperpositionResult MeanSquareMinimizerImpl::IterativeMinimize(int max_cycles, R
res
=
this
->
Minimize
(
subset1
,
subset2
);
transformation_matrix
=
Mat4ToEigenMat4
(
res
.
transformation
);
diff
=
transformation_matrix
-
identity
_matrix
;
diff
=
transformation_matrix
_old
-
transformation
_matrix
;
if
(
diff
.
cwise
().
abs
().
sum
()
<
0.0001
){
++
cycles
;
break
;
}
transformation_matrix_old
=
transformation_matrix
;
}
res
.
rmsd_superposed_atoms
=
calc_rmsd_for_ematx
(
subset1
,
subset2
,
transformation_matrix
);
...
...
@@ -479,7 +483,9 @@ SuperpositionResult IterativeSuperposeSVD(const mol::EntityView& ev,
AtomViewList
atoms_ref
=
ev_ref
.
GetAtomList
();
MeanSquareMinimizer
msm
=
MeanSquareMinimizer
::
FromAtomLists
(
atoms
,
atoms_ref
);
SuperpositionResult
result
=
msm
.
IterativeMinimize
(
max_cycles
,
distance_threshold
);
result
.
rmsd
=
calc_rmsd_for_atom_lists
(
atoms
,
atoms_ref
,
result
.
transformation
);
if
(
apply_transform
)
{
mol
::
AtomView
jv
=
atoms
.
front
();
...
...
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
register
or
sign in
to comment