 |
NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
|
Go to the documentation of this file.
47 template<
typename dtype>
48 constexpr
double interp(dtype inValue1, dtype inValue2,
double inPercent) noexcept
71 template<
typename dtype>
90 for (
auto sortedXpIdx : sortedXpIdxs)
92 sortedXp[counter] = inXp[sortedXpIdx];
93 sortedFp[counter++] = inFp[sortedXpIdx];
103 while (currXidx < sortedX.
size())
105 if (sortedXp[currXpIdx] <= sortedX[currXidx] && sortedX[currXidx] <= sortedXp[currXpIdx + 1])
107 const double percent =
static_cast<double>(sortedX[currXidx] - sortedXp[currXpIdx]) /
108 static_cast<double>(sortedXp[currXpIdx + 1] - sortedXp[currXpIdx]);
109 returnArray[currXidx++] =
utils::interp(sortedFp[currXpIdx], sortedFp[currXpIdx + 1], percent);
value_type item() const
Definition: NdArrayCore.hpp:2975
constexpr double interp(dtype inValue1, dtype inValue2, double inPercent) noexcept
Definition: Functions/interp.hpp:48
constexpr double interp(double inValue1, double inValue2, double inPercent) noexcept
Definition: Utils/interp.hpp:43
NdArray< dtype > max(Axis inAxis=Axis::NONE) const
Definition: NdArrayCore.hpp:2996
std::uint32_t uint32
Definition: Types.hpp:40
size_type size() const noexcept
Definition: NdArrayCore.hpp:4370
Definition: Coordinate.hpp:44
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
NdArray< dtype > sort(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: sort.hpp:47
NdArray< uint32 > argsort(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: argsort.hpp:47
NdArray< dtype > min(Axis inAxis=Axis::NONE) const
Definition: NdArrayCore.hpp:3053