Created
January 30, 2009 04:08
-
-
Save okomok/54933 to your computer and use it in GitHub Desktop.
Triples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mada.vec | |
/* | |
private[mada] object TriplesVector { | |
def apply[A](from: Vector[Vector.Triple[A]]): Vector[Vector[A]] = from match { | |
case from: VectorTriples[_] => from.from // conversion fusion | |
case _ => new TriplesVector(from) | |
} | |
} | |
private[mada] class TriplesVector[A](val from: Vector[Vector.Triple[A]]) extends VectorProxy[Vector[A]] with NotWritable[Vector[A]] { | |
override val self = from.map({ v => Vector.tripleVector(v) }) | |
} | |
private[mada] object VectorTriples { | |
def apply[A](from: Vector[Vector[A]]): Vector[Vector.Triple[A]] = from match { | |
case from: TriplesVector[_] => from.from // conversion fusion | |
case _ => new VectorTriples(from) | |
} | |
} | |
private[mada] class VectorTriples[A](val from: Vector[Vector[A]]) extends VectorProxy[Vector.Triple[A]] with NotWritable[Vector.Triple[A]] { | |
override val self = from.map({ v => v.triple }) | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment