BALL 1.5.0
Loading...
Searching...
No Matches
cosineTorsion.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5#ifndef BALL_MOLMEC_PARAMETER_COSINETORSION_H
6#define BALL_MOLMEC_PARAMETER_COSINETORSION_H
7
8#ifndef BALL_FORMAT_PARAMETERSECTION_H
10#endif
11
12#ifndef BALL_MOLMEC_PARAMETER_ATOMTYPES_H
14#endif
15
16namespace BALL
17{
26 : public ParameterSection
27 {
28 public:
29
30 enum
31 {
33 };
34
36 {
37 float phase;
38 float V;
39 float f;
40 float n;
41
43 : phase(v.phase),
44 V(v.V),
45 f(v.f),
46 n(v.n)
47 {
48 }
49
51 : phase(0),
52 V(0),
53 f(0),
54 n(0)
55 {
56 }
57
58 bool operator == (const SingleValues& rhs) const
59 {
60 return ((phase == rhs.phase) && (V == rhs.V)
61 && (f == rhs.f) && (n == rhs.n));
62 }
63 };
64
66 {
71
73 : n(0),
74 values(0)
75 {
76 }
77
78 Values(Size number)
79 : n((unsigned char)number),
80 values(new SingleValues[number])
81 {
82 }
83
84 Values(const Values& v)
85 {
86 n = v.n;
87 values = new SingleValues[n];
88 for (Position i = 0; i < n; i++)
89 {
90 values[i].phase = v.values[i].phase;
91 values[i].V = v.values[i].V;
92 values[i].f = v.values[i].f;
93 values[i].n = v.values[i].n;
94 }
95 }
96
97 void set(const Values& v)
98 {
99 delete [] values;
100
101 n = v.n;
102 values = new SingleValues[n];
103 for (Position i = 0; i < n; i++)
104 {
105 values[i] = v.values[i];
106 }
107 }
108
110 {
111 delete [] values;
112 }
113
114 bool operator == (const Values& rhs) const
115 {
116 if (n != rhs.n)
117 {
118 return false;
119 }
120 for (Position i = 0; i < n; ++i)
121 {
122 if (!(values[i] == rhs.values[i]))
123 {
124 return false;
125 }
126 }
127 return true;
128 }
129
130 bool operator != (const Values& rhs) const
131 {
132 return ! operator == (rhs);
133 }
134 };
135
145
155
159
163
166 CosineTorsion(const CosineTorsion& cosine_torsion);
167
170 virtual ~CosineTorsion() ;
171
174 virtual void clear() ;
175
177
181
188 virtual bool extractSection(ForceFieldParameters& parameters, const String& section_name);
189
191 virtual bool extractSection(Parameters& parameters, const String& section_name);
192
196
200
206 Atom::Type J, Atom::Type K, Atom::Type L) const;
207
209
212
215 CosineTorsion& operator = (const CosineTorsion& cosine_torsion);
216
218
222
225 bool operator == (const CosineTorsion& cosine_torsion) const;
226
228
229 protected:
230
232
233 vector<Values> torsions_;
234
236 };
237
238} // namespace BALL
239
240#endif // BALL_MOLMEC_PARAMETER_COSINETORSION_H
UNKNOWN
Definition result.h:27
HashMap class based on the STL map (containing serveral convenience functions)
short Type
Definition atom.h:103
virtual ~CosineTorsion()
vector< Values > torsions_
bool hasParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
CosineTorsion::Values getParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
virtual bool extractSection(ForceFieldParameters &parameters, const String &section_name)
virtual void clear()
CosineTorsion(const CosineTorsion &cosine_torsion)
bool assignParameters(CosineTorsion::Values &parameters, Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
HashMap< Size, Size > torsion_hash_map_
virtual bool extractSection(Parameters &parameters, const String &section_name)
SingleValues(const SingleValues &v)
void set(const Values &v)
#define BALL_EXPORT