public void IsSortedUtil() { Assert.That( OneThreeTwoFour.Begin().IsSortedUntil( OneThreeTwoFour.End(), IsIntLessThanInt).Index, Is.EqualTo(2)); }
public void PushHeap() { NativeArrayIterator <int> pushHeapIt = FourTwoThreeOne.Begin().Copy( FourTwoThreeOne.End(), arrLong.Begin()); pushHeapIt.SetCurrent(5); pushHeapIt = pushHeapIt.GetNext(); arrLong.Begin().PushHeap(pushHeapIt, IsIntLessThanInt); Assert.That(arrLong, Is.EqualTo(new[] { 5, 4, 3, 1, 2, 0, 0, 0 })); }
public void Merge() { Assert.That( arr.Begin().Merge( arr.End(), OneThreeThreeFour.Begin(), OneThreeThreeFour.End(), arrLong.Begin(), IsIntLessThanInt ).Index, Is.EqualTo(8)); Assert.That(arrLong, Is.EqualTo(new[] { 1, 1, 2, 2, 3, 3, 3, 4 })); }
public void Includes() { Assert.That( arr.Begin().Includes( arr.End(), TwoThree.Begin(), TwoThree.End(), IsIntLessThanInt), Is.True); }
public void PartitionCopy() { NativeArrayIterator <int> outResultTrue; NativeArrayIterator <int> outResultFalse; arr.Begin().PartitionCopy( arr.End(), arr2.Begin(), arr3.Begin(), IsIntEven, out outResultTrue, out outResultFalse ); Assert.That(outResultTrue.Index, Is.EqualTo(2)); Assert.That(outResultFalse.Index, Is.EqualTo(2)); Assert.That(arr, Is.EqualTo(new[] { 1, 2, 2, 3 })); Assert.That(arr2, Is.EqualTo(new[] { 2, 2, 0, 0 })); Assert.That(arr3, Is.EqualTo(new[] { 1, 3, 0, 0 })); }
public void PrevPermutation() { Assert.That( ThreeTwoOne.Begin().PrevPermutation( ThreeTwoOne.End(), IsIntLessThanInt), Is.True); Assert.That(ThreeTwoOne, Is.EqualTo(new[] { 3, 1, 2 })); Assert.That( ThreeTwoOne.Begin().PrevPermutation( ThreeTwoOne.End(), IsIntLessThanInt), Is.True); Assert.That(ThreeTwoOne, Is.EqualTo(new[] { 2, 3, 1 })); Assert.That( ThreeTwoOne.Begin().PrevPermutation( ThreeTwoOne.End(), IsIntLessThanInt), Is.True); Assert.That(ThreeTwoOne, Is.EqualTo(new[] { 2, 1, 3 })); Assert.That( ThreeTwoOne.Begin().PrevPermutation( ThreeTwoOne.End(), IsIntLessThanInt), Is.True); Assert.That(ThreeTwoOne, Is.EqualTo(new[] { 1, 3, 2 })); Assert.That( ThreeTwoOne.Begin().PrevPermutation( ThreeTwoOne.End(), IsIntLessThanInt), Is.True); Assert.That(ThreeTwoOne, Is.EqualTo(new[] { 1, 2, 3 })); Assert.That( ThreeTwoOne.Begin().PrevPermutation( ThreeTwoOne.End(), IsIntLessThanInt), Is.False); Assert.That(ThreeTwoOne, Is.EqualTo(new[] { 3, 2, 1 })); }
public void MakeHeap() { OneTwoThreeFour.Begin().Copy(OneTwoThreeFour.End(), arr2.Begin()); arr2.Begin().MakeHeap(arr2.End(), IsIntLessThanInt); Assert.That(arr2, Is.EqualTo(new[] { 4, 2, 3, 1 })); }
public void Copy() { Assert.That( arr.Begin().Copy(arr.IteratorAt(2), arr2.Begin()).Index, Is.EqualTo(2)); Assert.That(arr2, Is.EqualTo(new[] { 1, 2, 0, 0 })); }
public void GetAdvanced() { Assert.That(arr.Begin().GetAdvanced(1).GetCurrent(), Is.EqualTo(2)); }