Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
a175aeba
"platforms/cpu/src/CpuNonbondedForceVec8.cpp" did not exist on "6eacad45c8e1aca19af6d7a6f599442acf1c3db5"
Commit
a175aeba
authored
May 15, 2013
by
Peter Eastman
Browse files
Added division operator to Vec3 and RealVec
parent
65caf22b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
openmmapi/include/openmm/Vec3.h
openmmapi/include/openmm/Vec3.h
+16
-1
platforms/reference/src/SimTKUtilities/RealVec.h
platforms/reference/src/SimTKUtilities/RealVec.h
+16
-1
No files found.
openmmapi/include/openmm/Vec3.h
View file @
a175aeba
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008 Stanford University and the Authors.
*
* Portions copyright (c) 2008
-2013
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -127,6 +127,21 @@ public:
return
*
this
;
}
// scalar division
Vec3
operator
/
(
double
rhs
)
const
{
const
Vec3
&
lhs
=
*
this
;
double
scale
=
1.0
/
rhs
;
return
Vec3
(
lhs
[
0
]
*
scale
,
lhs
[
1
]
*
scale
,
lhs
[
2
]
*
scale
);
}
Vec3
&
operator
/=
(
double
rhs
)
{
double
scale
=
1.0
/
rhs
;
data
[
0
]
*=
scale
;
data
[
1
]
*=
scale
;
data
[
2
]
*=
scale
;
return
*
this
;
}
// dot product
double
dot
(
const
Vec3
&
rhs
)
const
{
const
Vec3
&
lhs
=
*
this
;
...
...
platforms/reference/src/SimTKUtilities/RealVec.h
View file @
a175aeba
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-201
0
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
3
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -136,6 +136,21 @@ public:
return
*
this
;
}
// scalar division
RealVec
operator
/
(
double
rhs
)
const
{
const
RealVec
&
lhs
=
*
this
;
double
scale
=
1.0
/
rhs
;
return
RealVec
(
lhs
[
0
]
*
scale
,
lhs
[
1
]
*
scale
,
lhs
[
2
]
*
scale
);
}
RealVec
&
operator
/=
(
double
rhs
)
{
double
scale
=
1.0
/
rhs
;
data
[
0
]
*=
scale
;
data
[
1
]
*=
scale
;
data
[
2
]
*=
scale
;
return
*
this
;
}
// dot product
RealOpenMM
dot
(
const
RealVec
&
rhs
)
const
{
const
RealVec
&
lhs
=
*
this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment