pktools 2.6.7
Processing Kernel for geospatial data
Public Member Functions | List of all members
SVR_Q Class Reference
Inheritance diagram for SVR_Q:
Inheritance graph
[legend]
Collaboration diagram for SVR_Q:
Collaboration graph
[legend]

Public Member Functions

 SVR_Q (const svm_problem &prob, const svm_parameter &param)
 
void swap_index (int i, int j) const
 
Qfloat * get_Q (int i, int len) const
 
double * get_QD () const
 
- Public Member Functions inherited from Kernel
 Kernel (int l, svm_node *const *x, const svm_parameter &param)
 
virtual Qfloat * get_Q (int column, int len) const =0
 
virtual double * get_QD () const =0
 
virtual void swap_index (int i, int j) const
 
virtual Qfloat * get_Q (int column, int len) const =0
 
virtual double * get_QD () const =0
 
virtual void swap_index (int i, int j) const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from Kernel
static double k_function (const svm_node *x, const svm_node *y, const svm_parameter &param)
 
- Protected Attributes inherited from Kernel
double(Kernel::* kernel_function )(int i, int j) const
 

Detailed Description

Definition at line 1369 of file svm.cpp.

Constructor & Destructor Documentation

◆ SVR_Q()

SVR_Q::SVR_Q ( const svm_problem prob,
const svm_parameter param 
)
inline

Definition at line 1372 of file svm.cpp.

1373 :Kernel(prob.l, prob.x, param)
1374 {
1375 l = prob.l;
1376 cache = new Cache(l,(long int)(param.cache_size*(1<<20)));
1377 QD = new double[2*l];
1378 sign = new schar[2*l];
1379 index = new int[2*l];
1380 for(int k=0;k<l;k++)
1381 {
1382 sign[k] = 1;
1383 sign[k+l] = -1;
1384 index[k] = k;
1385 index[k+l] = k;
1386 QD[k] = (this->*kernel_function)(k,k);
1387 QD[k+l] = QD[k];
1388 }
1389 buffer[0] = new Qfloat[2*l];
1390 buffer[1] = new Qfloat[2*l];
1391 next_buffer = 0;
1392 }
Definition: svm.cpp:70
Definition: svm.cpp:204

◆ ~SVR_Q()

SVR_Q::~SVR_Q ( )
inline

Definition at line 1425 of file svm.cpp.

1426 {
1427 delete cache;
1428 delete[] sign;
1429 delete[] index;
1430 delete[] buffer[0];
1431 delete[] buffer[1];
1432 delete[] QD;
1433 }

Member Function Documentation

◆ get_Q()

Qfloat * SVR_Q::get_Q ( int  i,
int  len 
) const
inlinevirtual

Implements Kernel.

Definition at line 1401 of file svm.cpp.

1402 {
1403 Qfloat *data;
1404 int j, real_i = index[i];
1405 if(cache->get_data(real_i,&data,l) < l)
1406 {
1407 for(j=0;j<l;j++)
1408 data[j] = (Qfloat)(this->*kernel_function)(real_i,j);
1409 }
1410
1411 // reorder and copy
1412 Qfloat *buf = buffer[next_buffer];
1413 next_buffer = 1 - next_buffer;
1414 schar si = sign[i];
1415 for(j=0;j<len;j++)
1416 buf[j] = (Qfloat) si * (Qfloat) sign[j] * data[index[j]];
1417 return buf;
1418 }

◆ get_QD()

double * SVR_Q::get_QD ( ) const
inlinevirtual

Implements Kernel.

Definition at line 1420 of file svm.cpp.

1421 {
1422 return QD;
1423 }

◆ swap_index()

void SVR_Q::swap_index ( int  i,
int  j 
) const
inlinevirtual

Reimplemented from Kernel.

Definition at line 1394 of file svm.cpp.

1395 {
1396 swap(sign[i],sign[j]);
1397 swap(index[i],index[j]);
1398 swap(QD[i],QD[j]);
1399 }

The documentation for this class was generated from the following file: