Documentation 6b54b78464
Loading...
Searching...
No Matches
CBlockView< ScalarType > Struct Template Reference

View of one matrix block, const-correct via the ScalarType template parameter. CBlockView<const ScalarType> is read-only; CBlockView<ScalarType> is mutable and exposes apply<Overwrite>(f) for writing with on-the-fly quantized encoding. Evaluates to false if the block is absent from the sparsity pattern. More...

#include <CSysMatrix.hpp>

Public Types

using QuantType = std::conditional_t< std::is_const_v< ScalarType >, const int8_t, int8_t >
 
using QuantScaleType = std::conditional_t< std::is_const_v< ScalarType >, const uint8_t, uint8_t >
 

Public Member Functions

 operator bool () const
 False when the block is not present in the sparsity pattern.
 
std::remove_const_t< ScalarType > operator() (unsigned long i, unsigned long j) const
 Return entry (row i, col j), decoding quantization if necessary.
 
template<bool Overwrite, class F , class S = ScalarType, su2enable_if<!std::is_const_v< S > > = 0>
void apply (const F &f) const
 Write the block from callable f(i,j). Overwrite=true overwrites (or quantizes for Q_LU_SGS off-diagonal blocks); Overwrite=false accumulates into non-quantized storage only — accumulating into quantized storage would require decode-accumulate-encode and is a silent no-op. Only enabled for mutable (non-const ScalarType) views.
 

Public Attributes

ScalarType * ptr = nullptr
 Full-precision block; non-null iff not quantized.
 
QuantScaleType * qs = nullptr
 Per-row biased binary exponent; non-null iff quantized.
 
QuantType * qv = nullptr
 Quantized values (row-major); non-null iff quantized.
 
unsigned long nVar = 0
 

Detailed Description

template<class ScalarType>
struct CBlockView< ScalarType >

View of one matrix block, const-correct via the ScalarType template parameter. CBlockView<const ScalarType> is read-only; CBlockView<ScalarType> is mutable and exposes apply<Overwrite>(f) for writing with on-the-fly quantized encoding. Evaluates to false if the block is absent from the sparsity pattern.

Member Typedef Documentation

◆ QuantScaleType

template<class ScalarType >
using CBlockView< ScalarType >::QuantScaleType = std::conditional_t<std::is_const_v<ScalarType>, const uint8_t, uint8_t>

◆ QuantType

template<class ScalarType >
using CBlockView< ScalarType >::QuantType = std::conditional_t<std::is_const_v<ScalarType>, const int8_t, int8_t>

Member Function Documentation

◆ apply()

template<class ScalarType >
template<bool Overwrite, class F , class S = ScalarType, su2enable_if<!std::is_const_v< S > > = 0>
void CBlockView< ScalarType >::apply ( const F &  f) const
inline

Write the block from callable f(i,j). Overwrite=true overwrites (or quantizes for Q_LU_SGS off-diagonal blocks); Overwrite=false accumulates into non-quantized storage only — accumulating into quantized storage would require decode-accumulate-encode and is a silent no-op. Only enabled for mutable (non-const ScalarType) views.

◆ operator bool()

template<class ScalarType >
CBlockView< ScalarType >::operator bool ( ) const
inlineexplicit

False when the block is not present in the sparsity pattern.

◆ operator()()

template<class ScalarType >
std::remove_const_t< ScalarType > CBlockView< ScalarType >::operator() ( unsigned long  i,
unsigned long  j 
) const
inline

Return entry (row i, col j), decoding quantization if necessary.

Member Data Documentation

◆ nVar

template<class ScalarType >
unsigned long CBlockView< ScalarType >::nVar = 0

◆ ptr

template<class ScalarType >
ScalarType* CBlockView< ScalarType >::ptr = nullptr

Full-precision block; non-null iff not quantized.

◆ qs

template<class ScalarType >
QuantScaleType* CBlockView< ScalarType >::qs = nullptr

Per-row biased binary exponent; non-null iff quantized.

◆ qv

template<class ScalarType >
QuantType* CBlockView< ScalarType >::qv = nullptr

Quantized values (row-major); non-null iff quantized.


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