/// <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)); }
/// <summary> /// Опеределяет, совпадают ли значения двух матриц <see cref="BinaryRelationMatrix" /> /// </summary> /// <param name="other"></param> /// <returns></returns> protected bool Equals(BinaryRelationMatrix other) { return(Equals(matrix, other.matrix)); }