@@ -24,45 +24,49 @@ template <typename REAL>
2424REAL Sto_Func<REAL>::root_fd(REAL e)
2525{
2626 REAL e_mu = (e - mu) / this ->tem ;
27- if (e_mu > 72 )
27+ if (e_mu > 72 ) {
2828 return 0 ;
29- else
29+ } else {
3030 return 1 / sqrt (1 + exp (e_mu));
3131}
32+ }
3233
3334template <typename REAL>
3435REAL Sto_Func<REAL>::nroot_fd(REAL e)
3536{
3637 REAL Ebar = (*Emin + *Emax) / 2 ;
3738 REAL DeltaE = (*Emax - *Emin) / 2 ;
3839 REAL ne_mu = (e * DeltaE + Ebar - mu) / this ->tem ;
39- if (ne_mu > 72 )
40+ if (ne_mu > 72 ) {
4041 return 0 ;
41- else
42+ } else {
4243 return 1 / sqrt (1 + exp (ne_mu));
4344}
45+ }
4446
4547template <typename REAL>
4648REAL Sto_Func<REAL>::fd(REAL e)
4749{
4850 REAL e_mu = (e - mu) / this ->tem ;
49- if (e_mu > 36 )
51+ if (e_mu > 36 ) {
5052 return 0 ;
51- else
53+ } else {
5254 return 1 / (1 + exp (e_mu));
5355}
56+ }
5457
5558template <typename REAL>
5659REAL Sto_Func<REAL>::nfd(REAL e)
5760{
5861 REAL Ebar = (*Emin + *Emax) / 2 ;
5962 REAL DeltaE = (*Emax - *Emin) / 2 ;
6063 REAL ne_mu = (e * DeltaE + Ebar - mu) / this ->tem ;
61- if (ne_mu > 36 )
64+ if (ne_mu > 36 ) {
6265 return 0 ;
63- else
66+ } else {
6467 return 1 / (1 + exp (ne_mu));
6568}
69+ }
6670
6771template <typename REAL>
6872REAL Sto_Func<REAL>::nxfd(REAL rawe)
@@ -71,27 +75,29 @@ REAL Sto_Func<REAL>::nxfd(REAL rawe)
7175 REAL DeltaE = (*Emax - *Emin) / 2 ;
7276 REAL e = rawe * DeltaE + Ebar;
7377 REAL ne_mu = (e - mu) / this ->tem ;
74- if (ne_mu > 36 )
78+ if (ne_mu > 36 ) {
7579 return 0 ;
76- else
80+ } else {
7781 return e / (1 + exp (ne_mu));
7882}
83+ }
7984
8085template <typename REAL>
8186REAL Sto_Func<REAL>::fdlnfd(REAL e)
8287{
8388 REAL e_mu = (e - mu) / this ->tem ;
84- if (e_mu > 36 )
89+ if (e_mu > 36 ) {
8590 return 0 ;
86- else if (e_mu < -36 )
91+ } else if (e_mu < -36 ) {
8792 return 0 ;
88- else
93+ } else
8994 {
9095 REAL f = 1 / (1 + exp (e_mu));
91- if (f == 0 || f == 1 )
96+ if (f == 0 || f == 1 ) {
9297 return 0 ;
93- else
98+ } else {
9499 return (f * log (f) + (1.0 - f) * log (1.0 - f));
100+ }
95101 }
96102}
97103
@@ -101,17 +107,18 @@ REAL Sto_Func<REAL>::nfdlnfd(REAL rawe)
101107 REAL Ebar = (*Emin + *Emax) / 2 ;
102108 REAL DeltaE = (*Emax - *Emin) / 2 ;
103109 REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this ->tem ;
104- if (ne_mu > 36 )
110+ if (ne_mu > 36 ) {
105111 return 0 ;
106- else if (ne_mu < -36 )
112+ } else if (ne_mu < -36 ) {
107113 return 0 ;
108- else
114+ } else
109115 {
110116 REAL f = 1 / (1 + exp (ne_mu));
111- if (f == 0 || f == 1 )
117+ if (f == 0 || f == 1 ) {
112118 return 0 ;
113- else
119+ } else {
114120 return f * log (f) + (1 - f) * log (1 - f);
121+ }
115122 }
116123}
117124
@@ -121,17 +128,18 @@ REAL Sto_Func<REAL>::n_root_fdlnfd(REAL rawe)
121128 REAL Ebar = (*Emin + *Emax) / 2 ;
122129 REAL DeltaE = (*Emax - *Emin) / 2 ;
123130 REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this ->tem ;
124- if (ne_mu > 36 )
131+ if (ne_mu > 36 ) {
125132 return 0 ;
126- else if (ne_mu < -36 )
133+ } else if (ne_mu < -36 ) {
127134 return 0 ;
128- else
135+ } else
129136 {
130137 REAL f = 1 / (1 + exp (ne_mu));
131- if (f == 0 || f == 1 )
138+ if (f == 0 || f == 1 ) {
132139 return 0 ;
133- else
140+ } else {
134141 return sqrt (-f * log (f) - (1 - f) * log (1 - f));
142+ }
135143 }
136144}
137145
@@ -141,11 +149,12 @@ REAL Sto_Func<REAL>::nroot_mfd(REAL rawe)
141149 REAL Ebar = (*Emin + *Emax) / 2 ;
142150 REAL DeltaE = (*Emax - *Emin) / 2 ;
143151 REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this ->tem ;
144- if (ne_mu < -72 )
152+ if (ne_mu < -72 ) {
145153 return 0 ;
146- else
154+ } else {
147155 return 1 / sqrt (1 + exp (-ne_mu));
148156}
157+ }
149158
150159template <typename REAL>
151160REAL Sto_Func<REAL>::ncos(REAL rawe)
@@ -178,11 +187,12 @@ template <typename REAL>
178187REAL Sto_Func<REAL>::gauss(REAL e)
179188{
180189 REAL a = pow ((targ_e - e), 2 ) / 2.0 / pow (sigma, 2 );
181- if (a > 72 )
190+ if (a > 72 ) {
182191 return 0 ;
183- else
192+ } else {
184193 return exp (-a) / sqrt (TWOPI) / sigma;
185194}
195+ }
186196
187197template <typename REAL>
188198REAL Sto_Func<REAL>::ngauss(REAL rawe)
@@ -191,11 +201,12 @@ REAL Sto_Func<REAL>::ngauss(REAL rawe)
191201 REAL DeltaE = (*Emax - *Emin) / 2 ;
192202 REAL e = rawe * DeltaE + Ebar;
193203 REAL a = pow ((targ_e - e), 2 ) / 2.0 / pow (sigma, 2 );
194- if (a > 72 )
204+ if (a > 72 ) {
195205 return 0 ;
196- else
206+ } else {
197207 return exp (-a) / sqrt (TWOPI) / sigma;
198208}
209+ }
199210
200211template <typename REAL>
201212REAL Sto_Func<REAL>::nroot_gauss(REAL rawe)
@@ -204,11 +215,12 @@ REAL Sto_Func<REAL>::nroot_gauss(REAL rawe)
204215 REAL DeltaE = (*Emax - *Emin) / 2 ;
205216 REAL e = rawe * DeltaE + Ebar;
206217 REAL a = pow ((targ_e - e), 2 ) / 4.0 / pow (sigma, 2 );
207- if (a > 72 )
218+ if (a > 72 ) {
208219 return 0 ;
209- else
220+ } else {
210221 return exp (-a) / sqrt (sqrt (TWOPI) * sigma);
211222}
223+ }
212224
213225// we only have two examples: double and float.
214226template class Sto_Func <double >;
0 commit comments