Skip to content

Commit

Permalink
More clang-tidy fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Feb 7, 2025
1 parent 89417ce commit fda237d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions freud/density/GaussianDensity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ void GaussianDensity::compute(const freud::locality::NeighborQuery* nq, const fl

// Assure that out of range indices are corrected for storage
// in the array i.e. bin -1 is actually bin 29 for nbins = 30
const float ni = float((i + m_width.x) % m_width.x);
const float nj = float((j + m_width.y) % m_width.y);
const float nk = float((k + m_width.z) % m_width.z);
const auto ni = float((i + m_width.x) % m_width.x);
const auto nj = float((j + m_width.y) % m_width.y);
const auto nk = float((k + m_width.z) % m_width.z);

// Store the gaussian contribution
local_bin_counts.local()(ni, nj, nk) += gaussian;
Expand Down
1 change: 1 addition & 0 deletions freud/density/LocalDensity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <vector>

#include "LocalDensity.h"
#include "ManagedArray.h"
#include "NeighborBond.h"
#include "NeighborComputeFunctional.h"
#include "NeighborList.h"
Expand Down
1 change: 1 addition & 0 deletions freud/density/SphereVoxelization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cstddef>
#include <memory>
#include <stdexcept>
#include <vector>

#include "ManagedArray.h"
#include "NeighborQuery.h"
Expand Down
7 changes: 3 additions & 4 deletions freud/density/export-LocalDensity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <nanobind/nanobind.h>
#include <nanobind/ndarray.h>
#include <nanobind/stl/shared_ptr.h> // NOLINT(misc-include-cleaner): used implicitly
#include <utility>

#include "LocalDensity.h"
#include "NeighborList.h"
Expand All @@ -20,13 +19,13 @@ using nb_array = nanobind::ndarray<T, shape, nanobind::device::cpu, nanobind::c_
namespace wrap {

void computeLocalDensity(const std::shared_ptr<LocalDensity>& self,
std::shared_ptr<locality::NeighborQuery>& points,
const std::shared_ptr<locality::NeighborQuery>& points,
nb_array<float, nanobind::shape<-1, 3>>& query_points,
const unsigned int num_query_points, std::shared_ptr<locality::NeighborList> nlist,
const unsigned int num_query_points, std::shared_ptr<locality::NeighborList>& nlist,
const locality::QueryArgs& qargs)
{
auto* query_points_data = reinterpret_cast<vec3<float>*>(query_points.data());
self->compute(points, query_points_data, num_query_points, std::move(nlist), qargs);
self->compute(points, query_points_data, num_query_points, nlist, qargs);
}

}; // namespace wrap
Expand Down
4 changes: 1 addition & 3 deletions freud/density/export-RDF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <nanobind/ndarray.h>
#include <nanobind/stl/shared_ptr.h> // NOLINT(misc-include-cleaner): used implicitly

#include <utility>

#include "BondHistogramCompute.h"
#include "NeighborList.h"
#include "NeighborQuery.h"
Expand All @@ -27,7 +25,7 @@ void accumulateRDF(const std::shared_ptr<RDF>& self, const std::shared_ptr<local
{
unsigned int const num_query_points = query_points.shape(0);
auto* query_points_data = reinterpret_cast<vec3<float>*>(query_points.data());
self->accumulate(nq, query_points_data, num_query_points, std::move(nlist), qargs);
self->accumulate(nq, query_points_data, num_query_points, nlist, qargs);
}

}; // namespace wrap
Expand Down

0 comments on commit fda237d

Please sign in to comment.