stanford-ppl / Delite

The Delite Git Repo
http://ppl.stanford.edu
216 stars 43 forks source link

Suggestion: Enrich ForgeArray types to have .toVector method (OptiML only) #50

Open malcolmgreaves opened 8 years ago

malcolmgreaves commented 8 years ago

Using an implicit class, we could add a .toVector method on the ForgeArray type that would convert the data into a DenseVector type. E.g.

val x: ForgeArray[Int] = ...
val y: DenseVector[Int] = x.toVector

This would be equivalent to the following (current way):

val y: DenseVector[Int] = DenseVector(x)
dkoeplin commented 8 years ago

I believe this doesn't exist at the moment primarily because the user isn't generally supposed to handle ForgeArray instances in OptiML apps.