Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial merged works as future common base #282

Merged

Conversation

HaiwangYu and others added 30 commits January 5, 2024 14:15
This commit adds a new interface called IClusterFaninTensorSet to the WireCellIface namespace. The interface is a fan-in node that takes IClusters as input and outputs an ITensorSet. The commit also includes the necessary header and source file changes to implement the interface.
Eg:

../img/src/PointTreeBuilding.cxx:190:35: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
        auto cnode = root->insert(std::move(std::make_unique<Points::node_t>()));

We should not use std::move() here because the return of make_unique() is already an lvalue.  Likewise in code like:

       cnode->insert(Points(std::move(pcs)));

The Points() constructor returns a temporary which is also an lvalue.

C++ will automaticaly move lvalues to their destination (copy elision).

And for reasons I do not yet understand, std::move() defeats that.
Any TensorDM function that took an ITensor::vector now also takes a TensorIndex
@@ -214,7 +214,7 @@ namespace {
const auto& z = pc_scalar.get("z")->elements<float_t>();
std::vector<Point2D> points;
for (size_t i = 0; i < y.size(); ++i) {
points.push_back({y[i], z[i]});
points.push_back({(float)y[i], (float)z[i]});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is double OK?

@HaiwangYu HaiwangYu merged commit f459617 into WireCell:apply-pointcloud Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants