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
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. linalg
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
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

  3. trait Broadcasted[+T, B] extends NumericOps[Broadcasted[T, B]]

    TODO

  4. case class BroadcastedColumns[T, ColType](underlying: T) extends BroadcastedLike[T, ColType, BroadcastedColumns[T, ColType]] with Product with Serializable

    Class for classes that are broadcasting their columns.

  5. trait BroadcastedLike[T, B, Self <: Broadcasted[T, B]] extends Broadcasted[T, B] with NumericOps[Self]

  6. case class BroadcastedRows[T, RowType](underlying: T) extends BroadcastedLike[T, RowType, BroadcastedRows[T, RowType]] with Product with Serializable

    Class for classes that are broadcasting their rows.

  7. class Broadcaster extends AnyRef

  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.

  9. trait CanPadLeft[Input, Dimensions, Output] extends AnyRef

  10. trait CanPadRight[Input, Dimensions, Output] extends AnyRef

  11. trait Counter[K, V] extends Tensor[K, V] with CounterLike[K, V, Map[K, V], Counter[K, V]]

  12. trait Counter2[K1, K2, V] extends Tensor[(K1, K2), V] with Counter2Like[K1, K2, V, [V]Map[K1, V], Counter[K2, V], Counter2[K1, K2, V]]

  13. 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.

  14. 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.

  15. 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.

  16. class DenseVector[V] extends StorageVector[V] with VectorLike[V, DenseVector[V]] with Serializable

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

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

    A HashVector is a sparse vector backed by an OpenAddressHashArray

  18. trait ImmutableNumericOps[+This] extends Any

  19. implicit final class InjectNumericOps[T] extends AnyVal with ImmutableNumericOps[T]

  20. class LapackException extends RuntimeException with LinearAlgebraException

  21. trait LinearAlgebraException extends RuntimeException

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

  22. trait LowPriorityCounter2 extends AnyRef

  23. trait LowPriorityMatrix extends AnyRef

  24. trait LowPrioritySliceMatrix extends AnyRef

  25. trait Matrix[V] extends MatrixLike[V, Matrix[V]]

  26. trait MatrixConstructors[Mat[T] <: Matrix[T]] extends AnyRef

  27. class MatrixEmptyException extends IllegalArgumentException with LinearAlgebraException

  28. trait MatrixLike[V, +Self <: Matrix[V]] extends Tensor[(Int, Int), V] with TensorLike[(Int, Int), V, Self]

  29. class MatrixNotSquareException extends IllegalArgumentException with LinearAlgebraException

  30. class MatrixNotSymmetricException extends IllegalArgumentException with LinearAlgebraException

  31. class MatrixSingularException extends RuntimeException with LinearAlgebraException

    Thrown when trying to solve using a singular matrix.

  32. class NotConvergedException extends RuntimeException with LinearAlgebraException

    Exception thrown if a routine has not converged.

  33. trait NumericOps[+This] extends ImmutableNumericOps[This]

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

  34. class PCA extends AnyRef

    Perform Principal Components Analysis on input data.

  35. trait QuasiTensor[K, V] extends AnyRef

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

  36. trait RandomGeneratorUFunc[T] extends UFunc

  37. class SliceMatrix[K1, K2, V] extends Matrix[V] with MatrixLike[V, SliceMatrix[K1, K2, V]]

  38. trait SliceMatrixOps extends AnyRef

  39. class SliceVector[K, V] extends Vector[V] with VectorLike[V, SliceVector[K, V]]

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

  40. trait SliceVectorOps extends AnyRef

  41. class SparseVector[V] extends StorageVector[V] with VectorLike[V, SparseVector[V]] with Serializable

    A vector backed by binary search (with breeze.collection.mutable.SparseArray).

  42. trait StorageVector[V] extends Vector[V] with Storage[V]

  43. implicit class String2File extends AnyRef

    Add methods to the string class in order to make file reading easier

  44. 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.

  45. trait TensorLike[K, V, +This <: Tensor[K, V]] extends QuasiTensor[K, V] with NumericOps[This]

  46. final case class Transpose[+T](inner: T) extends NumericOps[Transpose[T]] with Product with Serializable

    TODO

  47. trait TransposeLowPrio extends AnyRef

  48. trait Vector[V] extends VectorLike[V, Vector[V]]

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

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

    A VectorBuilder is basically an unsorted Sparse Vector.

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

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

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

    Trait for operators and such used in vectors.

  52. trait VectorOps extends AnyRef

  53. trait VectorizedReduceUFunc extends UFunc

    Reducing UFunc that provides implementations for Broadcasted Dense stuff

  54. sealed trait View extends AnyRef

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

  55. trait ZippedValues[V1, V2] extends AnyRef

    Usually used as the return type from zipValues

  56. trait diagLowPrio extends UFunc

  57. trait diagLowPrio2 extends UFunc with diagLowPrio

  58. sealed trait diffLowPrio extends AnyRef

  59. sealed trait mapValuesLowPrio extends AnyRef

  60. trait pinvLowPrio extends AnyRef

  61. sealed trait squaredDistanceLowPrio extends UFunc

  62. sealed trait sumLowPrio extends AnyRef

Value Members

  1. object * extends Broadcaster

  2. object Axis

  3. object BitVector extends BitVectorOps

  4. object BroadcastedColumns extends Serializable

  5. object BroadcastedRows extends Serializable

  6. object Broadcaster

  7. object CSCMatrix extends MatrixConstructors[CSCMatrix] with CSCMatrixOps with SerializableLogging

  8. object CanPadLeft

  9. object CanPadRight

  10. object Counter extends CounterOps with Serializable

  11. object Counter2 extends LowPriorityCounter2 with Counter2Ops

  12. object DenseMatrix extends LowPriorityDenseMatrix with DenseMatrixOps with DenseMatrix_OrderingOps with DenseMatrixMultOps with DenseMatrixMultiplyStuff with DenseMatrixFloatMultiplyStuff with MatrixConstructors[DenseMatrix] with Serializable

  13. object DenseVector extends VectorConstructors[DenseVector] with DenseVector_GenericOps with DenseVectorOps with DenseVector_OrderingOps with DenseVector_SpecialOps with Serializable

  14. object HashVector extends HashVectorOps with DenseVector_HashVector_Ops with HashVector_DenseVector_Ops with HashVector_SparseVector_Ops with SparseVector_HashVector_Ops

  15. object LSMR extends SerializableLogging

    Nearly direct port of http://www.

  16. 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).

  17. object Matrix extends MatrixConstructors[Matrix] with LowPriorityMatrix with MatrixGenericOps with MatrixOpsLowPrio with MatrixOps with MatrixMultOps

  18. object NotConvergedException extends Serializable

  19. object NumericOps

  20. object Options

  21. implicit def RangeToRangeExtender(re: Range): RangeExtender

  22. object SliceMatrix extends LowPrioritySliceMatrix with SliceMatrixOps

  23. object SliceVector extends SliceVectorOps

  24. object SparseVector extends SparseVectorOps with DenseVector_SparseVector_Ops with SparseVector_DenseMatrixOps with SparseVector_DenseVector_Ops with Serializable

  25. object Tensor

  26. object Transpose extends TransposeLowPrio with Serializable

  27. object Vector extends VectorConstructors[Vector] with VectorOps

  28. object VectorBuilder extends VectorBuilderOps with Serializable

  29. object View

  30. object accumulate extends UFunc

    Returns a cumulative sum of the vector (ie cumsum).

  31. object all extends UFunc

    all(t) true if all elements of t are non-zero all(f, t) returns true if all elements of t satisfy f

  32. object any extends UFunc

    any(t) true if any element of t is non-zero any(f, t) returns true if any element of t satisfies f

  33. object argmax extends UFunc

    Returns the key that has maximum value

  34. object argmin extends UFunc

  35. object argsort extends UFunc with LowPriorityArgSort

    Returns a sequence of keys sorted by value

  36. object argtopk extends UFunc with LowPriorityArgTopK

    Returns the top k indices with maximum value

  37. def axpy[A, X, Y](a: A, x: X, y: Y)(implicit axpy: linalg.scaleAdd.InPlaceImpl3[Y, A, X]): Unit

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

  38. object cholesky extends UFunc

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

  39. object clip extends UFunc

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

  40. object cond extends UFunc

    Computes the condition number of the given real matrix.

  41. object convert extends UFunc with MappingUFunc

    Provides casting facilities similar to Numpy's "astype" and Julia's "convert".

  42. 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.

  43. def cov(x: DenseMatrix[Double], center: Boolean = true): DenseMatrix[Double]

    Compute the covariance matrix from the given data, centering if necessary.

    Compute the covariance matrix from the given data, centering if necessary. Very simple, just does the basic thing.

  44. 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.

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

    Reads in a DenseMatrix from a CSV File

  46. def csvwrite(file: File, mat: Matrix[Double], separator: Char = ',', quote: Char = '\u0000', escape: Char = '\\', skipLines: Int = 0): Unit

  47. object det extends UFunc

    Computes the determinant of the given real matrix.

  48. object diag extends UFunc with diagLowPrio2

    returns a vector along the diagonal of v.

  49. object diff extends UFunc with diffLowPrio

    Differences between adjacent elements and discrete derivatives.

  50. object dim extends UFunc

    breeze 7/15/14

  51. object eig extends UFunc

    Eigenvalue decomposition (right eigenvectors)

  52. object eigSym extends UFunc

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

  53. object fliplr extends UFunc

    mirrors the columns (left<->right).

  54. object flipud extends UFunc

    mirrors the rows (up down)

  55. package functions

  56. object hsplit extends UFunc

  57. object inv extends UFunc

    Computes the inverse of a given real matrix.

  58. object isClose extends UFunc

    Created by dlwh on 11/1/15.

  59. object kron extends UFunc

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

  60. 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.

  61. object logAndNormalize extends UFunc

  62. object logDiff extends UFunc

  63. object logNormalize extends UFunc

  64. object logdet extends UFunc

    Computes the log of the determinant of the given real matrix.

  65. def lowerTriangular[T](X: Matrix[T])(implicit arg0: Semiring[T], arg1: ClassTag[T], arg2: Zero[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.

  66. object mapActiveValues extends UFunc

  67. object mapValues extends UFunc with mapValuesLowPrio

    UFunc for being able to map the keys and values in a value collection to new values.

  68. object max extends UFunc

  69. object min extends UFunc

    Computes the minimum.

  70. object minMax extends UFunc

    Minimum and maximum in one traversal, along an axis.

  71. def mmwrite[T](file: File, mat: Matrix[T])(implicit arg0: Numeric[T]): Unit

  72. object mpow extends UFunc

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

  73. object norm extends UFunc

    Computes the norm of an object.

  74. object normalize extends UFunc

    Normalizes the argument such that its norm is 1.

  75. package operators

  76. def padLeft[T](v: DenseMatrix[T], dimensions: Dimensions2, mode: OptPadMode)(implicit canPad: CanPadLeft[DenseMatrix[T], Dimensions2, DenseMatrix[T]]): DenseMatrix[T]

  77. def padLeft[T](v: DenseMatrix[T], dimensions: Dimensions1)(implicit canPad: CanPadLeft[DenseMatrix[T], Dimensions1, DenseMatrix[T]]): DenseMatrix[T]

  78. def padLeft[T](v: DenseVector[T], dimensions: Dimensions1, mode: OptPadMode)(implicit canPad: CanPadLeft[DenseVector[T], Dimensions1, DenseVector[T]]): DenseVector[T]

  79. def padLeft[T](v: DenseVector[T], dimensions: Dimensions1)(implicit canPad: CanPadLeft[DenseVector[T], Dimensions1, DenseVector[T]]): DenseVector[T]

  80. def padRight[T](v: DenseMatrix[T], dimensions: Dimensions2, mode: OptPadMode)(implicit canPad: CanPadRight[DenseMatrix[T], Dimensions2, DenseMatrix[T]]): DenseMatrix[T]

  81. def padRight[T](v: DenseMatrix[T], dimensions: Dimensions1)(implicit canPad: CanPadRight[DenseMatrix[T], Dimensions1, DenseMatrix[T]]): DenseMatrix[T]

  82. def padRight[T](v: DenseVector[T], dimensions: Dimensions1, mode: OptPadMode)(implicit canPad: CanPadRight[DenseVector[T], Dimensions1, DenseVector[T]]): DenseVector[T]

  83. def padRight[T](v: DenseVector[T], dimensions: Dimensions1)(implicit canPad: CanPadRight[DenseVector[T], Dimensions1, DenseVector[T]]): DenseVector[T]

  84. object pinv extends UFunc with pinvLowPrio

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

  85. def princomp(x: DenseMatrix[Double], covmatOpt: Option[DenseMatrix[Double]] = None): PCA

    Performs a principal components analysis on the given numeric data matrix and returns the results as an object of class PCA.

    Performs a principal components analysis on the given numeric data matrix and returns the results as an object of class PCA.

    If the no covariance matrix is supplied, one obtained from the given data is used.

  86. object product extends UFunc

    Computes the product

  87. object ptp extends UFunc

    Peak-to-peak, ie the Range of values (maximum - minimum) along an axis.

  88. object qr extends UFunc

    QR Factorization

  89. object qrp extends UFunc

    QR Factorization with pivoting

  90. val rand: randomDouble.type

    Alias for randomDouble

  91. object randn extends RandomGeneratorUFunc[Double]

    Gives Gaussian-distributed random Double(s) + randn().

  92. object randomDouble extends RandomGeneratorUFunc[Double]

    Gives a random Double.

  93. object randomInt extends RandomGeneratorUFunc[Int]

    Gives a random Int.

  94. object rank extends UFunc

    Computes the rank of a matrix.

  95. 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.

  96. object reshape extends UFunc

    breeze 7/4/14

  97. object reverse extends UFunc

    Returns a reversed copy of the DenseVector.

  98. object roll extends UFunc

    roll the array

  99. object rot90 extends UFunc

    Rotates a matrix by 90 * k degrees counter clockwise.

  100. def scale(x: DenseMatrix[Double], center: Boolean = true, scale: Boolean = false): DenseMatrix[Double]

    A generic function (based on the R function of the same name) whose default method centers and/or scales the columns of a numeric matrix.

    A generic function (based on the R function of the same name) whose default method centers and/or scales the columns of a numeric matrix.

    If ‘scale’ is ‘TRUE’ then scaling is done by dividing the (centered) columns of ‘x’ by their standard deviations if ‘center’ is ‘TRUE’, and the root mean square otherwise. If ‘scale’ is ‘FALSE’, no scaling is done.

  101. object scaleAdd extends UFunc

    method for representing scaleAdd(y, a, x) == y + a * x

  102. object shuffle extends UFunc

    Return the given DenseVector, Array, or DenseMatrix as a shuffled copy by using Fisher-Yates shuffle.

  103. object softmax extends UFunc

    Computes the softmax (a.

  104. object split extends UFunc

    split the array

  105. object squaredDistance extends UFunc with squaredDistanceLowPrio

    Computes the squared distance between two vectors.

  106. def strictlyLowerTriangular[T](X: Matrix[T])(implicit arg0: Semiring[T], arg1: ClassTag[T], arg2: Zero[T]): DenseMatrix[T]

    The lower triangular portion of the given real quadratic matrix X with the diagnal elements is zero!

  107. def strictlyUpperTriangular[T](X: Matrix[T])(implicit arg0: Semiring[T], arg1: ClassTag[T], arg2: Zero[T]): DenseMatrix[T]

    The upper triangular portion of the given real quadratic matrix X with the diagnal elements is zero!

  108. object sum extends UFunc with sumLowPrio with VectorizedReduceUFunc

  109. package support

    TODO

  110. object svd extends UFunc

    Computes the SVD of a M-by-N matrix Returns an M-by-M matrix U, a vector of singular values, and a N-by-N matrix V'

  111. object tile extends UFunc

  112. object trace extends UFunc

    Computes the determinant of the given real matrix.

  113. object unique extends UFunc

    deduplicates the array

  114. def upperTriangular[T](X: Matrix[T])(implicit arg0: Semiring[T], arg1: ClassTag[T], arg2: Zero[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.

  115. lazy val usingNatives: Boolean

    val to determine if breeze is using natives or f2jblas

  116. object vsplit extends UFunc

  117. object where extends UFunc

    where(a) returns those indices that are non-zero

  118. object zipValues extends UFunc

Inherited from AnyRef

Inherited from Any

Ungrouped