32 SG_DEBUG(
"using custom distance of size %dx%d\n", cols,cols)
40 for (int32_t row=0; row<
num_rows; row++)
42 for (int32_t col=row; col<
num_cols; col++)
43 dmatrix[int64_t(row) * num_cols - int64_t(row)*(row+1)/2 + col]=d->
distance(row,col);
56 for (int32_t row=0; row<
num_rows; row++)
58 for (int32_t col=0; col<
num_cols; col++)
101 CDistance::init(l, r);
111 void CCustomDistance::cleanup_custom()
113 SG_DEBUG(
"cleanup up custom distance\n")
146 return dmatrix[r*
num_cols - r*(r+1)/2 + col];
151 return dmatrix[c*
num_cols - c*(c+1)/2 + row];
virtual float64_t compute(int32_t row, int32_t col)
Class Distance, a base class for all the distances used in the Shogun toolbox.
virtual int32_t get_num_vec_lhs()
virtual bool dummy_init(int32_t rows, int32_t cols)
virtual int32_t get_num_vectors() const =0
void add(bool *param, const char *name, const char *description="")
bool set_full_distance_matrix_from_full(const float64_t *dm, int32_t rows, int32_t cols)
virtual int32_t get_num_vec_rhs()
The class DummyFeatures implements features that only know the number of feature objects (but don't a...
virtual float64_t distance(int32_t idx_a, int32_t idx_b)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual ~CCustomDistance()
virtual bool init(CFeatures *l, CFeatures *r)
The Custom Distance allows for custom user provided distance matrices.
void add_matrix(bool **param, index_t *length_y, index_t *length_x, const char *name, const char *description="")