 breeze

linalg

package linalg

This package contains everything relating to Vectors, Matrices, Tensors, etc.

If you're doing basic work, you probably want breeze.linalg.DenseVector and breeze.linalg.DenseMatrix, which support most operations. We also have breeze.linalg.SparseVectors and (basic!) support for a sparse matrix (breeze.linalg.CSCMatrix).

This package object contains Matlab-esque functions for interacting with tensors and matrices.

Linear Supertypes
AnyRef, Any
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. linalg
2. AnyRef
3. Any
1. Hide All
2. Show all
Visibility
1. Public
2. All

Type Members

1. sealed trait Axis extends AnyRef

This trait is commonly used for breeze.linalg.sum and its kin for summing along a particular axis of a Matrix.

2. class BitVector extends Vector[Boolean] with VectorLike[Boolean, BitVector]

TODO @ dwhl: What does enforceLength exactly do?

TODO

Class for classes that are broadcasting their columns.

Class for classes that are broadcasting their rows.

8. class CSCMatrix[V] extends Matrix[V] with MatrixLike[V, CSCMatrix[V]] with Serializable

A compressed sparse column matrix, as used in Matlab and CSparse, etc.

11. trait Counter2Like[K1, K2, V, +M1[VV] <: Map[K1, VV], +T <: Counter[K2, V], +This <: Counter2[K1, K2, V]] extends TensorLike[(K1, K2), V, This]

A map-like tensor that acts like a collection of key-value pairs where the set of values may grow arbitrarily.

12. trait CounterLike[K, V, +M <: Map[K, V], +This <: Counter[K, V]] extends TensorLike[K, V, This] with Serializable

A map-like tensor that acts like a collection of key-value pairs where the set of values may grow arbitrarily.

13. final class DenseMatrix[V] extends Matrix[V] with MatrixLike[V, DenseMatrix[V]] with Serializable

A DenseMatrix is a matrix with all elements found in an array.

14. class DenseVector[E] extends StorageVector[E] with VectorLike[E, DenseVector[E]] with Serializable

A DenseVector is the "obvious" implementation of a Vector, with one twist.

15. class HashVector[E] extends Vector[E] with VectorLike[E, HashVector[E]]

A HashVector is a sparse vector backed by an OpenAddressHashArray

16. trait LinearAlgebraException extends RuntimeException

Marker trait for exceptions thrown from the breeze.linalg package.

24. class MatrixSingularException extends RuntimeException with LinearAlgebraException

Thrown when trying to solve using a singular matrix.

25. class NormCacheDecorator[E] extends Vector[E]

This decorator automatically caches the norm and sums of a vector and invalidates the cache whenever the vector is updated.

26. class NotConvergedException extends RuntimeException with LinearAlgebraException

Exception thrown if a routine has not converged.

27. trait NumericOps[+This] extends AnyRef

In some sense, this is the real root of the linalg hierarchy.

28. sealed trait QuasiTensor[K, V] extends AnyRef

We occasionally need a Tensor that doesn't extend NumericOps directly.

31. class SliceVector[K, V] extends Vector[V]

A SliceVector is a vector that is a view of another underlying tensor.

32. class SparseVector[E] extends StorageVector[E] with VectorLike[E, SparseVector[E]] with Serializable

A Binary-search backed vector.

34. trait Tensor[K, V] extends TensorLike[K, V, Tensor[K, V]]

A Tensor defines a map from an index set to a set of values.

36. trait Vector[E] extends VectorLike[E, Vector[E]]

A Vector represents the mathematical concept of a vector in math.

37. class VectorBuilder[E] extends NumericOps[VectorBuilder[E]] with Serializable

A VectorBuilder is basically an unsorted Sparse Vector.

38. trait VectorConstructors[Vec[T] <: Vector[T]] extends AnyRef

Trait that can mixed to companion objects to enable utility methods for creating vectors.

39. trait VectorLike[E, +Self <: Vector[E]] extends Tensor[Int, E] with TensorLike[Int, E, Self]

Trait for operators and such used in vectors.

41. sealed trait View extends AnyRef

Trait used for methods that can return a view or a copy.

Value Members

13. object LU extends UFunc

Computes the LU factorization of the given real M-by-N matrix X such that X = P * L * U where P is a permutation matrix (row exchanges).

15. object MutableInnerProductSpaceDenseMatrixDouble

Import this to provide access to a DenseMatrix[Double] as a MutableInnerProductSpace, so it can be used in optimization.

24. object all extends UFunc

Returns true if all elements are non-zero

25. object any extends UFunc

Returns true if any element is non-zero

26. def axpy[A, X, Y](a: A, x: X, y: Y)(implicit axpy: CanAxpy[A, X, Y]): Unit

Computes y += x * a, possibly doing less work than actually doing that operation

27. object cholesky extends UFunc

Computes the cholesky decomposition A of the given real symmetric positive definite matrix X such that X = A A.

28. object clip extends UFunc

clip(a, lower, upper) returns an array such that all elements are "clipped" at the range (lower, upper)

29. def copy[T](t: T)(implicit canCopy: CanCopy[T]): T

Copy a T.

Copy a T. Most tensor objects have a CanCopy implicit, which is what this farms out to.

30. def cross[V1](a: DenseVector[V1], b: DenseVector[V1])(implicit ring: Ring[V1], man: ClassTag[V1]): DenseVector[V1]

Vector cross product of 3D vectors a and b.

31. def csvread(file: File, separator: Char = ',', quote: Char = '"', escape: Char = '\\', skipLines: Int = 0): DenseMatrix[Double]

Reads in a DenseMatrix from a CSV File

33. object det extends UFunc

Computes the determinant of the given real matrix.

34. object diag extends UFunc with diagLowPrio2

returns a vector along the diagonal of v.

35. object diff extends UFunc

Differences between adjacent elements and discrete derivatives.

36. object eig extends UFunc

Eigenvalue decomposition (right eigenvectors)

37. object eigSym extends UFunc

Computes all eigenvalues (and optionally right eigenvectors) of the given real symmetric matrix X.

38. object fliplr extends UFunc

mirrors the columns (left<->right).

39. object flipud extends UFunc

mirrors the rows (up down)

40. object inv extends UFunc

Computes the inverse of a given real matrix.

41. object kron extends UFunc

Returns the Kronecker product of two matrices a and b, usually denoted a ⊗ b.

42. def linspace(a: Double, b: Double, length: Int = 100): DenseVector[Double]

Generates a vector of linearly spaced values between a and b (inclusive).

Generates a vector of linearly spaced values between a and b (inclusive). The returned vector will have length elements, defaulting to 100.

46. def lowerTriangular[T](X: Matrix[T])(implicit arg0: Semiring[T], arg1: ClassTag[T], arg2: DefaultArrayValue[T]): DenseMatrix[T]

The lower triangular portion of the given real quadratic matrix X.

The lower triangular portion of the given real quadratic matrix X. Note that no check will be performed regarding the symmetry of X.

48. object mean extends UFunc

A breeze.generic.UFunc for computing the mean of objects

49. object meanAndVariance extends UFunc

A breeze.generic.UFunc for computing the mean and variance of objects.

50. object min extends UFunc

Computes the minimum.

51. object mpow extends UFunc

Raises m to the exp'th power via eigenvalue decomposition.

52. object norm extends UFunc

Computes the norm of an object.

53. object normalize extends UFunc

Normalizes the argument such that its norm is 1.

55. object pinv extends UFunc

Computes the Moore-Penrose pseudo inverse of the given real matrix X.

56. object product extends UFunc

Computes the product

57. object qr extends UFunc

QR Factorization

58. object qrp extends UFunc

QR Factorization with pivoting

59. object rank extends UFunc

Computes the rank of a matrix.

60. def ranks[V](x: Vector[V])(implicit arg0: Ordering[V]): Array[Double]

Returns the rank of each element in the given vector, adjusting for ties.

61. object reverse extends UFunc

Returns a reversed copy of the DenseVector.

62. object rot90 extends UFunc

Rotates a matrix by 90 * k degrees counter clockwise.

63. object softmax extends UFunc

Computes the softmax (a.

64. object stddev extends UFunc

Computes the standard deviation by calling variance and then sqrt'ing

67. object svd extends UFunc

Computes the SVD of a m by n matrix Returns an m*m matrix U, a vector of singular values, and a n*n matrix V'

68. def upperTriangular[T](X: Matrix[T])(implicit arg0: Semiring[T], arg1: ClassTag[T], arg2: DefaultArrayValue[T]): DenseMatrix[T]

The upper triangular portion of the given real quadratic matrix X.

The upper triangular portion of the given real quadratic matrix X. Note that no check will be performed regarding the symmetry of X.

69. object variance extends UFunc

A breeze.generic.UFunc for computing the variance of objects.