$darkmode
DENOPTIM
TinkerBond.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2019 Vishwesh Venkatraman <vishwesh.venkatraman@ntnu.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.integration.tinker;
20
25public class TinkerBond implements Cloneable
26{
27 private TinkerAtom atoms[];
28
29//------------------------------------------------------------------------------
30
38 {
39 atoms = new TinkerAtom[2];
40 int i1 = a1.getXYZIndex();
41 int i2 = a2.getXYZIndex();
42 if (i1 < i2)
43 {
44 atoms[0] = a1;
45 atoms[1] = a2;
46 }
47 else
48 {
49 atoms[0] = a2;
50 atoms[1] = a1;
51 }
52 }
53
54//------------------------------------------------------------------------------
55
62 public TinkerAtom getAtom(int index)
63 {
64 if (index >= 0 && index < atoms.length)
65 {
66 return atoms[index];
67 }
68 return null;
69 }
70
71//------------------------------------------------------------------------------
72
73}
Based on the code from ffx.kenai.com Michael J.
Definition: TinkerAtom.java:26
int getXYZIndex()
Gets the XYZ Index.
TinkerBond(TinkerAtom a1, TinkerAtom a2)
Bond constructor.
Definition: TinkerBond.java:37
TinkerAtom getAtom(int index)
Get the constituent TinkerAtom specified by index.
Definition: TinkerBond.java:62