⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kernel_cache.h

📁 SVM 软件包
💻 H
字号:
#ifndef _KERNEL_CACHE_
#define _KERNEL_CACHE_

#include "memSpec.h"

//#define MAX_CACHE_SIZE 1073741824 // 128 Mb/8bytes maximale cache...
// #define MAX_CACHE_SIZE 2400 // 64 Mb 8bytes maximale cache...
// #define MAX_CACHE_SIZE 3535 // 128 Mb 8bytes maximale cache...
 #define MAX_CACHE_SIZE 5656 // 256 Mb 8bytes maximale cache...
// #define MAX_CACHE_SIZE 7500 // 512 Mb 8bytes maximale cache...
// #define MAX_CACHE_SIZE 10000 // 1024 Mb 8bytes maximale cache...

#define MAX(x,y) x<y? y:x                         
#define MIN(x,y) x<y? x:y                         


#ifndef NULL
#define NULL 0
#endif

/* simple one step history cache */
/* an extension is to use a hash table to
 * store as many elements of the kernel matrix as possible,
 * to avoid recomputations 
 */
typedef struct _cache
{
  int _i;
  int _j;
  int _m;
  double _value;
  double** _cache;
  int _size;
}cache;

cache* createCache(int steps);
void   destructCache(cache* c); 

void setCache(cache* c, const int i, const int j, const int m, const double value);
/* value cannot be negative */
double getCache(cache* c, const int i, const int j);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -