Skip to content

Commit

Permalink
fix initialization of struct for the parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
adalisan committed Sep 2, 2017
1 parent fedfd44 commit cf5e12d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/graphm/algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ double algorithm::graph_dist(graph &g,graph &h,gsl_matrix* gm_P,char cscore_matr
parameter pdebug_f = get_param("debugprint_file");
pdebug.strvalue=pdebug_f.strvalue;
bool print_debug = false;
if ((pdebug.ivalue != NULL) && (pdebug.ivalue))
print_debug = 1;
if ((pdebug.ivalue != -1) && (pdebug.ivalue))
print_debug = true;
long N=g.getN();
gsl_matrix* gm_Ag=g.get_descmatrix(cscore_matrix);
gsl_matrix* gm_At=gsl_matrix_alloc(N,N);
Expand All @@ -126,9 +126,9 @@ double algorithm::graph_dist(graph &g, graph &h,char cscore_matrix){
parameter pdebug = get_param("debugprint");
parameter pdebug_f = get_param("debugprint_file");
pdebug.strvalue=pdebug_f.strvalue;
bool print_debug = 0;
if ((pdebug.ivalue != NULL) && (pdebug.ivalue))
print_debug = 1;
bool print_debug = false;
if ((pdebug.ivalue != -1) && (pdebug.ivalue))
print_debug = true;
gsl_matrix* gm_Ag=g.get_descmatrix(cscore_matrix);
gsl_matrix* gm_Ah=h.get_descmatrix(cscore_matrix);
gsl_matrix_sub(gm_Ag,gm_Ah);
Expand Down
3 changes: 2 additions & 1 deletion src/graphm/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Special root class which support parameter control, setting, reading etc.
*/
struct parameter
{
parameter() : ptype(5), dvalue(-1.0), cvalue(char(0)), ivalue(-1), fvalue(-1.0), strvalue("") {}
std::string pname;
/*parameter type:
1: double
Expand All @@ -60,7 +61,7 @@ class rpc{
int set_param(std::string pname,int pvalue);
int set_param(std::string pname,float pvalue);
int set_param(std::string pname,std::string pvalue);

int set_param(std::string pname, const char *pvalue);
parameter get_param(std::string pname);
double get_param_d(std::string pname){parameter p=get_param(pname); return p.dvalue;};
Expand Down

0 comments on commit cf5e12d

Please sign in to comment.