//开始分析 private void btn_Analyst_Click(object sender, EventArgs e) { m_sceneControl.Action = SuperMap.UI.Action3D.CreatePoint; if (m_skyline == null) { m_skyline = this.CreateSkyline(); } Camera camera = m_sceneControl.Scene.FirstPersonCamera; m_skyline.ViewerPosition = new Point3D(camera.Longitude, camera.Latitude, camera.Altitude); m_skyline.Direction = camera.Heading; m_skyline.Pitch = camera.Tilt - 90; m_skyline.Color = m_skylineColor; m_skyline.SetViewerVisible(m_bShowObserverPoint); updateObserverPosition(m_skyline); this.RegisterEventsForSkyline(false); this.RegisterEventsForSkyline(true); this.btn_Analyst.Enabled = false; this.btn_ClearResult.Enabled = true; this.gb_HeightLimit.Enabled = true; this.btn_HeightLimit.Enabled = true; this.btn_DeleteLimit.Enabled = false; this.btn_StopDrawLimit.Enabled = false; this.btn_FlyToViewer.Enabled = true; }
public static void Main(string[] args) { Skyline o1 = new Skyline(1, 5, 6); Skyline o2 = new Skyline(4, 10, 4); Skyline o3 = new Skyline(8, 20, 2); Skyline o4 = new Skyline(30, 40, 5); Skyline o5 = new Skyline(38, 60, 10); Skyline o6 = new Skyline(42, 44, 5); List <Skyline> arr = new List <Skyline>(); arr.Add(o1); arr.Add(o2); arr.Add(o3); arr.Add(o4); arr.Add(o5); arr.Add(o6); List <Skyline> res = drawSkyline(arr, 0, arr.Count - 1); foreach (Skyline obj in res) { Console.WriteLine(obj.s + "," + obj.e + "," + obj.h); } Console.ReadLine(); }
//更新天际线分析观察点 private void updateObserverPosition(Skyline skyline) { this.numericUpDown_X.Value = Convert.ToDecimal(skyline.ViewerPosition.X); this.numericUpDown_Y.Value = Convert.ToDecimal(skyline.ViewerPosition.Y); this.numericUpDown_Height.Value = Convert.ToDecimal(skyline.ViewerPosition.Z); this.numeric_Direction.Value = Convert.ToDecimal(skyline.Direction); this.numeric_Pitch.Value = Convert.ToDecimal(skyline.Pitch); }
private Skyline CreateSkyline() { Skyline skyline = new Skyline(m_sceneControl.Scene); skyline.Quality = m_quality; skyline.DisplayStyle = m_displayMode; skyline.SetViewerVisible(m_bShowObserverPoint); skyline.Build(); return(skyline); }
public static void mergeOverlappingSkyline(List <Skyline> merged, Skyline left, Ref l, Skyline right, Ref r) { if (left.e <= right.e) { if (left.h > right.h) { if (left.e == right.e) { r.value++; } else { merged.Add(left); l.value++; right.s = left.e; } } else if (left.h == right.h) { l.value++; right.s = left.s; } else {//left.h < right.h if (left.s != right.s) { merged.Add(new Skyline(left.s, right.s, left.h)); } l.value++; } } else //left.e > right.e { if (left.h >= right.h) { r.value++; } else { if (left.s != right.s) { merged.Add(new Skyline(left.s, right.s, left.h)); } merged.Add(right); left.s = right.e; r.value++; } } }
//检查场景中是否存在天际线分析,如果有,移除 private void clearSkylineAnalysis() { this.numeric_Direction.Value = 0;; this.numeric_Pitch.Value = 0; this.numericUpDown_X.Value = 0; this.numericUpDown_Y.Value = 0; this.numericUpDown_Height.Value = 0; m_sceneControl.Scene.TrackingLayer.Clear(); if (m_skyline != null) { m_skyline.Clear(); m_skyline = null; } }
static void Main(string[] args) { // StringProblems //Test calls for Reverse string string input = "jacob"; Console.WriteLine(input + "<=>" + new string(SimpleProblem.ReverseString(input.ToCharArray()))); input = "jake"; Console.WriteLine(input + "<=>" + new string(SimpleProblem.ReverseString(input.ToCharArray()))); input = ""; Console.WriteLine(input + "<=>" + new string(SimpleProblem.ReverseString(input.ToCharArray()))); input = "jdshjdh@#$%^&)"; Console.WriteLine(input + "<=>" + new string(SimpleProblem.ReverseString(input.ToCharArray()))); ReplaceSpaces.TestReplaceSpacesInplace(); Anagrams.TestIsAnagramAlgo(); StringRotation.TestIsThisRotatedString(); RemoveDuplicates.TestRemoveDuplicatesFromString(); StringToLongConverter.TestStringToLong(); RegexMatching.TestMatch(); SumOfTwoNumbersInArray.TestSumOfTwoNumbersInArray(); SumOfThreeNumbersInArray.TestSumOfThreeNumbersInArray(); PairInSortedArrayClosestToAParticularValue.TestPairInSortedArrayClosestToAParticularValue(); PalindromeInStringPermutation.TestPalindromeInStringPermutation(); EditDistanceBetweenStrings.TestEditDistanceBetweenStrings(); AnagramIsPalindrome.TestAnagramIsPalindrome(); GreatestPalindrome.TestGreatestPalindrome(); ReverseStringWithoutVowels.TestReverseStringWithoutVowels(); LongestSubstringWithKDistinctChars.TestLongestSubstringWithKDistinctChars(); // Pattern Matching NativePatternMatching.TestNativePatternMatching(); KMPPatternMatching.TestKMPPatternMatching(); BoyerMoorePatternMatching.TestPatternMatching(); RabinKarp.TestRabinKarp(); //Console.ReadLine(); //Array Problems ArrayOfNumsIncrement.TestIncrementArrayOfNumbers(); MajorityElement.TestFindMajorityElement(); Merge2SortedArrays.TestMergeSortedArrays(); MaxDistanceInArray.TestMaxDistanceInArray(); MovingAverage.TestMovingAverage(); TotalAverage.TestTotalAverage(); ArrayWithGreaterElementToRight.TestArrayWithGreaterElementToRight(); WaterCollectedInPuddleShownByHistogram.TestWaterCollectedInPuddleShownByHistogram(); CountOfPairsWhichSumUpToGivenSum.TestCountOfPairsWhichSumUpToGivenSum(); //Median.TestGetMedianOf2SortedArray(); // Sorting Problems SelectionSort.TestSorting(); BubbleSort.TestSorting(); InsertionSort.TestSorting(); ShellSort.TestSorting(); MergeSort.TestMergeSort(); QuickSort.TestQuickSort(); HeapSortTester.TestHeapSort(); CountingSort.TestSorting(); RadixSort.TestRadixSort(); DutchNationalFlag.TestDutchNationalFlag(); SortedSquares.TestSortedSquares(); // Matrix Problem Rotate_Matrix_90_degree.TestRotateMatrix(); Matrix_Column_Rows_0.TestMakeRowColZero1(); Matrix_Column_Rows_0.TestMakeRowColZero2(); RotateMatrix180.TestRotateMatrix180(); SumOfMatrixElementsFormedByRectangleWithCoordinates.TestSumOfMatrixElements(); SortedArrayFromSortedMatrix.TestSortedArrayFromSortedMatrix(); SearchWordInMatrix.TestSearchWordInMatrix(); MaxOnesInRow.TestMaxOnesInRow(); MatrixAsTriangle.TestMatrixAsTriangle(); MinRangeInMatrix.TestMinRangeInMatrix(); PrintMatrixAsSnake.TestPrintMatrixAsSnake(); PrintMatrixInSpiral.TestPrintMatrixInSpiral(); MaxSqAreaInBinaryMatrix.TestMaxRectAreaInBinaryMatrix(); TicTacToeWinner.TestTicTacToeWinner(); WaterfallCreation.TestWaterfallCreation(); // Linked list Problems DeleteLinkedListNode.TestDeleteFirstNode(); DeleteDuplicatesFromLinkedList.TestDeleteDuplicates(); NthLastElementOfLinkedList.TestNthLastNodeOfLinkedList(); DeleteNodeWithDirectReference.TestDeleteNode(); AddNumbers.TestAddNumbersRepresentedByLinkedList(); CopyLinkedListWithRandomNode.TestGetCopiedLinkedListWithRandomNode(); CommonElementInTwoLinkedList.TestCommonElement(); ReverseAdjacentNodesInLinkedList.TestReverseAdjacentNodes(); MergeSortedLinkedList.TestMerge(); CycleInLinkedList.TestStartOfCycleInLinkedList(); MedianForCircularLinkedList.TestGetMedian(); ReverseLinkedList.TestReverseLinkedList(); SortedCircularLinkedList.TestCircularLinkedList(); // stack and queue problem ThreeStackWithOneArray.TestThreeStackWithOneArray(); StackWithMinElement.TestStackWithMinElement(); StackOfPlates.TestStackOfPlates(); SortAStack.TestSortAStackAscending(); WellFormedExpression.TestWellFormedExpression(); QueueVia2Stack.TestQueueVia2Stack(); LRUCache.TestLRUCache(); EvaluatePrefixNotation.TestGetPrefixNotationResult(); EvaluateInflixNotation.TestGetInflixNotationResults(); EvaluatePostfixNotation.TestGetPostfixNotationResult(); TestCircularQueue.TestCircularQueueWithDifferentCases(); LargestAreaInHistogram.TestLargestAreaInHistogram(); TextEditerWithUndo.TestTextEditerWithUndo(); //Recursion Problem TowerOfHanoi.TestTowerOfHanoi(); MaxSumOfConsecutiveNums.TestMaxSumOfConsecutiveNums(); // Back tracking problems Sudoku.TestSudokuSolver(); HamiltonianCycle.TestHamiltonianCycle(); GraphColoringWithMColors.TestGraphColoringWithMColors(); MakeLargestIsland.TestMakeLargestIsland(); //Misc Problem MinNumOfCoins.TestMinNumOfCoins(); IsPrime.TestCheckPrime(); SquareRoot.TestCalculateSquareRoot(); CreditCardCheck.TestLuhnAlgo(); ExcelFirstRowConversion.TestCovertExcelColumnToLong(); Skyline.TestSkyline(); SumOfSquaresWithoutMultiplication.TestSumOfSquares(); MergeIntervals.TestMergeIntervals(); WidthOfCalendar.TestWidthOfCalendar(); JosephusProblem.TestJosephusProblem(); // Permutation and Combination problem ShuffleAList.TestFisherYatesAlgo(); CombinationsOfBinaryString.TestCombinationsOfBinaryString(); AllCombinationsOfString.TestAllCombinationsOfString(); AllPermutationsOfString.TestAllPermutationsOfString(); PhoneNumberToWords.TestPhoneNumberToWords(); AllNumbersInRangeWithDifferentDigits.TestAllNumbersInRangeWithDifferentDigits(); DivideSetIntoTwoEqualSetsWithMinSumDiff.TestDivideSetIntoTwoEqualSetsWithMinSumDiff(); PowerSet.TestPowerSet(); AllCombinationsOfParenthesis.TestAllCombinationsOfParenthesis(); GoodDiceRoll.TestGoodDiceRoll(); PermutationsOfValidTime.TestPermutationsOfValidTime(); // Tree Problems TreeFromExpression.TestCreateTreeFromExpression(); TestBinarySearchTree.TestDifferentOperationsOnBST(); AncestorOfTwoNodesInBST.TestAncestorOfTwoNodesInBST(); CheckBTisBST.TestCheckBTisBST(); MaxSumOnTreeBranch.TestMaxSum(); WalkTheTree.TestWalkTheTree(); SkewedBSTToCompleteBST.TestConvertSkewedBSTToCompleteBST(); CheckIfTheTreeIsBalanced.TestIsTreeBalanced(); LinkedListOfTreeNodesAtEachDepth.TestCreateLinkedListOfTreeNodesAtEachDepth(); PrintBinaryTreeNodeAtEachLevel.TestPrintBinaryTreeNodeAtEachLevel(); PrintBinaryTreeNodeAtEachLevelSpirally.TestPrintBinaryTreeNodeAtEachLevelSpirally(); TreeSubtreeOfAnother.TestMatchTree(); AncestorOfTwoNodesInBT.TestGetAncestorOfTwoNodesInBT(); AncestorOfMultiNodesInBT.TestAncestorOfMultiNodesInBT(); LinkedListFromLeavesOfBT.TestLinkedListFromLeavesOfBT(); ExteriorOfBT.TestPrintExteriorOfBT(); DepthOfTree.TestGetDepthOfTree(); TreeToColumns.TestTreeToColumns(); KthSmallestElementFromBST.TestKthSmallestElementFromBST(); MakeBSTFromPreOrder.TestMakeBSTFromPreOrder(); MirrorATree.TestMirrorATree(); CloneABTWithRandPointer.TestCloneABTWithRandPointer(); TreeWithInorderAndPreorder.TestTreeWithInorderAndPreorder(); TreeWithInorderAndPostorder.TestTreeWithInorderAndPostorder(); TreePathSumsToValue.TestTreePathSumsToValue(); AllPathInNArayTree.TestAllPathInNArayTree(); SerializeDeserializeBinaryTree.TestSerializeDeserializeBinaryTree(); SerializeDeserializeAnNaryTree.TestSerializeDeserializeAnNaryTree(); AncestorOfTwoNodesInNaryTree.TestAncestorOfTwoNodesInNaryTree(); AbsOfMaxAndSecondMaxDepthInBT.TestGetAbsOfMaxAndSecondMaxDepthInBT(); // Trie problems CreateAndSearchSimpleTrie.TestCreateAndSearchSimpleTrie(); // ToDo: have a problem of suffix trees ShortestPrefix.TestGetShortestPrefixNotPresentInStringSet(); // Dynamic Programming problems LongestCommonSubsequence.TestGetLongestCommonSubsequence(); LongestPalindromeSubString.TestGetLongestPalindromeSubString(); LongestPalindromicSubsequence.TestGetLongestPalindromicSubsequence(); MaximumAs.TestGetMaximumAs(); MinNumberOfJumps.TestGetMinimumNumberOfJumps(); LongestCommonSubString.TestGetLongestCommonSubString(); KnapSackProblem.TestGetTheMaximumValueWithLimitedWeight(); TreeCuttingProblem.TestGetTreeCuttingToMaximizeProfits(); WordBreaking.TestBreakTheWords(); DistanceOfWords.TestDistanceOfWords(); LongestIncreasingSubSequence.TestLongestIncreasingSubSequence(); MinCostPath.TestMinCostPath(); DifferentWaysForCoinChange.TestDifferentWaysForCoinChange(); MatrixMultiplication.TestMatrixMultiplication(); BinomialCoefficient.TestBinomialCoefficient(); BoxStacking.TestBoxStacking(); WordWrapping.TestWordWrapping(); MaxSubMatrixWithAllOnes.TestMaxSubMatrixWithAllOnes(); LongestSubStringWithEqualSum.TestLongestSubStringWithEqualSum(); PartitionArrayIntoEqualSumSets.TestPartitionArrayIntoEqualSumSets(); MaxSumRectangle.TestMaxSumRectangle(); RegularExpressionMatch.TestRegularExpressionMatch(); NumRepresentedByPerfectSquares.TestNumRepresentedByPerfectSquares(); LongestCommonSubsequenceInSameString.TestLongestCommonSubsequenceInSameString(); StringDecodeAsAlphabets.TestStringDecodeAsAlphabets(); BalloonBursting.TestBalloonBursting(); TravellingSalesmanProblem.TestTravellingSalesmanProblem(); MaxSumWithoutAdjacentElements.TestMaxSumWithoutAdjacentElements(); MaxPathThroughMatrix.TestMaxPathThroughMatrix(); BrickLaying.TestBrickLaying(); JobSchedullingWithConstraints.TestJobSchedullingWithConstraints(); EggDropMinTrials.TestEggDropMinTrials(); // Graph Problems ShortestPath.TestGetShortestPathBetween2Vertex(); CycleInDirectedGraph.TestIsCycleInDirectedGraph(); CycleInUnDirectedGraph.TestIsCycleInUnDirectedGraph(); SolveAMaze.TestSolveAMaze(); AllPathsGivenStartEndVertex.TestGetAllPathsInGraphFromStartVertexToEndVertex(); AllPaths.TestGetAllPathsInGraphFromStartVertex(); ColorVertices.TestColorVerticesWithDifferentColor(); CheckBipartiteGraph.TestCheckBipartiteGraph(); TransformOneWordToAnother.TestGetTransformation(); ConstraintsVerification.TestConstraintsVerification(); ExtendedContactsInSocialNetwork.TestComputeExtendedContacts(); CourseScheduling.TestCourseScheduling(); SnakeAndLadder.TestSnakeAndLadder(); IsGraphATree.TestIsGraphATree(); ReverseGraph.TestReverseGraph(); StronglyConnectedGraph.TestStronglyConnectedGraph(); ConnectedComponents.TestConnectedComponents(); ContinentalDivide.TestContinentalDivide(); CloneGraph.TestCloneGraph(); Wordament.TestWordament(); // ShortestPathAlgo FloydWarshall.TestFloydWarshall(); DijkstraAlgorithm.TestDijkstraAlgorithm(); BellmanFord.TestBellmanFord(); TravelFromLeftToRightInMatrix.TestTravelFromLeftToRightInMatrix(); HeuristicSearch.TestHeuristicSearch(); AStar.TestAStar(); ShortestPathWhenObstaclesRemoved.TestShortestPathWhenObstaclesRemoved(); ShortestDistanceFromRoomsToGates.TestShortestDistanceFromRoomsToGates(); //MaxFlow FordFulkersonEdmondKarp.TestFordFulkersonEdmondKarp(); MinCut.TestMinCut(); MaximumBipartiteMatching.TestMaximumBipartiteMatching(); //Minimum Spanning Tree KruskalAlgorithm.TestKruskalAlgorithm(); PrimsAlgorithm.TestPrimsAlgorithm(); //Heap problems BasicMaxHeap.TestMaxHeap(); BasicMinHeap.TestMinHeap(); TestMinHeapMap.DoTest(); TestPriorityQueue.Run(); MedianForAStreamOfNumbers.TestMedianForAStreamOfNumbers(); //DisjointSets TestingDisjointSet.Run(); //TestWeightedDisjointSetsWithPathCompression.Run(); // this runs slow, hence commenting it //Geometry ClosestPairOfPoints.TestClosestPairOfPoints(); RectangleIntersection.TestRectangleIntersection(); LineSegmentIntersection.TestLineSegmentIntersection(); ConvexHull.TestConvexHull(); KClosestPointToOrigin.TestKClosestPointToOrigin(); //Greedy Algorithm HuffmanCoding.TestHuffmanCoding(); //Randomized Algorithm RandomGeneration.TestRandomGeneration(); // Bit Algorithms IntHaveOppositeSigns.TestIntHaveOppositeSigns(); Parity.TestParity(); //Math Problem ZerosInFactorial.TestZerosInFactorial(); GetAllPrimeFactors.TestGetAllPrimeFactors(); NumberOfFactors.TestNumberOfFactors(); AllFactors.TestAllFactors(); MultiplyLongNumbers.TestMultiplyLongNumbers(); NextLargestPermutation.TestNextLargestPermutation(); AllPrimesTillN.TestAllPrimesTillN(); PascalsTriangle.TestPascalsTriangle(); SubtractLongNumbers.TestSubtractLongNumbers(); //Search problems SearchInSortedRotatedArray.TestSearchInSortedRotatedArray(); KClosestElementInArray.TestKClosestElementInArray(); SearchInSortedMatrix.TestSearchInSortedMatrix(); BinarySearchUnbounded.TestBinarySearchUnbounded(); LinkedListSublistSearch.TestLinkedListSublistSearch(); NoOfOccuranceInSortedArray.TestNoOfOccuranceInSortedArray(); GetSmallestInSortedRotatedArray.TestGetSmallestInSortedRotatedArray(); //Distributed algorithms KWayMerge.TestKWayMerge(); Console.ReadLine(); }
public void TestStorage() { double[,] matrix2 = { { 9, 0, 3, 0 }, { 0, 8, 0, 0 }, { 0, 2, 6, 0 }, { 1, 0, 0, 5 }, }; double[] vector2 = { 1, 2, 3, 4 }; //CSR CompressedSparseRows csr = new CompressedSparseRows(matrix2); double[] values = csr.Values; int[] colindices = csr.ColIndices; int[] rowoffsets = csr.RowOffsets; double[] actualValues = { 9, 3, 8, 2, 6, 1, 5 }; int[] actualColindices = { 0, 2, 1, 1, 2, 0, 3 }; int[] actualRowoffsets = { 0, 2, 3, 5, 7 }; double[] actualProduct2 = { 21, 16, 22, 21 }; Assert.Equal(values, actualValues); Assert.Equal(colindices, actualColindices); Assert.Equal(rowoffsets, actualRowoffsets); //COOrdinateListRowMajor COOrdinateListRowMajor rowCOO = new COOrdinateListRowMajor(matrix2); double[] valuesCOOrow = rowCOO.Values; int[] colindicesCOOrow = rowCOO.ColumnsArray; int[] rowoffsetsCOOrow = rowCOO.RowsArray; double[] actualValuesCOOrow = { 9, 3, 8, 2, 6, 1, 5 }; int[] actualColindicesCOOrow = { 0, 2, 1, 1, 2, 0, 3 }; int[] actualRowoffsetsCOOrow = { 0, 0, 1, 2, 2, 3, 3 }; Assert.Equal(valuesCOOrow, actualValuesCOOrow); Assert.Equal(colindicesCOOrow, actualColindicesCOOrow); Assert.Equal(rowoffsetsCOOrow, actualRowoffsetsCOOrow); //COOrdinateListColumnMajor COOrdinateListColumnMajor columnCOO = new COOrdinateListColumnMajor(matrix2); double[] valuesCOOcolumn = columnCOO.Values; int[] colindicesCOOcolumn = columnCOO.ColumnsArray; int[] rowoffsetsCOOcolumn = columnCOO.RowsArray; double[] actualValuesCOOcolumn = { 9, 1, 8, 2, 3, 6, 5 }; int[] actualColindicesCOOcolumn = { 0, 0, 1, 1, 2, 2, 3 }; int[] actualRowoffsetsCOOcolumn = { 0, 3, 1, 2, 0, 2, 3 }; Assert.Equal(valuesCOOcolumn, actualValuesCOOcolumn); Assert.Equal(colindicesCOOcolumn, actualColindicesCOOcolumn); Assert.Equal(rowoffsetsCOOcolumn, actualRowoffsetsCOOcolumn); //Banded Storage double[,] bandedmatrix = { { 21, 1, 0, 4, 0 }, { 1, 22, 2, 0, 0 }, { 0, 2, 23, 1, 3 }, { 4, 0, 1, 24, 2 }, { 0, 0, 3, 2, 25 }, }; BandedStorage bandedStore = new BandedStorage(); var bandedValues = bandedStore.BandedStorageMethod(bandedmatrix); double[,] actualBandedValues = { { 21, 22, 23, 24, 25 }, { 1, 2, 1, 2, 0 }, { 0, 0, 3, 0, 0 }, { 4, 0, 0, 0, 0 }, }; Assert.Equal(bandedValues, actualBandedValues); //PackedStorageLower double[,] lowerTriangleMatrix = { { 1, 0, 0, 0, 0 }, { 2, 3, 0, 0, 0 }, { 4, 5, 6, 0, 0 }, { 7, 8, 9, 10, 0 }, { 11, 12, 13, 14, 15 } }; double[,] upperTriangleMatrix = { { 1, 2, 3 }, { 0, 5, 7 }, { 0, 0, 8 } }; PackedStorageLower packedLow = new PackedStorageLower(); var lowerColumn = packedLow.ColumnMajorLayout(lowerTriangleMatrix); var lowerRow = packedLow.RowMajorLayout(lowerTriangleMatrix); PackedStorageUpper packedUp = new PackedStorageUpper(); var upperColumn = packedUp.ColumnMajorLayout(upperTriangleMatrix); var upperRow = packedUp.RowMajorLayout(upperTriangleMatrix); double[] actualPackedLowerColumn = { 1, 2, 4, 7, 11, 3, 5, 8, 12, 6, 9, 13, 10, 14, 15 }; double[] actualPackedLowerRow = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; double[] actualPackedUpperColumn = { 1, 2, 5, 3, 7, 8 }; double[] actualPackedUpperRow = { 1, 2, 3, 5, 7, 8 }; Assert.Equal(lowerColumn, actualPackedLowerColumn); Assert.Equal(lowerRow, actualPackedLowerRow); Assert.Equal(upperColumn, actualPackedUpperColumn); Assert.Equal(upperRow, actualPackedUpperRow); // SkyLine Storage double[,] skymatrix = { { 21, 1, 0, 4, 0 }, { 1, 22, 2, 0, 0 }, { 0, 2, 23, 1, 3 }, { 4, 0, 1, 24, 2 }, { 0, 0, 3, 2, 25 }, }; Skyline skyline = new Skyline(skymatrix, 2, 4); var valuesArray = skyline.ValuesArray; int[] diagOffsets = skyline.DiagOffsets; int[] actualDiagonals = { 0, 1, 3, 5, 9, 13 }; double value1 = skyline.Value; double[] actualValuesArray = { 21, 22, 1, 23, 2, 24, 1, 0, 4, 25, 2, 3 }; double actualValue1 = 3; Assert.Equal(diagOffsets, actualDiagonals); Assert.Equal(valuesArray, actualValuesArray); Assert.Equal(value1, actualValue1); }