53 template<
typename FV,
typename KF>
58 :
Kernel( kernel, prob.l, prob.x)
61 cache =
new Cache(l,(
int)(param.cache_size*(1<<20)));
62 sign =
new schar[2*l];
71 buffer[0] =
new Qfloat[2*l];
72 buffer[1] =
new Qfloat[2*l];
78 swap(sign[i],sign[j]);
79 swap(index[i],index[j]);
85 int real_i = index[i];
86 if(cache->
get_data(real_i,&data,l) < l)
93 Qfloat *buf = buffer[next_buffer];
94 next_buffer = 1 - next_buffer;
96 for(
int j=0;j<len;j++)
97 buf[j] = si * sign[j] * data[index[j]];
114 mutable int next_buffer;
void swap_index(int i, int j) const
long get_data(const long index, Qfloat **data, long len)
SVR_Q(const KF &kernel, const SVM_Problem< FV, KF > &prob)
Qfloat * get_Q(int i, int len) const
double kernel_function(int i, int j) const