Basic Breeze data types
Breeze is an extensive library providing fast and easy manipulation of arrays of data, routines for optimization, interpolation, linear algebra, signal processing, and numerical integration.
The basic linear algebra operations underlying Breeze rely on the netlib-java
library, which can use system-optimized BLAS and LAPACK libraries, if present. Thus, linear algebra operations in Breeze are often extremely fast. Breeze is still undergoing rapid development and can, therefore, be somewhat unstable.
Vectors
Breeze makes manipulating one- and two-dimensional data structures easy. To start, open a Scala console through SBT and import Breeze:
$ sbt console scala> import breeze.linalg._ import breeze.linalg._
Let's dive straight in and define a vector:
scala> val v = DenseVector(1.0, 2.0, 3.0) breeze.linalg.DenseVector[Double] = DenseVector(1.0, 2.0, 3.0)
We have just defined a three-element vector, v
. Vectors are just one-dimensional arrays of data exposing methods...