Commit 61a4cd37 authored by Camvinel's avatar Camvinel
Browse files

last commit

parent 92d55a7e
......@@ -368,7 +368,7 @@ static uint backtrackingDataflow(std::map<sptrBipartite, bool>* graph_nodes1,std
/* Returns true if there is a path from source 's' to sink
't' in residual graph. Also fills parent[] to store the
path */
bool beadth_first_search(boost::multi_array<int, 2> rGraph, int s, int t, int parent[])
bool beadth_first_search(int *rGraph[], int s, int t, int parent[])
{
// Create a visited array and mark all vertices as not
// visited
......@@ -450,8 +450,10 @@ static int ford_fulkersonDataFlow(std::map<sptrBipartite, uint> graph_index1,std
}
// Ford Fulkerson algorithm, with BFS
boost::multi_array <int, 2>::extent_gen extents;
boost::multi_array <int, 2> rGraph(extents[index + 1][index + 1]);
int *rGraph[index + 1];
for(int i = 0; i < index + 1; i++){
rGraph[i] = new int[index + 1];
}
// Create a residual graph and fill the residual graph with given capacities in the original graph as residual capacities in residual graph
// Residual graph where rGraph[i][j] indicates residual capacity of edge from i to j (if there is an edge. If rGraph[i][j] is 0, then there is not)
for (uint u = 0; u < index + 1; u++){
......@@ -510,7 +512,6 @@ static std::unordered_set<sptrBipartite> getMatchesOfDF(sptrBipartite DF_graph,
float Site::computeDataflowSimilarity(const std::shared_ptr<Site> site2, std::shared_ptr<spdlog::logger> log, const std::string similarity_method) const{
SPDLOG_LOGGER_TRACE(log, "computeDataflowSimilarity with {}", similarity_method);
float score=0;
if (similarity_method == "ford-fulkerson"){
std::unordered_set<sptrBipartite> matches;
std::map<sptrBipartite, std::unordered_set<sptrBipartite>> graph_matches; // key: site1's DF, value: this DF's matches in site2
......
......@@ -8,7 +8,6 @@
#include <limits.h>
#include <queue>
#include <string.h>
#include "boost/multi_array.hpp"
namespace boa{
......@@ -55,7 +54,7 @@ public:
std::vector<sptrBipartite> getSiteDataflow() const;
bool isDataflowEqual(std::shared_ptr<Site> site2, std::shared_ptr<spdlog::logger> log) const;
bool isDataflowEqualV2( std::shared_ptr<Site> site2) const;
bool beadth_first_search(boost::multi_array<int, 2> rGraph, int s, int t, int parent[]);
bool beadth_first_search(int *rGraph[], int s, int t, int parent[]);
float computeDataflowSimilarity(const std::shared_ptr<Site> site2, std::shared_ptr<spdlog::logger> log, const std::string similarity_method) const;
......
......@@ -624,7 +624,7 @@ Config::Config(int argc, char* argv[])
throw std::runtime_error("No mode is selected. Please select one.");
}
std::unordered_set<std::string> authorized_site_sim_methods ({"backtracking", "sum", "ford-fulkerson", "sum_general_reg"});
if(authorized_site_sim_methods.find(m_config_global.site_sim_method)==0){
if(authorized_site_sim_methods.count(m_config_global.site_sim_method)==0){
throw std::runtime_error("Please select a valid site similarity computation method: backtracking, sum, sum_general_reg, or ford-fulkerson");
}
if(!std::filesystem::exists(std::filesystem::path(m_config_global.log_output).parent_path())){
......
......@@ -238,7 +238,6 @@ void handleResultsLearn(Config *config, std::shared_ptr<AnalysisEngine> analysis
}
void handleResultsCorrelation(Config *config, std::shared_ptr<ClassificationEngine> classification_engine,std::shared_ptr<spdlog::logger> log){
classification_engine->sortCorrelFunctions();
......@@ -319,7 +318,6 @@ void handleResultsCorrelation(Config *config, std::shared_ptr<ClassificationEngi
}
log->info("Done\n", config->getConfigGlobal().log_output);
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment