GiNaC 1.8.7
|
The remember table is organized like an n-fold associative cache in a microprocessor. More...
#include <remember.h>
Public Member Functions | |
remember_table () | |
remember_table (unsigned s, unsigned as, unsigned strat) | |
bool | lookup_entry (function const &f, ex &result) const |
void | add_entry (function const &f, ex const &result) |
void | clear_all_entries () |
void | show_statistics (std::ostream &os, unsigned level) const |
Static Public Member Functions | |
static std::vector< remember_table > & | remember_tables () |
Protected Member Functions | |
void | init_table () |
Protected Attributes | |
unsigned | table_size |
unsigned | max_assoc_size |
unsigned | remember_strategy |
The remember table is organized like an n-fold associative cache in a microprocessor.
The table has a width of 's' (which is rounded to table_size, some power of 2 near 's', internally) and a depth of 'as' (unless you choose that entries are never discarded). The place where an entry is stored depends on the hashvalue of the parameters of the function (this corresponds to the address of byte to be cached). The 'log_2(table_size)' least significant bits of this hashvalue give the slot in which the entry will be stored or looked up. Each slot can take up to 'as' entries. If a slot is full, an older entry is removed by one of the following strategies:
Definition at line 83 of file remember.h.
GiNaC::remember_table::remember_table | ( | ) |
Definition at line 139 of file remember.cpp.
References GiNaC::remember_strategies::delete_never, max_assoc_size, remember_strategy, and table_size.
GiNaC::remember_table::remember_table | ( | unsigned | s, |
unsigned | as, | ||
unsigned | strat | ||
) |
Definition at line 146 of file remember.cpp.
References init_table(), GiNaC::log2(), and table_size.
Definition at line 157 of file remember.cpp.
References GiNaC::basic::gethash(), GINAC_ASSERT, and table_size.
Definition at line 164 of file remember.cpp.
References GiNaC::basic::gethash(), GINAC_ASSERT, and table_size.
void GiNaC::remember_table::clear_all_entries | ( | ) |
Definition at line 171 of file remember.cpp.
References init_table().
void GiNaC::remember_table::show_statistics | ( | std::ostream & | os, |
unsigned | level | ||
) | const |
|
static |
Definition at line 184 of file remember.cpp.
Referenced by GiNaC::function::lookup_remember_table(), GiNaC::function::register_new(), and GiNaC::function::store_remember_table().
|
protected |
Definition at line 177 of file remember.cpp.
References max_assoc_size, remember_strategy, and table_size.
Referenced by clear_all_entries(), and remember_table().
|
protected |
Definition at line 94 of file remember.h.
Referenced by add_entry(), init_table(), lookup_entry(), and remember_table().
|
protected |
Definition at line 95 of file remember.h.
Referenced by init_table(), and remember_table().
|
protected |
Definition at line 96 of file remember.h.
Referenced by init_table(), and remember_table().