 |
NumCpp
1.0
A C++ implementation of the Python Numpy library
|
Go to the documentation of this file.
48 template<
typename dtype>
49 constexpr
double interp(dtype inValue1, dtype inValue2,
double inPercent) noexcept
72 template<
typename dtype>
91 for (
auto sortedXpIdx : sortedXpIdxs)
93 sortedXp[counter] = inXp[sortedXpIdx];
94 sortedFp[counter++] = inFp[sortedXpIdx];
104 while (currXidx < sortedX.
size())
106 if (sortedXp[currXpIdx] <= sortedX[currXidx] && sortedX[currXidx] <= sortedXp[currXpIdx + 1])
108 const double percent =
static_cast<double>(sortedX[currXidx] - sortedXp[currXpIdx]) /
109 static_cast<double>(sortedXp[currXpIdx + 1] - sortedXp[currXpIdx]);
110 returnArray[currXidx++] =
utils::interp(sortedFp[currXpIdx], sortedFp[currXpIdx + 1], percent);
value_type item() const
Definition: NdArrayCore.hpp:2950
constexpr double interp(dtype inValue1, dtype inValue2, double inPercent) noexcept
Definition: Functions/interp.hpp:49
constexpr double interp(double inValue1, double inValue2, double inPercent) noexcept
Definition: Utils/interp.hpp:44
NdArray< dtype > max(Axis inAxis=Axis::NONE) const
Definition: NdArrayCore.hpp:2971
std::uint32_t uint32
Definition: Types.hpp:41
size_type size() const noexcept
Definition: NdArrayCore.hpp:4310
Definition: Coordinate.hpp:45
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
NdArray< dtype > sort(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: sort.hpp:48
NdArray< uint32 > argsort(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: argsort.hpp:48
NdArray< dtype > min(Axis inAxis=Axis::NONE) const
Definition: NdArrayCore.hpp:3027