SHOGUN v0.9.0
组合类型 | 公有成员 | 保护属性
CCache< T >模板类参考

详细描述

template<class T>
class shogun::CCache< T >

Template class Cache implements a simple cache.

When the cache is full -- elements that are least used are freed from the cache. Thus for the cache to be effective one should not visit loop over objects, i.e. visit elements in order 0...num_elements (with num_elements >> the maximal number of entries in cache)

在文件Cache.h第31行定义。

继承图,类CCache< T >
Inheritance graph
[图例]

所有成员的列表。

组合类型

struct  TEntry

公有成员

 CCache (void)
 CCache (int64_t cache_size, int64_t obj_size, int64_t num_entries)
virtual ~CCache ()
bool is_cached (int64_t number)
T * lock_entry (int64_t number)
void unlock_entry (int64_t number)
T * set_entry (int64_t number)
virtual const char * get_name () const

保护属性

bool cache_is_full
int64_t entry_size
int64_t nr_cache_lines
TEntry * lookup_table
TEntry ** cache_table
T * cache_block

构造及析构函数文档

CCache ( void  )

default constructor

在文件Cache.h第46行定义。

CCache ( int64_t  cache_size,
int64_t  obj_size,
int64_t  num_entries 
)

constructor

create a cache in which num_entries objects can be cached whose lookup table of sizeof(int64_t)*num_entries must fit into memory

参数:
cache_sizecache size in Megabytes
obj_sizeobject size
num_entriesnumber of cached objects

在文件Cache.h第68行定义。

virtual ~CCache ( ) [virtual]

在文件Cache.h第112行定义。


成员函数文档

virtual const char* get_name ( void  ) const [virtual]
返回:
object name

实现了CSGObject。

在文件Cache.h第245行定义。

bool is_cached ( int64_t  number)

checks if an object is cached

参数:
numbernumber of object to check for
返回:
if an object is cached

在文件Cache.h第124行定义。

T* lock_entry ( int64_t  number)

lock and get a cache entry

参数:
numbernumber of object to lock and get
返回:
cache entry or NULL when not cached

在文件Cache.h第134行定义。

T* set_entry ( int64_t  number)

returns the address of a free cache entry to where the data of size obj_size has to be written

参数:
numbernumber of object to unlock
返回:
address of a free cache entry

在文件Cache.h第163行定义。

void unlock_entry ( int64_t  number)

unlock a cache entry

参数:
numbernumber of object to unlock

在文件Cache.h第150行定义。


成员数据文档

T* cache_block [protected]

cache block

在文件Cache.h第259行定义。

bool cache_is_full [protected]

if cache is full

在文件Cache.h第249行定义。

TEntry** cache_table [protected]

cache table containing cached objects

在文件Cache.h第257行定义。

int64_t entry_size [protected]

size of one entry

在文件Cache.h第251行定义。

TEntry* lookup_table [protected]

lookup table

在文件Cache.h第255行定义。

int64_t nr_cache_lines [protected]

number of cache lines

在文件Cache.h第253行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation