52 template<
typename dtype>
60 for (
auto value : inArray)
62 if (value != dtype{ 0 })
70 if (place == inArray.size())
84 for (
uint32 i = inArray.
size() - 1; i > 0; --i)
86 if (inArray[i] != dtype{ 0 })
94 if (place == 0 || (place == 1 && inArray[0] == dtype{ 0 }))
108 for (
auto value : inArray)
110 if (value != dtype{ 0 })
118 if (placeBegin == inArray.size())
123 uint32 placeEnd = inArray.size();
124 for (
uint32 i = inArray.size() - 1; i > 0; --i)
126 if (inArray[i] != dtype{ 0 })
134 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:50
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:4497
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1270
iterator begin() noexcept
Definition: NdArrayCore.hpp:1214
OutputIt copy(InputIt first, InputIt last, OutputIt destination) noexcept
Definition: StlAlgorithms.hpp:95
Definition: Coordinate.hpp:45
NdArray< dtype > trim_zeros(const NdArray< dtype > &inArray, const std::string &inTrim="fb")
Definition: trim_zeros.hpp:53
std::uint32_t uint32
Definition: Types.hpp:40