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