This file is indexed.

/usr/include/ghemical/tab_mm_prmfit.h is in libghemical-dev 3.0.0-2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
// TAB_MM_PRMFIT.H : a slightly modified tables class for FF parameter fitting.

// Copyright (C) 1998 Tommi Hassinen.

// This package is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.

// This package is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this package; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

/*################################################################################################*/

#ifndef TAB_MM_PRMFIT_H
#define TAB_MM_PRMFIT_H

struct prmfit_at;		// atomtype

struct prmfit_bs;		// bond stretching
struct prmfit_ab;		// angle bending
struct prmfit_tr;		// torsion
struct prmfit_op;		// out of plane

struct prmfit_bs_query;
struct prmfit_ab_query;
struct prmfit_tr_query;
struct prmfit_op_query;

class prmfit_tables;

/*################################################################################################*/

class typerule;		// typerule.h

#include "eng1_mm_prmfit.h"
#include "conjgrad.h"

#include <vector>
using namespace std;

/*################################################################################################*/

struct prmfit_at		// atomtype
{
	i32s atomtype[2];
	
	f64 vdw_R; f64 vdw_E;
	f64 formal_charge;
	i32u flags;
	
	typerule * tr;
	char * description;
	
	/*##########################*/
	/*##########################*/
	
};

struct prmfit_bs		// bond stretching
{
	i32s atmtp[2];
	bondtype bndtp;
	
	f64 opt;
	f64 fc;
	
	f64 ci;
	
	/*##########################*/
	/*##########################*/
	
	bool operator<(const prmfit_bs & p1) const
	{
		if (atmtp[0] != p1.atmtp[0]) return (atmtp[0] < p1.atmtp[0]);
		else if (atmtp[1] != p1.atmtp[1]) return (atmtp[1] < p1.atmtp[1]);
		else return (bndtp.GetValue() < p1.bndtp.GetValue());
	}
};

struct prmfit_ab		// angle bending
{
	i32s atmtp[3];
	bondtype bndtp[2];
	
	f64 opt;
	f64 fc;
	
	/*##########################*/
	/*##########################*/
	
	bool operator<(const prmfit_ab & p1) const
	{
		if (atmtp[1] != p1.atmtp[1]) return (atmtp[1] < p1.atmtp[1]);
		else if (atmtp[0] != p1.atmtp[0]) return (atmtp[0] < p1.atmtp[0]);
		else if (atmtp[2] != p1.atmtp[2]) return (atmtp[2] < p1.atmtp[2]);
		else if (bndtp[0].GetValue() != p1.bndtp[0].GetValue()) return (bndtp[0].GetValue() < p1.bndtp[0].GetValue());
		else return (bndtp[1].GetValue() < p1.bndtp[1].GetValue());
	}
};

struct prmfit_tr		// torsion
{
	i32s atmtp[4];
	bondtype bndtp[3];
	
	f64 fc1;
	f64 fc2;
	f64 fc3;
	
	/*##########################*/
	/*##########################*/
	
	bool operator<(const prmfit_tr & p1) const
	{
		if (atmtp[1] != p1.atmtp[1]) return (atmtp[1] < p1.atmtp[1]);
		else if (atmtp[2] != p1.atmtp[2]) return (atmtp[2] < p1.atmtp[2]);
		else if (atmtp[0] != p1.atmtp[0]) return (atmtp[0] < p1.atmtp[0]);
		else if (atmtp[3] != p1.atmtp[3]) return (atmtp[3] < p1.atmtp[3]);
		else if (bndtp[1].GetValue() != p1.bndtp[1].GetValue()) return (bndtp[1].GetValue() < p1.bndtp[1].GetValue());
		else if (bndtp[0].GetValue() != p1.bndtp[0].GetValue()) return (bndtp[0].GetValue() < p1.bndtp[0].GetValue());
		else return (bndtp[2].GetValue() < p1.bndtp[2].GetValue());
	}
};

struct prmfit_op		// out of plane
{
	i32s atmtp[4];
	bondtype bndtp[3];
	
	f64 opt;
	f64 fc;
	
	/*##########################*/
	/*##########################*/
	
	bool operator<(const prmfit_op & p1) const
	{
		if (atmtp[1] != p1.atmtp[1]) return (atmtp[1] < p1.atmtp[1]);
		else if (atmtp[2] != p1.atmtp[2]) return (atmtp[2] < p1.atmtp[2]);
		else if (atmtp[0] != p1.atmtp[0]) return (atmtp[0] < p1.atmtp[0]);
		else if (atmtp[3] != p1.atmtp[3]) return (atmtp[3] < p1.atmtp[3]);
		else if (bndtp[0].GetValue() != p1.bndtp[0].GetValue()) return (bndtp[0].GetValue() < p1.bndtp[0].GetValue());
		else if (bndtp[1].GetValue() != p1.bndtp[1].GetValue()) return (bndtp[1].GetValue() < p1.bndtp[1].GetValue());
		else return (bndtp[2].GetValue() < p1.bndtp[2].GetValue());
	}
};

struct prmfit_bs_query
{
	i32s atmtp[2];		// filled by client!!!
	bondtype bndtp;		// filled by client!!!

	bool strict;		// filled by client!!!
	
	i32s index;
	bool dir;
	
	f64 opt;
	f64 fc;
	
	f64 ci;
};

struct prmfit_ab_query
{
	i32s atmtp[3];		// filled by client!!!
	bondtype bndtp[2];	// filled by client!!!

	bool strict;		// filled by client!!!

	i32s index;
	bool dir;
	
	f64 opt;
	f64 fc;
};

struct prmfit_tr_query
{
	i32s atmtp[4];		// filled by client!!!
	bondtype bndtp[3];	// filled by client!!!

	bool strict;		// filled by client!!!

	i32s index;
	bool dir;
	
	f64 fc1;
	f64 fc2;
	f64 fc3;
};

struct prmfit_op_query
{
	i32s atmtp[4];		// filled by client!!!
	bondtype bndtp[3];	// filled by client!!!

	bool strict;		// filled by client!!!

	i32s index;
	
	f64 opt;
	f64 fc;
};

/*################################################################################################*/

/// force field parameter tables.

class prmfit_tables
{
	protected:
	
	char * path;
	
	vector<prmfit_at> at2_vector;
	
	vector<prmfit_bs> bs_vector;
	vector<prmfit_ab> ab_vector;
	vector<prmfit_tr> tr_vector;
	vector<prmfit_op> op_vector;
	
	public:
	
	prmfit_tables(const char *);
	virtual ~prmfit_tables(void);
	
// strategy: the tab_mm_prmfit/eng1_mm_prmfit classes are different from the default ones,
// ^^^^^^^^^ and it seems to be OK; compatibility at parameter-file-level seems to be enough!
	
	void PrintAllTypeRules(ostream &);
	
	i32u UpdateTypes(setup *);
	i32u UpdateCharges(setup *);
	
	const prmfit_at * GetAtomType(i32s);
	
	void DoParamSearch(prmfit_bs_query *, model *);
	void DoParamSearch(prmfit_ab_query *, model *);
	void DoParamSearch(prmfit_tr_query *, model *);
	void DoParamSearch(prmfit_op_query *, model *);
};

/*################################################################################################*/

#endif	// TAB_MM_PRMFIT_H

// eof