Ejemplo n.º 1
0
            /// <summary>
            ///     Осуществляет алгебраическое произведение двух матриц
            /// </summary>
            /// <param name="First"></param>
            /// <param name="Second"></param>
            /// <returns></returns>
            public static BinaryRelationMatrix Multiply(BinaryRelationMatrix First, BinaryRelationMatrix Second)
            {
                byte Length = First.Size;

                bool[,] answer = new bool[Length, Length];
                for (int i = 0; i < Length; i++)
                {
                    for (int j = 0; j < Length; j++)
                    {
                        for (int k = 0; k < Length && !answer[i, j]; k++)
                        {
                            answer[i, j] = First[i, k] && Second[k, j];
                        }
                    }
                }

                return(new BinaryRelationMatrix(answer));
            }
Ejemplo n.º 2
0
 /// <summary>
 ///     Опеределяет, совпадают ли значения двух матриц <see cref="BinaryRelationMatrix" />
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 protected bool Equals(BinaryRelationMatrix other)
 {
     return(Equals(matrix, other.matrix));
 }