Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions core/base/inc/TMathBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ namespace TMath {
// Binary search
template <typename T> Long64_t BinarySearch(Long64_t n, const T *array, T value);
template <typename T> Long64_t BinarySearch(Long64_t n, const T **array, T value);
template <typename Iterator, typename Element> Iterator BinarySearch(Iterator first, Iterator last, Element value)
R__DEPRECATED(6,40, "Undefined behavior in case \"value\" is smaller than the first element. Use STL algorithms instead, e.g. std::lower_bound(v.rbegin(), v.rend(), value, std::greater{}).");

// Sorting
template <typename Element, typename Index>
Expand Down Expand Up @@ -321,6 +323,23 @@ inline ULong_t TMath::Range(ULong_t lb, ULong_t ub, ULong_t x)
inline Double_t TMath::Range(Double_t lb, Double_t ub, Double_t x)
{ return x < lb ? lb : (x > ub ? ub : x); }

/// Binary search in an array defined by its iterators.
///
/// The values in the iterators range are supposed to be sorted
/// prior to this call. If match is found, function returns
/// position of element. If no match found, function gives nearest
/// element smaller than value.
template <typename Iterator, typename Element>
Iterator TMath::BinarySearch(Iterator first, Iterator last, Element value)
{
Iterator pind;
pind = std::lower_bound(first, last, value);
if ( (pind != last) && (*pind == value) )
return pind;
else
return ( pind - 1);
}

/// Binary search in an array of n values to locate value.
///
/// Array is supposed to be sorted prior to this call.
Expand Down
2 changes: 1 addition & 1 deletion core/foundation/inc/ROOT/RConfig.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@

/*---- deprecation -----------------------------------------------------------*/
#if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
# if (__GNUC__ == 5 && (__GNUC_MINOR__ == 1 || __GNUC_MINOR__ == 2)) || defined(R__NO_DEPRECATION)
# if (__GNUC__ == 5 && (__GNUC_MINOR__ == 1 || __GNUC_MINOR__ == 2)) || defined(R__NO_DEPRECATION) || defined(__ROOTCLING__)
/* GCC 5.1, 5.2: false positives due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15269
or deprecation turned off */
# define _R__DEPRECATED_LATER(REASON)
Expand Down
20 changes: 20 additions & 0 deletions tree/dataframe/inc/ROOT/RDF/RInterface.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,26 @@ public:
return newInterface;
}

////////////////////////////////////////////////////////////////////////////
/// \brief Save selected columns to disk, in a new TTree or RNTuple `treename` in file `filename`.
/// \deprecated Use other overloads that do not require template arguments.
/// \tparam ColumnTypes variadic list of branch/column types.
/// \param[in] treename The name of the output TTree or RNTuple.
/// \param[in] filename The name of the output TFile.
/// \param[in] columnList The list of names of the columns/branches/fields to be written.
/// \param[in] options RSnapshotOptions struct with extra options to pass to the output TFile and TTree/RNTuple.
/// \return a `RDataFrame` that wraps the snapshotted dataset.
///
template <typename... ColumnTypes>
R__DEPRECATED(
6, 40, "Snapshot does not need template arguments anymore, you can safely remove them from this function call.")
RResultPtr<RInterface<RLoopManager>> Snapshot(std::string_view treename, std::string_view filename,
const ColumnNames_t &columnList,
const RSnapshotOptions &options = RSnapshotOptions())
{
return Snapshot(treename, filename, columnList, options);
}

////////////////////////////////////////////////////////////////////////////
/// \brief Save selected columns to disk, in a new TTree or RNTuple `treename` in file `filename`.
/// \param[in] treename The name of the output TTree or RNTuple.
Expand Down
Loading