Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9555

[DF] Compilation fails for Reduce on a bool column due to std::vector<bool>

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 6.16/00, 6.14/04
    • Component/s: None
    • Labels:
      None
    • Environment:

      any

      Description

      Minimal repro:

      #include <ROOT/RDataFrame.hxx>
       
      int main()
      {
         ROOT::RDataFrame df(10);
         *df.Define("b", [] { return true; }).Reduce([](bool a, bool b) { return a == b; }, "b", true);
         return 0;
      }
      

      The critical points are a loop over the per-thread partial reductions:

      for (auto &r : fAggregators)
      

      which is fixed by changing auto & to const auto &

      and T& PartialUpdate, a method that each action helper implements which in this case returns a reference to a vector<bool> element.

        Attachments

          Activity

            People

            Assignee:
            eguiraud Enrico Guiraud
            Reporter:
            eguiraud Enrico Guiraud
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: