Object

ap.util

Seqs

Related Doc: package util

Permalink

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

Type Members

  1. abstract class BS_Result extends AnyRef

    Permalink
  2. abstract class FAS_RESULT[+A] extends AnyRef

    Permalink
  3. case class FilteredSorted[A](res: Array[A]) extends FAS_RESULT[A] with Product with Serializable

    Permalink
  4. case class Found(index: Int) extends BS_Result with Product with Serializable

    Permalink
  5. case class FoundBadElement[A](badElement: A) extends FAS_RESULT[A] with Product with Serializable

    Permalink
  6. case class NotFound(nextBiggerElement: Int) extends BS_Result with Product with Serializable

    Permalink

Value Members

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

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

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

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

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

    Permalink

    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

    Permalink

    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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def computeHashCode[A](a: Iterable[A], init: Int, multiplier: Int): Int

    Permalink
  9. def computeHashCode[A](a: Iterator[A], init: Int, multiplier: Int): Int

    Permalink

    Compute a polynomial hashcode for a sequence of things

  10. def count[A](els: Iterator[A], p: (A) ⇒ Boolean): Int

    Permalink
  11. def count[A](els: Iterable[A], p: (A) ⇒ Boolean): Int

    Permalink
  12. def diff[A](newSeq: IndexedSeq[A], oldSeq: IndexedSeq[A])(implicit ord: Ordering[A]): (IndexedSeq[A], IndexedSeq[A])

    Permalink

    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])

    Permalink

    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

    Permalink

    Determine whether 3 given sets have any elements in common

  15. def disjoint[A](a: Set[A], b: Set[A]): Boolean

    Permalink
  16. def disjointSeq[A](a1: Set[A], a2: Set[A], b: Iterator[A]): Boolean

    Permalink
  17. def disjointSeq[A](a1: Set[A], a2: Set[A], b: Iterable[A]): Boolean

    Permalink
  18. def disjointSeq[A](a: Set[A], b: Iterable[A]): Boolean

    Permalink
  19. def disjointSeq[A](a: Set[A], b: Iterator[A]): Boolean

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

    Permalink

    Iterator over exactly two elements

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

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

    Permalink
    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]

    Permalink

    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

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

    Permalink

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

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

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

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

    Permalink

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

  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. def lexCombineInts(int1: Int, _int2: ⇒ Int, _int3: ⇒ Int, _int4: ⇒ Int): Int

    Permalink
  31. def lexCombineInts(int1: Int, _int2: ⇒ Int, _int3: ⇒ Int): Int

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

    Permalink

    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

    Permalink

    Lexicographic comparison of two lists of things

  34. def lexCompareOrdering[T](it1: Iterator[T], it2: Iterator[T])(implicit ord: Ordering[T]): Int

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

    Permalink

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

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

    Permalink

    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

    Permalink

    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]

    Permalink

    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]

    Permalink

    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

    Permalink

    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

    Permalink

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

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

    Permalink

    Compute the minimum of a sequence of ints.

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

  43. def minOption[A, B](it: Iterator[A], measure: (A) ⇒ Option[B])(implicit arg0: (B) ⇒ Ordered[B]): Option[A]

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

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

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

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

    Permalink

    Max on optional integers

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

    Permalink

    Min on optional integers

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

    Permalink

    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

    Permalink

    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]

    Permalink

    Prepend some elements in front of a list

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

    Permalink

    reduceLeft that also works for empty sequences

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

    Permalink

    reduceLeft that also works for empty sequences

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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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 some[A](vals: Iterable[Option[A]]): Option[A]

    Permalink
  62. def some[A](vals: Iterator[Option[A]]): Option[A]

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    Determine whether a occurs in b as a sub-sequence

    Determine whether a occurs in b as a sub-sequence

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

    Permalink

    Determine whether a occurs in b as a sub-sequence

    Determine whether a occurs in b as a sub-sequence

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

    Permalink
    Definition Classes
    AnyRef
  67. def toArray[A](els: Iterator[A])(implicit arg0: ClassTag[A]): Array[A]

    Permalink
  68. def toStream[A](f: (Int) ⇒ A): Stream[A]

    Permalink

    Lazily convert a function (over naturals) to a stream

  69. def toString(): String

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

    Permalink

    Iterator over exactly three elements

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

    Permalink

    Compute union of a sequence of sets.

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

    Permalink

    Compute union of a sequence of sets.

  73. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped