51 template<
typename dtype>
59 for (
auto value : inArray)
61 if (value != dtype{ 0 })
69 if (
place == inArray.size())
83 for (
uint32 i = inArray.
size() - 1; i > 0; --i)
85 if (inArray[i] != dtype{ 0 })
93 if (
place == 0 || (
place == 1 && inArray[0] == dtype{ 0 }))
107 for (
auto value : inArray)
109 if (value != dtype{ 0 })
117 if (placeBegin == inArray.size())
122 uint32 placeEnd = inArray.size();
123 for (
uint32 i = inArray.size() - 1; i > 0; --i)
125 if (inArray[i] != dtype{ 0 })
133 if (placeEnd == 0 || (placeEnd == 1 && inArray[0] == dtype{ 0 }))
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:49
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
size_type size() const noexcept
Definition: NdArrayCore.hpp:4105
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1221
iterator begin() noexcept
Definition: NdArrayCore.hpp:1171
OutputIt copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:99
Definition: Coordinate.hpp:45
void place(NdArray< dtype > &arr, const NdArray< bool > &mask, const NdArray< dtype > &vals)
Definition: place.hpp:48
NdArray< dtype > trim_zeros(const NdArray< dtype > &inArray, const std::string &inTrim="fb")
Definition: trim_zeros.hpp:52
std::uint32_t uint32
Definition: Types.hpp:40