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

Public Member Functions

 ONE_CLASS_Q (const svm_problem &prob, const svm_parameter &param)
 
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 1323 of file svm.cpp.

Constructor & Destructor Documentation

◆ ONE_CLASS_Q()

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

Definition at line 1326 of file svm.cpp.

1327 :Kernel(prob.l, prob.x, param)
1328 {
1329 cache = new Cache(prob.l,(long int)(param.cache_size*(1<<20)));
1330 QD = new double[prob.l];
1331 for(int i=0;i<prob.l;i++)
1332 QD[i] = (this->*kernel_function)(i,i);
1333 }
Definition: svm.cpp:70
Definition: svm.cpp:204

◆ ~ONE_CLASS_Q()

ONE_CLASS_Q::~ONE_CLASS_Q ( )
inline

Definition at line 1359 of file svm.cpp.

1360 {
1361 delete cache;
1362 delete[] QD;
1363 }

Member Function Documentation

◆ get_Q()

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

Implements Kernel.

Definition at line 1335 of file svm.cpp.

1336 {
1337 Qfloat *data;
1338 int start, j;
1339 if((start = cache->get_data(i,&data,len)) < len)
1340 {
1341 for(j=start;j<len;j++)
1342 data[j] = (Qfloat)(this->*kernel_function)(i,j);
1343 }
1344 return data;
1345 }

◆ get_QD()

double * ONE_CLASS_Q::get_QD ( ) const
inlinevirtual

Implements Kernel.

Definition at line 1347 of file svm.cpp.

1348 {
1349 return QD;
1350 }

◆ swap_index()

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

Reimplemented from Kernel.

Definition at line 1352 of file svm.cpp.

1353 {
1354 cache->swap_index(i,j);
1355 Kernel::swap_index(i,j);
1356 swap(QD[i],QD[j]);
1357 }

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