90 return m_fea->get_feature_type();
100 return m_fea->get_dim_feature_space();
110 REQUIRE(m_fea,
"Please set the features first\n");
111 int32_t total_vlen=m_fea->get_num_vectors();
112 for (int32_t i=0; i<idx.
vlen; i++)
114 int32_t index=idx[i];
115 REQUIRE(index>=0 && index<total_vlen,
116 "The index (%d) in the vector idx is not valid since there are %d samples\n",
125 check_bound(vec_idx1);
132 df_f->check_bound(vec_idx2);
133 res=m_fea->dot(m_idx[vec_idx1], df_f->m_fea, df_f->m_idx[vec_idx2]);
136 res=m_fea->dot(m_idx[vec_idx1], df, vec_idx2);
141 int32_t vec_idx1,
const float64_t* vec2, int32_t vec2_len)
143 check_bound(vec_idx1);
144 return m_fea->dense_dot(m_idx[vec_idx1], vec2, vec2_len);
149 REQUIRE(index<m_idx.vlen && index>=0,
150 "Index (%d) is out of bound (%d)\n", index, m_idx.
vlen);
156 check_bound(vec_idx1);
157 m_fea->add_to_dense_vec(alpha, m_idx[vec_idx1], vec2, vec2_len, abs_val);
163 return m_fea->get_nnz_features_for_vector(num);
167 int32_t vector_index)
174 int32_t& index,
float64_t& value,
void* iterator)
void set_subset_idx(SGVector< int32_t > idx)
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual ~CDenseSubSamplesFeatures()
virtual int32_t get_dim_feature_space() const
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
virtual bool get_feature_class_compatibility(EFeatureClass rhs) const
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
virtual CFeatures * duplicate() const
#define SG_NOTIMPLEMENTED
Features that support dot products among other operations.
virtual int32_t get_num_vectors() const
EFeatureClass
shogun feature class
void set_features(CDenseFeatures< ST > *fea)
Class SGObject is the base class of all shogun objects.
virtual EFeatureClass get_feature_class() const
CDenseSubSamplesFeatures()
virtual void * get_feature_iterator(int32_t vector_index)
EFeatureType
shogun feature type
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
The class DenseFeatures implements dense feature matrices.
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual void free_feature_iterator(void *iterator)
virtual EFeatureType get_feature_type() const
virtual int32_t get_nnz_features_for_vector(int32_t num)