com.twitter.scalding.mathematics

Matrix2

sealed trait Matrix2[R, C, V] extends Serializable

This is the future Matrix API. The old one will be removed in scalding 0.10.0 (or 1.0.0).

Create Matrix2 instances with methods in the Matrix2 object. Note that this code optimizes the order in which it evaluates matrices, and replaces equivalent terms to avoid recomputation. Also, this code puts the parenthesis in the optimal place in terms of size according to the sizeHints. For instance: (A*B)*C == A*(B*C) but if B is a 10 x 106 matrix, and C is 106 x 100, it is better to do the B*C product first in order to avoid storing as much intermediate output.

NOTE THIS REQUIREMENT: for each formula, you can only have one Ring[V] in scope. If you evaluate part of the formula with one Ring, and another part with another, you must go through a TypedPipe (call toTypedPipe) or the result may not be correct.

Linear Supertypes
Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Matrix2
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. implicit abstract def colOrd: Ordering[C]

  2. abstract def negate(implicit g: Group[V]): Matrix2[R, C, V]

  3. implicit abstract def rowOrd: Ordering[R]

  4. abstract def toTypedPipe: TypedPipe[(R, C, V)]

    Convert the current Matrix to a TypedPipe

  5. abstract def transpose: Matrix2[C, R, V]

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def #*#(that: Matrix2[R, C, V])(implicit ring: Ring[V]): Matrix2[R, C, V]

    Represents the pointwise, or Hadamard, product of two matrices.

  5. def *(that: Scalar2[V])(implicit ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, C, V]

  6. def *[C2](that: Matrix2[C, C2, V])(implicit ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, C2, V]

  7. def +(that: Matrix2[R, C, V])(implicit mon: Monoid[V]): Matrix2[R, C, V]

  8. def -(that: Matrix2[R, C, V])(implicit g: Group[V]): Matrix2[R, C, V]

  9. def /(that: Scalar2[V])(implicit field: algebird.Field[V]): Matrix2[R, C, V]

  10. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  12. def ^(power: Int)(implicit ev: =:=[R, C], ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, R, V]

    equivalent to multiplying this matrix by itself, power times

  13. def asCol[C2](c2: C2)(implicit ev: =:=[C, Unit], colOrd: Ordering[C2]): Matrix2[R, C2, V]

  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def asRow[R2](r2: R2)(implicit ev: =:=[R, Unit], rowOrd: Ordering[R2]): Matrix2[R2, C, V]

    Consider this Matrix as the r2 row of a matrix.

    Consider this Matrix as the r2 row of a matrix. The current matrix must be a row, which is to say, its row type must be Unit.

  16. def binarizeAs[NewValT](implicit mon: Monoid[V], ring: Ring[NewValT]): Matrix2[R, C, NewValT]

  17. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def getColumn(index: C): Matrix2[R, Unit, V]

  23. def getRow(index: R): Matrix2[Unit, C, V]

  24. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  25. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  26. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  29. def optimizedSelf: Matrix2[R, C, V]

    Users should never need this.

    Users should never need this. This is the current Matrix2, but in most optimized form. Usually, you will just do matrix operations until you eventually call write or toTypedPipe

  30. def propagate[C2, VecV](vec: Matrix2[C, C2, VecV])(implicit ev: =:=[V, Boolean], mon: Monoid[VecV], mj: MatrixJoiner2): Matrix2[R, C2, VecV]

    the result is the same as considering everything on the this to be like a 1 value so we just sum, using only a monoid on VecV, where this Matrix has the value true.

    the result is the same as considering everything on the this to be like a 1 value so we just sum, using only a monoid on VecV, where this Matrix has the value true. This is useful for graph propagation of monoids, such as sketchs like HyperLogLog, BloomFilters or CountMinSketch. TODO This is a special kind of product that could be optimized like Product is

  31. def propagateRow[C2](mat: Matrix2[C, C2, Boolean])(implicit ev: =:=[R, Unit], mon: Monoid[V], mj: MatrixJoiner2): Matrix2[Unit, C2, V]

  32. def rowL1Normalize(implicit num: Numeric[V], mj: MatrixJoiner2): Matrix2[R, C, Double]

    Row L1 normalization After this operation, the sum(|x|) alone each row will be 1.

  33. def rowL2Normalize(implicit num: Numeric[V], mj: MatrixJoiner2): Matrix2[R, C, Double]

    Row L2 normalization After this operation, the sum(|x|^2) along each row will be 1.

  34. val sizeHint: SizeHint

  35. def sumColVectors(implicit ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, Unit, V]

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def toString(): String

    Definition Classes
    AnyRef → Any
  38. def trace(implicit mon: Monoid[V], ev: =:=[R, C]): Scalar2[V]

  39. def unary_-(implicit g: Group[V]): Matrix2[R, C, V]

  40. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. def write(sink: TypedSink[(R, C, V)])(implicit fd: FlowDef, m: Mode): Matrix2[R, C, V]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped