Example #1
0
        public bool Contains(FullDBM dbm)
        {
            Debug.Assert(Matrix[0] > 0 || (Matrix[0] == 0 && MatrixStrictness[0] == false));
            Debug.Assert(dbm.Matrix[0] > 0 || (dbm.Matrix[0] == 0 && dbm.MatrixStrictness[0] == false));
            Debug.Assert(IsCanonicalForm);
            Debug.Assert(dbm.IsCanonicalForm);
            Debug.Assert(dimention == dbm.dimention);

            if (dbm.IsEmpty)
            {
                return(true);
            }

            for (int i = 0; i != dimention; ++i)
            {
                for (int j = 0; j != dimention; ++j)
                {
                    if (Matrix[Pos(i, j)] < dbm.Matrix[Pos(i, j)])
                    {
                        return(false);
                    }
                    else if (Matrix[Pos(i, j)] == dbm.Matrix[Pos(i, j)])
                    {
                        if (MatrixStrictness[Pos(i, j)] == true && dbm.MatrixStrictness[Pos(i, j)] == false)
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// this method should be avoided as it seemed incorrect working with extrapolation
        /// </summary>
        /// <param name="myDBM"></param>
        public void Conjunction(FullDBM myDBM)
        {
            if (myDBM.IsEmpty)
            {
                return;
            }

            if (IsEmpty)
            {
                dimention        = myDBM.dimention;
                Matrix           = myDBM.Matrix;
                MatrixStrictness = myDBM.MatrixStrictness;
                IsCanonicalForm  = myDBM.IsCanonicalForm;

                ClockMaxValues   = myDBM.ClockMaxValues;
                ClockLowerValues = myDBM.ClockLowerValues;
                ClockUpperValues = myDBM.ClockUpperValues;
            }
            else if (!myDBM.IsEmpty)
            {
                System.Diagnostics.Debug.Assert(dimention == myDBM.dimention);

                //assert the dimention of the two dbm are same
                for (int i = 0; i < dimention; i++)
                {
                    for (int j = 0; j < dimention; j++)
                    {
                        if (Matrix[i * dimention + j] > myDBM.Matrix[i * dimention + j])
                        {
                            Matrix[i * dimention + j]           = myDBM.Matrix[i * dimention + j];
                            MatrixStrictness[i * dimention + j] = myDBM.MatrixStrictness[i * dimention + j];
                        }
                        else if (Matrix[i * dimention + j] == myDBM.Matrix[i * dimention + j])
                        {
                            MatrixStrictness[i * dimention + j] = MatrixStrictness[i * dimention + j] || myDBM.MatrixStrictness[i * dimention + j];
                        }
                    }
                }

                IsCanonicalForm = false;
            }
        }
Example #3
0
        public void Conjunction(FullDBM myDBM)
        {
            if (myDBM.IsEmpty)
            {
                return;
            }

            if (IsEmpty)
            {
                Matrix = myDBM.Matrix;
                //MatrixStrictness = myDBM.MatrixStrictness;
                IsCanonicalForm = myDBM.IsCanonicalForm;
            }
            else if (!myDBM.IsEmpty)
            {
                //assert the dimention of the two dbm are same
                //int dimention = Matrix.Count;
                for (int i = 0; i < dimention; i++)
                {
                    //int myith = i + 1;
                    //int ith = TimerArray.IndexOf(myDBM.TimerArray[i]) + 1;

                    for (int j = 0; j < dimention; j++)
                    {
                        //int myjth = j + 1;
                        //int jth = TimerArray.IndexOf(myDBM.TimerArray[j]) + 1;

                        if (Matrix[i * dimention + j] > myDBM.Matrix[i * dimention + j])
                        {
                            Matrix[i * dimention + j] = myDBM.Matrix[i * dimention + j];
                            //MatrixStrictness[i* dimention + j] = myDBM.MatrixStrictness[i* dimention + j];
                        }
                        //else if (Matrix[i* dimention + j] == myDBM.Matrix[i* dimention + j])
                        //{
                        //    MatrixStrictness[i* dimention + j] = MatrixStrictness[i* dimention + j] || myDBM.MatrixStrictness[i* dimention + j];
                        //}
                    }
                }

                IsCanonicalForm = false;
            }
        }
Example #4
0
        public bool Contains(FullDBM dbm)
        {
            Debug.Assert(Matrix[0] > 0 || (Matrix[0] == 0 && MatrixStrictness[0] == false));
            Debug.Assert(dbm.Matrix[0] > 0 || (dbm.Matrix[0] == 0 && dbm.MatrixStrictness[0] == false));
            Debug.Assert(IsCanonicalForm);
            Debug.Assert(dbm.IsCanonicalForm);
            Debug.Assert(dimention == dbm.dimention);

            if (dbm.IsEmpty)
            {
                return true;
            }

            for (int i = 0; i != dimention; ++i)
            {
                for (int j = 0; j != dimention; ++j)
                {
                    if (Matrix[Pos(i, j)] < dbm.Matrix[Pos(i, j)])
                    {
                        return false;
                    }
                    else if (Matrix[Pos(i, j)] == dbm.Matrix[Pos(i, j)])
                    {
                        if (MatrixStrictness[Pos(i, j)] == true && dbm.MatrixStrictness[Pos(i, j)] == false)
                        {
                            return false;
                        }
                    }
                }
            }

            return true;
        }
Example #5
0
        /// <summary>
        /// this method should be avoided as it seemed incorrect working with extrapolation
        /// </summary>
        /// <param name="myDBM"></param>
        public void Conjunction(FullDBM myDBM)
        {
            if (myDBM.IsEmpty)
            {
                return;
            }

            if (IsEmpty)
            {
                dimention = myDBM.dimention;
                Matrix = myDBM.Matrix;
                MatrixStrictness = myDBM.MatrixStrictness;
                IsCanonicalForm = myDBM.IsCanonicalForm;

                ClockMaxValues = myDBM.ClockMaxValues;
                ClockLowerValues = myDBM.ClockLowerValues;
                ClockUpperValues = myDBM.ClockUpperValues;
            }
            else if (!myDBM.IsEmpty)
            {
                System.Diagnostics.Debug.Assert(dimention == myDBM.dimention);

                //assert the dimention of the two dbm are same
                for (int i = 0; i < dimention; i++)
                {
                    for (int j = 0; j < dimention; j++)
                    {
                        if (Matrix[i * dimention + j] > myDBM.Matrix[i * dimention + j])
                        {
                            Matrix[i * dimention + j] = myDBM.Matrix[i * dimention + j];
                            MatrixStrictness[i * dimention + j] = myDBM.MatrixStrictness[i * dimention + j];
                        }
                        else if (Matrix[i * dimention + j] == myDBM.Matrix[i * dimention + j])
                        {
                            MatrixStrictness[i * dimention + j] = MatrixStrictness[i * dimention + j] || myDBM.MatrixStrictness[i * dimention + j];
                        }
                    }
                }

                IsCanonicalForm = false;
            }
        }
Example #6
0
        public void Conjunction(FullDBM myDBM)
        {
            if (myDBM.IsEmpty)
            {
                return;
            }

            if (IsEmpty)
            {
                Matrix = myDBM.Matrix;
                //MatrixStrictness = myDBM.MatrixStrictness;
                IsCanonicalForm = myDBM.IsCanonicalForm;
            }
            else if (!myDBM.IsEmpty)
            {
                //assert the dimention of the two dbm are same
                //int dimention = Matrix.Count;
                for (int i = 0; i < dimention; i++)
                {
                    //int myith = i + 1;
                    //int ith = TimerArray.IndexOf(myDBM.TimerArray[i]) + 1;

                    for (int j = 0; j < dimention; j++)
                    {
                        //int myjth = j + 1;
                        //int jth = TimerArray.IndexOf(myDBM.TimerArray[j]) + 1;

                        if (Matrix[i * dimention + j] > myDBM.Matrix[i * dimention + j])
                        {
                            Matrix[i * dimention + j] = myDBM.Matrix[i * dimention + j];
                            //MatrixStrictness[i* dimention + j] = myDBM.MatrixStrictness[i* dimention + j];
                        }
                        //else if (Matrix[i* dimention + j] == myDBM.Matrix[i* dimention + j])
                        //{
                        //    MatrixStrictness[i* dimention + j] = MatrixStrictness[i* dimention + j] || myDBM.MatrixStrictness[i* dimention + j];
                        //}
                    }
                }

                IsCanonicalForm = false;
            }
        }