HLIBpro  3.0
TUpdateAccumulator< value_t > Class Template Reference

Handles updates for a single matrix block by accumulating direct updates and recursive (pending) updates.

#include <TUpdateAccumulator.hh>

Inheritance diagram for TUpdateAccumulator< value_t >:
TLockable

Public Member Functions

 ~TUpdateAccumulator ()
 dtor
 
void init (const TMatrix< value_t > *M)
 initialise matrix for accumulated updates
 
void apply_direct (const TTruncAcc &acc, TMatrix< value_t > *dest=nullptr, const bool update_dest=false)
 
bool has_updates () const
 return true if accumulator holds any updates
 
auto accumulated_updates () -> TMatrix< value_t > *
 access accumulated updates
 
auto pending_direct () -> direct_updates_t &
 access set of direct pending updates
 
auto pending_recursive () -> recursive_updates_t &
 access set of recursive pending updates
 
void add_update (const TMatrix< value_t > *M, const TTruncAcc &acc, const TMatrix< value_t > *dest=nullptr)
 add update matrix
 
void add_parent_update (const TMatrix< value_t > *M, const TTruncAcc &acc)
 add update from parent matrix
 
void add_pending_direct (TDirectMatrixUpdate< value_t > *U)
 add update U to set of recursive pending updates
 
void add_pending_recursive (TRecursiveMatrixUpdate< value_t > *U)
 add update U to set of recursive pending updates
 
void clear_accumulated ()
 remove matrix with accumulated updates
 
void clear_pending ()
 remove list of pending updates
 
void clear_updates ()
 clear all updates
 
- Public Member Functions inherited from TLockable
TMutexmutex ()
 give access to internal mutex
 
void lock ()
 lock local mutex
 
void unlock ()
 unlock local mutex
 
size_t byte_size () const
 return size in bytes used by this object
 

Member Function Documentation

◆ apply_direct()

void apply_direct ( const TTruncAcc acc,
TMatrix< value_t > *  dest = nullptr,
const bool  update_dest = false 
)

compute and apply local direct updates;

  • use dest as hint for destination type, e.g. to choose format of accumulator
  • directly update dest if update_dest == true (accumulator is zero afterwards)