In relation to the answer of NOAH on how to use CSCMatrix
how to construct matrix B, it consists of what items?
In relation to the answer of NOAH on how to use CSCMatrix
how to construct matrix B, it consists of what items?
It looks like CSC
matrices only support B
columns in the form of a DenseVector
:
scala> import breeze.linalg._
import breeze.linalg._
scala> import breeze.numerics._
import breeze.numerics._
scala> val A = CSCMatrix((1d,0d,0d),(0d,1d,0d),(0d,0d,1d))
A: breeze.linalg.CSCMatrix[Double] =
3 x 3 CSCMatrix
(0,0) 1.0
(1,1) 1.0
(2,2) 1.0
scala> val B = DenseVector(3d,4d,5d)
B: breeze.linalg.DenseVector[Double] = DenseVector(3.0, 4.0, 5.0)
scala> A \ B
res0: breeze.linalg.DenseVector[Double] = DenseVector(3.000000000000001, 4.000000000000002, 5.000000000000001)