0

There is apply method in DenseMatrix object that allows to construct DenseMatrix from rows (breeze 0.11.2). Like an example below:

val dv:DenseVector[Double]
DenseMatrix.apply[DenseVector[Double],Double](
   (for(i <- 0 until dv.activeSize)yield dv) :_ *)

the trouble, that such code needs additional implicit

implicit val rl = new LiteralRow[DenseVector[Double], Double] {
override def foreach[X](row: DenseVector[Double], fn: (Int, Double) => X): Unit = {
  for(i<- 0 until row.iterableSize) {
    fn(i, row(i))
  }
}

override def length(row: DenseVector[Double]): Int = row.iterableSize
}

Any simplier/more correct ways?

kokorins
  • 72
  • 7

1 Answers1

1

it's an oversight. please open a ticket.

If you have columns, you can use DenseVector.horzcat(columns:_*)

dlwh
  • 2,257
  • 11
  • 23