Changeset d484a32


Ignore:
Timestamp:
10/24/14 13:07:15 (10 years ago)
Author:
Tomasz Obrebski <obrebski@…>
Branches:
master
Children:
acbabee
Parents:
56c300b
git-author:
Tomasz Obrebski <obrebski@…> (10/24/14 13:07:15)
git-committer:
Tomasz Obrebski <obrebski@…> (10/24/14 13:07:15)
Message:

some unnecessary variables/functions deleted

Location:
src/dgp
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/dgp/Makefile

    re7de6cc rd484a32  
    1111#vpath %.o  . 
    1212 
    13 CXXFLAGS = -g -static 
     13CXXFLAGS = -g -Wno-deprecated -static 
    1414 
    1515sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp1.cc cmdline.cc \ 
     
    4747        rm -f ${bin} ${objs} cmdline.* 
    4848        rm -f *.d 
     49        rm -f *~ 
    4950 
    5051.PHONY: prof 
  • src/dgp/dgp1.cc

    r519eaf5 rd484a32  
    8282          { 
    8383            ret = *ps; 
    84             fprintf(stderr,"#\tsucceeded because of LH/LV equality ()\n"); 
     84            if(debug) fprintf(stderr,"#\tsucceeded because of LH/LV equality ()\n"); 
    8585          } 
    8686        else 
    8787          { 
    88             fprintf(stderr,"#\tfailed beacause of LH/LV inequality\n"); 
     88            if(debug) fprintf(stderr,"#\tfailed beacause of LH/LV inequality\n"); 
    8989          } 
    9090    } 
     
    517517                          if(debug) fprintf(stderr," ...SUCCESS!\n"); 
    518518                          connect_left( j, i, **ri, new_head_boubbles, new_dep_boubbles); 
     519                          lvi.update_edge(sgraph,i); 
    519520                        } 
    520521                      else 
  • src/dgp/grammar.cc

    r3b02b04 rd484a32  
    3131  Cat::add(s); 
    3232 
    33   if(connect.size() <= Cat::count()) 
    34   { 
    35     connect.resize(Cat::count()+RESIZE_DELTA); 
    36     for(int i=0; i<connect.size(); ++i) 
    37       if(connect[i].size() <= Cat::count()) connect[i].resize(Cat::count()+RESIZE_DELTA); 
    38   } 
     33  // if(connect.size() <= Cat::count()) 
     34  // { 
     35  //   connect.resize(Cat::count()+RESIZE_DELTA); 
     36  //   for(int i=0; i<connect.size(); ++i) 
     37  //     if(connect[i].size() <= Cat::count()) connect[i].resize(Cat::count()+RESIZE_DELTA); 
     38  // } 
    3939  if(connect1.size() <= Cat::count()) 
    4040  { 
     
    331331 
    332332          if( chk_cat(cat1) && chk_cat(cat2) && chk_type(type) ) 
    333             set_connect(cat1,parse_flags(flags1,"+"),parse_flags(flags1,"-"),cat2,parse_flags(flags2,"+"),parse_flags(flags2,"-"),type,parse_props(props)); 
     333            set_connect(cat1,parse_flags(flags1,"+"),parse_flags(flags1,"-"),cat2,parse_flags(flags2,"+"),parse_flags(flags2,"-"),type,parse_props(props),lineno); 
    334334          else if( chk_cat(cat1) && chk_cat(cat2) && chk_long(type) ) 
    335335            { 
     
    504504      if(obl[c].test(r)) fprintf(f,"REQ\t%s\t%s\n",c.str(),r.str()); 
    505505   
    506   for(Cat c=1; c<Cat::count(); ++c) 
    507     for(Cat d=1; d<Cat::count(); ++d) 
    508       for(Role t=1; t<Role::count(); ++t) 
    509         if(connect[c][d].count(t)) 
    510           fprintf(f,"LINK\t%s\t%s\t%s\n",c.str(),d.str(),t.str()); 
     506  // for(Cat c=1; c<Cat::count(); ++c) 
     507  //   for(Cat d=1; d<Cat::count(); ++d) 
     508  //     for(Role t=1; t<Role::count(); ++t) 
     509  //    if(connect[c][d].count(t)) 
     510  //         fprintf(f,"LINK\t%s\t%s\t%s\n",c.str(),d.str(),t.str()); 
    511511 
    512512  for(LongRel i=1; i<LongRel::count(); ++i) 
  • src/dgp/grammar.hh

    r519eaf5 rd484a32  
    2727struct Link 
    2828{ 
    29   Link(Role r, Flag dfplus="NULL", Flag dfminus="NULL") : role(r), dflagplus(dfplus), dflagminus(dfminus) { } 
    30   Link(Role r, PropSet ps=EmptyPropSet, Flag hfp="NULL", Flag hfm="NULL", Flag dfp="NULL", Flag dfm="NULL") 
     29  // Link(Role r, Flag dfplus="NULL", Flag dfminus="NULL") : role(r), dflagplus(dfplus), dflagminus(dfminus) { } 
     30  Link(Role r, PropSet ps=EmptyPropSet, Flag hfp="NULL", Flag hfm="NULL", Flag dfp="NULL", Flag dfm="NULL", int lineno=0) 
    3131    : role(r), props(ps), hflagplus(hfp), hflagminus(hfm), dflagplus(dfp), dflagminus(dfm) { } 
    3232  //Link(Role r) : role(r), dflagplus("NULL") { } 
     
    3838  Flag dflagminus; 
    3939  PropSet props; 
     40  int lineno; 
    4041 
    4142  bool operator<(const Link& l) const  
     
    6768  Grammar() {} ; 
    6869 
    69   Roles&  connectable(Cat h, Cat d); 
    70   Roles   connectable(Cat h, Cat d, FlagSet f, FlagSet df); 
    71  
    7270  list<const Link*> connectable2(Cat h, Cat d, FlagSet hfs, FlagSet dfs); 
    7371 
     
    109107  vector< FlagSet >            pass;     //[Role] 
    110108 
    111   vector< vector< Roles > >    connect;  //[Cat][Cat] 
     109  // vector< vector< Roles > >    connect;  //[Cat][Cat] 
    112110 
    113111  vector< vector< Links > >    connect1; //[Cat][Cat] 
     
    143141  //  void set_connect(Cat c, Cat d, Flag f, Role r)   { connect1[c][d].insert(Link(r,f)); } 
    144142 
    145   void set_connect(Cat h, Flag hfp, Flag hfm, Cat d, Flag dfp, Flag dfm, Role r, PropSet ps )   { connect1[h][d].insert(Link(r,ps,hfp,hfm,dfp,dfm)); } 
     143  void set_connect(Cat h, Flag hfp, Flag hfm, Cat d, Flag dfp, Flag dfm, Role r, PropSet ps, int lineno )   { connect1[h][d].insert(Link(r,ps,hfp,hfm,dfp,dfm,lineno)); } 
    146144 
    147145  void set_include(Role r, Role s)         { include[r].set(s); } 
     
    160158 
    161159inline 
    162 Roles&  Grammar::connectable(Cat h, Cat d) 
    163 { 
    164   return connect[h][d]; 
    165 } 
    166  
    167 //---------------------------------------------------------------------------------------------------- 
    168  
    169 inline 
    170 Roles Grammar::connectable(Cat h, Cat d, FlagSet hfs, FlagSet dfs)  // ZBYT WOLNE!!!!!!!!!!!!!!!!!!!!!!!!!! (-> Roles&) 
    171 { 
    172   Roles ret; 
    173   for(Links::const_iterator l = connect1[h][d].begin(); l != connect1[h][d].end(); l++) 
    174     if( (l->hflagplus==0 || hfs[l->hflagplus]) && (l->hflagminus==0 || !hfs[l->hflagminus]) ) 
    175       if( (l->dflagplus==0 || dfs[l->dflagplus]) && (l->dflagminus==0 || !dfs[l->dflagminus]) ) 
    176         ret.insert(l->role); 
    177   return ret; 
    178 } 
    179  
    180 //---------------------------------------------------------------------------------------------------- 
    181  
    182 inline 
    183160list<const Link*> Grammar::connectable2(Cat h, Cat d, FlagSet hfs, FlagSet dfs)  // ZBYT WOLNE!!!!!!!!!!!!!!!!!!!!!!!!!! (-> Roles&) 
    184161{ 
     
    190167  return ret; 
    191168} 
    192  
    193 //---------------------------------------------------------------------------------------------------- 
    194  
    195 // inline 
    196 // bool Grammar::check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role)    // dir: 0-left 1-right 
    197 // { 
    198 //   return  
    199 //     !hprop.forbidden[role] && 
    200 //     ( dir==1 || !right[role] ) && 
    201 //     ( dir==0 || !left[role]  ) && 
    202 //     ( dir==1 || (hprop.attached&init).none() ) && 
    203 //     ( dir==0 || (hprop.attached&fin).none() ) 
    204 //     ; 
    205 // } 
    206169 
    207170//---------------------------------------------------------------------------------------------------- 
  • src/dgp/sgraph.cc

    r519eaf5 rd484a32  
    179179  buf+=sprint_node(buf,n,anc,HEADS|DEPS|SETS|CONSTRAINTS); 
    180180   
    181   // buf+=sprintf(buf,"/"); 
    182   // for(vector<int>::iterator e = nodes[n].edge.begin(); e != nodes[n].edge.end(); e++ ) 
    183   //   buf += sprintf(buf,"%d ", *e); 
     181  buf+=sprintf(buf,"/"); 
     182  for(vector<int>::iterator e = nodes[n].edge.begin(); e != nodes[n].edge.end(); e++ ) 
     183    buf += sprintf(buf,"%d ", *e); 
    184184 
    185185  buf+=sprintf(buf,"\n"); 
  • src/dgp/sgraph.hh

    r519eaf5 rd484a32  
    296296  LViterator(SGraph& sg, int n, bool s); 
    297297  int next(); 
     298  void update_edge(SGraph& sg, int e); 
    298299 
    299300private: 
     
    308309  void push_lh(int i); 
    309310  void push_ln(int i); 
     311 
    310312}; 
    311313 
     
    326328        } 
    327329       
     330    } 
     331} 
     332 
     333inline void LViterator::update_edge(SGraph& sg, int n) 
     334{ 
     335  for(vector<int>::iterator i=sg[n].edge.begin(); i!=sg[n].edge.end(); ++i) 
     336    { 
     337      push_ld(*i); 
     338      push_ln(*i); 
    328339    } 
    329340} 
  • src/dgp/thesymbols.hh

    re7de6cc rd484a32  
    1818typedef list<Role>::iterator   RoleListIter; 
    1919typedef bitset<MAXTYPES>       RoleSet; 
    20 typedef set<Role>              Roles; 
    21 typedef Roles::iterator        RolesIter; 
     20// typedef set<Role>              Roles; 
     21// typedef Roles::iterator        RolesIter; 
    2222 
    2323typedef Symbol<3>              Constr; 
Note: See TracChangeset for help on using the changeset viewer.