case class SequenceComp[T](v1: Vector[T], v2: Vector[T]) extends Product with Serializable
A class for comparing pairs of vectors.
- v1
First Vector to compare.
- v2
Second Vector to compare.
- Alphabetic
- By Inheritance
- SequenceComp
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
SequenceComp(v1: Vector[T], v2: Vector[T])
- v1
First Vector to compare.
- v2
Second Vector to compare.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
align(src1: Vector[T], src2: Vector[T], overlap: Vector[T], mashup: Vector[Pairing[T]]): Vector[Pairing[T]]
Recursively align two vectors against their supersequence.
Recursively align two vectors against their supersequence.
- src1
First Vector to align.
- src2
Second Vector to align.
- overlap
The Shortest Common Supersequence of src1 and src2.
- mashup
The cumulative alignment.
- Annotations
- @tailrec()
-
def
align: Vector[Pairing[T]]
Align vectors against their supersequence.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
insertSingles(src1: Vector[T], src2: Vector[T], overlap: Vector[T], mashup: Vector[T]): Vector[T]
Recursively insert unique elements from a pair of vectors into a vector of their common or overlapping elements.
Recursively insert unique elements from a pair of vectors into a vector of their common or overlapping elements. This is equivalent to solving the SCS problem for a pair of Vectors by inserting elements into the LCS solution for same Vectors. Initial elements of the source vectors and the common vector are compared to decide whether or what to add to the composite mashup, then the process is repeated recursively until no elements remain in the overlap vector. Finally, any remaining elements in
src1
andsrc2
are added to the mashup with the convention thatsrc1
precedessrc2
. This means that reversing the order ofsrc1
andsrc2
might or might not produce identical results.- src1
First vector to examine.
- src2
Second vector to examine.
- overlap
Common vector (LCS of src1 and src2).
- mashup
Accumulator with previously inserted elements.
- Annotations
- @tailrec()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lcs: Vector[T]
Compute Longest Common Subsequence for two Vectors of objects by walking back through the memoizing array to recover the common values in each of the two Vectors.
Compute Longest Common Subsequence for two Vectors of objects by walking back through the memoizing array to recover the common values in each of the two Vectors.
Compare the textbook discussion at http://introcs.cs.princeton.edu/java/23recursion/ with accompanying java impementation at http://introcs.cs.princeton.edu/java/23recursion/LongestCommonSubsequence.java.html
-
def
memo: Array[Array[Int]]
Create a memoizing array by comparing each pair of elements in v1 and v2 and saving the resulting counts of the length of the common Vector (or lcs) at that point.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
printMemo: Unit
Print to stdout a display of the memoizing array.
Print to stdout a display of the memoizing array. Useful for teaching and explaining how the LCS algorithm works.
-
def
printRow(i: Integer): Unit
Print to stdout a display of a specified row of the memoizing array.
Print to stdout a display of a specified row of the memoizing array. Used by printMemo.
- i
Index of row to print out.
-
def
scs: Vector[T]
Compute Shortest Common Supersequence for v1 and v2 by finding LCS and inserting into it at the approrpiate point accompanying any elements of v1 and v2 that appear only in one Vector.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val v1: Vector[T]
- val v2: Vector[T]
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.