MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
pbqp::Matrix Class Reference

An owning row-major cost matrix; it views its own storage, so writes go through span(). More...

#include <pbqp/graph.h>

Inheritance diagram for pbqp::Matrix:
[legend]

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)

Detailed Description

An owning row-major cost matrix; it views its own storage, so writes go through span().

Definition at line 189 of file graph.h.

Constructor & Destructor Documentation

◆ Matrix() [1/7]

pbqp::Matrix::Matrix ( )
default

◆ Matrix() [2/7]

pbqp::Matrix::Matrix ( size_t rows,
size_t cols,
Cost fill = 0 )
inline

◆ Matrix() [3/7]

pbqp::Matrix::Matrix ( size_t rows,
size_t cols,
std::initializer_list< Cost > costs )
inline

◆ Matrix() [4/7]

template<class F>
requires std::is_invocable_r_v<Cost, F&, size_t, size_t>
pbqp::Matrix::Matrix ( size_t rows,
size_t cols,
F f )
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().

◆ Matrix() [5/7]

pbqp::Matrix::Matrix ( MatrixView view)
inlineexplicit

◆ Matrix() [6/7]

pbqp::Matrix::Matrix ( const Matrix & other)
inline

◆ Matrix() [7/7]

pbqp::Matrix::Matrix ( Matrix && other)
inlinenoexcept

Definition at line 205 of file graph.h.

References Matrix().

Member Function Documentation

◆ operator+=()

Matrix & pbqp::Matrix::operator+= ( MatrixView rhs)
inline

Definition at line 218 of file graph.h.

References Matrix(), and span().

◆ operator=()

Matrix & pbqp::Matrix::operator= ( Matrix other)
inlinenoexcept

Definition at line 209 of file graph.h.

References Matrix().

◆ span()

MatrixSpan pbqp::Matrix::span ( )
inlinenodiscard

◆ operator==

bool operator== ( const Matrix & a,
const Matrix & b )
friend

Definition at line 223 of file graph.h.

References Matrix().


The documentation for this class was generated from the following file: