From c53101b5faac278a3a5ce1af282c8e8531166427 Mon Sep 17 00:00:00 2001 From: Sancar Adali Date: Tue, 29 Aug 2017 17:46:25 -0400 Subject: [PATCH] some more error handling --- src/graphm/experiment.cpp | 5 +++++ src/graphmatch_rcpp.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/src/graphm/experiment.cpp b/src/graphm/experiment.cpp index fb1bd16..8f44767 100644 --- a/src/graphm/experiment.cpp +++ b/src/graphm/experiment.cpp @@ -107,6 +107,11 @@ void experiment::run_experiment(graph &g, graph &h) int N2 =0; N2 = h.get_adjmatrix()->size1; // Matrix of local similarities between graph vertices + if ( N1==0) + throw std::runtime_error("Error: graph g has adjacency matrix of 0 size \n"); + if ( N2==0) + throw std::runtime_error("Error: graph h has adjacency matrix of 0 size \n"); + gsl_matrix* gm_ldh=gsl_matrix_alloc(N1,N2); diff --git a/src/graphmatch_rcpp.cpp b/src/graphmatch_rcpp.cpp index 5d687d7..89ce475 100644 --- a/src/graphmatch_rcpp.cpp +++ b/src/graphmatch_rcpp.cpp @@ -116,6 +116,7 @@ Rcpp::List run_graph_match(const RcppGSL::Matrix& A, const RcppGSL::Matrix& B, c try { exp.run_experiment(graphm_obj_A, graphm_obj_B); + Rcpp::Rcout <<"GM Experiments complete\n"; int exp_count = exp.get_algo_len();