Skip to content

Commit

Permalink
make sure specific algo implementations get N from first graph
Browse files Browse the repository at this point in the history
  • Loading branch information
adalisan committed Sep 5, 2017
1 parent b4a97ba commit 8b91dc8
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 58 deletions.
7 changes: 4 additions & 3 deletions src/graphm/algorithm_fsol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@
match_result algorithm_fsol::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matrix* gm_ldh,double dalpha_ldh)
{
if (bverbose)
*gout<<"FSol matching"<<std::endl;
*gout<<"FSol matching"<<std::endl;
//some duplicate variables
match_result mres;
N=g.getN();
mres.gm_P=gsl_matrix_alloc(N,N);
std::string sfile=get_param_s("solution_file");
FILE *f=fopen(sfile.c_str(),"r");
if (f!=NULL){
if (f!=NULL){
gsl_matrix_fscanf(f,mres.gm_P);
fclose(f);
}
else{
if (bverbose) *gout<<"Can't load solution file, fsoltity matrix is used"<<std::endl;
if (bverbose) *gout<<"Can't load solution file, fsoltity matrix is used"<<std::endl;
gsl_matrix_set_identity(mres.gm_P);
}
mres.gm_P_exact=NULL;
Expand Down
3 changes: 2 additions & 1 deletion src/graphm/algorithm_iden.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
match_result algorithm_iden::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matrix* gm_ldh,double dalpha_ldh)
{
if (bverbose)
*gout<<"Identity matching"<<std::endl;
*gout<<"Identity matching"<<std::endl;
//some duplicate variables
match_result mres;
N=g.getN();
mres.gm_P=gsl_matrix_alloc(N,N);
gsl_matrix_set_identity(mres.gm_P);
mres.gm_P_exact=NULL;
Expand Down
17 changes: 9 additions & 8 deletions src/graphm/algorithm_lp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
match_result algorithm_lp::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matrix* gm_ldh,double dalpha_ldh)
{
if (bverbose)
*gout<<"Linear programming matching"<<std::endl;
*gout<<"Linear programming matching"<<std::endl;
gsl_matrix* gm_Ag_d=g.get_descmatrix(cdesc_matrix);
gsl_matrix* gm_Ah_d=h.get_descmatrix(cdesc_matrix);
N=g.getN();
//linear program parameters
int* ia = new int[N*N*(N+N-1)+N*N+N*N+N*N+1];
int* ja = new int[N*N*(N+N-1)+N*N+N*N+N*N+1];
Expand All @@ -40,7 +41,7 @@ match_result algorithm_lp::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matr
gsl_matrix_set(gm_Agh,i*N+j,j*N+k,gsl_matrix_get(gm_Ag_d,i,k));
ia[icounter]=i*N+j+1;ja[icounter]=j*N+k+1;ar[icounter]=gsl_matrix_get(gm_Ag_d,i,k);
icounter++;
};
};
for (int k=0;k<N;k++){
//sometimes we have to change yet allocated constaints
if (k!=j){
Expand Down Expand Up @@ -80,7 +81,7 @@ match_result algorithm_lp::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matr
};
//glpk package
LPX* lp;
lp=lpx_create_prob();
lp=lpx_create_prob();
lpx_set_prob_name(lp,"glpk");
lpx_add_rows(lp,N*N+N);
for (int i=0;i<N*N;i++)
Expand All @@ -94,7 +95,7 @@ match_result algorithm_lp::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matr
lpx_set_obj_dir(lp,LPX_MIN);
//the label cost matrix introduce the coefficients for the first part of objective function
if (dalpha_ldh>0)
{
{
for (int i=0;i<N*N;i++)
lpx_set_obj_coef(lp,i+1,dalpha_ldh*gm_ldh->data[i]);
for (int i=0;i<2*N*N;i++)
Expand All @@ -115,7 +116,7 @@ match_result algorithm_lp::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matr
for (int j=0;j<N;j++)
gsl_matrix_set(C,i,j,lpx_get_col_prim(lp,i*N+j+1));
lpx_delete_prob(lp);
if (pdebug.ivalue) gsl_matrix_printout(C,"C=lp solution",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C,"C=lp solution",pdebug.strvalue);
match_result mres;
mres.gm_P_exact=gsl_matrix_alloc(N,N);
gsl_matrix_transpose_memcpy(mres.gm_P_exact,C);
Expand All @@ -125,9 +126,9 @@ match_result algorithm_lp::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matr
dscale_factor=10000/dscale_factor;
gsl_matrix_scale(C,-dscale_factor);
//gsl_matrix_transpose(C);
if (pdebug.ivalue) gsl_matrix_printout(C,"scale(C)",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C,"scale(C)",pdebug.strvalue);
gsl_matrix* gm_P=gsl_matrix_hungarian(C);
if (pdebug.ivalue) gsl_matrix_printout(gm_P,"gm_P",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_P,"gm_P",pdebug.strvalue);
mres.gm_P=gm_P;
gsl_matrix_free(gm_Ag_d);
gsl_matrix_free(gm_Ah_d);
Expand All @@ -148,4 +149,4 @@ match_result algorithm_lp::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matr
return mres;
}

#endif
#endif
1 change: 1 addition & 0 deletions src/graphm/algorithm_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ match_result algorithm_path::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_ma
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d, "Ag", pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ah_d, "Ah", pdebug.strvalue);
//laplacian construction
N=g.getN();
gsl_matrix* gm_Lg_d=gsl_matrix_alloc(N, N);
gsl_matrix* gm_Lh_d=gsl_matrix_alloc(N, N);
gsl_matrix_memcpy(gm_Lg_d, gm_Ag_d);
Expand Down
1 change: 1 addition & 0 deletions src/graphm/algorithm_qcv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ match_result algorithm_qcv::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_matr
gsl_matrix* gm_P_bp_temp=NULL;
gsl_matrix* gm_P_bp=NULL;
double fbest_path=1e+300;
N= g.getN();

if (bbest_path)
{
Expand Down
3 changes: 2 additions & 1 deletion src/graphm/algorithm_rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
match_result algorithm_rand::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_matrix* gm_ldh,double dalpha_ldh)
{
if (bverbose)
*gout<<"Random matching"<<std::endl;
*gout<<"Random matching"<<std::endl;
match_result mres;
N=g.getN();
mres.gm_P=gsl_matrix_alloc(N,N);
mres.gm_P_exact=NULL;
gsl_matrix_set_zero(mres.gm_P);
Expand Down
55 changes: 28 additions & 27 deletions src/graphm/algorithm_rank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ match_result algorithm_rank::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_ma
*gout<<"Rank matching"<<std::endl;
bool bblast_match_end=(get_param_i("blast_match_proj")==1);
//some duplicate variables
N=g.getN();
gsl_matrix* gm_Ag_d=g.get_descmatrix(cdesc_matrix);
gsl_matrix* gm_Ah_d=h.get_descmatrix(cdesc_matrix);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"Ag",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"Ag",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ah_d,"Ah",pdebug.strvalue);
double d1=gsl_matrix_sum(gm_Ag_d);
double d2=gsl_matrix_sum(gm_Ah_d);
Expand All @@ -37,11 +38,11 @@ match_result algorithm_rank::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_ma
gsl_matrix_set_all(C,1.0/(N));
int max_num_it=1000;
int num_it=0;

gsl_vector_view gvv_C_old=gsl_vector_view_array(C_old->data,N*N);
gsl_vector_view gvv_R=gsl_vector_view_array(C->data,N*N);


gsl_vector* gv_deg_g=gsl_vector_alloc(N);
gsl_vector* gv_deg_h=gsl_vector_alloc(N);
gsl_matrix_sum(gm_Ag_d,1, gv_deg_g);
Expand All @@ -53,38 +54,38 @@ match_result algorithm_rank::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_ma
if (gv_deg_g->data[j]>0) gm_Ag_d->data[i*N+j]/=gv_deg_g->data[j];
if (gv_deg_h->data[j]>0) gm_Ah_d->data[i*N+j]/=gv_deg_h->data[j];
};
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"gm_Ag_d",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ah_d,"gm_Ah_d",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"gm_Ag_d",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ah_d,"gm_Ah_d",pdebug.strvalue);
gsl_vector_free(gv_deg_g);
gsl_vector_free(gv_deg_h);
double ddiff;bool bcontinue=true;double dm_old;
if (dalpha_ldh>0) {
if (dalpha_ldh>0) {
gsl_matrix_scale(gm_ldh,dalpha_ldh);
gsl_matrix_memcpy(C,gm_ldh);
}
else
gsl_matrix_set_all(C,1.0/N);
if (pdebug.ivalue) gsl_matrix_printout(C,"C",pdebug.strvalue);

if (pdebug.ivalue) gsl_matrix_printout(C,"C",pdebug.strvalue);
bool biter_algo=true;
if (biter_algo)
{
while (bcontinue)
{
{
gsl_matrix_memcpy(C_old,C);
gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1, gm_Ag_d,C,0,gm_temp);
if (pdebug.ivalue) gsl_matrix_printout(gm_temp,"gm_temp",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_temp,"gm_temp",pdebug.strvalue);
//gsl_blas_dgemm(CblasNoTrans,CblasTrans, 1-dalpha_ldh, gm_temp,gm_Ah_d,0,C);
gsl_matrix_transpose(gm_temp);
gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1-dalpha_ldh,gm_Ah_d, gm_temp,0,C);
gsl_matrix_transpose(C);
if (pdebug.ivalue) gsl_matrix_printout(C,"C",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C,"C",pdebug.strvalue);
if (dalpha_ldh>0) gsl_matrix_add(C,gm_ldh);
//normalization
dm_old=gsl_blas_dnrm2(&gvv_R.vector);
gsl_matrix_scale(C,1.0/dm_old);
gsl_matrix_sub(C_old,C);
if (pdebug.ivalue) gsl_matrix_printout(C_old,"C_old",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C_old,"C_old",pdebug.strvalue);
ddiff=gsl_blas_dnrm2(&gvv_C_old.vector);
bcontinue=!(ddiff<1e-2);
bcontinue=(bcontinue && (num_it++<max_num_it));
Expand All @@ -105,65 +106,65 @@ match_result algorithm_rank::match(graph& g, graph& h,gsl_matrix* gm_P_i, gsl_ma
gsl_eigen_symmv (gm_Ag_d, eval_g,evec_g,gesw);
if (bverbose) *gout<<"Ag eigen vectors"<<std::endl;
gsl_eigen_symmv (gm_Ah_d, eval_h,evec_h,gesw);

if (bverbose) *gout<<"Ah eigen vectors"<<std::endl;
gsl_eigen_symmv_sort (eval_g, evec_g, GSL_EIGEN_SORT_VAL_DESC);
gsl_eigen_symmv_sort (eval_h, evec_h, GSL_EIGEN_SORT_VAL_DESC);
//eigenvalues recalculation

gsl_matrix_view gmv_Lg=gsl_matrix_view_vector(eval_g,N,1);
gsl_matrix_view gmv_Lh=gsl_matrix_view_vector(eval_h,1,N);
gsl_matrix_view gmv_L=gsl_matrix_view_array(C_old->data,N,N);
gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1, &gmv_Lg.matrix,&gmv_Lh.matrix,0,C_old);
gsl_matrix_scale(C_old,-1);
gsl_matrix_add_constant(C_old,1);

if (pdebug.ivalue) gsl_matrix_printout(&gmv_Lg.matrix,"gmv_Lg.matrix",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(&gmv_Lh.matrix,"gmv_Lh.matrix",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C_old,"C_old",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(&gmv_Lg.matrix,"gmv_Lg.matrix",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(&gmv_Lh.matrix,"gmv_Lh.matrix",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C_old,"C_old",pdebug.strvalue);
gsl_matrix_memcpy(C,gm_ldh);
gsl_matrix_transpose(C);
//multiplcation chain
gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1, C,gm_Ah_d,0,gm_temp);
gsl_matrix_transpose(gm_Ag_d);
gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1, gm_Ag_d,gm_temp,0,C);
gsl_matrix_transpose(gm_Ag_d);

gsl_matrix_div_elements(C,C_old);

//gsl_matrix_transpose(gm_Ah_d);
//gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1, C,gm_Ah_d,0,gm_temp);
gsl_matrix_transpose(C);
gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1, gm_Ah_d,C,0,gm_temp);
gsl_matrix_transpose(gm_temp);
gsl_blas_dgemm(CblasNoTrans,CblasNoTrans, 1, gm_Ag_d,gm_temp,0,C);

gsl_matrix_free(gm_Ag_d);
gsl_matrix_free(gm_Ah_d);
gsl_matrix_free(gm_Ah_d);
gsl_vector_free(eval_g);
gsl_vector_free(eval_h);
gsl_matrix_free(evec_g);
gsl_matrix_free(evec_h);
gsl_matrix_free(C);
gsl_matrix_free(C);
};
if (dalpha_ldh>0) gsl_matrix_scale(gm_ldh,1/dalpha_ldh);
if (pdebug.ivalue) gsl_matrix_printout(C,"C=rank matrix",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C,"C=rank matrix",pdebug.strvalue);
gsl_matrix_free(gm_Ag_d);
gsl_matrix_free(gm_Ah_d);
gsl_matrix_free(C_old);
gsl_matrix_free(gm_temp);

//scaling for hungarian
double dscale_factor =gsl_matrix_max_abs(C);
dscale_factor=(dscale_factor>EPSILON)?dscale_factor:EPSILON;
dscale_factor=10000/dscale_factor;
gsl_matrix_scale(C,-dscale_factor);
gsl_matrix_transpose(C);
if (pdebug.ivalue) gsl_matrix_printout(C,"scale(C)",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C,"scale(C)",pdebug.strvalue);
gsl_matrix* gm_P=gsl_matrix_alloc(N,N);
gsl_matrix_hungarian(C,gm_P,NULL,NULL,false,(bblast_match_end?gm_ldh:NULL),false);
if (pdebug.ivalue) gsl_matrix_printout(gm_P,"gm_P",pdebug.strvalue);

match_result mres;
mres.gm_P=gm_P;
gsl_matrix_free(C);
Expand Down
13 changes: 7 additions & 6 deletions src/graphm/algorithm_sch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ match_result algorithm_sch::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_matr
bool bgreedy=(get_param_i("hungarian_greedy")==1);
match_result mres=algorithm_qcv::match(g,h,gm_P_i,gm_ldh,dalpha_ldh);
if (bverbose)
*gout<<"SCH algorithm"<<std::endl;
*gout<<"SCH algorithm"<<std::endl;
//some duplicate variables
N=g.getN();
gsl_matrix* gm_Ag_d=g.get_descmatrix(cdesc_matrix);
gsl_matrix* gm_Ah_d=h.get_descmatrix(cdesc_matrix);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"Ag",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"Ag",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ah_d,"Ah",pdebug.strvalue);
//memory allocation
gsl_eigen_symmv_workspace * gesw= gsl_eigen_symmv_alloc (N);
Expand All @@ -42,8 +43,8 @@ match_result algorithm_sch::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_matr
gsl_eigen_symmv (gm_Ag_d, eval_g,evec_g,gesw);
if (bverbose) *gout<<"Ag eigen vectors"<<std::endl;
gsl_eigen_symmv (gm_Ah_d, eval_h,evec_h,gesw);


if (bverbose) *gout<<"Ah eigen vectors"<<std::endl;
gsl_eigen_symmv_sort (eval_g, evec_g, GSL_EIGEN_SORT_VAL_DESC);
gsl_eigen_symmv_sort (eval_h, evec_h, GSL_EIGEN_SORT_VAL_DESC);
Expand Down Expand Up @@ -82,10 +83,10 @@ match_result algorithm_sch::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_matr
for (int m=0;m<N;m++)
C->data[i+N*j]+=pow(gm_Ag_d->data[i+k*N]-gm_Ah_d->data[j+m*N],2);
};*/

gsl_matrix_free(gm_Ag_d);
gsl_matrix_free(gm_Ah_d);

// gsl_matrix_transpose(C);
//gsl_matrix_scale(C,-1);
gsl_matrix_printout(C,"C",pdebug.strvalue);
Expand Down
25 changes: 13 additions & 12 deletions src/graphm/algorithm_umeyama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
match_result algorithm_umeyama::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_matrix* gm_ldh,double dalpha_ldh)
{
if (bverbose)
*gout<<"Umeyama algorithm"<<std::endl;
*gout<<"Umeyama algorithm"<<std::endl;
bool bblast_match_end=(get_param_i("blast_match_proj")==1);
//some duplicate variables
gsl_matrix* gm_Ag_d=g.get_descmatrix(cdesc_matrix);
gsl_matrix* gm_Ah_d=h.get_descmatrix(cdesc_matrix);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"Ag",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ag_d,"Ag",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_Ah_d,"Ah",pdebug.strvalue);
//memory allocation
N=g.getN();
gsl_eigen_symmv_workspace * gesw= gsl_eigen_symmv_alloc (N);
gsl_vector* eval_g=gsl_vector_alloc(N);
gsl_vector* eval_h=gsl_vector_alloc(N);
Expand All @@ -40,27 +41,27 @@ match_result algorithm_umeyama::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_
gsl_eigen_symmv (gm_Ag_d, eval_g,evec_g,gesw);
if (bverbose) *gout<<"Ag eigen vectors"<<std::endl;
gsl_eigen_symmv (gm_Ah_d, eval_h,evec_h,gesw);

gsl_matrix_free(gm_Ag_d);
gsl_matrix_free(gm_Ah_d);

if (bverbose) *gout<<"Ah eigen vectors"<<std::endl;
gsl_eigen_symmv_sort (eval_g, evec_g, GSL_EIGEN_SORT_VAL_DESC);
gsl_eigen_symmv_sort (eval_h, evec_h, GSL_EIGEN_SORT_VAL_DESC);
if (pdebug.ivalue){ gsl_matrix_printout(eval_g,"eval_g",pdebug.strvalue);
gsl_matrix_printout(eval_h,"eval_h",pdebug.strvalue);

if (pdebug.ivalue){ gsl_matrix_printout(eval_g,"eval_g",pdebug.strvalue);
gsl_matrix_printout(eval_h,"eval_h",pdebug.strvalue);
gsl_matrix_printout(evec_g,"evec_g",pdebug.strvalue);
gsl_matrix_printout(evec_h,"evec_h",pdebug.strvalue);};
gsl_matrix_abs(evec_g);
gsl_matrix_abs(evec_h);
if (pdebug.ivalue) gsl_matrix_printout(evec_g,"abs(evec_g)",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(evec_h,"abs(evec_h)",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(evec_h,"abs(evec_h)",pdebug.strvalue);
//loss matrix construction
gsl_matrix* C=gsl_matrix_alloc(N,N);
if (bverbose) *gout<<"Loss function matrix allocation"<<std::endl;
gsl_blas_dgemm(CblasNoTrans,CblasTrans,1,evec_g,evec_h,0,C);
if (pdebug.ivalue) gsl_matrix_printout(C,"C=abs(evec_g)*abs(evec_h')",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C,"C=abs(evec_g)*abs(evec_h')",pdebug.strvalue);
//label cost matrix
update_C_hungarian(C,-1);
//scaling for hungarian
Expand All @@ -69,14 +70,14 @@ match_result algorithm_umeyama::match(graph& g, graph& h,gsl_matrix* gm_P_i,gsl_
dscale_factor=10000/dscale_factor;
gsl_matrix_scale(C,-dscale_factor);
gsl_matrix_transpose(C);
if (pdebug.ivalue) gsl_matrix_printout(C,"scale(C)",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(C,"scale(C)",pdebug.strvalue);
gsl_matrix* gm_P=gsl_matrix_alloc(N,N);
gsl_matrix_hungarian(C,gm_P,NULL,NULL,false,(bblast_match_end?gm_ldh:NULL),false);
if (pdebug.ivalue) gsl_matrix_printout(gm_P,"gm_P",pdebug.strvalue);
if (pdebug.ivalue) gsl_matrix_printout(gm_P,"gm_P",pdebug.strvalue);
if (bverbose) *gout<<"Hungarian solved"<<std::endl;
match_result mres;
mres.gm_P=gm_P;


//initial score
mres.vd_trace.push_back(graph_dist(g,h,cscore_matrix));
Expand Down
Loading

0 comments on commit 8b91dc8

Please sign in to comment.