0

I cannot assign a column via A(::,1) = DenseVector to a DenseMatrix A. Here is what I get in the repl:

scala> val A=DenseMatrix.vertcat(DenseVector(11,12).toDenseMatrix,DenseVector(21,22).toDenseMatrix) A: breeze.linalg.DenseMatrix[Int] = 11 12 21 22 scala> A(::,1) = DenseVector(13,23) <console>:14: error: type mismatch; found : collection.immutable.::.type required: Int A(::,1) = DenseVector(13,23) ^ 

Scala version is 2.12, breeze version: 1.0. This is similar to this question where it is stated that this should work. The problem persists if A is declared as a var.

1 Answer 1

2

You're close...

A(::,1) := DenseVector(13,23) 

https://github.com/scalanlp/breeze/wiki/Linear-Algebra-Cheat-Sheet

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.