59 const auto startIdx =
byte * 8;
60 const auto byteValue = a[byte];
62 for (
uint8 bit = 0; bit < 8; ++bit)
64 result[startIdx + bit] =
static_cast<uint8>((byteValue & (
uint8{ 1 } << bit)) >> bit);
72 const auto aShape = a.
shape();
74 const auto resultCSlice = result.
cSlice();
75 const auto aCSlice = a.
cSlice();
120 const auto startIdx =
byte * 8;
121 const auto byteValue = a[byte];
123 for (
uint8 bit = 0; bit < 8; ++bit)
125 const auto bitToMask =
static_cast<uint8>(7 - bit);
126 result[startIdx + bit] =
127 static_cast<uint8>((byteValue & (
uint8{ 1 } << bitToMask)) >> bitToMask);
135 const auto aShape = a.
shape();
137 const auto resultCSlice = result.
cSlice();
138 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:135
size_type size() const noexcept
Definition NdArrayCore.hpp:4600
self_type transpose() const
Definition NdArrayCore.hpp:4959
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4587
uint32 size_type
Definition NdArrayCore.hpp:152
Slice cSlice(index_type inStartIdx=0, size_type inStepSize=1) const
Definition NdArrayCore.hpp:1004
self_type & put(index_type inIndex, const value_type &inValue)
Definition NdArrayCore.hpp:3769
Definition Cartesian.hpp:39
std::uint8_t uint8
Definition Types.hpp:42
NdArray< uint8 > unpackbitsBigEndian(const NdArray< uint8 > &a, Axis axis=Axis::NONE)
Definition unpackbits.hpp:110
NdArray< uint8 > unpackbitsLittleEndian(const NdArray< uint8 > &a, Axis axis=Axis::NONE)
Definition unpackbits.hpp:49
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