61 const auto startIdx =
byte * 8;
62 const auto byteValue = a[byte];
64 for (
uint8 bit = 0; bit < 8; ++bit)
66 result[startIdx + bit] =
static_cast<uint8>((byteValue & (
uint8{ 1 } << bit)) >> bit);
74 const auto aShape = a.
shape();
76 const auto resultCSlice = result.
cSlice();
77 const auto aCSlice = a.
cSlice();
122 const auto startIdx =
byte * 8;
123 const auto byteValue = a[byte];
125 for (
uint8 bit = 0; bit < 8; ++bit)
127 const auto bitToMask =
static_cast<uint8>(7 - bit);
128 result[startIdx + bit] =
129 static_cast<uint8>((byteValue & (
uint8{ 1 } << bitToMask)) >> bitToMask);
137 const auto aShape = a.
shape();
139 const auto resultCSlice = result.
cSlice();
140 const auto aCSlice = a.
cSlice();
#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
size_type size() const noexcept
Definition NdArrayCore.hpp:4604
self_type transpose() const
Definition NdArrayCore.hpp:4963
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4591
uint32 size_type
Definition NdArrayCore.hpp:156
Slice cSlice(index_type inStartIdx=0, size_type inStepSize=1) const
Definition NdArrayCore.hpp:1008
self_type & put(index_type inIndex, const value_type &inValue)
Definition NdArrayCore.hpp:3773
Definition Cartesian.hpp:40
std::uint8_t uint8
Definition Types.hpp:42
NdArray< uint8 > unpackbitsBigEndian(const NdArray< uint8 > &a, Axis axis=Axis::NONE)
Definition unpackbits.hpp:112
NdArray< uint8 > unpackbitsLittleEndian(const NdArray< uint8 > &a, Axis axis=Axis::NONE)
Definition unpackbits.hpp:51
Axis
Enum To describe an axis.
Definition Enums.hpp:36
@ ROW
Definition Enums.hpp:38
@ COL
Definition Enums.hpp:39
@ NONE
Definition Enums.hpp:37