diff --git a/src/main/scala/hb/dhbw/CartesianProduct.scala b/src/main/scala/hb/dhbw/CartesianProduct.scala index b075424..4220891 100644 --- a/src/main/scala/hb/dhbw/CartesianProduct.scala +++ b/src/main/scala/hb/dhbw/CartesianProduct.scala @@ -1,17 +1,7 @@ package hb.dhbw class CartesianProduct[A](private val setOfSets: List[List[A]]){ - def productWith(product: CartesianProduct[A]) = { - val ret = new CartesianProduct[A](setOfSets ++ product.setOfSets) - var base: Long = 1 - ret.sizes = ret.setOfSets.map(_.size) - ret.sizes.foreach(size => { - base = base * size - }) - ret.max = base - ret.i = i - ret - } + //def addPossibilities(Set[A]) //TODO private var sizes: List[Int] = null private var max: Long = 1 diff --git a/src/test/scala/CartesianProductTest.scala b/src/test/scala/CartesianProductTest.scala index e6281dc..8249796 100644 --- a/src/test/scala/CartesianProductTest.scala +++ b/src/test/scala/CartesianProductTest.scala @@ -8,15 +8,4 @@ class CartesianProductTest extends FunSuite{ val result = List(1,2,3,4).map( _ => test.nextProduct()) assert(result.contains(Set(1,4))) } - - test("productWith"){ - val test = new CartesianProduct[Int](Set(Set(1,2),Set(4,3))) - val test2 = new CartesianProduct[Int](Set(Set(5,6), Set(7,8))) - val test3 = test.productWith(test2) - val result = for( i <- 1 to 16) yield test3.nextProduct() - assert(result.contains(Set(2,3,6,8))) - assert(result.toSet.size == 16) - println(result) - } - }