OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
stage
include
ost
mol
alg
svd_superpose.hh
Go to the documentation of this file.
1
//------------------------------------------------------------------------------
2
// This file is part of the OpenStructure project <www.openstructure.org>
3
//
4
// Copyright (C) 2008-2011 by the OpenStructure authors
5
//
6
// This library is free software; you can redistribute it and/or modify it under
7
// the terms of the GNU Lesser General Public License as published by the Free
8
// Software Foundation; either version 3.0 of the License, or (at your option)
9
// any later version.
10
// This library is distributed in the hope that it will be useful, but WITHOUT
11
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
// details.
14
//
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with this library; if not, write to the Free Software Foundation, Inc.,
17
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
//------------------------------------------------------------------------------
19
20
/*
21
* Author Juergen Haas
22
*/
23
#ifndef OST_SUPERPOSITION_HH
24
#define OST_SUPERPOSITION_HH
25
26
#include <
ost/base.hh
>
27
#include <
ost/geom/geom.hh
>
28
#include <
ost/mol/entity_view.hh
>
29
#include <
ost/mol/alg/module_config.hh
>
30
#include <
ost/mol/atom_view.hh
>
31
32
namespace
ost {
namespace
mol {
33
34
class
EntityHandle;
35
36
namespace
alg {
37
42
struct
DLLEXPORT_OST_MOL_ALG
SuperpositionResult
{
43
SuperpositionResult
()
44
: ncycles(0), rmsd(0.0), transformation() {
45
}
46
int
ncycles
;
47
Real
rmsd
;
48
Real
rmsd_superposed_atoms
;
49
Real
fraction_superposed
;
50
geom::Mat4
transformation
;
51
mol::EntityView
entity_view1
;
52
mol::EntityView
entity_view2
;
53
};
54
55
56
// the mean square minimizer is split into a private and a public class to avoid
57
// exposing the lib Eigen classes to the outside world
58
class
MeanSquareMinimizerImpl;
59
60
61
class
DLLEXPORT_OST_MOL_ALG
MeanSquareMinimizer
{
62
public
:
63
static
MeanSquareMinimizer
FromAtomLists(
const
mol::AtomViewList
& atoms,
64
const
mol::AtomViewList
& atoms_ref);
65
static
MeanSquareMinimizer
FromPointLists(
const
std::vector<geom::Vec3>& points,
66
const
std::vector<geom::Vec3>& points_ref);
67
SuperpositionResult
MinimizeOnce()
const
;
68
69
SuperpositionResult
IterativeMinimize(
int
ncycles=5,
Real
distance_threshold=2.0)
const
;
70
71
~
MeanSquareMinimizer
();
72
73
74
MeanSquareMinimizer
& operator=(
const
MeanSquareMinimizer
& rhs);
75
MeanSquareMinimizer
(
const
MeanSquareMinimizer
& rhs);
76
void
swap
(
MeanSquareMinimizer
& rhs) {
77
std::swap(rhs.
impl_
, impl_);
78
}
79
80
protected
:
81
MeanSquareMinimizer
(): impl_(NULL) {}
82
MeanSquareMinimizerImpl*
impl_
;
83
};
84
86
SuperpositionResult
DLLEXPORT_OST_MOL_ALG
SuperposeAtoms
(
const
mol::AtomViewList
& atoms1,
87
const
mol::AtomViewList
& atoms2,
88
bool
apply_transform);
90
SuperpositionResult
DLLEXPORT_OST_MOL_ALG
SuperposeSVD
(
const
mol::EntityView
& ev1,
91
const
mol::EntityView
& ev2,
92
bool
apply_transform);
93
95
SuperpositionResult
DLLEXPORT_OST_MOL_ALG
SuperposeSVD
(
const
std::vector<geom::Vec3>& pl1,
96
const
std::vector<geom::Vec3>& pl2);
97
99
SuperpositionResult
DLLEXPORT_OST_MOL_ALG
IterativeSuperposeSVD
(
const
mol::EntityView
& ev1,
100
const
mol::EntityView
& ev2,
101
int
max_cycles,
102
Real
distance_threshold,
103
bool
apply_transform);
104
106
SuperpositionResult
DLLEXPORT_OST_MOL_ALG
IterativeSuperposeSVD
(
const
std::vector<geom::Vec3>& pl1,
107
const
std::vector<geom::Vec3>& pl2,
108
int
max_cycles,
109
Real
distance_threshold);
110
111
112
114
Real
DLLEXPORT_OST_MOL_ALG
CalculateRMSD
(
const
mol::EntityView
& ev1,
115
const
mol::EntityView
& ev2,
116
const
geom::Mat4
& transformation);
117
118
119
120
}}}
//ns
121
#endif
Generated on Thu Mar 5 2015 15:19:05 for OpenStructure by
1.8.1.1