32 void CDistanceMachine::init()
52 #pragma omp parallel shared(num_threads, step) 57 num_threads=omp_get_num_threads();
58 num_vec=idx_a2-idx_a1+1;
59 step=num_vec/num_threads;
61 int32_t thread_num=omp_get_thread_num();
63 index_t idx_r_start = thread_num * step;
64 index_t idx_start = (thread_num * step) + idx_a1;
65 index_t idx_stop = (thread_num==(num_threads - 1)) ? (idx_a2 + 1) : ((thread_num + 1) * step) + idx_a1;
84 #pragma omp parallel shared(num_threads, step) 89 num_threads=omp_get_num_threads();
90 num_vec=idx_b2-idx_b1+1;
91 step=num_vec/num_threads;
93 int32_t thread_num=omp_get_thread_num();
95 index_t idx_r_start = thread_num * step;
96 index_t idx_start = (thread_num * step) + idx_b1;
97 index_t idx_stop = (thread_num==(num_threads - 1)) ? (idx_b2 + 1) : ((thread_num + 1) * step) + idx_b1;
148 for (
index_t i=1; i<num_clusters; ++i)
176 SG_ERROR(
"store_model_features not yet implemented for %s!\n",
Class Distance, a base class for all the distances used in the Shogun toolbox.
virtual void store_model_features()
virtual ~CDistanceMachine()
virtual CMulticlassLabels * apply_multiclass(CFeatures *data=NULL)
void distances_rhs(SGVector< float64_t > &result, int32_t idx_b1, int32_t idx_b2, int32_t idx_a)
virtual int32_t get_num_vectors() const =0
void run_distance_rhs(SGVector< float64_t > &result, const index_t idx_r_start, index_t idx_start, const index_t idx_stop, const index_t idx_a)
A generic learning machine interface.
bool set_label(int32_t idx, float64_t label)
Multiclass Labels for multi-class classification.
virtual const char * get_name() const
void add(bool *param, const char *name, const char *description="")
virtual void set_store_model_features(bool store_model)
Class SGObject is the base class of all shogun objects.
void distances_lhs(SGVector< float64_t > &result, int32_t idx_a1, int32_t idx_a2, int32_t idx_b)
void run_distance_lhs(SGVector< float64_t > &result, const index_t idx_r_start, index_t idx_start, const index_t idx_stop, const index_t idx_b)
virtual float64_t apply_one(int32_t num)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
void set_distance(CDistance *d)
CDistance * get_distance() const
virtual bool init(CFeatures *lhs, CFeatures *rhs)