Browse Source

Partial cleanup of header files

master
Jean-Sébastien 2 years ago
parent
commit
bdf309d78c

+ 1
- 1
include/ABACUS.h View File

@@ -17,7 +17,7 @@ Purpose:  Core header file, includes all descendents.
17 17
 
18 18
 // This core header file includes all the others
19 19
 
20
-const char ABACUS_VERSION[20] = "ABACUS_0a";
20
+const char ABACUS_VERSION[20] = "1.0.0";
21 21
 
22 22
 // Standard includes
23 23
 #include <cmath>

+ 4
- 3
include/ABACUS_Heis.h View File

@@ -21,7 +21,7 @@ namespace ABACUS {
21 21
 
22 22
   // First, some global constants...
23 23
 
24
-  const long long int ID_UPPER_LIMIT = 10000000LL;  // max size of vectors we can define without seg fault
24
+  const long long int ID_UPPER_LIMIT = 10000000LL;  // max size we can define without seg fault
25 25
   const int INTERVALS_SIZE = 100000;                // size of Scan_Intervals arrays
26 26
   const int NBASESMAX = 1000; // max number of bases kept
27 27
 
@@ -30,7 +30,7 @@ namespace ABACUS {
30 30
   // Cutoffs on particle numbers
31 31
   const int MAXSTRINGS = 20;      // maximal number of particle types we allow in bases
32 32
 
33
-  const int NEXC_MAX_HEIS = 16; // maximal number of excitations (string binding/unbinding, particle-hole) considered
33
+  const int NEXC_MAX_HEIS = 16; // max nr of excitations (string binding/unbinding, particle-hole) considered
34 34
 
35 35
 
36 36
   //***********************************************************************
@@ -66,7 +66,8 @@ namespace ABACUS {
66 66
 
67 67
   //****************************************************************************
68 68
 
69
-  // Objects in class Heis_Base are a checked vector containing the number of rapidities of allowable types for a given state
69
+  // Objects in class Heis_Base are a checked vector containing the number of rapidities
70
+  // of allowable types for a given state
70 71
 
71 72
   class Heis_Base {
72 73
 

+ 106
- 45
include/ABACUS_Integ.h View File

@@ -116,7 +116,8 @@ namespace ABACUS {
116 116
 	if (i % 2 && bdry[i] < xmax_ref) xmax_reg++;
117 117
       }
118 118
 
119
-      Vect<T> new_bdry(bdry.size() + 2 * (((xmin_reg + 1) % 2 && (xmax_reg + 1) % 2) - (xmax_reg - xmin_reg)/2));
119
+      Vect<T> new_bdry(bdry.size()
120
+		       + 2 * (((xmin_reg + 1) % 2 && (xmax_reg + 1) % 2) - (xmax_reg - xmin_reg)/2));
120 121
 
121 122
       int ishift = 0;
122 123
       for (int i = 0; i <= xmin_reg; ++i) new_bdry[i] = bdry[i];
@@ -201,18 +202,40 @@ namespace ABACUS {
201 202
 
202 203
   // ******************************** Recursive integration functions ******************************
203 204
 
204
-  DP Integrate_Riemann (DP (*function) (Vect_DP), Vect_DP& args, int arg_to_integ, DP xmin, DP xmax, int Npts);
205
-  DP Integrate_Riemann_using_table (DP (*function) (Vect_DP, I_table), Vect_DP& args, int arg_to_integ, I_table Itable,
205
+  DP Integrate_Riemann (DP (*function) (Vect_DP),
206
+			Vect_DP& args, int arg_to_integ,
207
+			DP xmin, DP xmax,
208
+			int Npts);
209
+
210
+  DP Integrate_Riemann_using_table (DP (*function) (Vect_DP, I_table),
211
+				    Vect_DP& args, int arg_to_integ,
212
+				    I_table Itable,
206 213
 				    DP xmin, DP xmax, int Npts);
207 214
 
208
-  DP Integrate_rec (DP (*function) (Vect_DP), Vect_DP& args, int arg_to_integ, DP xmin, DP xmax, DP req_prec, int max_rec_level);
209
-  DP Integrate_rec_using_table (DP (*function) (Vect_DP, I_table), Vect_DP& args, int arg_to_integ, I_table Itable,
210
-				DP xmin, DP xmax, DP req_prec, int max_rec_level);
211
-  DP Integrate_rec_using_table (DP (*function) (Vect_DP, I_table), Vect_DP& args, int arg_to_integ, I_table Itable,
212
-				DP xmin, DP xmax, DP req_prec, int max_rec_level, std::ofstream& outfile);
213
-  DP Integrate_rec_using_table_and_file (DP (*function) (Vect_DP, I_table, std::ofstream&), Vect_DP& args,
214
-					 int arg_to_integ, I_table Itable,
215
-					 DP xmin, DP xmax, DP req_prec, int max_rec_level, std::ofstream& outfile);
215
+  DP Integrate_rec (DP (*function) (Vect_DP),
216
+		    Vect_DP& args, int arg_to_integ,
217
+		    DP xmin, DP xmax,
218
+		    DP req_prec, int max_rec_level);
219
+
220
+  DP Integrate_rec_using_table (DP (*function) (Vect_DP, I_table),
221
+				Vect_DP& args, int arg_to_integ,
222
+				I_table Itable,
223
+				DP xmin, DP xmax,
224
+				DP req_prec, int max_rec_level);
225
+
226
+  DP Integrate_rec_using_table (DP (*function) (Vect_DP, I_table),
227
+				Vect_DP& args, int arg_to_integ,
228
+				I_table Itable,
229
+				DP xmin, DP xmax,
230
+				DP req_prec, int max_rec_level,
231
+				std::ofstream& outfile);
232
+
233
+  DP Integrate_rec_using_table_and_file (DP (*function) (Vect_DP, I_table, std::ofstream&),
234
+					 Vect_DP& args, int arg_to_integ,
235
+					 I_table Itable,
236
+					 DP xmin, DP xmax,
237
+					 DP req_prec, int max_rec_level,
238
+					 std::ofstream& outfile);
216 239
 
217 240
 
218 241
 
@@ -248,34 +271,70 @@ namespace ABACUS {
248 271
     DP xmax;
249 272
 
250 273
   public:
251
-    Integral_data (DP (*function_ref) (Vect_DP), Vect_DP& args, int arg_to_integ_ref, DP xmin_ref, DP xmax_ref);
252
-    Integral_data (DP (*function_ref) (Vect_DP, I_table), Vect_DP& args, int arg_to_integ_ref,
253
-		   I_table Itable, DP xmin_ref, DP xmax_ref);
254
-    Integral_data (DP (*function_ref) (Vect_DP, Integral_table), Vect_DP& args, int arg_to_integ_ref,
255
-		   Integral_table Itable, DP xmin_ref, DP xmax_ref);
274
+    Integral_data (DP (*function_ref) (Vect_DP),
275
+		   Vect_DP& args, int arg_to_integ_ref,
276
+		   DP xmin_ref, DP xmax_ref);
277
+
278
+    Integral_data (DP (*function_ref) (Vect_DP, I_table),
279
+		   Vect_DP& args, int arg_to_integ_ref,
280
+		   I_table Itable,
281
+		   DP xmin_ref, DP xmax_ref);
282
+
283
+    Integral_data (DP (*function_ref) (Vect_DP, Integral_table),
284
+		   Vect_DP& args, int arg_to_integ_ref,
285
+		   Integral_table Itable,
286
+		   DP xmin_ref, DP xmax_ref);
287
+
256 288
     void Save (std::ofstream& outfile);
257
-    void Improve_estimate (DP (*function) (Vect_DP), Vect_DP& args, int arg_to_integ, int Npts_max);
258
-    void Improve_estimate (DP (*function) (Vect_DP, I_table), Vect_DP& args, int arg_to_integ, I_table Itable, int Npts_max);
259
-    void Improve_estimate (DP (*function) (Vect_DP, Integral_table), Vect_DP& args, int arg_to_integ,
260
-			   Integral_table Itable, int Npts_max);
261
-    ~Integral_data ();
262 289
 
263
-  };
290
+    void Improve_estimate (DP (*function) (Vect_DP),
291
+			   Vect_DP& args, int arg_to_integ,
292
+			   int Npts_max);
264 293
 
265
-  Integral_result Integrate_optimal (DP (*function) (Vect_DP), Vect_DP& args,
266
-				     int arg_to_integ, DP xmin, DP xmax, DP req_rel_prec, DP req_abs_prec, int max_nr_pts);
267
-  Integral_result Integrate_optimal_using_table (DP (*function) (Vect_DP, I_table Itable), Vect_DP& args, int arg_to_integ,
268
-						 I_table Itable, DP xmin, DP xmax, DP req_rel_prec, DP req_abs_prec, int max_nr_pts);
269
-  Integral_result Integrate_optimal_using_table (DP (*function) (Vect_DP, Integral_table Itable), Vect_DP& args, int arg_to_integ,
270
-						 Integral_table Itable, DP xmin, DP xmax, DP req_rel_prec,
271
-						 DP req_abs_prec, int max_nr_pts);
294
+    void Improve_estimate (DP (*function) (Vect_DP, I_table),
295
+			   Vect_DP& args, int arg_to_integ,
296
+			   I_table Itable,
297
+			   int Npts_max);
272 298
 
273
-  Integral_result Integrate_optimal_using_table (DP (*function) (Vect_DP, I_table Itable), Vect_DP& args, int arg_to_integ,
274
-						 I_table Itable, DP xmin, DP xmax, DP req_rel_prec,
275
-						 DP req_abs_prec, int max_nr_pts, std::ofstream& outfile);
299
+    void Improve_estimate (DP (*function) (Vect_DP, Integral_table),
300
+			   Vect_DP& args, int arg_to_integ,
301
+			   Integral_table Itable,
302
+			   int Npts_max);
276 303
 
304
+    ~Integral_data ();
277 305
 
278
-  // ******************************** Recursive version:  optimal, complex implementation ******************************
306
+  };
307
+
308
+  Integral_result Integrate_optimal (DP (*function) (Vect_DP),
309
+				     Vect_DP& args, int arg_to_integ,
310
+				     DP xmin, DP xmax,
311
+				     DP req_rel_prec, DP req_abs_prec,
312
+				     int max_nr_pts);
313
+
314
+  Integral_result Integrate_optimal_using_table (DP (*function) (Vect_DP, I_table Itable),
315
+						 Vect_DP& args, int arg_to_integ,
316
+						 I_table Itable,
317
+						 DP xmin, DP xmax,
318
+						 DP req_rel_prec, DP req_abs_prec,
319
+						 int max_nr_pts);
320
+
321
+  Integral_result Integrate_optimal_using_table (DP (*function) (Vect_DP, Integral_table Itable),
322
+						 Vect_DP& args, int arg_to_integ,
323
+						 Integral_table Itable,
324
+						 DP xmin, DP xmax,
325
+						 DP req_rel_prec, DP req_abs_prec,
326
+						 int max_nr_pts);
327
+
328
+  Integral_result Integrate_optimal_using_table (DP (*function) (Vect_DP, I_table Itable),
329
+						 Vect_DP& args, int arg_to_integ,
330
+						 I_table Itable,
331
+						 DP xmin, DP xmax,
332
+						 DP req_rel_prec, DP req_abs_prec,
333
+						 int max_nr_pts,
334
+						 std::ofstream& outfile);
335
+
336
+
337
+  // ********************** Recursive version:  optimal, complex implementation ********************
279 338
 
280 339
   // NB:  function returns complex values but takes real arguments
281 340
 
@@ -307,23 +366,25 @@ namespace ABACUS {
307 366
     DP xmax;
308 367
 
309 368
   public:
310
-    Integral_data_CX (std::complex<DP> (*function_ref) (Vect_DP), Vect_DP& args, int arg_to_integ_ref, DP xmin_ref, DP xmax_ref);
311
-    void Save (std::ofstream& outfile);
312
-    void Improve_estimate (std::complex<DP> (*function) (Vect_DP), Vect_DP& args, int arg_to_integ, int Npts_max);
313
-    ~Integral_data_CX ();
369
+    Integral_data_CX (std::complex<DP> (*function_ref) (Vect_DP),
370
+		      Vect_DP& args, int arg_to_integ_ref,
371
+		      DP xmin_ref, DP xmax_ref);
314 372
 
315
-  };
316
-
317
-  Integral_result_CX Integrate_optimal (std::complex<DP> (*function) (Vect_DP), Vect_DP& args, int arg_to_integ, DP xmin, DP xmax,
318
-					DP req_rel_prec, DP req_abs_prec, int max_nr_pts);
319
-  //Integral_result_CX Integrate_optimal_using_table (DP (*function) (Vect_DP, I_table Itable), Vect_DP& args, int arg_to_integ,
320
-  //					 I_table Itable, DP xmin, DP xmax, DP req_rel_prec, DP req_abs_prec, int max_nr_pts);
321
-  //Integral_result_CX Integrate_optimal_using_table (DP (*function) (Vect_DP, I_table Itable), Vect_DP& args, int arg_to_integ,
322
-  //					 I_table Itable, DP xmin, DP xmax, DP req_rel_prec, DP req_abs_prec, int max_nr_pts, std::ofstream& outfile);
373
+    void Save (std::ofstream& outfile);
323 374
 
375
+    void Improve_estimate (std::complex<DP> (*function) (Vect_DP),
376
+			   Vect_DP& args, int arg_to_integ,
377
+			   int Npts_max);
324 378
 
379
+    ~Integral_data_CX ();
325 380
 
381
+  };
326 382
 
383
+  Integral_result_CX Integrate_optimal (std::complex<DP> (*function) (Vect_DP),
384
+					Vect_DP& args, int arg_to_integ,
385
+					DP xmin, DP xmax,
386
+					DP req_rel_prec, DP req_abs_prec,
387
+					int max_nr_pts);
327 388
 
328 389
 } // namespace ABACUS
329 390
 

+ 1
- 1
include/ABACUS_Matrix.h View File

@@ -8,7 +8,7 @@ Copyright (c) J.-S. Caux.
8 8
 
9 9
 File:  ABACUS_Matrix.h
10 10
 
11
-Purpose:  Declares square matrix class.
11
+Purpose:  Declares square and rectangular matrix classes.
12 12
 
13 13
 ***********************************************************/
14 14
 

+ 6
- 3
include/ABACUS_Spec_Fns.h View File

@@ -26,7 +26,8 @@ namespace ABACUS {
26 26
     // Refer to GR[6] 8.23
27 27
 
28 28
     if (x <= 0.0) {
29
-      std::cout << "Cosine_Integral called with real argument " << x << " <= 0, which is ill-defined because of the branch cut." << std::endl;
29
+      std::cout << "Cosine_Integral called with real argument "
30
+		<< x << " <= 0, which is ill-defined because of the branch cut." << std::endl;
30 31
       ABACUSerror("");
31 32
     }
32 33
 
@@ -59,7 +60,8 @@ namespace ABACUS {
59 60
 
60 61
     else { // Use high x power series
61 62
 
62
-      // Ci (x) = \frac{\sin x}{x} \sum_{n=0}^\infty (-1)^n (2n)! x^{-2n} - \frac{\cos x}{x} \sum_{n=0}^\infty (-1)^n (2n+1)! x^{-2n-1}
63
+      // Ci (x) = \frac{\sin x}{x} \sum_{n=0}^\infty (-1)^n (2n)! x^{-2n}
64
+      //        - \frac{\cos x}{x} \sum_{n=0}^\infty (-1)^n (2n+1)! x^{-2n-1}
63 65
 
64 66
       int n = 0;
65 67
       DP minonetothen = 1.0;
@@ -167,7 +169,8 @@ namespace ABACUS {
167 169
     int max_nr_pts = 10000;
168 170
     Integral_result integ_ln_Gamma = Integrate_optimal (ln_Gamma_for_Barnes_G_RE, args, 0, 0.0, z - 1.0, req_rel_prec, req_abs_prec, max_nr_pts);
169 171
 
170
-    return(0.5 * (z - 1.0) * (2.0 - z + logtwoPI) + (z - 1.0) * real(ln_Gamma(std::complex<double>(z - 1.0))) - integ_ln_Gamma.integ_est);
172
+    return(0.5 * (z - 1.0) * (2.0 - z + logtwoPI)
173
+	   + (z - 1.0) * real(ln_Gamma(std::complex<double>(z - 1.0))) - integ_ln_Gamma.integ_est);
171 174
   }
172 175
 
173 176
 } // namespace ABACUS

+ 44
- 19
include/ABACUS_Utils.h View File

@@ -39,7 +39,9 @@ namespace ABACUS {
39 39
 
40 40
   // Inexplicably missing string functions in standard library:
41 41
 
42
-  inline std::string replace(const std::string& str, const std::string& from, const std::string& to) {
42
+  inline std::string replace(const std::string& str,
43
+			     const std::string& from,
44
+			     const std::string& to) {
43 45
     std::string repl = str;
44 46
     size_t start_pos = repl.find(from);
45 47
     if(start_pos < std::string::npos)
@@ -47,7 +49,9 @@ namespace ABACUS {
47 49
     return repl;
48 50
   }
49 51
 
50
-  inline std::string replace_all(const std::string& str, const std::string& from, const std::string& to) {
52
+  inline std::string replace_all(const std::string& str,
53
+				 const std::string& from,
54
+				 const std::string& to) {
51 55
     std::string repl = str;
52 56
     if(from.empty())
53 57
       return repl;
@@ -125,7 +129,8 @@ namespace ABACUS {
125 129
     int ans = 0;
126 130
 
127 131
     if (N < 0) {
128
-      std::cerr << "Error:  factorial of negative number.  Exited." << std::endl;
132
+      std::cerr << "Error:  factorial of negative number.  Exited."
133
+		<< std::endl;
129 134
       exit(1);
130 135
     }
131 136
     else if ( N == 1  ||  N == 0) ans = 1;
@@ -139,7 +144,8 @@ namespace ABACUS {
139 144
     DP ans = 0.0;
140 145
 
141 146
     if (N < 0) {
142
-      std::cerr << "Error:  factorial of negative number.  Exited." << std::endl;
147
+      std::cerr << "Error:  factorial of negative number.  Exited."
148
+		<< std::endl;
143 149
       exit(1);
144 150
     }
145 151
     else if ( N == 1  ||  N == 0) ans = 0.0;
@@ -153,7 +159,8 @@ namespace ABACUS {
153 159
     long long int ans = 0;
154 160
 
155 161
     if (N < 0) {
156
-      std::cerr << "Error:  factorial of negative number.  Exited." << std::endl;
162
+      std::cerr << "Error:  factorial of negative number.  Exited."
163
+		<< std::endl;
157 164
       exit(1);
158 165
     }
159 166
     else if ( N == 1  ||  N == 0) ans = 1;
@@ -167,7 +174,8 @@ namespace ABACUS {
167 174
     unsigned long long int ans = 0;
168 175
 
169 176
     if (N < 0) {
170
-      std::cerr << "Error:  factorial of negative number.  Exited." << std::endl;
177
+      std::cerr << "Error:  factorial of negative number.  Exited."
178
+		<< std::endl;
171 179
       exit(1);
172 180
     }
173 181
     else if ( N == 1  ||  N == 0) ans = 1;
@@ -182,7 +190,8 @@ namespace ABACUS {
182 190
 
183 191
     int ans = 0;
184 192
     if (N1 < N2) {
185
-      std::cout << "Error:  N1 smaller than N2 in choose.  Exited." << std::endl;
193
+      std::cout << "Error:  N1 smaller than N2 in choose.  Exited."
194
+		<< std::endl;
186 195
       exit(1);
187 196
     }
188 197
     else if (N1 == N2) ans = 1;
@@ -203,7 +212,8 @@ namespace ABACUS {
203 212
 
204 213
     DP ans = 0.0;
205 214
     if (N1 < N2) {
206
-      std::cout << "Error:  N1 smaller than N2 in choose.  Exited." << std::endl;
215
+      std::cout << "Error:  N1 smaller than N2 in choose.  Exited."
216
+		<< std::endl;
207 217
       exit(1);
208 218
     }
209 219
     else if (N1 == N2) ans = 0.0;
@@ -219,13 +229,14 @@ namespace ABACUS {
219 229
 
220 230
     long long int ans = 0;
221 231
     if (N1 < N2) {
222
-      std::cout << "Error:  N1 smaller than N2 in choose.  Exited." << std::endl;
232
+      std::cout << "Error:  N1 smaller than N2 in choose.  Exited."
233
+		<< std::endl;
223 234
       exit(1);
224 235
     }
225 236
     else if (N1 == N2) ans = 1;
226 237
     else if (N1 < 12) ans = fact_lli(N1)/(fact_lli(N2) * fact_lli(N1 - N2));
227 238
     else {
228
-      // Make sure that N2 is less than or equal to N1/2;  if not, just switch...
239
+      // Make sure that N2 is less than or equal to N1/2;  if not, just switch
229 240
       int N2_min = min(N2, N1 - N2);
230 241
 
231 242
       ans = 1;
@@ -244,13 +255,14 @@ namespace ABACUS {
244 255
 
245 256
     unsigned long long int ans = 0;
246 257
     if (N1 < N2) {
247
-      std::cout << "Error:  N1 smaller than N2 in choose.  Exited." << std::endl;
258
+      std::cout << "Error:  N1 smaller than N2 in choose.  Exited."
259
+		<< std::endl;
248 260
       exit(1);
249 261
     }
250 262
     else if (N1 == N2) ans = 1;
251 263
     else if (N1 < 12) ans = fact_ulli(N1)/(fact_ulli(N2) * fact_ulli(N1 - N2));
252 264
     else {
253
-      // Make sure that N2 is less than or equal to N1/2;  if not, just switch...
265
+      // Make sure that N2 is less than or equal to N1/2;  if not, just switch
254 266
       int N2_min = min(N2, N1 - N2);
255 267
 
256 268
       ans = 1;
@@ -302,6 +314,7 @@ namespace ABACUS {
302 314
     return(-0.5 * II * log((1.0 + II* x)/(1.0 - II* x)));
303 315
   }
304 316
 
317
+
305 318
   /****************  Gamma function *******************/
306 319
 
307 320
   inline std::complex<double> ln_Gamma (std::complex<double> z)
@@ -325,7 +338,8 @@ namespace ABACUS {
325 338
 	+ 0.5384136432509564062961e-7 / (z + 8.0)
326 339
 	- 0.4023533141268236372067e-8 / (z + 9.0);
327 340
 
328
-      return(0.5 * logtwoPI + (z - 0.5) * log(z + 8.5) - (z + 8.5) + log(series));
341
+      return(0.5 * logtwoPI + (z - 0.5) * log(z + 8.5)
342
+	     - (z + 8.5) + log(series));
329 343
     }
330 344
 
331 345
     return(log(0.0));  // never called
@@ -359,7 +373,8 @@ namespace ABACUS {
359 373
       for (int i = 1; i < g+2; ++i)
360 374
 	series += p[i]/(z_min_1 + std::complex<double>(i));
361 375
 
362
-      return(0.5 * logtwoPI + (z_min_1 + 0.5) * log(z_min_1 + std::complex<double>(g) + 0.5)
376
+      return(0.5 * logtwoPI
377
+	     + (z_min_1 + 0.5) * log(z_min_1 + std::complex<double>(g) + 0.5)
363 378
 	     - (z_min_1 + std::complex<double>(g) + 0.5) + log(series));
364 379
     }
365 380
 
@@ -376,16 +391,25 @@ namespace ABACUS {
376 391
 
377 392
       int g = 7;
378 393
 
379
-      double p[9] = { 0.99999999999980993, 676.5203681218851, -1259.1392167224028,
380
-		      771.32342877765313, -176.61502916214059, 12.507343278686905,
381
-		      -0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7};
394
+      double p[9] = {
395
+	0.99999999999980993,
396
+	676.5203681218851,
397
+	-1259.1392167224028,
398
+	771.32342877765313,
399
+	-176.61502916214059,
400
+	12.507343278686905,
401
+	-0.13857109526572012,
402
+	9.9843695780195716e-6,
403
+	1.5056327351493116e-7
404
+      };
382 405
 
383 406
       std::complex<double> z_min_1 = z - 1.0;
384 407
       std::complex<double> series = p[0];
385 408
       for (int i = 1; i < g+2; ++i)
386 409
 	series += p[i]/(z_min_1 + std::complex<double>(i));
387 410
 
388
-      return(0.5 * logtwoPI + (z_min_1 + 0.5) * log(z_min_1 + std::complex<double>(g) + 0.5)
411
+      return(0.5 * logtwoPI
412
+	     + (z_min_1 + 0.5) * log(z_min_1 + std::complex<double>(g) + 0.5)
389 413
 	     - (z_min_1 + std::complex<double>(g) + 0.5) + log(series));
390 414
     }
391 415
 
@@ -396,7 +420,8 @@ namespace ABACUS {
396 420
 
397 421
   inline long long int Partition_Function (int n)
398 422
   {
399
-    // Returns the value of the partition function p(n), giving the number of partitions of n into integers.
423
+    // Returns the value of the partition function p(n),
424
+    // giving the number of partitions of n into integers.
400 425
 
401 426
     if (n < 0) ABACUSerror("Calling Partition_Function for n < 0.");
402 427
     else if (n == 0 || n == 1) return(1LL);

+ 14
- 8
include/ABACUS_Young.h View File

@@ -45,7 +45,8 @@ namespace ABACUS {
45 45
   public:
46 46
     Young_Tableau ();    // empty constructor, does nothing
47 47
     Young_Tableau (int Nr, int Nc);  // constructs empty tableau
48
-    Young_Tableau (int Nr, int Nc, long long int idnr);  // constructs the tableau corresponding to identification number idnr
48
+    // constructs the tableau with identification number idnr:
49
+    Young_Tableau (int Nr, int Nc, long long int idnr);
49 50
     Young_Tableau (const Young_Tableau& RefTableau);  // copy constructor
50 51
     Young_Tableau (int Nr, int Nc, const Young_Tableau& RefTableau);
51 52
     Young_Tableau& operator= (const Young_Tableau& RefTableau);  // assignment
@@ -55,11 +56,13 @@ namespace ABACUS {
55 56
     Young_Tableau& Compute_Map (long long int idnr_to_reach);  // fills the map vector
56 57
     Young_Tableau& Distribute_boxes (int nboxes_to_dist, int level);
57 58
     Young_Tableau& Set_to_id (long long int idnr); // sets the tableau to the one corresponding to idnr
58
-    Young_Tableau& Set_to_id (long long int idnr, int option); // sets the tableau to the one corresponding to idnr according to rule option
59
+    // sets the tableau to the one corresponding to idnr according to rule option:
60
+    Young_Tableau& Set_to_id (long long int idnr, int option);
59 61
     Young_Tableau& Set_Row_L (Vect<int>& Row_Lengths);  // set row lengths
60 62
     Young_Tableau& Set_Col_L_given_Row_L ();   // sets the Col_L array self-consistently
61 63
     Young_Tableau& Set_Row_L_given_Col_L ();   // sets the Col_L array self-consistently
62
-    long long int Compute_Descendent_id (int option, Vect<int>& Desc_Row_L, int Nrows_Desc, int Ncols_Desc,
64
+    long long int Compute_Descendent_id (int option, Vect<int>& Desc_Row_L,
65
+					 int Nrows_Desc, int Ncols_Desc,
63 66
 					 const Young_Tableau& RefTableau);
64 67
     Young_Tableau& Compute_id();       // computes the id number of tableau
65 68
     Young_Tableau& Compute_id(int option);       // computes the id number of tableau according to rule option
@@ -69,7 +72,8 @@ namespace ABACUS {
69 72
     bool Raise_Row (int i);
70 73
     bool Lower_Col (int i);
71 74
     bool Raise_Col (int i);
72
-    bool Raise_Lowest_Nonzero_Row(); // adds a box to the lowest nonzero length Row, recomputes id, returns true if tableau has changed
75
+    // adds a box to the lowest nonzero length Row, recomputes id, returns true if tableau has changed:
76
+    bool Raise_Lowest_Nonzero_Row();
73 77
     bool Raise_Next_to_Lowest_Nonzero_Row(); // same thing, but for Row under lowest nonzero length one.
74 78
     bool Move_Box_from_Col_to_Col (int ifrom, int ito);
75 79
 
@@ -83,10 +87,12 @@ namespace ABACUS {
83 87
 
84 88
   inline int Nr_Nonzero_Rows (const Vect<Young_Tableau>& Tableau_ref)
85 89
   {
86
-    // This function checks the number of rows containing at least one box
87
-    // in the whole vector of Young tableaux given as argument.
88
-    // The usefulness is to force descent of states in which only a few
89
-    // excitations have started dispersing.
90
+    /*
91
+    This function checks the number of rows containing at least one box
92
+    in the whole vector of Young tableaux given as argument.
93
+    The usefulness is to force descent of states in which only a few
94
+    excitations have started dispersing.
95
+    */
90 96
 
91 97
     int nr_nonzero_rows = 0;
92 98
     for (int i = 0; i < Tableau_ref.size(); ++i)

+ 1
- 1
src/SCAN/General_Scan.cc View File

@@ -819,7 +819,7 @@ namespace ABACUS {
819 819
 		    << exp(-paused_thread_data.logscale * paused_thread_data.lowest_il_with_nthreads_neq_0) << endl;
820 820
 	LOG_outfile << "Resulting info: " << scan_info << endl;
821 821
       }
822
-      LOG_outfile << "Code version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl << endl;
822
+      LOG_outfile << "ABACUS version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl << endl;
823 823
       LOG_outfile.close();
824 824
     }
825 825
 

+ 1
- 1
src/SCAN/General_Scan_Parallel.cc View File

@@ -408,7 +408,7 @@ namespace ABACUS {
408 408
     LOG_outfile << "Refining in parallel mode using " << nr_processors_at_newlevel << " processors."
409 409
 		<< endl << "Refining info: " << scan_info_refinement
410 410
 		<< endl << "Resulting info:  " << scan_info << endl;
411
-    LOG_outfile << "Code version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl;
411
+    LOG_outfile << "ABACUS version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl;
412 412
     LOG_outfile.close();
413 413
 
414 414
     return;

Loading…
Cancel
Save