Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Packed_Row< Cols >::Proxy< Checked > Class Template Reference

Proxy of a column of a row that is not const. More...

Collaboration diagram for Aleph::Packed_Row< Cols >::Proxy< Checked >:
[legend]

Public Member Functions

constexpr Proxy (Packed_Row &r, const size_t col) noexcept
 Bind column col of r.
 
constexpr Proxy (const Proxy &) noexcept=default
 Copying a proxy binds the same column of the same row.
 
constexpr operator std::int64_t () const noexcept
 Read the column.
 
constexpr const Proxy & operator= (const std::int64_t v) const noexcept(not Checked)
 Write the column.
 
constexpr const Proxy & operator= (const Proxy &p) const noexcept(not Checked)
 Write the column with the value of another one.
 
constexpr const Proxy & operator+= (const std::int64_t v) const noexcept(not Checked)
 Add v to the column.
 
constexpr const Proxy & operator-= (const std::int64_t v) const noexcept(not Checked)
 Subtract v from the column.
 
constexpr const Proxy & operator++ () const noexcept(not Checked)
 Add one to the column.
 
constexpr const Proxy & operator-- () const noexcept(not Checked)
 Subtract one from the column.
 

Private Attributes

Packed_Row & row
 The row.
 
size_t j
 The column; already validated if Checked.
 

Detailed Description

template<Bit_Column... Cols>
template<bool Checked>
class Aleph::Packed_Row< Cols >::Proxy< Checked >

Proxy of a column of a row that is not const.

Template Parameters
CheckedWhether writing validates the value.

Definition at line 411 of file tpl_packed_matrix.H.

Constructor & Destructor Documentation

◆ Proxy() [1/2]

template<Bit_Column... Cols>
template<bool Checked>
constexpr Aleph::Packed_Row< Cols >::Proxy< Checked >::Proxy ( Packed_Row &  r,
const size_t  col 
)
inlineconstexprnoexcept

Bind column col of r.

Parameters
[in]rThe row.
[in]colThe column, less than num_cols.

Definition at line 421 of file tpl_packed_matrix.H.

◆ Proxy() [2/2]

template<Bit_Column... Cols>
template<bool Checked>
constexpr Aleph::Packed_Row< Cols >::Proxy< Checked >::Proxy ( const Proxy< Checked > &  )
constexprdefaultnoexcept

Copying a proxy binds the same column of the same row.

Member Function Documentation

◆ operator std::int64_t()

template<Bit_Column... Cols>
template<bool Checked>
constexpr Aleph::Packed_Row< Cols >::Proxy< Checked >::operator std::int64_t ( ) const
inlineconstexprnoexcept

◆ operator++()

template<Bit_Column... Cols>
template<bool Checked>
constexpr const Proxy & Aleph::Packed_Row< Cols >::Proxy< Checked >::operator++ ( ) const
inlineconstexprnoexcept

Add one to the column.

Returns
This proxy.
Exceptions
std::domain_errorif Checked and the column is at its highest value; the row does not change.
Note
A column that holds every std::int64_t wraps around.

Definition at line 495 of file tpl_packed_matrix.H.

◆ operator+=()

template<Bit_Column... Cols>
template<bool Checked>
constexpr const Proxy & Aleph::Packed_Row< Cols >::Proxy< Checked >::operator+= ( const std::int64_t  v) const
inlineconstexprnoexcept

Add v to the column.

Parameters
[in]vThe addend.
Returns
This proxy.
Exceptions
std::domain_errorif Checked and the sum is outside the range of the column; the row does not change.
Note
The sum is computed modulo 2^64: on a column that holds every std::int64_t it wraps around.

Definition at line 469 of file tpl_packed_matrix.H.

References Aleph::Packed_Row< Cols >::fast_read(), Aleph::Packed_Row< Cols >::Proxy< Checked >::j, and Aleph::Packed_Row< Cols >::Proxy< Checked >::row.

◆ operator--()

template<Bit_Column... Cols>
template<bool Checked>
constexpr const Proxy & Aleph::Packed_Row< Cols >::Proxy< Checked >::operator-- ( ) const
inlineconstexprnoexcept

Subtract one from the column.

Returns
This proxy.
Exceptions
std::domain_errorif Checked and the column is at its lowest value; the row does not change.
Note
A column that holds every std::int64_t wraps around.

Definition at line 506 of file tpl_packed_matrix.H.

◆ operator-=()

template<Bit_Column... Cols>
template<bool Checked>
constexpr const Proxy & Aleph::Packed_Row< Cols >::Proxy< Checked >::operator-= ( const std::int64_t  v) const
inlineconstexprnoexcept

Subtract v from the column.

Parameters
[in]vThe subtrahend.
Returns
This proxy.
Exceptions
std::domain_errorif Checked and the difference is outside the range of the column; the row does not change.
Note
The difference is computed modulo 2^64: on a column that holds every std::int64_t it wraps around.

Definition at line 483 of file tpl_packed_matrix.H.

References Aleph::Packed_Row< Cols >::fast_read(), Aleph::Packed_Row< Cols >::Proxy< Checked >::j, and Aleph::Packed_Row< Cols >::Proxy< Checked >::row.

◆ operator=() [1/2]

template<Bit_Column... Cols>
template<bool Checked>
constexpr const Proxy & Aleph::Packed_Row< Cols >::Proxy< Checked >::operator= ( const Proxy< Checked > &  p) const
inlineconstexprnoexcept

Write the column with the value of another one.

Parameters
[in]pProxy of the column to read.
Returns
This proxy.
Exceptions
std::domain_errorif Checked and the value is outside the range of this column; the row does not change.

Definition at line 456 of file tpl_packed_matrix.H.

◆ operator=() [2/2]

template<Bit_Column... Cols>
template<bool Checked>
constexpr const Proxy & Aleph::Packed_Row< Cols >::Proxy< Checked >::operator= ( const std::int64_t  v) const
inlineconstexprnoexcept

Write the column.

Parameters
[in]vThe value.
Returns
This proxy.
Exceptions
std::domain_errorif Checked and v is outside the range of the column; the row does not change.

Definition at line 442 of file tpl_packed_matrix.H.

References Aleph::Packed_Row< Cols >::check_value(), Aleph::Packed_Row< Cols >::fast_write(), Aleph::Packed_Row< Cols >::Proxy< Checked >::j, and Aleph::Packed_Row< Cols >::Proxy< Checked >::row.

Member Data Documentation

◆ j

◆ row


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