This file is indexed.

/usr/include/ghemical/search.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
// SEARCH.H : conformational search classes.

// 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 SEARCH_H
#define SEARCH_H

class random_search;		// DO WE NEED TO RANDOMIZE THE RANDOM NUMBER GENERATOR SOMEWAY???
class systematic_search;	// DO WE NEED TO RANDOMIZE THE RANDOM NUMBER GENERATOR SOMEWAY???
class monte_carlo_search;	// DO WE NEED TO RANDOMIZE THE RANDOM NUMBER GENERATOR SOMEWAY???

class transition_state_search;

#define UPDATEFRQ 25

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

#include "engine.h"
#include "eng1_qm.h"
#include "conjgrad.h"
#include "geomopt.h"
#include "intcrd.h"

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

/// A random conformational search (intcrd based).

class random_search
{
	protected:
	
	model * mdl; i32s molnum;
	i32s in_crdset; i32s out_crdset;
	
	i32s cycles;
	i32s optsteps;
	
	intcrd * ic;
	
	engine * eng;
	geomopt * go;
	
	i32s counter1;
	i32s counter2;
	
	f64 min_energy;
	
	public:
	
	random_search(model *, i32s, i32s, i32s, i32s, i32s);
	~random_search(void);
	
	f64 GetMinEnergy(void) { return min_energy; }
	
	// the search is split in small steps to make it "look nice" in graphic environment.
	// you should just keep callig TakeStep() until it returns a negative value...
	
	i32s TakeStep(void);
	
	public:
	
	int last_step;
	float last_E;
};

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

/// A systematic conformational search (intcrd based).

class systematic_search
{
	protected:

	model * mdl; i32s molnum;
	i32s in_crdset; i32s out_crdset;
	
	i32s divisions;
	i32s optsteps;
	
	intcrd * ic;
	
	engine * eng;
	geomopt * go;
	
	i32s nvar;
	i32s * counter1;
	i32s counter2;
	
	f64 min_energy;
	
	public:
	
	systematic_search(model *, i32s, i32s, i32s, i32s, i32s);
	~systematic_search(void);
	
	f64 GetMinEnergy(void) { return min_energy; }
	
	// the search is split in small steps to make it "look nice" in graphic environment.
	// you should just keep callig TakeStep() until it returns a negative value...
	
	i32s TakeStep(void);
};

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

/**	A monte carlo search (intcrd based). both for conformational search and for collecting 
	a set of probable states for a molecule.
*/

class monte_carlo_search
{
	protected:

	model * mdl; i32s molnum;
	i32s in_crdset; i32s out_crdset;
	
	i32s n_init_steps;
	i32s n_simul_steps;
	i32s optsteps;
	
	intcrd * ic;
	
	engine * eng;
	geomopt * go;
	
	i32s counter1;
	i32s counter2;
	
	i32s nvar;
	f64 * curr_ic1;
	f64 * curr_ic2;
	f64 curr_energy;
	
	f64 min_energy;
	
	public:
	
	monte_carlo_search(model *, i32s, i32s, i32s, i32s, i32s, i32s);
	~monte_carlo_search(void);
	
	f64 GetMinEnergy(void) { return min_energy; }
	
	// the search is split in small steps to make it "look nice" in graphic environment.
	// you should just keep callig TakeStep() until it returns a negative value...
	
	i32s TakeStep(void);
};

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

/**	A transition state search for QM methods.
	This is NOT a "gradient extremal" method, but works roughly the same way.
	Simple energy constraints are added to drive the reactants/products towards each other.
*/

class transition_state_search
{
	protected:
	
	model * mdl;
	
	setup1_qm * suQM;
	eng1_qm * engQM;
	
	bool init_failed;
	
	f64 deltae;
	f64 * target[2];
	
	f64 energy1[2];		// energy with constraints
	f64 energy2[2];		// energy without constraints
	
	f64 fc[2];
	
	f64 t_ene[2];
	f64 last_de[2];
	
	f64 p[2];		// progress ; actually a "reaction coordinate" for sorting the structures.
	bool ready[2];
	
	public:
	
	vector<i32u> patoms;		// this is for calculating the final reaction coordinates.
	vector<bond *> rbonds;		// this is for graphics only...
	vector<bond *> pbonds;		// this is for graphics only...
	
	public:
	
	transition_state_search(model *, f64, f64);
	~transition_state_search(void);
	
	bool InitFailed(void) { return init_failed; }
	
	void Run(i32s *);
	void UpdateTargets(bool *);
	
	f64 GetE(i32s p1) { return energy2[p1]; }
	f64 GetP(i32s p1) { return p[p1]; }
	
	bool GetR(i32s p1) { return ready[p1]; }
	
	protected:
	
	void SetTarget(i32s, i32s);
};

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

/**	This class finds stationary states by minimizing forces in a structure.
	Used as a final stage in the transition state search.
*/

class stationary_state_search : public conjugate_gradient
{
	protected:
	
	engine * eng;
	
	f64 * my_d1;
	
	public:
	
	stationary_state_search(engine *, i32s, f64, f64);
	~stationary_state_search(void);
	
	f64 GetValue(void);		// virtual
	
	// no GetGradient() function defined here; just use the default numerical one...
	// no GetGradient() function defined here; just use the default numerical one...
	// no GetGradient() function defined here; just use the default numerical one...
};

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

#endif	// SEARCH_H

// eof