10 #include <unordered_map> 12 #include <boost/functional/hash.hpp> 26 using ContexT = std::map<std::string,CtxValT>;
29 using CtxsT = std::unordered_set<ContexT,boost::hash<ContexT>>;
63 boost::hash_combine(seed, sym.
type_);
76 using CandsT = std::unordered_map<Symbol,CtxsT,SymbolHash>;
99 #endif // OPT_CAND_HPP CandsT candidates_
Potential rules contexts that can match subgraph of tensor_.
Definition: candidate.hpp:85
Convert to a non-scalar constant.
Definition: candidate.hpp:37
std::set< teq::TensptrT > CtxValT
Set of tensors that potentially matches some id.
Definition: candidate.hpp:23
std::string reference_
Definition: candidate.hpp:53
teq::CoordptrT shaper_
Real shaper in the argument.
Definition: candidate.hpp:88
std::shared_ptr< iCoordMap > CoordptrT
Type of iCoordMap smartpointer.
Definition: coord.hpp:106
teq::CoordptrT coorder_
Real coorder in the argument.
Definition: candidate.hpp:91
Definition: candidate.hpp:19
std::unordered_set< ContexT, boost::hash< ContexT > > CtxsT
Set of contexts that serve as a candidates of a conversion rule.
Definition: candidate.hpp:29
size_t operator()(const Symbol &sym) const
Return hash of Symbol.
Definition: candidate.hpp:60
std::vector< CandArg > CandArgsT
Vector of candidate arguments.
Definition: candidate.hpp:95
Hasher to encode rule key.
Definition: candidate.hpp:57
CAND_TYPE
Conversion type.
Definition: candidate.hpp:32
std::map< std::string, CtxValT > ContexT
Map of rule graph leaf identifiers to corresponding matches.
Definition: candidate.hpp:26
Intermediate conversion.
Definition: candidate.hpp:39
std::unordered_map< Symbol, CtxsT, SymbolHash > CandsT
Map of convers symbols to its potential candidate conversion rules.
Definition: candidate.hpp:76
Encapsulation of match output argument.
Definition: candidate.hpp:79
teq::TensptrT tensor_
Real tensor of the argument.
Definition: candidate.hpp:82
std::shared_ptr< iTensor > TensptrT
Tensor smart pointer.
Definition: itensor.hpp:51
CAND_TYPE type_
Type of rule.
Definition: candidate.hpp:48
Generic representation of a conversion rule.
Definition: candidate.hpp:45
Full conversion to a subgraph.
Definition: candidate.hpp:41
Convert to a scalar.
Definition: candidate.hpp:35
bool operator==(const Symbol &lhs, const Symbol &rhs)
Compare equality of Symbols.
Definition: candidate.hpp:70