fixed bug that would force node sharing when two or more expectation operators had the same expression but different information sets
parent
405ca1365c
commit
d206217fef
|
@ -536,7 +536,7 @@ DataTree::isUnaryOpUsed(UnaryOpcode opcode) const
|
||||||
{
|
{
|
||||||
for (unary_op_node_map_t::const_iterator it = unary_op_node_map.begin();
|
for (unary_op_node_map_t::const_iterator it = unary_op_node_map.begin();
|
||||||
it != unary_op_node_map.end(); it++)
|
it != unary_op_node_map.end(); it++)
|
||||||
if (it->first.second == opcode)
|
if (it->first.first.second == opcode)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -59,7 +59,8 @@ protected:
|
||||||
//! Pair (symbol_id, lag) used as key
|
//! Pair (symbol_id, lag) used as key
|
||||||
typedef map<pair<int, int>, VariableNode *> variable_node_map_t;
|
typedef map<pair<int, int>, VariableNode *> variable_node_map_t;
|
||||||
variable_node_map_t variable_node_map;
|
variable_node_map_t variable_node_map;
|
||||||
typedef map<pair<expr_t, UnaryOpcode>, UnaryOpNode *> unary_op_node_map_t;
|
//! Pair( Pair (arg1, UnaryOpCode), Pair(Expectation Info Set, Expectation Info Set Name) )
|
||||||
|
typedef map<pair<pair<expr_t, UnaryOpcode>, pair<int, string> >, UnaryOpNode *> unary_op_node_map_t;
|
||||||
unary_op_node_map_t unary_op_node_map;
|
unary_op_node_map_t unary_op_node_map;
|
||||||
typedef map<pair<pair<expr_t, expr_t>, BinaryOpcode>, BinaryOpNode *> binary_op_node_map_t;
|
typedef map<pair<pair<expr_t, expr_t>, BinaryOpcode>, BinaryOpNode *> binary_op_node_map_t;
|
||||||
binary_op_node_map_t binary_op_node_map;
|
binary_op_node_map_t binary_op_node_map;
|
||||||
|
@ -263,7 +264,7 @@ inline expr_t
|
||||||
DataTree::AddUnaryOp(UnaryOpcode op_code, expr_t arg, int arg_exp_info_set, const string &arg_exp_info_set_name)
|
DataTree::AddUnaryOp(UnaryOpcode op_code, expr_t arg, int arg_exp_info_set, const string &arg_exp_info_set_name)
|
||||||
{
|
{
|
||||||
// If the node already exists in tree, share it
|
// If the node already exists in tree, share it
|
||||||
unary_op_node_map_t::iterator it = unary_op_node_map.find(make_pair(arg, op_code));
|
unary_op_node_map_t::iterator it = unary_op_node_map.find(make_pair(make_pair(arg, op_code), make_pair(arg_exp_info_set, arg_exp_info_set_name)));
|
||||||
if (it != unary_op_node_map.end())
|
if (it != unary_op_node_map.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
|
|
|
@ -1192,7 +1192,8 @@ UnaryOpNode::UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const
|
||||||
op_code(op_code_arg)
|
op_code(op_code_arg)
|
||||||
{
|
{
|
||||||
// Add myself to the unary op map
|
// Add myself to the unary op map
|
||||||
datatree.unary_op_node_map[make_pair(arg, op_code)] = this;
|
datatree.unary_op_node_map[make_pair(make_pair(arg, op_code),
|
||||||
|
make_pair(expectation_information_set, expectation_information_set_name))] = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue