Example #1
0
        /** A shared_ptr to a TreeWithAcceptance */
        //typedef boost::shared_ptr<TreeWithAcceptance<Tree,AcceptanceSignature> > ptr;

        /** Check if this TreeWithAcceptance is equal to another.
         * @param other the other TreeWithAcceptance.
         * @return true iff the two are equal
         */
        public static bool operator ==(TreeWithAcceptance one, TreeWithAcceptance other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            return((one._tree == other.getTree()) && (one._signature == other.getSignature()));
        }
Example #2
0
        /**
         * Check for equality.
         * @param other the other APElement
         * @return <b>true</b> if this and the other APElement are equal.
         */
        public static bool operator ==(APElement one, APElement other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            return(one.getBitSet() == other.getBitSet());
        }
Example #3
0
        /** Compare to other signature for equality. */
        public static bool operator ==(RabinSignature one, RabinSignature other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            return(one._L == other._L && one._U == other._U);
        }
Example #4
0
        /**
         * Checks for equality.
         * @param other the other APMonom
         * @return <b>true</b> if this and the other APMonom are equal
         */
        public static bool operator ==(APMonom one, APMonom other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            return((one.getValueBits() == other.getValueBits()) && (one.getSetBits() == other.getSetBits()));
        }
Example #5
0
        public static bool operator ==(AbstractedKeyType one, AbstractedKeyType other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            return(SafraTreeCandidateMatcher.abstract_equal_to(one._key, other._key));
        }
Example #6
0
        /** Compare this state to another for equality.
         * @param other the other UnionState
         * @returns true iff the two states are equal
         */
        public static bool operator ==(UnionState one, UnionState other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            return(one.da_state_1 == other.da_state_1 && one.da_state_2 == other.da_state_2);
            // we don't have to check the signature as there is a
            // 1-on-1 mapping between <da_state_1, da_state_2> -> signature
        }
Example #7
0
        //add this code to class ThreeDPoint as defined previously
        //
        public static bool operator ==(SafraTreeNode a, SafraTreeNode b)
        {
            bool?val = Ultility.NullCheck(a, b);

            if (val != null)
            {
                return(val.Value);
            }

            if (!(a._id == b._id))
            {
                return(false);
            }
            if (!(a._final_flag == b._final_flag))
            {
                return(false);
            }
            if (!(a._childCount == b._childCount))
            {
                return(false);
            }
            if (!(a._labeling == b._labeling))
            {
                return(false);
            }
            if (!NULL_OR_EQUALID(a._parent, b._parent))
            {
                return(false);
            }
            if (!NULL_OR_EQUALID(a._olderBrother, b._olderBrother))
            {
                return(false);
            }
            if (!NULL_OR_EQUALID(a._youngerBrother, b._youngerBrother))
            {
                return(false);
            }
            if (!NULL_OR_EQUALID(a._oldestChild, b._oldestChild))
            {
                return(false);
            }
            if (!NULL_OR_EQUALID(a._youngestChild, b._youngestChild))
            {
                return(false);
            }

            return(true);
        }
Example #8
0
        /**
         * Equality operator.
         */
        public static bool operator ==(SafraTree one, SafraTree other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            if (other.MAX_NODES != one.MAX_NODES)
            {
                return(false);
            }

            for (int i = 0; i < one.MAX_NODES; i++)
            {
                if (one._nodes[i] == null)
                {
                    if (other._nodes[i] != null)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (other._nodes[i] == null)
                    {
                        return(false);
                    }

                    if (!(one._nodes[i] == other._nodes[i]))
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Example #9
0
        /**
         * Equality check.
         * @param other the other APSet
         * @return <b>true</b> if this and the other APSet are equal
         */
        public static bool operator ==(APSet one, APSet other)
        {
            bool?val = Ultility.NullCheck(one, other);

            if (val != null)
            {
                return(val.Value);
            }

            if (one.size() != other.size())
            {
                return(false);
            }

            for (int i = 0; i < one.size(); i++)
            {
                if (!(one.getAP(i) == other.getAP(i)))
                {
                    return(false);
                }
            }

            return(true);
        }