Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: glotzerlab/freud
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e2c7ba4e8c9378ef7e4907190de1ee1b7c8ea37b
Choose a base ref
..
head repository: glotzerlab/freud
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1aca1d3c6f6db7644aef903520efce5b07bd5034
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +5 −5 cpp/box/export_Box.cc
10 changes: 5 additions & 5 deletions cpp/box/export_Box.cc
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ std::vector<float> centerOfMass(const std::shared_ptr<Box>& box, nb_array<float>
{
const unsigned int Nvecs = vecs.shape(0);
auto vecs_data = reinterpret_cast<vec3<float>*>(vecs.data());
auto reinterpret_cast<float*>(masses.data());
auto masses_data = reinterpret_cast<float*>(masses.data());
auto com = box->centerOfMass(vecs_data, Nvecs, masses_data);
return {com.x, com.y, com.z};
}
@@ -66,7 +66,7 @@ void center(const std::shared_ptr<Box>& box, nb_array<float> vecs, nb_array<floa
{
const unsigned int Nvecs = vecs.shape(0);
auto vecs_data = reinterpret_cast<vec3<float>*>(vecs.data());
auto reinterpret_cast<float*>(masses.data());
auto masses_data = reinterpret_cast<float*>(masses.data());
box->center(vecs_data, Nvecs, masses_data);
}

@@ -77,7 +77,7 @@ void computeDistances(const std::shared_ptr<Box>& box, nb_array<float> query_poi
auto query_points_data = reinterpret_cast<vec3<float>*>(query_points.data());
const unsigned int n_points = points.shape(0);
auto points_data = reinterpret_cast<vec3<float>*>(points.data());
auto reinterpret_cast<float*>(distances.data());
auto distances_data = reinterpret_cast<float*>(distances.data());
if (n_query_points != n_points)
{
throw std::invalid_argument("The number of query points and points must match.");
@@ -92,7 +92,7 @@ void computeAllDistances(const std::shared_ptr<Box>& box, nb_array<float> query_
auto query_points_data = reinterpret_cast<vec3<float>*>(query_points.data());
const unsigned int n_points = points.shape(0);
auto points_data = reinterpret_cast<vec3<float>*>(points.data());
auto reinterpret_cast<float*>(distances.data());
auto distances_data = reinterpret_cast<float*>(distances.data());
box->computeAllDistances(query_points_data, n_query_points, points_data, n_points, distances_data);
}

@@ -101,7 +101,7 @@ void contains(const std::shared_ptr<Box>& box, nb_array<float> points,
{
const unsigned int n_points = points.shape(0);
auto points_data = reinterpret_cast<vec3<float>*>(points.data());
auto reinterpret_cast<bool*>(contains_mask.data());
auto contains_mask_data = reinterpret_cast<bool*>(contains_mask.data());
box->contains(points_data, n_points, contains_mask_data);
}