KSquare Utilities
SVM233::SVC_Q Class Reference
+ Inheritance diagram for SVM233::SVC_Q:

Public Member Functions

 SVC_Q (const svm_problem &prob, const svm_parameter &param, const schar *y_)
 
 ~SVC_Q ()
 
Qfloat * get_Q (kkint32 i, kkint32 len) const
 
void swap_index (kkint32 i, kkint32 j) const
 
- Public Member Functions inherited from SVM233::Kernel
 Kernel (kkint32 l, svm_node *const *x, const svm_parameter &param)
 
virtual ~Kernel ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 2650 of file svm.cpp.

Constructor & Destructor Documentation

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

Definition at line 2653 of file svm.cpp.

References SVM233::Cache::Cache(), SVM233::svm_parameter::cache_size, SVM233::Kernel::Kernel(), SVM233::svm_problem::l, and SVM233::svm_problem::x.

Referenced by SVM233::solve_c_svc(), and SVM233::solve_nu_svc().

2657  :Kernel (prob.l, prob.x, param)
2658  {
2659  clone(y,y_,prob.l);
2660  cache = new Cache(prob.l,(kkint32)(param.cache_size*(1<<20)));
2661  }
__int32 kkint32
Definition: KKBaseTypes.h:88
Kernel(kkint32 l, svm_node *const *x, const svm_parameter &param)
Definition: svm.cpp:1609
kkint32 l
Definition: svm.h:48
double cache_size
Definition: svm.h:85
struct svm_node ** x
Definition: svm.h:52
void clone(T *&dst, S *src, kkint32 n)
Definition: svm.cpp:690
SVM233::SVC_Q::~SVC_Q ( )
inline

Definition at line 2683 of file svm.cpp.

2684  {
2685  delete[] y;
2686  delete cache;
2687  }

Member Function Documentation

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

Implements SVM233::Kernel.

Definition at line 2663 of file svm.cpp.

References SVM233::Cache::get_data(), and SVM233::Kernel::kernel_function.

2664  {
2665  Qfloat *data;
2666  kkint32 start;
2667  if ((start = cache->get_data (i, &data, len)) < len)
2668  {
2669  for (kkint32 j = start; j < len; j++)
2670  data[j] = (Qfloat)(y[i] * y[j] * (this->*kernel_function)(i,j));
2671  //luo add data[j] = (Qfloat)(w[i]*w[j]*y[i]*y[j]*(this->*kernel_function)(i,j));
2672  }
2673  return data;
2674  }
__int32 kkint32
Definition: KKBaseTypes.h:88
double(Kernel::* kernel_function)(kkint32 i, kkint32 j) const
Definition: svm.cpp:1555
kkint32 get_data(const kkint32 index, Qfloat **data, kkint32 len)
Definition: svm.cpp:1445
float Qfloat
Definition: svm2.h:287
void SVM233::SVC_Q::swap_index ( kkint32  i,
kkint32  j 
) const
inlinevirtual

Reimplemented from SVM233::Kernel.

Definition at line 2676 of file svm.cpp.

References SVM233::Cache::swap_index(), and SVM233::Kernel::swap_index().

2677  {
2678  cache->swap_index(i,j);
2679  Kernel::swap_index(i,j);
2680  Swap(y[i],y[j]);
2681  }
void Swap(T &x, T &y)
Definition: svm.cpp:687
virtual void swap_index(kkint32 i, kkint32 j) const
Definition: svm.cpp:1547
void swap_index(kkint32 i, kkint32 j)
Definition: svm.cpp:1483

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