当前位置: 首页>>代码示例>>C#>>正文


C# Matrix.GetGreatestSets方法代码示例

本文整理汇总了C#中System.Matrix.GetGreatestSets方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix.GetGreatestSets方法的具体用法?C# Matrix.GetGreatestSets怎么用?C# Matrix.GetGreatestSets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Matrix的用法示例。


在下文中一共展示了Matrix.GetGreatestSets方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetGreatestSetsInDiagonalMatrix

        public void GetGreatestSetsInDiagonalMatrix()
        {
            Matrix matrix = new Matrix("1000", "0100", "0010", "0001");

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(4, result.Count);
            Assert.IsTrue(result.All(l => l.Count == 1));
            Assert.IsTrue(result.All(l => l[0].X == l[0].Y));
            Assert.IsTrue(result.All(l => l.All(c => c.Value)));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:12,代码来源:MatrixTests.cs

示例2: GetGreatestSetInFirstRow

        public void GetGreatestSetInFirstRow()
        {
            Matrix matrix = new Matrix("1110", "0000", "0000");

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(3, result[0].Count);
            Assert.IsTrue(result[0].All(c => c.Y == 0));
            Assert.IsTrue(result[0][0].X == 0);
            Assert.IsTrue(result[0][1].X == 1);
            Assert.IsTrue(result[0][2].X == 2);
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:14,代码来源:MatrixTests.cs

示例3: GetGreatestSetsInEmptyMatrix

        public void GetGreatestSetsInEmptyMatrix()
        {
            Matrix matrix = new Matrix(3, 4);

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(0, result.Count);
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:9,代码来源:MatrixTests.cs

示例4: GetTwoSpareSquareSetSizeFour

        public void GetTwoSpareSquareSetSizeFour()
        {
            Matrix matrix = new Matrix("0101", "1010", "0101", "1010");

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count);
            Assert.IsTrue(result.All(l => l.Count == 4));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:10,代码来源:MatrixTests.cs

示例5: GetSquareSetSizeFour

        public void GetSquareSetSizeFour()
        {
            Matrix matrix = new Matrix("1100", "1100", "1000");

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(4, result[0].Count);
            Assert.IsTrue(result[0][0].X == 0);
            Assert.IsTrue(result[0][0].Y == 0);
            Assert.IsTrue(result[0][1].X == 1);
            Assert.IsTrue(result[0][1].Y == 0);
            Assert.IsTrue(result[0][2].X == 1);
            Assert.IsTrue(result[0][2].Y == 1);
            Assert.IsTrue(result[0][3].X == 0);
            Assert.IsTrue(result[0][3].Y == 1);
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:18,代码来源:MatrixTests.cs

示例6: GetSpareSquareSetSizeFour

        public void GetSpareSquareSetSizeFour()
        {
            Matrix matrix = new Matrix("0101", "0000", "0101");

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(4, result[0].Count);
            Assert.IsTrue(result[0].All(c => c.X == 1 || c.X == 3));
            Assert.IsTrue(result[0].All(c => c.Y == 0 || c.Y == 2));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:12,代码来源:MatrixTests.cs

示例7: GetRectangularSetSizeSix

        public void GetRectangularSetSizeSix()
        {
            Matrix matrix = new Matrix("1100", "1100", "1100");

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(6, result[0].Count);
            Assert.IsTrue(result[0].All(c => c.X >= 0 && c.X <= 1));
            Assert.IsTrue(result[0].All(c => c.Y >= 0 && c.Y <= 2));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:12,代码来源:MatrixTests.cs

示例8: GetGreatestSetsInMatrixWithOneTrue

        public void GetGreatestSetsInMatrixWithOneTrue()
        {
            Matrix matrix = new Matrix(3, 4);
            matrix.Set(0, 0, true);

            var result = matrix.GetGreatestSets();

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(1, result[0].Count);
            Assert.AreEqual(0, result[0][0].X);
            Assert.AreEqual(0, result[0][0].Y);
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:13,代码来源:MatrixTests.cs


注:本文中的System.Matrix.GetGreatestSets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。