diff --git a/src/graphm/algorithm.cpp b/src/graphm/algorithm.cpp index 0cbcaa1..79cc186 100644 --- a/src/graphm/algorithm.cpp +++ b/src/graphm/algorithm.cpp @@ -27,14 +27,9 @@ algorithm::algorithm(std::string fconfig) bnosymm=false; df_norm=0; N=0; - cdesc_matrix='A'; - cscore_matrix='A'; bverbose=false; sverbfile=std::string(""); - N=0; - df_norm=0.0; - } algorithm::algorithm() : rpc() @@ -49,8 +44,6 @@ algorithm::algorithm() bverbose=false; sverbfile=std::string(""); - N=0; - df_norm=0.0; } //common framework for graph matching algorithm @@ -125,7 +118,7 @@ double algorithm::graph_dist(graph &g,graph &h,gsl_matrix* gm_P,char cscore_matr bool print_debug = false; if ((pdebug.ivalue != -1) && (pdebug.ivalue)) print_debug = true; - long N=g.getN(); + N=g.getN(); gsl_matrix* gm_Ag=g.get_descmatrix(cscore_matrix); gsl_matrix* gm_At=gsl_matrix_alloc(N,N); gsl_matrix* gm_Ah=gsl_matrix_alloc(N,N); diff --git a/src/graphm/algorithm_ca.cpp b/src/graphm/algorithm_ca.cpp index 9e485c0..abe2ba6 100644 --- a/src/graphm/algorithm_ca.cpp +++ b/src/graphm/algorithm_ca.cpp @@ -22,6 +22,7 @@ match_result algorithm_ca::match(graph &g, graph &h, gsl_matrix *gm_P_i, gsl_matrix *_gm_ldh, double dalpha_ldh) { double dhung_max = get_param_d("hungarian_max"); + N=g.getN(); //bool bblast_match_end = (get_param_i("blast_match_proj") == 1); bool bblast_match = (get_param_i("blast_match") == 1); //double dfw_xeps = get_param_d("algo_fw_xeps"); diff --git a/src/graphm/algorithm_ext.cpp b/src/graphm/algorithm_ext.cpp index fd041f4..2e77967 100644 --- a/src/graphm/algorithm_ext.cpp +++ b/src/graphm/algorithm_ext.cpp @@ -21,13 +21,13 @@ match_result algorithm_NEW::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_matrix* gm_ldh,double dalpha_ldh) { -if (bverbose) *gout<<"The best matching algorithm"<size1; set_adjmatrix(_gm_A); + } graph::graph(std::string fconfig) @@ -46,14 +48,18 @@ graph::graph(graph &gr) : rpc() gm_A = NULL; N = 0; const gsl_matrix *gm_t = gr.get_adjmatrix(); + N=gm_t->size1; set_adjmatrix(gm_t); + } graph &graph::operator=(graph &gh) { if (&gh != this) { + N=gh.get_adjmatrix()->size1; set_adjmatrix(gh.get_adjmatrix()); + } return (*this); } @@ -87,6 +93,7 @@ int graph::load_graph(std::string fgraph_name, char ftype, char cformat, std::st fclose(f); gsl_set_error_handler(NULL); set_adjmatrix(gm_A_l); + this->N = gm_A_l->size1; gsl_matrix_free(gm_A_l); }; if (ierror != 0)