@@ -16,7 +16,7 @@ namespace psi
1616
1717Range::Range (const size_t range_in)
1818{
19- k_first = 1 ;
19+ k_first = true ;
2020 index_1 = 0 ;
2121 range_1 = range_in;
2222 range_2 = range_in;
@@ -38,7 +38,8 @@ template <typename T, typename Device> Psi<T, Device>::Psi()
3838
3939template <typename T, typename Device> Psi<T, Device>::~Psi ()
4040{
41- if (this ->allocate_inside ) delete_memory_op ()(this ->ctx , this ->psi );
41+ if (this ->allocate_inside ) { delete_memory_op ()(this ->ctx , this ->psi );
42+ }
4243}
4344
4445// template <typename T, typename Device> Psi<T, Device>::Psi(const int* ngk_in)
@@ -278,12 +279,14 @@ template <typename T, typename Device> void Psi<T, Device>::fix_k(const int ik)
278279{
279280 assert (ik >= 0 );
280281 this ->current_k = ik;
281- if (this ->ngk != nullptr && this ->npol != 2 )
282+ if (this ->ngk != nullptr && this ->npol != 2 ) {
282283 this ->current_nbasis = this ->ngk [ik];
283- else
284+ } else {
284285 this ->current_nbasis = this ->nbasis ;
286+ }
285287
286- if (this ->k_first )this ->current_b = 0 ;
288+ if (this ->k_first ) {this ->current_b = 0 ;
289+ }
287290 int base = this ->current_b * this ->nk * this ->nbasis ;
288291 if (ik >= this ->nk )
289292 {
@@ -302,7 +305,8 @@ template <typename T, typename Device> void Psi<T, Device>::fix_b(const int ib)
302305 assert (ib >= 0 );
303306 this ->current_b = ib;
304307
305- if (!this ->k_first )this ->current_k = 0 ;
308+ if (!this ->k_first ) {this ->current_k = 0 ;
309+ }
306310 int base = this ->current_k * this ->nbands * this ->nbasis ;
307311 if (ib >= this ->nbands )
308312 {
@@ -373,7 +377,8 @@ template <typename T, typename Device> int Psi<T, Device>::get_current_nbas() co
373377
374378template <typename T, typename Device> const int & Psi<T, Device>::get_ngk(const int ik_in) const
375379{
376- if (!this ->ngk ) return this ->nbasis ;
380+ if (!this ->ngk ) { return this ->nbasis ;
381+ }
377382 return this ->ngk [ik_in];
378383}
379384
0 commit comments