16 using namespace shogun;
28 num_dimensions(orig.num_dimensions)
109 result += f1->
dot(vec_idx1, f2,vec_idx2) *
116 f2=cf->get_next_feature_obj(current2);
120 ASSERT(f1 == NULL && f2 == NULL);
156 int32_t num=stop-start;
170 for (int32_t i=0; i<num; i++)
204 for (int32_t i=0; i<num; i++)
234 combined_feature_iterator* it=
SG_MALLOC(combined_feature_iterator, 1);
238 it->iterator=it->f->get_feature_iterator(vector_index);
239 it->vector_index=vector_index;
246 combined_feature_iterator* it = (combined_feature_iterator*) iterator;
250 if (it->f->get_next_feature(index, value, it->iterator))
256 it->f->free_feature_iterator(it->iterator);
259 it->iterator=it->f->get_feature_iterator(it->vector_index);
270 combined_feature_iterator* it = (combined_feature_iterator*) iterator;
271 if (it->iterator && it->f)
272 it->f->free_feature_iterator(it->iterator);
392 void CCombinedDotFeatures::init()
395 "Total number of dimensions.");
397 "Total number of vectors.");
399 "feature_list",
"Feature list.");
virtual void dense_dot_range(float64_t *output, int32_t start, int32_t stop, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
virtual int32_t get_nnz_features_for_vector(int32_t num)=0
CDotFeatures * get_first_feature_obj()
CSGObject * get_next_element()
int32_t num_vectors
total number of vectors
CDotFeatures * get_next_feature_obj()
virtual EFeatureType get_feature_type()=0
virtual void dense_dot_range(float64_t *output, int32_t start, int32_t stop, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)=0
virtual ~CCombinedDotFeatures()
void update_dim_feature_space_and_num_vec()
bool insert_feature_obj(CDotFeatures *obj)
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)=0
virtual int32_t get_num_vectors() const =0
virtual void dense_dot_range_subset(int32_t *sub_index, int32_t num, float64_t *output, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)=0
bool delete_feature_obj()
virtual CFeatures * duplicate() const
Features that support dot products among other operations.
CSGObject * delete_element()
bool append_feature_obj(CDotFeatures *obj)
virtual EFeatureClass get_feature_class()
virtual int32_t get_dim_feature_space() const =0
void add(bool *param, const char *name, const char *description="")
CSGObject * get_first_element()
Class SGObject is the base class of all shogun objects.
virtual EFeatureClass get_feature_class()=0
int32_t get_num_feature_obj()
virtual void dense_dot_range_subset(int32_t *sub_index, int32_t num, float64_t *output, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
int32_t get_num_elements()
virtual int32_t get_nnz_features_for_vector(int32_t num)
virtual void get_subfeature_weights(float64_t **weights, int32_t *num_weights)
virtual void set_subfeature_weights(float64_t *weights, int32_t num_weights)
virtual EFeatureType get_feature_type()
Class ListElement, defines how an element of the the list looks like.
The class Features is the base class of all feature objects.
bool append_element(CSGObject *data)
Features that allow stacking of a number of DotFeatures.
virtual void free_feature_iterator(void *iterator)
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
CSGObject * get_last_element()
void set_combined_feature_weight(float64_t nw)
virtual void * get_feature_iterator(int32_t vector_index)
int32_t num_dimensions
total number of dimensions
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
CDotFeatures * get_last_feature_obj()
#define SG_MALLOC(type, len)
float64_t get_combined_feature_weight()
Class List implements a doubly connected list for low-level-objects.
bool insert_element(CSGObject *data)