aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scalam/package.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/scalam/package.scala')
-rw-r--r--src/main/scala/scalam/package.scala17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/scala/scalam/package.scala b/src/main/scala/scalam/package.scala
index 95f1fa2..6a167eb 100644
--- a/src/main/scala/scalam/package.scala
+++ b/src/main/scala/scalam/package.scala
@@ -3,14 +3,27 @@ import scalam.collection._
import scala.collection.generic.CanBuildFrom
import scala.collection.mutable.Builder
+/**
+ * A number of commonly applied implicit conversions are defined here, and
+ * in the parent type [[scalam.LowPriorityImplicits]]. Implicit conversions
+ * are provided for the integration of external collection-like structures into
+ * the standard Scala collections framework.
+ */
package object scalam extends LowPriorityImplicits {
-
+
+ /**
+ * Augments a given dense vector to a DenseVectorOps object, thereby providing it with all the methods found in sequences.
+ * @see scalam.collection.DenseVectorOps
+ */
implicit def denseVector2Ops[A: ClassManifest](v: DenseVector[A]) = new DenseVectorOps(v)
+ /**
+ * Enables new dense vectors to be built from existing dense vectors. This implicit is used by [[scalam.collection.DenseVectorOps]].
+ */
implicit def denseVectorCanBuildFrom[A: ClassManifest]: CanBuildFrom[DenseVector[_], A, DenseVector[A]] =
new CanBuildFrom[DenseVector[_], A, DenseVector[A]] {
def apply(from: DenseVector[_]): Builder[A, DenseVector[A]] = apply()
def apply(): Builder[A, DenseVector[A]] = collection.DenseVectorOps.newBuilder[A]
}
-
+
} \ No newline at end of file