24#ifndef HPCOMBI_BMAT16_HPP_
25#define HPCOMBI_BMAT16_HPP_
37#include "simde/x86/avx2.h"
40using xpu16 = uint16_t __attribute__((vector_size(32)));
41using xpu64 = uint64_t __attribute__((vector_size(32)));
83 explicit BMat16(uint64_t n0, uint64_t n1, uint64_t n2,
84 uint64_t n3)
noexcept;
90 explicit BMat16(std::vector<std::vector<bool>>
const &mat)
noexcept;
118 bool operator==(
BMat16 const &that) const noexcept;
123 bool operator!=(
BMat16 const &that) const noexcept {
124 return !(*
this == that);
142 bool operator()(
size_t i,
size_t j)
const noexcept;
149 void set(
size_t i,
size_t j,
bool val)
noexcept;
154 std::array<std::array<bool, 16>, 16>
to_array() const noexcept;
161 return BMat16(_data | that._data);
217 size_t nr_rows() const noexcept;
221 std::vector<uint16_t>
rows() const;
228 static std::array<uint64_t, 9>
const ones = {0,
237 return BMat16(ones[dim >= 8 ? 8 : dim], 0, 0,
238 ones[dim >= 8 ? dim - 8 : 0]);
254 void swap(
BMat16 &that)
noexcept { std::swap(this->_data, that._data); }
258 std::ostream &
write(std::ostream &os)
const;
declaration of HPCombi::BMat8
Class for fast boolean matrices of dimension up to 16 x 16.
Definition bmat16.hpp:65
std::ostream & write(std::ostream &os) const
Write this on os.
Definition bmat16_impl.hpp:350
size_t nr_rows() const noexcept
Returns the number of non-zero rows of this.
Definition bmat16_impl.hpp:228
void swap(BMat16 &that) noexcept
Definition bmat16.hpp:254
bool operator>(BMat16 const &that) const noexcept
Returns true if this is greater than that.
Definition bmat16_impl.hpp:93
BMat16 mult_transpose(BMat16 const &that) const noexcept
Returns the matrix product of this and the transpose of that.
Definition bmat16_impl.hpp:151
std::vector< uint16_t > rows() const
Returns a std::vector for rows of this.
Definition bmat16_impl.hpp:242
BMat16 mult_4bmat8(BMat16 const &that) const noexcept
Returns the matrix product of this and that.
Definition bmat16_impl.hpp:173
BMat16(BMat16 &&) noexcept=default
A constructor.
static BMat16 one(size_t dim=16) noexcept
Returns the identity BMat16.
Definition bmat16.hpp:226
BMat16 mult_naive(BMat16 const &that) const noexcept
Returns the matrix product of this and that.
Definition bmat16_impl.hpp:184
BMat16(BMat16 const &) noexcept=default
A constructor.
BMat16 mult_naive_array(BMat16 const &that) const noexcept
Returns the matrix product of this and that.
Definition bmat16_impl.hpp:207
BMat16 transpose() const noexcept
Returns the transpose of this.
Definition bmat16_impl.hpp:132
void set(size_t i, size_t j, bool val) noexcept
Sets the (i, j)th position to val.
Definition bmat16_impl.hpp:69
std::array< std::array< bool, 16 >, 16 > to_array() const noexcept
Returns the array representation of this.
Definition bmat16_impl.hpp:102
BMat16 transpose_naive() const noexcept
Returns the transpose of this.
Definition bmat16_impl.hpp:119
bool operator<(BMat16 const &that) const noexcept
Returns true if this is less than that.
Definition bmat16_impl.hpp:84
static BMat16 random()
Returns a random BMat16.
Definition bmat16_impl.hpp:258
BMat16() noexcept=default
A default constructor.
bool operator()(size_t i, size_t j) const noexcept
Returns the entry in the (i, j)th position.
Definition bmat16_impl.hpp:65
defines the macro HPCOMBI_ASSERT
#define HPCOMBI_ASSERT(x)
Definition debug.hpp:31
xpu64 to_block(xpu64 vect)
Converting storage type from rows to blocks of a xpu64 representing a 16x16 matrix (used in BMat16).
Definition bmat16_impl.hpp:41
uint64_t __attribute__((vector_size(32))) xpu64
Definition bmat16.hpp:41
uint16_t __attribute__((vector_size(32))) xpu16
Definition bmat16.hpp:40
xpu64 to_line(xpu64 vect)
Converting storage type from blocks to rows of a xpu64 representing a 16x16 matrix (used in BMat16).
Definition bmat16_impl.hpp:37
Definition bmat16_impl.hpp:362