Fixes for 3 tests which aren't failing.
Which should be failing, and would be failing if they were being compiled by trunk, since they used methods which don't exist. Why aren't they failing? That is the real mystery. In the interests of removing a disincentive to track that one down, I future-proofed them against that day when they start being run like they're supposed to be. git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@26090 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
71835ea33c
commit
d2f941517d
|
|
@ -56,7 +56,7 @@ object knucleotide {
|
|||
}
|
||||
|
||||
|
||||
class Counter(_value: Int) {
|
||||
class Counter(_value: Int) {
|
||||
var value = _value
|
||||
def ++() = { value += 1 }
|
||||
}
|
||||
|
|
@ -86,11 +86,7 @@ object knucleotide {
|
|||
def writeFrequencies(j: Int) {
|
||||
val d = generateFrequencies(j)
|
||||
val n = sequence.length - j + 1.0
|
||||
val sortedValues = d.toList.sort(
|
||||
(a,b) => if (a._2.value == b._2.value) a._1 > b._1
|
||||
else a._2.value > b._2.value )
|
||||
|
||||
for (a <- sortedValues)
|
||||
for (a <- d.toList.sortWith((a,b) => if (a._2.value == b._2.value) a._1 > b._1 else a._2.value > b._2.value))
|
||||
Console.printf("%s %.3f\n", a._1, a._2.value / n * 100.0)
|
||||
|
||||
Console.println
|
||||
|
|
|
|||
|
|
@ -70,11 +70,7 @@ object knucleotide {
|
|||
def writeFrequencies(j: Int) = {
|
||||
val bag = generateFrequencies(j)
|
||||
val n = sequence.length - j + 1.0
|
||||
val sortedValues = bag.iterator.toList.sort(
|
||||
(a,b) => if (a.value == b.value) a.key > b.key
|
||||
else a.value > b.value )
|
||||
|
||||
for (a <- sortedValues)
|
||||
for (a <- bag.iterator.toList.sortWith((a,b) => if (a.value == b.value) a.key > b.key else a.value > b.value))
|
||||
Console.printf("%s %.3f\n", a.key, a.value / n * 100.0)
|
||||
|
||||
Console.println
|
||||
|
|
@ -90,7 +86,7 @@ object knucleotide {
|
|||
class HashBag[A] extends HashTable[A, Counter[A]] {
|
||||
protected type Entry = Counter[A]
|
||||
protected def entryKey(e: Entry) = e.key
|
||||
def iterator = entries
|
||||
def iterator = entriesIterator
|
||||
|
||||
def +=(elem: A): Unit = {
|
||||
var bucket = table(index(elemHashCode(elem))).asInstanceOf[Entry]
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ object nestedloop {
|
|||
val n = toPositiveInt(args);
|
||||
var count = 0;
|
||||
|
||||
for (a <- Iterator.range(0,n);
|
||||
val b <- Iterator.range(0,n);
|
||||
val c <- Iterator.range(0,n);
|
||||
val d <- Iterator.range(0,n);
|
||||
val e <- Iterator.range(0,n);
|
||||
val f <- Iterator.range(0,n)
|
||||
)
|
||||
for { a <- Iterator.range(0,n)
|
||||
b <- Iterator.range(0,n)
|
||||
c <- Iterator.range(0,n)
|
||||
d <- Iterator.range(0,n)
|
||||
e <- Iterator.range(0,n)
|
||||
f <- Iterator.range(0,n)
|
||||
}
|
||||
count = count + 1;
|
||||
|
||||
Console println(count);
|
||||
|
|
|
|||
Loading…
Reference in New Issue