Skip to content

Commit

Permalink
MAINT: Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Apr 25, 2024
1 parent 83e4508 commit 06e6291
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
7 changes: 3 additions & 4 deletions CppCore/rgpot/CuH2/cuh2Utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <limits>
// clang-format on
#include "rgpot/CuH2/cuh2Utils.hpp"
#include "include/ReadCon.hpp"
using rgpot::types::AtomMatrix;

#ifdef WITH_XTENSOR
Expand All @@ -27,9 +26,9 @@ extract_positions(const yodecon::types::ConFrameVec &frame) {
}

xt::xtensor<double, 2>
peturb_positions(const xt::xtensor<double, 2> &base_positions,
const xt::xtensor<int, 1> &atmNumVec, double hcu_dist,
double hh_dist) {
perturb_positions(const xt::xtensor<double, 2> &base_positions,
const xt::xtensor<int, 1> &atmNumVec, double hcu_dist,
double hh_dist) {
xt::xtensor<double, 2> positions = base_positions;
std::vector<size_t> hIndices, cuIndices;

Expand Down
13 changes: 7 additions & 6 deletions CppCore/rgpot/CuH2/cuh2Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ namespace xts {
xt::xtensor<double, 2>
extract_positions(const yodecon::types::ConFrameVec &frame);
xt::xtensor<double, 2>
peturb_positions(const xt::xtensor<double, 2> &base_positions,
const xt::xtensor<int, 1> &atmNumVec, double hcu_dist,
double hh_dist);
perturb_positions(const xt::xtensor<double, 2> &base_positions,
const xt::xtensor<int, 1> &atmNumVec, double hcu_dist,
double hh_dist);
std::pair<double, double>
calculateDistances(const xt::xtensor<double, 2> &positions,
const xt::xtensor<int, 1> &atmNumVec);
Expand All @@ -35,12 +35,13 @@ void ensure_normalized(E &&vector, bool is_normalized = false,
ScalarType tol = static_cast<ScalarType>(1e-6)) {
if (!is_normalized) {
auto norm = xt::linalg::norm(vector, 2);
if (std::abs(norm - static_cast<ScalarType>(1.0)) >= tol) {
vector /= norm;
} else {
if (norm == 0.0) {
throw std::runtime_error(
"Cannot normalize a vector whose norm is smaller than tol");
}
if (std::abs(norm - static_cast<ScalarType>(1.0)) >= tol) {
vector /= norm;
}
}
}

Expand Down

0 comments on commit 06e6291

Please sign in to comment.