An owning row-major cost matrix; it views its own storage, so writes go through span(). More...
#include <pbqp/graph.h>
Public Member Functions | |
| Matrix ()=default | |
| Matrix (size_t rows, size_t cols, Cost fill=0) | |
| Matrix (size_t rows, size_t cols, std::initializer_list< Cost > costs) | |
| template<class F> requires std::is_invocable_r_v<Cost, F&, size_t, size_t> | |
| Matrix (size_t rows, size_t cols, F f) | |
| Entry (r, c) is f(r, c), generated in row-major order. | |
| Matrix (MatrixView view) | |
| Matrix (const Matrix &other) | |
| Matrix (Matrix &&other) noexcept | |
| Matrix & | operator= (Matrix other) noexcept |
| MatrixSpan | span () |
| Matrix & | operator+= (MatrixView rhs) |
| Public Member Functions inherited from pbqp::BasicMatrix< const Cost > | |
| constexpr | BasicMatrix ()=default |
| constexpr | BasicMatrix (const Cost *data, size_t rows, size_t cols) |
| constexpr | BasicMatrix (const BasicMatrix< U > &other) |
| constexpr const Cost & | operator[] (size_t row, size_t col) const |
| constexpr size_t | rows () const |
| constexpr size_t | cols () const |
| constexpr size_t | size () const |
| constexpr bool | row_major () const |
| Whether rows are contiguous, which also holds for a transposed single row or column. | |
| constexpr BasicMatrix | transposed () const |
| constexpr const BasicMatrix & | operator+= (BasicMatrix< const Cost > rhs) const |
| constexpr void | copy_from (BasicMatrix< const Cost > src) const |
| constexpr void | erase_rows (fe::View< size_t > rows) & |
| Erases the rows in rows, which must be sorted and distinct. | |
| constexpr void | erase_cols (fe::View< size_t > cols) & |
| Erases the columns in cols, which must be sorted and distinct. | |
| constexpr const Cost * | data () const |
| constexpr const Cost * | begin () const |
| constexpr const Cost * | end () const |
| constexpr const Cost * | row (size_t row) const |
Friends | |
| bool | operator== (const Matrix &a, const Matrix &b) |
An owning row-major cost matrix; it views its own storage, so writes go through span().
|
default |
Referenced by Matrix(), Matrix(), Matrix(), Matrix(), Matrix(), Matrix(), operator+=(), operator=(), and operator==.
|
inline |
Definition at line 192 of file graph.h.
References pbqp::BasicMatrix< const Cost >::cols(), Matrix(), and pbqp::BasicMatrix< const Cost >::rows().
|
inline |
Definition at line 194 of file graph.h.
References pbqp::BasicMatrix< const Cost >::cols(), Matrix(), and pbqp::BasicMatrix< const Cost >::rows().
|
inline |
Entry (r, c) is f(r, c), generated in row-major order.
Definition at line 198 of file graph.h.
References pbqp::BasicMatrix< const Cost >::cols(), Matrix(), and pbqp::BasicMatrix< const Cost >::rows().
|
inlineexplicit |
Definition at line 200 of file graph.h.
References pbqp::BasicMatrix< const Cost >::cols(), Matrix(), and pbqp::BasicMatrix< const Cost >::rows().
|
inline |
Definition at line 203 of file graph.h.
References pbqp::BasicMatrix< const Cost >::cols(), Matrix(), and pbqp::BasicMatrix< const Cost >::rows().
|
inlinenoexcept |
|
inline |
|
inlinenodiscard |
Definition at line 216 of file graph.h.
References pbqp::BasicMatrix< const Cost >::cols(), and pbqp::BasicMatrix< const Cost >::rows().
Referenced by operator+=().