47 template<
typename dtype>
50 if (inNumBytes %
sizeof(dtype) != 0)
55 const auto numElements =
static_cast<uint32>(inNumBytes /
sizeof(dtype));
56 return NdArray<dtype>(
reinterpret_cast<const dtype*
>(inBufferPtr), numElements);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
Definition: Coordinate.hpp:45
NdArray< dtype > frombuffer(const char *inBufferPtr, uint32 inNumBytes)
Definition: frombuffer.hpp:48
std::uint32_t uint32
Definition: Types.hpp:40