22 m_degree(0), m_win_len(0), m_inhomogene(false)
30 int32_t degree, int32_t win_len,
bool inhomogene)
32 m_degree(degree), m_win_len(2*win_len), m_inhomogene(inhomogene)
41 int32_t degree, int32_t win_len,
bool inhomogene)
42 :
CStringKernel<char>(10), m_degree(degree), m_win_len(2*win_len),
43 m_inhomogene(inhomogene)
78 for (int32_t i=0; i<
num_lhs; i++)
95 for (int32_t j=0; j<len; j++)
126 bool free_avec, free_bvec;
140 for (int32_t i = 0; i<alen-1; i+=2)
146 for (int32_t l=0; l<
m_win_len && i+l<alen-1; l+=2)
153 if ((a1!=a2 || a1==
'0' || a2==
'0') && (b1!=b2 || b1==
'0' || b2==
'0'))
155 else if (a1==a2 && b1==b2)
166 SG_ERROR(
"The impossible happened i=%d l=%d a1=%c "
167 "a2=%c b1=%c b2=%c min=%c maj=%c\n", i, l, a1,a2, b1,b2,
m_str_min[i+l],
m_str_maj[i+l]);
191 void CSNPStringKernel::init()
void obtain_base_strings()
virtual bool set_normalizer(CKernelNormalizer *normalizer)
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
virtual bool init(CFeatures *l, CFeatures *r)
virtual ~CSNPStringKernel()
virtual void register_params()
int32_t num_lhs
number of feature vectors on left hand side
virtual bool init_normalizer()
CFeatures * rhs
feature vectors to occur on right hand side
void add_vector(bool **param, index_t *length, const char *name, const char *description="")
all of classes and functions are contained in the shogun namespace
CFeatures * lhs
feature vectors to occur on left hand side
The class Features is the base class of all feature objects.
static void swap(T &a, T &b)
friend class CSqrtDiagKernelNormalizer
Template class StringKernel, is the base class of all String Kernels.
static int32_t pow(bool x, int32_t n)