Questions tagged [scalala]

Scalala is the linear algebra library for scala. Now, it is replaced by Breeze.

Scalala (now replaced by Breeze) is the numerical linear algebra library for Scala, supporting rich Matlab-like operators on vectors and matrices, and a library of numerical and plotting routines. Scalala takes its inspiration from numerical programming environments such as Matlab and R, that can easily express linear algebra as simple expressions involving matrices, vectors and scalars. However, general purpose programming with richer data structures in these environments ranges from slow to painful. Scalala is designed to marry the syntax of interactive numeric environments, the performance of dedicated linear algebra libraries, and the flexibility of general purpose programming in Scala.

14 questions
7
votes
2 answers

Read a matrix from a file in Scala Breeze

I want to read a tab-delimited text file into a Breeze DenseMatrix. I see in the ScalaDoc that this should be possible and there are a whole set of I/O classes, but I can't find any examples and it's hard to digest the ScalaDoc. Can someone provide…
Dave DeCaprio
  • 2,051
  • 17
  • 31
6
votes
2 answers

How to solve a linear system of matrices in scala breeze?

How to solve a linear system of matrices in scala breeze? ie, I have Ax = b, where A is a matrix (usually positive definite), and x and b are vectors. I can see that there is a cholesky decomposition available, but I couldn't seem to find a solver?…
Hugh Perkins
  • 7,975
  • 7
  • 63
  • 71
5
votes
1 answer

How to perform element-wise scalar operations on a vector with Scala Breeze?

With Scalala it was possible to perform element-wise operations on a Vector using a scalar operand. Say you have a Vector of random numbers between 0 and 1 and you want to subtract each value from 1: import breeze.linalg._ val x =…
weston
  • 2,878
  • 3
  • 24
  • 23
3
votes
2 answers

Why is it illegal to call mean on this 3x2 matrix of doubles in Scala Breeze?

I am new to Breeze (formerly Scalala), and can't figure out why the following simple program throws an exception. i am using Scala 2.9.2 and Breeze 0.1: import breeze.linalg._ val m = DenseMatrix((3.0, 1.0, 2.0), (-2.0, 1.0, 3.0)) val n = mean(m,…
Dave DeCaprio
  • 2,051
  • 17
  • 31
3
votes
2 answers

Using Scala Breeze to do numPy style broadcasting

Is there a generic way using Breeze to achieve what you can do using broadcasting in NumPy? Specifically, if I have an operator I'd like to apply to two 3x4 matrices, I can apply that operation element-wise. However, what I have is a 3x4 matrix and…
Dave DeCaprio
  • 2,051
  • 17
  • 31
3
votes
1 answer

Does Scalala provide straightforward way of inserting vector into matrix?

I am a bit lost among all those available operators -- so is there easy way to insert a entire row/column (vector) into a matrix? I started thinking about creating a vector, converting it to array, joining it with matrix converted into array, and…
greenoldman
  • 16,895
  • 26
  • 119
  • 185
2
votes
1 answer

Clone and build Scalala with Eclipse/IntelliJ

I am trying to import Scalala into Eclipse. I had tried using the sbt-eclipse plugin by adding the lines addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0-M2") to my plugins.sbt and I ran ./sbt update from the root of the…
tutysara
  • 177
  • 1
  • 12
2
votes
2 answers

Scalala Plotting: Compile Error

I'm trying to implement the answer to this question: https://stackoverflow.com/questions/3704647/can-you-recommend-a-charting-library-for-scala/3704974#3704974 I've downloaded and compiled Scalala from the git hub and placed the…
dsg
  • 12,924
  • 21
  • 67
  • 111
2
votes
1 answer

Slicing a SparseVector to get a SparseVector in Scalala

I'd like to slice a sparse vector in scalala and get another sparse vector. A normal slice always gives a standard vector. Can I provide an implicit function for doing this while slicing and if so what would it look like? As an example, I'd like…
fozziethebeat
  • 1,180
  • 2
  • 11
  • 27
1
vote
1 answer

Bar charts in Scalala

Is it possible to use Scalala to plot bar charts, similars to http://www.mathworks.com/help/techdoc/ref/bar.html?
1
vote
1 answer

Scala Breeze: can you create a DenseMatrix of Int Array elements?

I just found Scala Breeze as a high performance linear algebra library for Scala applications. I wonder if there is a way to initialize a DenseMatrix with an Int Array as element unit. This is the OpenCV functionality i am trying to port to…
Ignacio
  • 135
  • 1
  • 2
  • 8
0
votes
2 answers

How to start scalala console?

I am starting using scala and I am interested in using the scalala package for doing linear algebra computations. I successfully installed it through sbt but I can't (or better don't know how) start the scalala console. Can anyone point out the…
Gerry
  • 5,326
  • 1
  • 23
  • 33
0
votes
1 answer

How do I configure Scala Breeze to use log4j or slf4j

I am using the breeze.optimize package of Scala Breeze, and it looks like Breeze ahs implemented its own logging library. Is there a way to configure Breeze to use standard logging like log4j or slf4j so I can configure logging for optimizations the…
Dave DeCaprio
  • 2,051
  • 17
  • 31
0
votes
1 answer

How to do X * diag(Y) in Scala Breeze?

How to do X * diag(Y) in Scala Breeze? X could be for example a CSCMatrix and Y could be a DenseVector? In MATLAB syntax, this would be: X * spdiags(0, Y, N, N ) Or: X .* repmat( Y', K, 0 ) In SciPy syntax, this would be a 'broadcast multiply': Y…
Hugh Perkins
  • 7,975
  • 7
  • 63
  • 71