Skip to content

Commit 3189cc4

Browse files
BMat8: rows array by reference
1 parent 665c9be commit 3189cc4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/bmat8.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class BMat8 {
193193
size_t nr_rows() const;
194194
//! Returns a \c std::vector for rows of \c this
195195
std::vector<uint8_t> rows() const;
196+
void rows(std::array<uint8_t, 8>&) const;
196197

197198
//! Returns the cardinality of the row space of \c this
198199
//!

include/bmat8_impl.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,13 @@ inline std::vector<uint8_t> BMat8::rows() const {
397397
return rows;
398398
}
399399

400+
inline void BMat8::rows(std::array<uint8_t, 8>& rows) const {
401+
rows.fill(0);
402+
for (size_t i = 0; i < 8; ++i) {
403+
rows[i] = static_cast<uint8_t>(_data << (8 * i) >> 56);
404+
}
405+
}
406+
400407
inline size_t BMat8::nr_rows() const {
401408
epu8 x = _mm_set_epi64x(_data, 0);
402409
return _mm_popcnt_u64(_mm_movemask_epi8(x != epu8 {}));

0 commit comments

Comments
 (0)