Features
Classes | Typedefs | Functions | Variables
fl.cpp File Reference
#include <fstream>
#include <iostream>
#include <vector>
#include <exception>
#include <cstdint>
Include dependency graph for fl.cpp:

Classes

class  combination_t
 
class  difference_expression_generator
 

Typedefs

using maxnat_t = uintmax_t
 
using combination_element_t = unsigned short int
 
using difference_expression_t = vector< bool >
 

Functions

maxnat_t power (maxnat_t base, maxnat_t exponent)
 
maxnat_t ceil_div (const maxnat_t &x, const maxnat_t &y)
 
difference_expression_t operator~ (difference_expression_t de)
 
difference_expression_toperator&= (difference_expression_t &left, const difference_expression_t &right)
 
difference_expression_toperator|= (difference_expression_t &left, const difference_expression_t &right)
 
ostream & operator<< (ostream &os, const difference_expression_t &de)
 
void print_independent_features (const difference_expression_generator &dg)
 
void print_independent_features_alt (const difference_expression_generator &dg)
 
void print_not_features (const difference_expression_generator &dg)
 
void print_and_features (const difference_expression_generator &dg)
 
void print_or_features (const difference_expression_generator &dg)
 
void print_and_not_features (const difference_expression_generator &dg)
 
void print_or_not_features (const difference_expression_generator &dg)
 
int main ()
 

Variables

constexpr bool checking { true }
 
const string prefix { "fl_" }
 

Detailed Description

fl in the program name is an acronym for Feature Location.

Author
Ulrich W. Eisenecker
Date
February 4, 2023
Warning
This program is a research prototype only. It comes with no warranty and no liability. Use it only at your own risk!

Typedef Documentation

◆ combination_element_t

using combination_element_t = unsigned short int

Type alias for the program specific name for the unsigned integer type that is used consistently for everything related to the combination_t class.

◆ difference_expression_t

using difference_expression_t = vector<bool>

Type alias for the program specific name for a difference expression to be used throughout the program.

◆ maxnat_t

using maxnat_t = uintmax_t

Type alias for the program specific name for the unsigned integer type to be used throughout the program.

Function Documentation

◆ ceil_div()

maxnat_t ceil_div ( const maxnat_t x,
const maxnat_t y 
)

Returns the result of integral division of x by y rounded to the nearest upper integer value. The following code was taken from https://stackoverflow.com/questions/2745074/fast-ceiling-of-an-integer-division-in-c-c , Answer 3

Parameters
xDividend.
yDivisor.
Returns
Result of integral division rounded to the nearest upper integer.
Here is the caller graph for this function:

◆ operator&=()

difference_expression_t& operator&= ( difference_expression_t left,
const difference_expression_t right 
)

Performs bitwise-and assignment for difference expressions.

Parameters
leftDifference expression passed as reference.
rightDifference expression passed as reference to const.
Returns
Difference expression left that has been bitwise-and-assigned with right as reference.

◆ operator<<()

ostream& operator<< ( ostream &  os,
const difference_expression_t de 
)

Stream insertion operator for difference expressions.

Parameters
osOutput stream passed as reference.
deDifference expression passed as reference to const.
Returns
Output stream as reference.

◆ operator|=()

difference_expression_t& operator|= ( difference_expression_t left,
const difference_expression_t right 
)

Performs bitwise-or assignment for difference expressions.

Parameters
leftDifference expression passed as reference.
rightDifference expression passed as reference to const.
Returns
Difference expression left that has been bitwise-or-assigned with right as reference.

◆ operator~()

Calculates and returns bitwise negation of difference expression.

Parameters
deDifference expression passed by value.
Returns
Negated difference expression as value.

◆ power()

maxnat_t power ( maxnat_t  base,
maxnat_t  exponent 
)

Calculates and returns the power of base and exponent.

Parameters
baseValue for the base of the power expression.
exponentValue for the exponent of the power expression.
Returns
Value of power.
Here is the caller graph for this function:

◆ print_and_features()

void print_and_features ( const difference_expression_generator dg)

Outputs difference expressions for and features to a file. This implementation creates and uses difference expressions.

Parameters
dgDifference generator to be used for generating difference expressions.
Here is the call graph for this function:

◆ print_and_not_features()

void print_and_not_features ( const difference_expression_generator dg)

Outputs difference expressions for and-not features to a file. This implementation creates and uses difference expressions.

Parameters
dgDifference generator to be used for generating difference expressions.
Here is the call graph for this function:

◆ print_independent_features()

void print_independent_features ( const difference_expression_generator dg)

Outputs difference expressions for independent features to a file. This implementation creates and uses difference expressions.

Parameters
dgDifference generator to be used for generating difference expressions.
Here is the call graph for this function:

◆ print_independent_features_alt()

void print_independent_features_alt ( const difference_expression_generator dg)

Outputs difference expressions for independent features to a file. This implementation does neither create nor uses difference expressions! Instead, the value that indicates if a system is to be intersected or to be united is calculated for each individual system. Therefore, this function has minimal memory requirements. In general, it is possible to provide corresponding implementations for all other following functions whose names begin with print_.

Parameters
dgDifference generator to be used for generating difference expressions.
Here is the call graph for this function:

◆ print_not_features()

void print_not_features ( const difference_expression_generator dg)

Outputs difference expressions for not features to a file. This implementation creates and uses difference expressions.

Parameters
dgDifference generator to be used for generating difference expressions.
Here is the call graph for this function:

◆ print_or_features()

void print_or_features ( const difference_expression_generator dg)

Outputs difference expressions for or features to a file. This implementation creates and uses difference expressions.

Parameters
dgDifference generator to be used for generating difference expressions.
Here is the call graph for this function:

◆ print_or_not_features()

void print_or_not_features ( const difference_expression_generator dg)

Outputs difference expressions for or-not features to a file. This implementation creates and uses difference expressions.

Parameters
dgDifference generator to be used for generating difference expressions.
Here is the call graph for this function:

Variable Documentation

◆ checking

constexpr bool checking { true }
constexpr

checking turns some checks for errors on or off. Initializing checking to true, turns on error checking. Initializing checking to false, turns off error checking. checking should always be tested wit hif constexpr. Only then, the code performing the actual check will not be included in the object code if checking is initialized to false.

◆ prefix

const string prefix { "fl_" }

This string constant defines the prefix that is used consistently for the names of all files that are produced by the program.