 # Seqs

### Related Doc: package util

#### object Seqs

Linear Supertypes
AnyRef, Any
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. Seqs
2. AnyRef
3. Any
1. Hide All
2. Show all
Visibility
1. Public
2. All

### Value Members

1. #### final def !=(arg0: Any): Boolean

Definition Classes
AnyRef → Any
2. #### final def ##(): Int

Definition Classes
AnyRef → Any
3. #### final def ==(arg0: Any): Boolean

Definition Classes
AnyRef → Any
4. #### final def asInstanceOf[T0]: T0

Definition Classes
Any
5. #### def binIntersect[A, B](aEls: Iterator[A], bEls: IndexedSeq[B], compare: (A, B) ⇒ Int): Iterator[(A, B)]

Compute the intersection of two sequences in (strictly) ascending order.

Compute the intersection of two sequences in (strictly) ascending order. The procedure uses binary search on the second list, and should in particular perform well if the second list is much bigger than the first list. `compare` should return a negative number of the `a` argument is smaller than the `b` argument, a positive number if `a` argument is bigger than `b`, `0` otherwise.

6. #### def binSearch[T](seq: IndexedSeq[T], begin: Int, end: Int, wanted: T)(implicit ord: Ordering[T]): BS_Result

Binary search for an element in a sorted random-access sequent.

Binary search for an element in a sorted random-access sequent. The result is either `Found(i)`, where `i` is the index of some occurrence of `wanted` in `seq`, or `NotFound(i)`, where `i` is the index of the next-bigger element in `seq`. Note, that elements are never compared with ```==, only with (a compare b) == 0 ```

``` ```
7. ``` def clone(): AnyRef Attributesprotected[java.lang] Definition ClassesAnyRefAnnotations @throws( ... ) ```
8. ``` def computeHashCode[A](a: Iterable[A], init: Int, multiplier: Int): Int ```
9. ``` def computeHashCode[A](a: Iterator[A], init: Int, multiplier: Int): Int Compute a polynomial hashcode for a sequence of things ```
10. ``` def count[A](els: Iterator[A], p: (A) ⇒ Boolean): Int ```
11. ``` def count[A](els: Iterable[A], p: (A) ⇒ Boolean): Int ```
12. ``` def diff[A](newSeq: IndexedSeq[A], oldSeq: IndexedSeq[A])(implicit ord: Ordering[A]): (IndexedSeq[A], IndexedSeq[A]) ```

```Given to sequences that are totally sorted in the same descending order, determine those elements in newSeq that also occur in oldSeq, and those elements in newSeq that do not occur in oldSeq.```

Given to sequences that are totally sorted in the same descending order, determine those elements in `newSeq` that also occur in `oldSeq`, and those elements in `newSeq` that do not occur in `oldSeq`.

13. #### def diff3[A](seq0: IndexedSeq[A], seq1: IndexedSeq[A])(implicit ord: Ordering[A]): (IndexedSeq[A], IndexedSeq[A], IndexedSeq[A])

Given to sequences that are totally sorted in the same descending order, determine those elements that only occur in `seq0`, those that occur in both sequences, and those that only occur in `seq1`.

Given to sequences that are totally sorted in the same descending order, determine those elements that only occur in `seq0`, those that occur in both sequences, and those that only occur in `seq1`.

14. #### def disjoint[A](a: Set[A], b: Set[A], c: Set[A]): Boolean

Determine whether 3 given sets have any elements in common

20. #### def doubleIterator[A](a: A, b: A): Iterator[A]

Iterator over exactly two elements

21. #### final def eq(arg0: AnyRef): Boolean

Definition Classes
AnyRef
22. #### def equals(arg0: Any): Boolean

Definition Classes
AnyRef → Any
23. #### def filterAndSort[A](it: Iterator[A], skipEl: (A) ⇒ Boolean, badEl: (A) ⇒ Boolean, trafo: (A) ⇒ A, comesBefore: (A, A) ⇒ Boolean)(implicit arg0: ClassTag[A]): FAS_RESULT[A]

Filter a sequence of objects in order to detect the existence of certain bad objects (`badEl`) and to remove certain unnecessary objects (`skipEl`).

Filter a sequence of objects in order to detect the existence of certain bad objects (`badEl`) and to remove certain unnecessary objects (`skipEl`). If a bad element is found, `FoundBadElement` is returned, otherwise a sorted array with the elements that were kept is created and returned.

24. #### def finalize(): Unit

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
25. #### def findDuplicates[A](els: Iterator[A]): Set[A]

Determine all elements that occur in more than one of the given collections

26. #### final def getClass(): Class[_]

Definition Classes
AnyRef → Any
27. #### def hashCode(): Int

Definition Classes
AnyRef → Any
28. #### def identicalSeqs[A <: AnyRef](a: Iterable[A], b: Iterable[A]): Boolean

Determine whether the two given sequences/iterables contain reference-identical objects.

29. #### final def isInstanceOf[T0]: Boolean

Definition Classes
Any

32. #### def lexCombineInts(int1: Int, int2: ⇒ Int): Int

Interpret the given integers as results of a `compare` function (negative, zero, positive for less, equal, greater) and combine them lexicographically

Interpret the given integers as results of a `compare` function (negative, zero, positive for less, equal, greater) and combine them lexicographically

33. #### def lexCompare[T](it1: Iterator[T], it2: Iterator[T])(implicit ord: Ordering[T]): Int

Lexicographic comparison of two lists of things

35. #### def max[A, B](it: Iterator[A], measure: (A) ⇒ B)(implicit arg0: (B) ⇒ Ordered[B]): A

Determine a maximum element of a sequence of things under a given measure

36. #### def max(els: Iterable[Int]): Int

Compute the maximum of a sequence of ints.

Compute the maximum of a sequence of ints. If the sequence is empty, `0` is returned

37. #### def max(it: Iterator[Int]): Int

Compute the maximum of a sequence of ints.

Compute the maximum of a sequence of ints. If the sequence is empty, `0` is returned

38. #### def mergeSortedSeqs[A](aIt: Iterator[A], bIt: Iterator[A])(implicit ord: Ordering[A]): IndexedSeq[A]

Merge two sequences that are sorted in strictly descending order and produce a descending sequence with all elements occurring in at least one of the sequences

39. #### def mergeSortedSeqs[A](a: IndexedSeq[A], b: IndexedSeq[A])(implicit ord: Ordering[A]): IndexedSeq[A]

Merge two sequences that are sorted in strictly descending order and produce a descending sequence with all elements occurring in at least one of the sequences

40. #### def min[A, B](it: Iterator[A], measure: (A) ⇒ B)(implicit arg0: (B) ⇒ Ordered[B]): A

Determine a minimum element of a sequence of things under a given measure

41. #### def min[A, B](it: Iterable[A], measure: (A) ⇒ B)(implicit arg0: (B) ⇒ Ordered[B]): A

Determine a minimum element of a sequence of things under a given measure

42. #### def min(it: Iterator[Int]): Int

Compute the minimum of a sequence of ints.

Compute the minimum of a sequence of ints. If the sequence is empty, `0` is returned

44. #### final def ne(arg0: AnyRef): Boolean

Definition Classes
AnyRef
45. #### final def notify(): Unit

Definition Classes
AnyRef
46. #### final def notifyAll(): Unit

Definition Classes
AnyRef
47. #### def optionMax(a: Option[IdealInt], b: Option[IdealInt]): Option[IdealInt]

Max on optional integers

48. #### def optionMin(a: Option[IdealInt], b: Option[IdealInt]): Option[IdealInt]

Min on optional integers

49. #### def optionSum(vals: Iterator[Option[Int]]): Option[Int]

Return the sum of the given numbers if all numbers are defined, `None` otherwise.

Return the sum of the given numbers if all numbers are defined, `None` otherwise.

50. #### def partialMinBy[A, B](it: Iterator[A], f: (A) ⇒ B)(implicit cmp: PartialOrdering[B]): A

Determine a minimum element of a sequence of things under a given measure

51. #### def prepend[A](els: Iterable[A], l: List[A]): List[A]

Prepend some elements in front of a list

52. #### def reduceLeft[A](els: Iterable[A], f: (A, A) ⇒ A): Option[A]

reduceLeft that also works for empty sequences

53. #### def reduceLeft[A](els: Iterator[A], f: (A, A) ⇒ A): Option[A]

reduceLeft that also works for empty sequences

54. #### def removeDuplicates[A](s: IndexedSeq[A]): IndexedSeq[A]

Remove all duplicates from a sorted sequence.

Remove all duplicates from a sorted sequence. It is assumed that duplicates can only occur immediately following each other

55. #### def risingEdge[A](ar: IndexedSeq[A], p: (A) ⇒ Boolean): Int

Find the first index `ind` with `p(ar(ind))`; return `0` if `p` is `true` on the whole sequence, and `end` if `p` is `false` on the whole sequence.

Find the first index `ind` with `p(ar(ind))`; return `0` if `p` is `true` on the whole sequence, and `end` if `p` is `false` on the whole sequence.

`p` has to be monotonic on `ar`, i.e., if `p(ar(ind))` then `p(ar(ind + 1))`.

56. #### def risingEdgeBwd[A](ar: IndexedSeq[A], p: (A) ⇒ Boolean, start: Int): Int

Going backward, find the first index `ind` in the range `[0, start)` with `p(ar(ind))`; return `0` if `p` is `true` on `[0, start)`, and `start` if `p` is `false` on `[0, start)`.

Going backward, find the first index `ind` in the range `[0, start)` with `p(ar(ind))`; return `0` if `p` is `true` on `[0, start)`, and `start` if `p` is `false` on `[0, start)`.

`p` has to be monotonic on `ar`, i.e., if `p(ar(ind))` then `p(ar(ind + 1))`.

57. #### def risingEdgeBwdFull[A](ar: IndexedSeq[A], p: (A) ⇒ Boolean, start: Int, begin: Int): Int

Going backward, find the first index `ind` in the range `[begin, start)` with `p(ar(ind))`; return `begin` if `p` is `true` on `[begin, start)`, and `start` if `p` is `false` on `[begin, start)`.

Going backward, find the first index `ind` in the range `[begin, start)` with `p(ar(ind))`; return `begin` if `p` is `true` on `[begin, start)`, and `start` if `p` is `false` on `[begin, start)`.

`p` has to be monotonic on `ar`, i.e., if `p(ar(ind))` then `p(ar(ind + 1))`.

58. #### def risingEdgeFull[A](ar: IndexedSeq[A], p: (A) ⇒ Boolean, begin: Int, end: Int): Int

Find the first index `ind` in the range `[begin, end)` with `p(ar(ind))`; return `begin` if `p` is `true` on `[begin, end)`, and `end` if `p` is `false` on `[begin, end)`.

Find the first index `ind` in the range `[begin, end)` with `p(ar(ind))`; return `begin` if `p` is `true` on `[begin, end)`, and `end` if `p` is `false` on `[begin, end)`.

`p` has to be monotonic on `ar`, i.e., if `p(ar(ind))` then `p(ar(ind + 1))`.

59. #### def risingEdgeFwd[A](ar: IndexedSeq[A], p: (A) ⇒ Boolean, start: Int): Int

Going forward, find the first index `ind` in the range `[start, ar.size)` with `p(ar(ind))`; return `start` if `p` is `true` on `[start, ar.size)`, and `ar.size` if `p` is `false` on `[start, ar.size)`.

Going forward, find the first index `ind` in the range `[start, ar.size)` with `p(ar(ind))`; return `start` if `p` is `true` on `[start, ar.size)`, and `ar.size` if `p` is `false` on `[start, ar.size)`.

`p` has to be monotonic on `ar`, i.e., if `p(ar(ind))` then `p(ar(ind + 1))`.

60. #### def risingEdgeFwdFull[A](ar: IndexedSeq[A], p: (A) ⇒ Boolean, start: Int, end: Int): Int

Going forward, find the first index `ind` in the range `[start, end)` with `p(ar(ind))`; return `start` if `p` is `true` on `[start, end)`, and `end` if `p` is `false` on `[start, end)`.

Going forward, find the first index `ind` in the range `[start, end)` with `p(ar(ind))`; return `start` if `p` is `true` on `[start, end)`, and `end` if `p` is `false` on `[start, end)`.

`p` has to be monotonic on `ar`, i.e., if `p(ar(ind))` then `p(ar(ind + 1))`.

61. #### def so2os[T](l: Seq[Option[T]]): Option[Seq[T]]

Convert a sequence of options to an optional sequence.

63. #### def some[A](vals: Iterator[Option[A]]): Option[A]

Return the first `Some(x)` of the given sequence, or `None` if none exists

Return the first `Some(x)` of the given sequence, or `None` if none exists

64. #### def split[A](els: Iterator[A], firstKind: (A) ⇒ Boolean): (Vector[A], Vector[A])

Split a sequence of things into two sequences, one with all the elements for which certain predicate holds, and one with the elements for which the predicate does not hold

65. #### def subSeq[A](a: Iterator[A], aFilter: Set[A], b: Iterator[A]): Boolean

Determine whether `a` occurs in `b` as a sub-sequence

Determine whether `a` occurs in `b` as a sub-sequence

66. #### def subSeq[A](a: Iterator[A], b: Iterator[A]): Boolean

Determine whether `a` occurs in `b` as a sub-sequence

Determine whether `a` occurs in `b` as a sub-sequence

67. #### final def synchronized[T0](arg0: ⇒ T0): T0

Definition Classes
AnyRef

69. #### def toStream[A](f: (Int) ⇒ A): Stream[A]

Lazily convert a function (over naturals) to a stream

70. #### def toString(): String

Definition Classes
AnyRef → Any
71. #### def tripleIterator[A](a: A, b: A, c: A): Iterator[A]

Iterator over exactly three elements

72. #### def union[A](sets: Iterator[Set[A]]): Set[A]

Compute union of a sequence of sets.

73. #### def union[A](sets: Iterable[Set[A]]): Set[A]

Compute union of a sequence of sets.

74. #### final def wait(): Unit

Definition Classes
AnyRef
Annotations
@throws( ... )
75. #### final def wait(arg0: Long, arg1: Int): Unit

Definition Classes
AnyRef
Annotations
@throws( ... )
76. #### final def wait(arg0: Long): Unit

Definition Classes
AnyRef
Annotations
@throws( ... )