SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IndexFeatures.cpp
Go to the documentation of this file.
3 
4 using namespace shogun;
5 
7 {
8  init();
9 }
10 
12 {
13  init();
14  set_feature_index(feature_index);
15 }
16 
18 {
19 }
20 
22 {
24 }
25 
27 {
28  CIndexFeatures* indexfeature_dup =
30  if (m_subset_stack != NULL)
31  {
32  SG_UNREF(indexfeature_dup->m_subset_stack);
33  indexfeature_dup->m_subset_stack=new CSubsetStack(*m_subset_stack);
34  SG_REF(indexfeature_dup->m_subset_stack);
35  }
36  return indexfeature_dup;
37 }
38 
40 {
41  return F_ANY;
42 }
43 
45 {
46  return C_INDEX;
47 }
48 
50 {
52  return m_feature_index;
53 
54  SGVector<index_t> sub_feature_index(get_num_vectors());
55 
56  /* copy a subset vector wise */
57  for (int32_t i=0; i<sub_feature_index.vlen; ++i)
58  {
59  int32_t real_i = m_subset_stack->subset_idx_conversion(i);
60  sub_feature_index[i] = m_feature_index[real_i];
61  }
62 
63  return sub_feature_index;
64 }
65 
67 {
70  m_feature_index = feature_index;
71  num_vectors = feature_index.vlen;
72 }
73 
75 {
78  num_vectors = 0;
79 }
80 
81 void CIndexFeatures::init()
82 {
83  num_vectors = 0;
84  SG_ADD(&m_feature_index, "m_feature_index",
85  "Vector of feature index.", MS_NOT_AVAILABLE);
86 }

SHOGUN Machine Learning Toolbox - Documentation