本文整理汇总了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)));
}
示例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);
}
示例3: GetGreatestSetsInEmptyMatrix
public void GetGreatestSetsInEmptyMatrix()
{
Matrix matrix = new Matrix(3, 4);
var result = matrix.GetGreatestSets();
Assert.IsNotNull(result);
Assert.AreEqual(0, result.Count);
}
示例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));
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}