diff --git a/src/madness/chem/BSHApply.h b/src/madness/chem/BSHApply.h index 141b3d6e21b..137481911f3 100644 --- a/src/madness/chem/BSHApply.h +++ b/src/madness/chem/BSHApply.h @@ -85,7 +85,7 @@ class BSHApply { Tensor in=inner(world,Vpsi,bra_res); // no shift here! Tensor delta_eps(psi.size()); - for (int i=0; i fock1) const { // check dimensions - bool consistent=(psi.size()==fock1.dim(0)); - if ((fock1.ndim()==2) and not (psi.size()==fock1.dim(1))) consistent=false; + bool consistent=(psi.size()==size_t(fock1.dim(0))); + if ((fock1.ndim()==2) and not (psi.size()==size_t(fock1.dim(1)))) consistent=false; if (not consistent) { print("Fock matrix dimensions",fock1.ndim(), fock1.dim(0), fock1.dim(1)); diff --git a/src/madness/chem/CC2.cc b/src/madness/chem/CC2.cc index af9db385497..0ffa7e5e10a 100644 --- a/src/madness/chem/CC2.cc +++ b/src/madness/chem/CC2.cc @@ -318,7 +318,7 @@ Tensor CC2::enforce_core_valence_separation(const Tensor& fmat) if (nemo->get_param().localize_method()=="canon") { auto nmo=nemo->get_calc()->amo.size(); Tensor fmat1(nmo,nmo); - for (int i=0; iget_calc()->aeps(i); + for (size_t i=0; iget_calc()->aeps(i); return fmat1; } @@ -334,7 +334,7 @@ Tensor CC2::enforce_core_valence_separation(const Tensor& fmat) //hf->reset_orbitals(lmo); nemo->get_calc()->amo=lmo.get_mos(); nemo->get_calc()->aeps=lmo.get_eps(); - MADNESS_CHECK(nemo->get_calc()->aeps.size()==nemo->get_calc()->amo.size()); + MADNESS_CHECK(size_t(nemo->get_calc()->aeps.size())==nemo->get_calc()->amo.size()); //orbitals_ = nemo->R*nemo->get_calc()->amo; //R2orbitals_ = nemo->ncf->square()*nemo->get_calc()->amo; @@ -415,7 +415,7 @@ double CC2::solve_mp2_coupled(Pairs& doubles) { // std::vector coupling_constant_term_vec=Pairs::pairs2vector(coupling_constant_term,triangular_map); // transform vector back to Pairs structure - for (int i = 0; i < pair_vec.size(); i++) { + for (size_t i = 0; i < pair_vec.size(); i++) { pair_vec[i].constant_part = result_vec[i];// - coupling_constant_term_vec[i]; //save(pair_vec[i].constant_part, pair_vec[i].name() + "_const"); pair_vec[i].constant_part.truncate().reduce_rank(); @@ -503,20 +503,20 @@ double CC2::solve_mp2_coupled(Pairs& doubles) { std::vector u; for (auto p : pair_vec) u.push_back(p.function()); std::vector kain_update = copy(world,solver.update(u, u_update)); - for (int i=0; i pairs2vector(const Pairs& argument, const PairVectorMap map) { std::vector vector; - for (int i=0; i mad_coc(3, 0); - for (int i = 0; i < molecule.natom(); ++i) { + for (size_t i = 0; i < molecule.natom(); ++i) { const Atom& atom = molecule.get_atom(i); int charge = atom.atomic_number; mad_coc[0] += atom.x * charge; @@ -1060,7 +1060,7 @@ void SCF::initial_guess(World& world) { // And rotate molecule.rotate(q(Slice(0, 2), Slice(0, 2))); if (world.rank() == 0 && param.print_level() > 3) print("New MADNESS coordinates:"); - for (int i = 0; i < molecule.natom(); ++i) { + for (size_t i = 0; i < molecule.natom(); ++i) { const Atom& atom = molecule.get_atom(i); if (world.rank() == 0 && param.print_level() > 3) print(atomic_number_to_symbol(atom.atomic_number), atom.x, atom.y, atom.z); @@ -2038,7 +2038,7 @@ void SCF::solve(World& world) { const double dconv = std::max(FunctionDefaults<3>::get_thresh(), param.dconv()); const double trantol = vtol / std::min(30.0, double(amo.size())); - const double tolloc = 1e-6; // was std::min(1e-6,0.01*dconv) but now trying to avoid unnecessary change // moved to localizer.h + //const double tolloc = 1e-6; // was std::min(1e-6,0.01*dconv) but now trying to avoid unnecessary change // moved to localizer.h double update_residual = 0.0, bsh_residual = 0.0; subspaceT subspace; tensorT Q; diff --git a/src/madness/chem/TDHF.cc b/src/madness/chem/TDHF.cc index 63f2ef49c89..c892840ea3e 100644 --- a/src/madness/chem/TDHF.cc +++ b/src/madness/chem/TDHF.cc @@ -144,7 +144,7 @@ void TDHF::prepare_calculation() { } else { std::size_t nmo=get_calc()->aeps.size(); fmat=Tensor(nmo,nmo); - for (int i=0; iaeps(i); + for (size_t i=0; iaeps(i); } std::size_t nfrozen=Localizer::determine_frozen_orbitals(fmat); @@ -302,7 +302,7 @@ std::vector TDHF::solve_cis() const { if (parameters.restart()=="iterate" or parameters.restart()=="no_compute") { auto excitations_list=parameters.excitations(); if (excitations_list.empty()) { - for (int i=0; i& mos) { nemo_ptr->get_calc()->amo=mos.get_mos(); nemo_ptr->get_calc()->aeps=mos.get_eps(); - MADNESS_CHECK(nemo_ptr->get_calc()->aeps.size()==nemo_ptr->get_calc()->amo.size()); + MADNESS_CHECK(size_t(nemo_ptr->get_calc()->aeps.size())==nemo_ptr->get_calc()->amo.size()); orbitals_ = nemo_ptr->R*nemo_ptr->get_calc()->amo; R2orbitals_ = nemo_ptr->ncf->square()*nemo_ptr->get_calc()->amo; } diff --git a/src/madness/chem/oep.cc b/src/madness/chem/oep.cc index 1ebc2baf7fd..f9adb8d0b38 100644 --- a/src/madness/chem/oep.cc +++ b/src/madness/chem/oep.cc @@ -239,10 +239,10 @@ double OEP::iterate(const std::string model, const vecfuncT& HF_nemo, const tens bool converged=false; timer timer1(world,param.print_level()>=3); - for (int iter = 0; iter < oep_param.maxiter(); ++iter) { + for (size_t iter = 0; iter < oep_param.maxiter(); ++iter) { if (param.do_localize()) { - for (int i=0; iaeps(i)=KS_Fock(i,i); + for (size_t i=0; iaeps(i)=KS_Fock(i,i); KS_nemo=localize(KS_nemo,param.econv(),iter==0); if (param.print_level()>=10) calc->analyze_vectors(world,KS_nemo,calc->aocc,tensorT(),calc->aset); } @@ -372,13 +372,13 @@ double OEP::iterate(const std::string model, const vecfuncT& HF_nemo, const tens KS_nemo = nemo_new; timer1.tag("post-process"); if (oep_param.saving_amount() >= 3) - for (int n=0; n /// return the norm of the difference of this node and its "mirror" node double operator()(typename rangeT::iterator& it) const { + // Temporary fix to GCC whining about out of range access for NDIM!=6 + if constexpr(NDIM==6) { const keyT& key = it->first; const nodeT& fnode = it->second; @@ -2318,6 +2320,10 @@ template norm=fnode.coeff().normf(); } return norm*norm; + } + else { + throw "ONLY FOR DIM 6!"; + } } double operator()(double a, double b) const { diff --git a/src/madness/mra/mra.h b/src/madness/mra/mra.h index f5ec8c9fbd6..79d3be60031 100644 --- a/src/madness/mra/mra.h +++ b/src/madness/mra/mra.h @@ -2116,7 +2116,7 @@ namespace madness { op.reset_timer(); // will fence here - for (int i=0; irecursive_apply(op, f1[i].get_impl().get(),f2[i].get_impl().get(),false); world.gop.fence(); diff --git a/src/madness/mra/mraimpl.h b/src/madness/mra/mraimpl.h index d0e120ccc7c..a3e9f8bd49b 100644 --- a/src/madness/mra/mraimpl.h +++ b/src/madness/mra/mraimpl.h @@ -402,7 +402,7 @@ namespace madness { Tensor FunctionImpl::print_plane_local(const int xaxis, const int yaxis, const coordT& el2) { coordT x_sim; user_to_sim(el2,x_sim); - x_sim[2]+=1.e-10; + x_sim[0]+=1.e-10; // dimensions are: (# boxes)(hue, x lo left, y lo left, x hi right, y hi right) Tensor plotinfo(coeffs.size(),5);