diff --git a/src/DataSet/DataSet.h b/src/DataSet/DataSet.h index d47bbb0054493b9bd9b670094cf237448c68af79..50791d37890aa0ef9b2e29deb2149f5f1cd1ed47 100644 --- a/src/DataSet/DataSet.h +++ b/src/DataSet/DataSet.h @@ -376,7 +376,6 @@ namespace lib4neuro { */ LIB4NEURO_API void MPI_gather_data_on_master( ); - [[nodiscard]] LIB4NEURO_API arma::Mat<double>* get_inputs_matrix(); [[nodiscard]] LIB4NEURO_API arma::Mat<double>* get_outputs_matrix(); diff --git a/src/Reader/XYZReader.cpp b/src/Reader/XYZReader.cpp index c36fbc68ec72b2caec0cb4a7da65565c5113d2d8..ab121dcf74526848900bd86347cc2f96be8d1179 100644 --- a/src/Reader/XYZReader.cpp +++ b/src/Reader/XYZReader.cpp @@ -208,34 +208,27 @@ void lib4neuro::XYZReader::transform_input_to_acsf(std::unordered_map<ELEMENT_SY /* Save Cartesian coordinates into the vector */ for(auto el : *this->element_list) { /* Iterate over particles */ for(unsigned int i = 0; i < n_coords_per_particle; i++) { /* Iterate over all coordinates of a single particle */ - if(this->ignore_charge && i < 3) { /* Skip charge */ - cartesian_coords.at(i) = configuration.first.at(idx); - } - + cartesian_coords.at(i) = configuration.first.at(idx); idx++; } + + if(this->ignore_charge) { + idx++; //skips charge - TODO add support for charge! + } + particles.emplace_back(std::make_pair(el, cartesian_coords)); } -// std::vector<std::vector<double>> coords_check; -// std::vector<double> single_coords_check; - /* Transform Cartesian coordinates into ACSFs */ std::vector<double> single_particle_coords; -// double coord_val; std::vector<std::pair<ELEMENT_SYMBOL, std::vector<double>>> acsf_coords_prep; for(size_t i = 0; i < particles.size(); i++) { /* Iterate over all the particles */ -// single_coords_check.clear(); single_particle_coords.clear(); /* Compute vector of ACSF coordinates for a single particle */ for (auto sym_func : *element_description[particles.at(i).first]->getSymmetryFunctions()) { -// coord_val = sym_func->eval(i, particles); -// acsf_coords.emplace_back(coord_val); -// single_coords_check.emplace_back(coord_val); single_particle_coords.emplace_back(sym_func->eval(i, particles)); } -// coords_check.emplace_back(single_coords_check); /* Store coordinates in a canonic order */ unsigned int element_ind = 0; @@ -256,9 +249,6 @@ void lib4neuro::XYZReader::transform_input_to_acsf(std::unordered_map<ELEMENT_SY break; } -// std::cout << arma::norm(arma::conv_to<arma::Col<double>>::from(single_particle_coords)) << " " -// << arma::norm(arma::conv_to<arma::Col<double>>::from(acsf_coords_prep.at(element_ind-1).second)) << std::endl; - if(arma::norm(arma::conv_to<arma::Col<double>>::from(single_particle_coords)) > arma::norm(arma::conv_to<arma::Col<double>>::from(acsf_coords_prep.at(element_ind-1).second))) { break; @@ -317,9 +307,7 @@ lib4neuro::ELEMENT_SYMBOL lib4neuro::XYZReader::get_element_symbol(std::string s std::shared_ptr<lib4neuro::DataSet> lib4neuro::XYZReader::get_acsf_data_set(std::unordered_map<ELEMENT_SYMBOL, Element*>& element_description) { -// if(acsf_data_set == nullptr) { - this->transform_input_to_acsf(element_description); -// } + this->transform_input_to_acsf(element_description); return this->acsf_data_set; }