13#ifndef SIMILARITY_TABLE_HPP
14#define SIMILARITY_TABLE_HPP
16#include <bits/stdc++.h>
31 string SIMILARITY_TABLE_FILE_NAME =
"tmp/output_parsed.txt";
32 double DEFAULT_SIMILARITY = 100.00;
33 double EPS_ERROR_MARGIN = 1e-6;
34 double MAXIMUM_SIMILARITY = 100.00;
35 double MINIMUM_SIMILARITY = 0.00;
37 double similarity_threshold;
39 map<Path,int> path_id;
40 vector<vector<pair<int,double>>> similarity_graph;
41 map<pair<int,int>,
double> similarity_table;
48 int find_id_path(
Path path);
54 void read_comparation(ifstream &table_file);
60 void read_file_table(ifstream &table_file);
65 void init_similarity_table();
72 bool is_above_threshold(
double similarity);
79 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.
vector< pair< Path, Path > > get_all_similar_path_pairs_sorted_by_line_number()
Gets all similar path pairs, sorted by line count.
Similarity_Table(double _similarity_threshold)
Constructs with custom similarity threshold.
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.