Skip to content

Commit

Permalink
clang-tidy apply modernize-use-bool-literals fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodr committed Oct 31, 2018
1 parent b39c597 commit 6c322d0
Show file tree
Hide file tree
Showing 30 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion psi4/src/psi4/dcft/dcft_scf_RHF.cc
Expand Up @@ -411,7 +411,7 @@ void DCFTSolver::process_so_ints_RHF() {
} /* end loop through current buffer */
if (!lastBuffer) iwl->fetch();
} while (!lastBuffer);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;
if (buildTensors) {
if (print_ > 1) {
Expand Down
6 changes: 3 additions & 3 deletions psi4/src/psi4/dcft/dcft_scf_UHF.cc
Expand Up @@ -891,7 +891,7 @@ void DCFTSolver::process_so_ints() {
} /* end loop through current buffer */
if (!lastBuffer) iwl->fetch();
} while (!lastBuffer);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;
if (buildTensors) {
if (print_ > 1) {
Expand Down Expand Up @@ -1289,7 +1289,7 @@ void DCFTSolver::build_AO_tensors() {
} /* end loop through current buffer */
if (!lastBuffer) iwl->fetch();
} while (!lastBuffer);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;
if (print_ > 1) {
outfile->Printf("Processed %d SO integrals each for AA, BB, and AB\n", counter);
Expand Down Expand Up @@ -1715,7 +1715,7 @@ void DCFTSolver::build_G() {
} /* end loop through current buffer */
if (!lastBuffer) iwl->fetch();
} while (!lastBuffer);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

// Build the Fock matrices from the H and G matrices
Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/dcft/dcft_sort_mo_tpdm.cc
Expand Up @@ -161,7 +161,7 @@ void DCFTSolver::presort_mo_tpdm_AB() {
dpdFiller(p, q, r, s, value);
} /* end loop through current buffer */
} while (!lastbuf); /* end loop over reading buffers */
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

for (int h = 0; h < nirrep_; ++h) {
Expand Down Expand Up @@ -315,7 +315,7 @@ void DCFTSolver::presort_mo_tpdm_AA() {

} /* end loop through current buffer */
} while (!lastbuf); /* end loop over reading buffers */
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

for (int h = 0; h < nirrep_; ++h) {
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/detci/mitrush_iter.cc
Expand Up @@ -319,7 +319,7 @@ void CIWavefunction::mitrush_iter(CIvect &Hd, struct stringwr **alplist, struct
last = 0;
}

while (1) {
while (true) {
Cvec.buf_lock(buffer1);
Sigma.buf_lock(buffer2);
Cvec.read(curr, 0);
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/fnocc/frozen_natural_orbitals.cc
Expand Up @@ -699,7 +699,7 @@ void DFFrozenNO::FourIndexIntegrals() {
}
}
iwl->flush(1);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

free(Qmo);
Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/libfock/DiskJK.cc
Expand Up @@ -464,7 +464,7 @@ void DiskJK::compute_JK()
if (K_[N]->symmetry()) K_[N]->transpose_this();
}
}
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

if(do_wK_){
Expand Down Expand Up @@ -590,7 +590,7 @@ void DiskJK::compute_JK()
for (size_t N = 0; N < wK_.size(); N++) {
if (wK_[N]->symmetry()) wK_[N]->transpose_this();
}
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;
}
}
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/libmints/basisset.cc
Expand Up @@ -120,7 +120,7 @@ BasisSet::BasisSet() {
shell_center_[0] = 0;
center_to_nshell_[0] = 1;
center_to_shell_[0] = 0;
puream_ = 0;
puream_ = false;
max_am_ = 0;
max_nprimitive_ = 1;
xyz_[0] = 0.0;
Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/libmints/petitelist.cc
Expand Up @@ -442,15 +442,15 @@ void PetiteList::init(double tol) {
group_ = ct.bits();

// initialize private members
c1_ = 0;
c1_ = false;
ng_ = ct.order();
natom_ = mol.natom();
nshell_ = gbs.nshell(); // full number of shells
nirrep_ = ct.nirrep();

// if point group is C1, then zero everything
if (ng_ == 1) {
c1_ = 1;
c1_ = true;
nblocks_ = 1;

p1_ = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/libqt/pople.cc
Expand Up @@ -254,7 +254,7 @@ int pople(double **A, double *x, int dimen, int /*num_vecs*/, double tolerance,
for (I = 0; I < dimen; I++) Bmat[L + 1][I] /= norm;

/* check orthogonality of subspace */
if (0) {
if (false) {
for (i = 0; i <= L + 1; i++) {
for (j = 0; j <= i; j++) {
// dot_arr(Bmat[i], Bmat[j], dimen, &tval);
Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/libsapt_solver/sapt.cc
Expand Up @@ -105,9 +105,9 @@ void SAPT::initialize(SharedWavefunction MonomerA, SharedWavefunction MonomerB)

// Compare pointers
if (ribasis_ == elstbasis_) {
elst_basis_ = 0;
elst_basis_ = false;
} else {
elst_basis_ = 1;
elst_basis_ = true;
}

zero_ = std::shared_ptr<BasisSet>(BasisSet::zero_ao_basis_set());
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/libtrans/integraltransform_functors.h
Expand Up @@ -569,7 +569,7 @@ void iwl_integrals(IWL *iwl, DPDFunctor &dpd, FockFunctor &fock) {
} /* end loop through current buffer */
if (!lastBuffer) iwl->fetch();
} while (!lastBuffer);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
}

} // namespace psi
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/libtrans/integraltransform_moinfo.cc
Expand Up @@ -46,7 +46,7 @@ void IntegralTransform::common_initialize() {
abIntName_ = "";
bbIntName_ = "";

keepHtInts_ = 0;
keepHtInts_ = false;

nTriSo_ = nso_ * (nso_ + 1) / 2;
nTriMo_ = nmo_ * (nmo_ + 1) / 2;
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/libtrans/integraltransform_oei.cc
Expand Up @@ -324,7 +324,7 @@ void IntegralTransform::generate_oei() {
aFzcOp, bFzcOp, aD, bD, aFock, bFock);
} /* end loop through current buffer */
} /* end loop over reading buffers */
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

double *moInts = init_array(nTriMo_);
Expand Down
8 changes: 4 additions & 4 deletions psi4/src/psi4/libtrans/integraltransform_sort_mo_tpdm.cc
Expand Up @@ -163,7 +163,7 @@ void IntegralTransform::presort_mo_tpdm_restricted() {
dpdFiller(p, q, r, s, value);
} /* end loop through current buffer */
} while (!lastbuf); /* end loop over reading buffers */
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

for (int h = 0; h < nirreps_; ++h) {
Expand Down Expand Up @@ -313,7 +313,7 @@ void IntegralTransform::presort_mo_tpdm_unrestricted() {
aaDpdFiller(p, q, r, s, value);
} /* end loop through current buffer */
} while (!lastbuf); /* end loop over reading buffers */
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

for (int h = 0; h < nirreps_; ++h) {
Expand Down Expand Up @@ -361,7 +361,7 @@ void IntegralTransform::presort_mo_tpdm_unrestricted() {
abDpdFiller(p, q, r, s, value);
} /* end loop through current buffer */
} while (!lastbuf); /* end loop over reading buffers */
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

for (int h = 0; h < nirreps_; ++h) {
Expand Down Expand Up @@ -407,7 +407,7 @@ void IntegralTransform::presort_mo_tpdm_unrestricted() {
bbDpdFiller(p, q, r, s, value);
} /* end loop through current buffer */
} while (!lastbuf); /* end loop over reading buffers */
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
delete iwl;

for (int h = 0; h < nirreps_; ++h) {
Expand Down
6 changes: 3 additions & 3 deletions psi4/src/psi4/libtrans/integraltransform_tei_2nd_half.cc
Expand Up @@ -208,7 +208,7 @@ void IntegralTransform::transform_tei_second_half(const std::shared_ptr<MOSpace>

if (useIWL_) {
iwl->flush(1);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
// This closes the file too
delete iwl;
}
Expand Down Expand Up @@ -322,7 +322,7 @@ void IntegralTransform::transform_tei_second_half(const std::shared_ptr<MOSpace>

if (useIWL_) {
iwl->flush(1);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
// This closes the file too
delete iwl;
}
Expand Down Expand Up @@ -443,7 +443,7 @@ void IntegralTransform::transform_tei_second_half(const std::shared_ptr<MOSpace>

if (useIWL_) {
iwl->flush(1);
iwl->set_keep_flag(1);
iwl->set_keep_flag(true);
// This closes the file too
delete iwl;
}
Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/mcscf/scf_read_so_tei.cc
Expand Up @@ -137,7 +137,7 @@ void SCF::read_so_tei_form_PK() {
int ilsti, nbuf, fi, index;

IWL ERIIN(psio_.get(), PSIF_SO_TEI, 0.0, 1, 1);
ERIIN.set_keep_flag(1);
ERIIN.set_keep_flag(true);
do {
ilsti = ERIIN.last_buffer();
nbuf = ERIIN.buffer_count();
Expand Down Expand Up @@ -215,7 +215,7 @@ void SCF::read_so_tei_form_PK_and_K() {
int ilsti, nbuf, fi, index;

IWL ERIIN(psio_.get(), PSIF_SO_TEI, 0.0, 1, 1);
ERIIN.set_keep_flag(1);
ERIIN.set_keep_flag(true);

do {
ilsti = ERIIN.last_buffer();
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/occ/trans_ints_rhf.cc
Expand Up @@ -48,7 +48,7 @@ void OCCWave::trans_ints_rhf()
/********************************************************************************************/
ints->update_orbitals();
ints->set_print(print_ - 2 >= 0 ? print_ - 2 : 0);
ints->set_keep_dpd_so_ints(1);
ints->set_keep_dpd_so_ints(true);

// Trans (OO|OO)
timer_on("Trans (OO|OO)");
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/occ/trans_ints_rmp2.cc
Expand Up @@ -45,7 +45,7 @@ void OCCWave::trans_ints_rmp2()
/********************************************************************************************/
ints->update_orbitals();
ints->set_print(print_ - 2 >= 0 ? print_ - 2 : 0);
ints->set_keep_dpd_so_ints(1);
ints->set_keep_dpd_so_ints(true);

// Trans (OV|OV)
timer_on("Trans (OV|OV)");
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/occ/trans_ints_uhf.cc
Expand Up @@ -46,7 +46,7 @@ void OCCWave::trans_ints_uhf()
/********************************************************************************************/
ints->update_orbitals();
ints->set_print(print_ - 2 >= 0 ? print_ - 2 : 0);
ints->set_keep_dpd_so_ints(1);
ints->set_keep_dpd_so_ints(true);

// Trans (OO|OO)
timer_on("Trans (OO|OO)");
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/occ/trans_ints_ump2.cc
Expand Up @@ -45,7 +45,7 @@ void OCCWave::trans_ints_ump2()
/********************************************************************************************/
ints->update_orbitals();
ints->set_print(print_ - 2 >= 0 ? print_ - 2 : 0);
ints->set_keep_dpd_so_ints(1);
ints->set_keep_dpd_so_ints(true);

// Trans (OV|OV)
timer_on("Trans (OV|OV)");
Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/optking/IRC_data.h
Expand Up @@ -112,8 +112,8 @@ class IRC_DATA {

IRC_DATA() {
sphere_step = 0;
go = 1;
in_min_range = 0;
go = true;
in_min_range = false;
step_dist = 0;
arc_dist = 0;
line_dist = 0;
Expand Down
6 changes: 3 additions & 3 deletions psi4/src/psi4/optking/frag_disp.cc
Expand Up @@ -285,12 +285,12 @@ bool FRAG::displace_util(double *dq, bool focus_on_constraints) {
// dx = Bt (B Bt)^-1 dq
// dx = Bt G^-1 dq, where G = B B^t.
compute_B(B,0,0);
opt_matrix_mult(B, 0, B, 1, G, 0, Nints, Ncarts, Nints, 0);
opt_matrix_mult(B, false, B, true, G, false, Nints, Ncarts, Nints, false);

// u B^t (G_inv dq) = dx
G_inv = symm_matrix_inv(G, Nints, true);
opt_matrix_mult(G_inv, 0, &dq, 1, &tmp_v_Nints, 1, Nints, Nints, 1, 0);
opt_matrix_mult(B, 1, &tmp_v_Nints, 1, &dx, 1, Ncarts, Nints, 1, 0);
opt_matrix_mult(G_inv, false, &dq, true, &tmp_v_Nints, true, Nints, Nints, 1, false);
opt_matrix_mult(B, true, &tmp_v_Nints, true, &dx, true, Ncarts, Nints, 1, false);
free_matrix(G_inv);

for (i=0; i<Ncarts; ++i)
Expand Down
2 changes: 1 addition & 1 deletion psi4/src/psi4/optking/interfrag_orient.cc
Expand Up @@ -364,7 +364,7 @@ void rotate_vecs(double *w, double phi, double **v, int num_v) {
R[2][2] = cos(phi) + wz*wz*cp;

v_new = init_matrix(num_v,3);
opt_matrix_mult(R, 0, v, 1, v_new, 1, 3, 3, num_v, 0);
opt_matrix_mult(R, false, v, true, v_new, true, 3, 3, num_v, false);

for (int i=0; i<num_v; ++i)
for (int j=0; j<3; ++j)
Expand Down
6 changes: 3 additions & 3 deletions psi4/src/psi4/optking/lindh_guess.cc
Expand Up @@ -263,7 +263,7 @@ in this set of internals. */
//oprint_array_out(g_x,3*natom);

double *temp_arr = init_array(Nintco);
opt_matrix_mult(B, 0, &g_x, 1, &temp_arr, 1, Nintco, 3*natom, 1, 0);
opt_matrix_mult(B, false, &g_x, true, &temp_arr, true, Nintco, 3*natom, 1, false);
free_array(g_x);

double **G = init_matrix(Nintco, Nintco);
Expand All @@ -272,11 +272,11 @@ in this set of internals. */
for (int j=0; j<Nintco; ++j)
G[i][j] += B[i][k] * B[j][k];
free_matrix(B);
double **G_inv = symm_matrix_inv(G, Nintco, 1);
double **G_inv = symm_matrix_inv(G, Nintco, true);
free_matrix(G);

double *g_q = init_array(Nintco);
opt_matrix_mult(G_inv, 0, &temp_arr, 1, &g_q, 1, Nintco, Nintco, 1, 0);
opt_matrix_mult(G_inv, false, &temp_arr, true, &g_q, true, Nintco, Nintco, 1, false);
free_matrix(G_inv);
free_array(temp_arr);
// Done computing g_q
Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/optking/linear_algebra.cc
Expand Up @@ -253,8 +253,8 @@ double ** symm_matrix_inv(double **A, int dim, bool redundant) {
double ** A_temp = init_matrix(dim, dim);

// A^-1 = P^t D^-1 P
opt_matrix_mult(A_inv, 0, A_evects, 0, A_temp, 0, dim, dim, dim,0);
opt_matrix_mult(A_evects, 1, A_temp, 0, A_inv, 0, dim, dim, dim, 0);
opt_matrix_mult(A_inv, false, A_evects, false, A_temp, false, dim, dim, dim,false);
opt_matrix_mult(A_evects, true, A_temp, false, A_inv, false, dim, dim, dim, false);

free_matrix(A_temp);
free_array(evals);
Expand Down

0 comments on commit 6c322d0

Please sign in to comment.