Vowpal Wabbit
Classes | Typedefs | Functions
feature_group.h File Reference
#include <memory>
#include <string>
#include <cstddef>
#include "v_array.h"
#include <sys/types.h>

Go to the source code of this file.

Classes

struct  feature
 
struct  feature_slice
 
class  features_value_iterator
 iterator over feature values only More...
 
class  features_value_index_iterator
 iterator over values and indicies More...
 
class  features_value_index_audit_iterator
 iterator over values, indicies and audit space names More...
 
struct  features
 the core definition of a set of features. More...
 
class  features::features_value_index_audit_range
 defines a "range" usable by C++ 11 for loops More...
 

Typedefs

typedef float feature_value
 
typedef uint64_t feature_index
 
typedef std::pair< std::string, std::string > audit_strings
 
typedef std::shared_ptr< audit_stringsaudit_strings_ptr
 

Functions

template<class T >
int order_features (const void *first, const void *second)
 

Typedef Documentation

◆ audit_strings

typedef std::pair<std::string, std::string> audit_strings

Definition at line 22 of file feature_group.h.

◆ audit_strings_ptr

typedef std::shared_ptr<audit_strings> audit_strings_ptr

Definition at line 23 of file feature_group.h.

◆ feature_index

typedef uint64_t feature_index

Definition at line 21 of file feature_group.h.

◆ feature_value

typedef float feature_value

Definition at line 20 of file feature_group.h.

Function Documentation

◆ order_features()

template<class T >
int order_features ( const void *  first,
const void *  second 
)
inline

Definition at line 41 of file feature_group.h.

References feature::weight_index, and feature::x.

42 {
43  if (((T*)first)->weight_index != ((T*)second)->weight_index)
44  return (int)(((T*)first)->weight_index - ((T*)second)->weight_index);
45  else if (((T*)first)->x > ((T*)second)->x)
46  return 1;
47  else
48  return -1;
49 }