From d1b2f589a6608fa4266724bd4ade08898debe3b0 Mon Sep 17 00:00:00 2001 From: Sancar Adali Date: Fri, 4 Aug 2017 20:39:50 -0400 Subject: [PATCH] might fix solaris errors --- src/graphm/algorithm_path.cpp | 4 +++- src/graphm/graph.cpp | 3 ++- src/graphm/hungarian.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/graphm/algorithm_path.cpp b/src/graphm/algorithm_path.cpp index c129797..b5321c3 100644 --- a/src/graphm/algorithm_path.cpp +++ b/src/graphm/algorithm_path.cpp @@ -121,6 +121,7 @@ match_result algorithm_path::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_ma gm_P_bp_temp=gsl_matrix_alloc(N, N); gm_P_bp=gsl_matrix_alloc(N, N); }; + int Nqua = pow(N, 4); //*************ALGORITHM*********************** bool bpath_continue=true; double dlambda_add=dlambda_min; @@ -261,7 +262,8 @@ match_result algorithm_path::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_ma // int dbg=1; ddP_norm=gsl_matrix_norm(gm_P_prev, 1); bstop_algo=((ddP_normpow(N, 4))); + + bstop_algo = (bstop_algo or (icounter>Nqua)); bstop_algo=(bstop_algo or (abs(df_value-df_value_old)<1e-30)); bstop_algo=(bstop_algo or ((icounter>0) and binc_lambda));//if we are on the increment step do not repreat many times icounter++; diff --git a/src/graphm/graph.cpp b/src/graphm/graph.cpp index b54cf2e..f760ead 100644 --- a/src/graphm/graph.cpp +++ b/src/graphm/graph.cpp @@ -24,6 +24,7 @@ #include #include "hungarian.h" #include + //using namespace std; graph::graph(const gsl_matrix *_gm_A) : rpc("") @@ -31,7 +32,7 @@ graph::graph(const gsl_matrix *_gm_A) : rpc("") gm_A = NULL; N = 0; set_adjmatrix(_gm_A); - + } graph::graph(std::string fconfig) diff --git a/src/graphm/hungarian.cpp b/src/graphm/hungarian.cpp index cda434e..a295c9f 100644 --- a/src/graphm/hungarian.cpp +++ b/src/graphm/hungarian.cpp @@ -434,7 +434,7 @@ void gsl_matrix_hungarian(gsl_matrix* gm_C,gsl_matrix* gm_P,gsl_vector* gv_col_i for (long l=0;l