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
e30d080c
Commit
e30d080c
authored
14 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
expose StericEnergy to the outside world
parent
071f7b6f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/qa/src/clash_score.cc
+17
-17
17 additions, 17 deletions
modules/qa/src/clash_score.cc
modules/qa/src/clash_score.hh
+4
-1
4 additions, 1 deletion
modules/qa/src/clash_score.hh
with
21 additions
and
18 deletions
modules/qa/src/clash_score.cc
+
17
−
17
View file @
e30d080c
...
@@ -24,23 +24,6 @@ namespace ost { namespace qa {
...
@@ -24,23 +24,6 @@ namespace ost { namespace qa {
namespace
{
namespace
{
Real
StericEnergy
(
const
geom
::
Vec3
&
pos1
,
Real
r1
,
const
geom
::
Vec3
&
pos2
,
Real
r2
)
{
geom
::
Vec3
d
=
pos1
-
pos2
;
// delay calculation of square root as long as possible. It is only needed
// in the rare case when 0.8254*rr <= d <= rr
Real
distance_sqr
=
geom
::
Length2
(
d
);
Real
rr
=
r1
+
r2
;
if
(
distance_sqr
>
rr
*
rr
)
{
return
0.0
;
}
if
(
distance_sqr
<
0.8254
*
0.8254
*
rr
*
rr
)
{
return
10.0
;
}
return
57.273
*
(
1.0
-
sqrt
(
distance_sqr
)
/
rr
);
}
template
<
typename
T
,
typename
I
>
template
<
typename
T
,
typename
I
>
Real
do_clash_score
(
const
T
&
ent_a
,
const
mol
::
EntityView
&
ent_b
)
Real
do_clash_score
(
const
T
&
ent_a
,
const
mol
::
EntityView
&
ent_b
)
{
{
...
@@ -61,6 +44,23 @@ Real do_clash_score(const T& ent_a, const mol::EntityView& ent_b)
...
@@ -61,6 +44,23 @@ Real do_clash_score(const T& ent_a, const mol::EntityView& ent_b)
}
}
Real
StericEnergy
(
const
geom
::
Vec3
&
pos1
,
Real
r1
,
const
geom
::
Vec3
&
pos2
,
Real
r2
)
{
geom
::
Vec3
d
=
pos1
-
pos2
;
// delay calculation of square root as long as possible. It is only needed
// in the rare case when 0.8254*rr <= d <= rr
Real
distance_sqr
=
geom
::
Length2
(
d
);
Real
rr
=
r1
+
r2
;
if
(
distance_sqr
>
rr
*
rr
)
{
return
0.0
;
}
if
(
distance_sqr
<
0.8254
*
0.8254
*
rr
*
rr
)
{
return
10.0
;
}
return
57.273
*
(
1.0
-
sqrt
(
distance_sqr
)
/
rr
);
}
Real
ClashScore
(
const
mol
::
EntityView
&
ent_a
,
const
mol
::
EntityView
&
ent_b
)
Real
ClashScore
(
const
mol
::
EntityView
&
ent_a
,
const
mol
::
EntityView
&
ent_b
)
{
{
return
do_clash_score
<
mol
::
EntityView
,
mol
::
AtomViewIter
>
(
ent_a
,
ent_b
);
return
do_clash_score
<
mol
::
EntityView
,
mol
::
AtomViewIter
>
(
ent_a
,
ent_b
);
...
...
This diff is collapsed.
Click to expand it.
modules/qa/src/clash_score.hh
+
4
−
1
View file @
e30d080c
...
@@ -52,7 +52,10 @@ Real DLLEXPORT_OST_QA ClashScore(const mol::EntityHandle& ent_a,
...
@@ -52,7 +52,10 @@ Real DLLEXPORT_OST_QA ClashScore(const mol::EntityHandle& ent_a,
/// \sa \ref the_hammer.py "The Hammer Example"
/// \sa \ref the_hammer.py "The Hammer Example"
Real
DLLEXPORT_OST_QA
ClashScore
(
const
mol
::
AtomHandle
&
atom
,
Real
DLLEXPORT_OST_QA
ClashScore
(
const
mol
::
AtomHandle
&
atom
,
const
mol
::
EntityView
&
ent_b
);
const
mol
::
EntityView
&
ent_b
);
/// \brief calculate steric energy of two atoms
Real
DLLEXPORT_OST_QA
StericEnergy
(
const
geom
::
Vec3
&
pos1
,
Real
r1
,
const
geom
::
Vec3
&
pos2
,
Real
r2
);
//@}
//@}
/// \example the_hammer.py
/// \example the_hammer.py
...
...
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