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
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, B](underlying: T) extends BroadcastedLike[T, B, BroadcastedColumns[T, B]] 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 Matrix[V] extends MatrixLike[V, Matrix[V]]

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

  25. class MatrixEmptyException extends IllegalArgumentException with LinearAlgebraException

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

  27. class MatrixNotSquareException extends IllegalArgumentException with LinearAlgebraException

  28. class MatrixNotSymmetricException extends IllegalArgumentException with LinearAlgebraException

  29. class MatrixSingularException extends RuntimeException with LinearAlgebraException

    Thrown when trying to solve using a singular matrix.

  30. class NotConvergedException extends RuntimeException with LinearAlgebraException

    Exception thrown if a routine has not converged.

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

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

  32. class PCA extends AnyRef

    Perform Principal Components Analysis on input data.

  33. sealed trait QRMode extends AnyRef

  34. trait QuasiTensor[K, V] extends AnyRef

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

  35. trait RandomGeneratorUFunc[T] extends UFunc

  36. sealed abstract class SVDMode extends AnyRef

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

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

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

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

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

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

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

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

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

    TODO

  44. trait TransposeLowPrio extends AnyRef

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

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

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

    A VectorBuilder is basically an unsorted Sparse Vector.

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

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

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

    Trait for operators and such used in vectors.

  49. trait VectorOps extends AnyRef

  50. sealed trait View extends AnyRef

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

  51. trait ZippedValues[V1, V2] extends AnyRef

    Usually used as the return type from zipValues

  52. trait diagLowPrio extends UFunc

  53. trait diagLowPrio2 extends UFunc with diagLowPrio

  54. trait pinvLowPrio 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 CompleteQR extends QRMode with Product with Serializable

  11. object CompleteSVD extends SVDMode with Product with Serializable

  12. object Counter extends CounterOps with Serializable

  13. object Counter2 extends LowPriorityCounter2 with Counter2Ops

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

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

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

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

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

  19. object NotConvergedException extends Serializable

  20. object NumericOps

  21. object Options

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

  23. object ReducedQR extends QRMode with Product with Serializable

  24. object ReducedSVD extends SVDMode with Product with Serializable

  25. object SliceVector

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

  27. object Tensor

  28. object Transpose extends TransposeLowPrio with Serializable

  29. object Vector extends VectorConstructors[Vector] with VectorOps

  30. object VectorBuilder extends VectorBuilderOps with Serializable

  31. object View

  32. object accumulate extends UFunc

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

  33. object all extends UFunc

    Returns true if all elements are non-zero

  34. object any extends UFunc

    Returns true if any element is non-zero

  35. object argmax extends UFunc

    Returns the key that has maximum value

  36. object argmin extends UFunc

  37. object argsort extends UFunc with LowPriorityArgSort

    Returns a sequence of keys sorted by value

  38. object argtopk extends UFunc with LowPriorityArgTopK

    Returns a sequence of keys sorted by value

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

  40. object cholesky extends UFunc

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

  41. object clip extends UFunc

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

  42. object cond extends UFunc

    Computes the condition number of the given real matrix.

  43. object convert extends UFunc with MappingUFunc

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

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

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

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

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

    Reads in a DenseMatrix from a CSV File

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

  49. object det extends UFunc

    Computes the determinant of the given real matrix.

  50. object diag extends UFunc with diagLowPrio2

    returns a vector along the diagonal of v.

  51. object diff extends UFunc

    Differences between adjacent elements and discrete derivatives.

  52. object dim extends UFunc

    breeze 7/15/14

  53. object eig extends UFunc

    Eigenvalue decomposition (right eigenvectors)

  54. object eigSym extends UFunc

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

  55. object fliplr extends UFunc

    mirrors the columns (left<->right).

  56. object flipud extends UFunc

    mirrors the rows (up down)

  57. package functions

  58. object hsplit extends UFunc

  59. object inv extends UFunc

    Computes the inverse of a given real matrix.

  60. object kron extends UFunc

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

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

  62. object logAndNormalize extends UFunc

  63. object logDiff extends UFunc

  64. object logNormalize extends UFunc

  65. object logdet extends UFunc

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

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

  67. object max extends UFunc

  68. object min extends UFunc

    Computes the minimum.

  69. object minMax extends UFunc

    Minimum and maximum in one traversal, along an axis.

  70. object mpow extends UFunc

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

  71. object norm extends UFunc

    Computes the norm of an object.

  72. object normalize extends UFunc

    Normalizes the argument such that its norm is 1.

  73. package operators

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

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

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

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

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

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

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

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

  82. object pinv extends UFunc with pinvLowPrio

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

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

  84. object product extends UFunc

    Computes the product

  85. object ptp extends UFunc

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

  86. object qr extends UFunc

    QR Factorization

  87. object qrp extends UFunc

    QR Factorization with pivoting

  88. val rand: randomDouble.type

    Alias for randomDouble

  89. object randn extends RandomGeneratorUFunc[Double]

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

  90. object randomDouble extends RandomGeneratorUFunc[Double]

    Gives a random Double.

  91. object randomInt extends RandomGeneratorUFunc[Int]

    Gives a random Int.

  92. object rank extends UFunc

    Computes the rank of a matrix.

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

  94. object reshape extends UFunc

    breeze 7/4/14

  95. object reverse extends UFunc

    Returns a reversed copy of the DenseVector.

  96. object roll extends UFunc

    roll the array

  97. object rot90 extends UFunc

    Rotates a matrix by 90 * k degrees counter clockwise.

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

  99. object scaleAdd extends UFunc

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

  100. object shuffle extends UFunc

    Returns the given DenseVector, Array, or DenseMatrix as a shuffled copy.

  101. object softmax extends UFunc

    Computes the softmax (a.

  102. object split extends UFunc

    split the array

  103. object squaredDistance extends UFunc

    Computes the squared distance between two vectors.

  104. object sum extends UFunc

  105. package support

  106. 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'

  107. object tile extends UFunc

  108. object trace extends UFunc

    Computes the determinant of the given real matrix.

  109. object unique extends UFunc

    roll the array

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

  111. lazy val usingNatives: Boolean

    val to determine if breeze is using natives or f2jblas

  112. object vsplit extends UFunc

  113. object where extends UFunc

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

  114. object zipValues extends UFunc

Inherited from AnyRef

Inherited from Any

Ungrouped