Permalink
Browse files

clang-tidy apply modernize-use-auto fixes

  • Loading branch information...
robertodr committed Oct 31, 2018
1 parent b39c597 commit 470c5dcde2f91f4886e96f2d6fe5622fadc3e0ec
Showing with 296 additions and 296 deletions.
  1. +2 −2 psi4/src/psi4/cc/ccenergy/diis.cc
  2. +5 −5 psi4/src/psi4/cc/ccenergy/form_df_ints.cc
  3. +1 −1 psi4/src/psi4/cc/cceom/get_eom_params.cc
  4. +1 −1 psi4/src/psi4/dcft/dcft_density_UHF.cc
  5. +6 −6 psi4/src/psi4/dcft/dcft_gradient_RHF.cc
  6. +12 −12 psi4/src/psi4/dcft/dcft_gradient_UHF.cc
  7. +4 −4 psi4/src/psi4/dcft/dcft_integrals_RHF.cc
  8. +4 −4 psi4/src/psi4/dcft/dcft_integrals_UHF.cc
  9. +1 −1 psi4/src/psi4/dcft/dcft_memory.cc
  10. +5 −5 psi4/src/psi4/dcft/dcft_qc.cc
  11. +2 −2 psi4/src/psi4/dcft/dcft_sort_mo_tpdm.cc
  12. +8 −8 psi4/src/psi4/detci/ciwave.cc
  13. +2 −2 psi4/src/psi4/detci/compute_mpn.cc
  14. +1 −1 psi4/src/psi4/detci/diag_h.cc
  15. +1 −1 psi4/src/psi4/detci/ints.cc
  16. +1 −1 psi4/src/psi4/detci/params.cc
  17. +1 −1 psi4/src/psi4/dfmp2/mp2.cc
  18. +7 −7 psi4/src/psi4/dfocc/tensors.cc
  19. +2 −2 psi4/src/psi4/fnocc/df_t1_transformation.cc
  20. +9 −9 psi4/src/psi4/fnocc/frozen_natural_orbitals.cc
  21. +3 −3 psi4/src/psi4/fnocc/lowmemory_triples.cc
  22. +1 −1 psi4/src/psi4/fnocc/opdm.cc
  23. +20 −20 psi4/src/psi4/fnocc/sortintegrals.cc
  24. +2 −2 psi4/src/psi4/fnocc/triples.cc
  25. +1 −1 psi4/src/psi4/lib3index/cholesky.cc
  26. +4 −4 psi4/src/psi4/lib3index/denominator.cc
  27. +3 −3 psi4/src/psi4/lib3index/fittingmetric.cc
  28. +1 −1 psi4/src/psi4/libciomr/print_mat.cc
  29. +2 −2 psi4/src/psi4/libdiis/diismanager.cc
  30. +1 −1 psi4/src/psi4/libdpd/contract444_df.cc
  31. +1 −1 psi4/src/psi4/libfilesystem/path.cc
  32. +7 −7 psi4/src/psi4/libfock/DiskDFJK.cc
  33. +3 −3 psi4/src/psi4/libfock/PK_workers.cc
  34. +4 −4 psi4/src/psi4/libfock/apps.cc
  35. +1 −1 psi4/src/psi4/libfock/cubature.cc
  36. +7 −7 psi4/src/psi4/libfock/hamiltonian.cc
  37. +4 −4 psi4/src/psi4/libfock/solver.cc
  38. +2 −2 psi4/src/psi4/libmints/cdsalclist.cc
  39. +4 −4 psi4/src/psi4/libmints/corrtab.cc
  40. +2 −2 psi4/src/psi4/libmints/deriv.cc
  41. +1 −1 psi4/src/psi4/libmints/intvector.cc
  42. +3 −3 psi4/src/psi4/libmints/matrix.cc
  43. +2 −2 psi4/src/psi4/libmints/multipolesymmetry.cc
  44. +6 −6 psi4/src/psi4/libmints/osrecur.cc
  45. +5 −5 psi4/src/psi4/libmints/petitelist.cc
  46. +2 −2 psi4/src/psi4/libmints/sobasis.cc
  47. +1 −1 psi4/src/psi4/libmints/vector.cc
  48. +4 −4 psi4/src/psi4/libmints/writer.cc
  49. +2 −2 psi4/src/psi4/liboptions/liboptions.cc
  50. +1 −1 psi4/src/psi4/libpsi4util/combinations.cc
  51. +2 −2 psi4/src/psi4/libpsi4util/memory_manager.h
  52. +1 −1 psi4/src/psi4/libpsio/filemanager.cc
  53. +3 −3 psi4/src/psi4/libsapt_solver/sapt0.cc
  54. +2 −2 psi4/src/psi4/libsapt_solver/sapt2.cc
  55. +1 −1 psi4/src/psi4/libsapt_solver/sapt2p.cc
  56. +1 −1 psi4/src/psi4/libsapt_solver/sapt2p3.cc
  57. +2 −2 psi4/src/psi4/libscf_solver/frac.cc
  58. +6 −6 psi4/src/psi4/libscf_solver/mom.cc
  59. +1 −1 psi4/src/psi4/libscf_solver/rohf.cc
  60. +1 −1 psi4/src/psi4/libscf_solver/sad.cc
  61. +4 −4 psi4/src/psi4/libtrans/integraltransform_sort_mo_tpdm.cc
  62. +1 −1 psi4/src/psi4/libtrans/integraltransform_tei_1st_half.cc
  63. +1 −1 psi4/src/psi4/libtrans/integraltransform_tei_2nd_half.cc
  64. +2 −2 psi4/src/psi4/libtrans/integraltransform_tpdm.cc
  65. +1 −1 psi4/src/psi4/mcscf/scf_diis.cc
  66. +1 −1 psi4/src/psi4/mcscf/scf_read_so_oei.cc
  67. +1 −1 psi4/src/psi4/mrcc/mrcc.cc
  68. +8 −8 psi4/src/psi4/occ/arrays.cc
  69. +9 −9 psi4/src/psi4/occ/coord_grad.cc
  70. +2 −2 psi4/src/psi4/occ/diis.cc
  71. +1 −1 psi4/src/psi4/occ/dpd.cc
  72. +6 −6 psi4/src/psi4/occ/ep2_ip.cc
  73. +1 −1 psi4/src/psi4/occ/get_moinfo.cc
  74. +6 −6 psi4/src/psi4/occ/omp2_ip_poles.cc
  75. +6 −6 psi4/src/psi4/occ/omp3_ip_poles.cc
  76. +2 −2 psi4/src/psi4/occ/trans_ints_rhf.cc
  77. +2 −2 psi4/src/psi4/occ/trans_ints_rmp2.cc
  78. +4 −4 psi4/src/psi4/occ/trans_ints_uhf.cc
  79. +4 −4 psi4/src/psi4/occ/trans_ints_ump2.cc
  80. +1 −1 psi4/src/psi4/optking/IRC_data.h
  81. +1 −1 psi4/src/psi4/optking/frag.cc
  82. +1 −1 psi4/src/psi4/optking/lindh_guess.cc
  83. +1 −1 psi4/src/psi4/optking/molecule.cc
  84. +2 −2 psi4/src/psi4/optking/opt_data.cc
  85. +4 −4 psi4/src/psi4/psimrcc/blas_algorithms.cc
  86. +4 −4 psi4/src/psi4/psimrcc/manybody.cc
  87. +9 −9 psi4/src/psi4/psimrcc/matrix.cc
  88. +5 −5 psi4/src/psi4/psimrcc/operation_sort.cc
  89. +1 −1 psi4/src/psi4/psimrcc/psimrcc.cc
  90. +2 −2 psi4/src/psi4/psimrcc/sort_mrpt2.cc
  91. +2 −2 psi4/src/psi4/psimrcc/sort_out_of_core.cc
  92. +1 −1 psi4/src/psi4/psimrcc/transform_read_so.cc
  93. +2 −2 psi4/src/psi4/scfgrad/jk_grad.cc
  94. +2 −2 psi4/src/psi4/scfgrad/response.cc
  95. +1 −1 psi4/src/psi4/scfgrad/scf_grad.cc
@@ -77,8 +77,8 @@ void CCEnergyWavefunction::diis_invert_B(double** B, double* C, int dimension, d
double** Bp = B2->pointer();
::memcpy((void*)Bp[0], B[0], sizeof(double) * dimension * dimension);
double* Sp = new double[dimension];
double* Tp = new double[dimension];
auto* Sp = new double[dimension];
auto* Tp = new double[dimension];
bool is_zero = false;
for (int i = 0; i < dimension - 1; i++) {
@@ -80,7 +80,7 @@ void CCEnergyWavefunction::form_df_ints(Options &options, int **cachelist, int *
// We're done with the original AO basis integrals now
Qao.reset();
double *htints = new double[nbf2];
auto *htints = new double[nbf2];
/*
* Set up the DPD machinery
@@ -107,8 +107,8 @@ void CCEnergyWavefunction::form_df_ints(Options &options, int **cachelist, int *
aospaces.push_back(moinfo_.virtpi);
aospaces.push_back(moinfo_.vir_sym);
}
int *dforbspi = new int[moinfo_.nirreps];
int *dummyorbspi = new int[moinfo_.nirreps];
auto *dforbspi = new int[moinfo_.nirreps];
auto *dummyorbspi = new int[moinfo_.nirreps];
int count = 0;
for (int h = 0; h < moinfo_.nirreps; ++h) {
dummyorbspi[h] = 0;
@@ -117,8 +117,8 @@ void CCEnergyWavefunction::form_df_ints(Options &options, int **cachelist, int *
count += norb;
}
dummyorbspi[0] = 1;
int *dforbsym = new int[count];
int *dummyorbsym = new int[1];
auto *dforbsym = new int[count];
auto *dummyorbsym = new int[1];
dummyorbsym[0] = 0;
count = 0;
for (int h = 0; h < moinfo_.nirreps; ++h)
@@ -83,7 +83,7 @@ void get_eom_params(SharedWavefunction ref_wfn, Options &options) {
size_t full_nirreps = old_pg->char_table().nirrep();
if (options["ROOTS_PER_IRREP"].size() != full_nirreps)
throw PSIEXCEPTION("Input ROOTS_PER_IRREP array has the wrong dimensions");
int *temp_docc = new int[full_nirreps];
auto *temp_docc = new int[full_nirreps];
for (int h = 0; h < full_nirreps; ++h) temp_docc[h] = options["ROOTS_PER_IRREP"][h].to_integer();
map_irreps(temp_docc, old_pg, ref_wfn->molecule()->point_group());
eom_params.states_per_irrep = new int[moinfo.nirreps];
@@ -1995,7 +1995,7 @@ void DCFTSolver::compute_TPDM_trace() {
opdm_trace += (aocc_tau_->trace() + bocc_tau_->trace() + avir_tau_->trace() + bvir_tau_->trace());
// Compute deviations from N-representability
double N = (double)(nalpha_ + nbeta_);
auto N = (double)(nalpha_ + nbeta_);
double opdm_dev = N - opdm_trace;
double tpdm_dev = N * (N - 1.0) - tpdm_trace;
@@ -439,15 +439,15 @@ void DCFTSolver::compute_ewdm_odc_RHF() {
auto a_opdm = std::make_shared<Matrix>("MO basis OPDM (Alpha)", nirrep_, nmopi_, nmopi_);
const int *alpha_corr_to_pitzer = _ints->alpha_corr_to_pitzer();
int *alpha_pitzer_to_corr = new int[nmo_];
auto *alpha_pitzer_to_corr = new int[nmo_];
::memset(alpha_pitzer_to_corr, '\0', nmo_ * sizeof(int));
for (int n = 0; n < nmo_; ++n) {
alpha_pitzer_to_corr[alpha_corr_to_pitzer[n]] = n;
}
const int *beta_corr_to_pitzer = _ints->beta_corr_to_pitzer();
int *beta_pitzer_to_corr = new int[nmo_];
auto *beta_pitzer_to_corr = new int[nmo_];
::memset(beta_pitzer_to_corr, '\0', nmo_ * sizeof(int));
for (int n = 0; n < nmo_; ++n) {
@@ -553,10 +553,10 @@ void DCFTSolver::compute_ewdm_odc_RHF() {
psio_->write_entry(PSIF_MO_OPDM, "MO-basis OPDM", (char *)a_qt[0], sizeof(double) * nmo_ * nmo_);
psio_->close(PSIF_MO_OPDM, 1);
int *aocc_qt = new int[nalpha_];
int *bocc_qt = new int[nbeta_];
int *avir_qt = new int[navir_];
int *bvir_qt = new int[nbvir_];
auto *aocc_qt = new int[nalpha_];
auto *bocc_qt = new int[nbeta_];
auto *avir_qt = new int[navir_];
auto *bvir_qt = new int[nbvir_];
int aocc_count = 0;
int bocc_count = 0;
@@ -3631,15 +3631,15 @@ void DCFTSolver::compute_ewdm_dc() {
auto b_zia = std::make_shared<Matrix>("MO basis Orbital Response (Beta)", nirrep_, nmopi_, nmopi_);
const int *alpha_corr_to_pitzer = _ints->alpha_corr_to_pitzer();
int *alpha_pitzer_to_corr = new int[nmo_];
auto *alpha_pitzer_to_corr = new int[nmo_];
::memset(alpha_pitzer_to_corr, '\0', nmo_ * sizeof(int));
for (int n = 0; n < nmo_; ++n) {
alpha_pitzer_to_corr[alpha_corr_to_pitzer[n]] = n;
}
const int *beta_corr_to_pitzer = _ints->beta_corr_to_pitzer();
int *beta_pitzer_to_corr = new int[nmo_];
auto *beta_pitzer_to_corr = new int[nmo_];
::memset(beta_pitzer_to_corr, '\0', nmo_ * sizeof(int));
for (int n = 0; n < nmo_; ++n) {
@@ -3909,10 +3909,10 @@ void DCFTSolver::compute_ewdm_dc() {
psio_->write_entry(PSIF_MO_OPDM, "MO-basis Beta OPDM", (char *)b_qt[0], sizeof(double) * nmo_ * nmo_);
psio_->close(PSIF_MO_OPDM, 1);
int *aocc_qt = new int[nalpha_];
int *bocc_qt = new int[nbeta_];
int *avir_qt = new int[navir_];
int *bvir_qt = new int[nbvir_];
auto *aocc_qt = new int[nalpha_];
auto *bocc_qt = new int[nbeta_];
auto *avir_qt = new int[navir_];
auto *bvir_qt = new int[nbvir_];
int aocc_count = 0;
int bocc_count = 0;
@@ -4590,15 +4590,15 @@ void DCFTSolver::compute_ewdm_odc() {
auto b_opdm = std::make_shared<Matrix>("MO basis OPDM (Beta)", nirrep_, nmopi_, nmopi_);
const int *alpha_corr_to_pitzer = _ints->alpha_corr_to_pitzer();
int *alpha_pitzer_to_corr = new int[nmo_];
auto *alpha_pitzer_to_corr = new int[nmo_];
::memset(alpha_pitzer_to_corr, '\0', nmo_ * sizeof(int));
for (int n = 0; n < nmo_; ++n) {
alpha_pitzer_to_corr[alpha_corr_to_pitzer[n]] = n;
}
const int *beta_corr_to_pitzer = _ints->beta_corr_to_pitzer();
int *beta_pitzer_to_corr = new int[nmo_];
auto *beta_pitzer_to_corr = new int[nmo_];
::memset(beta_pitzer_to_corr, '\0', nmo_ * sizeof(int));
for (int n = 0; n < nmo_; ++n) {
@@ -4780,10 +4780,10 @@ void DCFTSolver::compute_ewdm_odc() {
psio_->write_entry(PSIF_MO_OPDM, "MO-basis Beta OPDM", (char *)b_qt[0], sizeof(double) * nmo_ * nmo_);
psio_->close(PSIF_MO_OPDM, 1);
int *aocc_qt = new int[nalpha_];
int *bocc_qt = new int[nbeta_];
int *avir_qt = new int[navir_];
int *bvir_qt = new int[nbvir_];
auto *aocc_qt = new int[nalpha_];
auto *bocc_qt = new int[nbeta_];
auto *avir_qt = new int[navir_];
auto *bvir_qt = new int[nbvir_];
int aocc_count = 0;
int bocc_count = 0;
@@ -292,10 +292,10 @@ void DCFTSolver::build_denominators_RHF() {
dpdbuf4 D;
dpdfile2 F;
double *aOccEvals = new double[nalpha_];
double *bOccEvals = new double[nbeta_];
double *aVirEvals = new double[navir_];
double *bVirEvals = new double[nbvir_];
auto *aOccEvals = new double[nalpha_];
auto *bOccEvals = new double[nbeta_];
auto *aVirEvals = new double[navir_];
auto *bVirEvals = new double[nbvir_];
// Pick out the diagonal elements of the Fock matrix, making sure that they are in the order
// used by the DPD library, i.e. starting from zero for each space and ordering by irrep
int aOccCount = 0, aVirCount = 0;
@@ -585,10 +585,10 @@ void DCFTSolver::build_denominators() {
dpdbuf4 D;
dpdfile2 F;
double *aOccEvals = new double[nalpha_];
double *bOccEvals = new double[nbeta_];
double *aVirEvals = new double[navir_];
double *bVirEvals = new double[nbvir_];
auto *aOccEvals = new double[nalpha_];
auto *bOccEvals = new double[nbeta_];
auto *aVirEvals = new double[navir_];
auto *bVirEvals = new double[nbvir_];
// Pick out the diagonal elements of the Fock matrix, making sure that they are in the order
// used by the DPD library, i.e. starting from zero for each space and ordering by irrep
int aOccCount = 0, bOccCount = 0, aVirCount = 0, bVirCount = 0;
@@ -175,7 +175,7 @@ void DCFTSolver::init() {
}
// Store the AO overlap matrix
double *sArray = new double[ntriso_];
auto *sArray = new double[ntriso_];
IWL::read_one(psio_.get(), PSIF_OEI, PSIF_SO_S, sArray, ntriso_, 0, 0, "outfile");
ao_s_->set(sArray);
delete[] sArray;
@@ -333,8 +333,8 @@ void DCFTSolver::form_idps() {
::memset(lookup_orbitals_, '\0', sizeof(int) * dim_orbitals_);
// Temporary vectors containing gradient value and diagonal part of the Hessian for each IDP
double *grad = new double[dim_];
double *Hd = new double[dim_];
auto *grad = new double[dim_];
auto *Hd = new double[dim_];
// Count the number of IDPs for orbital rotations (Alpha spin)
// The minus sign in the gradient takes into account the sign of the g vector in the N-R equations: dX H = -g
@@ -2072,7 +2072,7 @@ void DCFTSolver::run_davidson() {
G->diagonalize(Evecs, Evals, ascending);
// Define the eigenvectors to be positive to make sure the phase doesn't change
double *ones = new double[b_dim_];
auto *ones = new double[b_dim_];
for (int i = 0; i < b_dim_; ++i) ones[i] = 1.0;
double **Evecs_p = Evecs->pointer();
for (int k = 0; k < b_dim_; ++k) {
@@ -2166,8 +2166,8 @@ void DCFTSolver::run_davidson() {
double value = Evals->get(k);
outfile->Printf("\t %10.6f \n", value);
if (value < 0.0) {
double *max_values = new double[values_to_print + 1];
int *max_values_idp = new int[values_to_print + 1];
auto *max_values = new double[values_to_print + 1];
auto *max_values_idp = new int[values_to_print + 1];
int stored = 0;
double norm = 0.0;
@@ -157,7 +157,7 @@ void DCFTSolver::presort_mo_tpdm_AB() {
int q = _ints->alpha_corr_to_pitzer()[(int)lblptr[labelIndex++]];
int r = _ints->alpha_corr_to_pitzer()[(int)lblptr[labelIndex++]];
int s = _ints->alpha_corr_to_pitzer()[(int)lblptr[labelIndex++]];
double value = (double)valptr[index];
auto value = (double)valptr[index];
dpdFiller(p, q, r, s, value);
} /* end loop through current buffer */
} while (!lastbuf); /* end loop over reading buffers */
@@ -310,7 +310,7 @@ void DCFTSolver::presort_mo_tpdm_AA() {
int q = _ints->alpha_corr_to_pitzer()[(int)lblptr[labelIndex++]];
int r = _ints->alpha_corr_to_pitzer()[(int)lblptr[labelIndex++]];
int s = _ints->alpha_corr_to_pitzer()[(int)lblptr[labelIndex++]];
double value = (double)valptr[index];
auto value = (double)valptr[index];
dpdFiller(p, q, r, s, value);
} /* end loop through current buffer */
@@ -258,12 +258,12 @@ void CIWavefunction::orbital_locations(const std::string& orbitals, int* start,
SharedMatrix CIWavefunction::get_orbitals(const std::string& orbital_name) {
/// Figure out orbital positions
int* start = new int[nirrep_];
int* end = new int[nirrep_];
auto* start = new int[nirrep_];
auto* end = new int[nirrep_];
orbital_locations(orbital_name, start, end);
int* spread = new int[nirrep_];
auto* spread = new int[nirrep_];
for (int h = 0; h < nirrep_; h++) {
spread[h] = end[h] - start[h];
}
@@ -286,12 +286,12 @@ SharedMatrix CIWavefunction::get_orbitals(const std::string& orbital_name) {
void CIWavefunction::set_orbitals(const std::string& orbital_name, SharedMatrix orbitals) {
/// Figure out orbital positions
int* start = new int[nirrep_];
int* end = new int[nirrep_];
auto* start = new int[nirrep_];
auto* end = new int[nirrep_];
orbital_locations(orbital_name, start, end);
int* spread = new int[nirrep_];
auto* spread = new int[nirrep_];
for (int h = 0; h < nirrep_; h++) {
spread[h] = end[h] - start[h];
}
@@ -311,8 +311,8 @@ void CIWavefunction::set_orbitals(const std::string& orbital_name, SharedMatrix
Dimension CIWavefunction::get_dimension(const std::string& orbital_name) {
/// Figure out orbital positions
int* start = new int[nirrep_];
int* end = new int[nirrep_];
auto* start = new int[nirrep_];
auto* end = new int[nirrep_];
orbital_locations(orbital_name, start, end);
Dimension dim = Dimension(nirrep_);
@@ -403,7 +403,7 @@ void CIWavefunction::mpn_generator(CIvect &Hd) {
else {
std::string str = std::to_string(13);
str += " vector norm = ";
char *str2 = new char[25];
auto *str2 = new char[25];
sprintf(str2, "%20.15lf", cvec_norm[k - 1]);
str += str2;
str += " < ";
@@ -427,7 +427,7 @@ void CIWavefunction::mpn_generator(CIvect &Hd) {
else {
std::string str = std::to_string(13);
str += " vector norm = ";
char *str2 = new char[25];
auto *str2 = new char[25];
sprintf(str2, "%20.15lf", cvec_norm[k - 1]);
str += str2;
str += " < ";
@@ -114,7 +114,7 @@ int CIWavefunction::diag_h(double conv_e, double conv_rms) {
// Write evecs to Dvec
evals = init_array(nroots);
double *tmp_buff = new double[size];
auto *tmp_buff = new double[size];
double **evecsp = evecs->pointer();
double *evals_vp = evals_v->pointer();
for (size_t root = 0; root < nroots; root++) {
@@ -624,7 +624,7 @@ void CIWavefunction::read_dpd_ci_ints() {
// => Read one electron integrals <= //
// Build temporary desired arrays
int nmotri_full = (CalcInfo_->nmo * (CalcInfo_->nmo + 1)) / 2;
double* tmp_onel_ints = new double[nmotri_full];
auto* tmp_onel_ints = new double[nmotri_full];
// Read one electron integrals
iwl_rdone(PSIF_OEI, PSIF_MO_FZC, tmp_onel_ints, nmotri_full, 0, (print_ > 4), "outfile");
@@ -643,7 +643,7 @@ void CIWavefunction::get_parameters(Options &options) {
}
if (junk <= 0.0) {
std::string str = "Error: AVERAGE WEIGHTS add up to ";
char *str2 = new char[25];
auto *str2 = new char[25];
sprintf(str2, "%20.15lf", junk);
str += str2;
delete[] str2;
@@ -87,7 +87,7 @@ void DFMP2::compute_opdm_and_nos(const SharedMatrix Dnosym, SharedMatrix Dso, Sh
// Now, copy over the full matrix, whenever nonzero columns are
for (int h = 0; h < nirrep_; ++h) {
if (nsopi_[h] == 0) continue;
double* CStemp = new double[nsopi_[h]];
auto* CStemp = new double[nsopi_[h]];
double** pC1 = SO_c1NO->pointer(h);
double** Smat = S_->pointer(h);
int symcol = 0;
Oops, something went wrong.

0 comments on commit 470c5dc

Please sign in to comment.