src/Generic/PropTree/PropEdgeMatch.cpp
/*
	Use the SessionLogger as a way of printing the status with respect to _covered, _covering, _groups, _weights, and _valid 
	_covered and _covering are filled during computeCoverage(), so this makes most sense called after computeCoverage()
*/
Use the SessionLogger as a way of printing the status with respect to _covered, _covering, _groups, _weights, and _valid
_covered and _covering are filled during computeCoverage(), so this makes most sense called after computeCoverage()
Use the SessionLogger as a way of printing the status with respect to _covered _covering _groups _weights and _valid _covered and _covering are filled during computeCoverage () so this makes most sense called after computeCoverage ()
void PropEdgeMatch::debugPrintValidityAndSourceEdges() const {
	std::set<size_t> positions;
	std::wstringstream debugstream;
	debugstream<<"Calculate Validity \n";
	std::map<size_t, std::set<Symbol> > parentMapEdge;
	std::map<size_t, std::set<Symbol> > childMapEdge;
	for(size_t i = 0; i < _loc_edges.size(); i++){
		parentMapEdge[_loc_edges[i].source_ind].insert(_loc_edges[i].parent.pred());
		childMapEdge[_loc_edges[i].source_ind].insert(_loc_edges[i].child.pred());
		positions.insert(_loc_edges[i].source_ind);
	}
	std::map<size_t, std::set<Symbol> > parentMapRoot;
	for(size_t i = 0; i < _loc_roots.size(); i++){
		parentMapRoot[_loc_roots[i].source_ind].insert(_loc_roots[i].pred.pred());				
		positions.insert(_loc_roots[i].source_ind);
	}
	for(size_t i = 0; i < _valid.size(); i++){
		debugstream<<i<<": ";
		if(_valid[i]){
			debugstream<<"\tValid: ";
			debugstream<<"\tParents: ";
			BOOST_FOREACH(Symbol p, parentMapEdge[i]){
				debugstream<<p<<", ";
			}
			debugstream<<"\tChilderen: ";
			BOOST_FOREACH(Symbol p, childMapEdge[i]){
				debugstream<<p<<", ";
			}
			debugstream<<"\tRoots: ";
			BOOST_FOREACH(Symbol p, parentMapRoot[i]){
				debugstream<<p<<", ";
			}
		}
		else{
			debugstream<<"\tInvalid";
		}
		debugstream<<"\n";
	}
	SessionLogger::warn("prop_trees")<<debugstream.str().c_str()<<std::endl;
}
void PropEdgeMatch :: debugPrintValidityAndSourceEdges ( ) const { std :: set < size_t > positions ; std :: wstringstream debugstream ; debugstream << " \n " ; std :: map < size_t , std :: set < Symbol > > parentMapEdge ; std :: map < size_t , std :: set < Symbol > > childMapEdge ; for ( size_t i = 0 ; i < _loc_edges . size ( ) ; i ++ ) { parentMapEdge [ _loc_edges [ i ] . source_ind ] . insert ( _loc_edges [ i ] . parent . pred ( ) ) ; childMapEdge [ _loc_edges [ i ] . source_ind ] . insert ( _loc_edges [ i ] . child . pred ( ) ) ; positions . insert ( _loc_edges [ i ] . source_ind ) ; } std :: map < size_t , std :: set < Symbol > > parentMapRoot ; for ( size_t i = 0 ; i < _loc_roots . size ( ) ; i ++ ) { parentMapRoot [ _loc_roots [ i ] . source_ind ] . insert ( _loc_roots [ i ] . pred . pred ( ) ) ; positions . insert ( _loc_roots [ i ] . source_ind ) ; } for ( size_t i = 0 ; i < _valid . size ( ) ; i ++ ) { debugstream << i << " " ; if ( _valid [ i ] ) { debugstream << " \t " ; debugstream << " \t " ; BOOST_FOREACH ( Symbol p , parentMapEdge [ i ] ) { debugstream << p << " " ; } debugstream << " \t " ; BOOST_FOREACH ( Symbol p , childMapEdge [ i ] ) { debugstream << p << " " ; } debugstream << " \t " ; BOOST_FOREACH ( Symbol p , parentMapRoot [ i ] ) { debugstream << p << " " ; } } else { debugstream << " \t " ; } debugstream << " \n " ; } SessionLogger :: warn ( " " ) << debugstream . str ( ) . c_str ( ) << std :: endl ; }
Use the SessionLogger as a way of printing the status with respect to _covered, _covering, _groups, _weights, and _valid
_covered and _covering are filled during computeCoverage(), so this makes most sense called after computeCoverage()
Use the SessionLogger as a way of printing the status with respect to _covered _covering _groups _weights and _valid _covered and _covering are filled during computeCoverage () so this makes most sense called after computeCoverage ()
//mrf: currently, there will never be roots if there are edge, but check both together just to be sure
