Package

breeze

linalg

Permalink

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
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait Axis extends AnyRef

    Permalink

    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]

    Permalink

    TODO

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

    Permalink

    TODO

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

    Permalink

    Class for classes that are broadcasting their columns.

    Class for classes that are broadcasting their columns. That is denseMatrix(::, *) /= denseVector

    T

    the type of the tensor

    underlying

    the tensor (or equivalent) being broadcasted

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

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

    Permalink

    Class for classes that are broadcasting their rows.

    Class for classes that are broadcasting their rows. That is denseMatrix(*, ::) /= denseVector

    T

    the type of the tensor

    underlying

    the tensor (or equivalent) being broadcasted

  7. class Broadcaster extends AnyRef

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

    Permalink

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

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

    Most implementations based on "Direct Methods for Sparse Linear Systems" by Timothy A. Davis

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

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

    Permalink

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

    Permalink
  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]]

    Permalink
  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]

    Permalink

    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

    Permalink

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

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

    Annotations
    @SerialVersionUID()
  15. final class DenseMatrix[V] extends Matrix[V] with MatrixLike[V, DenseMatrix[V]] with Serializable

    Permalink

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

    A DenseMatrix is a matrix with all elements found in an array. It is column major unless isTranspose is true, It is designed to be fast: Double- (and potentially Float-)valued DenseMatrices can be used with blas, and support operations to that effect.

    Annotations
    @SerialVersionUID()
  16. class DenseVector[V] extends StorageVector[V] with VectorLike[V, DenseVector[V]] with Serializable

    Permalink

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

    A DenseVector is the "obvious" implementation of a Vector, with one twist. The underlying data may have more data than the Vector, represented using an offset into the array (for the 0th element), and a stride that is how far elements are apart from one another.

    The i'th element is at offset + i * stride

    Annotations
    @SerialVersionUID()
  17. class HashVector[E] extends Vector[E] with VectorLike[E, HashVector[E]]

    Permalink

    A HashVector is a sparse vector backed by an OpenAddressHashArray

  18. trait ImmutableNumericOps[+This] extends Any

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

    Permalink
  20. class LapackException extends RuntimeException with LinearAlgebraException

    Permalink
  21. trait LinearAlgebraException extends RuntimeException

    Permalink

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

  22. trait LowPriorityCounter2 extends AnyRef

    Permalink
  23. trait LowPriorityMatrix extends AnyRef

    Permalink
  24. trait LowPrioritySliceMatrix extends AnyRef

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

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

    Permalink
  27. class MatrixEmptyException extends IllegalArgumentException with LinearAlgebraException

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

    Permalink

  29. class MatrixNotSquareException extends IllegalArgumentException with LinearAlgebraException

    Permalink
  30. class MatrixNotSymmetricException extends IllegalArgumentException with LinearAlgebraException

    Permalink
  31. class MatrixSingularException extends RuntimeException with LinearAlgebraException

    Permalink

    Thrown when trying to solve using a singular matrix.

  32. class NotConvergedException extends RuntimeException with LinearAlgebraException

    Permalink

    Exception thrown if a routine has not converged.

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

    Permalink

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

    In some sense, this is the real root of the linalg hierarchy. It provides methods for doing operations on a Tensor-like thing. All methods farm out to some implicit or another. We use this when we don't care about the index into the Tensor, or if we don't really have an index.

  34. class PCA extends AnyRef

    Permalink

    Perform Principal Components Analysis on input data.

    Perform Principal Components Analysis on input data. Handles scaling of the when computing the covariance matrix. Lazily produces the scores (the translation of the data to their new coordinates on the PC axes.

    Input is a matrix that has data points as rows. Variable naming and documentation inspired and used directy from the 'princomp' function in R.

  35. trait QuasiTensor[K, V] extends AnyRef

    Permalink

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

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

  36. trait RandomGeneratorUFunc[T] extends UFunc

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

    Permalink
  38. trait SliceMatrixOps extends AnyRef

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

    Permalink

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

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

    val m = DenseMatrix(...)
    m( (1,2), (3,4), (4,5))

    will give a SliceVector such that apply/update at index 0 will map to m(1,2), index 1 to m(3,4), etc.

  40. trait SliceVectorOps extends AnyRef

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

    Permalink

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

    A vector backed by binary search (with breeze.collection.mutable.SparseArray). There is a parallel array of ints (in 0 until length) and values, sorted by index value. To quickly access all stored values use the following loop:

    var offset = 0
    while( offset < v.activeSize) {
      val index: Int = v.indexAt(offset)
      val value: E = v.valueAt(offset)
    
      offset += 1
    }
    Annotations
    @SerialVersionUID()
  42. trait StorageVector[V] extends Vector[V] with Storage[V]

    Permalink
  43. implicit class String2File extends AnyRef

    Permalink

    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]]

    Permalink

    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]

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

    Permalink

    TODO

  47. trait TransposeLowPrio extends AnyRef

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

    Permalink

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

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

    Permalink

    A VectorBuilder is basically an unsorted Sparse Vector.

    A VectorBuilder is basically an unsorted Sparse Vector. Two parallel arrays are maintained, one of indices, and another of values. The indices are not sorted. Moreover, <B> indices are not unique in the index array. Furthermore, apply(i) and update(i, v) are linear in the number of active values in the array. + and - are linear operations: they just append to the end. Component wise multiply, divide, and dot product are also linear, but require creating a HashVector copy. (TODO: maybe a SparseVector?) In general, these should never be used, except for building, or for doing feature vector type things where you just need a sparse vector with a fast dot product with a "real" vector.

    Annotations
    @SerialVersionUID()
  50. trait VectorConstructors[Vec[T] <: Vector[T]] extends AnyRef

    Permalink

    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]

    Permalink

    Trait for operators and such used in vectors.

  52. trait VectorOps extends AnyRef

    Permalink
  53. trait VectorizedReduceUFunc extends UFunc

    Permalink

    Reducing UFunc that provides implementations for Broadcasted Dense stuff

  54. sealed trait View extends AnyRef

    Permalink

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

  55. trait ZippedValues[V1, V2] extends AnyRef

    Permalink

    Usually used as the return type from zipValues

  56. trait diagLowPrio extends UFunc

    Permalink
  57. trait diagLowPrio2 extends UFunc with diagLowPrio

    Permalink
  58. sealed trait diffLowPrio extends AnyRef

    Permalink
  59. sealed trait mapValuesLowPrio extends AnyRef

    Permalink
  60. trait pinvLowPrio extends AnyRef

    Permalink
  61. sealed trait squaredDistanceLowPrio extends UFunc

    Permalink
  62. sealed trait sumLowPrio extends AnyRef

    Permalink

Value Members

  1. object * extends Broadcaster

    Permalink
  2. object Axis

    Permalink
  3. object BitVector extends BitVectorOps

    Permalink
  4. object BroadcastedColumns extends Serializable

    Permalink
  5. object BroadcastedRows extends Serializable

    Permalink
  6. object Broadcaster

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

    Permalink
  8. object CanPadLeft

    Permalink
  9. object CanPadRight

    Permalink
  10. object Counter extends CounterOps with Serializable

    Permalink
  11. object Counter2 extends LowPriorityCounter2 with Counter2Ops

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

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

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

    Permalink
  15. object LSMR extends SerializableLogging

    Permalink

    Nearly direct port of http://www.mathworks.com/matlabcentral/fileexchange/27183-lsmr--an-iterative-algorithm-for-least-squares-problems (BSD licensed code)

    Nearly direct port of http://www.mathworks.com/matlabcentral/fileexchange/27183-lsmr--an-iterative-algorithm-for-least-squares-problems (BSD licensed code)

    http://web.stanford.edu/group/SOL/software/lsmr/

    The only difference is that they square the regularization factor.

  16. object LU extends UFunc

    Permalink

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

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

    Upon completion, a tuple consisting of a matrix A and an integer array P.

    The upper triangular portion of A resembles U whereas the lower triangular portion of A resembles L up to but not including the diagonal elements of L which are all equal to 1.

    For 0 <= i < M, each element P(i) denotes whether row i of the matrix X was exchanged with row P(i-1) during computation (the offset is caused by the internal call to LAPACK).

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

    Permalink
  18. object NotConvergedException extends Serializable

    Permalink
  19. object NumericOps

    Permalink
  20. object Options

    Permalink

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

    Permalink
  22. object SliceMatrix extends LowPrioritySliceMatrix with SliceMatrixOps

    Permalink
  23. object SliceVector extends SliceVectorOps

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

    Permalink
  25. object Tensor

    Permalink
  26. object Transpose extends TransposeLowPrio with Serializable

    Permalink
  27. object Vector extends VectorConstructors[Vector] with VectorOps

    Permalink
  28. object VectorBuilder extends VectorBuilderOps with Serializable

    Permalink
  29. object View

    Permalink
  30. object accumulate extends UFunc

    Permalink

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

  31. object all extends UFunc

    Permalink

    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

    Permalink

    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

    Permalink

    Returns the key that has maximum value

  34. object argmin extends UFunc

    Permalink
  35. object argsort extends UFunc with LowPriorityArgSort

    Permalink

    Returns a sequence of keys sorted by value

  36. object argtopk extends UFunc with LowPriorityArgTopK

    Permalink

    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

    Permalink

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

  38. object cholesky extends UFunc

    Permalink

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

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

    TODO: For higher dimensionalities, the return value really should be a sparse matrix due to its inherent lower triangular nature.

  39. object clip extends UFunc

    Permalink

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

  40. object cond extends UFunc

    Permalink

    Computes the condition number of the given real matrix.

  41. object convert extends UFunc with MappingUFunc

    Permalink

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

    Provides casting facilities similar to Numpy's "astype" and Julia's "convert". Does casts of collections from one type to another. For example,

    convert(DenseVector(0.1, 1.0, 1.5), Int) == DenseVector(0, 1, 1)
  42. def copy[T](t: T)(implicit canCopy: CanCopy[T]): T

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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

    Permalink
  47. object det extends UFunc

    Permalink

    Computes the determinant of the given real matrix.

  48. object diag extends UFunc with diagLowPrio2

    Permalink

    returns a vector along the diagonal of v.

    returns a vector along the diagonal of v. Requires a square matrix?

  49. object diff extends UFunc with diffLowPrio

    Permalink

    Differences between adjacent elements and discrete derivatives.

  50. object dim extends UFunc

    Permalink

    breeze 7/15/14

  51. object eig extends UFunc

    Permalink

    Eigenvalue decomposition (right eigenvectors)

    Eigenvalue decomposition (right eigenvectors)

    This function returns the real and imaginary parts of the eigenvalues, and the corresponding eigenvectors. For most (?) interesting matrices, the imaginary part of all eigenvalues will be zero (and the corresponding eigenvectors will be real). Any complex eigenvalues will appear in complex-conjugate pairs, and the real and imaginary components of the eigenvector for each pair will be in the corresponding columns of the eigenvector matrix. Take the complex conjugate to find the second eigenvector.

    Based on EVD.java from MTJ 0.9.12

  52. object eigSym extends UFunc

    Permalink

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

  53. object fliplr extends UFunc

    Permalink

    mirrors the columns (left<->right).

  54. object flipud extends UFunc

    Permalink

    mirrors the rows (up down)

  55. package functions

    Permalink
  56. object hsplit extends UFunc

    Permalink
  57. object inv extends UFunc

    Permalink

    Computes the inverse of a given real matrix.

    Computes the inverse of a given real matrix. In general, you should avoid using this metho in combination with *. Instead, wherever you might want to write inv(A) * B, you should write A \ B.

  58. object isClose extends UFunc

    Permalink

    Created by dlwh on 11/1/15.

  59. object kron extends UFunc

    Permalink

    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]

    Permalink

    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

    Permalink
  62. object logDiff extends UFunc

    Permalink
  63. object logNormalize extends UFunc

    Permalink
  64. object logdet extends UFunc

    Permalink

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

    Computes the log of the determinant of the given real matrix. The value returned is (sign of determinant, log of determinant). This method can be more accurate than just using breeze.linalg.det, if det is very small.

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

    Permalink

    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

    Permalink
  67. object mapValues extends UFunc with mapValuesLowPrio

    Permalink

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

  68. object max extends UFunc

    Permalink
  69. object min extends UFunc

    Permalink

    Computes the minimum.

  70. object minMax extends UFunc

    Permalink

    Minimum and maximum in one traversal, along an axis.

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

    Permalink
  72. object mpow extends UFunc

    Permalink

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

    Raises m to the exp'th power via eigenvalue decomposition. Currently requires that m's eigenvalues are real.

  73. object norm extends UFunc

    Permalink

    Computes the norm of an object.

    Computes the norm of an object. Many tensor objects have a norm implementation implicit, which is what this calls.

  74. object normalize extends UFunc

    Permalink

    Normalizes the argument such that its norm is 1.0 (with respect to the argument n).

    Normalizes the argument such that its norm is 1.0 (with respect to the argument n). Returns value if value's norm is 0.

  75. package operators

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

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

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

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

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

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

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

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

    Permalink
  84. object pinv extends UFunc with pinvLowPrio

    Permalink

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

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

    The pseudo inverse is nothing but the least-squares solution to AX=B, hence: d/dX 1/2 (AX-B)2 = AT (AX-B) Solving AT (AX-B) = 0 for X yields AT AX = A^T B

    > X

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

    Permalink

    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

    Permalink

    Computes the product

  87. object ptp extends UFunc

    Permalink

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

  88. object qr extends UFunc

    Permalink

    QR Factorization

    QR Factorization

    Previous versions of Breeze had qr(m, skipQ), where we could skip the computation in making Q if we didn't want it. That is now supplanted by qr.justR(m)

    Supports complete and reduced mode of factorization of matrix A with dimensions (m, n). If mode is complete matrices Q and R have dimensions (m, m), (m, n). If mode is reduced matrices Q and R have dimensions (m, k), (k, n) with k = min(m, n).

    Complete QR factorization can be called by qr(A).

    Reduced QR factorization can be called by qr.reduced(A). If computation of Q is unnecessary, it can be skipped by qr.reduced.justR(A)

    returns

    (Q, R) Q - A matrix with orthonormal columns R - The upper-triangular matrix

  89. object qrp extends UFunc

    Permalink

    QR Factorization with pivoting

    QR Factorization with pivoting

    input: A m x n matrix output: (Q,R,P,pvt) where AP = QR Q: m x m R: m x n P: n x n : permutation matrix (P(pvt(i),i) = 1) pvt : pivot indices

  90. val rand: randomDouble.type

    Permalink

    Alias for randomDouble

  91. object randn extends RandomGeneratorUFunc[Double]

    Permalink

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

    Gives Gaussian-distributed random Double(s) + randn()... returns a Gaussian random variable with mean 0, variance 1 + randn( n: Int )... returns a DenseVector with n randn's + randn( (n1: Int, n2: Int) )... returns an n1 x n2 DenseMatrix with randn's

  92. object randomDouble extends RandomGeneratorUFunc[Double]

    Permalink

    Gives a random Double.

    Gives a random Double. + randomDouble()... returns a random double, in [0, 1] + randomDouble( n: Int )... returns a DenseVector with n random doubles, in [0, 1] + randomDouble( n: Int, (r1: Double, r2: Double) )... returns a DenseVector with n random doubles, in [r1, r2] + randomDouble( (n1: Int, n2: Int) )... returns an n1 x n2 DenseMatrix with n random doubles, in [0, 1] + randomDouble( (n1: Int, n2: Int), (r1: Double, r2: Double) )... returns an n1 x n2 DenseMatrix with n random doubles, in [r1, r2]

  93. object randomInt extends RandomGeneratorUFunc[Int]

    Permalink

    Gives a random Int.

    Gives a random Int. + randomInt()... returns a random Int, in [0, 1] + randomInt( n: Int )... returns a DenseVector with n random Ints, in [0, 1] + randomInt( n: Int, (r1: Int, r2: Int) )... returns a DenseVector with n random Ints, in [r1, r2) + randomInt( (n1: Int, n2: Int) )... returns an n1 x n2 DenseMatrix with n random Ints, in [0, 1] + randomInt( (n1: Int, n2: Int), (r1: Int, r2: Int) )... returns an n1 x n2 DenseMatrix with n random Ints, in [r1, r2)

  94. object rank extends UFunc

    Permalink

    Computes the rank of a matrix.

    Computes the rank of a matrix.

    The rank of the matrix is computed using the SVD method. The singular values of the SVD which are greater than a specified tolerance are counted.

    returns

    the rank of the matrix (number of singular values)

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

    Permalink

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

  96. object reshape extends UFunc

    Permalink

    breeze 7/4/14

  97. object reverse extends UFunc

    Permalink

    Returns a reversed copy of the DenseVector.

  98. object roll extends UFunc

    Permalink

    roll the array

  99. object rot90 extends UFunc

    Permalink

    Rotates a matrix by 90 * k degrees counter clockwise.

    Rotates a matrix by 90 * k degrees counter clockwise. if k is not specified, it defaults to 1.

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

    Permalink

    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

    Permalink

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

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

    This method is designed to eventually replace breeze.linalg.axpy

  102. object shuffle extends UFunc

    Permalink

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

    Return the given DenseVector, Array, or DenseMatrix as a shuffled copy by using Fisher-Yates shuffle. Additionally, can return the given Array as a shuffled copy with the corresponding shuffle index information, or return the given Array as a shuffled copy using the inverse of the given shuffle index information, reversing the shuffle.

  103. object softmax extends UFunc

    Permalink

    Computes the softmax (a.k.a.

    Computes the softmax (a.k.a. logSum) of an object. Softmax is defined as \log \sum_i \exp(x(i)), but implemented in a more numerically stable way. Softmax is so-called because it is a differentiable function that tends to look quite a lot like max. Consider log(exp(30) + exp(10)). That's basically 30. We use softmax a lot in machine learning.

  104. object split extends UFunc

    Permalink

    split the array

  105. object squaredDistance extends UFunc with squaredDistanceLowPrio

    Permalink

    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]

    Permalink

    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]

    Permalink

    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

    Permalink
  109. package support

    Permalink

    TODO

  110. object svd extends UFunc

    Permalink

    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

    Permalink

  112. object trace extends UFunc

    Permalink

    Computes the determinant of the given real matrix.

  113. object unique extends UFunc

    Permalink

    deduplicates the array

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

    Permalink

    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

    Permalink

    val to determine if breeze is using natives or f2jblas

  116. object vsplit extends UFunc

    Permalink
  117. object where extends UFunc

    Permalink

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

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

    where(cond, a, b) returns the value from a if cond is non-zero, and the value from b otherwise

  118. object zipValues extends UFunc

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped