Allan Brighton
unread,May 12, 2013, 10:12:24 AM5/12/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-...@googlegroups.com
Hi,
I have some questions about how Breeze compares to Scalala.
In Scalala it was possible to create a Matrix from a number of Arrays or Vectors. For example:
val a1 = Array(1,2,3)
val a2 = Array(4,5,6)
val m = Matrix(a1, a2)
m: scalala.tensor.dense.DenseMatrix[Int] =
1 2 3
4 5 6
This doesn't seem to be implemented in Breeze. Is this feature planned? (Or is it considered ambiguous?)
I also noticed that arithmetic operations on arrays changed. Array(1,2,3) :+ 2
used to add 2 to each element to get Array(3,4,5), but now it appends 2 to the array:
Array(1,2,3,2). Is that to be expected?
I noticed other differences. For example: Vector(1,2,3) used to result in a DenseVector.
Now I have to use DenseVector(1,2,3) to get that (same for Matrix and DenseMatrix).
Scalala defined arithmetic operations on arrays, lists and numbers, so I could write
5.0 :^ 3.0 instead of math.pow(5.0, 3.0) or Array(1,2,3) :* 2. Are there plans to add these operations to Breeze?
What is the reason for not automatically converting integers to double in Matrix and Vector operations
as scalala did? Is that better for performance or to avoid confusion?
Thanks,
Allan