13#ifndef SIMILARITY_TABLE_HPP
14#define SIMILARITY_TABLE_HPP
36 string SIMILARITY_TABLE_FILE_NAME =
"tmp/output_parsed.txt";
37 double DEFAULT_SIMILARITY = 100.00;
38 double EPS_ERROR_MARGIN = 1e-6;
39 double MAXIMUM_SIMILARITY = 100.00;
40 double MINIMUM_SIMILARITY = 0.00;
42 double similarity_threshold;
44 map<Path,int> path_id;
45 vector<vector<pair<int,double>>> similarity_graph;
46 map<pair<int,int>,
double> similarity_table;
53 int find_id_path(
Path path);
59 void read_comparation(ifstream &table_file);
65 void read_file_table(ifstream &table_file);
70 void init_similarity_table();
77 bool is_above_threshold(
double similarity);
84 vector<tuple<int,Path,Path>> sort_pairs_by_line_number(vector<pair<Path,Path>> similar_path_pairs);
Path manipulation class for tool-specific directory structure.
Manages and analyzes function similarity relationships.
vector< pair< Path, Path > > get_all_similar_path_pairs_sorted_by_line_number()
Gets all similar path pairs, sorted by line count.
void update_similarity(double new_similarity_threshold)
Updates similarity threshold.
vector< Path > get_path_list()
Gets list of all known paths.
vector< Path > get_similar_path_to_the_reference(Path reference)
Gets paths similar to reference path.
double is_similar(Path path1, Path path2)
Checks if two paths are similar.
vector< tuple< double, Path, Path > > get_all_path_pairs_and_similarity_sorted_by_similarity()
Gets all similar path pairs with scores, sorted.
Similarity_Table()
Constructs with default similarity threshold.
double get_similarity(Path path1, Path path2)
Gets similarity between two paths.
vector< pair< Path, Path > > get_all_similar_path_pairs_sorted_by_similarity()
Gets all similar path pairs, sorted by similarity.
Function abstraction for temporary codebase.
Path abstraction for temporary codebase.
Defines utility functions used across all files.