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

Public Member Functions

 SVC_Q (const svm_problem &prob, const svm_parameter &param, const schar *y_)
 
Qfloat * get_Q (int i, int len) const
 
double * get_QD () const
 
void swap_index (int i, int j) 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 1273 of file svm.cpp.

Constructor & Destructor Documentation

◆ SVC_Q()

SVC_Q::SVC_Q ( const svm_problem prob,
const svm_parameter param,
const schar *  y_ 
)
inline

Definition at line 1276 of file svm.cpp.

1277 :Kernel(prob.l, prob.x, param)
1278 {
1279 clone(y,y_,prob.l);
1280 cache = new Cache(prob.l,(long int)(param.cache_size*(1<<20)));
1281 QD = new double[prob.l];
1282 for(int i=0;i<prob.l;i++)
1283 QD[i] = (this->*kernel_function)(i,i);
1284 }
Definition: svm.cpp:70
Definition: svm.cpp:204

◆ ~SVC_Q()

SVC_Q::~SVC_Q ( )
inline

Definition at line 1311 of file svm.cpp.

1312 {
1313 delete[] y;
1314 delete cache;
1315 delete[] QD;
1316 }

Member Function Documentation

◆ get_Q()

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

Implements Kernel.

Definition at line 1286 of file svm.cpp.

1287 {
1288 Qfloat *data;
1289 int start, j;
1290 if((start = cache->get_data(i,&data,len)) < len)
1291 {
1292 for(j=start;j<len;j++)
1293 data[j] = (Qfloat)(y[i]*y[j]*(this->*kernel_function)(i,j));
1294 }
1295 return data;
1296 }

◆ get_QD()

double * SVC_Q::get_QD ( ) const
inlinevirtual

Implements Kernel.

Definition at line 1298 of file svm.cpp.

1299 {
1300 return QD;
1301 }

◆ swap_index()

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

Reimplemented from Kernel.

Definition at line 1303 of file svm.cpp.

1304 {
1305 cache->swap_index(i,j);
1306 Kernel::swap_index(i,j);
1307 swap(y[i],y[j]);
1308 swap(QD[i],QD[j]);
1309 }

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