Features
Classes | Typedefs | Functions | Variables
features Namespace Reference

Classes

struct  systems_difference_t
 
struct  system_feature_difference_t
 
class  combination_t
 
class  feature_location_t
 
class  feature_location_isolation_t
 
class  feature_location_differences_t
 
class  feature_location_calculation_t
 

Typedefs

using feature_id_t = unsigned short int
 
using model_id_t = unsigned short int
 
using maxnat_t = uintmax_t
 
using feature_expression_t = std::vector< std::pair< std::string, maxnat_t > >
 
using expression_feature_t = std::map< maxnat_t, std::string >
 
using feature_names_t = std::vector< std::string >
 
using system_t = feature_names_t
 
using systems_t = std::vector< system_t >
 
using features_isolation_t = std::map< std::string, systems_difference_t >
 
using differences_t = std::vector< system_feature_difference_t >
 

Functions

maxnat_t product (maxnat_t from, maxnat_t to)
 
maxnat_t factorial (maxnat_t n)
 
maxnat_t combinations (maxnat_t n, maxnat_t k)
 
maxnat_t sum_of_combinations (maxnat_t n, maxnat_t k)
 
maxnat_t power (maxnat_t base, maxnat_t exponent)
 
maxnat_t power2 (maxnat_t exponent)
 
template<class T >
std::vector< T > & concat (std::vector< T > &destination, const std::vector< T > &v)
 
template<class T >
bool contains (const std::vector< T > &v, const T &e)
 
std::vector< feature_id_tnegate (const std::vector< feature_id_t > &v, feature_id_t n)
 
bool hasO (model_id_t M)
 
bool hasA (model_id_t M)
 
bool hasN (model_id_t M)
 
bool hasON (model_id_t M)
 
bool hasAN (model_id_t M)
 
std::string independent_feature_name (feature_id_t i)
 
std::string or_feature_name (const std::vector< feature_id_t > &ids)
 
std::string and_feature_name (const std::vector< feature_id_t > &ids)
 
std::string not_feature_name (feature_id_t i)
 
std::string or_not_feature_name (const std::vector< feature_id_t > &ids)
 
std::string and_not_feature_name (const std::vector< feature_id_t > &ids)
 
std::string system_name (feature_id_t n)
 
std::string difference_name (feature_id_t n)
 
maxnat_t or_feature_value (const std::vector< feature_id_t > &ids, const feature_expression_t &idf)
 
maxnat_t and_feature_value (const std::vector< feature_id_t > &ids, const feature_expression_t &idf)
 
maxnat_t or_not_feature_value (const std::vector< feature_id_t > &ids, const feature_expression_t &nf)
 
maxnat_t and_not_feature_value (const std::vector< feature_id_t > &ids, const feature_expression_t &nf, const maxnat_t &bitmask)
 
std::vector< feature_id_tunsigned2vector (maxnat_t u)
 

Variables

const std::string set_begin { "{" }
 
const std::string set_end { "}" }
 
const std::string set_intersection { "&" }
 
const std::string set_difference { "\\" }
 
const std::string set_union { "|" }
 
const std::string set_separator { " " }
 
const std::string set_comma { "," }
 
const std::string feature_and { "*" }
 
const std::string feature_or { "+" }
 
const std::string feature_not { "!" }
 
const std::string feature { "f" }
 
const std::string feature_separator { " " }
 
const std::string system { "S" }
 
const std::string difference_expression { "E" }
 
const std::string separator { "\t" }
 
const std::string opening_parenthesis { "(" }
 
const std::string closing_parenthesis { ")" }
 

Detailed Description

This namespace contains all types and functions that are related to feature location.

Typedef Documentation

◆ expression_feature_t

using features::expression_feature_t = typedef std::map<maxnat_t,std::string>

Type alias for mapping a set difference ID to a feature name.

◆ feature_expression_t

using features::feature_expression_t = typedef std::vector<std::pair<std::string,maxnat_t> >

Type alias for collection of feature names and associated set difference IDs.

◆ feature_id_t

using features::feature_id_t = typedef unsigned short int

Type alias for a feature ID.

◆ feature_names_t

using features::feature_names_t = typedef std::vector<std::string>

Type alias for a collection of feature names.

◆ maxnat_t

using features::maxnat_t = typedef uintmax_t

Type alias for largest natural number type.

◆ model_id_t

using features::model_id_t = typedef unsigned short int

Type alias for a model ID.

◆ system_t

Type alias for the feature names that define a system.

◆ systems_t

using features::systems_t = typedef std::vector<system_t>

Type alias for a collection of systems that are defined by their feature names.

Function Documentation

◆ and_feature_name()

std::string features::and_feature_name ( const std::vector< feature_id_t > &  ids)

Returns name for and-feature of feature ids.

Here is the caller graph for this function:

◆ and_feature_value()

maxnat_t features::and_feature_value ( const std::vector< feature_id_t > &  ids,
const feature_expression_t idf 
)

Returns value of and-feature for ids and feature expression idf.

Here is the caller graph for this function:

◆ and_not_feature_name()

std::string features::and_not_feature_name ( const std::vector< feature_id_t > &  ids)

Returns name for and-not-feature of feature ids.

Here is the caller graph for this function:

◆ and_not_feature_value()

maxnat_t features::and_not_feature_value ( const std::vector< feature_id_t > &  ids,
const feature_expression_t nf,
const maxnat_t bitmask 
)

Returns value of and-not-feature for ids and feature expression nf.

Here is the caller graph for this function:

◆ combinations()

maxnat_t features::combinations ( maxnat_t  n,
maxnat_t  k 
)

Returns number of combinations of n items and sample size k.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ concat()

template<class T >
std::vector<T>& features::concat ( std::vector< T > &  destination,
const std::vector< T > &  v 
)

Function template that returns vector destination after appending vector v.

Here is the caller graph for this function:

◆ contains()

template<class T >
bool features::contains ( const std::vector< T > &  v,
const T &  e 
)

Function template that returns true if vector v contains element e, and false otherwise.

Here is the caller graph for this function:

◆ difference_name()

std::string features::difference_name ( feature_id_t  n)

Returns name for system set difference expression with id n.

Here is the caller graph for this function:

◆ factorial()

maxnat_t features::factorial ( maxnat_t  n)

Returns factorial of n.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasA()

bool features::hasA ( model_id_t  M)

Returns true if model M has and-features and false otherwise.

Here is the caller graph for this function:

◆ hasAN()

bool features::hasAN ( model_id_t  M)

Returns true if model M has and-not-features and false otherwise.

Here is the caller graph for this function:

◆ hasN()

bool features::hasN ( model_id_t  M)

Returns true if model M has not-features and false otherwise.

Here is the caller graph for this function:

◆ hasO()

bool features::hasO ( model_id_t  M)

Returns true if model M has or-features and false otherwise.

Here is the caller graph for this function:

◆ hasON()

bool features::hasON ( model_id_t  M)

Returns true if model M has or-not-features and false otherwise.

Here is the caller graph for this function:

◆ independent_feature_name()

std::string features::independent_feature_name ( feature_id_t  i)

Returns name for independent feature with id i.

Here is the caller graph for this function:

◆ negate()

std::vector<feature_id_t> features::negate ( const std::vector< feature_id_t > &  v,
feature_id_t  n 
)

Function template that returns a vector that results from negating vector v with respect to the range [1,n]. For example: { 1 }, 3 --> { 2, 3 }

Here is the call graph for this function:
Here is the caller graph for this function:

◆ not_feature_name()

std::string features::not_feature_name ( feature_id_t  i)

Returns name for not-feature with id i.

Here is the caller graph for this function:

◆ or_feature_name()

std::string features::or_feature_name ( const std::vector< feature_id_t > &  ids)

Returns name for or-feature of feature ids.

Here is the caller graph for this function:

◆ or_feature_value()

maxnat_t features::or_feature_value ( const std::vector< feature_id_t > &  ids,
const feature_expression_t idf 
)

Returns value of or-feature for ids and feature expression idf.

Here is the caller graph for this function:

◆ or_not_feature_name()

std::string features::or_not_feature_name ( const std::vector< feature_id_t > &  ids)

Returns name for or-not-feature of feature ids.

Here is the caller graph for this function:

◆ or_not_feature_value()

maxnat_t features::or_not_feature_value ( const std::vector< feature_id_t > &  ids,
const feature_expression_t nf 
)

Returns value of or-not-feature for ids and feature expression nf.

Here is the caller graph for this function:

◆ power()

maxnat_t features::power ( maxnat_t  base,
maxnat_t  exponent 
)

Returns base to the power of exponent.

Here is the caller graph for this function:

◆ power2()

maxnat_t features::power2 ( maxnat_t  exponent)

Returns 2 to the power of exponent.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ product()

maxnat_t features::product ( maxnat_t  from,
maxnat_t  to 
)

Returns product of numbers in the range [from,to].

Here is the caller graph for this function:

◆ sum_of_combinations()

maxnat_t features::sum_of_combinations ( maxnat_t  n,
maxnat_t  k 
)

Returns sum of combinations of n items in the sample range [k,n].

Here is the call graph for this function:

◆ system_name()

std::string features::system_name ( feature_id_t  n)

Returns name for system with id n.

Here is the caller graph for this function:

◆ unsigned2vector()

std::vector<feature_id_t> features::unsigned2vector ( maxnat_t  u)

Returns vector that corresponds to the bit pattern of u.

Here is the caller graph for this function: